:root {
  --bg: #0f1117;
  --surface: #181b24;
  --border: #2a3042;
  --text: #e8eaef;
  --muted: #8b92a8;
  --accent: #22c55e;
  --warn: #eab308;
  --urgent: #ef4444;
  --font: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: min(400px, 92vw); }
.login-box label { display: block; font-size: .72rem; color: var(--muted); margin: 12px 0 4px; }
.login-box input { width: 100%; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.btn { margin-top: 16px; width: 100%; padding: 11px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.btn-sm { width: auto; margin-top: 0; padding: 8px 14px; font-size: .85rem; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 8px; width: 100%; text-align: left; margin-top: 12px; }
.err { color: #f87171; font-size: .85rem; margin-top: 8px; }
.muted { color: var(--muted); font-size: .88rem; }
.back { display: block; margin-top: 14px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.side { width: 260px; background: var(--surface); border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.brand .logo {
  display: inline-flex; width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(145deg, #22c55e, #15803d);
  align-items: center; justify-content: center;
  font-weight: 800; font-size: .75rem; color: #fff;
  box-shadow: 0 0 0 1px rgba(34,197,94,.35), 0 0 12px rgba(34,197,94,.25);
}
.brand .logo.logo-icon svg { width: 22px; height: 22px; display: block; }

/* Étapes HT — structure + badges noms plus lisibles + barre article */
.steps-list-ht { display: flex; flex-direction: column; gap: 4px; }
.steps-list-structured { gap: 3px; }
.step-struct-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 0 6px; padding: 10px 14px; border-radius: 10px; font-size: 1.05rem;
}
.step-struct-header:first-child { margin-top: 0; }
.step-struct-badge {
  display: inline-block; font-size: 0.95rem; font-weight: 800;
  letter-spacing: 0.02em; padding: 6px 14px; border-radius: 999px; flex-shrink: 0;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.25;
}
.step-struct-header--tranche {
  background: linear-gradient(90deg, rgba(214,40,40,.45), rgba(214,40,40,.14));
  border-left: 5px solid #ff2d2d; color: #fff;
}
.step-struct-header--tranche .step-struct-badge {
  background: rgba(255,255,255,.18); color: #ffffff;
  border: 1px solid rgba(255,255,255,.45);
  font-size: 1.05rem; text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.step-struct-header--ouvrage {
  background: linear-gradient(90deg, rgba(55,65,90,.98), rgba(36,42,58,.95));
  border-left: 5px solid #f87171; color: #f8fafc; margin-left: 6px;
}
.step-struct-header--ouvrage .step-struct-badge {
  background: rgba(248,113,113,.2); color: #fecaca;
  border: 1px solid rgba(252,165,165,.55);
  font-size: 0.98rem;
}
.step-struct-header--sous {
  background: rgba(42,48,64,.98); border-left: 5px solid #94a3b8;
  color: #f1f5f9; margin-left: 14px; padding: 8px 14px; font-size: 0.98rem;
}
.step-struct-header--sous .step-struct-badge {
  background: rgba(226,232,240,.14); color: #f8fafc;
  border: 1px solid rgba(226,232,240,.35);
  font-size: 0.95rem;
}
.step-struct-header--sous-pct {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.step-struct-header--sous-pct .step-group-pct {
  font-weight: 800; min-width: 3rem; color: #fde047; font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.step-struct-header--sous-pct.done .step-group-pct { color: #4ade80; }
.step-struct-header--sous-pct.pending .step-group-pct { color: #cbd5e1; }
.step-struct-header--sous-pct .step-group-bill {
  color: #fde68a !important; font-weight: 700; font-size: 0.92rem !important;
}

/* Lignes article — texte plus lisible */
.step-row .step-title {
  font-size: 1rem !important; font-weight: 700 !important; color: #f8fafc !important;
}
.step-row .step-amount,
.step-row .step-days,
.step-row .step-progress {
  font-size: 0.95rem; font-weight: 600; color: #f1f5f9;
}
.step-line-cagnotte {
  font-size: 0.95rem !important; color: #fde047 !important;
}

/* Article : LED + barre verticale qui se remplit selon le % */
.step-article-wrap {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 10px;
  align-items: stretch;
  margin-left: 12px;
}
.step-article-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 22px;
  min-height: 100%;
}
.step-article-led {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  margin-top: 14px; z-index: 1;
  border: 2px solid rgba(15, 18, 28, 0.9);
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.35);
}
.step-article-led--pending { background: #64748b; }
.step-article-led--in_progress {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45);
}
.step-article-led--done {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}
.step-article-track {
  flex: 1 1 auto;
  width: 4px;
  min-height: 28px;
  margin: 4px 0 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}
.step-article-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 0;
  border-radius: 0 0 4px 4px;
  transition: height 0.25s ease, background 0.2s ease;
  background: #64748b;
}
.step-article-fill--pending { background: #64748b; opacity: 0.55; }
.step-article-fill--in_progress {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  opacity: 1;
}
.step-article-fill--done {
  background: linear-gradient(180deg, #4ade80, #22c55e);
  opacity: 1;
}

.step-row {
  display: grid; grid-template-columns: 1fr 100px 100px 90px 64px; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,.03); margin-left: 0;
}
.step-row--poste { border-left: 3px solid rgba(148,163,184,.45); }
.step-row .step-title {
  font-size: 1rem; font-weight: 700; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: #f8fafc; min-width: 0;
}
.step-row .step-amount, .step-row .step-days, .step-row .step-status, .step-row .step-progress {
  padding: 9px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: #f1f5f9; width: 100%; font-size: 0.95rem; font-weight: 600;
}
.step-line-cagnotte {
  font-weight: 800; font-variant-numeric: tabular-nums; color: #fde047;
  font-size: 0.95rem; text-align: right; white-space: nowrap;
}
.step-cagnotte-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(234,179,8,.45);
  background: linear-gradient(135deg, rgba(234,179,8,.12), rgba(214,40,40,.08));
}
.step-cagnotte-label {
  display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fbbf24; font-weight: 800; margin-bottom: 4px;
}
.step-tranche-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 28px; padding: 0 8px; border-radius: 6px;
  background: #15803d; color: #fff; font-weight: 800; font-size: 0.78rem;
}
.timeline-structured .step-struct-header { margin: 8px 0 4px; }
.brand strong { display: block; margin-top: 8px; }
.brand span { font-size: .7rem; color: var(--muted); }
.upstream { font-size: .72rem; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.upstream.ok { color: #86efac; }
.upstream.err { color: #fca5a5; }
.nav-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-item { text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; font-size: .85rem; }
.nav-item:hover, .nav-item.active { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); }
.nav-item small { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.side-links a { display: block; font-size: .78rem; color: var(--muted); text-decoration: none; padding: 4px 0; }
.main { flex: 1; padding: 24px 28px; overflow: auto; }
.top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; }
.badge { font-size: .72rem; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.08); white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs.hidden { display: none; }
.tab { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: .82rem; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: .85rem; border: 1px solid var(--border); }
.alert.warn { background: rgba(234,179,8,.1); border-color: rgba(234,179,8,.35); }
.alert.urgent { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.35); }
.alert.info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.35); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.progress-bar { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #4ade80); transition: width .25s; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.todo-list { list-style: none; }
.todo-list li { margin-bottom: 8px; }
.todo-link { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: .85rem; font-family: inherit; }
.alert-click:hover { filter: brightness(1.08); }
.todo-link.urgent { border-color: rgba(239,68,68,.4); }
.todo-link.warn { border-color: rgba(234,179,8,.4); }

/* ——— Accueil : bandeaux chantiers compacts ——— */
.chantier-bands {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chantier-band {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 12px 16px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.chantier-band:hover {
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .04);
}
.chantier-band.status-provisoire { border-left: 3px solid var(--warn); }
.chantier-band.status-retractation { border-left: 3px solid var(--warn); }
.chantier-band.status-en_cours { border-left: 3px solid var(--accent); }
.chantier-band.status-termine { border-left: 3px solid var(--muted); opacity: .9; }
.band-main { min-width: 0; }
.band-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.band-title {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.band-status { flex-shrink: 0; }
.band-meta {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.band-addr { display: none; }
@media (min-width: 900px) {
  .band-addr { display: inline; }
}
.band-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  max-width: 280px;
}
.band-bar { flex: 1; margin: 0; height: 6px; }
.band-pct { font-size: .72rem; color: var(--muted); min-width: 2.2em; }
.band-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.band-assign {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.band-assign-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.band-assign-select {
  width: 100%;
  padding: 6px 8px;
  font-size: .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
}
.band-assign-ro {
  font-size: .82rem;
  font-weight: 600;
}
.band-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.band-pill {
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  white-space: nowrap;
}
.band-pill.ok { background: rgba(34,197,94,.15); color: #86efac; }
.band-pill.info { background: rgba(59,130,246,.15); color: #93c5fd; }
.band-pill.warn { background: rgba(234,179,8,.15); color: #fde047; }
.band-pill.urgent { background: rgba(239,68,68,.18); color: #fca5a5; }
.band-open {
  align-self: flex-end;
  margin-top: 0 !important;
  width: auto !important;
}
.band-hint { margin-top: 12px; font-size: .78rem; }
@media (max-width: 720px) {
  .chantier-band {
    grid-template-columns: 1fr;
  }
  .band-open { align-self: stretch; width: 100% !important; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-block; font-size: .7rem; padding: 4px 8px; border-radius: 99px; background: rgba(255,255,255,.08); margin-right: 6px; }
.chip.ok { background: rgba(34,197,94,.15); color: #86efac; }
.chip.warn { background: rgba(234,179,8,.15); color: #fde047; }
.chip.urgent { background: rgba(239,68,68,.15); color: #fca5a5; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.kpi strong { display: block; font-size: 1.1rem; margin-top: 4px; }
.kpi span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.finance-pie { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.finance-pie-item { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.finance-pie-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-layout { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.donut-wrap { width: 200px; height: 200px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-hole {
  position: absolute; inset: 28%; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 8px; border: 1px solid var(--border);
}
.donut-hole strong { font-size: .95rem; line-height: 1.2; }
.donut-hole span { font-size: .68rem; margin-top: 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.doc-preview-shell {
  position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.75);
  display: flex; flex-direction: column;
}
.doc-preview-shell.hidden { display: none; }
.doc-preview-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.doc-preview-actions { display: flex; gap: 8px; }
.doc-preview-frame { flex: 1; width: 100%; border: none; background: #fff; }
.doc-link { background: none; border: none; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
.st-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: var(--bg); }
.st-card h4 { margin-bottom: 8px; font-size: .95rem; }
.statut-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 600; }
.statut-brouillon { background: rgba(148,163,184,.2); color: #cbd5e1; }
.statut-envoyee, .statut-en_attente { background: rgba(234,179,8,.15); color: #fde047; }
.statut-validee { background: rgba(59,130,246,.15); color: #93c5fd; }
.statut-payee { background: rgba(34,197,94,.15); color: #86efac; }
.client-fold { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.client-fold > summary { padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; }
.client-fold > summary::-webkit-details-marker { display: none; }
.client-fold[open] > summary { border-bottom: 1px solid var(--border); }
.client-fold-body { padding: 14px 16px; }
.timeline-wrap { display: flex; gap: 16px; align-items: flex-start; margin: 18px 0; }
.timeline { flex: 1; min-width: 0; margin: 0; }
.timeline-legend { display: flex; flex-direction: column; gap: 6px; font-size: .72rem; color: var(--muted); padding-top: 4px; flex-shrink: 0; }
.timeline-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.timeline-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.timeline-legend-dot.done { background: #22c55e; }
.timeline-legend-dot.in_progress { background: #f59e0b; }
.timeline-step { display: flex; gap: 14px; padding: 12px 0; border-left: 2px solid var(--border); margin-left: 12px; padding-left: 22px; position: relative; }
.timeline-step::before { content: ''; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.timeline-step.done::before { background: #22c55e; }
.timeline-step.in_progress::before { background: #f59e0b; }
.timeline-step.done { border-left-color: #22c55e; }
.timeline-step.in_progress { border-left-color: #f59e0b; }

/* Synthèse — Suivi des étapes : même barre verticale que l’espace client */
.syn-etapes-wrap {
  display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap;
  margin: 14px 0 8px;
}
.syn-etapes-main { flex: 1 1 260px; min-width: 0; }

.syn-led-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.16);
  font-size: 0.82rem; color: var(--muted);
}
.syn-led-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: #e2e8f0;
}
.syn-led-swatch {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.syn-led-swatch--pending {
  background: #64748b; box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.4);
}
.syn-led-swatch--in_progress {
  background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45);
}
.syn-led-swatch--done {
  background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.syn-vbar-zone {
  width: 100%; margin: 16px 0 10px; padding: 0 0 8px;
  border-bottom: 1px solid rgba(214, 40, 40, 0.18);
}
.syn-vbar-zone:first-child { margin-top: 0; }

.syn-vbar-cat {
  display: grid; grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px; align-items: stretch; min-height: 28px; margin: 0;
}
.syn-vbar-cat .syn-vbar-body {
  display: flex; align-items: center; padding: 2px 0 6px;
}
.syn-vbar-rail--empty { width: 28px; }

.syn-struct-badge {
  display: inline-block; font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.03em; padding: 3px 11px; border-radius: 999px;
  flex-shrink: 0; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.syn-struct-badge--zone {
  background: rgba(214, 40, 40, 0.12); color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(214, 40, 40, 0.2);
}
.syn-struct-badge--cat {
  background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.syn-vbar {
  display: flex; flex-direction: column; gap: 0; padding: 4px 0 2px;
}
.syn-vbar-node {
  display: grid; grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px; align-items: stretch; min-height: 0;
}
.syn-vbar-node:last-child,
.syn-vbar-node--end { min-height: 36px; }
.syn-vbar-rail {
  display: flex; flex-direction: column; align-items: center;
  align-self: stretch; width: 28px; min-height: 100%;
}
.syn-vbar-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  z-index: 1; margin-top: 10px;
  border: 2px solid rgba(15, 18, 28, 0.85);
  background: #64748b; box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.35);
}
.syn-vbar-dot--pending {
  background: #64748b; box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.35);
}
.syn-vbar-dot--in_progress {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45), 0 0 8px rgba(245, 158, 11, 0.28);
}
.syn-vbar-dot--done {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45), 0 0 8px rgba(34, 197, 94, 0.22);
}
.syn-vbar-seg {
  flex: 1 1 auto; width: 3px; min-height: 10px; margin: 2px 0 0; border-radius: 0;
}
.syn-vbar-seg--pending { background: #64748b; opacity: 0.5; }
.syn-vbar-seg--in_progress { background: #f59e0b; opacity: 0.95; }
.syn-vbar-seg--done { background: #22c55e; opacity: 0.95; }
.syn-vbar-seg--bridge {
  flex: 1 1 auto; width: 3px; min-height: 22px; margin: 0;
  background: #64748b; opacity: 0.4; border-radius: 0;
}
.syn-vbar-body { min-width: 0; padding: 0 0 8px; }
.syn-vbar-node:last-child .syn-vbar-body,
.syn-vbar-node--end .syn-vbar-body { padding-bottom: 0; }
.syn-vbar-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 32px; padding: 6px 12px; border-radius: 8px;
  background: rgba(36, 40, 54, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18); box-sizing: border-box;
}
.syn-vbar-node--in_progress .syn-vbar-line {
  border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.06);
}
.syn-vbar-node--done .syn-vbar-line {
  border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.06);
}
.syn-vbar-name { font-weight: 700; color: #e2e8f0; font-size: 0.95rem; }
.syn-vbar-pct {
  font-weight: 800; font-variant-numeric: tabular-nums;
  flex-shrink: 0; font-size: 0.95rem;
}
.syn-vbar-pct--pending { color: #94a3b8; }
.syn-vbar-pct--in_progress { color: #fbbf24; }
.syn-vbar-pct--done { color: #4ade80; }
.gantt-chart { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.gantt-chart-head, .gantt-row { display: grid; grid-template-columns: minmax(140px, 1.5fr) minmax(120px, 2fr) 52px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.gantt-chart-head { background: rgba(255,255,255,.03); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.gantt-chart-range { padding: 8px 12px; font-size: .82rem; color: var(--muted); background: rgba(34,197,94,.06); border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: none; }
.gantt-row-label strong { display: block; font-size: .92rem; }
.gantt-row-dates { display: block; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.gantt-row-note { font-size: .78rem; color: #eab308; margin-top: 4px; font-style: italic; }
.gantt-row-track { position: relative; height: 24px; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; }
.gantt-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; min-width: 4px; }
.gantt-bar--pending { background: linear-gradient(180deg, #94a3b8, #64748b); }
.gantt-bar--in_progress { background: linear-gradient(180deg, #facc15, #ca8a04); }
.gantt-bar--done { background: linear-gradient(180deg, #4ade80, #16a34a); }
.gantt-row-days { font-size: .85rem; font-weight: 700; text-align: center; color: var(--muted); }
.gantt-revision-banner { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(234,179,8,.12); border: 1px solid rgba(234,179,8,.35); font-size: .88rem; }
.gantt-empty { padding: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .step-row { grid-template-columns: 1fr; }
}
/* CR photos — légende / état / constat (comme Construction) */
.cr-photo-stack {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--surface);
}
.cr-photo-stack-head {
  display: grid; grid-template-columns: 40% 1fr; gap: 10px;
  padding: 10px 14px; background: rgba(255,255,255,.04);
  font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.cr-photo-stack-head-2 { grid-template-columns: 40% 1fr; }
.cr-photo-rule { border: none; border-top: 1px solid var(--border); margin: 0; }
.cr-photo-block { background: var(--surface); }
.cr-photo-block-legend {
  display: grid; grid-template-columns: 1fr 140px; gap: 10px; padding: 12px 14px; align-items: end;
}
.cr-photo-block-legend-edit { align-items: start; }
.cr-photo-legend-cell { min-width: 0; }
.cr-photo-label {
  display: block; font-size: 0.72em; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); margin-bottom: 6px;
}
.cr-photo-block-side {
  display: grid; grid-template-columns: minmax(160px, 40%) 1fr; align-items: stretch; min-height: 120px;
}
.cr-photo-col-img {
  padding: 10px 12px; border-right: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.cr-photo-col-text { padding: 10px 14px 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cr-photo-block-img {
  display: block; width: auto; max-width: 100%; height: auto; max-height: 280px;
  object-fit: contain; object-position: left top;
}
.cr-photo-comment { margin: 0; white-space: pre-wrap; line-height: 1.45; font-size: 0.9em; }
.cr-photo-block-edit input[type="text"],
.cr-photo-block-edit select,
.cr-photo-block-edit textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.9em;
}
.cr-photo-block-edit textarea { resize: vertical; min-height: 72px; }
.cr-new-constat { padding: 10px; border-radius: 6px; background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.2); }
.cr-carry-section {
  margin: 16px 0; padding: 14px; border-radius: 8px;
  background: rgba(234, 179, 8, 0.08); border: 1px solid rgba(234, 179, 8, 0.45);
}
.cr-carry-title { margin: 0 0 6px; color: #eab308; font-size: 0.95em; }
.cr-history-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 720px) {
  .cr-photo-block-side { grid-template-columns: 1fr; }
  .cr-photo-col-img { border-right: none; border-bottom: 1px solid var(--border); }
}
