/* recrutement.stayweb.io — design inspiré claude.ai (crème + corail).
   Tooltips 100% CSS (attribut data-tip). Mode clair + sombre. */

:root {
    --bg:        #f5f4ee;   /* crème chaud */
    --surface:   #ffffff;
    --surface-2: #faf9f5;
    --sidebar:   #f0eee6;
    --text:      #2b2926;
    --text-soft: #55524c;
    --muted:     #8a867d;
    --border:    #e7e3d8;
    --border-2:  #efece3;
    --field-border: #d3ccbb;
    --accent:    #c96442;   /* corail Claude */
    --accent-h:  #b1543410;
    --accent-strong: #b15434;
    --ok:        #4a7c59;
    --ok-bg:     #e7f0e8;
    --warn:      #9a6a1a;
    --warn-bg:   #f6ecd6;
    --info:      #3f6d99;
    --info-bg:   #e4edf5;
    --danger:    #b23c2b;
    --danger-bg: #f6e0dc;
    --radius:    12px;
    --radius-s:  8px;
    --shadow:    0 1px 2px rgba(43,41,38,.04), 0 4px 16px rgba(43,41,38,.05);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:        #1f1e1b;
        --surface:   #292723;
        --surface-2: #24221f;
        --sidebar:   #24221f;
        --text:      #eeece5;
        --text-soft: #c7c3b8;
        --muted:     #979285;
        --border:    #3a3733;
        --border-2:  #322f2b;
        --field-border: #4d4941;
        --accent:    #e08a68;
        --accent-strong: #e08a68;
        --shadow:    0 1px 2px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.28);
        --ok-bg:     #223027; --ok: #8fce9f;
        --warn-bg:   #352d1c; --warn: #e3bd77;
        --info-bg:   #1e2b38; --info: #8fb6dd;
        --danger-bg: #3a2320; --danger: #e08b7c;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 244px; flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 18px;
}
.brand .logo {
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--accent); color: #fff;
    display: grid; place-items: center;
    font-family: var(--serif); font-size: 18px; font-weight: 600;
    box-shadow: var(--shadow);
}
.brand .name { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.brand .sub  { font-size: 11px; color: var(--muted); margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: var(--radius-s);
    color: var(--text-soft); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--border-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav a .ic { width: 18px; text-align: center; opacity: .8; }

.sidebar .spacer { flex: 1; }
.userbox {
    border-top: 1px solid var(--border);
    padding-top: 12px; display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: grid; place-items: center; font-weight: 600; font-size: 14px;
}
.userbox .meta { line-height: 1.25; min-width: 0; }
.userbox .meta b { font-size: 13px; }
.userbox .meta small { color: var(--muted); font-size: 11px; text-transform: capitalize; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 30px 6px;
}
.topbar h1 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0; letter-spacing: -.02em; }
.topbar .subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.content { padding: 18px 30px 40px; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stats.has-pub { grid-template-columns: repeat(5, 1fr); }
.tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.tile .k { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.tile .v { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile.accent .v { color: var(--accent-strong); }
/* Tuiles cliquables (filtres rapides du tableau de bord) */
a.tile { display: block; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.tile:hover { text-decoration: none; border-color: var(--accent); }
a.tile .h { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-h); }

/* ---------- Card ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    /* overflow visible : sinon les tooltips CSS sont coupés par la carte */
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border-2);
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
/* Règle d'espacement globale : deux cartes empilées directement dans le contenu d'une page ne se touchent JAMAIS
   (18 px, comme les colonnes .fiche-main/.fiche-side). Évite d'oublier la marge sur un nouvel onglet. */
.content > .card + .card { margin-top: 18px; }

/* ---------- Toolbar / form ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-check {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--muted);
    padding: 0 12px; border: 1px solid var(--field-border); border-radius: 10px;
}
.toolbar-check input { width: auto; margin: 0; accent-color: var(--accent-strong); }
.field { display: flex; flex-direction: column; gap: 5px; }
label.lbl { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
    font: inherit; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-s); padding: 9px 12px; min-width: 0;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-h);
}
.btn {
    font: inherit; font-weight: 600; cursor: pointer;
    border: 1px solid var(--accent); background: var(--accent); color: #fff;
    border-radius: var(--radius-s); padding: 9px 16px;
    transition: filter .15s, transform .02s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--border-2); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
    text-align: left; font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
    color: var(--muted); font-weight: 600; padding: 11px 16px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
table.grid td { padding: 12px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.grid tbody tr { transition: background .12s; }
table.grid tbody tr:hover td { background: var(--surface-2); }
.cand { display: flex; align-items: center; gap: 11px; }
.cand .ini {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: var(--border-2); color: var(--text-soft);
    display: grid; place-items: center; font-weight: 600; font-size: 13px;
}
.cand .who b { display: block; font-weight: 600; }
.cand .who small { color: var(--muted); font-size: 12px; }
.dim { color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    background: var(--border-2); color: var(--text-soft);
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.km { font-variant-numeric: tabular-nums; font-weight: 600; }
.km.near { color: var(--ok); }
.km.mid  { color: var(--warn); }

/* ---------- Tooltip (100% CSS) ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: #2b2926; color: #fff; font-size: 12px; font-weight: 500;
    line-height: 1.35; white-space: normal; width: max-content; max-width: 240px; text-align: center;
    padding: 6px 9px; border-radius: 7px;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    opacity: 0; pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 40;
}
[data-tip]::before {
    content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px);
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent; border-top-color: #2b2926;
    opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease; z-index: 40;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after,
[data-tip]:hover::before, [data-tip]:focus-visible::before {
    opacity: 1; transform: translateX(-50%) translateY(0);
}
[data-tip-pos="right"]::after {
    left: calc(100% + 8px); bottom: auto; top: 50%;
    transform: translateY(-50%) translateX(-4px);
}
[data-tip-pos="right"]::before { display: none; }
[data-tip-pos="right"]:hover::after { transform: translateY(-50%) translateX(0); }

/* ---------- Notification toast (apparaît puis disparaît) ---------- */
.toast {
    position: fixed; top: 18px; left: 50%; z-index: 1000;
    max-width: min(90vw, 520px); text-align: center;
    background: #2f8f57; color: #fff; font-weight: 600; font-size: 14px; line-height: 1.4;
    padding: 12px 20px; border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0,0,0,.22);
    animation: toastIn .28s ease-out, toastOut .5s ease-in 4.2s forwards;
}
.toast.err { background: #b23c2b; }
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -14px); visibility: hidden; } }

