/* =============================================================
   CVtek — feuille de style locale (pas de CDN, portable)
   Direction visuelle : vert sapin + terracotta + beige clair.
   Polices : Lora (titres) + Inter (corps). Icônes : Lucide SVG.
   ============================================================= */

/* Polices hébergées en local (doit rester en tête : règle @import). */
@import "fonts.css";

:root {
  --primary: #14532d;
  --primary-dark: #052e16;
  --primary-tint: #dcfce7;
  --primary-soft: #f0fdf4;
  --primary-border: #d1fadf;
  --accent: #c2410c;
  --accent-tint: #fed7aa;
  --accent-soft: #fff7ed;
  --gold: #ca8a04;
  --gold-soft: #fef9c3;
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #78716c;
  --border: #e7e5e4;
  --border-soft: #f5f5f4;
  --bg: #faf7f2;
  --card: #ffffff;
  --err: #b91c1c;
  --err-soft: #fef2f2;

  /* Jeton de rayon (non-couleur, conservé pour les classes existantes) */
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
}

/* Titres en Lora */
h1, h2 {
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  color: var(--text);
}
h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.15rem; }

/* Utilitaire icône (alignement des SVG Lucide avec le texte) */
.icone {
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.site-header a.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  height: 36px;
  width: auto;
}
.site-header .licencie {
  color: var(--muted);
  font-weight: 500;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  font-size: 0.85rem;
}
.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.site-header nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 5px;
  transition: all 0.15s;
}
.site-header nav a:hover {
  background: var(--border-soft);
  color: var(--text);
}
.site-header nav a.active {
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 600;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 32px;
}

.footer-version {
  margin-left: 8px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.container {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
}

label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.help { color: var(--muted); font-size: 0.875rem; margin-top: 6px; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }

/* Variantes de boutons */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-dark); }

