 :root {
  --brand-purple: #6366f1;
  --brand-purple-dark: #4f46e5;
  --brand-purple-hover: #818cf8;
  --brand-emerald: #10b981;
  --brand-emerald-dark: #059669;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --bg-light: #f8fafc;
  --bg-lighter: #f1f5f9;
  --border-light: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 16px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.16);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.2);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0);
  }
  50% {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes slideInText {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideOutText {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes progressExpand {
  0% {
    width: 5%;
  }
  15% {
    width: 20%;
  }
  30% {
    width: 35%;
  }
  50% {
    width: 55%;
  }
  70% {
    width: 72%;
  }
  85% {
    width: 85%;
  }
  100% {
    width: 85%;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.recruiter-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #f8fafc 100%);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);

  /* Le shell prend toute la hauteur écran */
  height: 100vh;
  overflow: hidden;
}

.app-main {
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.8rem 1.6rem;
  box-sizing: border-box;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

  /* 👇 ICI se fait le scroll */
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Sidebar avec dégradé clair ===== */

.app-sidebar {
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.95) 0%, rgba(243, 245, 255, 0.95) 50%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(226, 232, 240, 0.5);
  padding: 0.9rem 0.9rem 0.8rem;
  box-sizing: border-box;
  box-shadow: inset -1px 0 0 rgba(100, 116, 139, 0.08);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.3rem 0.8rem;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--brand-purple), #0f172a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-ai {
  color: #111827;
}

.btn-new-search {
  margin: 0.1rem 0 0.9rem;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text-primary);
  padding: 0.6rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  font-weight: 600;
}

.btn-new-search:hover {
  background: linear-gradient(135deg, #f9fafb 0%, #eef2ff 100%);
  border-color: var(--brand-purple);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Lien vers le dashboard dans la sidebar */
.sidebar-dashboard-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.15rem 0;
  margin: 0.15rem 0;
}

/* Pastille centrée, compacte et non-débordante */
.sidebar-dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 220px;
  width: auto;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f8f9ff, #eef2ff);
  border: 1px solid rgba(79, 70, 229, 0.12);
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.06);
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-dashboard-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.08);
}

/* Accessible focus state */
.sidebar-dashboard-btn:focus {
  outline: 3px solid rgba(79,70,229,0.14);
  outline-offset: 2px;
}

/* État actif pour le lien de navigation courant (tableau de bord) */
.sidebar-link-current {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border: 1px solid #d4d8ff;
  color: #0f172a;
  font-weight: 700;
  text-align: center;
  font-size: 0.88rem;
  box-sizing: border-box;
  width: calc(100% - 0.6rem);
  margin: 0 0.3rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(79,70,229,0.06);
}

/* Slightly stronger focus ring for keyboard nav */
.sidebar-link-current:focus {
  outline: 3px solid rgba(79,70,229,0.12);
  outline-offset: 2px;
}

/* Make the dashboard button receive the same 'active' look as .sidebar-link-current */
.sidebar-dashboard-btn.active {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border: 1px solid #d4d8ff;
  color: #0f172a;
  font-weight: 700;
  text-align: center;
  font-size: 0.88rem;
  box-sizing: border-box;
  width: calc(100% - 0.6rem);
  margin: 0 0.3rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(79,70,229,0.06);
}

.sidebar-dashboard-btn.active:focus {
  outline: 3px solid rgba(79,70,229,0.12);
  outline-offset: 2px;
}

/* Dashboard page: cards synthétiques */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
  margin-bottom: 2.4rem;
  animation: fadeInUp var(--transition-slow) ease-out;
}

.dash-card:nth-child(1) { animation-delay: 0.1s; }
.dash-card:nth-child(2) { animation-delay: 0.2s; }
.dash-card:nth-child(3) { animation-delay: 0.3s; }
.dash-card:nth-child(4) { animation-delay: 0.4s; }

.dash-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.dash-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.dash-card-search {
  background: linear-gradient(135deg, rgba(230, 230, 250, 0.8), rgba(210, 210, 240, 0.6));
}

.dash-card-pipeline {
  background: linear-gradient(135deg, rgba(220, 240, 255, 0.8), rgba(180, 220, 255, 0.6));
}

.dash-card-discussion {
  background: linear-gradient(135deg, rgba(200, 245, 230, 0.8), rgba(160, 240, 210, 0.6));
}

.dash-card-actions {
  background: linear-gradient(135deg, rgba(255, 245, 220, 0.8), rgba(255, 225, 180, 0.6));
}

.dash-card-icon {
  font-size: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dash-card-search .dash-card-icon {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);
}

.dash-card-pipeline .dash-card-icon {
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
}