/* Ancienne bannière (conservée pour compat, non utilisée) */
.flash {
    background: var(--warn-bg); color: var(--warn);
    border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
    padding: 10px 14px; border-radius: var(--radius-s); font-size: 14px; margin-bottom: 14px;
}

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
    width: 100%; max-width: 380px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    padding: 30px 28px;
}
.login-card .brand { justify-content: center; padding: 4px 0 18px; }
.login-card h1 { font-family: var(--serif); font-size: 21px; margin: 0 0 4px; text-align: center; font-weight: 600; }
.login-card p.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 6px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Connecteur (MCP) */
.conn { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface-2); }
.conn-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }

/* Honeypot anti-bot : invisible pour les humains, rempli par les robots */
.hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Tri colonnes ---------- */
.sortlink { color: var(--muted); text-decoration: none; font: inherit; }
.sortlink:hover { color: var(--text); text-decoration: none; }
th .arrow { color: var(--accent-strong); }
.rowbtn {
    display: inline-block; font-size: 12.5px; font-weight: 600; white-space: nowrap;
    color: var(--accent-strong); padding: 5px 10px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--surface);
}
.rowbtn:hover { background: var(--border-2); text-decoration: none; }
/* Main sur tout ce qui se clique : un <button> affiche une flèche par défaut, contrairement à un
   lien — d'où des boutons qui ne « donnaient pas envie » d'être cliqués. Les éléments purement
   explicatifs (chips, libellés en `cursor: help`) ne sont pas concernés : ce sont des <span>. */
