/* Ōra V2 — composants du cockpit (accueil global, bottom-nav, dashboards).
   Vient compléter css/styles.css : rien n'y est redéfini/écrasé, seulement ajouté. */

/* ---------- Auth gate (écran de connexion unique du cockpit) ---------- */
.auth-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* ---------- Bottom navigation (mobile/tablette) ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  background: color-mix(in srgb, var(--offwhite) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-top: 1px solid var(--border);
  padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 6px 4px;
  color: var(--ink-soft); font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.02em;
  line-height: 1;
  border-radius: var(--radius-sm);
  min-height: 44px;
  transition: color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.bn-item svg { flex-shrink: 0; display: block; transition: color 0.15s ease; stroke-width: 1.4; }
.bn-item span { line-height: 1; }
.bn-item.active { color: var(--olive-deep); }
.bn-item.active svg { color: var(--accent); }
.bn-item:active { transform: scale(0.93); }
.bn-fab {
  width: 52px; height: 52px; margin: -22px 6px 0; flex-shrink: 0;
  border-radius: 50%; border: none; background: var(--accent); color: var(--offwhite);
  box-shadow: var(--shadow-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 0; padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bn-fab svg { display: block; flex-shrink: 0; }
.bn-fab:hover { box-shadow: 0 10px 26px rgba(42, 46, 36, 0.16), 0 3px 8px rgba(42, 46, 36, 0.08); }
.bn-fab:active { transform: scale(0.94); }

body.has-bottom-nav #app { padding-bottom: 92px; }

/* Desktop : rail vertical éditorial — icône + libellé alignés côte à côte */
@media (min-width: 1024px) {
  .bottom-nav {
    left: 0; right: auto; top: 0; bottom: 0;
    width: 208px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px;
    padding: 40px 18px;
    border-top: none; border-right: 1px solid var(--border);
  }
  .bn-item {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px;
    width: 100%; padding: 12px 14px; min-height: 0;
    font-size: 0.87rem; letter-spacing: 0.01em;
  }
  .bn-item svg { width: 19px; height: 19px; }
  .bn-item.active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
  .bn-fab {
    order: 5; margin: 22px 0 0 4px; align-self: flex-start;
  }
  body.has-bottom-nav #app { padding-bottom: 0; padding-left: 208px; }
}

/* ---------- Stat tiles (dashboards) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.stat-tile {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  transition: transform 0.1s ease;
}
.stat-tile[style*="pointer"]:active { transform: scale(0.97); }
.stat-tile .stat-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px;
}
.stat-tile .stat-value { font-family: var(--serif); font-size: 2rem; color: var(--ink); line-height: 1; margin: 0; }
.stat-tile .stat-value.accent { color: var(--accent-dark); }
.stat-tile .stat-sub { font-size: 0.78rem; color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- Section headers réutilisables ---------- */
.cockpit-section { margin-bottom: var(--space-6); }
.cockpit-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: var(--space-3);
}
.cockpit-section-head h2 { margin: 0; }
.cockpit-section-head .see-all {
  font-family: var(--sans); font-size: 0.82rem; color: var(--accent-dark); background: none; border: none; cursor: pointer;
}

/* ---------- Timeline du jour ---------- */
.day-timeline { display: flex; flex-direction: column; }
.day-timeline-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: opacity 0.1s ease;
}
.day-timeline-item:active { opacity: 0.6; }
.day-timeline-item:last-child { border-bottom: none; }
.day-timeline-item .time {
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); width: 46px; flex-shrink: 0; padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.day-timeline-item .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--olive); margin-top: 7px; flex-shrink: 0;
}
.day-timeline-item.type-business .dot { background: var(--accent); }
.day-timeline-item.type-studio .dot { background: var(--warning); }
.day-timeline-item.type-perso .dot { background: var(--olive); }
.day-timeline-item .content { flex: 1; min-width: 0; }
.day-timeline-item .content .title { font-size: 0.95rem; color: var(--ink); }
.day-timeline-item .content .meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Ne pas oublier ---------- */
.attention-list { display: flex; flex-direction: column; gap: 10px; }
.attention-row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius-md);
  padding: 13px 16px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform 0.1s ease;
}
.attention-row:active { transform: scale(0.98); }
.attention-row .badge {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0;
}
.attention-row.urgent .badge { background: var(--danger); }
.attention-row .grow { flex: 1; min-width: 0; }
.attention-row .grow .label { font-size: 0.92rem; color: var(--ink); }
.attention-row .grow .sub { font-size: 0.76rem; color: var(--ink-soft); margin-top: 1px; }
.attention-row .chev { color: var(--ink-soft); opacity: 0.6; }

