/* ═══════════════════════════════════════════════════════
   *  CARTOGRAPHIE-ERP / FERME-DARRIGADE
   *  Tulip Conseil — Light futuriste, REV.03
   * ═══════════════════════════════════════════════════════ */

:root {
  /* Light pure backgrounds */
  --bg: #fafbfc;
  --bg-elev: #ffffff;
  --bg-soft: #f4f6f8;
  --bg-deep: #eef1f4;
  --bg-stage: #f7f9fb;

  /* Ink */
  --ink: #0a0e14;
  --ink-soft: #2d3540;
  --ink-mid: #5c6470;
  --ink-light: #8b92a0;
  --ink-faint: #c5c9d2;

  /* Brand — Tulip Conseil (couleurs exactes du logo) */
  --teal: #49737f;
  --teal-deep: #355560;
  --teal-mid: #5c8794;
  --teal-light: #8fafb8;
  --teal-soft: #c5d4da;
  --teal-pale: #e8eff2;
  --teal-glow: rgba(73, 115, 127, 0.4);

  --gold: #ccbb8f;
  --gold-deep: #a89868;
  --gold-mid: #d8caa5;
  --gold-light: #e6dcc0;
  --gold-soft: #efe7d2;
  --gold-pale: #f7f2e5;
  --gold-glow: rgba(204, 187, 143, 0.4);

  /* Cream (3e couleur du logo) — utilisée en bg complémentaire */
  --cream: #dbd9cd;
  --cream-soft: #eceae0;

  /* Lines */
  --line: #e4e7ec;
  --line-mid: #d0d5dc;
  --line-soft: #ebeef2;
  --line-faint: #f0f2f5;

  /* Type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image:
    radial-gradient(
      ellipse 800px 600px at 100% 0%,
      rgba(0, 184, 184, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 600px 600px at 0% 100%,
      rgba(212, 160, 56, 0.03) 0%,
      transparent 50%
    );
}

::selection {
  background: var(--teal);
  color: var(--bg);
}

/* ═══════════ TOPBAR ═══════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.tb-mark {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--teal-glow);
  position: relative;
}
.tb-mark::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-glow);
}
.tb-brand {
  font-weight: 600;
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.tb-sep {
  color: var(--ink-light);
  user-select: none;
}
.tb-path {
  color: var(--ink-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.tb-path strong {
  color: var(--ink);
  font-weight: 500;
}

.tb-right {
  color: var(--ink-mid);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.tb-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-weight: 600;
  padding: 4px 10px;
  background: var(--teal-pale);
  border: 1px solid var(--teal-soft);
  border-radius: 100px;
}
.tb-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--teal);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 184, 184, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 184, 184, 0);
  }
}

/* ═══════════ HERO ═══════════ */
.hero {
  padding: 100px 24px 80px;
  border-bottom: 1px solid var(--line);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 60px;
  right: 24px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--teal-pale) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
  margin-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
}
.hero-meta-item {
  display: flex;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-right: 6px;
}
.hero-meta-item span {
  color: var(--ink-light);
}
.hero-meta-item strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.hero-title-line {
  display: block;
}
.hero-title-line.accent {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-title-line.muted {
  color: var(--ink-light);
  font-weight: 400;
}

.hero-deck {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 680px;
  margin-bottom: 64px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(10, 14, 20, 0.06);
  border-color: var(--teal-soft);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(
    circle at top right,
    var(--teal-pale) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
  font-weight: 500;
}
.stat-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-top: 24px;
  color: var(--ink);
}
.stat-num small {
  font-size: 22px;
  color: var(--ink-mid);
  margin-left: 2px;
  font-weight: 400;
}
.stat-ref {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--teal-pale);
  border-radius: 100px;
}

/* ═══════════ SECTION ═══════════ */
section {
  padding: 100px 24px;
  border-bottom: 1px solid var(--line);
  max-width: 1400px;
  margin: 0 auto;
  scroll-margin-top: 60px;
}

.sec-head {
  margin-bottom: 64px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: end;
}
.sec-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  background: var(--teal-pale);
  border: 1px solid var(--teal-soft);
  border-radius: 100px;
  display: inline-block;
  width: fit-content;
}
.sec-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.sec-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sec-deck {
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 16px;
  max-width: 680px;
  line-height: 1.6;
}

