@font-face { font-family: Inter; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Montserrat; src: url(/fonts/montserrat.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --acier: #303a40; --acier-fonce: #1f262a; --acier-doux: #5f6b71;
  --orange: #d85b35; --orange-action: #c24c29; --orange-appuye: #a63f20; --orange-pale: #fbeee9;
  --fond: #eef0f1; --surface: #fff; --surface-2: #f6f7f8; --ligne: #dfe3e5; --ligne-forte: #b9c1c5;
  --texte: #263036; --texte-doux: #5a666c;
  --danger: #b3261e; --danger-fonce: #8f1e18; --danger-pale: #fbeceb; --ok: #1d7a4f;
  --ambre: #a8590c; --ambre-pale: #fcf0dc;
  --bleu: #2a6191; --bleu-pale: #e6f0f8;
  --vert: #1d7a4f; --vert-pale: #e3f4ec;
  --sarcelle: #0f7079; --sarcelle-pale: #dff3f4;
  --gris: #5c676d; --gris-pale: #e9ecee;
  --titre: Montserrat, system-ui, sans-serif;
  --rayon: 14px; --rayon-s: 9px;
  --ombre-1: 0 1px 2px rgba(31, 38, 42, .06), 0 1px 3px rgba(31, 38, 42, .06);
  --ombre-2: 0 6px 18px rgba(31, 38, 42, .12);
  --ombre-3: 0 18px 50px rgba(31, 38, 42, .28);
  --vite: 160ms; --moyen: 240ms;
  --sortie: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 400 15px/1.5 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--titre); letter-spacing: -.015em; line-height: 1.2; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, select, label, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: rgba(216, 91, 53, .16); }