.dash-card-discussion .dash-card-icon {
  background: linear-gradient(135deg, #6ee7b7, #34d399);
}

.dash-card-actions .dash-card-icon {
  background: linear-gradient(135deg, #fdba74, #fb923c);
}

.dash-card-value {
  margin: 0 0 8px 0;
  font-size: 42px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.dash-card-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.dash-card-meta {
  margin: 0;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
}

/* Sections du dashboard */
.dashboard-section {
  margin-bottom: 2.4rem;
  animation: fadeInUp var(--transition-slow) ease-out;
  animation-fill-mode: both;
}

.dashboard-section:nth-of-type(1) { animation-delay: 0.5s; }
.dashboard-section:nth-of-type(2) { animation-delay: 0.6s; }
.dashboard-section:nth-of-type(3) { animation-delay: 0.7s; }
.dashboard-section:nth-of-type(4) { animation-delay: 0.8s; }

.dashboard-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 18px 0;
  letter-spacing: -0.01em;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.expand-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.expand-btn:hover {
  background: var(--bg-light);
  color: var(--brand-purple);
  transform: scale(1.1);
}

.tout-voir-link {
  color: var(--brand-purple);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tout-voir-link:hover {
  color: var(--brand-purple-dark);
  transform: translateX(3px);
  text-decoration: underline;
}

/* Cartes de priorité */
.priority-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  animation: slideInLeft var(--transition-slow) ease-out;
  backdrop-filter: blur(4px);
}

.priority-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(6px);
  border-color: var(--brand-purple);
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
  backdrop-filter: blur(8px);
}

.priority-card-primary {
  background: #ffffff;
  border-color: #e5e7eb;
}

.priority-icon {
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.priority-card-primary .priority-icon {
  background: #f3f4f6;
  color: #6b7280;
  opacity: 0.7;
}

.priority-text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  color: #374151;
}

.priority-action-btn {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.priority-action-btn:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.priority-action-btn--sent {
  background: #e5e7eb;
  color: #4b5563;
  cursor: default;
}

.priority-action-btn:hover {
  filter: brightness(0.98);
}

.priority-card--sent {
  border-color: #d1fae5;
  background: #f0fdf4;
}

.priority-card--dismiss {
  opacity: 0;
  transform: translateY(6px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
  transition: opacity 240ms ease, transform 240ms ease, max-height 260ms ease, padding 260ms ease, margin 260ms ease, border-width 260ms ease;
}

.priority-suggestion {
  background: rgba(254, 243, 199, 0.25);
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

.priority-suggestion-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.priority-suggestion-text {
  margin: 0;
  font-size: 14px;
  color: #92400e;
  line-height: 1.4;
  font-weight: 500;
}

/* Pipeline stages */
.pipeline-stages {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  padding-top: 4px;
}

.pipeline-stage {
  flex: 1;
  min-width: 140px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-base);
  animation: fadeInUp var(--transition-slow) ease-out;
  box-shadow: var(--shadow-sm);
}

.pipeline-stage:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
  border-color: var(--brand-purple);
}

.pipeline-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-stage-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
}

.pipeline-badge-new {
  background: #dbeafe;
  color: #1e40af;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pipeline-badge-shortlist {
  background: #e0e7ff;
  color: #4338ca;
}

.pipeline-badge-contacted {
  background: #ccfbf1;
  color: #0f766e;
}

.pipeline-badge-interview {
  background: #f0fdf4;
  color: #15803d;
}

.pipeline-badge-offer {
  background: #fef3c7;
  color: #a16207;
}

.pipeline-stage-count {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

/* Shortlist grid */
.shortlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.shortlist-candidate-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.shortlist-candidate-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-purple);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}

/* Bouton supprimer de la shortlist */
.shortlist-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #c0c4cc;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s ease, color 0.2s ease;
}

