/* Bloc « Temps consacré » — composant partagé (js/views/tempsBloc.js) et
   récapitulatif des temps de l'onglet Rentabilité. Une seule feuille pour ces
   deux surfaces : elles montrent la même donnée, elles se ressemblent. */

.temps-bloc { margin-top: 18px; }
.temps-bloc-total {
  margin: 4px 0 12px;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--accent-dark);
  line-height: 1.1;
}
.temps-bloc-add { align-items: flex-end; margin-bottom: 0; }
.temps-bloc-field { flex: 1; margin-bottom: 0; }
.temps-bloc-add .btn { white-space: nowrap; }
.temps-bloc-add .btn[disabled] { opacity: .55; pointer-events: none; }

.temps-bloc-list { list-style: none; margin: 14px 0 0; padding: 0; }
.temps-bloc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line, rgba(124, 108, 88, .18));
  font-size: 0.85rem;
}
.temps-bloc-when { color: var(--ink-soft); }
.temps-bloc-duree { margin-left: auto; font-weight: 600; }
.temps-bloc-remove { flex: 0 0 auto; }

/* Récapitulatif Rentabilité — une ligne par phase, éditable. */
.temps-recap { display: flex; flex-direction: column; }
.temps-recap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line, rgba(124, 108, 88, .18));
}
.temps-recap-row:first-child { border-top: 0; }
.temps-recap-label { flex: 1; min-width: 0; }
.temps-recap-label .mini-label { margin: 2px 0 0; }
.temps-recap-valeur { font-weight: 600; white-space: nowrap; }
.temps-recap-input { width: 92px; text-align: right; }
.temps-recap-row.total { border-top-width: 2px; font-size: 1.02rem; }
.temps-recap-legend { margin-top: 10px; }

@media (max-width: 420px) {
  .temps-bloc-add { flex-direction: column; align-items: stretch; }
  .temps-bloc-add .btn { width: 100%; }
  .temps-recap-input { width: 78px; }
}

/* Onglet Photos — autorisation portfolio (informatif) et association espace. */
.photos-portfolio { margin-bottom: 18px; }
.photos-accord { margin: 4px 0 8px; font-size: 0.95rem; }
.photos-accord.ok { color: var(--accent-dark); font-weight: 600; }
.photos-accord.non { color: var(--ink-soft); }
.photos-espace-choice { margin-bottom: 14px; }
.photo-espace { width: 100%; font-size: 0.78rem; padding: 4px 6px; margin: 4px 0; }

/* ===========================================================================
   Bloc « Message cliente » (Phase 6) — js/views/messageBloc.js
   L'aperçu montre le texte tel qu'il partira, en pleine largeur : un message
   qu'on ne relit pas en entier est un message qu'on envoie de travers.
   ======================================================================== */
.msg-bloc {
  border: 1px solid var(--line, rgba(124, 108, 88, .18));
  border-radius: 14px;
  padding: 16px 18px 18px;
  margin-top: 18px;
  background: var(--offwhite);
}
.msg-titre { margin: 2px 0 10px; font-size: 1.02rem; color: var(--ink); }
.msg-apercu {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--paper, #fff);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
}
.msg-statut {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.msg-pastille {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  flex: 0 0 auto;
}
.msg-pastille.ready { background: var(--accent); }
/* « Ouvert » est volontairement distinct d'« envoyé » : la couleur ne doit pas
   laisser croire que le message est parti. */
.msg-pastille.opened { background: #C9A227; }
.msg-pastille.sent { background: #4F7A4A; }
.msg-pastille.failed { background: #A33; }
/* « Programmé » : en attente, ni ouvert ni parti — une couleur d'attente, pas
   la couleur d'un envoi réussi. */
.msg-pastille.scheduled { background: #6E7FA3; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-edition { margin-top: 16px; }
.msg-edition textarea { font-family: inherit; line-height: 1.6; }
.msg-programmation { margin-top: 16px; }
.msg-programmation input[type="datetime-local"] { font-family: inherit; }
.msg-historique { margin-top: 14px; font-size: 0.82rem; color: var(--ink-soft); }
.msg-historique summary { cursor: pointer; }
.msg-historique ul { list-style: none; margin: 8px 0 0; padding: 0; }
.msg-historique li { display: flex; gap: 10px; padding: 4px 0; }
.msg-hist-date { min-width: 6.5em; }
.msg-hist-statut { font-weight: 600; }

@media (max-width: 420px) {
  .msg-bloc { padding: 14px; }
  .msg-actions .btn { flex: 1 1 calc(50% - 4px); }
}

/* --- Estimation Ōra (Phase 9) ---------------------------------------------
   Le bloc vit en tête de l'onglet Devis : il montre ce que la Lecture implique
   avant que le chiffrage commence. */
.est-bloc .est-alerte {
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
  color: var(--ink-soft);
}
/* Une alerte qui demande une décision de méthode n'est pas une erreur : elle
   se distingue sans crier. */
.est-bloc .est-alerte.coefficientsAValider { border-left: 3px solid #C9A227; }
.est-bloc .est-alerte.materielDepasseBudget { border-left: 3px solid #A33; }
.est-espaces { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.est-espace {
  padding: 12px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
}
.est-espace.prioritaire { border-color: var(--accent); }
.est-espace-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.est-espace-nom { font-weight: 600; }
.est-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  color: var(--ink-soft);
}
.est-tag.prioritaire { background: var(--accent); color: #fff; }
.est-tag.confiance-faible { color: #A33; }
.est-charge { font-size: 0.85rem; margin: 0 0 6px; }
.est-espace-sous { font-size: 0.82rem; color: var(--ink-soft); margin: 0 0 8px; }
.est-espace-chiffres { margin-bottom: 8px; }
.est-espace-chiffres .value.confiance-faible { color: #A33; }
.est-espace-chiffres .value.confiance-moyenne { color: #C9A227; }
.est-pourquoi { font-size: 0.82rem; color: var(--ink-soft); }
.est-pourquoi summary { cursor: pointer; }
.est-pourquoi ul { margin: 6px 0 0; padding-left: 18px; }
.est-pourquoi li { padding: 2px 0; }
.est-manquant { font-size: 0.8rem; color: var(--ink-soft); margin: 6px 0 0; }
.est-totaux { margin-top: 8px; }
.est-totaux + .est-totaux { padding-top: 8px; border-top: 1px solid var(--line, rgba(0, 0, 0, 0.06)); }
.est-totaux .recap-row.est-total .label,
.est-totaux .recap-row.est-total .value { font-weight: 600; }
.est-totaux .recap-row.est-negatif .value { color: #A33; }
.est-validee { font-size: 0.82rem; color: var(--ink-soft); margin: 10px 0 0; }
.est-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.est-phases { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.est-phases .est-phase input { width: 100%; }
.est-decisions-liste { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.84rem; }
.est-decisions-liste li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.06)); }
.est-decision-u { color: var(--ink-soft); font-size: 0.78rem; }
/* « Comment l'estimation est calculée » — de la méthode en français, pas un
   tableau de coefficients. */
.est-methode-liste { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.84rem; }
.est-methode-liste li { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.06)); }
.est-methode-liste li:last-child { border-bottom: 0; }
.est-methode-titre { font-weight: 600; }
.est-methode-texte { color: var(--ink-soft); line-height: 1.45; }
.est-bloc .est-alerte.socleParDefaut { border-left: 3px solid #C9A227; }

/* --- Budget cliente (Phase 9B) -------------------------------------------- */
.renc-budget .renc-budget-champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.renc-budget .mini-label { margin-top: 10px; }
