/* =====================================================================
   ERP — styles de base
   Palette : pétrole (structure), safran (repères actifs), papier (fond)
   ===================================================================== */
:root {
  --petrol: #0E4A55;
  --petrol-deep: #0A363E;
  --petrol-soft: #E3EEEF;
  --saffron: #D9A23A;
  --saffron-soft: #F7EBD2;
  --paper: #F4F6F5;
  --surface: #FFFFFF;
  --ink: #1B2A2F;
  --muted: #5E6F75;
  --line: #D8DFDD;
  --danger: #B3412E;
  --danger-soft: #F6E1DC;
  --success: #2F7D5B;
  --success-soft: #DCEFE5;
  --warning-soft: #F7EBD2;

  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius-s: 4px;
  --radius-m: 8px;
  --sidebar-w: 256px;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
a { color: var(--petrol); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; padding: .6rem 1.1rem;
  border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--petrol-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn-block { width: 100%; }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.input {
  font: inherit; width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink);
}
.input:focus { border-color: var(--petrol); outline: 2px solid var(--petrol-soft); outline-offset: 0; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.input-affix span {
  display: flex; align-items: center; padding: 0 .75rem; background: var(--paper);
  border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--muted); white-space: nowrap; font-size: .9rem;
}

/* ---------- Messages ---------- */
.alert { padding: .7rem .9rem; border-radius: var(--radius-s); margin-bottom: 1rem; border-left: 3px solid; }
.alert-error   { background: var(--danger-soft);  border-color: var(--danger);  }
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--saffron); }

/* =====================================================================
   Layout invité (connexion, portail)
   ===================================================================== */