/* ═══════════ SCHEMATIC CARD ═══════════ */
.schematic {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(10, 14, 20, 0.04);
}

.schematic-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  flex-wrap: wrap;
  gap: 12px;
}
.sh-id {
  color: var(--ink);
  font-weight: 600;
}

.sh-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mid);
}

.sh-stat-pill {
  padding: 3px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 10px;
}

.sh-stat-pill strong {
  color: var(--ink);
  font-weight: 600;
}

.schematic-toolbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-elev);
}
.toolbar-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 8px;
  font-weight: 500;
}
.filter-btn {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-mid);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 100px;
  user-select: none;
}
.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}
.filter-btn.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-mid);
}
.filter-btn[data-flow="compta"].active .filter-dot {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}
.filter-btn[data-flow="logistique"].active .filter-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.filter-btn[data-flow="temps"].active .filter-dot {
  background: var(--teal-mid);
  box-shadow: 0 0 8px var(--teal-mid);
}
.filter-btn:not(.active) .filter-dot {
  opacity: 0.4;
}

.filter-reset {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-mid);
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 100px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.filter-reset:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ═══════════ STAGE 2D ═══════════ */
.schematic-stage {
  position: relative;
  background: radial-gradient(
    ellipse at 50% 50%,
    var(--bg-elev) 0%,
    var(--bg-soft) 80%
  );
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* Grille subtile en fond */
.schematic-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 30%,
    transparent 80%
  );
  pointer-events: none;
}

.map-svg {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1400 / 875;
  min-height: 480px;
  position: relative;
  z-index: 2;
}

@media (max-width: 760px) {
  .map-svg {
    aspect-ratio: 760 / 1280;
    min-height: 0;
  }
}

/* Grid lines / axis labels in SVG */
.map-svg .map-axis-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ink-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.map-svg .pole-band {
  fill: var(--teal);
  opacity: 0.025;
}
.map-svg .pole-band.agricole {
  fill: var(--teal);
}
.map-svg .pole-band.support {
  fill: var(--ink-mid);
}
.map-svg .pole-band.transformation {
  fill: var(--gold);
}

.map-svg .pole-divider {
  stroke: var(--line-soft);
  stroke-width: 0.5;
  stroke-dasharray: 4 6;
}

/* ── FLOWS ── */
.map-svg .flow {
  fill: none;
  stroke-width: 1.4;
  transition:
    opacity 0.25s ease,
    stroke-width 0.25s,
    filter 0.25s;
}
.map-svg .flow.compta {
  stroke: var(--teal);
  opacity: 0.45;
}
.map-svg .flow.logistique {
  stroke: var(--gold);
  stroke-width: 2;
  opacity: 0.78;
}
.map-svg .flow.temps {
  stroke: var(--teal-mid);
  opacity: 0.5;
  stroke-dasharray: 4 4;
  animation: dashFlow 1.5s linear infinite;
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -16;
  }
}

.map-svg.dimmed .flow {
  opacity: 0.06;
}
.map-svg.dimmed .flow.highlight {
  opacity: 1 !important;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px currentColor);
}
.map-svg.dimmed .flow.highlight.logistique {
  stroke-width: 3;
}
.map-svg .flow.hidden {
  display: none;
}

/* Arrow heads pour flux logistique surtout */
.map-svg .flow-arrow {
  fill: var(--gold);
  transition: opacity 0.25s;
  opacity: 0.85;
}
.map-svg .flow-arrow.compta {
  fill: var(--teal);
  opacity: 0.45;
}
.map-svg .flow-arrow.temps {
  fill: var(--teal-mid);
  opacity: 0.5;
}
.map-svg.dimmed .flow-arrow {
  opacity: 0.06;
}
.map-svg.dimmed .flow-arrow.highlight {
  opacity: 1 !important;
}

/* ── NODES ── */
.map-svg .node {
  cursor: pointer;
  transition:
    opacity 0.25s ease,
    transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-origin: center;
  transform-box: fill-box;
}

.map-svg .node-shape {
  fill: var(--bg-elev);
  stroke: var(--line-mid);
  stroke-width: 1.5;
  transition: all 0.25s ease;
  filter: drop-shadow(0 2px 6px rgba(10, 14, 20, 0.04));
}