.btn-clair {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-clair:hover { background: var(--bg); }

.btn-danger { background: var(--err); color: #fff; border: none; }
.btn-danger:hover { background: #991b1b; }

.alert {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-ok  { background: var(--primary-tint); color: var(--primary-dark); border-color: var(--primary-border); }
.alert-err { background: var(--err-soft);     color: var(--err);          border-color: #fecaca; }

.alert ul { margin: 8px 0 0; padding-left: 20px; }

dl.recap { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; }
dl.recap dt { font-weight: 600; color: var(--muted); }
dl.recap dd { margin: 0; }

.tag {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  margin: 0 4px 4px 0;
}

/* ===== Écran fiche (vérification / consultation / édition) ===== */

/* Conteneur élargi pour la mise en page deux colonnes. */
.container-wide { max-width: 1200px; margin: 28px auto; padding: 0 20px; }

.fiche-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .fiche-layout { grid-template-columns: 1fr; }
}

/* Colonne CV original */
.cv-pane iframe {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.cv-text {
  white-space: pre-wrap;
  font-size: 0.9rem;
  max-height: 78vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0;
}

/* Champs de formulaire */
.field { margin-bottom: 16px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card);
}
.field textarea { resize: vertical; min-height: 70px; }


/* Bloc compétences groupées */
.comp-group { margin-bottom: 14px; }
.comp-group h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.comp-items { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.comp-items label {
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-warn   { background: var(--gold-soft);    color: #854d0e;             border: 1px solid #fde68a; }
.badge-ok     { background: var(--primary-tint); color: var(--primary-dark); border: 1px solid var(--primary-border); }
/* v1.1 — badges d'évaluation d'entretien (recommandation + décision) */
.badge-warm   { background: var(--accent-tint); color: var(--accent);       border: 1px solid #fdba74; }
.badge-danger { background: var(--err-soft);    color: var(--err);          border: 1px solid #fecaca; }

/* v1.1 — état de dépôt de la fiche remplie (page entretien, Bloc 2) */
.fiche-deposee {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 10px;
}
.fiche-deposee-icone { color: var(--primary); margin-top: 1px; }
.fiche-deposee-corps { flex: 1; min-width: 0; }
.fiche-deposee-titre {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.fiche-deposee-nom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-2);
  word-break: break-all;
}
.fiche-deposee-nom a { color: var(--primary); text-decoration: none; }
.fiche-deposee-nom a:hover { text-decoration: underline; }

/* v1.1 — accordéon "Remplacer la fiche" caché par défaut, ouvert via .ouverte */
.form-remplacer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: none;
}
.form-remplacer.ouverte { display: block; }

/* v1.1 — alignement horizontal des actions crayon+poubelle dans le tableau
   de l'historique des entretiens (le <form> autour du bouton "Supprimer"
   cassait l'alignement inline). */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-actions form { margin: 0; display: inline-flex; }

/* v1.1 — dépôt conditionnel : le bouton "Confirmer le dépôt" reste caché
   tant qu'aucun fichier n'a été sélectionné (LOT G). JS vanilla ajoute
   la classe .pret sur .depot-ligne quand l'input file a un fichier. */
.depot-ligne {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.depot-ligne .depot-input { flex: 1; min-width: 0; }
.depot-ligne .depot-confirm { display: none; white-space: nowrap; }
.depot-ligne.pret .depot-confirm { display: inline-flex; }

/* v1.1 — lien discret « déposer » dans la colonne Fiche de l'historique */
.lien-deposer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  transition: all 0.15s;
}
.lien-deposer:hover {
  color: var(--primary);
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-soft);
}

/* ===== Fiche en lecture seule (consultation, Module 5) ===== */
.lecture-bloc { margin-top: 16px; }
.lecture-bloc h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.lecture-texte { margin: 0; white-space: pre-line; }

.actions-fiche {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Modale de confirmation ===== */
.modale {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modale.ouverte { display: flex; }
.modale-boite {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 26px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.modale-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ===== Gestion des compétences (Module 6) ===== */

/* Menu déroulant ⋯ */
.menu-wrap { position: relative; }
.menu-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 10px;
  cursor: pointer;
  color: var(--muted);
}
.menu-btn:hover { background: var(--bg); border-color: var(--border); }
.menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 50;
  min-width: 220px;
  overflow: hidden;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--text);
}
.menu button:hover { background: var(--bg); }

/* Message d'erreur inline (sous un formulaire de création) */
.erreur-inline {
  color: var(--err);
  font-size: 0.875rem;
  margin: 8px 0 0;
  font-weight: 600;
}

/* ===== Tableau de recherche (Module 4) ===== */

/* Grille de filtres responsive */
.filtres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 18px;
  margin-bottom: 14px;
}
.filtres .field { margin-bottom: 0; }
.filtres input[type="text"],
.filtres input[type="number"],
.filtres select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card);
}
.filtres .plage { display: flex; gap: 8px; }
.filtres .plage input { width: 100%; }

/* Champ d'ajout de compétence */
#comp-input {
  width: 100%;
  max-width: 360px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Tableau */
.tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tableau th, .tableau td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tableau thead th {
  background: var(--bg);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}
.tableau thead th a { color: var(--muted); text-decoration: none; }
.tableau thead th a:hover { color: var(--primary); }
.tableau tbody tr:hover { background: var(--primary-soft); }

.btn-petit { padding: 5px 12px; font-size: 0.85rem; border-radius: 8px; white-space: nowrap; }

/* Pagination */
.pagination-wrap { margin-top: 18px; }
.pagination-wrap nav ul { display: flex; gap: 6px; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination-wrap nav a, .pagination-wrap nav .active {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
}
.pagination-wrap nav .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination-wrap nav .disabled { opacity: 0.4; }

/* ===== Étape 3 : Écran fiche candidat ===== */

.container { max-width: 1280px; margin: 24px auto; padding: 0 24px; }

.crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--muted); margin-bottom: 18px;
}
.crumb a {
  color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color 0.15s;
}
.crumb a:hover { color: var(--text); }

.candidate-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 24px; margin-bottom: 20px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
}
.avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #166534 100%);
  color: white; font-family: "Lora", serif; font-weight: 600; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(20, 83, 45, 0.2);
}
.candidate-info h1 {
  font-family: "Lora", serif; font-size: 1.55rem; font-weight: 600;
  margin: 0 0 4px; letter-spacing: -0.3px; color: var(--text);
}
.candidate-tagline { color: var(--muted); margin: 0; font-size: 0.88rem; }
.quick-stats { display: flex; gap: 28px; align-items: center; }
.qs { text-align: center; min-width: 50px; }
.qs-value {
  font-family: "Lora", serif; font-size: 1.4rem; font-weight: 600;
  color: var(--primary-dark); line-height: 1;
}
.qs-label {
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px; font-weight: 600;
}

