/* Fiche candidat recruteur V2 — scoped sous .cand-detail-v2 */
.cand-detail-v2 {
  --green-l: var(--green-bg);
  --green-m: var(--green);
  --orange-l: #fff3cd;
  --orange: #b45309;
  --red-l: var(--red-bg);
  --g3: var(--hint);
  padding: 10px 12px 20px;
  box-sizing: border-box;
  /* #172 — layout 2 colonnes seulement si le panneau est assez large (évite le wrap lettre-à-lettre) */
  container-type: inline-size;
  container-name: cand-detail;
}

.cand-detail-v2 .progress-bar-wrap {
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 12px 10px;
  margin-bottom: 12px;
}
.cand-detail-v2 .progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.cand-detail-v2 .ps-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0.45;
}
.cand-detail-v2 .ps-item.active,
.cand-detail-v2 .ps-item.done {
  opacity: 1;
}
.cand-detail-v2 .ps-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.cand-detail-v2 .ps-item.active .ps-dot {
  background: var(--bx);
  border-color: var(--bx);
  color: #fff;
}
.cand-detail-v2 .ps-item.done .ps-dot {
  background: var(--green-l);
  border-color: var(--green-m);
  color: var(--green-m);
  font-size: 12px;
}
.cand-detail-v2 .ps-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.cand-detail-v2 .ps-item.active .ps-label {
  color: var(--bx);
  font-weight: 700;
}

.cand-detail-v2 .cand-header {
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.cand-detail-v2 .cand-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cand-detail-v2 .cand-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.cand-detail-v2 .reliable-ring {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-m);
  border: 2px solid var(--surface);
}
.cand-detail-v2 .cand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.cand-detail-v2 .cand-phone {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.cand-detail-v2 .cand-loc {
  font-size: 11px;
  color: var(--hint);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cand-detail-v2 .cand-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cand-detail-v2 .v2-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cand-detail-v2 .badge-r {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .badge-n {
  background: var(--bx-l);
  color: var(--bx);
}
.cand-detail-v2 .badge-s {
  background: var(--gold-l);
  color: #7a5200;
}

.cand-detail-v2 .vocal-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cand-detail-v2 .play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bx);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cand-detail-v2 .vocal-info {
  flex: 1;
  min-width: 0;
}
.cand-detail-v2 .vocal-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.cand-detail-v2 .vocal-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.cand-detail-v2 .vocal-fill {
  height: 100%;
  width: 0;
  background: var(--bx);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.cand-detail-v2 .vocal-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  margin-top: 4px;
}
.cand-detail-v2 .wave-bar {
  width: 3px;
  background: var(--bx);
  border-radius: 2px;
  animation: v2-wave 0.8s ease-in-out infinite;
}
.cand-detail-v2 .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.cand-detail-v2 .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.cand-detail-v2 .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.cand-detail-v2 .wave-bar:nth-child(5) { animation-delay: 0.15s; }
.cand-detail-v2 .wave-bar:nth-child(6) { animation-delay: 0.25s; }
.cand-detail-v2 .wave-bar:nth-child(7) { animation-delay: 0.05s; }
.cand-detail-v2 .wave-bar:nth-child(8) { animation-delay: 0.35s; }
@keyframes v2-wave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}
.cand-detail-v2 .vocal-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--hint);
  margin-top: 3px;
}

.cand-detail-v2 .steps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cand-detail-v2 .step-block {
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 0.2s;
  min-width: 0;
}
.cand-detail-v2 .step-block.active,
.cand-detail-v2 .step-block.done {
  opacity: 1;
}
.cand-detail-v2 .step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cand-detail-v2 .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.cand-detail-v2 .step-block.active .step-num {
  background: var(--bx);
  border-color: var(--bx);
  color: #fff;
}
.cand-detail-v2 .step-block.done .step-num {
  background: var(--green-l);
  border-color: var(--green-m);
  color: var(--green-m);
}
.cand-detail-v2 .step-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}
.cand-detail-v2 .step-status-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.cand-detail-v2 .tag-todo {
  background: var(--bg);
  color: var(--hint);
}
.cand-detail-v2 .tag-active {
  background: var(--bx-l);
  color: var(--bx);
}
.cand-detail-v2 .tag-done {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .step-body {
  padding: 18px 18px 20px;
  min-width: 0;
}

.cand-detail-v2 .contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cand-detail-v2 .contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border-md);
  background: var(--bg);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.12s;
  position: relative;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cand-detail-v2 .contact-btn:active {
  transform: scale(0.96);
}
.cand-detail-v2 .cb-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.cand-detail-v2 .cb-call .cb-icon {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .cb-wa .cb-icon {
  background: #e7f9ef;
  color: #25d366;
}
.cand-detail-v2 .cb-wa.confirmed {
  border-color: #25d366;
}
.cand-detail-v2 .cb-sms .cb-icon {
  background: var(--blue-bg);
  color: var(--blue);
}
.cand-detail-v2 .wa-unconfirmed {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-md);
  font-size: 10px;
  font-weight: 700;
  color: var(--hint);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cand-detail-v2 .contact-hint {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--gold-l);
  border-radius: 10px;
  font-size: 12px;
  color: #7a5200;
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}
.cand-detail-v2 .contact-hint i {
  flex-shrink: 0;
  margin-top: 1px;
}

