/* Medirecrut ATS — feuille de styles (charte de www.medirecrut.com : Montserrat / Poppins, violet #9C52A0, bleu nuit #363956) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Poppins:wght@400;500;600&display=swap');

:root {
  --ground: #F6F5FA;
  --ground-2: #EBEBF5;
  --soft: #F1EFF7;
  --surface: #FFFFFF;
  --line: #E4E2EE;
  --line-strong: #CBC8DA;
  --ink: #363956;
  --ink-2: #4A4D6B;
  --muted: #5E6480;
  --accent: #9C52A0;
  --accent-hover: #7E3F82;
  --accent-ink: #7E3F82;
  --accent-soft: #F3E8F6;
  --accent-line: #DFC3ED;
  --violet: #6541B5;
  --mint: #DFC3ED;
  --orange: #B84A12;
  --orange-ink: #8A3510;
  --orange-soft: #FBE7D8;
  --danger: #A3261B;
  --danger-soft: #FBE4E1;
  --sidebar: #363956;
  --sidebar-2: #43466A;
  --sidebar-3: #4E5277;
  --sidebar-text: #D5D6E4;
  --sidebar-muted: #B9BBD0;
  --radius: 10px;
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 13px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 12px; font-weight: 600; }
p { margin: 0; }
.icon { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.xsmall { font-size: 11px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grow { flex-grow: 1; }
.pre { white-space: pre-line; }

/* ---------- Coquille de l'application ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; gap: 32px; padding: 24px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--mint); text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff; letter-spacing: -0.01em; display: block; }
.brand-sub { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--sidebar-text); text-decoration: none; font-size: 12px; font-weight: 500; }
.nav a .icon { color: var(--sidebar-muted); }
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--sidebar-3); color: #fff; font-weight: 600; }
.nav a[aria-current="page"] .icon { color: var(--mint); }
.sidebar-card { padding: 14px 12px; border-radius: 10px; background: var(--sidebar-2); display: flex; flex-direction: column; gap: 4px; }
.sidebar-card span { font-size: 11px; color: var(--sidebar-text); }
.sidebar-card a { font-size: 11px; font-weight: 600; color: #fff; text-decoration: none; word-break: break-all; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 10px; }
.me .avatar { background: var(--mint); color: var(--ink); }
.me-name { font-size: 12px; font-weight: 600; color: #fff; display: block; }
.me-role { font-size: 11px; color: var(--sidebar-muted); display: block; }
.me form { margin-left: auto; }
.me-link { display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; color: inherit; text-decoration: none; border-radius: 8px; padding: 4px 6px; margin-left: -6px; }
.me-link:hover, .me-link[aria-current="page"] { background: var(--sidebar-2); }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: none; background: transparent; color: var(--sidebar-muted); cursor: pointer; }
.icon-btn:hover { background: var(--sidebar-3); color: #fff; }
.main { flex-grow: 1; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.topbar-mobile { display: none; }

/* ---------- Composants ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn-dark:hover { background: #262842; color: #fff; }
.btn-danger { color: var(--danger); border-color: #E6B8B2; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 11px; }
.btn-link { background: none; border: none; padding: 0; min-height: 0; color: var(--accent); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.btn-link.danger { color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card-tight { padding: 16px 18px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-teal { background: var(--accent-soft); color: var(--accent-ink); }
.badge-grey { background: var(--soft); color: var(--ink-2); }
.badge-orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--soft); font-size: 11px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex-shrink: 0; }
.avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.avatar-lg { width: 64px; height: 64px; font-family: var(--font-display); font-size: 20px; font-weight: 700; background: var(--accent); color: #fff; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }

.flash { padding: 12px 16px; border-radius: 10px; font-size: 12px; border: 1px solid; }
.flash-success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.flash-error { background: var(--danger-soft); border-color: #EDBDB6; color: #7E1D14; }

.crumbs { display: flex; gap: 8px; font-size: 11px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi strong { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 11px; font-weight: 600; }
.hint { font-size: 11px; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.textarea { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input-sm { min-height: 36px; font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.btn[hidden], .btn-link[hidden] { display: none; }
.span-all { grid-column: 1 / -1; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fieldset > legend { padding: 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 12px; }
.fieldset-sub { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset-sub > legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.check-grid .check { min-height: 44px; align-items: center; cursor: pointer; }
.check-grid .check input { margin: 0; }
.ref-row { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 10px; background: var(--ground); }
.ref-row .grid-3 { width: 100%; }
.ref-row .btn-link { min-height: 44px; }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.ref-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 8px; background: var(--ground); font-size: 12px; }
.ref-item a { word-break: break-word; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.headline { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; }

/* ---------- Tableaux ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; padding: 12px 16px; background: var(--soft); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--ground-2); vertical-align: middle; }
.table tr:hover td { background: #FAF9FD; }
.table .title-cell a { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .title-cell a:hover { color: var(--accent); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.pipebar { display: flex; gap: 3px; height: 8px; min-width: 120px; }
.pipebar span { height: 8px; border-radius: 2px; }
.pipebar-empty { height: 8px; border-radius: 2px; background: var(--ground-2); min-width: 120px; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 12px; }

/* ---------- Pipeline Kanban ---------- */
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--ground-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.kcol.is-over { background: var(--accent-soft); outline-color: var(--accent-ink); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.kcol-head h2 { flex-grow: 1; font-size: 12px; }
.kcol-count { font-size: 11px; color: var(--muted); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; cursor: grab; }
.kcard:hover { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(54, 57, 86, .06); }
.kcard.is-dragging { opacity: .45; }
.kcard[hidden] { display: none; }
.kcard-name { font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.kcard-name:hover { color: var(--accent); }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kcard .stars { font-size: 11px; color: var(--orange); letter-spacing: 1px; }
.kcard-move { display: flex; gap: 6px; }
.kcard select { width: 100%; min-height: 34px; font-size: 11px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font-family: inherit; cursor: pointer; }
.kempty { font-size: 11px; color: var(--muted); padding: 8px 4px; }

/* ---------- Fiche candidat ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dl { margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.dl dt { color: var(--muted); font-size: 11px; }
.dl dd { margin: 2px 0 0; word-break: break-word; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--ground); font-size: 11px; }
.doc a { color: var(--ink); text-decoration: none; font-weight: 500; word-break: break-all; }
.doc a:hover { color: var(--accent); }
.note { display: flex; gap: 12px; }
.note-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.note-body p { font-size: 12px; line-height: 1.55; color: var(--ink-2); white-space: pre-line; word-break: break-word; }
.note.system p { color: var(--muted); font-size: 11px; }
.note.system .avatar { background: var(--ground-2); color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--ground-2); overflow: hidden; }
.meter span { display: block; height: 6px; background: var(--accent); border-radius: 3px; }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 11px; }
.rating-select { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; align-items: center; font-size: 11px; }
.app-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; background: var(--ground); }
.app-item a { font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.job-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.job-list .dot { width: 8px; height: 8px; align-self: center; }
.job-list a { font-weight: 600; color: var(--ink); text-decoration: none; }
.job-list a:hover { color: var(--accent); text-decoration: underline; }
.kcard-others summary { font-size: 11px; }
.kcard-others .job-list { margin-top: 6px; font-size: 11px; }
details summary { cursor: pointer; font-size: 11px; font-weight: 600; color: var(--accent); list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ---------- Connexion / installation ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.auth-brand strong { font-family: var(--font-display); font-size: 18px; color: var(--ink); }

/* ---------- Pages publiques ---------- */
.pub-header { background: var(--sidebar); }
.pub-header-inner { max-width: 880px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; gap: 10px; color: var(--mint); }
.pub-header-inner a { display: flex; align-items: center; gap: 10px; color: var(--mint); text-decoration: none; }
.pub-header-inner strong { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #fff; }
.pub-main { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 24px; }
.pub-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.job-item:hover { border-color: var(--accent); color: var(--ink); }
.job-item h2 { font-size: 15px; }
.job-desc { font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-line; }
.apply-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chips label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; font-weight: 500; cursor: pointer; }
.radio-chips input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.radio-chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone { font-weight: 400; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; border-radius: 10px; border: 1.5px dashed var(--sidebar-muted); background: var(--surface); text-align: center; cursor: pointer; }
.dropzone strong { font-size: 12px; color: var(--accent); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pub-footer { text-align: center; font-size: 11px; color: var(--muted); padding: 24px 16px 40px; }

/* ---------- Fiche candidat : onglets, remplissage, historique ---------- */
.completion { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--ground); }
.completion .meter { height: 8px; }
.completion .meter span { height: 8px; }
.completion-mini { display: flex; flex-direction: column; gap: 3px; min-width: 130px; }
.completion-mini strong { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
[data-tabs] > .tabs { flex-wrap: wrap; gap: 4px 20px; }
[data-tabs] > .tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
[data-tabs] > .tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
[data-tabs] > .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-count { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); }
.tab-count.is-full { background: var(--accent-soft); color: var(--accent-ink); }
.tabpanel { padding-top: 18px; }
.tabpanel[hidden], [data-tabs] > .tabs[hidden] { display: none; }
.field[hidden] { display: none; }
.input[readonly] { background: var(--ground); color: var(--ink-2); }
.tabpanel-title { font-family: var(--font-display); font-size: 15px; }
[data-tabs].is-ready > .tabpanel > .tabpanel-title { display: none; }
[data-tabs]:not(.is-ready) .tabpanel + .tabpanel { border-top: 1px solid var(--line); margin-top: 8px; }
.cp-pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--orange-soft); color: var(--orange-ink); white-space: nowrap; }
.cp-pill.is-good { background: var(--accent-soft); color: var(--accent-ink); }
.cp-pill.is-low { background: var(--danger-soft); color: var(--danger); }
.drawer { display: none; position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: clamp(300px, 20vw, 440px); max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(54, 57, 86, .12); flex-direction: column; }
.drawer.is-open, .drawer:not(.js-ready):target { display: flex; }
.drawer:focus { outline: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-display); font-size: 12px; }
.drawer-head .icon-btn { color: var(--muted); text-decoration: none; width: 44px; height: 44px; }
.drawer-head .icon-btn:hover { background: var(--ground-2); color: var(--ink); }
.drawer-body { flex-grow: 1; overflow-y: auto; padding: 14px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.hist-group { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--ground-2); }
.hist-meta { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.hist-meta strong { color: var(--ink); font-size: 11px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 11px; }
.hist-list li { display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
.hist-label { font-weight: 600; font-size: 11px; color: var(--ink-2); }
.hist-old { color: var(--danger); text-decoration: line-through; }
p.hist-old { text-decoration: none; background: var(--danger-soft); padding: 6px 8px; border-radius: 6px; margin-top: 6px; }
.hist-new { color: var(--accent); text-decoration: none; }
p.hist-new { background: var(--accent-soft); padding: 6px 8px; border-radius: 6px; margin-top: 6px; }

/* ---------- Offre et candidats (vue en deux moitiés) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.dl-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.hint-box { padding: 10px 12px; border-radius: 8px; background: var(--orange-soft); color: var(--orange-ink); }
.linked { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--ground); }
.linked-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.linked-name:hover { color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filters .field label { font-size: 11px; }
.filters-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-compact { font-size: 11px; }
.table-compact th { padding: 10px 6px; }
.table-compact td { padding: 10px 6px; }
.table-compact th:first-child, .table-compact td:first-child { padding-left: 12px; }
.table-compact tr.is-linked td { background: var(--accent-soft); }
.link-check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.link-bar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(54, 57, 86, .06); }
.link-bar .textarea { min-height: 44px; }
.link-bar .btn { flex-shrink: 0; }
.comments { display: flex; flex-direction: column; gap: 8px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comment { padding: 8px 10px; border-radius: 8px; background: var(--surface); border-left: 3px solid var(--mint); font-size: 11px; }
.comment p { white-space: pre-line; word-break: break-word; color: var(--ink-2); margin-top: 2px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.comment-meta strong { color: var(--ink); }
.comment-meta form { margin-left: auto; }
.comment-del { font-size: 11px; font-weight: 500; min-height: 24px; }
.app-item .comment { background: var(--surface); }
@media (max-width: 1180px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Alertes offres ---------- */
.alert-preview { padding: 12px 14px; border-radius: 10px; background: var(--ground); }
.mail-preview { margin: 0; padding: 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-family: var(--font-body); font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.mail-preview.rich-content { white-space: normal; font-size: 12px; }

.notes-scroll { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 8px 4px 0; overscroll-behavior: contain; }
.notes-scroll > * { flex-shrink: 0; }
.notes-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Éditeur de texte allégé et contenus enrichis ---------- */
.rich { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.rich:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rich.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.rich.is-busy { opacity: .6; pointer-events: none; }
.rich-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--soft); border-radius: 8px 8px 0 0; }
.rich-btn { min-width: 36px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.rich-btn:hover, .rich-btn:focus-visible { background: var(--surface); outline: 1px solid var(--line-strong); }
.rich-size { min-height: 36px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
.rich-size:hover, .rich-size:focus-visible { background: var(--surface); border-color: var(--line-strong); }
.rich-area { padding: 10px 12px; outline: none; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.rich-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich-content p { margin: 0 0 .6em; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 .6em; padding-left: 1.4em; }
.rich-content img { max-width: 100%; height: auto; border-radius: 6px; }
.rich-content a { color: var(--accent); }
.rich-content .ts-sm, .rich-content font[size="1"], .rich-content font[size="2"] { font-size: .85em; }
.rich-content .ts-lg, .rich-content font[size="5"] { font-size: 1.25em; }
.rich-content .ts-xl, .rich-content font[size="6"], .rich-content font[size="7"] { font-size: 1.5em; font-weight: 600; }
.rich-content .media-embed { font-weight: 600; }
.job-desc.rich-content, .rich-content.pre { white-space: normal; }
.media-frame { display: block; position: relative; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; margin: .6em 0; }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }

/* ---------- Candidatures en accordéon (fiche candidat) ---------- */
.app-acc { padding: 0; }
.app-acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; min-height: 44px; color: var(--ink); font-weight: 500; }
.app-acc > summary::after { content: '▾'; color: var(--muted); font-size: 11px; transition: transform .15s; }
.app-acc[open] > summary::after { transform: rotate(180deg); }
.app-acc-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.app-acc-title a { font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.app-acc-title a:hover { color: var(--accent); }
.app-acc-stage { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.app-acc-body { padding: 0 12px 12px; }

/* ---------- Clients et établissements ---------- */
.jobs-split { align-items: start; }
.job-line { padding: 10px 0; border-bottom: 1px solid var(--ground-2); flex-wrap: nowrap; }
.job-line:last-child { border-bottom: 0; }
details.card > summary { font-size: 12px; }

.placement-status { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }

/* ---------- Prospection ---------- */
.opp-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.opp-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.opp-card:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 1000px) { .opp-board { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Pilotage ---------- */
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-link { text-decoration: none; color: var(--ink); }
.kpi-link:hover { border-color: var(--accent); color: var(--ink); }
.kpi .kpi-amount { font-size: 12px; font-weight: 600; color: var(--accent); }
.kpi .kpi-commission { font-size: 11px; color: var(--orange-ink); }
.rate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rate-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.period-form .field { gap: 4px; }
.period-form .field label { font-size: 11px; }
@media (max-width: 900px) { .kpis-3 { grid-template-columns: minmax(0, 1fr); } }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; align-items: end; }
.bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bar-fill { width: 100%; max-width: 44px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar-value { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-label { font-size: 11px; color: var(--muted); }
.placement { padding-top: 4px; }

/* ---------- Emails et rappels ---------- */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.email-item { padding: 10px 12px; border-radius: 8px; background: var(--ground); }
.email-item summary { font-weight: 500; }
.tpl { padding: 12px 14px; border-radius: 8px; background: var(--ground); }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--ground-2); }
.task:last-of-type { border-bottom: 0; }
.task-check { width: 24px; height: 24px; margin: 10px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; position: relative; }
.task-check::after { content: ''; position: absolute; inset: -10px; }
.task-check:hover { border-color: var(--accent); }
.task-title { font-size: 12px; font-weight: 500; padding-top: 10px; }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task.is-done .task-check { background: var(--accent-soft); border-color: var(--accent-ink); }
.task-late { color: var(--danger); font-weight: 600; }
.task-today { color: var(--orange-ink); font-weight: 600; }
.tasks-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
a.chip { text-decoration: none; }
@media (max-width: 900px) { .tasks-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Rapprochement ---------- */
.match { display: grid; grid-template-columns: minmax(80px, 140px) auto; gap: 10px; align-items: center; }

/* ---------- Shortlists client ---------- */
.sl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sl-items li { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--ground); font-size: 12px; }
.sl-items a { color: var(--ink); text-decoration: none; }
.sl-form { padding-top: 14px; border-top: 1px solid var(--line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Dossier de présentation (écran + impression) ---------- */
.print-body { background: var(--surface); padding: 24px 16px 48px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.print-toolbar { width: 100%; max-width: 820px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.print-note { width: 100%; max-width: 820px; font-size: 11px; color: var(--orange-ink); background: var(--orange-soft); border-radius: 8px; padding: 10px 14px; }
.dossier { width: 100%; max-width: 820px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 40px 44px; display: flex; flex-direction: column; gap: 22px; }
.dossier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid var(--accent); }
.dossier-brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.dossier-brand strong { display: block; font-family: var(--font-display); font-size: 14px; color: var(--ink); }
.dossier-brand span span { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dossier-date { font-size: 11px; color: var(--muted); text-align: right; }
.dossier-id { display: flex; flex-direction: column; gap: 6px; }
.dossier-id h1 { font-size: 26px; }
.dossier-job { margin-top: 6px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; }
.dossier-facts { margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dossier-facts div { padding: 10px 12px; border-radius: 8px; background: var(--ground); }
.dossier-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dossier-facts dd { margin: 2px 0 0; font-size: 12px; font-weight: 600; }
.dossier-section { display: flex; flex-direction: column; gap: 8px; break-inside: avoid; }
.dossier-section h2 { font-family: var(--font-display); font-size: 12px; color: var(--accent); display: flex; justify-content: space-between; gap: 12px; }
.dossier-section p { font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.dossier-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.dossier-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dossier-2col > div { display: flex; flex-direction: column; gap: 8px; }
.dossier-score { font-size: 12px; color: var(--ink); }
.dossier-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.dossier-foot { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
@page { size: A4; margin: 14mm; }
@media print {
  .no-print, .flash { display: none !important; }
  body, .print-body { background: #fff; padding: 0; display: block; }
  .dossier { max-width: none; border: none; border-radius: 0; padding: 0; gap: 18px; }
  .dossier-job, .dossier-facts div, .meter, .meter span, .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
@media (max-width: 640px) {
  .dossier { padding: 24px 18px; }
  .dossier-2col, .dossier-scores { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .profile-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .profile-cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .topbar-mobile { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--sidebar); color: var(--mint); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
  .topbar-mobile a { color: var(--sidebar-text); text-decoration: none; font-size: 12px; white-space: nowrap; padding: 10px 6px; }
  .topbar-mobile a[aria-current="page"] { color: #fff; font-weight: 600; }
  .main { padding: 20px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-cols, .apply-layout, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 23px; }
}

/* Shortlist publique : créneaux d'entretien visibles seulement si « À rencontrer » est choisi */
.sl-form:not(:has(input[name="decision"][value="meet"]:checked)) .sl-slots { display: none; }

/* Pipe : entonnoir de production et barres d'objectifs */
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.progress { height: 6px; border-radius: 3px; background: var(--soft); margin-top: 4px; overflow: hidden; max-width: 160px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.cv-snippet { color: var(--ink-2); max-width: 420px; margin-top: 2px; }

/* Accueil : widgets « Rappels en retard » et « Rappels aujourd'hui » */
.task-widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .task-widgets { grid-template-columns: minmax(0, 1fr); } }

/* Pastilles de statut d'activité (candidats, clients, établissements) */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; vertical-align: middle; box-shadow: 0 0 0 2px var(--surface); }
.dot-green { background: #2E8B57; }
.dot-grey { background: #7F8197; }
.dot-orange { background: #E07B24; }
.dot-red { background: #C62828; }
.dot-black { background: #1B1C29; }
h1 .status-dot { width: 14px; height: 14px; }
.status-label { font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; order: 3; }

/* Tri des tableaux */
.th-sort { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; text-align: left; }
.th-sort::after { content: '↕'; opacity: .35; font-size: 10px; }
th[aria-sort="ascending"] .th-sort::after { content: '▲'; opacity: .9; }
th[aria-sort="descending"] .th-sort::after { content: '▼'; opacity: .9; }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
th.num .th-sort { justify-content: flex-end; width: 100%; }

/* Contrats : texte lisible */
.contract-text { max-width: 820px; font-size: 13px; line-height: 1.6; }
.contract-text p { margin: 0 0 8px; }
.contract-text ul { margin: 0 0 8px; padding-left: 20px; }
.variable-list { columns: 2 260px; margin: 8px 0 0; padding-left: 18px; }
.variable-list li { break-inside: avoid; margin-bottom: 2px; }

/* Offre publique : liens vers les pages « Offres d'emploi » et partage */
.seo-links { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; text-decoration: none; }
.seo-links a:hover { background: var(--accent-line); }
.share-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