/* ---------- Empty states riches ---------- */
.empty-state-rich {
  text-align: center; padding: var(--space-6) var(--space-4);
  color: var(--ink-soft);
}
.empty-state-rich .icon { color: var(--accent); opacity: 0.8; margin-bottom: 10px; }
.empty-state-rich .title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin-bottom: 4px; }
.empty-state-rich p { font-size: 0.88rem; margin: 0; }

/* ---------- Bottom sheet (quick add, etc.) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(42,36,22,0.32); z-index: 60;
  opacity: 0; transition: opacity 0.18s ease;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--offwhite); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-md);
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.22s ease;
  max-height: 80vh; overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border); margin: 6px auto 18px; }
.sheet h2 { font-size: 1.15rem; margin-bottom: 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.sheet-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--card); border-radius: var(--radius-md); padding: 16px;
  cursor: pointer; border: none; text-align: left; font-family: var(--sans);
  transition: transform 0.1s ease;
}
.sheet-action:active { transform: scale(0.96); }
.sheet-action .label { font-size: 0.9rem; color: var(--ink); }
.sheet-action svg { color: var(--accent); }

@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: 32px; width: 420px; transform: translate(-50%, 20px); border-radius: 24px; }
  .sheet.open { transform: translate(-50%, 0); }
}

/* ---------- Pipeline stepper (fiche cliente) ---------- */
.pipeline-stepper { display: flex; flex-direction: column; gap: 2px; }
.pipeline-step { display: flex; align-items: center; gap: 12px; padding: 6px 2px; font-size: 0.9rem; }
.pipeline-step .mark {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pipeline-step.done .mark { background: var(--sable); border-color: var(--sable); color: var(--olive-deep); }
.pipeline-step.done .mark svg { width: 10px; height: 10px; }
.pipeline-step.current .mark { border-color: var(--accent); }
.pipeline-step.current .mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pipeline-step.done .label { color: var(--sable); opacity: 0.75; }
.pipeline-step.current .label { color: var(--offwhite); font-weight: 500; }
.pipeline-step.upcoming .label { color: var(--sable); opacity: 0.45; }

/* Mobile : le stepper vertical (9 étapes × ~40px) prenait ~360px avant même
   le contenu métier. Bascule en piste horizontale scrollable — toutes les
   étapes restent visibles/atteignables, juste sur un seul axe compact. */
@media (max-width: 640px) {
  .pipeline-stepper {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 6px;
  }
  .pipeline-stepper::-webkit-scrollbar { display: none; }
  .pipeline-step {
    flex-direction: column;
    flex-shrink: 0;
    gap: 5px;
    padding: 2px 10px;
    font-size: 0.66rem;
    text-align: center;
    white-space: nowrap;
  }
  .pipeline-step:first-child { padding-left: 2px; }
  .pipeline-step:last-child { padding-right: 2px; }
}

.project-summary-card {
  background: var(--charcoal); color: var(--sable); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: var(--shadow-md); margin-bottom: var(--space-4);
}
.project-summary-card .status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--sable);
  background: color-mix(in srgb, var(--sable) 14%, transparent); padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}
.project-summary-card h1 { color: var(--offwhite); margin-bottom: 6px; }
.project-summary-card .meta-line { font-size: 0.88rem; opacity: 0.82; }