.shortlist-remove-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.shortlist-candidate-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.candidate-avatar-small {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.candidate-avatar-green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.shortlist-candidate-info {
  flex: 1;
  min-width: 0;
}

.shortlist-candidate-name {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlist-candidate-role {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlist-candidate-score {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-purple);
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

.score-label {
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
}

.shortlist-candidate-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shortlist-candidate-search {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}

.shortlist-candidate-date {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.shortlist-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.shortlist-badge-reminder {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(254, 243, 199, 0.4);
  color: #92400e;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  border: 1px solid rgba(252, 211, 77, 0.2);
}

.shortlist-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e5e7eb;
}

.shortlist-badge-ready {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.shortlist-badge-action {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #f9fafb;
  color: #4f46e5;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.shortlist-badge-action:hover {
  background: #eef2ff;
  border-color: #e0e7ff;
  transform: translateY(-1px);
}

.shortlist-buttons {
  display: flex;
  gap: 8px;
}

.shortlist-btn {
  flex: 1;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.shortlist-btn-primary {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.shortlist-btn-primary:hover {
  background: var(--brand-purple-dark);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* Neutralise les effets du btn-primary global quand il est dans une carte shortlist */
.shortlist-candidate-card .btn-primary {
  transition: background 0.2s ease, box-shadow 0.2s ease;
  transform: none !important;
  position: relative;
  overflow: hidden;
}

.shortlist-candidate-card .btn-primary::before {
  display: none !important;
}

.shortlist-candidate-card .btn-primary:hover:not(:disabled) {
  transform: none !important;
  background: var(--brand-purple-dark);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.shortlist-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.shortlist-btn-icon:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shortlist-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar-dashboard-btn { font-size: 0.82rem; }
}

.btn-new-search:hover {
  background: #eef2ff;
}

.sidebar-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.search-clear-btn:hover {
  background: rgba(79,70,229,0.04);
  color: #312e81;
}

.sidebar-section-title {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem 0.2rem;
}

.search-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.5rem;
}

.search-item {
  border-radius: 0.8rem;
  border: 1px solid transparent;
  padding: 0.45rem 0.45rem 0.4rem;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 0.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: slideInLeft var(--transition-slow) ease-out;
}

.search-item:hover {
  background: linear-gradient(135deg, #e5e7ff 0%, #eef2ff 100%);
  border-color: #d4d8ff;
  transform: translateX(4px);
}

.search-item-active {
  background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 100%);
  border-color: #818cf8;
  box-shadow: var(--shadow-sm);
}

.search-main {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.search-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
}

.search-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
}

.search-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
}

.search-status {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

/* Restore basic UX for recent searches: show meta by default */
.search-item .search-meta,
.search-item .search-status,
.search-item .search-date,
.search-item .search-subtitle {
  opacity: 1;
  transform: none;
  transition: none;
  pointer-events: auto;
}

/* Active search item styling (visible by default) */
.search-item-active {
  background: #e0e7ff;
  border-color: #818cf8;
}

/* Sidebar dashboard button: keep compact neutral look until hover */
.sidebar-dashboard-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.sidebar-dashboard-link:hover .sidebar-dashboard-btn,
.sidebar-dashboard-btn:hover,
.sidebar-dashboard-btn:focus {
  background: linear-gradient(135deg, #f8f9ff, #eef2ff);
  border: 1px solid rgba(79, 70, 229, 0.12);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.06);
  transform: translateY(-1px);
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-draft {
  background: #e5e7eb;
  color: #374151;
}

.search-date {
  font-size: 0.7rem;
  color: #9ca3af;
}

.sidebar-footer {
  padding-top: 0.5rem;
  border-top: 1px solid #e2e4f0;
  margin-top: 0.4rem;
}

.sidebar-footline {
  margin: 0;
  font-size: 0.76rem;
  color: #6b7280;
}

/* ===== Main panel : fond blanc, structuré comme ChatGPT ===== */

.app-main {
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.8rem 1.6rem;
  height: 100vh;
  box-sizing: border-box;
  background: #ffffff;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.8rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  animation: slideInLeft var(--transition-slow) ease-out;
  background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.02) 100%);
  border-radius: 0 0 8px 8px;
}

.main-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.main-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.env-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
}

/* Hero centré */

.search-hero {
  margin-bottom: 1.4rem;
  display: flex;
  justify-content: center;
}

.search-hero-top .search-hero-inner {
  text-align: center;
}

.search-hero-inner {
  max-width: 820px;
  width: 100%;
  text-align: center;
}

.hero-title {
  margin: 0 0 0.8rem;
  font-size: 2.4rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.hero-highlight {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 1.4rem;
  font-size: 0.96rem;
  color: #4b5563;
}

/* Prompt box façon ChatGPT */
.prompt-box {
  max-width: 720px;
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  min-height: 30px;
  transition: all var(--transition-base);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.prompt-box:focus-within {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), var(--shadow-md);
  border-color: var(--brand-purple);
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}

.prompt-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  color: #111827;
  background: transparent;
  line-height: 1.5;
  padding: 0;
  height: auto;
  min-height: 40px;
}

/* ===== Collection selector (discret, inline) ===== */
.collection-input-row {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border: none;
  padding: 0;
  opacity: 0.55;
  transition: opacity var(--transition-base);
}

.collection-input-row:hover,
.collection-input-row:focus-within {
  opacity: 1;
}

.collection-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
  margin-right: 6px;
}

.collection-input {
  border: none;
  border-radius: 0;
  padding: 2px 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: color var(--transition-fast);
}

.collection-input:hover,
.collection-input:focus {
  color: var(--text-primary);
}

select.collection-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 16px;
}

input.collection-input {
  cursor: text;
  color: var(--text-primary);
  border-bottom: 1px solid #d1d5db;
  margin-left: 4px;
}

input.collection-input::placeholder {
  color: #b0b8c4;
  font-weight: 400;
  font-style: italic;
}

input.collection-input:focus {
  border-bottom-color: var(--text-secondary);
}

.results-context-collection {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: #4b5563;
  font-weight: 400;
  display: block;
}

.results-context-collection::before {
  content: none;
}

.shortlist-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.collection-filter {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.collection-filter:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.prompt-input::placeholder {
  color: #9ca3af;
}

#recruiter-prompt-main {
  font-size: 0.95rem;
  line-height: 1.4;
}

.prompt-file-btn {
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.prompt-file-btn:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.prompt-file-btn:active {
  transform: scale(0.95);
}

.prompt-file-btn.uploading {
  cursor: wait;
  opacity: 0.7;
}

.prompt-send {
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #9ca3af;
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
}

.prompt-send:hover {
  background: #e5e7eb;
}

.prompt-form {
  display: flex;
  flex-direction: column;
  align-items: center; /* ← centre horizontalement */
  width: 100%;
}

/* Utils */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .sidebar-header .logo-text {
    display: none;
  }

  .btn-new-search {
    font-size: 0.72rem;
    padding-inline: 0.4rem;
  }

  .search-subtitle,
  .search-date {
    display: none;
  }

  .search-title {
    font-size: 0.8rem;
  }

  .search-status {
    font-size: 0.66rem;
  }

  .main-header {
    margin-bottom: 1.6rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 640px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    padding: 1rem 1rem 1.2rem;
  }

  .search-hero-inner {
    max-width: 100%;
  }

  .prompt-box {
    padding-left: 0.9rem;
  }
}
/* ===== Résultats / Shortlist ===== */

.results-main {
  padding-bottom: 1.6rem;
}

.results-context {
  margin-bottom: 1.6rem;
}

.results-context-header {
  margin-bottom: 1rem;
}

.results-context-title {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #020617;
}

.results-context-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
}