button:not(:disabled), [data-modal-url], summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.rowbtn.danger { color: var(--muted); }
.rowbtn.danger:hover { color: #fff; background: #c0392b; border-color: #c0392b; }
.badge.dim-badge { background: var(--border-2); color: var(--muted); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Fiche candidat ---------- */
.fiche { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.fiche-main, .fiche-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pad { padding: 16px 18px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-2); }
.kv > div { background: var(--surface); padding: 12px 18px; }
.kv span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.kv b { font-weight: 600; font-size: 14px; }
.prose { margin: 0; color: var(--text-soft); white-space: pre-wrap; }
.pieces { list-style: none; margin: 0; padding: 0; }
.pieces li { padding: 7px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.pieces li:last-child { border-bottom: 0; }
.mail-body { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13px; color: var(--text-soft); max-height: 420px; overflow: auto; }

/* ---------- Modal (contenu mail) ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,18,16,.5);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 1100; padding: 48px 16px; overflow: auto;
}
.modal-overlay.show { display: flex; }
.modal-box {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.34);
    max-width: 860px; width: 100%; padding: 26px 30px;
}
.modal-close {
    position: absolute; top: 8px; right: 12px; border: 0; background: transparent;
    font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.mail-subj { font-weight: 700; font-size: 17px; padding-right: 24px; }

/* Réponse du candidat rappelée en contexte dans la modale « Répondre » (scrollable) */
.mail-quote {
    margin: 0 0 18px; padding: 10px 13px; background: var(--surface-2);
    border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-s);
}
.mail-quote .mq-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.mail-quote .mq-sujet { font-size: 13px; font-weight: 600; margin-top: 2px; }
.mail-quote .mq-body { margin-top: 7px; max-height: 190px; }

/* Onglets dans la modal (CSS pur via radios) */
.modal-tabs > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.modal-tabs .panel { display: none; }
.modal-tabs #pt1:checked ~ .panel1,
.modal-tabs #pt2:checked ~ .panel2,
.modal-tabs #pt3:checked ~ .panel3,
.modal-tabs #st1:checked ~ .panel1,
.modal-tabs #st2:checked ~ .panel2 { display: block; }
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabbar label {
    padding: 9px 15px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabbar label:hover { color: var(--text); }
.modal-tabs #pt1:checked ~ .tabbar label[for=pt1],
.modal-tabs #pt2:checked ~ .tabbar label[for=pt2],
.modal-tabs #pt3:checked ~ .tabbar label[for=pt3],
.modal-tabs #st1:checked ~ .tabbar label[for=st1],
.modal-tabs #st2:checked ~ .tabbar label[for=st2] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.panel code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 12px; }

.actions-soon { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    background: var(--surface-2); border: 1px dashed var(--border);
    padding: 7px 12px; border-radius: 999px; cursor: help;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border-2); }
.tl { position: relative; padding: 0 0 16px 34px; }
.tl:last-child { padding-bottom: 0; }
.tl-ic {
    position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px;
}
.tl.mail .tl-ic { border-color: var(--accent); }
.tl-body b { font-size: 13.5px; }
.tl-date { color: var(--muted); font-size: 11px; margin-top: 3px; }
.tl-link { color: var(--text); cursor: pointer; }
.tl-link:hover { text-decoration: none; }
.tl-link:hover .tl-voir { text-decoration: underline; }
.tl-voir { color: var(--accent-strong); font-size: 11px; font-weight: 600; }

/* ---------- Nav séparateur (espace super-admin) ---------- */
.navsep { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 14px 11px 6px; }

/* ---------- Sous-navigation (onglets Paramètres) ---------- */
.subnav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav a {
    padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
    color: var(--text-soft); background: var(--surface); border: 1px solid var(--border);
}
.subnav a:hover { background: var(--border-2); text-decoration: none; }
.subnav a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Formulaires en grille ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; align-items: end; }
.form-grid .field.wide { grid-column: 1 / -1; }
.form-grid .form-actions { grid-column: 1 / -1; margin-top: 6px; }
.field input, .field select, .field textarea { width: 100%; }
.form-grid input, .form-grid select { background: var(--surface); border-color: var(--field-border); }
.field textarea {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--field-border); border-radius: var(--radius-s);
    padding: 10px 12px; resize: vertical; min-height: 120px; line-height: 1.5;
}
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-h); }