/* ---------- Sélecteur de mission (multi-missions) ---------- */
.mission-switch-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: -4px; flex-wrap: wrap;
}
.mission-switch-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 400;
  color: var(--sable); opacity: 0.75; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--sable) 40%, transparent);
  text-underline-offset: 3px; white-space: nowrap;
}
.mission-switch-btn:hover { opacity: 1; }

/* Contenu de la sheet générique ouverte par le sélecteur de mission — même
   mécanique de montage que la sheet "Créer" (cf. js/app.js openSheet()). */
.mission-list { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.mission-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; background: none; border: none;
  border-top: 1px solid var(--border); padding: 14px 2px; cursor: pointer;
  font-family: var(--sans);
}
.mission-row:first-child { border-top: none; }
.mission-row-main { display: flex; flex-direction: column; gap: 3px; }
.mission-row-titre { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.mission-row-cat {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-dark);
}
.mission-row-statut { font-size: 0.8rem; color: var(--ink-soft); font-weight: 300; }
.mission-row.active .mission-row-titre { color: var(--accent-dark); }
.mission-row-new { justify-content: flex-start; }
.mission-row-new .mission-row-titre { color: var(--accent-dark); font-family: var(--sans); font-size: 0.95rem; }
.project-summary-card .next-action {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--sable) 22%, transparent);
}
.project-summary-card .next-action .na-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.project-summary-card .next-action .na-title { font-size: 1.05rem; margin: 4px 0 2px; }
.project-summary-card .next-action .na-due { font-size: 0.8rem; opacity: 0.75; }
.project-summary-card .btn-on-dark {
  background: var(--accent-dark); border-color: var(--accent-dark); color: var(--offwhite); font-weight: 500;
}
.project-summary-card .btn-on-dark:active { background: var(--accent); }

/* ---------- Bloc compact « Étape actuelle » (fiche mission) ---------- */
/* Remplace, en affichage par défaut, le stepper 10 étapes : celui-ci reste
   rendu à l'identique mais replié derrière « Voir tout le parcours ». */
.mission-focus {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--sable) 22%, transparent);
}
.mission-focus .mf-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.7;
}
.mission-focus .mf-current {
  font-family: var(--serif); font-size: 1.25rem; color: var(--offwhite);
  line-height: 1.2; margin: 3px 0 2px;
}
.mission-focus .mf-next { font-size: 0.82rem; opacity: 0.8; }
.mission-focus .mf-next strong { font-weight: 500; color: var(--offwhite); opacity: 0.95; }
.mission-focus .mf-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.mission-focus .mf-secondaire {
  background: transparent; border-color: color-mix(in srgb, var(--sable) 45%, transparent);
  color: var(--sable);
}

/* Phase 7 — en-tête à deux colonnes : étape à gauche, progression à droite.
   `min-width: 0` sur les deux enfants pour qu'un libellé long tronque au lieu
   de pousser la carte au-delà du viewport (390 px). */
.mission-focus .mf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mission-focus .mf-head > * { min-width: 0; }
.mission-focus .mf-progression { text-align: right; flex-shrink: 0; }
.mission-focus .mf-prog-value {
  font-family: var(--mono); font-size: 1.05rem; color: var(--offwhite); margin-top: 3px;
}
.mission-focus .mf-prog-unite { font-size: 0.7rem; opacity: 0.65; white-space: nowrap; }

/* Alertes — uniquement actionnables : chacune est un bouton qui ouvre la
   section concernée (cf. §10 du brief). */
