")
for member in team:
name = html.escape(str(member.get("employee_name", "UNKNOWN")).upper())
role = html.escape(str(member.get("role", "UNASSIGNED")).upper())
# --- SKILL GAPS ---
skills_html = ""
gaps_list = member.get("skills_gaps", [])
if gaps_list:
skill_tags = ""
for gap_data in gaps_list:
skill_name = html.escape(gap_data.get("skill", "GENERIC"))
skill_tags += f"""
"""
skills_html = f"""
⚠ SKILL GAP IDENTIFIED
{skill_tags}
"""
else:
skills_html = """
✔ SKILLS VERIFIED. NO GAPS.
"""
# --- TRAINING PLAN ---
training_html = ""
for plan in member.get("training_plan", []):
title = html.escape(plan.get("title", "Training Module"))
cost = float(plan.get("cost", 0))
hours = float(plan.get("duration_hours", 0))
# Investment Level Logic
inv_class = "inv-low"
if cost > 50: inv_class = "inv-med"
if cost > 200: inv_class = "inv-high"
training_html += f"""
{title}
COST: ${cost} | DURATION: {hours} HRS
"""
if not training_html and gaps_list:
training_html = "
PENDING: CURRICULUM GENERATION REQUIRED
"
elif not training_html:
training_html = "
NO ACTION REQUIRED
"
# Assemble Card
# Create a faux Employee ID
emp_hash = f"EMP-{hash(name) % 99999:05d}"
card_html = f"""
{name}
{emp_hash}
{skills_html}
RECOMMENDED TRAINING
{training_html}
"""
html_parts.append(card_html)
html_parts.append("