/* ---------- Schéma d'étapes (processus) ---------- */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px 6px 6px; }
.step-n { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.step-l { font-size: 13px; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.step-arrow { color: var(--muted); font-weight: 700; }

/* ---------- Arbre décisionnel (processus, dans la modal) ---------- */
.dtree-wrap { overflow-x: auto; padding: 6px 2px 16px; }
.dtree, .dtree ul { list-style: none; margin: 0; padding: 0; }
.dtree ul { margin-left: 11px; padding-left: 16px; border-left: 2px solid var(--border); }
.dtree li { position: relative; padding: 6px 0; }
.dtree ul > li::before { content: ""; position: absolute; left: -16px; top: 18px; width: 14px; height: 2px; background: var(--border); }
.dtree .node {
    display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap;
}
.dtree .node .dim { font-weight: 500; }
.dtree .branch { display: inline-block; font-size: 10px; font-weight: 700; color: var(--muted); margin-right: 6px; text-transform: uppercase; letter-spacing: .04em; }
.dtree .branch.ok { color: var(--ok); }
.dtree .branch.no { color: var(--warn); }

@media (max-width: 980px) { .fiche { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
    .sidebar { display: none; }
    .stats, .stats.has-pub { grid-template-columns: repeat(2, 1fr); }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .kv { grid-template-columns: 1fr; }
}

/* ---- Fiche : panneau Process (stepper vertical, jalons, prochaine action) ---- */
.proc-name { font-weight: 600; margin-bottom: 8px; }
.proc-state { font-size: 13px; padding: 7px 11px; border-radius: 8px; font-weight: 600; }
.proc-state.live { background: var(--ok-bg); color: var(--ok); }
.proc-state.closed { background: var(--border-2); color: var(--muted); }
.proc-state.off { background: var(--surface-2); color: var(--muted); font-weight: 500; }

.stepper { list-style: none; margin: 16px 0 8px; padding: 0; }
.stepper .step { display: flex; align-items: center; gap: 11px; padding: 4px 0; position: relative; }
.stepper .step-num {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    border: 2px solid var(--border-2); background: var(--surface); color: var(--muted);
}
.stepper .step.done .step-num { background: var(--ok); border-color: var(--ok); color: #fff; }
/* étape en cours = sablier ⏳ dans un cercle neutre (pas de couleur de remplissage) */
.stepper .step.current .step-num { background: var(--surface); border-color: var(--border-2); color: var(--text-soft); box-shadow: none; font-size: 13px; line-height: 1; }
.stepper .step-lbl { font-size: 13px; color: var(--muted); }
.stepper .step.done .step-lbl { color: var(--text); }
.stepper .step.current .step-lbl { color: var(--text); font-weight: 700; }
.stepper .step:not(:last-child)::before {
    content: ''; position: absolute; left: 11px; top: 27px; width: 2px; height: calc(100% - 6px);
    background: var(--border-2);
}
.stepper .step.done:not(:last-child)::before { background: var(--ok); }

.milestones { margin: 14px 0 4px; display: grid; gap: 6px; }
.milestones > div { display: flex; justify-content: space-between; font-size: 13px; align-items: baseline; }
.milestones span { color: var(--muted); }

.proc-next { margin-top: 14px; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.proc-next.next-cadrage, .proc-next.next-relance { background: var(--warn-bg); color: var(--warn); }
.proc-next.next-cloture { background: rgba(177,84,52,.10); color: var(--accent-strong); }
.proc-next.next-reponse { background: var(--ok-bg); color: var(--ok); }
.proc-next.next-off { background: var(--surface-2); color: var(--muted); }

/* ---- Fiche : bannière réponse candidat (sentiment) ---- */
.proc-reponse { margin-top: 8px; padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.proc-reponse.s-positif { background: var(--ok-bg); color: var(--ok); }
.proc-reponse.s-negatif { background: var(--border-2); color: var(--text-soft); }
.proc-reponse.s-neutre  { background: var(--info-bg); color: var(--info); }
.proc-reponse a { font-weight: 600; }
/* Bouton « Répondre au candidat » posé DANS la bannière : reprend la couleur du sentiment
   (lisible en clair comme en sombre, sur fond ok / info / neutre). */
.proc-reponse-act { margin-top: 9px; }
.rowbtn.rb-sur { color: inherit; background: var(--surface); border-color: currentColor; }
.rowbtn.rb-sur:hover { background: var(--surface-2); text-decoration: none; }
.proc-next.next-reponse-ok { background: var(--ok-bg); color: var(--ok); }
.proc-next.next-reponse-no { background: var(--border-2); color: var(--text-soft); }
.proc-next.next-live { background: var(--surface-2); color: var(--muted); }
.proc-next.next-humain { background: var(--warn-bg); color: var(--warn); }
.proc-next.next-test { background: var(--info-bg); color: var(--info); }
/* Bandeau statut du test (rh.stayweb) */
.proc-test { margin-top: 8px; padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.proc-test.t-done { background: var(--ok-bg); color: var(--ok); }
.proc-test.t-in_progress { background: var(--warn-bg); color: var(--warn); }
.proc-test.t-invited { background: var(--info-bg); color: var(--info); }
/* Test jamais passé et expiré : alerte, la RH doit voir qu'il n'y a AUCUN résultat. */
.proc-test.t-expired { background: var(--danger-bg); color: var(--danger); }
.proc-test .pt-head { font-weight: 500; }
.proc-test .pt-vu { display: block; margin-top: 2px; font-size: 12px; opacity: .75; font-weight: 400; }
/* Détail par évaluation (parcours, note, date) */
.test-evals { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 6px; }
.test-evals .te {
    display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; align-items: center;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 3px solid var(--muted);
    border-radius: 7px; padding: 7px 10px;
}
.te .te-nom { grid-column: 1; font-weight: 600; font-size: 12.5px; line-height: 1.3; }
.te .te-etat { grid-column: 1; font-size: 12px; color: var(--text-soft); line-height: 1.3; }
.te .te-date { color: var(--muted); }
.te .te-res { grid-column: 2; grid-row: 1 / span 2; font-size: 17px; font-weight: 700; white-space: nowrap; }
.te .te-nul { font-size: 15px; color: var(--muted); }
/* Analyse RH de l'évaluation (synthèse, niveau, points forts / vigilance, suites) */
.te .te-analyse { grid-column: 1 / -1; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border); font-size: 12px; }
.te .te-analyse p { margin: 0; color: var(--text-soft); line-height: 1.45; }
.te .te-avis { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.te .te-tag { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 9px; font-size: 11px; font-weight: 600; }
.te .te-pts { margin-top: 7px; }
.te .te-pts b { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.te .te-pts ul { margin: 3px 0 0; padding-left: 17px; color: var(--text-soft); line-height: 1.45; }
/* Version colonne large (carte « Résultats des tests techniques ») : plus d'air, texte plus grand. */
.test-evals.large { gap: 12px; }
.test-evals.large .te { padding: 12px 14px; gap: 2px 14px; }
.test-evals.large .te-nom { font-size: 14px; }
.test-evals.large .te-etat { font-size: 13px; }
.test-evals.large .te-res { font-size: 22px; }
.test-evals.large .te-analyse { font-size: 13px; margin-top: 10px; padding-top: 10px; }
.pt-lien { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: inherit; text-decoration: underline; }
/* Deux actions côte à côte dans le bandeau de réponse (répondre / planifier la visio) */
.proc-reponse-act { display: flex; flex-wrap: wrap; gap: 8px; }
/* Participants d'un entretien : cases à cocher lisibles, sur une ou deux colonnes selon la place */
.invites { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 14px; }
.invites .invite {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 7px 10px; border: 1px solid var(--field-border); border-radius: var(--radius-s);
    background: var(--surface-2); font-size: 13px;
}
.invites .invite input { width: auto; margin: 0; accent-color: var(--accent-strong); }
.invites .invite:hover { border-color: var(--accent); }
.invites .invite .dim { font-size: 12px; }
.te.e-fait { border-left-color: var(--ok); }
.te.e-fait .te-res { color: var(--ok); }
.te.e-expire { border-left-color: var(--danger); }
.te.e-expire .te-etat { color: var(--danger); }
.te.e-en_cours { border-left-color: var(--warn); }
.te.e-envoye { border-left-color: var(--info); }

/* ---------- Arbre décisionnel (page process + schéma) ---------- */
.arbre { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.a-step { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px; transition: box-shadow .12s, border-color .12s; }
.a-step[data-modal-url] { cursor: pointer; }
.a-step[data-modal-url]:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.a-step.is-start { border-color: var(--ok); }
.a-step.t-fin { background: var(--surface-2); }
.a-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a-num { width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.a-title { font-weight: 700; font-size: 14px; }
.a-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--border-2); color: var(--text-soft); }
.a-badge.bg-test { background: var(--warn-bg); color: var(--warn); }
.a-badge.bg-fin { background: var(--border-2); color: var(--muted); }
.a-tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.a-tag.start { background: var(--ok-bg); color: var(--ok); }
.a-tag.hum { background: var(--info-bg); color: var(--info); }
.a-edit { margin-left: auto; font-size: 11px; color: var(--muted); }
.a-meta { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; }
.a-branches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.a-br { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); }
.a-br.oui b { color: var(--ok); }
.a-br.non b { color: var(--accent-strong); }
.a-br.sil b { color: var(--warn); }
.a-arrow { text-align: center; color: var(--muted); font-size: 18px; line-height: 1; padding: 5px 0; }
.a-fins { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-fins-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.a-fin { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.a-fin[data-modal-url] { cursor: pointer; }
.a-fin[data-modal-url]:hover { border-color: var(--accent); }
.a-add { margin-top: 14px; }
/* Aide de lecture du parcours (page process) */
.arbre-aide { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }
.arbre-aide > b { display: block; margin-bottom: 6px; }
.arbre-aide ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text-soft); }
.arbre-aide li b { color: var(--text); }
.branch-hint { font-weight: 600; font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; }
.dot.oui { background: var(--ok); }
.dot.non { background: var(--accent-strong); }
.dot.sil { background: var(--warn); }

/* ---- Fiche : sélecteur de mode (auto/manuel) + bouton danger + modale étape ---- */
.mode-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mode-lbl { font-size: 12.5px; color: var(--text-soft); font-weight: 600; cursor: help; }
.mode-seg { display: inline-flex; border: 1px solid var(--field-border); border-radius: 999px; padding: 2px; gap: 2px; background: var(--surface-2); }
.mode-seg .seg { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 0; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 999px; transition: background .12s, color .12s; }
.mode-seg .seg:hover { color: var(--text); }
.mode-seg .seg.on { background: var(--accent-strong); color: #fff; }
/* Permis voiture : même segment, posé dans une cellule .kv (Oui / Non / non précisé). */
.permis-seg { margin-top: 2px; }
.permis-seg .seg { padding: 4px 10px; }
/* Liste des candidats : permis voiture accolé à la distance (rien si l'info manque). */
.permis-pill { margin-left: 6px; font-size: 12px; }
.permis-pill.no { filter: grayscale(1); opacity: .45; }
.btn.danger { background: #c0392b; border-color: #c0392b; }
.btn.danger:hover { filter: brightness(1.06); }

/* ---- Fiche : repli « Renvoyer un mail » (actions ponctuelles discrètes) ---- */
details.renvoyer { margin-top: 14px; }
details.renvoyer > summary { font-size: 12.5px; color: var(--muted); font-weight: 600; cursor: pointer; }
details.renvoyer > summary:hover { color: var(--text); }

/* ---------- Accueil « Aujourd'hui » (notifications sur les candidats en process) ---------- */
.today-stats { grid-template-columns: repeat(3, 1fr); }
.today-stats .tile .h { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile.t-urgent .v { color: var(--danger); }
.tile.t-todo .v { color: var(--warn); }
.tile.t-info .v { color: var(--info); }
.today-note { font-size: 12.5px; text-align: right; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-item { display: grid; grid-template-columns: 5px 1fr auto; gap: 0 16px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); align-items: start; }
.today-item:last-child { border-bottom: 0; }
.ti-bar { align-self: stretch; border-radius: 3px; background: var(--border); }
.s-urgent .ti-bar { background: var(--danger); }
.s-todo .ti-bar { background: var(--warn); }
.s-info .ti-bar { background: var(--info); }
.ti-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ti-title { font-size: 14.5px; }
.ti-when { font-size: 12.5px; font-weight: 700; color: var(--accent-strong); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.s-urgent .ti-when { color: var(--danger); }
.ti-detail { font-size: 13.5px; color: var(--text-soft); margin-top: 3px; }
.ti-who { margin-top: 5px; font-size: 12.5px; }
.ti-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 190px; }
.ti-actions .btn { padding: 7px 12px; font-size: 13px; white-space: nowrap; text-align: center; }
.ti-actions .rowbtn { text-align: center; }
@media (max-width: 820px) {
    .today-stats { grid-template-columns: 1fr; }
    .today-item { grid-template-columns: 5px 1fr; }
    .ti-actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; min-width: 0; }
}

/* ---------- Fiche : notes de suivi internes ---------- */
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
/* Sélecteurs ciblés sur la carte (.notes) : la classe « note » sert aussi à la ligne de l'historique (.tl.note). */
.notes .note { border: 1px solid var(--border-2); border-left: 3px solid var(--border); border-radius: var(--radius-s); padding: 9px 12px; background: var(--surface-2); }
.notes .note.n-tel { border-left-color: var(--info); }
.notes .note.n-entretien { border-left-color: var(--ok); }
.notes .note.n-cv { border-left-color: var(--warn); }
.note-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.note-head .note-del { margin-left: auto; }
.note-head .rowbtn { padding: 1px 7px; font-size: 11px; }
.note-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; margin-top: 6px; color: var(--text); }
.tl.note .tl-ic { border-color: var(--info); }

/* Une personne = une fiche : bandeau de la fiche rattachée, liste des doublons à réunir */
.fusion-banner { border-color: var(--accent); }
.fusion-banner p { margin: 0 0 12px; line-height: 1.5; }
.fusion-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fusion-actions form { margin: 0; }
.fusion-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fusion-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fusion-liste form { margin: 0 0 0 auto; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }

/* Date d'un entretien convenu hors de l'app (visio / Golbey) */
.entretien-bloc { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.entretien-bloc .eb-head { font-size: 13.5px; margin-bottom: 8px; }
.entretien-bloc .eb-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.entretien-bloc .eb-form input[type="date"], .entretien-bloc .eb-form input[type="time"] { width: auto; flex: 1 1 110px; padding: 5px 8px; }