.map-svg .node-shape.featured {
  fill: var(--ink);
  stroke: var(--teal);
  stroke-width: 2;
  filter: drop-shadow(0 4px 16px rgba(0, 184, 184, 0.25));
}

.map-svg .node:hover .node-shape {
  stroke: var(--teal);
  stroke-width: 2;
  filter: drop-shadow(0 4px 12px rgba(10, 14, 20, 0.08));
}

.map-svg .node.selected .node-shape {
  stroke: var(--teal);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 0 4px var(--teal-pale))
    drop-shadow(0 4px 16px rgba(0, 184, 184, 0.35));
}

/* Inner circle / glyph by category */
.map-svg .node-glyph {
  fill: none;
  stroke-width: 1.2;
  transition: all 0.25s;
}
.map-svg .node-glyph.agricole {
  stroke: var(--teal);
}
.map-svg .node-glyph.transformation {
  stroke: var(--gold);
}
.map-svg .node-glyph.support {
  stroke: var(--ink-mid);
}
.map-svg .node-glyph.holding {
  stroke: var(--gold);
  fill: var(--gold);
  fill-opacity: 0.15;
}
.map-svg .node-glyph.ge {
  stroke: var(--teal-mid);
}

.map-svg .node-name {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: -0.01em;
}
.map-svg .node-name.featured {
  fill: var(--bg);
}

.map-svg .node-id {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--teal);
  text-anchor: middle;
  letter-spacing: 0.06em;
  pointer-events: none;
  font-weight: 600;
}
.map-svg .node-id.featured {
  fill: var(--gold-mid);
}

.map-svg .node-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: var(--ink-mid);
  text-anchor: middle;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-transform: uppercase;
}
.map-svg .node-sub.featured {
  fill: var(--ink-faint);
}

/* Node connection point (small dot) */
.map-svg .node-anchor {
  fill: var(--teal);
  opacity: 0.4;
  transition: all 0.25s;
}
.map-svg .node-anchor.featured {
  fill: var(--gold);
  opacity: 0.7;
}
.map-svg .node.selected .node-anchor {
  opacity: 1;
  r: 5;
}

/* Halo for selected */
.map-svg .node-halo {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  opacity: 0;
  transition:
    opacity 0.3s,
    r 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.map-svg .node.selected .node-halo {
  opacity: 0.4;
}

.map-svg.dimmed .node:not(.selected):not(.connected) {
  opacity: 0.2;
}
.map-svg.dimmed .node.connected .node-shape {
  stroke-width: 2;
}

/* Hint */
.iso-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mid);
  letter-spacing: 0.1em;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(10, 14, 20, 0.05);
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.schematic-stage.has-selection .iso-hint {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

/* Info panel — below the SVG stage, in normal flow */
.iso-info {
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.iso-info.visible {
  max-height: 360px;
}

.iso-info-inner {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1.2fr;
  gap: 32px;
  padding: 20px 32px 24px;
  flex: 1;
  overflow-y: auto;
}

.iso-info-col {
  min-width: 0;
}

.iso-info-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 28px;
  height: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-mid);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: var(--display);
  font-weight: 500;
  z-index: 2;
}
.iso-info-close:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: rotate(90deg);
}

.iso-info-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding: 3px 9px;
  background: var(--teal-pale);
  border-radius: 100px;
  display: inline-block;
}
.iso-info-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  line-height: 1.1;
}
.iso-info-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
}

.iso-info-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
}
.iso-info-label-count {
  color: var(--ink);
  font-weight: 700;
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  border: 1px solid var(--line);
}

.iso-info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.iso-info-tag {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-soft);
  transition: all 0.2s;
}
.iso-info-tag.pivot {
  background: linear-gradient(
    135deg,
    var(--gold-soft) 0%,
    var(--gold-pale) 100%
  );
  border-color: var(--gold-mid);
  color: var(--gold-deep);
  font-weight: 600;
}