.metrics-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
.metric {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.metric-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.metric-icon.green { background: var(--primary-tint); color: var(--primary); }
.metric-icon.orange { background: var(--accent-tint); color: var(--accent); }
.metric-icon.yellow { background: var(--gold-soft); color: var(--gold); }
.metric-icon.blue { background: #dbeafe; color: #1e40af; }
.metric-label {
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.metric-value {
  font-family: "Lora", serif; font-size: 1.2rem; font-weight: 600;
  color: var(--text); line-height: 1.1; margin-top: 2px;
}

.main-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}

/* Modèle de carte « en-tête + corps » — scopé à la fiche pour ne pas
   modifier les .card des autres écrans (padding, overflow du menu ⋯…). */
.main-grid .card {
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  margin-bottom: 0;
}
.card-header {
  padding: 13px 18px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 {
  font-family: "Lora", serif; margin: 0; font-size: 0.95rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.card-icon {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--primary-tint); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.card-count { font-size: 0.78rem; color: var(--muted); }
.card-body { padding: 18px; }

.cv-viewer { height: 580px; background: var(--bg); display: flex; }
.cv-viewer iframe { width: 100%; height: 100%; border: none; }
.cv-placeholder {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; color: var(--muted);
  text-align: center; padding: 0 20px;
}

.indicator-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--border-soft); gap: 16px;
}
.indicator-row:last-child { border-bottom: none; }
.indicator-label {
  font-size: 0.85rem; color: var(--muted);
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.indicator-value { font-weight: 600; color: var(--text); font-size: 0.92rem; text-align: right; }
.indicator-value a { color: var(--primary); text-decoration: none; }
.indicator-value a:hover { text-decoration: underline; }

.action-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--border-soft);
  background: #fafaf8;
}

.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

.field-row { margin-bottom: 14px; }
.field-row label {
  display: block; margin-bottom: 4px;
  font-size: 0.78rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.field-input, .field-select, .field-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.92rem; color: var(--text); background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.field-textarea { resize: vertical; min-height: 80px; }

.cat-block { margin-bottom: 16px; }
.cat-block:last-child { margin-bottom: 0; }
.cat-titre {
  font-family: "Lora", serif; font-size: 0.85rem; color: var(--primary-dark);
  font-weight: 600; margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px; font-style: italic;
}
.cat-pill {
  background: var(--primary-tint); color: var(--primary-dark);
  border-radius: 999px; padding: 1px 7px;
  font-size: 0.7rem; font-weight: 600; font-family: "Inter", sans-serif; font-style: normal;
}
.skill-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.8rem; font-weight: 500;
  border: 1px solid var(--primary-tint);
}
.skill-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

.skill-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px;
  background: var(--card); color: var(--text-2);
  font-size: 0.85rem; font-weight: 500;
  border: 1px solid var(--border); cursor: pointer;
  transition: all 0.15s;
  margin: 3px;
}
.skill-check:hover { border-color: var(--primary); }
.skill-check input { display: none; }
.skill-check.checked {
  background: var(--primary-tint); color: var(--primary-dark);
  border-color: var(--primary-border);
}

/* ===== Étape 3.1 : barre d'actions globale + contexte vérification ===== */

.fiche-actions-globales {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 18px;
}

.banniere-verification {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.5;
}
.banniere-verification strong {
  display: block;
  color: var(--accent);
  font-family: "Lora", serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.banniere-icone {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.mode-verification .field-input,
.mode-verification .field-select,
.mode-verification .field-textarea {
  border-left: 3px solid var(--accent-tint);
}
.mode-verification .field-input:focus,
.mode-verification .field-select:focus,
.mode-verification .field-textarea:focus {
  border-left-color: var(--primary);
}

/* ===== Étape 4 : Tableau de recherche /candidats ===== */

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 {
  font-family: "Lora", serif; font-size: 1.8rem; font-weight: 600;
  margin: 0; letter-spacing: -0.3px; color: var(--text);
}
.page-sub {
  color: var(--muted); font-size: 0.9rem; margin: 4px 0 0;
}

.card-padded { padding: 22px 24px; }
.card-padded .card-header-flat { margin-bottom: 18px; }

.card-table { padding: 0; overflow: hidden; }
.card-table .card-header-flat {
  padding: 13px 18px; border-bottom: 1px solid var(--border-soft);
}

.card-header-flat {
  display: flex; align-items: center; justify-content: space-between;
}
.card-header-flat h2 {
  font-family: "Lora", serif; margin: 0; font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}

/* Grille de filtres + plages min/max */
.filtres-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 18px;
}
.plage { display: flex; gap: 8px; }

.link-reset {
  color: var(--muted); text-decoration: none; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 5px; transition: all 0.15s;
}
.link-reset:hover { color: var(--err); background: var(--err-soft); }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

/* Liste des compétences sélectionnées dans les filtres */
.competences-selection {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 12px 0; border-top: 1px dashed var(--border-soft);
}
.competences-selection-label {
  font-size: 0.78rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-right: 8px;
}
.skill-chip-removable {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.83rem; font-weight: 500;
  border: 1px solid var(--primary-tint);
}
.skill-chip-removable button {
  border: none; background: var(--primary-tint); color: var(--primary-dark);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; line-height: 1; padding: 0;
}
.skill-chip-removable button:hover { background: var(--err); color: white; }

/* Tableau de résultats */
.tableau {
  width: 100%; border-collapse: collapse; background: white;
}
.tableau thead th {
  background: #fafaf8;
  padding: 12px 14px; text-align: left;
  font-size: 0.78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.tableau thead th.th-tri {
  cursor: pointer; user-select: none;
}
.tableau thead th.th-tri a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); text-decoration: none;
}
.tableau thead th.th-tri a:hover { color: var(--primary); }
.tableau tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem; color: var(--text-2);
}
.tableau tbody tr:hover { background: var(--primary-soft); }
.tableau tbody tr:last-child td { border-bottom: none; }

