%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF1E6','primaryTextColor':'#1a1a1a','primaryBorderColor':'#F77020','lineColor':'#F77020','secondaryColor':'#FFE4D1','tertiaryColor':'#ffffff','clusterBkg':'#FFF8F2','clusterBorder':'#F77020','fontFamily':'Inter','fontSize':'14px'},'flowchart':{'curve':'basis','htmlLabels':true}}}%%
flowchart TD
classDef trust fill:#F77020,stroke:#c4541a,stroke-width:2px,color:#ffffff
classDef action fill:#FFF1E6,stroke:#F77020,stroke-width:2px,color:#1a1a1a
classDef ai fill:#FFE4D1,stroke:#F77020,stroke-width:2px,color:#7a3a10
classDef user fill:#ffffff,stroke:#F77020,stroke-width:2px,color:#1a1a1a
classDef success fill:#F77020,stroke:#9c4214,stroke-width:3px,color:#ffffff
classDef decision fill:#ffffff,stroke:#F77020,stroke-width:2px,stroke-dasharray:4 2,color:#1a1a1a
Start([Application Submitted]) --> Stage1[STAGE 1: Applied]
Stage1 --> Email1[Auto-Email: Application Received]
Email1 --> AIQueue[Queue for AI Engine]
AIQueue --> Stage2[STAGE 2: AI Screened]
Stage2 --> AIParse[AI Parses Resume + Answers]
AIParse --> AISkill[Skill Extraction & Tagging]
AISkill --> AIExp[Experience Scoring]
AIExp --> AIEdu[Education Verification]
AIEdu --> AIMatch[Match Against JD]
AIMatch --> AIScore[Compute Weighted Score]
AIScore --> ScoreCheck{Score >= Threshold?}
ScoreCheck -- No --> Reject1[Reject & Notify]
Reject1 --> TalentPool[Talent Pool Archive]
ScoreCheck -- Yes --> Stage3[STAGE 3: Shortlisted]
Stage3 --> Kanban[Appears on Recruiter Kanban]
Kanban --> Email2[Auto-Email: Shortlisted]
Email2 --> Stage4[STAGE 4: HR Review]
Stage4 --> HRView[HR Reviews Profile + AI Summary]
HRView --> HRDecide{HR Decision?}
HRDecide -- Reject --> Reject2[Reject & Notify]
Reject2 --> TalentPool
HRDecide -- Hold --> Hold[On Hold — Future Role]
Hold --> TalentPool
HRDecide -- Advance --> Stage5[STAGE 5: Interview]
Stage5 --> Schedule[Schedule Interview]
Schedule --> Calendar[Send Calendar Invites]
Calendar --> Round1[Round 1: Technical]
Round1 --> Feedback1[Capture Panel Feedback]
Feedback1 --> Round2{Additional Rounds?}
Round2 -- Yes --> RoundN[Round 2..N: Manager / Cultural]
RoundN --> FeedbackN[Capture Feedback]
FeedbackN --> FinalDecide{Final Hire Decision?}
Round2 -- No --> FinalDecide
FinalDecide -- Reject --> Reject3[Reject & Notify]
Reject3 --> TalentPool
FinalDecide -- Hire --> Stage6[STAGE 6: Offer]
Stage6 --> Generate[Generate Offer Letter]
Generate --> Send[Send Offer to Candidate]
Send --> Accept{Candidate Accepts?}
Accept -- No --> Decline[Decline Recorded]
Decline --> TalentPool
Accept -- Yes --> ESign[E-Sign Offer]
ESign --> Stage7[STAGE 7: Onboarding]
Stage7 --> DocCollect[Document Collection]
DocCollect --> Compliance[Compliance & Background Check]
Compliance --> ITProv[IT & Workspace Provisioning]
ITProv --> Welcome[Welcome Kit + Day-1 Plan]
Welcome --> Hired([STAGE 8: Hired & Active])
TalentPool --> FuturePool[Available for Future Roles]
FuturePool --> ReEngage[Re-engage on New Match]
class Start,Schedule,Calendar,Round1,RoundN,DocCollect,Compliance,ITProv,Welcome user
class Stage1,Stage3,Stage4,Stage5,Stage6,Stage7,Email1,Email2,Generate,Send,ESign,HRView,Feedback1,FeedbackN,Hold,FuturePool,ReEngage action
class Stage2,AIQueue,AIParse,AISkill,AIExp,AIEdu,AIMatch,AIScore ai
class ScoreCheck,HRDecide,Round2,FinalDecide,Accept decision
class Reject1,Reject2,Reject3,Decline,TalentPool trust
class Hired success