feat: implementation des dossiers candidats PDF, gestion des entretiens et optimisation de l'analyse IA

This commit is contained in:
jeremy bayse
2026-04-19 15:35:16 +02:00
parent 4017e3d9c5
commit f3d630d741
27 changed files with 2550 additions and 741 deletions

View File

@@ -21,10 +21,29 @@ const props = defineProps({
const page = usePage();
const flashSuccess = computed(() => page.props.flash?.success);
const activeTab = ref('overview');
const positionForm = useForm({
job_position_id: props.candidate.job_position_id || ''
});
const showEditDetailsModal = ref(false);
const detailsForm = useForm({
name: props.candidate.user.name,
email: props.candidate.user.email,
phone: props.candidate.phone || '',
linkedin_url: props.candidate.linkedin_url || '',
});
const updateDetails = () => {
detailsForm.put(route('admin.candidates.update', props.candidate.id), {
preserveScroll: true,
onSuccess: () => {
showEditDetailsModal.value = false;
},
});
};
const updatePosition = () => {
positionForm.patch(route('admin.candidates.update-position', props.candidate.id), {
preserveScroll: true,
@@ -53,8 +72,20 @@ const docForm = useForm({
_method: 'PUT' // For file upload via PUT in Laravel
});
const rawInterviewDetails = props.candidate.interview_details || {};
const notesForm = useForm({
notes: props.candidate.notes || ''
notes: props.candidate.notes || '',
interview_details: {
questions: rawInterviewDetails.questions || [],
appreciation: rawInterviewDetails.appreciation || 0,
soft_skills: rawInterviewDetails.soft_skills || [
{ name: 'Communication & Pédagogie', score: 0 },
{ name: 'Esprit d\'équipe & Collaboration', score: 0 },
{ name: 'Résolution de problèmes & Logique', score: 0 },
{ name: 'Adaptabilité & Résilience', score: 0 },
{ name: 'Autonomie & Proactivité', score: 0 }
]
}
});
const scoreForm = useForm({
@@ -114,11 +145,6 @@ const updateDocuments = () => {
});
};
const saveNotes = () => {
notesForm.patch(route('admin.candidates.update-notes', props.candidate.id), {
preserveScroll: true,
});
};
const saveScores = () => {
scoreForm.patch(route('admin.candidates.update-scores', props.candidate.id), {
@@ -150,12 +176,21 @@ const bestTestScore = computed(() => {
return Math.max(...finished.map(a => (a.score / a.max_score) * 20));
});
// Calculated Soft Skills average
const softSkillsScore = computed(() => {
const skills = notesForm.interview_details.soft_skills || [];
if (skills.length === 0) return 0;
const total = skills.reduce((acc, s) => acc + (parseFloat(s.score) || 0), 0);
return Number((total / skills.length).toFixed(1));
});
// Données radar normalisées en % (chaque axe / son max)
const radarData = computed(() => ([
Math.round((parseFloat(scoreForm.cv_score) / 20) * 100),
Math.round((parseFloat(scoreForm.motivation_score) / 10) * 100),
Math.round((parseFloat(scoreForm.interview_score) / 30) * 100),
Math.round((bestTestScore.value / 20) * 100),
Math.round((softSkillsScore.value / 10) * 100), // Max is 10 for avg soft skills
]));
const buildRadarChart = () => {
@@ -172,7 +207,7 @@ const buildRadarChart = () => {
radarChartInstance = new Chart(radarCanvasRef.value, {
type: 'radar',
data: {
labels: ['Analyse CV', 'Lettre Motiv.', 'Entretien', 'Test Technique'],
labels: ['Analyse CV', 'Lettre Motiv.', 'Entretien', 'Test Technique', 'Soft Skills'],
datasets: [{
label: 'Profil Candidat (%)',
data: radarData.value,
@@ -239,7 +274,7 @@ onUnmounted(() => {
// Mise à jour du radar quand les scores changent
watch(
() => [scoreForm.cv_score, scoreForm.motivation_score, scoreForm.interview_score, bestTestScore.value],
() => [scoreForm.cv_score, scoreForm.motivation_score, scoreForm.interview_score, bestTestScore.value, softSkillsScore.value],
() => {
if (radarChartInstance) {
radarChartInstance.data.datasets[0].data = radarData.value;
@@ -247,6 +282,13 @@ watch(
}
}
);
// Ré-initialisation du radar lors du switch d'onglet
watch(activeTab, (newTab) => {
if (newTab === 'overview') {
nextTick(() => buildRadarChart());
}
});
// ──────────────────────────────────────────────────────────────────────────────
const aiAnalysis = ref(props.candidate.ai_analysis || null);
@@ -254,6 +296,43 @@ const isAnalyzing = ref(false);
const selectedProvider = ref(props.ai_config?.default || 'ollama');
const forceAnalysis = ref(false);
// ─── Interview Scoring Logic ───────────────────────────────────────────────────
const calculatedInterviewScore = computed(() => {
const qScore = (notesForm.interview_details.questions || []).reduce((acc, q) => acc + (parseFloat(q.score) || 0), 0);
const appScore = parseFloat(notesForm.interview_details.appreciation) || 0;
return Math.min(30, qScore + appScore);
});
// Auto-populate questions from AI analysis if empty
watch(aiAnalysis, (newVal) => {
if (newVal && newVal.questions_entretien_suggerees && (!notesForm.interview_details.questions || notesForm.interview_details.questions.length === 0)) {
notesForm.interview_details.questions = newVal.questions_entretien_suggerees.map(q => ({
question: q,
score: 0,
comment: ''
}));
}
}, { immediate: true });
// Sync with global score form and auto-save logic
watch(calculatedInterviewScore, (newVal) => {
scoreForm.interview_score = newVal;
});
const saveNotes = () => {
notesForm.transform((data) => ({
...data,
interview_score: calculatedInterviewScore.value
})).patch(route('admin.candidates.update-notes', props.candidate.id), {
preserveScroll: true,
onSuccess: () => {
// Update raw candidate data to reflect the new score in computed fields if necessary
props.candidate.interview_score = calculatedInterviewScore.value;
props.candidate.interview_details = notesForm.interview_details;
}
});
};
// Error Modal state
const showErrorModal = ref(false);
const modalErrorMessage = ref("");
@@ -310,156 +389,161 @@ const runAI = async () => {
</div>
</div>
<div class="grid grid-cols-1 xl:grid-cols-3 gap-8">
<!-- Sidebar: Profile & Docs -->
<div class="space-y-8">
<!-- Profile Card -->
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 overflow-hidden">
<div class="h-24 bg-gradient-to-r from-indigo-500 to-purple-600"></div>
<div class="px-6 pb-6 text-center -mt-12 relative">
<div class="absolute right-6 top-16 right-0 text-center w-full max-w-[50px] ml-auto mr-auto sm:right-6 sm:top-14 sm:w-auto">
<button
@click="toggleSelection"
class="flex flex-col items-center gap-1 group focus:outline-none"
:title="candidate.is_selected ? 'Retirer des retenus' : 'Marquer pour entretien'"
>
<div
class="p-2 rounded-full transition-all"
:class="candidate.is_selected ? 'bg-amber-100 text-amber-500 shadow-sm' : 'bg-slate-100 text-slate-400 group-hover:bg-amber-50 group-hover:text-amber-400'"
<div class="space-y-8">
<!-- Hero Header (En-tête de Profil) -->
<div class="bg-white rounded-3xl shadow-sm border border-anthracite/5 overflow-visible z-10 sticky top-0 md:top-4">
<div class="h-16 md:h-20 bg-primary rounded-t-3xl relative overflow-hidden flex items-center px-8 relative">
<div class="absolute inset-0 bg-[url('https://www.mediterranee-agglo.fr/sites/default/files/images/banniere-CABM-3.jpg')] opacity-10 bg-cover bg-center mix-blend-overlay"></div>
<!-- Actions globales alignées à droite et stylées Or du midi -->
<div class="ml-auto relative z-10 flex flex-wrap items-center justify-end gap-3 pt-2">
<a :href="route('admin.candidates.export-dossier', candidate.id)" class="px-4 py-1.5 bg-[#e0b04c] text-[#3a2800] rounded-xl text-[10px] uppercase font-black font-subtitle flex items-center gap-2 hover:bg-[#e0b04c]/80 transition-all shadow-lg active:scale-95" title="Télécharger le rapport de synthèse">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
Rapport (PDF)
</a>
<a :href="route('admin.candidates.export-zip', candidate.id)" class="px-4 py-1.5 bg-[#e0b04c] text-[#3a2800] rounded-xl text-[10px] uppercase font-black font-subtitle flex items-center gap-2 hover:bg-[#e0b04c]/80 transition-all shadow-lg active:scale-95" title="Télécharger le dossier complet avec originaux">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" />
</svg>
Dossier Complet (ZIP)
</a>
<SecondaryButton @click="resetPassword" class="!px-3 !py-1 text-[10px] uppercase font-bold tracking-widest !bg-white/10 !border-none !text-white hover:!bg-white/20">Réinitialiser MDP</SecondaryButton>
<DangerButton @click="deleteCandidate" class="!px-3 !py-1 text-[10px] uppercase font-bold tracking-widest !bg-accent hover:!bg-accent/80 !border-none">Supprimer</DangerButton>
</div>
</div>
<div class="px-6 md:px-8 pb-6 flex flex-col md:flex-row gap-6 relative">
<!-- Avatar flottant -->
<div class="w-24 h-24 md:w-32 md:h-32 bg-white rounded-3xl shadow-xl border-4 border-white flex items-center justify-center text-4xl md:text-5xl font-serif font-black text-primary -mt-12 md:-mt-16 relative z-10 shrink-0">
{{ candidate.user.name.charAt(0) }}
</div>
<!-- Infos Principales -->
<div class="flex-1 pt-2 md:pt-4 flex flex-col md:flex-row justify-between gap-6">
<div class="space-y-2">
<div class="flex items-center gap-3">
<h3 class="text-2xl md:text-3xl font-serif font-black text-primary">{{ candidate.user.name }}</h3>
<button @click="showEditDetailsModal = true" class="text-anthracite/20 hover:text-highlight transition-colors bg-neutral/50 p-1.5 rounded-lg">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
</svg>
</button>
<button
@click="toggleSelection"
class="flex items-center gap-1.5 px-3 py-1 rounded-full text-[10px] font-subtitle uppercase tracking-[0.2em] transition-all ml-2 border"
:class="candidate.is_selected ? 'bg-highlight/10 text-[#3a2800] border-highlight/30' : 'bg-neutral text-anthracite/40 border-anthracite/5 hover:border-highlight hover:text-highlight'"
:title="candidate.is_selected ? 'Retirer des retenus' : 'Marquer pour entretien'"
>
<svg v-if="candidate.is_selected" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
<svg v-if="candidate.is_selected" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" viewBox="0 0 20 20" fill="currentColor">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
</svg>
</div>
<span class="text-[9px] font-black uppercase tracking-widest hidden sm:block" :class="candidate.is_selected ? 'text-amber-500' : 'text-slate-400 group-hover:text-amber-400'">Retenu</span>
</button>
</div>
<div class="w-24 h-24 bg-white dark:bg-slate-900 rounded-2xl shadow-xl border-4 border-white dark:border-slate-800 flex items-center justify-center text-4xl font-black text-indigo-600 mx-auto mb-4">
{{ candidate.user.name.charAt(0) }}
</div>
<h3 class="text-xl font-bold">{{ candidate.user.name }}</h3>
<p class="text-slate-500 text-sm mb-4">{{ candidate.user.email }}</p>
<div class="mb-6">
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2 block text-left">Poste Cible</label>
<select
v-model="positionForm.job_position_id"
@change="updatePosition"
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-xl py-2 px-3 text-xs font-bold text-indigo-600 focus:ring-2 focus:ring-indigo-500/20 transition-all cursor-pointer"
>
<option value="">Non assigné</option>
<option v-for="pos in jobPositions" :key="pos.id" :value="pos.id">
{{ pos.title }}
</option>
</select>
</div>
<!-- Structure de rattachement (Super Admin only) -->
<div v-if="page.props.auth.user.role === 'super_admin'" class="mb-6">
<label class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2 block text-left">Structure de Rattachement</label>
<select
v-model="tenantForm.tenant_id"
@change="updateTenant"
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-xl py-2 px-3 text-xs font-bold text-emerald-600 focus:ring-2 focus:ring-emerald-500/20 transition-all cursor-pointer"
>
<option value="">Aucune structure</option>
<option v-for="tenant in tenants" :key="tenant.id" :value="tenant.id">
{{ tenant.name }}
</option>
</select>
<p class="text-[9px] text-slate-400 mt-1 italic text-left">Note: modifie aussi le rattachement de l'utilisateur.</p>
</div>
<div class="flex flex-col gap-3 text-left">
<div class="flex items-center gap-3 p-3 bg-slate-50 dark:bg-slate-900 rounded-xl">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
</svg>
<span class="text-sm font-medium">{{ candidate.phone || 'Non renseigné' }}</span>
{{ candidate.is_selected ? 'Retenu' : 'Sélectionner' }}
</button>
</div>
<div class="flex flex-wrap items-center gap-4 text-xs font-medium text-anthracite/60 font-subtitle">
<span class="flex items-center gap-1.5">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 opacity-50" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
{{ candidate.user.email }}
</span>
<span v-if="candidate.phone" class="flex items-center gap-1.5 relative before:content-['•'] before:absolute before:-left-3 before:text-anthracite/20 ml-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 opacity-50" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" /></svg>
{{ candidate.phone }}
</span>
<a v-if="candidate.linkedin_url" :href="candidate.linkedin_url" target="_blank" class="flex items-center gap-1.5 hover:text-primary transition-colors relative before:content-['•'] before:absolute before:-left-3 before:text-anthracite/20 ml-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 opacity-50 m-0.5" fill="currentColor" viewBox="0 0 24 24"><path d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/></svg>
LinkedIn
</a>
</div>
</div>
<!-- Sélecteurs (Poste & Structure) -->
<div class="flex flex-col sm:flex-row gap-4 lg:min-w-[400px]">
<div class="flex-1 space-y-1.5">
<label class="text-[9px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Fiche de Poste ciblée</label>
<select
v-model="positionForm.job_position_id"
@change="updatePosition"
class="w-full bg-neutral/50 border border-anthracite/5 rounded-xl py-2 px-3 text-xs font-bold text-primary focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all cursor-pointer shadow-sm"
>
<option value="">Non assigné (Candidature spontanée)</option>
<option v-for="pos in jobPositions" :key="pos.id" :value="pos.id">
{{ pos.title }}
</option>
</select>
</div>
<div v-if="page.props.auth.user.role === 'super_admin'" class="flex-1 space-y-1.5">
<label class="text-[9px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Structure (Tenant)</label>
<select
v-model="tenantForm.tenant_id"
@change="updateTenant"
class="w-full bg-neutral/50 border border-anthracite/5 rounded-xl py-2 px-3 text-xs font-bold text-primary focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all cursor-pointer shadow-sm"
>
<option value="">Aucune structure</option>
<option v-for="tenant in tenants" :key="tenant.id" :value="tenant.id">
{{ tenant.name }}
</option>
</select>
</div>
<a v-if="candidate.linkedin_url" :href="candidate.linkedin_url" target="_blank" class="flex items-center gap-3 p-3 bg-slate-50 dark:bg-slate-900 rounded-xl hover:text-indigo-600 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-slate-400" fill="currentColor" viewBox="0 0 24 24">
<path d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/>
</svg>
<span class="text-sm font-medium">LinkedIn Profile</span>
</a>
</div>
</div>
<div class="px-6 py-4 bg-slate-50 dark:bg-slate-900 border-t border-slate-200 dark:border-slate-700 flex justify-between items-center gap-2">
<SecondaryButton @click="resetPassword" class="!px-3 !py-1 text-[10px] uppercase font-bold tracking-widest">Réinitialiser MDP</SecondaryButton>
<DangerButton @click="deleteCandidate" class="!px-3 !py-1 text-[10px] uppercase font-bold tracking-widest">Supprimer Compte</DangerButton>
</div>
</div>
</div> <!-- Fin Hero Header (387) -->
<!-- Documents Card -->
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 p-6">
<h4 class="font-bold mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-indigo-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
</svg>
Documents joints
</h4>
<div class="space-y-3">
<!-- Tabs Navigation -->
<div class="border-t border-anthracite/5 px-6 md:px-8 bg-neutral/30 rounded-b-3xl">
<div class="flex items-center gap-8 overflow-x-auto no-scrollbar">
<button
v-for="doc in candidate.documents"
:key="doc.id"
@click="openPreview(doc)"
class="w-full flex items-center justify-between p-4 bg-slate-100 dark:bg-slate-900 rounded-xl hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors group"
@click="activeTab = 'overview'"
class="px-4 py-4 text-xs font-subtitle uppercase tracking-widest transition-all relative whitespace-nowrap"
:class="activeTab === 'overview' ? 'text-primary font-black' : 'text-anthracite/40 hover:text-primary/70 font-bold'"
>
<div class="flex items-center gap-3">
<div class="p-2 bg-white dark:bg-slate-800 rounded-lg group-hover:bg-indigo-500 group-hover:text-white transition-colors">
<svg v-if="doc.type === 'cv'" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
</div>
<div class="text-left">
<div class="text-sm font-bold uppercase tracking-tight">{{ doc.type }}</div>
<div class="text-[10px] text-slate-500 truncate max-w-[150px]">{{ doc.original_name }}</div>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-slate-400 group-hover:translate-x-1 transition-transform" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
Vue d'ensemble
<div v-if="activeTab === 'overview'" class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-t-full"></div>
</button>
<button
@click="activeTab = 'ai_analysis'"
class="px-4 py-4 text-xs font-subtitle uppercase tracking-widest transition-all relative whitespace-nowrap"
:class="activeTab === 'ai_analysis' ? 'text-primary font-black' : 'text-anthracite/40 hover:text-primary/70 font-bold'"
>
Analyse IA
<div v-if="activeTab === 'ai_analysis'" class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-t-full"></div>
</button>
<button
@click="activeTab = 'interview'"
class="px-4 py-4 text-xs font-subtitle uppercase tracking-widest transition-all relative whitespace-nowrap"
:class="activeTab === 'interview' ? 'text-primary font-black' : 'text-anthracite/40 hover:text-primary/70 font-bold'"
>
Évaluation & Entretien
<div v-if="activeTab === 'interview'" class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-t-full"></div>
</button>
<button
@click="activeTab = 'documents'"
class="px-4 py-4 text-xs font-subtitle uppercase tracking-widest transition-all relative whitespace-nowrap flex items-center gap-2"
:class="activeTab === 'documents' ? 'text-primary font-black' : 'text-anthracite/40 hover:text-primary/70 font-bold'"
>
Documents
<span class="px-1.5 py-0.5 bg-anthracite/5 rounded text-[9px] min-w-[20px] text-center" :class="{ 'bg-primary/10 text-primary': activeTab === 'documents' }">{{ candidate.documents?.length || 0 }}</span>
<div v-if="activeTab === 'documents'" class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-t-full"></div>
</button>
<button
@click="activeTab = 'tests'"
class="px-4 py-4 text-xs font-subtitle uppercase tracking-widest transition-all relative whitespace-nowrap"
:class="activeTab === 'tests' ? 'text-primary font-black' : 'text-anthracite/40 hover:text-primary/70 font-bold'"
>
Tests
<div v-if="activeTab === 'tests'" class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-t-full"></div>
</button>
<div class="pt-6 mt-6 border-t border-slate-100 dark:border-slate-700">
<h5 class="text-xs font-black uppercase text-slate-400 tracking-widest mb-4">Ajouter / Remplacer</h5>
<form @submit.prevent="updateDocuments" class="space-y-4">
<div class="grid grid-cols-2 gap-2">
<div class="relative group/file">
<label class="flex flex-col items-center justify-center p-3 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl cursor-pointer hover:border-indigo-500 transition-colors">
<span class="text-[10px] font-bold uppercase tracking-tight text-slate-500">CV (PDF)</span>
<span class="text-[9px] text-slate-400 truncate w-full text-center mt-1">{{ docForm.cv ? docForm.cv.name : 'Choisir...' }}</span>
<input type="file" class="hidden" @input="docForm.cv = $event.target.files[0]" accept="application/pdf" />
</label>
</div>
<div class="relative group/file">
<label class="flex flex-col items-center justify-center p-3 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl cursor-pointer hover:border-emerald-500 transition-colors">
<span class="text-[10px] font-bold uppercase tracking-tight text-slate-500">Lettre (PDF)</span>
<span class="text-[9px] text-slate-400 truncate w-full text-center mt-1">{{ docForm.cover_letter ? docForm.cover_letter.name : 'Choisir...' }}</span>
<input type="file" class="hidden" @input="docForm.cover_letter = $event.target.files[0]" accept="application/pdf" />
</label>
</div>
</div>
<InputError :message="docForm.errors.cv" />
<InputError :message="docForm.errors.cover_letter" />
<PrimaryButton class="w-full !justify-center !py-2 text-xs" :disabled="docForm.processing || (!docForm.cv && !docForm.cover_letter)">
Mettre à jour les fichiers
</PrimaryButton>
</form>
</div>
</div>
</div>
</div>
<!-- Main: Content -->
<div class="xl:col-span-2 space-y-8">
<!-- Tab Content: Overview -->
<div v-if="activeTab === 'overview'" class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
<!-- Scores Dashboard -->
<div class="bg-white dark:bg-slate-800 rounded-3xl shadow-xl border border-slate-200 dark:border-slate-700 overflow-hidden">
<div class="p-8 bg-gradient-to-br from-slate-900 to-slate-800 text-white flex flex-col md:flex-row md:items-center justify-between gap-8">
@@ -611,21 +695,20 @@ const runAI = async () => {
:style="{ width: (bestTestScore / 20 * 100) + '%' }"
></div>
</div>
</div>
</div>
<!-- Score footer note -->
<p class="text-[10px] text-slate-400 italic pt-2 border-t border-slate-100 dark:border-slate-700">
Chaque axe est normalisé sur 100% par rapport à son barème maximum.
</p>
</div>
<!-- Score footer note -->
<p class="text-[10px] text-slate-400 italic pt-6 border-t border-slate-100 dark:border-slate-700">
Chaque axe est normalisé sur 100% par rapport à son barème maximum.
</p>
</div>
</div>
</div> <!-- Fin Overview Tab Content -->
</div>
<!-- AI Analysis Section (Full Width) -->
<div class="xl:col-span-3 space-y-8">
<!-- Tab Content: AI Analysis -->
<div v-if="activeTab === 'ai_analysis'" class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
<div class="bg-white dark:bg-slate-800 rounded-3xl shadow-lg border border-slate-200 dark:border-slate-700 p-10 overflow-hidden relative">
<div class="flex flex-col xl:flex-row xl:items-center justify-between gap-8 mb-10 border-b border-slate-100 dark:border-slate-700 pb-8">
<div>
@@ -798,18 +881,6 @@ const runAI = async () => {
</div>
</div>
<!-- Interview Questions -->
<div v-if="aiAnalysis.questions_entretien_suggerees?.length > 0" class="space-y-8">
<h5 class="text-sm font-black uppercase tracking-widest text-indigo-500 border-l-4 border-indigo-500 pl-4">Préparation d'entretien : Questions suggérées</h5>
<div class="grid grid-cols-1 gap-4">
<div v-for="(q, idx) in aiAnalysis.questions_entretien_suggerees" :key="idx" class="flex items-center gap-6 p-6 bg-slate-50 dark:bg-slate-900/30 border border-slate-100 dark:border-slate-800 rounded-3xl group hover:bg-white dark:hover:bg-slate-800 hover:shadow-xl hover:border-indigo-300 transition-all duration-300">
<div class="w-12 h-12 shrink-0 rounded-[1.25rem] bg-white dark:bg-slate-800 flex items-center justify-center text-lg font-black text-indigo-500 shadow-md group-hover:bg-indigo-600 group-hover:text-white transition-all">
{{ idx + 1 }}
</div>
<p class="text-xl font-bold text-slate-700 dark:text-slate-200 leading-snug">{{ q }}</p>
</div>
</div>
</div>
</div>
<div v-else-if="!isAnalyzing" class="py-24 border-4 border-dashed border-slate-100 dark:border-slate-800 rounded-[3rem] text-center bg-slate-50/50 dark:bg-slate-900/20">
<div class="w-20 h-20 bg-white dark:bg-slate-800 rounded-3xl flex items-center justify-center mx-auto mb-6 shadow-lg">
@@ -834,8 +905,157 @@ const runAI = async () => {
</div>
</div>
</div>
<!-- Notes Section (Full Width) -->
<div class="xl:col-span-3 space-y-8">
<!-- Tab Content: Interview -->
<div v-if="activeTab === 'interview'" class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
<!-- Interview Questions & Interactive Evaluation -->
<div v-if="notesForm.interview_details.questions?.length > 0" class="space-y-10">
<div class="flex items-center justify-between gap-4">
<h5 class="text-sm font-black uppercase tracking-widest text-[#004f82] border-l-4 border-[#004f82] pl-4">Évaluation de l'entretien</h5>
<div class="flex items-center gap-6">
<div class="px-5 py-2 bg-[#004f82]/5 dark:bg-[#004f82]/30 rounded-2xl border border-[#004f82]/20 dark:border-[#004f82]/50 hidden sm:block">
<span class="text-[10px] font-black uppercase text-[#004f82]/80 block tracking-[0.2em]">Score Questions</span>
<span class="text-xl font-black text-[#004f82]">{{ (notesForm.interview_details.questions || []).reduce((acc, q) => acc + (parseFloat(q.score) || 0), 0) }} / 20</span>
</div>
<div class="px-5 py-2 bg-[#e0b04c]/10 dark:bg-[#e0b04c]/30 rounded-2xl border border-[#e0b04c]/30 dark:border-[#e0b04c]/50">
<span class="text-[10px] font-black uppercase text-[#8b6508] block tracking-[0.2em]">Total Entretien</span>
<span class="text-xl font-black text-[#8b6508]">{{ calculatedInterviewScore }} / 30</span>
</div>
</div>
</div>
<div class="grid grid-cols-1 gap-6">
<div v-for="(q, idx) in notesForm.interview_details.questions" :key="idx" class="p-8 bg-neutral/30 dark:bg-slate-900/40 border border-anthracite/5 dark:border-slate-800 rounded-[2.5rem] group hover:bg-white dark:hover:bg-slate-800 hover:shadow-2xl hover:border-primary/20 transition-all duration-500">
<div class="flex items-start gap-6 mb-8 text-left">
<div class="w-12 h-12 shrink-0 rounded-2xl bg-white dark:bg-slate-700 shadow-lg flex items-center justify-center text-primary group-hover:bg-primary group-hover:text-white transition-all duration-300">
<span class="text-xl font-black">{{ idx + 1 }}</span>
</div>
<div class="flex-1">
<input
v-if="!candidate.interview_details"
v-model="q.question"
class="w-full bg-transparent border-none p-0 text-2xl font-black text-anthracite dark:text-slate-100 tracking-tight leading-snug focus:ring-0 placeholder:text-slate-300"
placeholder="Saisissez votre question personnalisée..."
/>
<p v-else class="text-2xl font-black text-anthracite dark:text-slate-100 tracking-tight leading-snug">{{ q.question }}</p>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
<div class="lg:col-span-3">
<label class="text-[10px] font-black uppercase tracking-[0.2em] text-anthracite/50 mb-4 block">Note Qualité / 4</label>
<div class="flex gap-2">
<button
v-for="score in [0, 1, 2, 3, 4]"
:key="score"
@click="q.score = score"
type="button"
class="w-full h-12 rounded-xl border-2 font-black transition-all"
:class="[
q.score === score
? 'bg-primary border-primary text-white shadow-lg shadow-primary/30 dark:shadow-none'
: 'bg-white dark:bg-slate-900 border-anthracite/10 dark:border-slate-800 text-anthracite/50 hover:border-primary/50'
]"
>
{{ score }}
</button>
</div>
</div>
<div class="lg:col-span-9">
<label class="text-[10px] font-black uppercase tracking-[0.2em] text-anthracite/50 mb-4 block">Commentaires & Détails de l'échange</label>
<textarea
v-model="q.comment"
rows="2"
class="w-full bg-white dark:bg-slate-900/50 border-2 border-transparent focus:border-primary/30 focus:ring-0 rounded-3xl p-6 text-base font-medium transition-all placeholder:text-slate-300"
:placeholder="'Analyse de la réponse pour la question ' + (idx + 1) + '...'"
></textarea>
</div>
</div>
</div>
</div>
<!-- Soft Skills Grid -->
<div class="space-y-10 mt-16 pt-10 border-t-2 border-dashed border-anthracite/10 dark:border-slate-800">
<div class="flex items-center justify-between gap-4 mb-8">
<h5 class="text-sm font-black uppercase tracking-widest text-[#004f82] border-l-4 border-[#004f82] pl-4">Évaluation des Soft Skills</h5>
<div class="px-5 py-2 bg-[#004f82]/5 dark:bg-[#004f82]/30 rounded-2xl border border-[#004f82]/20 dark:border-[#004f82]/50">
<span class="text-[10px] font-black uppercase text-[#004f82]/70 block tracking-[0.2em]">Moyenne Soft Skills</span>
<span class="text-xl font-black text-[#004f82]">{{ (notesForm.interview_details.soft_skills.reduce((acc, s) => acc + (parseFloat(s.score) || 0), 0) / Math.max(1, notesForm.interview_details.soft_skills.length)).toFixed(1) }} / 10</span>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div v-for="(skill, idx) in notesForm.interview_details.soft_skills" :key="idx" class="p-6 bg-neutral/30 dark:bg-slate-900/40 border border-anthracite/5 dark:border-slate-800 rounded-[2rem] hover:shadow-xl hover:border-primary/20 transition-all duration-300">
<div class="flex justify-between items-center mb-5">
<span class="font-bold text-anthracite dark:text-slate-200 flex-1">{{ skill.name }}</span>
<span class="text-sm font-black px-3 py-1 rounded-xl"
:class="skill.score >= 8 ? 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30' : skill.score >= 5 ? 'bg-amber-100 text-amber-700 dark:bg-amber-900/30' : skill.score > 0 ? 'bg-red-100 text-red-700 dark:bg-red-900/30' : 'bg-anthracite/10 text-anthracite/60 dark:bg-slate-800'">
{{ skill.score }} / 10
</span>
</div>
<div class="flex gap-1.5 h-10 w-full group/slider">
<button
v-for="val in 10"
:key="val"
@click="skill.score = val"
type="button"
class="flex-1 rounded-lg transition-all border border-transparent hover:scale-110 relative"
:class="[
skill.score >= val
? (skill.score >= 8 ? 'bg-[#004f82]' : skill.score >= 5 ? 'bg-[#e0b04c]' : 'bg-[#a30000]')
: 'bg-anthracite/10 dark:bg-slate-800 hover:bg-anthracite/20 dark:hover:bg-slate-700'
]"
>
<!-- Affichage du chiffre au survol sur PC -->
<span class="absolute inset-0 flex items-center justify-center text-xs font-black opacity-0 group-hover/slider:opacity-100 hover:!opacity-100"
:class="skill.score >= val ? 'text-white/80' : 'text-anthracite/50'">
{{ val }}
</span>
</button>
</div>
</div>
</div>
</div>
<!-- Overall Appreciation -->
<div class="relative p-10 bg-primary/5 dark:bg-primary/20 border-4 border-dashed border-primary/20 dark:border-primary/30 rounded-[3rem] mt-16 group hover:border-primary/40 transition-all duration-500">
<div class="grid grid-cols-1 md:grid-cols-4 gap-12 items-center">
<div class="md:col-span-1 text-center md:text-left">
<label class="text-[10px] font-black uppercase tracking-[0.2em] text-primary/70 mb-6 block">Note Appréciation / 10</label>
<div class="relative inline-flex items-center">
<input
type="number"
v-model="notesForm.interview_details.appreciation"
min="0" max="10" step="0.5"
class="w-40 bg-white dark:bg-slate-800 border-none rounded-[2rem] p-6 font-black text-4xl text-primary text-center shadow-2xl focus:ring-4 focus:ring-primary/10 transition-all"
/>
<span class="ml-4 text-2xl font-black text-anthracite/40">/ 10</span>
</div>
</div>
<div class="md:col-span-3">
<div class="flex flex-col md:flex-row items-center justify-end gap-10">
<div class="text-right">
<span class="text-[10px] font-black uppercase tracking-[0.2em] text-anthracite/60 block mb-2">Pondération Totale Entretien</span>
<div class="text-6xl font-black text-highlight tracking-tighter">
{{ calculatedInterviewScore }}<span class="text-2xl text-anthracite/30 font-normal ml-3">/ 30</span>
</div>
</div>
<PrimaryButton
@click="saveNotes"
:disabled="notesForm.processing"
class="!px-12 !py-6 !rounded-[2rem] shadow-2xl transition-all hover:-translate-y-1 active:scale-95 flex flex-col items-center gap-1 group"
>
<span class="text-lg font-black tracking-tight">Enregistrer l'évaluation</span>
<span class="text-[10px] font-black uppercase tracking-widest opacity-60">Calcul des scores & profil radar</span>
</PrimaryButton>
</div>
</div>
</div>
</div>
</div>
<!-- Notes Section (Full Width) -->
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 p-8">
<div class="flex items-center justify-between mb-6">
<h4 class="text-xl font-bold flex items-center gap-2">
@@ -913,7 +1133,10 @@ const runAI = async () => {
</div>
</div>
</div>
</div> <!-- Fin Interview Tab -->
<!-- Tab Content: Tests -->
<div v-if="activeTab === 'tests'" class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
<!-- Historique des Tests (Full Width) -->
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 p-8">
<h3 class="text-xl font-bold mb-8 flex items-center justify-between">
@@ -1027,8 +1250,84 @@ const runAI = async () => {
Ce candidat n'a pas encore terminé de test.
</div>
</div>
</div>
</div>
</div> <!-- Fin Tests Tab -->
<!-- Tab Content: Documents -->
<div v-if="activeTab === 'documents'" class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 p-8">
<h4 class="font-bold mb-6 flex items-center gap-2 text-xl">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-[#004f82]" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" />
</svg>
Gestion des Documents
</h4>
<div v-if="candidate.documents?.length === 0" class="py-8 text-center text-slate-400 italic bg-neutral/10 rounded-xl border border-dashed border-anthracite/10">
Aucun document disponible pour ce candidat.
</div>
<div v-else class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<button
v-for="doc in candidate.documents"
:key="doc.id"
@click="openPreview(doc)"
class="flex items-center justify-between p-5 bg-neutral/20 border border-anthracite/5 rounded-2xl hover:bg-neutral/50 transition-colors group text-left"
>
<div class="flex items-center gap-4">
<div class="p-3 bg-white rounded-xl shadow-sm group-hover:bg-primary group-hover:text-white transition-colors">
<svg v-if="doc.type === 'cv'" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
</div>
<div>
<div class="text-sm font-black uppercase tracking-tight text-primary">{{ doc.type === 'cv' ? 'Curriculum Vitae' : 'Lettre de Motivation' }}</div>
<div class="text-[11px] text-slate-500 font-medium mt-1 truncate">{{ doc.original_name }}</div>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-slate-400 group-hover:translate-x-1 group-hover:text-primary transition-all" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</button>
</div>
<div class="pt-8 border-t border-anthracite/5">
<h5 class="text-sm font-black uppercase text-anthracite/60 tracking-widest mb-6">Ajouter ou Remplacer les documents</h5>
<form @submit.prevent="updateDocuments" class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="relative group/file">
<label class="flex flex-col items-center justify-center p-6 bg-neutral/20 border-2 border-dashed border-anthracite/10 rounded-2xl cursor-pointer hover:border-primary hover:bg-neutral/40 transition-all">
<div class="mb-3 p-2 bg-white rounded-lg shadow-sm group-hover/file:bg-primary group-hover/file:text-white transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-slate-400 group-hover/file:text-white transition-colors" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>
</div>
<span class="text-xs font-black uppercase tracking-tight text-primary mb-1">Nouveau CV (PDF)</span>
<span class="text-[10px] text-slate-400 truncate w-full text-center">{{ docForm.cv ? docForm.cv.name : 'Cliquer pour parcourir...' }}</span>
<input type="file" class="hidden" @input="docForm.cv = $event.target.files[0]" accept="application/pdf" />
</label>
<InputError :message="docForm.errors.cv" class="mt-2" />
</div>
<div class="relative group/file">
<label class="flex flex-col items-center justify-center p-6 bg-neutral/20 border-2 border-dashed border-anthracite/10 rounded-2xl cursor-pointer hover:border-accent hover:bg-neutral/40 transition-all">
<div class="mb-3 p-2 bg-white rounded-lg shadow-sm group-hover/file:bg-accent group-hover/file:text-white transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-slate-400 group-hover/file:text-white transition-colors" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>
</div>
<span class="text-xs font-black uppercase tracking-tight text-accent mb-1">Nouvelle Lettre (PDF)</span>
<span class="text-[10px] text-slate-400 truncate w-full text-center">{{ docForm.cover_letter ? docForm.cover_letter.name : 'Cliquer pour parcourir...' }}</span>
<input type="file" class="hidden" @input="docForm.cover_letter = $event.target.files[0]" accept="application/pdf" />
</label>
<InputError :message="docForm.errors.cover_letter" class="mt-2" />
</div>
</div>
<PrimaryButton class="!px-8 py-3 text-sm" :disabled="docForm.processing || (!docForm.cv && !docForm.cover_letter)">
Enregistrer les nouveaux documents
</PrimaryButton>
</form>
</div>
</div>
</div> <!-- Fin Documents Tab Content (1241) -->
<!-- Document Preview Modal -->
<Modal :show="!!selectedDocument" @close="selectedDocument = null" max-width="4xl">
@@ -1048,6 +1347,68 @@ const runAI = async () => {
</Modal>
</AdminLayout>
<!-- Edit Details Modal -->
<Modal :show="showEditDetailsModal" @close="showEditDetailsModal = false">
<div class="p-6">
<h2 class="text-lg font-black uppercase tracking-tight text-slate-900 dark:text-white mb-6">Modifier les informations</h2>
<form @submit.prevent="updateDetails" class="space-y-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-[10px] font-black uppercase tracking-widest text-slate-400 mb-1">Nom complet</label>
<input
v-model="detailsForm.name"
type="text"
class="w-full bg-slate-50 dark:bg-slate-900 border-slate-200 dark:border-slate-700 rounded-xl focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-bold text-sm"
placeholder="Ex: Jean Dupont"
/>
<InputError :message="detailsForm.errors.name" class="mt-1" />
</div>
<div>
<label class="block text-[10px] font-black uppercase tracking-widest text-slate-400 mb-1">Email</label>
<input
v-model="detailsForm.email"
type="email"
class="w-full bg-slate-50 dark:bg-slate-900 border-slate-200 dark:border-slate-700 rounded-xl focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-bold text-sm"
placeholder="Email candidat"
/>
<InputError :message="detailsForm.errors.email" class="mt-1" />
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-[10px] font-black uppercase tracking-widest text-slate-400 mb-1">Téléphone</label>
<input
v-model="detailsForm.phone"
type="text"
class="w-full bg-slate-50 dark:bg-slate-900 border-slate-200 dark:border-slate-700 rounded-xl focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-bold text-sm"
placeholder="Ex: 06 12 34 56 78"
/>
<InputError :message="detailsForm.errors.phone" class="mt-1" />
</div>
<div>
<label class="block text-[10px] font-black uppercase tracking-widest text-slate-400 mb-1">URL LinkedIn</label>
<input
v-model="detailsForm.linkedin_url"
type="url"
class="w-full bg-slate-50 dark:bg-slate-900 border-slate-200 dark:border-slate-700 rounded-xl focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-bold text-sm"
placeholder="https://linkedin.com/in/..."
/>
<InputError :message="detailsForm.errors.linkedin_url" class="mt-1" />
</div>
</div>
<div class="flex justify-end gap-3 pt-4">
<SecondaryButton @click="showEditDetailsModal = false" type="button">Annuler</SecondaryButton>
<PrimaryButton :class="{ 'opacity-25': detailsForm.processing }" :disabled="detailsForm.processing">
Enregistrer les modifications
</PrimaryButton>
</div>
</form>
</div>
</Modal>
<!-- Error Modal -->
<Modal :show="showErrorModal" @close="showErrorModal = false" maxWidth="md">
<div class="p-6">