.results-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.results-card {
  border-radius: 0.9rem;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  padding: 0.8rem 0.9rem;
  transition: all var(--transition-base);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.results-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-purple);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
}

.results-card-label {
  margin: 0 0 0.25rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.results-card-main {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 500;
  color: #111827;
}

.results-card-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.results-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.results-chip {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  font-size: 0.75rem;
  color: #4338ca;
}

/* Shortlist */

.results-shortlist {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.results-shortlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.results-shortlist-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.results-shortlist-count {
  font-size: 0.8rem;
  color: #6b7280;
}

.results-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.results-empty {
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  color: #6b7280;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 2rem 0;
  padding: 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.loading-dots {
  display: inline-flex;
  gap: 3px;
}

.loading-dot {
  width: 4px;
  height: 4px;
  background: #6366f1;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.loading-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin: 20px 0;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
  border-radius: 2px;
  width: 5%;
  animation: progressExpand 15s ease-in-out forwards;
  transition: width 0.3s ease-out;
}

.loading-steps-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  min-height: 24px;
  margin-top: 16px;
  position: relative;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.loading-step-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading-step-text[data-step="0"] {
  animation: slideInText 0.6s ease-out 0.3s forwards, slideOutText 0.6s ease-in 2.5s forwards;
}

.loading-step-text[data-step="1"] {
  animation: slideInText 0.6s ease-out 3.3s forwards, slideOutText 0.6s ease-in 5.5s forwards;
}

.loading-step-text[data-step="2"] {
  animation: slideInText 0.6s ease-out 6.3s forwards, slideOutText 0.6s ease-in 8.5s forwards;
}

.loading-step-text[data-step="3"] {
  animation: slideInText 0.6s ease-out 9.3s forwards;
}

.loading-patience-message {
  font-size: 0.95rem;
  color: #475569;
  text-align: center;
  font-weight: 500;
  margin: 16px 0 0 0;
  padding: 0 12px;
  animation: slideInText 0.6s ease-out forwards;
}

.shortlist-feedback {
  margin-top: 0.35rem;
}

.shortlist-feedback-card {
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInUp var(--transition-slow) ease-out;
  transition: all var(--transition-base);
}

.shortlist-feedback-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--brand-purple);
}

.shortlist-feedback-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.shortlist-feedback-icon {
  font-size: 18px;
  line-height: 1;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: var(--brand-purple);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.shortlist-feedback-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: #0f172a;
}

.shortlist-feedback-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.shortlist-feedback-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortlist-feedback-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortlist-feedback-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6366f1;
}

.shortlist-feedback-text {
  margin: 0;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
}

.shortlist-feedback-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Carte candidat */

.candidate-card {
  border-radius: 1.2rem;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 1rem 1.1rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  transition: all var(--transition-base);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.candidate-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-purple);
  transform: translateY(-4px);
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}

.candidate-top-click {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 82px; /* zone de clic réduite : nom + tags */
  border-radius: 1rem 1rem 0 0;
  cursor: pointer;
  z-index: 2;
  background: transparent;
}


.candidate-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.candidate-main {
  flex: 1;
  min-width: 0;
}

.candidate-name-line {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.candidate-avatar {
  width: 34px;
  height: 34px;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f9fafb;
}

.candidate-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #020617;
}

.candidate-role {
  margin: 0.05rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.candidate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.candidate-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #4338ca;
  transition: all var(--transition-fast);
  animation: fadeInUp var(--transition-base) ease-out;
}

.candidate-tag:hover {
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
  transform: scale(1.05);
}

/* Pastilles: visibles par défaut (affichage sans hover) */
.candidate-tag,
.results-chip,
.profile-tag,
.search-status,
.candidate-fit-badge {
  opacity: 1;
  transform: none;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: auto;
}

/* Révéler les pastilles lorsque l'on survole l'élément parent */
.search-item:hover .search-status,
.candidate-card:hover .candidate-tag,
.candidate-card:hover .candidate-fit-badge,
.results-card:hover .results-chip,
.profile-section:hover .profile-tag {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Small tweak: keep sidebar-dashboard button visible (navigation principale) */
.sidebar-dashboard-btn { opacity: 1; pointer-events: auto; }

.candidate-resume {
  margin: 0;
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.4;
}

.candidate-fit {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.candidate-fit-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.15rem;
}

.candidate-fit-label {
  font-size: 0.74rem;
  color: #6b7280;
}

.candidate-fit-score {
  font-size: 0.86rem;
  font-weight: 600;
  color: #111827;
}

.candidate-fit-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.candidate-fit-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #22c55e);
}

.candidate-fit-badge {
  font-size: 0.72rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.candidate-fit-badge--strong {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.candidate-fit-badge--moderate {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.35);
}

.candidate-fit-badge--cautious {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.35);
}

/* Bas de carte */

.candidate-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.55rem;
}

.candidate-section-title {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #4b5563;
}

.candidate-list {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.candidate-list li {
  margin-bottom: 0.1rem;
}

/* Boutons actions */

.candidate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.3rem;
}

.btn-primary-outline,
.btn-secondary-outline {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  border-width: 1px;
  border-style: solid;
  background: #ffffff;
}

.btn-shortlist-toggle { white-space: nowrap; display:inline-flex; align-items:center; gap:8px; }