.cand-detail-v2 .outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cand-detail-v2 .outcome-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border-md);
  background: var(--bg);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
  min-width: 0;
}
.cand-detail-v2 .outcome-btn .ob-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cand-detail-v2 .ob-default .ob-icon {
  background: var(--bg);
}
.cand-detail-v2 .ob-answered {
  border-color: var(--green-m);
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .ob-unreachable.active {
  border-color: var(--orange);
  background: var(--orange-l);
  color: var(--orange);
}
.cand-detail-v2 .ob-not-interested.active {
  border-color: var(--red);
  background: var(--red-l);
  color: var(--red);
}
.cand-detail-v2 .outcome-tip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cand-detail-v2 .tip-answered {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .tip-unreachable {
  background: var(--orange-l);
  color: var(--orange);
}
.cand-detail-v2 .tip-rejected {
  background: var(--red-l);
  color: var(--red);
}

.cand-detail-v2 .decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cand-detail-v2 .decision-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-md);
  background: var(--bg);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: all 0.15s;
}
.cand-detail-v2 .decision-detail {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.cand-detail-v2 .db-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cand-detail-v2 .db-short .db-icon {
  background: var(--gold-l);
  color: var(--gold);
}
.cand-detail-v2 .db-hold .db-icon {
  background: var(--blue-bg);
  color: var(--blue);
}
.cand-detail-v2 .db-done .db-icon {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .db-reject .db-icon {
  background: var(--orange-l, #FFF3E0);
  color: var(--orange, #E07B00);
}
.cand-detail-v2 .db-hired .db-icon {
  background: var(--green-l);
  color: var(--green-m);
}
.cand-detail-v2 .db-block .db-icon {
  background: var(--red-l);
  color: var(--red);
}
.cand-detail-v2 .db-short.active {
  border-color: var(--gold);
  background: var(--gold-l);
}
.cand-detail-v2 .db-hold.active {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.cand-detail-v2 .db-done.active {
  border-color: var(--green-m);
  background: var(--green-l);
}
.cand-detail-v2 .db-reject.active {
  border-color: var(--orange, #E07B00);
  background: var(--orange-l, #FFF3E0);
}
.cand-detail-v2 .db-hired.active {
  border-color: var(--green-m);
  background: var(--green-l);
}
.cand-detail-v2 .db-block.active {
  border-color: var(--red);
  background: var(--red-l);
}

.cand-detail-v2 .cta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--navy), #1a2d5a);
  border-radius: var(--r-sm);
  color: #fff;
}
.cand-detail-v2 .cta-text {
  flex: 1;
  min-width: 0;
}
.cand-detail-v2 .cta-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.cand-detail-v2 .cta-sub {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 3px;
  line-height: 1.35;
}
.cand-detail-v2 .cta-action-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bx);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.cand-detail-v2 .tunnel-validate-decision-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cand-detail-v2 .rep-section {
  margin-top: 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 12px;
}
.cand-detail-v2 .rep-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.cand-detail-v2 .det-profile-block {
  margin-top: 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 12px;
}
.cand-detail-v2 .det-profile-block .step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.cand-detail-v2 .v2-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cand-detail-v2 .v2-detail-main {
  min-width: 0;
}
.cand-detail-v2 .activity-log {
  margin-top: 0;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 16px 18px 18px;
  min-width: 0;
}
.cand-detail-v2 .activity-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.cand-detail-v2 .activity-title-secondary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cand-detail-v2 .portal-hist-hotel {
  font-size: 11px;
  color: var(--muted);
  margin: -4px 0 10px;
}
.cand-detail-v2 .portal-hist-head {
  font-size: 10px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.cand-detail-v2 .portal-hist-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0 4px;
  line-height: 1.45;
}
.cand-detail-v2 .portal-hist-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.cand-detail-v2 .portal-hist-item:last-child {
  border-bottom: none;
}
.cand-detail-v2 .portal-hist-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.cand-detail-v2 .portal-hist-date {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cand-detail-v2 .portal-hist-posts {
  margin-top: 5px;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.cand-detail-v2 .portal-hist-motiv {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.cand-detail-v2 .portal-hist-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--hint);
}
.cand-detail-v2 .activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.cand-detail-v2 .activity-item:last-child {
  border-bottom: none;
}
.cand-detail-v2 .act-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.cand-detail-v2 .act-text {
  flex: 1;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
}
.cand-detail-v2 .act-time {
  font-size: 10px;
  color: var(--hint);
  flex-shrink: 0;
  white-space: nowrap;
}

/* 2 colonnes uniquement si le panneau détail est assez large (≥720px).
   Dans le split Recherche/Candidats (~500–650px), on empile pour aérer. */
@container cand-detail (min-width: 720px) {
  .v2-detail-layout.has-activity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 22px;
    align-items: start;
  }
  .v2-detail-layout.has-activity .activity-log {
    margin-top: 0;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

/* Fallback navigateur sans container queries : viewport large seulement */
@supports not (container-type: inline-size) {
  @media (min-width: 1400px) {
    .cand-detail-v2 .v2-detail-main {
      flex: 1;
      min-width: 0;
    }
    .cand-detail-v2 .v2-detail-layout.has-activity {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
      gap: 22px;
      align-items: start;
    }
    .cand-detail-v2 .v2-detail-layout.has-activity .activity-log {
      margin-top: 0;
      position: sticky;
      top: 12px;
      max-height: calc(100vh - 140px);
      overflow-y: auto;
    }
  }
}

@media (min-width: 1024px) {
  .cand-detail-v2 .v2-detail-main {
    flex: 1;
    min-width: 0;
  }
}