.guest {
  min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 5fr) 7fr;
}
.guest-brand {
  background: var(--petrol); color: #fff; padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between;
}
.guest-brand .tenant-host { color: var(--saffron); font-weight: 600; word-break: break-all; }
.guest-brand h1 { font-size: 2.4rem; font-weight: 600; margin: .75rem 0 0; }
.guest-brand .tenant-mark { width: 48px; height: 48px; font-size: 1.1rem; }
.guest-brand .foot { color: #B8CDD0; font-size: .85rem; }
.guest-main { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.guest-card { width: 100%; max-width: 380px; }
.guest-card h2 { font-size: 1.4rem; margin-bottom: .25rem; }
.guest-card .lead { color: var(--muted); margin-bottom: 1.75rem; }

.error-page { max-width: 520px; }
.error-page .code { font-size: 4rem; font-weight: 600; color: var(--petrol); line-height: 1; margin-bottom: .5rem; }

@media (max-width: 800px) {
  .guest { grid-template-columns: 1fr; }
  .guest-brand { padding: 1.5rem; }
  .guest-brand h1 { font-size: 1.6rem; }
  .guest-brand .tenant-mark { width: 48px; height: 48px; font-size: 1.1rem; }
.guest-brand .foot { display: none; }
}

/* =====================================================================
   Layout application
   ===================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Barre latérale ---------- */
.sidebar {
  background: var(--petrol-deep); color: #D5E2E4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.tenant-block {
  display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.tenant-mark {
  width: 38px; height: 38px; flex: none; border-radius: var(--radius-s);
  background: var(--saffron); color: var(--petrol-deep);
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}
.tenant-name { color: #fff; font-weight: 600; line-height: 1.25; }
.tenant-host { font-size: .78rem; color: #8FAEB3; word-break: break-all; }

.nav { padding: .75rem .6rem; flex: 1; }
.nav-group-title { font-size: .78rem; color: #7F9EA3; padding: .9rem .6rem .35rem; }
.nav a, .nav .nav-soon, .nav summary {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .6rem; border-radius: var(--radius-s);
  color: inherit; text-decoration: none; cursor: pointer; list-style: none;
  position: relative;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -.6rem; top: .35rem; bottom: .35rem;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--saffron);
}
.nav .nav-soon { cursor: default; color: #6E8C91; }
.nav .nav-soon small { margin-left: auto; font-size: .72rem; border: 1px solid #3E6168; padding: 0 .4rem; border-radius: 10px; }
.nav details .chev { margin-left: auto; transition: transform .15s; }
.nav details[open] .chev { transform: rotate(90deg); }
.nav details a { padding-left: 2.45rem; font-size: .93rem; }

.sidebar-foot { padding: .75rem .6rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Barre du haut ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 10;
}
.topbar .menu-toggle { display: none; }
.top-tabs { display: flex; gap: .25rem; }
.top-tabs a, .top-tabs span {
  padding: .45rem .75rem; border-radius: var(--radius-s); text-decoration: none; color: var(--muted); font-weight: 600;
}
.top-tabs a:hover { background: var(--paper); color: var(--ink); }
.top-tabs span[aria-disabled] { opacity: .55; cursor: default; }

.global-search { flex: 1; max-width: 520px; position: relative; }
.global-search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search input { padding-left: 2.3rem; background: var(--paper); }
.global-search input:disabled { cursor: not-allowed; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: var(--radius-s); border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--paper); }
.icon-btn:disabled { color: var(--muted); cursor: not-allowed; opacity: .6; }

.user-menu { position: relative; }
.user-menu summary {
  list-style: none; display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .3rem .5rem; border-radius: var(--radius-s);
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--paper); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--petrol-soft); color: var(--petrol);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
}
.user-menu .who { line-height: 1.2; font-size: .9rem; }
.user-menu .who small { display: block; color: var(--muted); }
.user-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(14,74,85,.12); padding: .4rem;
}
.user-panel button, .user-panel a {
  display: flex; gap: .6rem; align-items: center; width: 100%; padding: .55rem .6rem;
  font: inherit; color: var(--ink); background: none; border: 0; text-align: left; border-radius: var(--radius-s); cursor: pointer; text-decoration: none;
}
.user-panel button:hover, .user-panel a:hover { background: var(--paper); }

.content { padding: 2rem 1.5rem 3rem; max-width: 1200px; width: 100%; }

/* ---------- Composants de page ---------- */
.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin: 0; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 1.25rem 1.4rem; margin-bottom: 1.25rem;
}
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.tag {
  display: inline-block; padding: .05rem .5rem; border-radius: 10px; font-size: .8rem; font-weight: 600;
  background: var(--petrol-soft); color: var(--petrol); margin: 0 .25rem .25rem 0;
}

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* Feuille de route : c'est une vraie séquence, d'où la numérotation */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.step {
  display: grid; grid-template-columns: 2.5rem 1fr auto; gap: 1rem; align-items: start;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; }
.step-num {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; border: 2px solid var(--line); color: var(--muted);
}
.step.is-done .step-num { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.step.is-in_progress .step-num { border-color: var(--saffron); color: var(--petrol-deep); background: var(--saffron-soft); }
.step h3 { font-size: 1rem; margin: .15rem 0 .2rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }
.status { font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 10px; white-space: nowrap; }
.status-done { background: var(--success-soft); color: var(--success); }
.status-in_progress { background: var(--saffron-soft); color: #7A5410; }
.status-todo { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(10,54,62,.4); }
  .topbar .menu-toggle { display: grid; }
  .top-tabs, .user-menu .who { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 1.25rem 1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =====================================================================
   Étape 1 : formulaires, listes, administration, console plateforme
   ===================================================================== */
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.back { display: inline-block; font-size: .88rem; color: var(--muted); text-decoration: none; margin-bottom: .4rem; }
.back::before { content: "‹ "; }
.back:hover { color: var(--petrol); }
.h-small { font-size: .95rem; margin-top: 1rem; }
.nowrap { white-space: nowrap; }
.muted-light { color: #B8CDD0; font-size: .9rem; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #962F1F; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.toolbar .input { width: auto; flex: 1 1 180px; max-width: 320px; }
.inline-label { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.inline-label .input { flex: none; }

.panel-flush { padding: 0; }
.panel-flush .table th, .panel-flush .table td { padding-left: 1.2rem; padding-right: 1.2rem; }
.panel-danger { border-color: #E6C3BB; }
.panel h2 + .check-list, .panel h2 + .field { margin-top: .5rem; }
.panel h2:not(:first-child) { margin-top: 1.5rem; }
.empty { color: var(--muted); padding: 1.5rem 1.25rem; margin: 0; }

.badge {
  display: inline-block; padding: .1rem .55rem; border-radius: 10px; font-size: .78rem; font-weight: 600;
  background: var(--paper); color: var(--muted); border: 1px solid var(--line);
}
.badge-ok  { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-off { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge-lg  { font-size: .9rem; padding: .25rem .75rem; }

.form-narrow { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.field-error { color: var(--danger); font-size: .86rem; margin: 0; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
.field-check { align-content: end; }
.field-check label { display: flex; gap: .5rem; align-items: center; font-weight: 400; padding-bottom: .6rem; }
.input[disabled] { background: var(--paper); color: var(--muted); }
select.input { appearance: auto; }

.check-list, .plain-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.check-list li { padding: .3rem 0; }
.check-list label { display: flex; gap: .55rem; align-items: baseline; cursor: pointer; }
.plain-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .muted { margin-left: .4rem; font-size: .88rem; }
.mono-list li { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }

/* Identifiants affichés une seule fois */
.credentials {
  border: 2px solid var(--saffron); background: var(--saffron-soft);
  border-radius: var(--radius-m); padding: 1.1rem 1.3rem; margin-bottom: 1.25rem;
}
.credentials p { color: #6B4A0E; }
.secret {
  font-size: 1.05rem; background: var(--surface); padding: .15rem .5rem; border-radius: var(--radius-s);
  border: 1px solid var(--line); user-select: all; letter-spacing: .03em;
}

/* Grille de permissions */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.perm-group { border: 1px solid var(--line); border-radius: var(--radius-m); padding: .75rem 1rem 1rem; margin: 0; }
.perm-group legend { font-weight: 600; padding: 0 .35rem; }
.perm { display: flex; gap: .55rem; align-items: baseline; padding: .3rem 0; cursor: pointer; }

/* Organigramme : l'indentation porte la hiérarchie */
.org-tree { list-style: none; margin: 0; padding: 0; }
.org-node {
  margin-left: calc(var(--depth) * 1.75rem);
  padding: .7rem .9rem; border-left: 3px solid var(--petrol-soft);
  border-bottom: 1px solid var(--line);
}
.org-node[style*="--depth: 0"] { border-left-color: var(--petrol); }
.org-node.is-inactive { opacity: .6; }
.org-main { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.org-main a { text-decoration: none; color: var(--ink); }
.org-main a:hover { color: var(--petrol); text-decoration: underline; }
.org-type { font-size: .78rem; color: var(--petrol); background: var(--petrol-soft); padding: .05rem .5rem; border-radius: 10px; }
.org-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin-top: .25rem; }

.logo-preview { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-m); padding: 1rem; margin-bottom: 1rem; text-align: center; }
.logo-preview img { max-width: 100%; max-height: 90px; }
.tenant-logo { background: #fff; padding: 3px; }
.tenant-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.guest-logo { background: #fff; display: inline-block; padding: .6rem .9rem; border-radius: var(--radius-m); }
.guest-logo img { max-height: 56px; max-width: 220px; display: block; }

.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 1rem; }

/* Console plateforme */
.platform-bar {
  background: var(--petrol-deep); color: #fff; display: flex; align-items: center; gap: 2rem;
  padding: 0 1.5rem; min-height: 60px; flex-wrap: wrap;
}
.platform-brand { display: flex; flex-direction: column; line-height: 1.2; padding: .6rem 0; }
.platform-brand span { color: var(--saffron); font-size: .82rem; }
.platform-nav { display: flex; gap: .25rem; }
.platform-nav a { color: #D5E2E4; text-decoration: none; padding: .45rem .75rem; border-radius: var(--radius-s); font-weight: 600; }
.platform-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.platform-nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -2px 0 var(--saffron); }
.platform-out { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.platform-content { margin: 0 auto; }

@media (max-width: 960px) {
  .form-grid { grid-template-columns: 1fr; }
  .org-node { margin-left: calc(var(--depth) * .9rem); }
  .platform-bar { gap: .75rem; padding: .5rem 1rem; }
}

/* Mise en route : une vraie séquence, d'où la liste numérotée */
.setup { border-left: 3px solid var(--saffron); }
.setup-list { margin: 0; padding-left: 1.3rem; }
.setup-list li { padding: .3rem 0; }
.setup-list li.is-done span { color: var(--muted); text-decoration: line-through; }
.setup-list li.is-done::marker { color: var(--success); }

/* =====================================================================
   Étape 2 : communication
   ===================================================================== */
.nav-badge {
  margin-left: auto; min-width: 1.35rem; padding: 0 .4rem; border-radius: 10px; text-align: center;
  background: var(--saffron); color: var(--petrol-deep); font-size: .75rem; font-weight: 700; line-height: 1.35rem;
}
.nav a .nav-badge { margin-left: auto; }
.has-badge { position: relative; text-decoration: none; }
.top-badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
}
[hidden] { display: none !important; }

.bell-menu { position: relative; }
.bell-menu summary { list-style: none; }
.bell-menu summary::-webkit-details-marker { display: none; }
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(360px, 90vw); z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(14,74,85,.12);
}
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.bell-all { display: block; text-align: center; padding: .65rem; border-top: 1px solid var(--line); font-size: .9rem; }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: grid; gap: .15rem; padding: .8rem 1.2rem; color: var(--ink); text-decoration: none; }
.notif-list a:hover { background: var(--paper); }
.notif-list li.unread a { box-shadow: inset 3px 0 0 var(--saffron); background: #FCF8EE; }
.notif-list li:not(.unread) strong { font-weight: 400; }
.notif-body { color: var(--muted); font-size: .9rem; }
.notif-list time { font-size: .8rem; }
.notif-list.compact { max-height: 340px; overflow-y: auto; }
.notif-list.compact a { padding: .6rem 1rem; font-size: .9rem; }

.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--petrol); border-bottom-color: var(--petrol); }

/* Messagerie */
.chat {
  display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--topbar-h) - 9rem); min-height: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden;
}
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: grid; gap: .15rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chat-item:hover { background: var(--paper); }
.chat-item.active { background: var(--petrol-soft); }
.chat-item-top { display: flex; align-items: center; gap: .5rem; }
.chat-item-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item:not(.unread) .chat-item-top strong { font-weight: 400; }
.chat-item-preview { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; }
.chat-head p { margin: .1rem 0 0; font-size: .86rem; }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; background: var(--paper); }
.msg { max-width: min(75%, 560px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .55rem .8rem; align-self: flex-start; }
.msg-mine { align-self: flex-end; background: var(--petrol-soft); border-color: transparent; }
.msg header { display: flex; gap: .6rem; align-items: baseline; font-size: .82rem; }
.msg time { color: var(--muted); }
.msg-body { white-space: normal; overflow-wrap: anywhere; margin-top: .15rem; }
.msg-file { display: block; margin-top: .35rem; font-size: .9rem; }
.chat-form { border-top: 1px solid var(--line); padding: .75rem 1rem; display: grid; gap: .5rem; }
.chat-form textarea { resize: vertical; min-height: 2.8rem; }
.chat-form-actions { display: flex; align-items: center; gap: .6rem; }
.chat-form-actions .btn-primary { margin-left: auto; }
.chat-files { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); padding: .25rem .75rem; margin-top: .4rem; }

@media (max-width: 960px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 7rem); }
  .chat.has-current .chat-list { display: none; }
  .chat:not(.has-current) .chat-thread { display: none; }
  .chat-back { display: inline-block; }
}

/* Historique et commentaires */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed p { margin: 0; }
.feed-meta { font-size: .82rem; margin-top: .15rem !important; }
.avatar-s { width: 2rem; height: 2rem; font-size: .72rem; }
.comment-body { background: var(--paper); border-radius: var(--radius-m); padding: .55rem .8rem; margin-top: .35rem; overflow-wrap: anywhere; }
.timeline-form { display: grid; gap: .5rem; margin-bottom: 1rem; }
.timeline-form .btn { justify-self: start; }
.notify-pick summary { cursor: pointer; color: var(--petrol); font-size: .9rem; }
.notify-pick[open] summary { margin-bottom: .4rem; }
.check-inline { display: flex; gap: .5rem; align-items: baseline; margin: .75rem 0 .25rem; cursor: pointer; }

/* =====================================================================
   Étape 3 : projets et tâches
   ===================================================================== */
.num { text-align: right; white-space: nowrap; }
.is-late { color: var(--danger); font-weight: 600; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem .4rem; }
.panel-title-row h2 { margin: 0; }
.prose-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.inline-form { display: inline; margin: 0; }
.input-s { padding: .3rem .5rem; font-size: .88rem; width: auto; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-size: .88rem; color: var(--petrol); cursor: pointer; text-decoration: underline; }
.btn-link:hover { color: var(--petrol-deep); }
.inline-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.inline-grid .input { flex: 1 1 140px; width: auto; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .9rem 1.1rem; display: grid; gap: .3rem; align-content: start; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.45rem; font-weight: 600; line-height: 1.15; }
.kpi a, .kpi span:not(.kpi-label):not(.kpi-value):not(.progress):not(.progress-bar):not(.progress-label) { font-size: .85rem; }
.kpi-alert { border-color: #E6C3BB; background: #FDF6F4; }
.kpi-alert .kpi-value { color: var(--danger); }

/* Barre d'avancement */
.progress { display: inline-block; vertical-align: middle; width: 90px; height: 6px; background: var(--petrol-soft); border-radius: 3px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--petrol); border-radius: 3px; }
.progress-label { font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.kpi .progress { width: 100%; }
.kpi .progress-label { display: none; }

/* Statuts */
.pstatus, .tstatus { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.pstatus-draft, .tstatus-todo { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pstatus-active, .tstatus-in_progress { background: var(--petrol-soft); color: var(--petrol); }
.pstatus-on_hold, .tstatus-review { background: var(--saffron-soft); color: #7A5410; }
.pstatus-completed, .tstatus-done { background: var(--success-soft); color: var(--success); }
.pstatus-cancelled, .tstatus-blocked { background: var(--danger-soft); color: var(--danger); }
select.tstatus { border-radius: var(--radius-s); border: 1px solid var(--line); padding: .3rem .5rem; font-size: .85rem; }
.prio { font-size: .75rem; font-weight: 600; margin-left: .35rem; }
.prio-high { color: #7A5410; }
.prio-critical { color: var(--danger); }
tr.is-done td a strong { color: var(--muted); text-decoration: line-through; font-weight: 400; }

.projects-table tr.is-child td:first-child { padding-left: 2.4rem; position: relative; }
.projects-table tr.is-child td:first-child::before {
  content: ""; position: absolute; left: 1.3rem; top: 0; bottom: 50%; width: .7rem;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* Création : choix du type */
.type-pick { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.type-pick legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.type-option { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-m); padding: .7rem .9rem; cursor: pointer; }
.type-option:has(input:checked) { border-color: var(--petrol); background: var(--petrol-soft); }
.type-option span { display: grid; gap: .1rem; }
.type-option small { color: var(--muted); }
.type-option.is-disabled { opacity: .5; cursor: not-allowed; }

.quick-add summary { cursor: pointer; }
.quick-add[open] summary { margin-bottom: 1rem; }

/* Sous-tâches */
.subtasks { list-style: none; margin: 0 0 .5rem; padding: 0; }
.subtasks li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtasks li.is-done a { color: var(--muted); text-decoration: line-through; }
.check-btn {
  width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--petrol); border-radius: 4px; background: var(--surface);
  display: inline-grid; place-items: center; font-size: .8rem; line-height: 1; color: #fff; cursor: pointer; padding: 0;
}
.subtasks li.is-done .check-btn { background: var(--petrol); }

/* Documents */
.doc-cat { font-size: .95rem; padding: 1.1rem 1.2rem .3rem; margin: 0; color: var(--petrol); }
.doc-list { list-style: none; margin: 0; padding: 0 1.2rem .5rem; }
.doc-list > li { padding: .65rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .3rem; }
.doc-list > li:last-child { border-bottom: 0; }
.doc-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.doc-main small { flex-basis: 100%; }
.doc-actions { display: flex; gap: 1rem; }
.doc-versions summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.doc-versions ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .88rem; }

.task-group-overdue { border-left: 3px solid var(--danger); }
.task-group-today { border-left: 3px solid var(--saffron); }

@media (max-width: 960px) {
  .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
}
.kpi-link { text-decoration: none; color: var(--ink); }
.kpi-link:hover { border-color: var(--petrol); }

/* =====================================================================
   Étape 3B : Gantt, calendrier, charge de travail
   ===================================================================== */
.gantt-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.gantt-msg { font-size: .88rem; color: var(--success); }
.gantt-msg.is-error { color: var(--danger); }
.gantt-hint { margin-bottom: .75rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg-btn { font: inherit; font-size: .88rem; padding: .45rem .8rem; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.is-active { background: var(--petrol); color: #fff; }

.gantt { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 1rem; }
.gantt-names { border-right: 1px solid var(--line); min-width: 0; }
.gantt-names-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.gantt-name { display: flex; flex-direction: column; justify-content: center; padding: 0 .8rem; border-bottom: 1px solid #EEF1F0;
  text-decoration: none; color: var(--ink); overflow: hidden; }
.gantt-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; font-weight: 600; }
.gantt-name small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-name.depth-1 { padding-left: 1.8rem; }
.gantt-name.depth-1 span { font-weight: 400; }
.gantt-name:hover { background: var(--paper); }
.gantt-chart { overflow-x: auto; position: relative; }
.gantt-canvas { position: relative; background-image: linear-gradient(#EEF1F0 1px, transparent 1px); background-size: 100% 34px; background-position: 0 46px; }
.g-month { position: absolute; top: 4px; font-size: .78rem; font-weight: 600; color: var(--petrol); padding-left: 4px; white-space: nowrap; }
.g-tick { position: absolute; top: 24px; font-size: .72rem; color: var(--muted); padding-left: 3px; white-space: nowrap; overflow: hidden; }
.g-line { position: absolute; top: 22px; border-left: 1px solid #EEF1F0; }
.g-line-month { top: 0; border-left-color: var(--line); }
.g-weekend { position: absolute; top: 46px; background: rgba(14,74,85,.035); }
.g-today { position: absolute; top: 0; border-left: 2px solid var(--saffron); z-index: 2; pointer-events: none; }
.gbar { position: absolute; height: 20px; border-radius: 4px; background: #9DBDC3; overflow: hidden; z-index: 3;
  display: flex; align-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(10,54,62,.15); user-select: none; touch-action: none; }
.gbar.is-editable { cursor: grab; }
.gbar.is-editable:active { cursor: grabbing; }
.gbar.is-sub { height: 14px; margin-top: 3px; opacity: .9; }
.gbar-progress { position: absolute; inset: 0 auto 0 0; background: var(--petrol); }
.gbar-label { position: relative; font-size: .74rem; color: #fff; padding: 0 6px; white-space: nowrap; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.gbar-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.gbar-handle-l { left: 0; } .gbar-handle-r { right: 0; }
.gbar.is-editable:hover .gbar-handle { background: rgba(255,255,255,.35); }
.gbar-done { background: #A9CDB8; } .gbar-done .gbar-progress { background: var(--success); }
.gbar-blocked { background: #E3B4AA; } .gbar-blocked .gbar-progress { background: var(--danger); }
.gbar-review { background: #EBD29C; } .gbar-review .gbar-progress { background: #B78A2A; }

/* Calendrier */
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-nav strong { min-width: 9rem; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px;
  border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.cal-head { background: var(--paper); padding: .45rem; font-size: .82rem; font-weight: 600; color: var(--muted); text-align: center; }
.cal-day { background: var(--surface); min-height: 108px; padding: .35rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day.is-out { background: #FAFBFA; }
.cal-day.is-out .cal-num { color: #B3BEBC; }
.cal-day.is-weekend { background: #F8FAF9; }
.cal-day.is-today .cal-num { background: var(--petrol); color: #fff; border-radius: 50%; }
.cal-num { font-size: .8rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; font-weight: 600; }
.cal-item { display: block; font-size: .76rem; padding: .1rem .35rem; border-radius: 3px; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.is-late-item { box-shadow: inset 3px 0 0 var(--danger); }
.cal-project { background: var(--petrol); color: #fff; font-weight: 600; }

/* Charge de travail */
.workload td.wl { font-size: .88rem; line-height: 1.25; }
.wl-l0 { color: #B3BEBC; }
.wl-l1 { background: #EEF5F5; }
.wl-l2 { background: #CFE2E4; }
.wl-l3 { background: var(--saffron-soft); color: #6B4A0E; font-weight: 600; }
.wl-l4 { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .85rem; color: var(--muted); margin: .5rem 0; }
.wl-legend i { display: inline-block; width: .9rem; height: .9rem; border-radius: 2px; vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--line); }

@media (max-width: 960px) {
  .gantt { grid-template-columns: 130px 1fr; }
  .cal-day { min-height: 70px; }
  .cal-item { font-size: 0; height: 6px; padding: 0; }
}

/* =====================================================================
   Étape 4A : commercial
   ===================================================================== */
.cstatus, .stage { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.cstatus-prospect { background: var(--saffron-soft); color: #7A5410; }
.cstatus-client { background: var(--success-soft); color: var(--success); }
.cstatus-inactive { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.stage-new, .stage-qualified { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.stage-proposal, .stage-negotiation { background: var(--petrol-soft); color: var(--petrol); }
.stage-won { background: var(--success-soft); color: var(--success); }
.stage-lost { background: var(--danger-soft); color: var(--danger); }

.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .5rem; }
.board-col { background: #EBEFEE; border-radius: var(--radius-m); padding: .6rem; display: flex; flex-direction: column; min-height: 240px; }
.board-col.is-over { outline: 2px dashed var(--petrol); outline-offset: -2px; background: var(--petrol-soft); }
.board-col header { display: flex; flex-direction: column; gap: .1rem; padding: .2rem .3rem .6rem; font-size: .9rem; }
.board-col header .muted { font-size: .8rem; }
.board-cards { display: grid; gap: .5rem; align-content: start; flex: 1; }
.deal-card { display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: .6rem .7rem; text-decoration: none; color: var(--ink); font-size: .9rem; box-shadow: 0 1px 2px rgba(10,54,62,.06); }
.deal-card[draggable="true"] { cursor: grab; }
.deal-card:hover { border-color: var(--petrol); }
.deal-card.is-dragging { opacity: .5; }
.deal-card .muted { font-size: .82rem; }
.deal-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }

.crm-acts { list-style: none; margin: 0 0 1rem; padding: 0; }
.crm-acts li { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.crm-acts li:last-child { border-bottom: 0; }
.crm-acts li > div { display: grid; gap: .1rem; }
.crm-acts li.is-done strong { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.crm-acts li.is-done .check-btn { background: var(--petrol); }
.crm-acts p { margin: .2rem 0 0; font-size: .88rem; }
.act-form summary { cursor: pointer; color: var(--petrol); font-weight: 600; font-size: .92rem; }
.act-form[open] summary { margin-bottom: .75rem; }
.lost-pick { position: relative; }
.lost-pick summary { list-style: none; }
.lost-pick summary::-webkit-details-marker { display: none; }
.lost-pick .panel { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; z-index: 5; display: grid; gap: .5rem;
  box-shadow: 0 8px 24px rgba(14,74,85,.12); }

@media (max-width: 960px) { .board { grid-template-columns: repeat(4, 240px); } }

/* =====================================================================
   Étape 4B : devis et factures
   ===================================================================== */
.qstatus, .istatus { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.qstatus-draft, .istatus-draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.qstatus-sent, .istatus-issued { background: var(--petrol-soft); color: var(--petrol); }
.qstatus-accepted, .qstatus-invoiced, .istatus-paid { background: var(--success-soft); color: var(--success); }
.istatus-partial { background: var(--saffron-soft); color: #7A5410; }
.qstatus-refused, .istatus-cancelled { background: var(--danger-soft); color: var(--danger); }

.lines-table td { vertical-align: top; }
.lines-table .line-main { min-width: 260px; display: grid; gap: .35rem; }
.lines-table .line-main textarea { min-height: 2.6rem; resize: vertical; font-size: .9rem; }
.num-in { width: 6.5rem; text-align: right; }
.line-total { font-weight: 600; padding-top: .9rem !important; }
.lines-totals { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1.5rem; max-width: 420px; margin: 1rem 0 .5rem auto; }
.lines-totals dt { color: var(--muted); }
.lines-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lines-totals .grand { font-weight: 700; font-size: 1.1rem; color: var(--ink); border-top: 2px solid var(--petrol); padding-top: .4rem; }

.doc-steps { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.issue-box { display: grid; gap: .75rem; border-left: 3px solid var(--saffron); }
.pay-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.color-in { height: 2.6rem; padding: .2rem; width: 5rem; }

/* =====================================================================
   Étape 5 : achats
   ===================================================================== */
.rstatus, .ostatus, .sistatus { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.rstatus-draft, .ostatus-draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.rstatus-submitted, .ostatus-sent, .sistatus-to_pay { background: var(--petrol-soft); color: var(--petrol); }
.rstatus-approved, .ostatus-partial, .sistatus-partial { background: var(--saffron-soft); color: #7A5410; }
.rstatus-ordered, .ostatus-received, .sistatus-paid { background: var(--success-soft); color: var(--success); }
.rstatus-rejected, .rstatus-cancelled, .ostatus-cancelled { background: var(--danger-soft); color: var(--danger); }
.is-ok { color: var(--success); font-weight: 600; }

.decision { border-left: 3px solid var(--saffron); }
.approval-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.approval-steps li { position: relative; padding: .2rem 0 1rem 2.4rem; display: grid; gap: .1rem; counter-increment: step; }
.approval-steps li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 2px solid var(--line); color: var(--muted); background: var(--surface);
}
.approval-steps li:not(:last-child)::after { content: ""; position: absolute; left: .8rem; top: 1.9rem; bottom: .1rem; border-left: 2px solid var(--line); }
.approval-steps li.ap-approved::before { content: "✓"; background: var(--success); border-color: var(--success); color: #fff; }
.approval-steps li.ap-rejected::before { content: "✕"; background: var(--danger); border-color: var(--danger); color: #fff; }
.approval-steps li.is-current::before { border-color: var(--saffron); color: var(--petrol-deep); background: var(--saffron-soft); }
.approval-steps em { color: var(--muted); font-size: .9rem; }

/* =====================================================================
   Étape 6 : aperçu, recherche, conventions
   ===================================================================== */
.top-tabs a.active { color: var(--petrol); background: var(--petrol-soft); }
.global-search { position: relative; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 10px 28px rgba(14,74,85,.16); padding: .35rem;
}
.ss-group + .ss-group { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .25rem; }
.ss-label { font-size: .74rem; font-weight: 700; color: var(--muted); padding: .35rem .6rem .15rem; }
.search-suggest a, .ss-item { display: grid; gap: .05rem; padding: .45rem .6rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.search-suggest a:hover, .search-suggest a:focus { background: var(--petrol-soft); outline: none; }
.search-suggest small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-all { width: 100%; margin-top: .3rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--petrol); background: var(--paper);
  border: 0; border-radius: var(--radius-s); padding: .5rem; cursor: pointer; }
.search-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.search-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.search-list li { display: grid; gap: .1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.search-list li:last-child { border-bottom: 0; }

.ov-section { margin-bottom: 1.5rem; }
.ov-section > h2 { font-size: 1rem; color: var(--petrol); margin-bottom: .6rem; }
.ov-section .kpis { margin-bottom: .75rem; }

.cvstatus { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.cvstatus-draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.cvstatus-active { background: var(--success-soft); color: var(--success); }
.cvstatus-terminated, .cvstatus-expired { background: var(--danger-soft); color: var(--danger); }
.seg label.seg-btn { cursor: pointer; }
.type-pick select, .type-pick input.input { margin-top: .6rem; }

/* Envoi de documents par email */
.send-doc summary { cursor: pointer; color: var(--petrol); }
.send-doc[open] summary { margin-bottom: 1rem; }

/* Import de fiches */
.import-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.25rem; flex-wrap: wrap; counter-reset: st; }
.import-steps li { counter-increment: st; display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .9rem; }
.import-steps li::before { content: counter(st); width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: .78rem; font-weight: 700; background: var(--surface); }
.import-steps li + li::after { order: -1; content: ""; width: 1.5rem; border-top: 2px solid var(--line); }
.import-steps li.is-done::before { content: "✓"; background: var(--success); border-color: var(--success); color: #fff; }
.import-steps li.is-current { color: var(--ink); font-weight: 600; }
.import-steps li.is-current::before { border-color: var(--saffron); background: var(--saffron-soft); color: var(--petrol-deep); }
tr.is-unmapped td { opacity: .6; }
.imp { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 10px; }
.imp-created { background: var(--success-soft); color: var(--success); }
.imp-updated, .imp-contact { background: var(--petrol-soft); color: var(--petrol); }
.imp-skipped { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.imp-error { background: var(--danger-soft); color: var(--danger); }