/* Button visual when candidate is saved to personal shortlist: purple */
.btn-shortlist-toggle.shortlisted {
  background: var(--brand-purple); /* même que .profile-fit-score */
  border-color: var(--brand-purple);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(79,70,229,0.12);
}
.btn-shortlist-toggle.shortlisted:hover,
  .btn-shortlist-toggle.shortlisted:focus {
  background: var(--brand-purple-dark); /* violet plus foncé au hover */
  border-color: var(--brand-purple-dark);
  color: #fff;
}
.btn-shortlist-toggle { transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }

.btn-shortlist-toggle .btn-icon { font-size: 0.95rem; line-height: 1; color: currentColor; }
.btn-shortlist-toggle .btn-label { font-size: 0.78rem; }

.btn-primary-outline {
  border-color: #4f46e5;
  color: #312e81;
}

.btn-primary-outline:hover {
  background: #eef2ff;
}

.btn-secondary-outline {
  border-color: #e5e7eb;
  color: #374151;
}

.btn-secondary-outline:hover {
  background: #f3f4f6;
}

.btn-secondary-outline:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Responsive résultats */

@media (max-width: 960px) {
  .results-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-fit {
    width: 160px;
  }
}

@media (max-width: 768px) {
  .results-context-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .candidate-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .candidate-fit {
    width: 100%;
    align-items: flex-start;
  }

  .candidate-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Barre de recherche "raffinage" en bas de page */
.refine-search {
  margin-top: 1.4rem;
  padding-bottom: 1.5rem;
}

.refine-search.loading-refine {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.refine-search.loading-refine .prompt-form {
  display: none;
}

.refine-search.loading-refine .refine-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.refine-loading-container {
  display: none;
}

.refine-loading-text {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 500;
  text-align: center;
}

.refine-loading-bar {
  width: 100%;
  max-width: 300px;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.refine-loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
  border-radius: 2px;
  animation: progressExpand 15s ease-in-out forwards;
}

.prompt-box-small {
  max-width: 720px;
  margin: 0 auto;
}

/* Ajustement du hero pour éviter les bugs d'affichage bas de page */
.search-hero {
  margin-bottom: 1.6rem;
  display: flex;
  justify-content: center;
}

.search-hero-inner {
  width: 100%;
}
.candidate-reason-inline{
  margin-top: 10px;
  margin-bottom: 14px; 
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(99,102,241,.08); /* léger, discret */
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.candidate-reason-icon{
  line-height: 1;
  margin-top: 1px;
  flex: 0 0 auto;
}

.candidate-reason-text{
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  opacity: .95;

  /* 1 ligne par défaut */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.candidate-reason-more{
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .8;
  padding: 0;
}

.candidate-reason-inline.is-expanded .candidate-reason-text{
  white-space: normal;
  overflow: visible;
}

/* ===== DETAILED PROFILE MODAL ===== */

.detailed-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.detailed-profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  animation: fadeInUp var(--transition-base) ease-out;
}

.detailed-profile-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeInUp var(--transition-base) ease-out;
}

.detailed-profile-close {
  position: sticky;
  top: 0;
  right: 0;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 12px 0 0;
  float: right;
}

.detailed-profile-close:hover {
  background: #f3f4f6;
}

.detailed-profile-content {
  padding: 0 32px 32px;
}

/* ===== REFINE SUGGESTIONS MODAL ===== */
.refine-suggestions-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.refine-suggestions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  animation: fadeInUp var(--transition-base) ease-out;
}

.refine-suggestions-container {
  position: relative;
  width: min(520px, 90vw);
  max-height: 80vh;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  animation: fadeInUp var(--transition-base) ease-out;
}

.refine-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.refine-suggestions-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refine-suggestions-title::before {
  content: "💡";
  font-size: 20px;
}

.refine-suggestions-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.refine-suggestions-close:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: rotate(90deg);
}

.refine-suggestions-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.refine-suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.refine-suggestions-list li {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.refine-suggestions-list li:hover {
  background: #eef2ff;
  border-color: #6366f1;
  border-left-color: #6366f1;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.refine-suggestions-list li:active {
  transform: translateX(2px);
}

.refine-suggestions-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
}

.refine-suggestions-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.results-shortlist-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-show-suggestions {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.btn-show-suggestions:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #e9d5ff 100%);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.btn-show-suggestions:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.btn-suggestions-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== CONTACT MODAL ===== */
.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.contact-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  animation: fadeInUp var(--transition-base) ease-out;
}

.contact-container {
  position: relative;
  width: min(540px, 94vw);
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  animation: fadeInUp var(--transition-base) ease-out;
}

.contact-close {
  display: none;
}

.contact-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}

.contact-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contact-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.contact-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #e5e7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #4f46e5;
}

.contact-role {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.contact-match {
  font-size: 13px;
  color: #6b7280;
}

.contact-close-inline {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
}

.contact-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 18px;
}

