  /* ============================================================
     NOUVEAUX CONTRATS · phase setup pré-production
     Tableau dynamique des fiches en stage='nouveau_contrat'.
     Design : meme layout que /projets/ (Demandes d estimation) mais
     les cartes utilisent la version mockup avec setup-badges.
     ============================================================ */

  /* Page bg legerement grise pour que les cartes blanches popent.
     Pattern partage avec les autres tableaux kanban (Demandes, Production, Termine). */
  .content { background: var(--surface-soft) !important; padding: 0 !important; }
  /* `body.has-layout` déplacé dans board/index.css · le fond de la PAGE est un
     réglage commun à tous les tableaux, il n'avait rien à faire dans la feuille
     d'un seul (d'où il s'appliquait quand même à tous). */
  .pipeline-wrap {
    padding: var(--space-lg) var(--space-xl) 0;
    background: var(--surface-soft);
    min-height: 100%;
  }
  /* `#kanban-area { overflow: hidden }` DÉPLACÉ dans board/index.css (2026-07-22).
     Règle globale qui vivait ici, dans la feuille d'un seul tableau, avec un
     commentaire devenu faux. Elle reste NÉCESSAIRE · voir le socle. */
  /* Le fond blanc de la carte est posé par le socle partagé (board/index.css).
     Le !important qui vivait ici s'appliquait à TOUS les tableaux. */

  /* Stage nav · meme style que index.html (Demandes d estimation) */
  .stage-nav {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: var(--space-lg);
  }
  .stage-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--r-pill);
    font-size: 13px; font-weight: 500; text-decoration: none;
    border: 1px solid var(--hairline);
    background: var(--canvas); color: var(--body);
    transition: all 0.15s;
  }
  .stage-nav a:hover { border-color: var(--primary); color: var(--primary); }
  .stage-nav a.active {
    background: var(--primary); border-color: var(--primary);
    color: #fff; font-weight: 600;
  }
  .stage-nav a .count {
    background: rgba(255,255,255,0.25); border-radius: var(--r-pill);
    padding: 1px 7px; font-size: 11px; font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    min-width: 20px; text-align: center;
  }
  .stage-nav a:not(.active) .count {
    background: var(--surface-strong); color: var(--muted);
  }

  /* Filter bar (search + view toggle) · meme pattern que index.html */
  .filters-bar {
    display: flex; align-items: center; gap: var(--space-xs);
    flex-wrap: wrap; margin-bottom: var(--space-base);
  }
  /* Groupe recherche · input + bouton Filtre (pastille) dans un seul pill */
  .search-group {
    display: flex; align-items: center;
    flex: 1; max-width: 560px;
    height: 47px; padding-right: 5px;
    border: 1px solid var(--hairline); border-radius: var(--r-pill);
    background: var(--canvas);
    transition: border-color 0.15s;
  }
  .search-group:focus-within { border-color: var(--primary); }
  .search-group input[type="search"] {
    flex: 1; min-width: 0; height: 100%;
    border: none; background: transparent; outline: none;
    padding: 0 14px; font-size: 13px; font-family: inherit; color: var(--ink);
    border-radius: var(--r-pill);
  }

  /* Toggle de vue · maintenant dans assets/styles.css (partagé) */
  .view-toggle { margin-left: auto; }

  /* Kanban · meme structure que index.html (colonnes flat sans fond/bordure) */
  .kanban-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    margin: 0 calc(-1 * var(--space-xl));
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
    /* Glisser-deposer pour se promener, ET une barre de defilement visible
       en bas (les 2 marchent · demande client). */
    cursor: grab;
    user-select: none;
  }
  /* ATTENTION · une barre de défilement VISIBLE était demandée ici (« demande
     client ») via scrollbar-width:thin + un thumb dessiné. Elle n'a jamais été
     visible : index.css et production.css, chargée après, posent toutes deux
     `scrollbar-width: none` et `::-webkit-scrollbar { display: none }`. Ces
     déclarations étaient donc inertes, et non scopées, elles s'appliquaient à
     tous les tableaux. Retirées ici pour ne pas laisser croire qu'elles font
     quelque chose. RENDRE la barre visible est une décision de design, pas le
     travail de cet audit : à trancher séparément si le besoin tient toujours. */
  .kanban-scroll.dragging { cursor: grabbing; scroll-behavior: auto; }
  .kanban-scroll.dragging .demande-card { pointer-events: none; }
  .kanban-board {
    display: flex; gap: 20px;
    min-width: max-content;
  }
  .kanban-col {
    width: 300px; flex-shrink: 0;
    background: transparent;
    border: 0;
  }

  /* Édition de structure en contexte (admin) · renommer une colonne EN PLACE */
  .col-label-editable { cursor: pointer; border-radius: var(--r-md); padding: 3px 8px; margin: -3px -8px; }
  .col-label-editable:hover { background: var(--surface-strong); }
  .col-label-editing {
    cursor: text; color: var(--ink);
    background: var(--canvas);
    outline: none;
    /* bordure LÉGÈRE via box-shadow · ne pousse pas la mise en page, pas de trait noir */
    box-shadow: 0 0 0 1px var(--hairline);
  }

  /* Poignée pour glisser-réordonner une colonne (admin) */
  .col-grip {
    cursor: grab; color: var(--muted-soft);
    font-size: 14px; line-height: 1; letter-spacing: -2px;
    padding-right: 2px; user-select: none;
    opacity: 0.5; transition: opacity 0.15s, color 0.15s;
  }
  .col-grip:hover { opacity: 1; color: var(--ink); }
  /* Glissement fluide (SortableJS) · placeholder doux, pas de ligne dure */
  .kanban-col.col-ghost { opacity: 0.35; }
  .kanban-col.col-ghost > * { visibility: hidden; }
  .kanban-col.col-ghost { background: var(--surface-strong); border-radius: var(--r-lg); }
  .kanban-col.col-chosen { cursor: grabbing; }

  /* Bouton « + colonne » dans la barre d'outils, à droite · hors du tableau,
     ne recouvre jamais les colonnes. */
  .btn-add-col {
    flex-shrink: 0; margin-left: var(--space-xs);
    display: inline-flex; align-items: center; gap: 5px;
    height: 44px; padding: 0 16px;
    background: var(--canvas); color: var(--body);
    border: 1px solid var(--hairline); border-radius: var(--r-pill);
    font-size: var(--text-label); white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
  }
  .btn-add-col:hover { border-color: var(--ink); color: var(--ink); }
  .btn-add-col-plus { font-size: 16px; line-height: 1; }
  .col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 10px;
    flex-shrink: 0;
  }
  .col-header-left { display: flex; align-items: center; gap: 8px; }
  .col-dot {
    width: 8px; height: 8px; border-radius: var(--r-full);
    flex-shrink: 0;
  }
  .col-label {
    font-size: 13px; font-weight: 500; color: var(--muted);
  }
  .col-count {
    font-size: 11px; font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    color: var(--muted); background: var(--surface-soft);
    border-radius: var(--r-pill); padding: 1px 7px;
  }
  /* Vestiges du défilement PAR COLONNE retirés (2026-07-22) · `flex: 1`,
     `min-height: 0`, `overflow-y: auto` et `scrollbar-width: thin`, plus
     `height: 100%` / `align-items: stretch` sur le tableau et la zone de
     défilement, et le `display: flex` de la colonne.

     Ce mécanisme a été abandonné par d33ebb0 : la zone garde sa hauteur
     naturelle et c'est la PAGE qui défile, sinon les cartes du bas d'une colonne
     étaient inatteignables. Ces déclarations survivaient ici, non scopées, donc
     appliquées à tous les tableaux, et `production.css` en neutralisait une
     partie (`align-items` remis à `flex-start`). Elles ont induit deux personnes
     en erreur. Retrait vérifié : 0 écart, défilement interne des colonnes inclus
     dans la mesure. */
  .col-cards {
    display: flex; flex-direction: column; gap: 8px;
    padding: 2px 4px 8px 0;
  }
  .col-empty {
    padding: 16px 12px; text-align: center;
    font-size: 11px; color: var(--muted-soft);
  }

  /* ============================================================
     CARTE NOUVEAU CONTRAT · garde le design mockup avec setup-badges
     ============================================================ */
  /* `.demande-card`, `:hover` et `.card-name` vivent dans le socle partagé
     (board/index.css). Les valeurs déclarées ici ne gagnaient déjà PAS la
     cascade (termine.css et annulees.css, chargées après, les écrasaient) :
     c'était du code mort qui donnait l'illusion que ce tableau pilotait sa
     carte. Retiré plutôt que scopé · le scoper aurait ressuscité un padding
     que plus aucun tableau n'affichait depuis longtemps. */
  .board-projets .card-addr { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
  .board-projets .card-types { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 8px; }
  .board-projets .card-type {
    background: var(--surface-strong);
    color: var(--body);
    font-size: var(--text-caption);
    padding: 2px 8px;
    border-radius: var(--r-pill);
  }
  .board-projets .card-action {
    padding-top: 4px;
    font-size: 11px;
    color: var(--body);
  }
  .board-projets .card-action .next {
    display: flex; align-items: center; gap: 5px;
    color: var(--ink); font-weight: 600; margin-bottom: 2px;
  }
  .board-projets .card-action .note { color: var(--muted); }
  /* Ce pied vivait en partie de production.css, chargée après : elle imposait
     11px (au lieu du 12px déclaré ici), plus un padding-top et un filet
     supérieur que ce fichier n'a jamais demandés. Relevé au computed style :
     11px, padding 8px 0 0, border-top 1px. On fige le rendu RÉEL · un audit
     ne change pas ce qui s'affiche, il rend seulement explicite d'où ça vient. */
  .board-projets .card-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--hairline-soft);
    font-size: 11px; color: var(--muted);
  }
  /* Ligne contremaitre · entre les livrables et le card-foot. Avatar de
     couleur differente (orange) pour le distinguer du charge de projet. */
  .board-projets .card-foreman-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 4px; margin-bottom: 2px;
    font-size: var(--text-caption); color: var(--muted);
  }
  .board-projets .card-foreman {
    display: inline-flex; align-items: center; gap: 5px;
  }
  .board-projets .card-foreman .avatar-cm {
    width: 18px; height: 18px;
    border-radius: var(--r-full);
    background: var(--accent-yellow, #f4b000);
    color: var(--canvas);
    font-size: var(--text-caption); font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  /* Livrables badges · 1 dot par livrable de la fiche. Gris par defaut,
     vert si signe. Compteur X/Y a droite pour vue d ensemble rapide. */
  .board-projets .setup-badges {
    display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
    margin-bottom: 6px;
  }
  .board-projets .setup-badge {
    width: 22px; height: 22px;
    border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-strong);
    color: var(--muted-soft);
    border: 1px solid var(--hairline-soft);
    flex-shrink: 0;
  }
  .board-projets .setup-badge svg { width: 11px; height: 11px; }
  .board-projets .setup-badge.done {
    background: var(--surface-strong);
    color: var(--semantic-up);
    border-color: var(--semantic-up);
  }
  .board-projets .setup-count {
    font-size: 11px; font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    margin-left: 4px;
    flex-shrink: 0;
  }

  /* Liste · groupes par statut (meme pattern que /projets/) */
  .list-group {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: var(--space-base);
    background: var(--canvas);
  }
  .list-group:last-child { margin-bottom: 0; }
  .list-group-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--hairline-soft);
    background: var(--surface-soft);
  }
  .list-group-dot { width: 7px; height: 7px; border-radius: var(--r-full); flex-shrink: 0; }
  .list-group-label { font-size: 13px; font-weight: 500; color: var(--ink); }
  /* Compteur · petite pastille juste a cote du titre (comme les pills du
     stage-nav en haut), pas pousse a droite. */
  .list-group-count {
    font-size: 11px; font-family: var(--font-display); font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    background: var(--surface-strong);
    border-radius: var(--r-pill);
    padding: 1px 8px;
    min-width: 20px; text-align: center;
  }

  .list-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .list-table-scroll::-webkit-scrollbar { display: none; }

  /* table-layout: fixed + colgroup partage · garantit que les colonnes
     s alignent IDENTIQUEMENT entre tous les groupes (sinon chaque table
     auto-dimensionne ses colonnes selon son propre contenu = decale). */
  .list-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
  /* L'ellipsis sur les cellules est passé dans board/index.css · il
     s'appliquait déjà à la vue liste de tous les tableaux depuis ici. */
  /* Règles de vue liste (`th`, `td`, `tr`, `:hover`, `.td-mono`) retirées :
     copies non scopées qui ne gagnaient jamais la cascade (annulees.css les
     écrasait avec une spécificité supérieure). Le socle board/index.css les
     porte maintenant, une seule fois (y compris le survol sur la cellule, qui
     s'appliquait lui aussi à tous les tableaux depuis ici). */
  @media (max-width: 768px) {
    .list-table { min-width: 760px; }
  }

  /* Cellule Livrables · bouton compteur X/Y + chevron · ouvre un dropdown */
  .board-projets .livr-cell-td { width: 1%; white-space: nowrap; }
  .board-projets .livr-cell-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 8px 0 10px;
    background: var(--surface-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
  }
  .board-projets .livr-cell-btn:hover { border-color: var(--primary); background: var(--canvas); }
  .board-projets .livr-cell-count {
    font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600;
    color: var(--ink);
  }
  .board-projets .livr-cell-btn.all-done { background: var(--surface-strong); border-color: var(--semantic-up); }
  .board-projets .livr-cell-btn.all-done .livr-cell-count { color: var(--semantic-up); }
  .board-projets .livr-cell-btn svg { width: 12px; height: 12px; color: var(--muted); }

  /* Dropdown des livrables · popover fixed cree dynamiquement.
     VOLONTAIREMENT NON SCOPÉ (et à laisser tel quel) : il est attaché à
     `document.body`, donc HORS de `.pipeline-wrap` qui porte `board-<card>`.
     Le préfixer le laisserait sans aucun style. Ses classes `livr-*` ne sont
     produites que par le renderer Projets, elles ne peuvent donc pas fuir. */
  #livr-dropdown {
    z-index: 1000;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    animation: livr-dd-in 0.12s ease;
  }
  @keyframes livr-dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .livr-dropdown-head {
    padding: 9px 14px;
    font-size: 13px; font-weight: 500; color: var(--muted);
    border-bottom: 1px solid var(--hairline-soft);
    background: var(--surface-soft);
  }
  .livr-dropdown-list { max-height: 320px; overflow-y: auto; padding: 4px; }
  .livr-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--body);
  }
  .livr-dropdown-icon { display: inline-flex; flex-shrink: 0; color: var(--muted-soft); }
  .livr-dropdown-icon svg { width: 15px; height: 15px; }
  .livr-dropdown-item.done .livr-dropdown-icon { color: var(--semantic-up); }
  .livr-dropdown-label { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
  .livr-dropdown-label > :first-child, .livr-dropdown-item.done .livr-dropdown-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .livr-dropdown-item.done .livr-dropdown-label { color: var(--muted); }
  .livr-dropdown-date {
    font-size: var(--text-caption); color: var(--muted-soft); font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
  }
  .livr-dropdown-state {
    flex-shrink: 0; font-size: 11px; font-weight: 600;
    color: var(--muted-soft);
  }
  .livr-dropdown-item.done .livr-dropdown-state { color: var(--semantic-up); }

  .loading-state, .empty-state {
    text-align: center; padding: 80px 24px;
    color: var(--muted);
    font-size: 13px;
  }
  .empty-state { color: var(--muted-soft); font-style: italic; }

  @media (max-width: 768px) {
    .pipeline-wrap { padding: var(--space-base); }
    .kanban-scroll { margin: 0 calc(-1 * var(--space-base)); padding: 0 var(--space-base) var(--space-base); }
    .kanban-col { width: 250px; }
  }