.iso-info-flows {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.iso-info-flow-cell {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s;
}
.iso-info-flow-cell.total {
  background: linear-gradient(135deg, var(--teal-pale) 0%, var(--bg-elev) 100%);
  border-color: var(--teal-soft);
}
.iso-info-flow-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}
.iso-info-flow-num {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.iso-info-flow-cell.total .iso-info-flow-num {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.iso-info-flow-types {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.iso-info-flow-type {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line-soft);
  position: relative;
  overflow: hidden;
}
.iso-info-flow-type-fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
}
.iso-info-flow-type-fill.compta {
  background: var(--teal);
}
.iso-info-flow-type-fill.logistique {
  background: var(--gold);
}
.iso-info-flow-type-fill.temps {
  background: var(--teal-mid);
}

.schematic-legend {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mid);
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.leg-line {
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.leg-line.dashed {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0,
    currentColor 3px,
    transparent 3px,
    transparent 6px
  );
  height: 2px;
}

/* ═══════════ DATA TABLES ═══════════ */
.data-section {
  margin-bottom: 64px;
}
.data-section:last-child {
  margin-bottom: 0;
}

.data-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.data-head-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  background: var(--teal-pale);
  border-radius: 4px;
}
.data-head-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.data-head-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  padding: 4px 10px;
  background: var(--bg-soft);
  border-radius: 100px;
}
.data-head-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 20px;
  max-width: 760px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead tr {
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  font-weight: 600;
  text-align: left;
  padding: 14px 16px 14px 0;
}
.data-table th:last-child {
  padding-right: 0;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: var(--bg-soft);
}
.data-table td {
  padding: 16px 16px 16px 0;
  color: var(--ink);
  vertical-align: middle;
}
.data-table td:last-child {
  padding-right: 0;
}

.data-table .col-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  width: 56px;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.data-table .col-name {
  font-weight: 500;
  color: var(--ink);
}
.data-table .col-arrow {
  width: 28px;
  text-align: center;
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
}
.data-table .col-label {
  color: var(--ink-soft);
  font-size: 13.5px;
}

.data-table .badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 100px;
  text-transform: uppercase;
}
.badge-agricole {
  color: var(--teal);
}
.badge-transformation {
  color: var(--gold);
}
.badge-support {
  color: var(--ink-mid);
}
.badge-holding {
  color: var(--gold-deep);
  background: var(--gold-pale);
  border-color: var(--gold-mid);
}
.badge-ge {
  color: var(--teal-deep);
  background: var(--teal-pale);
  border-color: var(--teal-soft);
}

/* ═══════════ APPS GRID ═══════════ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.app-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(10, 14, 20, 0.06);
  border-color: var(--teal-soft);
}
.app-card.pivot {
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--bg-elev) 70%);
  border-color: var(--gold-mid);
}
.app-card.pivot:hover {
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgba(212, 160, 56, 0.15);
}
.app-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--teal-pale) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.app-card:hover::after {
  opacity: 1;
}
.app-card.pivot::after {
  background: radial-gradient(circle, var(--gold-pale) 0%, transparent 70%);
}

.app-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.app-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 3px 10px;
  background: var(--teal-pale);
  border-radius: 100px;
}
.app-pivot {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--gold-deep);
  padding: 3px 10px;
  border-radius: 100px;
}
.app-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}
.app-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}
.app-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.app-card.pivot .app-foot {
  border-color: var(--gold-soft);
}
.app-foot-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}
.app-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.app-co-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 100px;
  background: var(--bg);
}
.app-card.pivot .app-co-tag {
  border-color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.6);
}

/* ═══════════ ESTIMATION ═══════════ */
.estim-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(10, 14, 20, 0.04);
}
.estim-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  flex-wrap: wrap;
  gap: 12px;
}
.estim-header strong {
  color: var(--ink);
  font-weight: 600;
}

.phases {
  display: flex;
  flex-direction: column;
}
.phase {
  padding: 24px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 80px 1fr 1.5fr 130px;
  gap: 24px;
  align-items: center;
  transition: background 0.15s;
  position: relative;
}
.phase:last-child {
  border-bottom: none;
}
.phase:hover {
  background: var(--bg-soft);
}
.phase-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  background: var(--teal-pale);
  border-radius: 100px;
  width: fit-content;
}
.phase-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.phase-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.phase-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.phase-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.phase-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--teal), var(--teal-mid));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 0 12px var(--teal-glow);
}
.phase.visible .phase-bar-fill {
  transform: scaleX(var(--bar, 0.5));
}
.phase-days {
  text-align: right;
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.phase-days small {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mid);
  margin-left: 3px;
  font-weight: 500;
}