.contact-tab {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.contact-tab.active {
  background: linear-gradient(135deg, #eef2ff 0%, #f3f5ff 100%);
  border-color: var(--brand-purple);
  color: var(--brand-purple);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.contact-message-block {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

.contact-message-block:focus-within {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.contact-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.contact-message-input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  resize: vertical;
  background: #ffffff;
  transition: all var(--transition-fast);
  font-family: inherit;
  box-sizing: border-box;
}

.contact-message-input:focus {
  outline: none;
  border-color: var(--border-light);
  box-shadow: none;
  background: #ffffff;
}

.contact-message-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.contact-chip {
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
}

.contact-chip:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
  border-color: var(--brand-purple);
  color: var(--brand-purple);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.contact-info {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
  font-size: 13px;
  color: #374151;
}

.contact-info-item a {
  color: #4f46e5;
  text-decoration: none;
}

.contact-send {
  width: 100%;
  border: none;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
  font-size: 15px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.contact-send::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width var(--transition-base), height var(--transition-base);
}

.contact-send:hover::before {
  width: 300px;
  height: 300px;
}

.contact-send:hover {
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

@media (max-width: 540px) {
  .contact-tabs {
    grid-template-columns: 1fr;
  }
}

/* Profil Header */
.profile-header {
  display: grid;
  grid-template-columns: 80px 1fr 200px;
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
  clear: both;
  animation: fadeInUp var(--transition-slow) ease-out;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.profile-intro h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.profile-intro .profile-name {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.profile-intro .profile-role {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: #4f46e5;
}

.profile-intro .profile-location {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.profile-fit-summary {
  text-align: right;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
}

.profile-fit-score {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand-purple);
  margin: 0 0 4px;
}

.profile-fit-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

.recommendation-strong {
  font-size: 13px;
  font-weight: 600;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
}

.recommendation-moderate {
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  background: rgba(217, 119, 6, 0.12);
  padding: 6px 10px;
  border-radius: 6px;
}

.recommendation-cautious {
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
}

/* Grid de sections */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.profile-section {
  grid-column: span 1;
  animation: fadeInUp var(--transition-slow) ease-out;
  animation-fill-mode: both;
}

.profile-section:nth-child(1) { animation-delay: 0.1s; }
.profile-section:nth-child(2) { animation-delay: 0.2s; }
.profile-section:nth-child(3) { animation-delay: 0.3s; }
.profile-section:nth-child(4) { animation-delay: 0.4s; }
.profile-section:nth-child(5) { animation-delay: 0.5s; }
.profile-section:nth-child(6) { animation-delay: 0.6s; }

.profile-section.profile-section-wide {
  grid-column: 1 / -1;
}

.profile-section:nth-child(1),
.profile-section:nth-child(2) {
  grid-column: span 1;
}

/* Section complète en largeur */
.profile-section:nth-child(3n+1):nth-child(-n+5) {
  grid-column: span 1;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-section {
    grid-column: span 1 !important;
  }

  .profile-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-fit-summary {
    text-align: left;
  }
}

.profile-section-title {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Info Grid */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.profile-info-item {
  padding: 14px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  animation: fadeInUp var(--transition-slow) ease-out;
}

.profile-info-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--brand-purple);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
}

.profile-info-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.profile-info-value {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  word-break: break-word;
}

.profile-info-value a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}

.profile-info-value a:hover {
  text-decoration: underline;
}

/* Tags */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag {
  display: inline-block;
  padding: 7px 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4338ca;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
  animation: fadeInUp var(--transition-base) ease-out;
  transition: all var(--transition-fast);
}

.profile-tag:hover {
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
  transform: scale(1.05);
}

.profile-tag-soft {
  background: #fef3c7;
  color: #78350f;
}

/* Listes */
.profile-list {
  margin: 0;
  padding-left: 20px;
}

.profile-list li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.profile-list-alert li {
  color: #7f1d1d;
}

/* Texte long */
.profile-reason,
.profile-resume,
.profile-transcript {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #4f46e5;
  white-space: pre-line;
}

.profile-resume {
  border-left-color: #22c55e;
}

.profile-transcript {
  border-left-color: #f59e0b;
}

/* Actions en bas */
.profile-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  min-width: 160px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-base), height var(--transition-base);
}

.btn-primary:hover::before:not(:disabled) {
  width: 300px;
  height: 300px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-purple-dark);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

/* Make 'Télécharger le CV' in the detailed profile use the HumaAI violet */
.detailed-profile-content .btn-primary {
  background: #4f46e5; /* match profile fit score color */
  border-color: #4f46e5;
  color: #ffffff;
}
.detailed-profile-content .btn-primary:hover:not(:disabled) {
  background: #4338ca; /* same hover as .btn-primary */
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  flex: 1;
  min-width: 160px;
  padding: 12px 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffffff 0%, var(--bg-light) 100%);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0), rgba(99, 102, 241, 0.05));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
  border-color: var(--brand-purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover::before {
  opacity: 1;
}

@media (max-width: 600px) {
  .detailed-profile-container {
    width: 95%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .detailed-profile-content {
    padding: 16px;
  }

  .profile-header {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .profile-grid {
    gap: 24px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* ========================================================================
   SIDEBAR COLLAPSE (Messaging page)
   ======================================================================== */

.sidebar-collapse-btn {
  position: fixed;
  top: 16px;
  left: 248px;
  z-index: 1100;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.3s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.sidebar-collapse-btn:hover {
  background: #eef2ff;
  border-color: var(--brand-purple);
  color: var(--brand-purple);
}

/* Move button to left edge when collapsed */
.sidebar-collapsed .sidebar-collapse-btn {
  left: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Collapsed state — sidebar slides out, grid adapts */
.sidebar-collapsed .app-sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr) !important;
}

.app-shell {
  transition: grid-template-columns 0.3s ease;
}

.app-sidebar {
  transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease, opacity 0.2s ease, border 0.2s ease;
}

/* ========================================================================
   MESSAGING PAGE — 3-column layout (Inbox / Thread / Candidate Panel)
   ======================================================================== */

/* Main container replaces .app-main for the messaging page */
.msg-main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

/* ========== INBOX (left column) ========== */
.msg-inbox {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-light);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
}

.msg-inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1rem 0.6rem 2.2rem;
  flex-shrink: 0;
}

.msg-inbox-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.msg-inbox-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-purple);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Search */
.msg-search-box {
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

.msg-search-box {
  position: relative;
}

.msg-search-icon {
  position: absolute;
  left: 1.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

.msg-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.8rem 0.55rem 2.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.msg-search-input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #ffffff;
}

.msg-search-input::placeholder {
  color: #9ca3af;
}

/* Filter tabs */
.msg-filter-tabs {
  display: flex;
  gap: 0;
  padding: 0 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}

.msg-filter-tab {
  flex: 1;
  padding: 0.55rem 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.msg-filter-tab:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.04);
}

.msg-filter-tab.active {
  color: var(--brand-purple);
  border-bottom-color: var(--brand-purple);
}

.msg-filter-tab:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Conversation list */
.msg-conversation-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.4rem 0.5rem;
}

/* Conversation item */
.msg-conv-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  animation: fadeInUp var(--transition-slow) ease-out;
}

.msg-conv-item:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
  border-color: rgba(99, 102, 241, 0.1);
}