.libelle-court { display: none; }
[hidden] { display: none !important; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--ligne-forte); border-radius: var(--rayon-s); background: var(--surface); color: var(--texte);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background var(--vite), border-color var(--vite), transform var(--vite);
}
.btn:hover { background: var(--surface-2); border-color: var(--acier-doux); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--orange-action); border-color: var(--orange-action); color: #fff; }
.btn.primary:hover { background: var(--orange-appuye); border-color: var(--orange-appuye); }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--danger-pale); }
.btn.danger-plein { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-plein:hover { background: var(--danger-fonce); border-color: var(--danger-fonce); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: var(--rayon-s);
  background: transparent; color: var(--texte-doux); transition: background var(--vite), color var(--vite);
}
.icon-btn:hover { background: var(--gris-pale); color: var(--texte); }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); background: var(--surface); }
.login-visuel { position: relative; background: var(--acier-fonce) url(/hero.jpg) center / cover no-repeat; }
.login-visuel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(31, 38, 42, .35), rgba(31, 38, 42, .88)); }
.login-accroche { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 48px; color: #fff; }
.login-accroche img { display: block; width: 136px; height: auto; margin-bottom: 28px; }
.login-accroche p { font: 700 clamp(26px, 2.8vw, 38px)/1.15 var(--titre); letter-spacing: -.02em; max-width: 15em; }
.login-accroche p span { color: #ff9a75; }
.login-panneau { display: grid; place-items: center; padding: 32px 24px; }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 18px; }
.login-form h1 { font-size: 28px; }
.login-form .intro { color: var(--texte-doux); margin-top: -10px; }
.login-form .btn { min-height: 48px; font-size: 15px; }
.login-erreur { padding: 10px 12px; border-radius: var(--rayon-s); background: var(--danger-pale); color: var(--danger); font-size: 14px; font-weight: 500; }
.mdp { position: relative; }
.mdp input { padding-right: 48px; }
.mdp .icon-btn { position: absolute; top: 1px; right: 1px; }

/* ---------- Champs ---------- */
.champ { display: grid; gap: 5px; min-width: 0; align-content: start; }
.champ > label { font-size: 12.5px; font-weight: 600; color: var(--texte-doux); }
.champ .req { color: var(--orange-action); }
.input {
  width: 100%; min-height: 44px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--ligne-forte);
  border-radius: var(--rayon-s); transition: border-color var(--vite), box-shadow var(--vite);
}
.input:hover { border-color: var(--acier-doux); }
.input:focus { outline: 0; border-color: var(--orange-action); box-shadow: 0 0 0 3px rgba(216, 91, 53, .22); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 110px; line-height: 1.5; resize: vertical; }
/* Safari iOS impose une largeur minimale aux dates et les centre : le champ déborderait de sa colonne. */
input[type="date"].input { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
/* Safari ignore la hauteur des listes natives : on dessine la flèche nous-mêmes. */
select.input, .statut-rapide select {
  -webkit-appearance: none; appearance: none; padding-right: 38px;
  background-image: url(/chevron.svg); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px;
}
.champ-erreur { color: var(--danger); font-size: 13px; font-weight: 500; }
.champ-aide { color: var(--texte-doux); font-size: 13px; }

/* ---------- Structure ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 26px 16px 16px;
  background: linear-gradient(180deg, #2b3439, var(--acier-fonce)); color: #fff;
}
.side-logo { display: block; width: 104px; height: auto; margin-left: 8px; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--rayon-s);
  color: #cfd6d9; font-weight: 500; text-decoration: none; transition: background var(--vite), color var(--vite);
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current="page"] { background: var(--orange-action); color: #fff; font-weight: 600; }
.nav .compte { margin-left: auto; padding: 0 7px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-bas { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.side-bas .avatar { width: 34px; height: 34px; font-size: 13px; }
.side-bas .nom { font-weight: 600; font-size: 14px; }
.side-bas .icon-btn { margin-left: auto; color: #cfd6d9; }
.side-bas .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { min-width: 0; padding: 28px 32px 40px; }
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.top-titres { margin-right: auto; }
.top h1 { font-size: 26px; font-weight: 700; }
.top .sous { color: var(--texte-doux); font-size: 14px; }
.top-mobile { display: none; }
.recherche { position: relative; width: min(300px, 100%); }
.recherche svg { position: absolute; left: 12px; top: 13px; color: var(--texte-doux); pointer-events: none; }
.recherche input { padding-left: 38px; }

/* ---------- Kanban ---------- */
/* Autant de colonnes que nécessaire : 5 statuts, ou une par entreprise pour les clients. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(178px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.board.empile { grid-auto-columns: minmax(230px, 1fr); }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 320px; padding: 12px; border-radius: var(--rayon); background: #e3e7e9; transition: background var(--vite), box-shadow var(--vite); }
.col.survol { background: var(--orange-pale); box-shadow: inset 0 0 0 2px var(--orange); }
.col-tete { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col-tete h2 { font-size: 13.5px; font-weight: 700; }
.col-tete .pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.col-tete .nb { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 99px; background: var(--surface); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.col-vide { flex: 1; display: grid; place-items: center; min-height: 92px; padding: 14px; border: 1.5px dashed var(--ligne-forte); border-radius: var(--rayon-s); color: var(--texte-doux); font-size: 13px; text-align: center; }

[data-statut="En négociation"], [data-statut="À confirmer"] { --c: var(--orange); --c-texte: var(--ambre); --c-pale: var(--ambre-pale); }
[data-statut="Signée"] { --c: var(--bleu); --c-texte: var(--bleu); --c-pale: var(--bleu-pale); }
[data-statut="En cours"], [data-statut="En mission"] { --c: var(--sarcelle); --c-texte: var(--sarcelle); --c-pale: var(--sarcelle-pale); }
[data-statut="Terminée"], [data-statut="Disponible"] { --c: var(--vert); --c-texte: var(--vert); --c-pale: var(--vert-pale); }
[data-statut="Abandonnée"], [data-statut="Indisponible"], [data-statut="Non retenu"] { --c: var(--gris); --c-texte: var(--gris); --c-pale: var(--gris-pale); }

.carte {
  display: block; width: 100%; padding: 14px; border-radius: var(--rayon); background: var(--surface);
  box-shadow: var(--ombre-1); color: inherit; text-align: left; text-decoration: none;
  transition: transform var(--vite) var(--sortie), box-shadow var(--vite);
}
.carte:hover { transform: translateY(-2px); box-shadow: var(--ombre-2); }
.carte.drag { opacity: .45; }
.mission { position: relative; }
.mission[draggable="true"] { cursor: grab; }
.mission[draggable="true"]:active { cursor: grabbing; }
.mission h3 { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.lien-etire { color: inherit; text-decoration: none; }
.lien-etire:focus-visible { outline: 0; }
/* Toute la carte reste cliquable, tandis que le sélecteur de statut garde ses propres touchers. */
.lien-etire::after { content: ""; position: absolute; inset: 0; border-radius: var(--rayon); }
.lien-etire:focus-visible::after { outline: 3px solid var(--orange); outline-offset: 2px; }
.statut-rapide { display: none; position: relative; z-index: 1; margin-top: 10px; }
.statut-rapide select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--c); border-radius: var(--rayon-s);
  background-color: var(--c-pale); color: var(--c-texte); font-size: 16px; font-weight: 600;
}
.mission .client { margin-top: 2px; color: var(--texte-doux); font-size: 13px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--ligne); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.progres { margin-top: 12px; }
.progres-ligne { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--texte-doux); }
.progres-ligne b { color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.barre { height: 6px; margin-top: 5px; border-radius: 99px; background: var(--gris-pale); overflow: hidden; }
.barre > i { display: block; height: 100%; width: 100%; border-radius: 99px; background: var(--orange); transform-origin: left; transition: transform var(--moyen) var(--sortie); }
.mission-bas { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 28px; }
.mission-bas .aucun { color: var(--texte-doux); font-size: 12px; }
.pile { display: flex; }
.pile .avatar { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--surface); margin-left: -6px; }
.pile .avatar:first-child { margin-left: 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--av, var(--acier)); color: #fff; font: 700 15px var(--titre);
}
.av0 { --av: #303a40; } .av1 { --av: #c24c29; } .av2 { --av: #2a6191; } .av3 { --av: #0f7079; } .av4 { --av: #1d7a4f; } .av5 { --av: #6d5a9c; }

/* Onglets de statut : le Kanban devient une colonne à la fois sur téléphone. */
.onglets { display: none; }

/* ---------- Grilles de fiches ---------- */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filtre {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--ligne-forte); border-radius: 99px; background: var(--surface);
  font-size: 13px; font-weight: 500; transition: background var(--vite), color var(--vite), border-color var(--vite);
}
.filtre:hover { border-color: var(--acier-doux); }
.filtre[aria-pressed="true"] { background: var(--acier); border-color: var(--acier); color: #fff; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.fiche { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.fiche-lien { display: block; flex: 1; padding: 16px; color: inherit; text-decoration: none; }
.fiche-tete { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fiche-tete > div:nth-child(2) { min-width: 130px; flex: 1; }
.fiche h3 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.fiche .role { color: var(--texte-doux); font-size: 13.5px; overflow-wrap: anywhere; }
.statut {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 99px; background: var(--c-pale);
  color: var(--c-texte); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fiche .note { margin-top: 10px; color: var(--texte-doux); font-size: 13px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.fiche-actions { display: flex; border-top: 1px solid var(--ligne); }
.fiche-actions a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--texte-doux); text-decoration: none; transition: background var(--vite), color var(--vite); }
.fiche-actions a + a { border-left: 1px solid var(--ligne); }
.fiche-actions a:hover { background: var(--surface-2); color: var(--orange-action); }
.vide { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; border: 1.5px dashed var(--ligne-forte); border-radius: var(--rayon); color: var(--texte-doux); text-align: center; }
.vide h2 { font-size: 17px; color: var(--texte); }

/* ---------- Choix d'affichage ---------- */
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.outils .filtres { margin: 0; }
.choix-vue { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: #dfe4e6; }
.choix-vue button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--texte-doux); font-size: 13.5px; font-weight: 600; transition: background var(--vite), color var(--vite), box-shadow var(--vite);
}
.choix-vue button:hover { color: var(--texte); }
.choix-vue button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.choix-vue svg.ic { width: 16px; height: 16px; }
.carte-statut { margin-bottom: 8px; }

/* ---------- Liens LinkedIn / Malt, CV, dossier de compétences ---------- */
.liens-docs { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; }
.mission .liens-docs { padding: 0; margin-top: 10px; }
.doc {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--ligne-forte); border-radius: 8px;
  background: var(--surface); color: var(--acier); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background var(--vite), border-color var(--vite), color var(--vite);
}
.doc:hover { border-color: var(--orange-action); background: var(--orange-pale); color: var(--orange-appuye); }
.doc svg.ic { width: 15px; height: 15px; }
.doc[data-type="linkedin"] svg.ic, .doc-btn[data-type="linkedin"] svg.ic { color: #0a66c2; }
.doc[data-type="malt"] svg.ic, .doc-btn[data-type="malt"] svg.ic { color: #e5484d; }

/* ---------- Tableau ---------- */
.table-wrap { overflow: auto; max-height: calc(100dvh - 190px); background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre-1); }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tableau th, .tableau td { padding: 10px 14px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: middle; white-space: nowrap; }
.tableau thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--texte-doux); font-size: 12.5px; font-weight: 600; }
.tableau th button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.tableau th button:hover { color: var(--texte); }
.tableau th[aria-sort] { color: var(--orange-appuye); }
.tableau .fleche { font-size: 10px; opacity: .7; }
/* Première colonne figée : on sait toujours de quelle ligne il s'agit en faisant défiler. */
.tableau .col-principale, .tableau thead th:first-child { position: sticky; left: 0; }
.tableau .col-principale { z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--ligne); }
/* La colonne figée reste étroite et passe à la ligne : les autres colonnes restent visibles à côté,
   et le défilement (au doigt ou au clavier) s'arrête juste après elle au lieu de passer dessous. */