.estim-total {
  padding: 32px 24px;
  background: linear-gradient(135deg, var(--ink) 0%, #1a2030 100%);
  color: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.estim-total::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(0, 184, 184, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.estim-total::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(212, 160, 56, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.estim-total-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  position: relative;
  z-index: 1;
}
.estim-total-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--bg);
  position: relative;
  z-index: 1;
}
.estim-total-num em {
  font-style: normal;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.estim-total-num small {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  margin-left: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ═══════════ COLOPHON ═══════════ */
footer.colophon {
  padding: 64px 24px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.colo-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.colo-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.colo-block strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  margin-bottom: 12px;
  color: var(--teal);
}
.colo-foot {
  max-width: 1400px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
}

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.reveal {
  opacity: 0;
}
.reveal.visible {
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.reveal-stagger > * {
  opacity: 0;
}
.reveal-stagger.visible > *:nth-child(1) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0s both;
}
.reveal-stagger.visible > *:nth-child(2) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.06s both;
}
.reveal-stagger.visible > *:nth-child(3) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both;
}
.reveal-stagger.visible > *:nth-child(4) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.18s both;
}
.reveal-stagger.visible > *:nth-child(5) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.24s both;
}
.reveal-stagger.visible > *:nth-child(6) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}
.reveal-stagger.visible > *:nth-child(7) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.36s both;
}
.reveal-stagger.visible > *:nth-child(8) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.42s both;
}
.reveal-stagger.visible > *:nth-child(9) {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.48s both;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .colo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .iso-info-inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .iso-info-col:nth-child(3) {
    grid-column: 1 / -1;
  }
  .phase {
    grid-template-columns: 60px 1fr 90px;
    gap: 16px;
  }
  .phase-desc {
    grid-column: 2 / -1;
    grid-row: 2;
    margin-top: 4px;
  }
  .phase-bar-wrap {
    grid-column: 2 / 3;
    grid-row: 3;
    margin-top: 10px;
  }
  .phase-days {
    grid-row: 1;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 14px;
    gap: 8px;
  }
  .tb-path {
    display: none;
  }
  .tb-right {
    font-size: 10px;
    gap: 8px;
  }
  .tb-status {
    padding: 3px 8px;
    font-size: 9.5px;
  }
  .tb-brand {
    font-size: 13px;
  }

  .hero {
    padding: 50px 16px 44px;
  }
  .hero-meta {
    font-size: 9.5px;
    gap: 6px 0;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }
  .hero-meta-item {
    padding: 4px 10px;
  }
  .hero-title {
    font-size: clamp(32px, 11vw, 52px);
    margin-bottom: 20px;
    line-height: 1;
  }
  .hero-deck {
    font-size: 15px;
    margin-bottom: 36px;
    line-height: 1.5;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat {
    padding: 16px;
  }
  .stat-num {
    font-size: 36px;
    margin-top: 14px;
  }
  .stat-num small {
    font-size: 14px;
  }
  .stat-ref {
    top: 14px;
    right: 14px;
    font-size: 9px;
    padding: 2px 6px;
  }
  .stat-label {
    font-size: 9px;
  }

  section {
    padding: 56px 16px;
  }

  .sec-head {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 36px;
  }
  .sec-deck {
    font-size: 14.5px;
  }

  .schematic {
    border-radius: 14px;
  }
  .schematic-header {
    padding: 12px 14px;
    font-size: 10px;
    gap: 8px;
  }
  .sh-stat-pill {
    font-size: 9.5px;
    padding: 2px 8px;
  }
  .schematic-toolbar {
    padding: 12px 14px;
    gap: 6px;
  }
  .toolbar-label {
    display: none;
  }
  .filter-btn {
    font-size: 11.5px;
    padding: 5px 10px;
    gap: 6px;
  }
  .filter-dot {
    width: 6px;
    height: 6px;
  }
  .filter-reset {
    width: 100%;
    text-align: center;
    margin-left: 0;
    padding: 6px 12px;
    margin-top: 4px;
  }
  .schematic-legend {
    padding: 12px 14px;
    gap: 10px 16px;
    font-size: 9.5px;
  }

  .iso-info.visible {
    max-height: 600px;
  }

  .iso-info-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px 16px 22px;
  }
  .iso-info-name {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .iso-info-id {
    font-size: 9.5px;
  }
  .iso-info-flow-num {
    font-size: 22px;
  }
  .iso-info-flow-cell {
    padding: 10px 12px;
  }
  .iso-info-tag {
    font-size: 11px;
    padding: 4px 9px;
  }
  .iso-info-close {
    width: 24px;
    height: 24px;
    top: 12px;
    right: 12px;
  }

  .iso-hint {
    font-size: 9px;
    padding: 5px 10px;
    bottom: auto;
    top: 12px;
    left: 12px;
    transform: none;
    letter-spacing: 0.06em;
  }
  .schematic-stage.has-selection .iso-hint {
    opacity: 0;
    transform: translateY(-30px);
  }

  .data-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .data-head-meta {
    width: 100%;
    margin-left: 0;
  }
  .data-head-title {
    font-size: 18px;
  }
  .data-head-desc {
    font-size: 13px;
  }

  .data-table {
    display: block;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody {
    display: block;
  }
  .data-table tr {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .data-table td {
    padding: 0;
    border: none;
  }
  .data-table .col-id {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 10.5px;
  }
  .data-table .col-name {
    font-weight: 500;
    font-size: 13.5px;
  }
  .data-table .col-arrow {
    display: none;
  }
  .data-table .col-arrow-mobile {
    display: inline;
    color: var(--gold);
    font-family: var(--mono);
    margin: 0 6px;
    font-weight: 600;
  }
  .data-table .col-label {
    grid-column: 2;
    font-size: 12.5px;
    color: var(--ink-mid);
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .app-card {
    padding: 20px;
    min-height: 0;
    border-radius: 14px;
  }
  .app-name {
    font-size: 20px;
  }
  .app-desc {
    font-size: 13px;
  }

  .estim-header {
    padding: 12px 14px;
    font-size: 9.5px;
  }
  .phase {
    padding: 18px 16px;
    gap: 10px;
    grid-template-columns: 56px 1fr 80px;
  }
  .phase-name {
    font-size: 15px;
  }
  .phase-desc {
    font-size: 12px;
  }
  .phase-days {
    font-size: 20px;
  }
  .phase-num {
    font-size: 10px;
    padding: 3px 8px;
  }

  .estim-total {
    padding: 22px 16px;
  }
  .estim-total-num {
    font-size: 36px;
  }
  .estim-total-label {
    font-size: 10px;
  }

  footer.colophon {
    padding: 40px 16px;
  }
  .colo-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 28px;
  }
  .colo-foot {
    font-size: 9.5px;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(28px, 10vw, 40px);
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    padding: 18px;
  }
  .filter-btn {
    font-size: 11px;
    padding: 5px 9px;
  }
}

.col-arrow-mobile {
  display: none;
}

/* ═══════════ FLUX LABELS & TABLE LINK ═══════════ */
.data-table tbody tr {
  cursor: pointer;
}

.data-table tr.active {
  background: var(--bg-soft);
}
.data-table[data-type="compta"] tr.active td:first-child {
  box-shadow: inset 3px 0 0 var(--teal);
}
.data-table[data-type="logistique"] tr.active td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}
.data-table[data-type="temps"] tr.active td:first-child {
  box-shadow: inset 3px 0 0 var(--teal-mid);
}

.map-svg .flow-label {
  font-family: var(--mono);
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.map-svg .flow-label.compta {
  fill: var(--teal-deep);
}
.map-svg .flow-label.logistique {
  fill: var(--gold-deep);
}
.map-svg .flow-label.temps {
  fill: var(--teal-mid);
}

.map-svg .flow-label-bg {
  fill: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.map-svg.dimmed .flow-label.highlight,
.map-svg.dimmed .flow-label-bg.highlight {
  opacity: 1;
}

@media print {
  .reveal,
  .reveal-stagger > * {
    opacity: 1 !important;
    animation: none !important;
  }
  .topbar {
    position: static;
  }
  .iso-info {
    display: none;
  }
}
