
  /* ============================================================
     EN PRODUCTION · phase chantier actif
     Tableau dynamique des fiches en stage='production'.
     Skeleton identique a Demandes d estimation et Nouveaux contrats.
     Cartes : avancement / budget / marge avec barres de progression.
     ============================================================ */

  .content { background: var(--surface-soft) !important; padding: 0 !important; }
  .pipeline-wrap {
    padding: var(--space-lg) var(--space-xl) var(--space-xxl);
    background: var(--surface-soft);
    min-height: 100%;
  }

  /* Stage nav · meme style que index.html */
  .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-mono);
    min-width: 20px; text-align: center;
  }
  .stage-nav a:not(.active) .count {
    background: var(--surface-strong); color: var(--muted);
  }

  /* Filter bar */
  .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: 38px; 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);
  }
  .view-toggle {
    display: flex; gap: 2px; background: var(--canvas);
    border: 1px solid var(--hairline); border-radius: var(--r-pill);
    padding: 3px; margin-left: auto;
  }
  .view-btn {
    background: transparent; border: none; cursor: pointer;
    padding: 6px 12px; border-radius: var(--r-pill);
    color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.12s, color 0.12s;
  }
  .view-btn:hover { color: var(--ink); }
  .view-btn.active { background: var(--ink); color: #fff; }
  .view-btn svg { width: 14px; height: 14px; }

  /* Kanban */
  .kanban-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: var(--space-base);
    margin: 0 calc(-1 * var(--space-xl));
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .kanban-scroll::-webkit-scrollbar { display: none; }
  .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;
    align-items: flex-start;
  }
  .kanban-col { width: 280px; flex-shrink: 0; }
  .col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 10px;
  }
  .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: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.07em;
  }
  .col-count {
    font-size: 11px; font-family: var(--font-mono);
    color: var(--muted); background: var(--surface-soft);
    border-radius: var(--r-pill); padding: 1px 7px;
  }
  .col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
  .col-empty {
    padding: 16px 12px; text-align: center;
    font-size: 11px; color: var(--muted-soft);
  }

  /* ============================================================
     CARTE PRODUCTION · barres avancement, budget, marge
     ============================================================ */
  .demande-card {
    background: var(--canvas) !important;
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: var(--space-sm) var(--space-base);
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
  }
  .demande-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
  }
  .card-po {
    font-size: 10px; font-family: var(--font-mono);
    color: var(--muted); margin-bottom: 2px;
  }
  .card-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
  .card-sub  { font-size: 11px; color: var(--muted); margin-bottom: 10px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .card-sub em { font-family: var(--font-body); font-style: italic; color: var(--muted-soft); }

  /* Indicateurs production sur la carte · Matériaux, Hydro-Québec, Urgence
     Affiches seulement si l'utilisateur a explicitement ajoute le livrable
     correspondant via le +Ajouter de la fiche. Etat 'fait' → vert. */
  .card-indicators {
    display: flex; align-items: center; gap: 6px;
    margin-top: 2px; margin-bottom: 10px;
    min-height: 18px;
  }
  .card-indicator {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    border-radius: var(--r-full);
    background: var(--surface-soft);
    color: var(--muted);
    border: 1px solid var(--hairline);
    transition: all 0.15s;
  }
  .card-indicator.done {
    background: var(--semantic-up);
    color: var(--canvas);
    border-color: var(--semantic-up);
  }
  /* Urgence · point rouge plein, pas d'icone interne (pas de blanc dedans) */
  .card-indicator.urgent {
    background: var(--semantic-down);
    border-color: var(--semantic-down);
  }
  .card-indicator.urgent.done {
    background: var(--semantic-up);
    border-color: var(--semantic-up);
  }
  .card-indicator svg { width: 11px; height: 11px; }
  /* HQ · logo Hydro-Quebec (eclair orange), wrapper transparent par defaut */
  .card-indicator.hq {
    background: var(--canvas);
    border-color: var(--hairline);
    padding: 1px;
  }
  .card-indicator.hq svg { width: 14px; height: 14px; }
  .card-indicator.hq.done svg path { fill: var(--canvas) !important; }

  .prod-bar-row {
    margin-bottom: 8px;
  }
  .prod-bar-row:last-of-type { margin-bottom: 10px; }
  .prod-bar-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 3px;
  }
  .prod-bar-label {
    font-size: 9px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.07em;
  }
  .prod-bar-val {
    font-size: 11px; font-family: var(--font-mono); color: var(--ink); font-weight: 600;
  }
  .prod-bar-val.up { color: var(--semantic-up); }
  .prod-bar-val.down { color: var(--semantic-down); }
  .prod-bar-val.warn { color: var(--accent-yellow); }
  .prod-bar {
    height: 4px; background: var(--surface-strong); border-radius: var(--r-full);
    overflow: hidden;
  }
  .prod-bar-fill {
    height: 100%; background: var(--primary); border-radius: var(--r-full);
    transition: width 0.3s;
  }
  .prod-bar-fill.up { background: var(--semantic-up); }
  .prod-bar-fill.down { background: var(--semantic-down); }
  .prod-bar-fill.warn { background: var(--accent-yellow); }

  .card-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--hairline-soft);
    font-size: 11px; color: var(--muted);
  }
  .card-foot .team {
    color: var(--ink); font-weight: 500;
  }
  .card-foot .dates { font-family: var(--font-mono); font-size: 10px; }

  /* Liste · groupes par statut (meme pattern) */
  .list-group {
    border: 1px solid var(--hairline);
    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: 11px; font-weight: 600; color: var(--ink); text-transform: uppercase; letter-spacing: 0.07em; }
  .list-group-count { font-size: 11px; font-family: var(--font-mono); color: var(--muted); margin-left: auto; }
  .list-table-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .list-table-scroll::-webkit-scrollbar { display: none; }
  .list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .list-table th {
    text-align: left;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline-soft);
    background: var(--canvas);
  }
  .list-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline-soft);
    color: var(--body);
    vertical-align: middle;
  }
  .list-table tr:last-child td { border-bottom: 0; }
  .list-table tbody tr { cursor: pointer; transition: background 0.12s; }
  .list-table tbody tr:hover td { background: var(--surface-soft); }
  .list-table .td-mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  @media (max-width: 768px) { .list-table { min-width: 720px; } }

  .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-lg) var(--space-base) var(--space-xxl); }
    .kanban-scroll { margin: 0 calc(-1 * var(--space-base)); padding: 0 var(--space-base) var(--space-base); }
    .kanban-col { width: 250px; }
  }