.mission-focus .mf-alertes { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mission-focus .mf-alerte {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: color-mix(in srgb, var(--offwhite) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--sable) 25%, transparent);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
  font-family: var(--sans); font-size: 0.82rem; color: var(--offwhite);
}
.mission-focus .mf-alerte .chev { margin-left: auto; opacity: 0.6; }
.mission-focus .mf-alerte-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--sable);
}
.mission-focus .mf-alerte.urgent .mf-alerte-dot { background: #d98080; }

.mission-focus .mf-now { margin-top: 14px; }
.mission-focus .mf-now-titre {
  font-family: var(--serif); font-size: 1.1rem; color: var(--offwhite); line-height: 1.25; margin-top: 3px;
}
.mission-focus .mf-now-desc { font-size: 0.8rem; opacity: 0.75; margin-top: 3px; }

.mission-focus .mf-comm {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--sable) 18%, transparent);
}
.mission-focus .mf-comm-titre { font-size: 0.92rem; color: var(--offwhite); margin-top: 3px; }
.mission-focus .mf-comm-btn {
  margin-top: 6px; background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; color: var(--sable);
  text-decoration: underline; text-underline-offset: 3px;
}
.mission-focus .mf-proposition {
  margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.82rem; opacity: 0.9;
}
.mission-focus .mf-toggle {
  display: inline-block; margin-top: 12px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; color: var(--sable); opacity: 0.75;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--sable) 40%, transparent);
  text-underline-offset: 3px;
}
.mission-focus .mf-toggle:hover { opacity: 1; }
.mission-focus .pipeline-stepper { margin-top: 12px; }
/* `display: flex` sur .pipeline-stepper l'emporterait sur le display:none par
   défaut de [hidden] — le parcours replié doit vraiment disparaître. */
.pipeline-stepper[hidden] { display: none; }

/* ---------- Fiche cliente : groupes de sections (Parcours Ōra / Gestion) ---------- */
.client-section-nav .csn-group + .csn-group { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border); }
.client-section-nav .csn-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; background: none; border: none; padding: 6px 4px; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); text-align: left;
}
.client-section-nav .csn-group-chev { font-size: 13px; line-height: 1; }
.client-section-nav .csn-group-items { display: flex; flex-direction: column; }
.client-section-nav .csn-group-items[hidden] { display: none; }

/* Le contenu de l'onglet est la cible du scroll après un clic de section
   (cf. positionnerScrollApresRendu(), js/views/clientDetail.js). La marge de
   scroll tient compte de la topbar collante, sinon le titre atterrit dessous. */
/* Hauteur minimale : sans elle, une section au contenu court ne peut pas
   remonter en haut de page (le document n'est pas assez long à faire défiler)
   et le titre atterrissait au milieu de l'écran. Espace réservé, jamais peint. */
