/* Palette, polices, rayons, ombres : voir styles-base.css (source unique,
   chargee avant ce fichier). Rien n'est redefini ici. */

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--police-texte);
    -webkit-font-smoothing: antialiased;
  }

  .screen {
    max-width: 1040px;
    margin: 0 auto;
    padding: 36px 24px 56px;
  }

  /* ---------- Navigation ---------- */

  .top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .brand-logo {
    font-family: var(--police-titre);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px 8px 0;
    margin-right: 4px;
  }

  .nav-link {
    font-family: var(--police-texte);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav-link.active {
    background: var(--green);
    color: #FFFFFF;
  }

  .nav-link:not(.active):hover {
    background: var(--track-bg);
  }

  /* ---------- Zone connexion / compte (coin haut droit) ---------- */

  .auth-btn {
    font-family: var(--police-texte);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--divider);
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .auth-btn:hover {
    background: var(--track-bg);
  }

  .auth-user-zone {
    position: relative;
  }

  .auth-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--police-texte);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--divider);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
  }

  .auth-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green);
    color: #FFFFFF;
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .auth-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 50;
  }

  .auth-user-menu.open {
    display: block;
  }

  .auth-user-menu button,
  .auth-user-menu a {
    display: block;
    width: 100%;
    text-align: left;
    font-family: var(--police-texte);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: none;
    border: none;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
  }

  .auth-user-menu button:hover,
  .auth-user-menu a:hover {
    background: var(--bg);
  }


  .auth-erreur {
    background: var(--erreur-fond);
    color: var(--erreur-texte);
  }

  .auth-info {
    background: var(--succes-fond);
    color: var(--accent-fonce);
  }

  header {
    margin-bottom: 24px;
  }

  header h1 {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 30px;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
  }

  header p {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
  }

  /* ---------- Bandeau de stats ---------- */

  .stats-card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
    padding: 26px 28px;
    margin-bottom: 28px;
  }

  .stats {
    display: flex;
    align-items: center;
  }

  .stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
  }

  .stat:first-child {
    padding-left: 4px;
  }

  .stat:last-child {
    padding-right: 4px;
  }

  .stat + .stat {
    border-left: 1px solid var(--divider);
  }

  .donut {
    --pct: 50;
    --donut-color: var(--green);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(var(--donut-color) calc(var(--pct) * 1%), var(--track-bg) 0);
    position: relative;
  }

  .donut::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--card);
  }

  .stat-text {
    display: flex;
    flex-direction: column;
  }

  .stat-value {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.2;
  }

  .stat-value.alert {
    color: var(--attention-texte);
  }

  .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
  }

  /* ---------- Tableau (PC) ---------- */

  .table-wrap {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
    overflow: hidden;
  }

  .empty-state {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
    padding: 56px 32px;
    text-align: center;
  }

  .empty-state p {
    font-family: var(--police-texte);
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 22px;
  }

  .empty-state .btn {
    display: inline-block;
    width: auto;
    text-decoration: none;
  }

  .data-table {
    width: 100%;
    border-collapse: collapse;
  }

  .data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--divider);
  }

  .data-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
    font-size: 14px;
  }

  .data-table tbody tr:last-child td {
    border-bottom: none;
  }

  .data-table tbody tr:hover {
    background: var(--bg);
  }

  .col-actions {
    width: 44px;
  }

  .delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  }

  .data-table tbody tr:hover .delete-btn {
    opacity: 1;
  }

  .delete-btn:hover {
    background: var(--attention-fond);
    color: var(--attention-texte);
  }

  .delete-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  .badge-new {
    display: inline-flex;
    align-items: center;
    background: var(--green);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
  }

  .cell-company {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 15px;
  }

  .cell-role {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  .cell-date,
  .cell-followup {
    color: var(--text-secondary);
  }

  .cell-followup.alert {
    color: var(--attention-texte);
    font-weight: 500;
  }

  .status-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  .status-todo {
    background: var(--status-todo-bg);
    color: var(--status-todo-text);
  }

  .status-sent {
    background: var(--status-sent-bg);
    color: var(--status-sent-text);
  }

  .status-followup {
    background: var(--status-followup-bg);
    color: var(--status-followup-text);
  }

  .status-interview {
    background: var(--status-interview-bg);
    color: var(--status-interview-text);
  }

  .progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
  }

  .progress-bar {
    flex: 1;
    height: 6px;
    background: var(--track-bg);
    border-radius: 999px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 999px;
  }

  .progress-pct {
    font-size: 12px;
    color: var(--text-secondary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
  }

  /* ---------- Cartes (mobile) ---------- */

  .cards {
    display: none;
    flex-direction: column;
    gap: 14px;
  }

  .card {
    background: var(--card);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
  }

  .card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .card-company {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
  }

  .card-role {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  .card-progress {
    margin-top: 12px;
  }

  .card-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--divider);
  }

  .card-meta.alert {
    color: var(--attention-texte);
    font-weight: 500;
  }

  .card-delete-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .card-delete-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  /* ---------- Confirmation de suppression ---------- */

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .modal-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  /* Ces deux modales s'ouvrent depuis la fiche candidature :
     elles doivent passer devant elle, pas derrière. */
  #messageModalOverlay,
  #contactModalOverlay {
    z-index: 150;
  }

  .confirm-box {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.28);
    padding: 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.25s ease;
  }

  .modal-overlay.open .confirm-box {
    transform: scale(1);
  }

  .confirm-box h2 {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 22px;
    line-height: 1.4;
  }

  .confirm-box p {
    font-family: var(--police-texte);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: -12px 0 22px;
  }

  .confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* ---------- Message d'erreur global (bandeau flottant) ---------- */

  .toast-erreur {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--erreur-fond);
    color: var(--erreur-texte);
    font-family: var(--police-texte);
    font-size: 13px;
    font-weight: 600;
    padding: 13px 20px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    max-width: 90vw;
    text-align: center;
  }

  .toast-erreur.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .btn {
    font-family: var(--police-texte);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    width: 100%;
  }

  .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--divider);
  }

  .btn-danger {
    background: var(--attention-texte);
    color: #FFFFFF;
  }

  .btn-primary {
    background: var(--green);
    color: #FFFFFF;
    width: auto;
  }

  .btn-cloture {
    background: var(--attention-texte);
    color: #FFFFFF;
    width: auto;
  }

  .cell-company-link,
  .card-company-link {
    cursor: pointer;
    width: fit-content;
  }

  .cell-company-link:hover,
  .card-company-link:hover {
    text-decoration: underline;
  }

  /* ---------- Fiche détaillée d'une candidature ---------- */

  .modal-box {
    position: relative;
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.28);
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s ease;
  }

  .modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
  }

  .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
  }

  .modal-close:hover {
    background: var(--track-bg);
    color: var(--text);
  }

  .modal-scroll {
    overflow-y: auto;
    padding: 56px 28px 28px;
  }

  .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
  }

  .modal-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }

  .modal-logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 22px;
  }

  .modal-company {
    font-size: 14px;
    color: var(--text-secondary);
  }

  .modal-role {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 22px;
    margin-top: 2px;
    line-height: 1.25;
  }

  .modal-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
  }

  .info-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
  }

  .info-pill {
    background: var(--track-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 999px;
  }

  .modal-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
  }

  .modal-section h2,
  .highlight-box h2 {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 14px;
  }

  .modal-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 12px;
  }

  .modal-section p:last-child {
    margin-bottom: 0;
  }

  .fiche-note {
    color: var(--text-secondary);
    font-style: italic;
  }

  .modal-section ul,
  .highlight-box ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .modal-section ul li,
  .highlight-box ul li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    padding-left: 22px;
    position: relative;
  }

  .modal-section ul li::before,
  .highlight-box ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
  }

  .highlight-box {
    background: var(--succes-fond);
    border-radius: 18px;
    padding: 22px 24px;
    margin-top: 20px;
  }

  .highlight-box ul li {
    font-weight: 600;
  }

  .keyword-group {
    margin-top: 16px;
  }

  .keyword-group:first-of-type {
    margin-top: 0;
  }

  .keyword-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 0 0 8px;
  }

  .keyword-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .keyword-pill {
    background: #FFFFFF;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 999px;
  }

  .keyword-fallback {
    font-size: 14px;
    color: var(--text-secondary);
  }

  .company-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
  }

  .company-meta strong {
    color: var(--text);
    font-weight: 600;
  }

  @media (max-width: 760px) {
    .modal-scroll {
      padding: 52px 18px 20px;
    }

    .modal-role {
      font-size: 19px;
    }



  }

  /* ---------- Tes relances du jour ---------- */

  .relances-section {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
    padding: 24px 26px;
    margin-bottom: 28px;
  }

  .relances-section h2 {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 16px;
  }

  .relances-liste {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .relance-vide {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
  }

  /* ---------- Relances + calendrier fusionnés ---------- */

  .relances-sous-titre {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -8px 0 16px;
  }

  .relances-flex {
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }

  .relances-gauche {
    flex: 1;
    min-width: 0;
  }

  .relances-droite {
    flex-shrink: 0;
  }

  .calendrier-legende {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
  }

  .calendrier-legende > span {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .legende-point {
    width: 12px;
    height: 12px;
    border-radius: 5px;
    flex-shrink: 0;
  }

  .legende-prevu { background: var(--green); }
  .legende-retard { background: var(--status-followup-text); }
  .legende-jour { border: 2px solid var(--green); background: var(--card); }

  /* Double cadre arrondi autour de la grille, comme la maquette d'origine */
  .calendrier-cadre {
    border: 1px solid var(--divider);
    border-radius: 24px;
    padding: 8px;
    transition: border-color 0.2s ease;
  }

  .calendrier-cadre:hover {
    border-color: var(--green);
  }

  .calendrier-inner {
    border: 2px solid rgba(16, 24, 40, 0.04);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 1.5px 0 rgba(165, 158, 132, 0.32) inset;
  }

  .calendrier-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }

  .cal-mois {
    font-family: var(--police-titre);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
  }

  .cal-nav {
    width: 28px;
    height: 28px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .cal-nav:hover {
    background: var(--bg);
    border-color: var(--green);
  }

  .calendrier-grille {
    display: grid;
    grid-template-columns: repeat(7, 34px);
    gap: 6px;
    justify-content: center;
  }

  .cal-jour {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    padding: 0;
  }

  .cal-entete-jour {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  .cal-marque {
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .cal-marque:hover {
    transform: scale(1.12);
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.18);
  }

  .cal-prevu {
    background: var(--green);
    color: #FFFFFF;
  }

  .cal-retard {
    background: var(--status-followup-bg);
    color: var(--status-followup-text);
  }

  .cal-aujourdhui {
    outline: 2px solid var(--green);
    outline-offset: 1px;
  }

  .cal-selectionne {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  }

  /* Détail du jour cliqué */
  .calendrier-detail {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .detail-titre {
    font-family: var(--police-titre);
    font-size: 14px;
    font-weight: 600;
  }

  .detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-family: var(--police-texte);
    transition: border-color 0.15s ease;
  }

  .detail-item:hover {
    border-color: var(--green);
  }

  .detail-entreprise {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }

  .detail-meta {
    font-size: 12px;
    color: var(--text-secondary);
  }

  @media (max-width: 860px) {
    .relances-flex {
      flex-direction: column;
      align-items: stretch;
    }

    .relances-droite {
      align-self: center;
      max-width: 100%;
    }

    .calendrier-grille {
      grid-template-columns: repeat(7, minmax(28px, 34px));
    }

    .cal-jour {
      width: auto;
      min-width: 28px;
    }
  }

  /* ---------- Favoris, badge canal, tooltip conseil ---------- */

  .fav-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 4px;
    color: var(--text-secondary);
    transition: transform 0.15s ease, color 0.15s ease;
  }

  .fav-btn:hover {
    transform: scale(1.2);
    color: var(--attention);
  }

  .fav-btn.fav-on {
    color: var(--attention);
  }

  .cell-company-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
  }

  .row-favori {
    background: var(--attention-fond);
  }

  .badge-canal {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--status-sent-bg);
    color: var(--status-sent-text);
    vertical-align: middle;
  }

  .conseil-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: 320px;
    padding: 10px 14px;
    background: var(--text);
    color: var(--card);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.25);
    pointer-events: none;
    display: none;
  }

  /* ---------- Contrôles de la fiche candidature ---------- */

  .fiche-controles {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 4px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 14px;
  }

  .fiche-champ label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }

  .fiche-champ-boutons {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }

  .canal-toggle {
    display: inline-flex;
    border: 1px solid var(--divider);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card);
  }

  .canal-toggle button {
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--police-texte);
    color: var(--text-secondary);
    cursor: pointer;
  }

  .canal-toggle button.actif {
    background: var(--green);
    color: #FFFFFF;
    font-weight: 600;
  }

  /* ---------- Modale message de relance ---------- */

  .message-box {
    max-width: 560px;
    width: calc(100% - 32px);
  }

  .message-canal-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 12px;
  }

  .message-box textarea,
  .message-box input {
    width: 100%;
    font-family: var(--police-texte);
    font-size: 14px;
    line-height: 1.5;
  }

  .relance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg);
    border-radius: 14px;
  }

  .relance-entreprise {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 15px;
  }

  .relance-poste {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 1px;
  }

  .relance-meta {
    font-size: 12px;
    color: var(--attention-texte);
    font-weight: 500;
    margin-top: 6px;
  }

  .relance-contact {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
  }

  .relance-contact a {
    color: var(--green);
  }

  .relance-add-contact {
    font-family: var(--police-texte);
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    background: none;
    border: none;
    padding: 0;
    margin-top: 6px;
    cursor: pointer;
  }

  .relance-add-contact:hover {
    text-decoration: underline;
  }

  .relance-actions {
    flex-shrink: 0;
  }

  /* ---------- Modale contact recruteur ---------- */

  .contact-field {
    text-align: left;
    margin-bottom: 14px;
  }

  .contact-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }

  .contact-field input {
    width: 100%;
    font-family: var(--police-texte);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 10px 14px;
  }

  .contact-field input:focus {
    outline: none;
    border-color: var(--green);
  }

  /* ---------- Responsive ---------- */

  @media (max-width: 760px) {
    .screen {
      padding: 24px 18px 40px;
    }

    .stats-card {
      padding: 20px 18px;
    }

    .stats {
      flex-wrap: wrap;
      gap: 18px 0;
    }

    .stat {
      flex: 1 1 50%;
      padding: 0 10px;
      border-left: none !important;
    }

    .donut {
      width: 38px;
      height: 38px;
    }

    .stat-value {
      font-size: 20px;
    }

    .table-wrap {
      display: none;
    }

    .cards {
      display: flex;
    }

    .delete-btn {
      opacity: 1;
    }

    .relance-item {
      flex-direction: column;
      align-items: stretch;
    }

    .relance-actions .btn {
      width: 100%;
    }
  }

  /* ---------- Offre externe (ajout manuel) ---------- */

  .section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 12px;
  }

  .section-header-row h2 {
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 19px;
    margin: 0;
  }

  .btn-externe {
    width: auto;
    white-space: nowrap;
    background: var(--card);
  }

  .badge-externe {
    display: inline-flex;
    align-items: center;
    background: var(--track-bg);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
  }

  .externe-box {
    max-width: 520px;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
  }

  .externe-box h2 {
    margin-bottom: 8px;
  }

  .externe-box p {
    margin: 0 0 18px;
  }

  .externe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }

  .externe-box select,
  .externe-box textarea {
    width: 100%;
    font-family: var(--police-texte);
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    box-sizing: border-box;
  }

  .externe-box textarea {
    resize: vertical;
  }

  .externe-box select:focus,
  .externe-box textarea:focus {
    outline: none;
    border-color: var(--green);
  }

  @media (max-width: 560px) {
    .externe-grid {
      grid-template-columns: 1fr;
    }
    .section-header-row {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  /* ---------- Badge Bêta (lien Candidature spontanée dans la nav) ---------- */

  .badge-beta {
    display: inline-flex;
    align-items: center;
    background: var(--attention-texte);
    color: #FFFFFF;
    font-family: var(--police-texte);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
  }

  /* ---------- Navigation mobile : rubriques secondaires dans le menu compte ---------- */

  /* Les liens du menu compte apparaissent aussi sur desktop,
     pour retrouver toutes les pages depuis son prénom. */
  .auth-user-menu .menu-mobile-lien {
    display: block;
  }

  /* Connecté : une seule entrée par rubrique, dans le menu du compte. Le lien
     "Articles" de la barre faisait doublon avec celui du menu, juste à côté du
     prénom. Masqué par CSS et non retiré du HTML, parce qu'un visiteur NON
     connecté (articles.html/article.html sont des pages publiques) n'a pas de
     menu compte : c'est son seul accès aux articles. */
  body.connecte .nav-links .nav-link {
    display: none;
  }

  @media (max-width: 720px) {
    /* Connecté : masquage des rubriques de la barre géré au-dessus, à toutes
       les largeurs (plus seulement sur mobile). */

    .auth-user-menu .menu-mobile-lien {
      display: block;
    }

    /* Non connecté : les liens restent dans la barre, en plus compact. */
    .nav-link {
      padding: 7px 11px;
      font-size: 13px;
    }
  }

  /* ---------- Protocole de relance expert ---------- */

  .status-signed { background: var(--status-signed-bg); color: var(--status-signed-text); }
  .status-refused { background: var(--status-refused-bg); color: var(--status-refused-text); }
  .status-closed { background: var(--status-closed-bg); color: var(--status-closed-text); }

  .etape-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
  }
  .etape-courtoisie { background: var(--status-sent-bg); color: var(--status-sent-text); }
  .etape-valeur { background: var(--status-interview-bg); color: var(--status-interview-text); }
  .etape-cloture { background: var(--status-followup-bg); color: var(--status-followup-text); }

  .badge-retard {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--status-refused-bg);
    color: var(--status-refused-text);
    vertical-align: middle;
  }

  .protocole-section {
    margin: 18px 0;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 12px;
  }
  .protocole-section h2 {
    margin: 0 0 6px;
    font-family: var(--police-titre);
    font-size: 15px;
  }
  .protocole-intro {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
  }
  .protocole-controles {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .protocole-controles .fiche-champ { min-width: 200px; }

  .protocole-timeline { display: flex; flex-direction: column; gap: 0; }
  .proto-etape {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    position: relative;
  }
  .proto-etape + .proto-etape::before {
    content: '';
    position: absolute;
    left: 5px;
    top: -8px;
    width: 2px;
    height: 16px;
    background: var(--divider);
  }
  .proto-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--divider);
  }
  .proto-fait .proto-point { background: var(--green); }
  .proto-due .proto-point { background: var(--status-followup-text); box-shadow: 0 0 0 3px var(--status-followup-bg); }
  .proto-nom { font-size: 13px; font-weight: 600; }
  .proto-avenir .proto-nom { color: var(--text-secondary); font-weight: 500; }
  .proto-date {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }
  .proto-fait .proto-date { color: var(--green); font-weight: 600; }
  .proto-due .proto-date { color: var(--status-followup-text); font-weight: 600; }

  .message-perso input { border-color: var(--status-followup-text); }
  .message-perso-aide {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
  }
  #messageCopierBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .cell-date, .progress-pct { font-variant-numeric: tabular-nums; }

  /* Menu rapide de changement de statut depuis la liste (§1.1) */
  .status-pill-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    gap: 4px;
  }
  .status-pill-btn:hover { filter: brightness(0.96); }
  .status-pill-caret { font-size: 10px; opacity: 0.7; }
  .menu-statut {
    position: absolute;
    z-index: 1000;
    background: var(--surface, #fff);
    border: 1px solid var(--border, var(--divider));
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    padding: 6px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .menu-statut-item {
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary, var(--text));
    padding: 8px 10px;
    border-radius: 8px;
  }
  .menu-statut-item:hover { background: var(--hover, var(--bg)); }
  .menu-statut-item.actif { font-weight: 700; background: var(--hover, var(--bg)); }

  /* Rappel "retour promis" (§2.2, §6.3) : BLEU dédié, jamais confondu avec
     une relance du protocole (brun/vert). */
  .status-rappel { background: var(--accent-doux); color: var(--status-sent-text); }
  .etape-rappel { background: var(--accent-doux); color: var(--status-sent-text); display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-right: 6px; }
  .cal-rappel { background: var(--accent); color: #FFFFFF; }
  .relance-rappel { border-left: 3px solid var(--accent); }
  .legende-rappel { background: var(--accent); }

  /* Case à cocher "Un retour m'a été promis" */
  .fiche-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
  }
  .fiche-checkbox input { width: 16px; height: 16px; cursor: pointer; }
  #ficheReponseAnnonceeBloc { margin-top: 10px; }

  .message-note-ia {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin: 4px 0 10px;
  }

  /* Choix du type de candidature (§3.1) */
  .choix-type-boutons { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

  /* Pipeline spontané (§3) : une étape visible, les autres grisées */
  .pipeline-frise { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .pipe-etape { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
  .pipe-fait { background: var(--status-signed-bg, var(--succes-fond)); color: var(--status-signed-text, var(--succes-texte)); }
  .pipe-actif { background: var(--green, var(--succes-texte)); color: #fff; }
  .pipe-gris { background: var(--divider, var(--track-bg)); color: var(--text-secondary); opacity: 0.7; }
  .pipeline-conseil { font-size: 13px; color: var(--text-secondary); margin: 10px 0; }
  .pipeline-btn { margin-top: 10px; }
  .pipeline-requete {
    display: block; font-size: 12px; background: var(--bg, var(--bg));
    border: 1px solid var(--divider, var(--track-bg)); border-radius: 8px;
    padding: 8px 10px; margin: 6px 0; user-select: all;
  }
  .pipeline-realisation { margin-bottom: 12px; }
  .pipeline-ajout-contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
  .pipeline-ajout-contact input, .pipeline-ajout-contact select { flex: 1 1 130px; padding: 8px 10px; border: 1px solid var(--divider); border-radius: 8px; font-family: inherit; font-size: 13px; }
  .contact-lk-carte {
    border: 1px solid var(--divider, var(--track-bg)); border-radius: 10px;
    padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 6px;
  }
  .contact-lk-titre { font-size: 13px; }
  .contact-lk-role { font-size: 11px; color: var(--text-secondary); }
  .contact-lk-etat { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; display: inline-block; }
  .lk-attente { background: var(--status-sent-bg); color: var(--status-sent-text); }
  .lk-ok { background: var(--status-signed-bg, var(--succes-fond)); color: var(--status-signed-text, var(--succes-texte)); }
  .lk-due { background: var(--status-followup-bg); color: var(--status-followup-text); }
  .lk-nogo { background: var(--divider, var(--track-bg)); color: var(--text-secondary); }
  .contact-lk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .btn-mini { font-size: 12px; padding: 5px 10px; }

  /* Toast de palier de motivation (§4.1) : non-bloquant, en bas à droite */
  .toast-palier {
    position: fixed; bottom: 20px; right: 20px; z-index: 2000;
    max-width: 380px; background: var(--surface, #fff);
    border: 1px solid var(--divider, var(--track-bg)); border-left: 4px solid var(--green, var(--succes-texte));
    border-radius: 12px; padding: 14px 34px 14px 16px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    transition: opacity 200ms ease;
  }
  .toast-palier-titre { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
  .toast-palier ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
  .toast-palier li { margin: 4px 0; }
  .toast-palier-fermer {
    position: absolute; top: 8px; right: 8px; border: none; background: none;
    cursor: pointer; font-size: 13px; color: var(--text-secondary);
  }

  /* ---------- Refonte UX (§6) ---------- */

  /* Boutons : 3 niveaux unifiés + transitions douces 200ms */
  .btn { transition: background 200ms ease, color 200ms ease, border-color 200ms ease, opacity 200ms ease; }
  .btn-tertiaire {
    background: none; border: none; padding: 6px 10px;
    color: var(--green, var(--accent)); font-family: inherit; font-size: 13px;
    font-weight: 600; cursor: pointer; border-radius: 8px;
    transition: background 200ms ease;
  }
  .btn-tertiaire:hover { background: var(--hover, var(--bg)); }

  /* Zone "Aujourd'hui" : la première action domine */
  .relance-hero {
    border: 2px solid var(--green, var(--accent));
    border-radius: 14px;
    padding: 16px;
    background: var(--surface, #fff);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.10);
  }
  .relance-hero.relance-rappel { border-color: var(--accent); box-shadow: 0 8px 24px rgba(46, 124, 199, 0.12); }
  .relance-item:not(.relance-hero) { opacity: 0.88; }
  .relance-prochaine { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 6px; font-weight: 400; }

  /* Recherche + filtre de la liste */
  .liste-filtres { display: flex; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
  .liste-filtres input[type="search"] {
    flex: 2 1 220px; padding: 9px 12px; border: 1px solid var(--divider, var(--track-bg));
    border-radius: 10px; font-family: inherit; font-size: 13px; background: var(--surface, #fff);
  }
  .liste-filtres select { flex: 1 1 140px; }

  /* Fiche : sections repliées (divulgation progressive) */
  .fiche-details summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  }
  .fiche-details summary::-webkit-details-marker { display: none; }
  .fiche-details summary::before { content: '▸'; font-size: 12px; color: var(--text-secondary); transition: transform 200ms ease; }
  .fiche-details[open] summary::before { transform: rotate(90deg); }
  .fiche-details summary h2 { display: inline; margin: 0; }

  /* Calendrier : replié par défaut sur mobile, toujours visible sur PC */
  .cal-toggle-mobile { display: none; }
  @media (max-width: 760px) {
    .cal-toggle-mobile { display: block; margin-bottom: 8px; }
    .calendrier-repliable { display: none; }
    .calendrier-repliable.ouvert { display: block; }
  }