.lien-candidat {
  color: var(--text); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color 0.15s;
}
.lien-candidat:hover { border-color: var(--primary); color: var(--primary); }

.td-competences {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.skill-chip-plus {
  display: inline-flex; align-items: center;
  padding: 4px 8px; border-radius: 4px;
  background: var(--border-soft); color: var(--muted);
  font-size: 0.75rem; font-weight: 600;
}
.td-actions {
  text-align: right; white-space: nowrap;
}

.empty-state {
  padding: 60px 24px; text-align: center; color: var(--muted);
}
.empty-state h3 {
  font-family: "Lora", serif; color: var(--text); font-size: 1.2rem;
  font-weight: 600; margin: 16px 0 8px;
}
.empty-state p { margin: 0; font-size: 0.92rem; }

/* ===== Étape 5 : Gestion des compétences /competences ===== */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.categorie-card { padding: 0; overflow: visible; }
.categorie-card .card-header-flat { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); margin-bottom: 0; }
.categorie-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.btn-menu { background: transparent; border: none; padding: 4px; border-radius: 6px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.btn-menu:hover { background: var(--primary-soft); color: var(--primary); }
.btn-menu svg, .menu-btn svg { pointer-events: none; } /* le clic doit compter sur le bouton (JS .menu-btn) */
.categorie-body { padding: 16px 18px; }
.skill-grid { display: flex; flex-wrap: wrap; }
.skill-chip-edit { display: inline-flex; align-items: center; gap: 0; padding: 0; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 0.83rem; font-weight: 500; border: 1px solid var(--primary-tint); margin: 0 4px 4px 0; overflow: hidden; transition: all 0.15s; }
.skill-chip-edit:hover { border-color: var(--primary); }
.skill-nom { padding: 4px 4px 4px 12px; cursor: pointer; background: transparent; border: none; color: inherit; font: inherit; }
.skill-nom:hover { text-decoration: underline; }
.skill-x { border: none; background: transparent; color: var(--primary-dark); padding: 4px 8px 4px 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; opacity: 0.4; }
.skill-chip-edit:hover .skill-x { opacity: 1; }
.skill-x:hover { color: var(--err); }
.form-ajout-comp { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; }
.form-ajout-comp .field-input { flex: 1; }
.btn-ajout-comp { background: transparent; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 14px; cursor: pointer; color: var(--muted); font-size: 0.85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s; white-space: nowrap; }
.btn-ajout-comp:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); border-style: solid; }

/* ===== Étape 6 : Import CV (dropzone) ===== */
.import-card { max-width: 640px; margin: 0 auto; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px; padding: 44px 24px;
  border: 2px dashed var(--border); border-radius: 14px;
  background: var(--bg); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone-actif { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-icone { color: var(--primary); margin-bottom: 6px; line-height: 0; }
.dropzone-titre { font-family: "Lora", serif; font-size: 1.15rem; font-weight: 600; color: var(--text); }
.dropzone-sous { font-size: 0.92rem; color: var(--muted); }
.dropzone-lien { color: var(--primary); font-weight: 600; text-decoration: underline; }
.dropzone-info { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.dropzone-fichier-selectionne {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  padding: 12px 14px; border: 1px solid var(--primary-tint); border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-dark);
}
.dropzone-fichier-selectionne svg { flex-shrink: 0; color: var(--primary); }
.fichier-nom { flex: 1; font-size: 0.9rem; font-weight: 500; word-break: break-all; }
.btn-retirer-fichier {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.btn-retirer-fichier:hover { color: var(--err); background: var(--card); }

/* ===== Écran activation de licence (plein page, pas de header) ===== */
.licence-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.licence-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(20, 83, 45, 0.06);
}
.licence-icone {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.licence-card h1 {
  font-family: "Lora", serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}
.licence-intro {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.licence-card .field {
  margin-bottom: 18px;
}
.licence-card textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
}
.licence-aide {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.licence-footer {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.brand-mark-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--primary);
  color: white;
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: 0.78rem;
}
.licence-footer strong {
  font-family: "Lora", serif;
  font-weight: 600;
  color: var(--text);
}

/* ===== Écran d'accueil (tableau de bord, route '/') ===== */

.accueil-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.accueil-hero-logo {
  height: 64px;
  width: auto;
  flex-shrink: 0;
}
.accueil-hero h1 { margin-bottom: 4px; }

.metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1rem;
}
.metric-badges .badge { font-size: 0.75rem; white-space: nowrap; }

.acces-rapides {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
