/* ============================================================
   Détail affaire — vue live (#affaire-live), rendue par
   frontend/js/views/affaire.js. (Styles déplacés depuis portfolio.css
   + sections jalons / membres / P&L par phase.)
   ============================================================ */

/* Contenu en dur d'origine du panel masqué : on rend du live. */
#affaire-legacy { display: none; }

/* Message d'invite quand aucune affaire n'est ouverte. */
.affaire-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
}

/* ----- Tableau des phases (santé + P&L) ----- */
.phase-health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.phase-health-table th,
.phase-health-table td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.phase-health-table th:first-child,
.phase-health-table td:first-child { text-align: left; }
.phase-health-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-mute);
}
.phase-health-table tfoot .phase-total td {
  font-weight: 600;
  border-top: 2px solid var(--line);
  border-bottom: none;
}
.phase-health-table td.phase-band-vert_eclatant { color: var(--olive); font-weight: 600; }
.phase-health-table td.phase-band-vert_fade     { color: #6F7E45; font-weight: 600; }
.phase-health-table td.phase-band-orange_clair  { color: #B07F1F; font-weight: 600; }
.phase-health-table td.phase-band-orange_fonce  { color: var(--ochre); font-weight: 600; }
.phase-health-table td.phase-band-rouge         { color: var(--terracotta); font-weight: 600; }

/* ----- Membres ----- */
.members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.members-table th,
.members-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.members-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-mute);
}

/* ----- Jalons ----- */
.ms-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ms-item:last-child { border-bottom: none; }
.ms-date {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  color: var(--terracotta);
  white-space: nowrap;
}
.ms-label { font-weight: 500; font-size: 14px; }
.ms-phase { font-family: 'Courier New', monospace; font-size: 11px; color: var(--bois-dark); margin-left: 6px; }
.ms-objet { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.ms-meta { font-size: 12px; color: var(--ink-mute); text-align: right; white-space: nowrap; }
.ms-actions { display: flex; gap: 6px; margin-left: 12px; }

/* ----- Boutons d'édition (Plan 15) ----- */
.aff-actions { display: flex; gap: 8px; align-items: flex-start; }
.aff-edit-btn {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.aff-edit-btn:hover { background: var(--bg-warm); border-color: var(--bois); }
.aff-danger { border-color: var(--terracotta); color: var(--terracotta); }
.aff-danger:hover { background: var(--terracotta-soft); }
/* Phase 26a : flèche retour Portefeuille dans le header du détail affaire. */
.aff-back-btn {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.aff-back-btn:hover { background: var(--bg-warm); border-color: var(--bois-dark); color: var(--bois-dark); }
.members-actions { display: flex; gap: 6px; white-space: nowrap; }
.phase-health-table .aff-edit-btn { padding: 2px 6px; }

/* ----- Modales d'écriture projet (#pe-*) ----- */
.pe-modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 38, 49, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.pe-modal[hidden] { display: none; }
.pe-card {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.pe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
}
.pe-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-mute); }
.pe-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.pe-body .form-label { margin-top: 6px; }
.pe-body input, .pe-body select, .pe-body textarea { width: 100%; box-sizing: border-box; }
.pe-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pe-checks { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin-top: 6px; }
.pe-checks label { display: flex; align-items: center; gap: 6px; }
.pe-checks input { width: auto; }
.pe-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
}
.pe-error {
  background: var(--terracotta-soft, #fadbd8);
  color: #6F2E15;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