.msg-conv-item-active {
  background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 100%);
  border-color: var(--brand-purple);
  box-shadow: var(--shadow-sm);
}

.msg-conv-item-unread {
  background: rgba(99, 102, 241, 0.03);
}

.msg-conv-item:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: -1px;
}

/* Avatar */
.msg-conv-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 1.5px solid #e2e8f0;
  position: relative;
}

.msg-conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.msg-conv-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.msg-conv-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-item-unread .msg-conv-name {
  font-weight: 700;
}

.msg-conv-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.msg-conv-role {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-preview {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.msg-conv-item-unread .msg-conv-preview {
  color: var(--text-primary);
  font-weight: 500;
}

.msg-conv-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.msg-conv-status {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}

.msg-conv-unread-badge {
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--brand-purple);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Status badge colors */
.msg-badge-invited {
  background: #dbeafe;
  color: #1e40af;
}

.msg-badge-replied {
  background: #dcfce7;
  color: #166534;
}

.msg-badge-followup {
  background: #fef3c7;
  color: #a16207;
}

.msg-badge-interview {
  background: #e0e7ff;
  color: #4338ca;
}

.msg-badge-closed {
  background: #f3f4f6;
  color: #6b7280;
}

/* Inbox empty state */
.msg-inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
}

.msg-inbox-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.msg-inbox-empty-title {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.msg-inbox-empty-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* ========== THREAD (center column) ========== */
.msg-thread {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  position: relative;
}

.msg-thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  text-align: center;
}

.msg-thread-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.msg-thread-empty-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.msg-thread-empty-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-tertiary);
  max-width: 300px;
}

/* Thread content wrapper */
.msg-thread-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Thread header (sticky) */
.msg-thread-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  flex-shrink: 0;
  z-index: 2;
}

.msg-back-btn {
  display: none; /* shown on mobile */
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.msg-back-btn:hover {
  background: var(--bg-lighter);
  border-color: var(--brand-purple);
}

.msg-thread-header-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.msg-thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 1.5px solid #e2e8f0;
}

.msg-thread-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-thread-role {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.msg-thread-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Status dropdown */
.msg-status-dropdown {
  position: relative;
}

.msg-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all var(--transition-fast);
}

.msg-status-btn:hover {
  border-color: var(--brand-purple);
  background: var(--bg-lighter);
}

.msg-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.msg-status-arrow {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.msg-status-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.3rem;
  margin: 0;
  animation: fadeInUp 150ms ease-out;
}

.msg-status-menu li {
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.msg-status-menu li:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #f3f4f6 100%);
  color: var(--brand-purple);
}

/* Action buttons in header */
.msg-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.msg-action-btn:hover {
  background: var(--bg-lighter);
  border-color: var(--brand-purple);
  transform: translateY(-1px);
}

.msg-action-btn:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 1px;
}

/* Messages list */
.msg-messages-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Date separator */
.msg-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

.msg-date-separator span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: #f3f4f6;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
}

/* Message bubbles */
.msg-bubble-row {
  display: flex;
  gap: 0.5rem;
  max-width: 80%;
  animation: fadeInUp 200ms ease-out;
}

.msg-bubble-left {
  align-self: flex-start;
}

.msg-bubble-right {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-bubble {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-lg);
  max-width: 100%;
  word-wrap: break-word;
}