#tab-content { scroll-margin-top: 76px; min-height: calc(100vh - 76px); }
@media print { #tab-content { min-height: 0; } }
@media (max-width: 640px) { #tab-content { scroll-margin-top: 104px; min-height: calc(100vh - 104px); } }

/* ---------- Payment rows (paiements multiples) ---------- */
.payment-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--border);
}
.payment-row:last-child { border-bottom: none; }
.payment-row .amount { font-family: var(--serif); font-size: 1.2rem; width: 84px; flex-shrink: 0; }
.payment-row .grow { flex: 1; min-width: 0; }
.payment-row .grow .label { font-size: 0.92rem; }
.payment-row .grow .sub { font-size: 0.76rem; color: var(--ink-soft); }
.payment-row .status-tag {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; flex-shrink: 0;
}
.payment-row .status-tag.paye { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.payment-row .status-tag.attente { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.payment-row .status-tag.annule { background: color-mix(in srgb, var(--ink-soft) 14%, transparent); color: var(--ink-soft); }
.payment-row.pai-annule .amount, .payment-row.pai-annule .grow { opacity: 0.55; text-decoration: line-through; text-decoration-color: var(--border); }
.pai-trop-percu, .pai-soldee { font-size: 0.85rem; margin: -6px 0 16px; }
.pai-trop-percu { color: var(--warning); }
.pai-soldee { color: var(--success); }

/* ---------- Fiche cliente : nav en sections (remplace les pills horizontales) ---------- */
.client-section-nav { display: flex; flex-direction: column; gap: 4px; }
.client-section-nav .csn-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 4px; border-bottom: 1px solid var(--border); background: none; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left; cursor: pointer; font-family: var(--sans); font-size: 0.98rem; color: var(--ink);
  transition: background 0.1s ease;
}
.client-section-nav .csn-item:active { background: var(--offwhite); }
.client-section-nav .csn-item:last-child { border-bottom: none; }
.client-section-nav .csn-item .csn-meta { font-size: 0.78rem; color: var(--ink-soft); }
.client-section-nav .csn-item .chev { color: var(--ink-soft); }

/* Mobile : la liste verticale des 17 sections (avec description + chevron)
   valait ~1000px avant d'atteindre le contenu de l'onglet actif. Bascule en
   piste de pastilles horizontale scrollable — même contenu (aucune section
   retirée), juste condensé sur un seul axe. Le détail (meta/chevron) reste
   affiché en desktop où l'espace vertical n'est pas la contrainte. */
@media (max-width: 640px) {
  .client-section-nav { gap: 2px; }
  .client-section-nav .csn-group-items {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 2px 6px;
  }
  .client-section-nav .csn-group-items::-webkit-scrollbar { display: none; }
  .client-section-nav .csn-item {
    flex-shrink: 0;
    width: auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 16px;
    height: var(--control-h-sm);
    background: var(--card);
    font-size: 0.85rem;
  }
  .client-section-nav .csn-item:active { background: var(--offwhite); }
  .client-section-nav .csn-item.csn-current { border-color: var(--accent-dark); color: var(--accent-dark); font-weight: 500; }
  .client-section-nav .csn-item .csn-meta,
  .client-section-nav .csn-item .chev { display: none; }
}

/* ---------- Objectifs (progression) ---------- */
.progress-track { height: 8px; border-radius: 999px; background: var(--sable); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.35s ease; }
.progress-fill.complete { background: var(--success); }
.objectif-card { background: var(--card); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-sm); margin-bottom: 14px; cursor: pointer; transition: transform 0.1s ease; }
.objectif-card:active { transform: scale(0.98); }
.objectif-card .objectif-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.objectif-card .objectif-label { font-size: 0.92rem; color: var(--ink); }
.objectif-card .objectif-values { font-family: var(--serif); font-size: 1.25rem; color: var(--accent-dark); flex-shrink: 0; }

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Indicateur de synchronisation (P0-2) ---------- */
/* Visible uniquement quand la synchro demande une action : hors ligne ou en
   échec. En marche normale il n'est pas dans le DOM — l'app n'a rien à dire.
   Volontairement sobre : même palette que le reste, pas de rouge vif. */
.sync-indicator {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 39;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 420px);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: left;
}
.sync-indicator .sync-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--warning);
}
.sync-indicator.is-error .sync-dot { background: var(--danger); }
.sync-indicator.is-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.sync-indicator .sync-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

@media (min-width: 1024px) {
  /* Le rail occupe la gauche : l'indicateur se cale dans l'espace restant. */
  .sync-indicator { left: calc(208px + (100vw - 208px) / 2); bottom: 24px; }
}

@media print { .sync-indicator { display: none !important; } }

/* Jour J — archives des checklists retirées de la navigation (Phase 2). */
.jj-archives { margin-top: 14px; }
.jj-archive-step + .jj-archive-step { margin-top: var(--space-4); }

/* Achats — regroupement par état dérivé (Phase 3). */
.achat-groupe { margin-bottom: var(--space-5); }
.achat-groupe-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.achat-groupe-total { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.achat-etat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.achat-etat-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink-soft) 12%, transparent); color: var(--ink-soft);
}
.achat-etat-tag.etat-prevu { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.achat-etat-tag.etat-achete { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.achat-etat-tag.etat-refacture { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-dark); }
.achat-refac-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 2px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.92rem;
}
.achat-refac-row:last-of-type { border-bottom: none; }
.achat-refac-montant { font-family: var(--serif); }
.devis-ligne { margin-bottom: 10px; }
.devis-origine { margin: 0 0 2px; color: var(--accent-dark); }