.tableau .col-principale, .tableau thead th:first-child { white-space: normal; }
.tableau .col-principale a, .tableau thead th:first-child button { display: flex; width: max-content; max-width: 240px; overflow-wrap: anywhere; }
.table-wrap { scroll-padding-left: 270px; }
.tableau .tronque { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.tableau thead th:first-child { z-index: 3; box-shadow: 1px 0 0 var(--ligne); }
.tableau .col-principale a { font-weight: 600; color: var(--texte); text-decoration: none; }
.tableau .col-principale a:hover { color: var(--orange-appuye); text-decoration: underline; }
.tableau td a { color: inherit; }
.tableau td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau .vide-cell { color: var(--ligne-forte); }
.tableau td .liens-docs { padding: 0; flex-wrap: nowrap; }
.tableau tbody tr { cursor: pointer; }
.tableau tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) {
  .tableau tbody tr:hover td { background: #fdf6f3; }
}

/* ---------- Tiroir ---------- */
dialog { color: inherit; }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(620px, 100vw); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--fond); box-shadow: var(--ombre-3);
}
.drawer[open] { display: flex; flex-direction: column; animation: glisse var(--moyen) var(--sortie); }
.drawer::backdrop { background: rgba(31, 38, 42, .5); animation: fondu var(--moyen) ease-out; }
@keyframes glisse { from { transform: translateX(44px); opacity: 0; } }
@keyframes fondu { from { opacity: 0; } }
.tiroir-tete { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 16px 22px; background: var(--surface); border-bottom: 1px solid var(--ligne); }
.tiroir-titres { min-width: 0; flex: 1; padding-top: 2px; }
.tiroir-titres h2 { font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.tiroir-code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; margin-top: 3px; color: var(--texte-doux); font-size: 12.5px; }
.sauvegarde { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.sauvegarde svg.ic { width: 14px; height: 14px; stroke-width: 3; }
.sauvegarde.encours { color: var(--texte-doux); font-weight: 500; }
.tiroir-corps { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.tiroir-dynamique { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.bloc { padding: 16px; background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre-1); min-width: 0; }
.bloc h3 { font-size: 14px; font-weight: 700; }
.bloc > h3 { margin-bottom: 12px; }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.bloc-tete span { color: var(--texte-doux); font-size: 13px; font-variant-numeric: tabular-nums; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.champ.large { grid-column: 1 / -1; }
.actions-rapides { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-rapides:empty { display: none; }
.tiroir-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 22px; background: var(--surface); border-top: 1px solid var(--ligne); }

.statuts { display: flex; flex-wrap: wrap; gap: 6px; }
.statuts button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; border: 1px solid var(--ligne-forte); border-radius: 99px;
  background: var(--surface); font-size: 13px; font-weight: 500; transition: background var(--vite), color var(--vite), border-color var(--vite);
}
.statuts button:hover { border-color: var(--c); }
.statuts button[aria-pressed="true"] { background: var(--c-pale); border-color: var(--c); color: var(--c-texte); font-weight: 700; }
.statuts svg.ic { width: 14px; height: 14px; stroke-width: 3; }

.etapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-top: 12px; }
.etape { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background var(--vite); }
.etape:hover { background: var(--surface-2); }
.etape input { width: 19px; height: 19px; flex: none; margin: 0; accent-color: var(--orange-action); cursor: pointer; }
.etape.fait span { color: var(--texte-doux); text-decoration: line-through; }

.lien-client { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; padding: 4px; border-radius: 10px; color: inherit; text-decoration: none; transition: background var(--vite); }
.lien-client:hover { background: var(--surface-2); }
.lien-client b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.lien-client small { display: block; color: var(--texte-doux); font-size: 13px; overflow-wrap: anywhere; }
.lien-client > div { min-width: 0; flex: 1; }
.lien-client .statut { margin-top: 4px; }

.propose { padding: 12px 0; border-top: 1px solid var(--ligne); }
.bloc-tete + .propose { border-top: 0; padding-top: 0; }
.propose-tete { display: flex; align-items: center; gap: 4px; }
.tarifs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.tarif { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.tarif small { display: block; color: var(--texte-doux); font-size: 11.5px; }
.tarif b { font: 700 15px var(--titre); font-variant-numeric: tabular-nums; }
.tarif.bon b { color: var(--ok); }
.tarif.mauvais b { color: var(--danger); }
.ajout-presta { margin-top: 10px; }
.aide-formule { margin-top: 10px; color: var(--texte-doux); font-size: 12px; }

/* ---------- Confirmation et messages ---------- */
.confirm { width: min(420px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: var(--rayon); box-shadow: var(--ombre-3); }
.confirm[open] { animation: fondu var(--vite) ease-out; }
.confirm::backdrop { background: rgba(31, 38, 42, .55); }
.confirm h2 { font-size: 18px; margin-bottom: 8px; overflow-wrap: anywhere; }
.confirm p { color: var(--texte-doux); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--rayon-s); background: var(--acier-fonce); color: #fff; font-weight: 500; font-size: 14px; box-shadow: var(--ombre-2); animation: monte var(--moyen) var(--sortie); }
.toast.erreur { background: var(--danger); }
@keyframes monte { from { transform: translateY(10px); opacity: 0; } }
.chargement { display: grid; place-items: center; min-height: 100dvh; color: var(--texte-doux); }

/* ---------- Petit PC et tablette : menu réduit, les colonnes gardent la place ---------- */
@media (min-width: 861px) and (max-width: 1180px) {
  .shell { grid-template-columns: 88px minmax(0, 1fr); }
  .side { padding: 20px 8px 12px; }
  .side-logo { width: 62px; margin: 0 auto; }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 60px; padding: 6px 2px; font-size: 11.5px; text-align: center; }
  .nav .compte { display: none; }
  .side-bas { flex-direction: column; padding: 10px 0 0; }
  .side-bas .nom { display: none; }
  .side-bas .icon-btn { margin: 0; }
  .main { padding: 24px; }
  .board { grid-auto-columns: minmax(190px, 1fr); scroll-snap-type: x proximity; }
  .col { scroll-snap-align: start; }
}

/* ---------- Écrans tactiles : cibles d'au moins 44 px et pas de zoom automatique ---------- */
@media (pointer: coarse), (max-width: 860px) {
  .btn, .filtre, .statuts button, .etape, .onglets button, .choix-vue button, .doc { min-height: 44px; }
  .doc { padding: 0 12px; font-size: 13.5px; }
  .tableau th button, .tableau td a { min-height: 44px; display: inline-flex; align-items: center; }
  .tableau .col-principale a, .tableau thead th:first-child button { display: flex; }
  .table-wrap { max-height: none; }
  .icon-btn { width: 44px; height: 44px; }
  .input, .statut-rapide select { font-size: 16px; }
  .statut-rapide { display: block; }
  .fiche-actions a { min-height: 48px; font-size: 14px; }
  .statuts { gap: 8px; }
  .filtres { gap: 8px; }
}
@media (hover: none) {
  .carte:hover { transform: none; box-shadow: var(--ombre-1); }
  .carte:active { transform: scale(.985); }
  .etape:hover, .lien-client:hover, .fiche-actions a:hover { background: transparent; }
  .etape:active, .lien-client:active, .fiche-actions a:active { background: var(--surface-2); }
  .fiche-actions a:hover { color: var(--texte-doux); }
}

/* ---------- Téléphone ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .libelle-long { display: none; }
  .libelle-court { display: inline; }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-visuel { min-height: 216px; background-position: center 30%; }
  .login-accroche { left: 20px; right: 20px; bottom: 18px; }
  .login-accroche img { width: 92px; margin-bottom: 12px; }
  .login-accroche p { font-size: 21px; }
  .login-panneau { place-items: start center; padding: 26px 20px calc(26px + env(safe-area-inset-bottom)); }
  .login-form h1 { font-size: 25px; }
  .shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .side { position: fixed; z-index: 10; inset: auto 0 0 0; height: auto; display: block; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--acier-fonce); }
  .side-logo, .side-bas { display: none; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .nav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 0; font-size: 12px; }
  .nav .compte { display: none; }
  .main { padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  .top { gap: 10px; margin-bottom: 14px; }
  .actions-rapides .btn { flex: 1 1 auto; }
  .drawer { width: 100vw; }
  .tiroir-tete { padding-top: max(14px, env(safe-area-inset-top)); }
  .top h1 { font-size: 22px; }
  .top .sous { display: none; }
  .top-mobile { display: flex; align-items: center; order: -1; width: 100%; justify-content: space-between; }
  .top-mobile img { width: 70px; height: auto; }
  .top-titres { flex: 1; }
  .recherche { order: 3; width: 100%; }
  .input { font-size: 16px; }
  .board { display: block; overflow: visible; }
  .board.empile .col { display: flex; margin-bottom: 12px; }
  .board.empile .col-tete { display: flex; }
  .choix-vue { display: flex; width: 100%; }
  .choix-vue button { flex: 1 1 0; min-width: 0; justify-content: center; }
  .outils .filtres { width: 100%; }
  .tableau .col-principale a, .tableau thead th:first-child button { max-width: calc(42vw - 24px); }
  .tableau .tronque { max-width: 60vw; }
  .table-wrap { scroll-padding-left: 42vw; }
  .tableau th, .tableau td { padding: 6px 12px; }
  .col { display: none; min-height: 0; }
  .col.actif { display: flex; }
  .col-tete { display: none; }
  .onglets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .onglets button {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border: 1px solid var(--ligne-forte); border-radius: 99px;
    background: var(--surface); font-size: 13px; font-weight: 500;
  }
  .onglets button[aria-selected="true"] { background: var(--acier); border-color: var(--acier); color: #fff; }
  .grille { grid-template-columns: minmax(0, 1fr); }
  .tiroir-corps { padding: 14px 14px 20px; }
  .tiroir-tete { padding-left: 16px; }
  .tiroir-pied { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Téléphone à l'horizontale : le menu du bas et le bandeau ne doivent pas manger la hauteur. */
@media (max-width: 960px) and (max-height: 480px) {
  .login { grid-template-rows: 1fr; }
  .login-visuel { display: none; }
  .login-panneau { place-items: center; padding-block: 16px; }
  .shell { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: row; gap: 8px; min-height: 44px; font-size: 13px; }
}

@media (max-width: 380px) {
  .choix-vue button { gap: 5px; padding: 0 6px; font-size: 13px; }
}

@media (max-width: 480px) {
  .champs, .etapes { grid-template-columns: minmax(0, 1fr); }
  .tarifs { gap: 6px; }
  .tarif { padding: 6px 8px; }
  .tarif b { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .carte:hover { transform: none; }
}