.msg-bubble-candidate {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

.msg-bubble-recruiter {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.msg-bubble-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg-bubble-time {
  display: block;
  font-size: 0.68rem;
  margin-top: 0.25rem;
  opacity: 0.65;
}

.msg-bubble-candidate .msg-bubble-time {
  color: var(--text-tertiary);
}

.msg-bubble-recruiter .msg-bubble-time {
  color: rgba(255, 255, 255, 0.75);
}

/* System event */
.msg-system-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.msg-system-icon {
  font-size: 0.85rem;
}

.msg-system-time {
  font-size: 0.68rem;
  color: #9ca3af;
}

/* Composer (sticky bottom) */
.msg-composer {
  padding: 0.6rem 1rem 0.8rem;
  border-top: 1px solid var(--border-light);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  flex-shrink: 0;
}

.msg-composer-templates {
  position: relative;
  margin-bottom: 0.4rem;
}

.msg-template-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.msg-template-btn:hover {
  background: var(--bg-lighter);
  border-color: var(--brand-purple);
  color: var(--brand-purple);
}

.msg-template-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.3rem;
  margin: 0;
  animation: fadeInUp 150ms ease-out;
}

.msg-template-menu li {
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.msg-template-menu li:hover {
  background: linear-gradient(135deg, #eef2ff 0%, #f3f4f6 100%);
  color: var(--brand-purple);
}

.msg-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 0.5rem 0.6rem;
  transition: all var(--transition-fast);
}

.msg-composer-box:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #ffffff;
}

.msg-composer-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: transparent;
  line-height: 1.5;
  padding: 0.15rem 0;
  min-height: 20px;
  max-height: 120px;
}

.msg-composer-input::placeholder {
  color: #9ca3af;
}

.msg-attach-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.msg-attach-btn:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #eef2ff 100%);
  border-color: var(--brand-purple);
  transform: scale(1.05);
}

.msg-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.msg-send-btn:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.msg-send-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

.msg-send-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* ========== CANDIDATE PANEL (right column) — Redesign ========== */
.msg-candidate-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
}

.msg-panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
}

.msg-panel-empty-text {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: center;
}

.msg-panel-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.msg-panel-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* ── Identity row ── */
.msg-panel-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.msg-panel-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.msg-panel-identity-info {
  flex: 1;
  min-width: 0;
}

.msg-panel-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-panel-role {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score badge — inline circle */
.msg-panel-score-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  background: #6366f1;
}

.msg-panel-score-badge.score-high {
  background: linear-gradient(135deg, #10b981, #059669);
}

.msg-panel-score-badge.score-mid {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.msg-panel-score-badge.score-low {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ── Quick info pills ── */
.msg-panel-quick-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Card sections ── */
.msg-panel-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg-panel-card-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-purple);
}

.msg-panel-card-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ── Evaluation (strengths + weaknesses) ── */
.msg-panel-eval {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg-panel-eval-col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.msg-panel-eval-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.msg-panel-eval-label--green {
  color: #059669;
}

.msg-panel-eval-label--red {
  color: #dc2626;
}

.msg-panel-eval-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-secondary);
  list-style: disc;
}

.msg-panel-eval-list li {
  margin-bottom: 0.15rem;
}

.msg-panel-eval-col:first-child .msg-panel-eval-list li::marker {
  color: #10b981;
}

.msg-panel-eval-col:last-child .msg-panel-eval-list li::marker {
  color: #ef4444;
}

/* ── Skills ── */
.msg-panel-skill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.msg-panel-skill-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4338ca;
  background: #eef2ff;
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  flex-shrink: 0;
}

.msg-panel-skill-label--soft {
  color: #78350f;
  background: #fef3c7;
}

.msg-panel-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.msg-panel-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid #e2e8f0;
  line-height: 1.4;
}

.msg-panel-chip--soft {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ── Info grid (2-col) ── */
.msg-panel-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.msg-panel-info-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.msg-panel-info-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.msg-panel-info-value {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.35;
}

/* ── Links row ── */
.msg-panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-panel-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-purple);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: #fff;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-panel-link:hover {
  background: #eef2ff;
  border-color: var(--brand-purple);
}

/* ── Actions ── */
.msg-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
}

.msg-panel-action-btn {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-align: center;
}

.msg-panel-action-primary {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-purple-dark));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.msg-panel-action-primary:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.msg-panel-action-secondary {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text-primary);
}

.msg-panel-action-secondary:hover {
  background: var(--bg-lighter);
  border-color: var(--brand-purple);
  color: var(--brand-purple);
}

.msg-panel-action-danger {
  background: #ffffff;
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.msg-panel-action-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* ── Collapsible transcript ── */
.msg-panel-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.msg-panel-collapse-btn:hover {
  color: var(--brand-purple);
}

.msg-panel-collapse-arrow {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  transition: transform 200ms ease;
}

.msg-panel-collapse-content {
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  border-left: 3px solid #f59e0b;
}

/* ========== RESPONSIVE ========== */

/* Tablet: 2 columns (inbox + thread), panel as overlay */
@media (max-width: 1100px) {
  .msg-main {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .msg-candidate-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    border-left: 1px solid var(--border-light);
  }

  .msg-candidate-panel.msg-panel-visible {
    display: flex;
  }

  .msg-panel-close {
    display: flex;
  }
}

/* Mobile: single panel navigation */
@media (max-width: 700px) {
  .msg-main {
    grid-template-columns: 1fr;
  }

  .msg-inbox {
    display: flex;
  }

  .msg-inbox-hidden-mobile {
    display: none !important;
  }

  .msg-thread {
    display: none;
  }

  .msg-thread-visible-mobile {
    display: flex !important;
  }

  .msg-back-btn {
    display: flex;
  }

  .msg-candidate-panel {
    width: 100%;
    left: 0;
  }

  .msg-thread-header-actions {
    gap: 0.25rem;
  }

  .msg-action-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

/* Small sidebar on messaging page at medium breakpoint */
@media (max-width: 880px) {
  .msg-main {
    /* Let the sidebar shrink handled by app-shell */
  }
}

