/* Radar V1 — mockup. Consomme uniquement les tokens de ds/tokens.css. */

/* Arbitrage 2026-09-24 : Satoshi seule, y compris les titres. */
:root {
  --font-heading: var(--font-sans);
  --header-h: 52px;
  /* Pleine largeur : seule une marge de 40 px encadre le contenu. */
  --page-max: none;
  --page-pad: 40px;

  /* Extras app repris de radar-app/src/tokens.css */
  --text-on-photo:        #FFFFFF;
  --text-on-photo-subtle: var(--gray-200);
  --overlay-photo-strong: rgba(0, 0, 0, .8);
}

body { min-height: 100vh; }
[hidden] { display: none !important; }

/* ── Chrome ─────────────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: var(--z-overlay);
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--page-pad);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.app-header svg { width: 16px; height: 16px; stroke-width: 1.6; }
.crumbs { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--control-h-sm); padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font: 500 var(--text-sm)/1 var(--font-sans); color: var(--fg-muted);
  cursor: pointer; white-space: nowrap;
}
.crumb:hover { background: var(--bg-inset); color: var(--fg-strong); }
.crumb--root { color: var(--fg-strong); font-weight: 700; padding-left: 0; }
.crumb--root:hover { background: transparent; color: var(--accent); }
.crumb--current { color: var(--fg-strong); }
.crumb-sep { color: var(--border-strong); font-size: var(--text-sm); }
.crumb svg { width: 14px; height: 14px; stroke-width: 1.6; color: var(--fg-subtle); }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-right: 1px solid var(--gray-200);
  font: 400 var(--text-sm)/1 var(--font-sans); color: var(--accent);
}
.header-link:hover { color: var(--accent-hover); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius);
  background: var(--accent-tint); color: var(--fg-strong); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--accent-subtle); }
.avatar-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 0;
  border: 0; background: transparent; color: var(--fg-strong); cursor: pointer;
}
.avatar {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--gray-900);
  font: 500 var(--text-xs)/1 var(--font-sans);
}

/* ── Carte de groupement (rollout) ──────────────────────────────────────
   Quatre informations, rien d'autre : le groupement (photo), le nombre de
   projets, la dernière mise à jour, la prochaine échéance.              */
.group-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  background: var(--bg-surface); color: inherit; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.group-card:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); color: inherit; }
.group-card:focus-visible { box-shadow: var(--focus-ring); }

.group-card__photo { position: relative; height: 164px; overflow: hidden; background: var(--bg-sunken); }
.group-card__photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.group-card:hover .group-card__photo img { transform: scale(1.03); }
.group-card__photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, var(--overlay-photo-strong));
}
.group-card__name { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 14px; }
.group-card__name strong {
  display: block; color: var(--text-on-photo);
  font: 500 var(--text-xl)/var(--lh-xl) var(--font-sans); letter-spacing: var(--tracking-tight);
}
.group-card__name span {
  display: block; margin-top: 2px; color: var(--text-on-photo-subtle); font-size: var(--text-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.group-card__body {
  display: grid; grid-template-columns: 0.7fr 1fr 1.3fr auto; align-items: center;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
}
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi + .kpi { padding-left: var(--space-4); border-left: 1px solid var(--border-subtle); }
.kpi__label {
  font: 500 var(--text-2xs)/var(--lh-2xs) var(--font-sans);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-muted);
}
.kpi__value { font: 500 var(--text-lg)/1.3 var(--font-sans); color: var(--fg-strong); white-space: nowrap; }
.kpi__sub { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__eta {
  margin-left: 4px; padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--accent-tint); color: var(--accent);
  font: 500 var(--text-2xs)/1.4 var(--font-sans); vertical-align: 2px;
}
.group-card__chev { width: 20px; height: 20px; color: var(--fg-muted); stroke-width: 1.8; transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.group-card:hover .group-card__chev { transform: translateX(2px); color: var(--accent); }

/* ── Page ───────────────────────────────────────────────────────────── */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--page-pad) var(--page-pad) var(--space-16); }
.page-title {
  margin: 0; font: 500 var(--text-3xl)/var(--lh-3xl) var(--font-sans);
  letter-spacing: var(--tracking-tight); color: var(--fg-strong);
}
.page-sub { margin: var(--space-2) 0 0; color: var(--fg-muted); font-size: var(--text-md); }

.section-label {
  font: 500 var(--text-2xs)/var(--lh-2xs) var(--font-sans);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-subtle);
}

.card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--pad-card); box-shadow: var(--shadow-sm);
}

/* ── Badges de statut ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: var(--pad-badge);
  border-radius: var(--radius-full); border: 1px solid;
  font: 500 var(--text-xs)/1.2 var(--font-sans); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--conform    { color: var(--status-conform-fg);    background: var(--status-conform-bg);    border-color: var(--status-conform-border); }
.badge--uncertain  { color: var(--status-uncertain-fg);  background: var(--status-uncertain-bg);  border-color: var(--status-uncertain-border); }
.badge--nonconform { color: var(--status-nonconform-fg); background: var(--status-nonconform-bg); border-color: var(--status-nonconform-border); }
.badge--neutral    { color: var(--status-neutral-fg);    background: var(--status-neutral-bg);    border-color: var(--status-neutral-border); }
.badge--plain      { color: var(--fg-muted); background: var(--bg-raised); border-color: var(--border-subtle); }
.badge--plain::before { display: none; }

/* ── Menu de bascule (fil d'ariane) ─────────────────────────────────── */
.crumb-menu { position: relative; }
.crumb-sep { color: var(--fg-strong); font-size: var(--text-sm); padding: 0 2px; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-overlay);
  min-width: 240px; padding: var(--space-1);
  background: var(--bg-overlay); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--fg-body);
}
.menu__item:hover { background: var(--bg-raised); color: var(--fg-strong); }
.menu__item.is-active { color: var(--fg-strong); font-weight: 500; }
.menu__item svg { width: 14px; height: 14px; color: var(--accent); }

/* ── Onglets de vue ─────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--accent-tint); }
.tab {
  padding: 10px var(--space-4); margin-bottom: -1px; border-bottom: 1px solid transparent;
  font: 400 var(--text-sm)/1.2 var(--font-sans); color: var(--accent);
}
.tab:hover { color: var(--fg-strong); }
.tab.is-active { font-weight: 500; color: var(--fg-strong); border-bottom-color: var(--accent); }

/* ── Pile d'avatars ─────────────────────────────────────────────────── */
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar--t1 { background: var(--accent-tint); }
.avatar--t2 { background: var(--gray-200); }
.avatar--t3 { background: var(--bg-sunken); }

/* ── Carte projet ───────────────────────────────────────────────────── */
.project-card {
  display: flex; flex-direction: column; gap: 10px; padding: var(--space-5);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.project-card:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); }
.project-card__grade { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.project-card__id { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.project-card__name {
  margin: 0; font: 500 1.125rem/1.3 var(--font-sans); color: var(--fg-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-card__report, .project-card__date { font: 500 var(--text-sm)/1.35 var(--font-sans); color: var(--gray-700); }
.project-card__date { font-style: italic; }
.project-card hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--accent-tint); }

.donut { position: relative; flex: none; width: 94px; height: 94px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut__value {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 1.8rem/1 var(--font-sans); color: var(--fg-strong); letter-spacing: var(--tracking-tight);
}
.donut__value small { font: 400 1rem/1 var(--font-sans); color: var(--fg-body); margin-left: 1px; }


.sw-conform    { background: var(--status-conform); }
.sw-uncertain  { background: var(--status-uncertain); }
.sw-nonconform { background: var(--status-nonconform); }
.sw-neutral    { background: var(--status-neutral); }

.evo { display: flex; flex-direction: column; gap: 5px; }
.evo__label {
  font: 400 var(--text-xs)/1.2 var(--font-sans);
  letter-spacing: 0.02em; color: var(--gray-700);
}
.evo__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.evo__item { display: flex; flex-direction: column; padding: 3px 0; }
.evo__top { display: flex; align-items: center; gap: 5px; font: 500 var(--text-lg)/1.25 var(--font-sans); }
.evo__top svg { width: 14px; height: 14px; stroke-width: 2; }
.evo__top .sq { width: 10px; height: 10px; border-radius: 2px; }
.evo__name { font-size: var(--text-sm); line-height: 1.3; }
.tone-conform    { color: var(--status-conform-fg); }
.tone-nonconform { color: var(--status-nonconform-fg); }
.tone-uncertain  { color: var(--status-uncertain-fg); }
.tone-neutral    { color: var(--fg-strong); }

.project-card__foot { display: flex; align-items: center; justify-content: space-between; }
.state-chip { display: inline-flex; align-items: center; gap: 5px; font: 500 var(--text-xs)/1.2 var(--font-sans); }
.state-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state--completed    { color: var(--status-conform-fg); }
.state--started      { color: var(--fg-muted); }
.state--waiting_docs { color: var(--accent); }
.card-action {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 500 var(--text-sm)/1 var(--font-sans); color: var(--gray-1000);
}
.card-action svg { width: 18px; height: 18px; stroke-width: 1.6; transition: transform var(--dur-fast) var(--ease-out); }
.card-action:hover { color: var(--accent); }
.card-action:hover svg:last-child { transform: translateX(2px); }

/* ══ Analytics & Échéances ═════════════════════════════════════════════ */
.analytics { display: flex; flex-direction: column; gap: 20px; margin-top: 10px; }
.panel { background: var(--bg-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; }
.panel__title {
  margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--border-subtle);
  font: 500 var(--text-md)/1.3 var(--font-sans); color: var(--fg-strong);
}
.panel__head .panel__title { padding: 0; border: 0; }
.panel__foot {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 24px;
  border-top: 1px solid var(--border-subtle); font-size: var(--text-sm); color: var(--gray-600);
}
.panel__note { margin: 0; padding: 0 20px 14px; font-size: var(--text-xs); color: var(--fg-muted); }
.link-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--accent); }
.link-cta svg { width: 16px; height: 16px; stroke-width: 1.8; }
.btn-outline {
  display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-h-sm); padding: 0 var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius); background: var(--bg-surface);
  font: 500 var(--text-sm)/1 var(--font-sans); color: var(--fg-strong); cursor: pointer;
}
.btn-outline:hover { border-color: var(--border-strong); }
.btn-outline svg { width: 15px; height: 15px; stroke-width: 1.7; }
.dim { color: var(--fg-muted); }

/* Tableau */
.grid-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--bg-surface); }
.grid-table th {
  height: 36px; padding: 0 16px; text-align: left; background: var(--bg-raised);
  font: 500 var(--text-xs)/1.2 var(--font-sans); color: var(--gray-700); border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.grid-table th[data-tip] { cursor: help; }
.grid-table td { height: 57px; padding: 0 16px; font-size: var(--text-sm); color: var(--fg-body); border-bottom: 1px solid var(--border-subtle); }
.grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table tbody tr:hover td { background: var(--bg-raised); }
.grid-table th:first-child, .grid-table td:first-child { padding-left: 24px; }
.grid-table .t-next { text-align: right; padding-right: 24px; }
.t-name a { font-weight: 500; color: var(--fg-strong); }
.t-name a:hover { color: var(--accent); }
.t-score { font-weight: 700; }
.t-score small { font-weight: 400; font-size: var(--text-2xs); margin-left: 1px; }
.alert { color: var(--status-nonconform-fg); font-weight: 500; }
.pill-btn {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-full);
  border: 1px solid var(--border-default); background: var(--bg-surface);
  font: 500 var(--text-xs)/1 var(--font-sans); color: var(--fg-body); white-space: nowrap;
}
.pill-btn:hover { border-color: var(--border-strong); color: var(--fg-strong); }

/* Frise */
.tl { display: flex; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
.tl-names { flex: none; width: 150px; border-right: 1px solid var(--border-subtle); }
.tl-names__head { height: 48px; }
.tl-name { height: 128px; display: flex; align-items: center; padding: 0 20px; border-top: 1px solid var(--border-subtle); }
.tl-name a { font-size: var(--text-sm); font-weight: 500; color: var(--fg-strong); }
.tl-name a:hover { color: var(--accent); }
.tl-scroll { flex: 1; min-width: 0; overflow-x: auto; }
.tl-canvas { position: relative; }
.tl-months { display: flex; height: 48px; }
.tl-month { flex: none; width: 250px; display: flex; align-items: center; justify-content: center; font-size: var(--text-sm); color: var(--fg-body); }
.tl-grid { position: absolute; top: 48px; bottom: 0; left: 0; display: flex; pointer-events: none; }
.tl-col { width: 250px; border-left: 1px solid var(--border-subtle); background: linear-gradient(90deg, transparent 124.5px, var(--bg-inset) 124.5px, var(--bg-inset) 125.5px, transparent 125.5px); opacity: .9; }
.tl-rows { position: relative; }
.tl-row { position: relative; height: 128px; border-top: 1px solid var(--border-subtle); }
.tl-row__line { position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--accent-border); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--fg-strong); z-index: 2; pointer-events: none; }
.tl-today__pill {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 10px; border-radius: var(--radius); background: var(--accent); color: var(--fg-on-accent);
  font: 500 var(--text-xs)/1.4 var(--font-sans);
}

.ev { position: absolute; top: 50%; width: 0; height: 0; z-index: 3; color: var(--accent); }
.ev__diamond {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; transform: rotate(45deg);
  border-radius: 2px; background: var(--status-conform); border: 1.5px solid var(--status-conform);
}
.ev--current .ev__diamond { background: var(--accent); border-color: var(--accent); }
.ev--todo .ev__diamond { background: var(--bg-surface); border-style: dashed; }
.ev:hover .ev__diamond { box-shadow: 0 0 0 3px var(--accent-subtle); }
.ev__tick { position: absolute; left: -0.5px; width: 1px; height: 8px; background: currentColor; }
.ev--milestone .ev__tick { bottom: 8px; }
.ev--report .ev__tick { top: 8px; }
.ev--todo .ev__tick { background: none; border-left: 1px dashed var(--status-conform); }
.ev__label {
  position: absolute; left: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; font-size: var(--text-xs); color: var(--accent); line-height: 1.3;
}
.ev--milestone .ev__label { bottom: 17px; }
.ev--report .ev__label { top: 17px; }
.ev__label svg { width: 13px; height: 13px; stroke-width: 1.7; }
.ev--current .ev__label { padding: 2px 8px; border-radius: var(--radius-full); background: var(--accent); color: var(--fg-on-accent); }
.ev--current.ev--milestone .ev__label { bottom: 15px; }

.tl-legend { display: flex; align-items: center; gap: 20px; padding: 12px 24px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
.lg { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--text-xs)/1 var(--font-sans); color: var(--fg-strong); }
.lg svg { width: 14px; height: 14px; stroke-width: 1.7; color: var(--accent); }
.lg .ev__diamond { position: static; width: 10px; height: 10px; margin: 0 2px; }
.ev--done-sw { background: var(--status-conform) !important; }
.ev--todo-sw { background: var(--bg-surface) !important; border-style: dashed !important; }
.lg-pill { padding: 2px 6px; border-radius: var(--radius-lg); background: var(--accent); color: var(--fg-on-accent); }

/* Graphes */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 18px 20px 12px; }
.chart { display: flex; flex-direction: column; min-width: 0; }
.chart__title { margin: 0; font: 500 var(--text-md)/1.3 var(--font-sans); color: var(--fg-strong); }
.chart__sub { margin: 4px 0 0; font-size: var(--text-xs); color: var(--accent); }
.chart__hero { display: flex; align-items: center; gap: var(--space-2); height: 40px; margin-top: 10px; font: 700 var(--text-xl)/1 var(--font-sans); color: var(--fg-strong); }
.chart__hero small { font: 400 var(--text-xs)/1 var(--font-sans); margin-left: -6px; align-self: flex-end; padding-bottom: 3px; }
.chart__spacer { height: 50px; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font: 500 var(--text-xs)/1.3 var(--font-sans); }
.delta svg { width: 12px; height: 12px; stroke-width: 2; }
.delta--up { color: var(--status-conform-fg); background: var(--status-conform-bg); border: 1px solid var(--status-conform-border); }
.delta--down { color: var(--status-nonconform-fg); background: var(--status-nonconform-bg); border: 1px solid var(--status-nonconform-border); }
.chart__hero .unit { font: 400 var(--text-xs)/1 var(--font-sans); color: var(--fg-body); align-self: flex-end; padding-bottom: 3px; margin-left: -4px; }
.viz { width: 100%; height: 96px; overflow: visible; display: block; }
.viz-grid { stroke: var(--border-subtle); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.viz-area { opacity: .7; }
.viz-dot { stroke: var(--bg-raised); stroke-width: 2; vector-effect: non-scaling-stroke; }
.viz-hit { fill: transparent; cursor: default; }
.viz-hit:hover { fill: var(--bg-inset); }
.viz-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--text-2xs); color: var(--accent); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 14px; font-size: var(--text-2xs); color: var(--accent); }
.viz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw-line { width: 12px; height: 2px; border-radius: 1px; }
.sw-sq { width: 8px; height: 8px; border-radius: 2px; }
.sw-tick { width: 12px; height: 2px; background: var(--fg-strong); }

.bars { display: flex; justify-content: space-around; align-items: flex-end; height: 146px; margin-top: 10px;
  background: repeating-linear-gradient(180deg, transparent 0 23px, var(--border-subtle) 23px 24px); background-size: 100% 24px; background-position: 0 2px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-wrap { position: relative; width: 24px; height: 96px; }
.bar-svg { display: block; }
.bar-svg rect:hover { opacity: .85; }
.bar-score {
  position: absolute; left: -8px; transform: translateY(-50%); display: inline-flex; align-items: center;
  font: 500 var(--text-md)/1 var(--font-sans); color: var(--fg-strong); white-space: nowrap; cursor: default;
}
.bar-score i { width: 40px; height: 2px; border-radius: 1px; background: var(--fg-strong); margin-right: 6px; box-shadow: 0 0 0 1px var(--bg-raised); }
.bar-score small { font-size: var(--text-2xs); font-weight: 400; margin-left: 1px; }
.bar-score sup { font-size: var(--text-2xs); color: var(--fg-muted); margin-left: 1px; }
.bar-label { font-size: var(--text-2xs); color: var(--accent); }

.viz-tip {
  position: fixed; z-index: var(--z-toast); pointer-events: none; max-width: 260px;
  padding: 8px 10px; border-radius: var(--radius); background: var(--gray-1000); color: var(--fg-on-accent);
  font: 400 var(--text-xs)/1.45 var(--font-sans); box-shadow: var(--shadow-lg);
}
.viz-tip strong { font-weight: 500; }
.viz-tip em { color: var(--gray-400); font-style: normal; }
.ev--lvl1 .ev__tick { height: 30px; }
.ev--lvl1.ev--milestone .ev__label { bottom: 39px; }
.ev--lvl1.ev--report .ev__label { top: 39px; }
.ev--lvl2 .ev__tick { height: 50px; }
.ev--lvl2.ev--milestone .ev__label { bottom: 59px; }
.ev--lvl2.ev--report .ev__label { top: 59px; }
.header-link.is-active { color: var(--fg-strong); font-weight: 500; }

/* ── Flags de risque (Discovery) : distincts des pastilles de statut ──
   Bloquant : plein, rouge profond, texte blanc. Prioritaire : clair, ardoise.
   Rectangulaires, là où les statuts sont des pastilles arrondies. */
.flag {
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 8px; border-radius: var(--radius-xs);
  font: 700 var(--text-2xs)/1 var(--font-sans); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; cursor: default;
}
.flag svg { width: 12px; height: 12px; stroke-width: 2.2; }
.flag--block { background: var(--badge-critical); color: var(--badge-critical-fg); }
.flag--sm { height: 18px; padding: 0 6px; font-size: 0.625rem; }
.flag--sm svg { width: 10px; height: 10px; }
.flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Vue portefeuilles : groupes par rollout dans le calendrier et l'état des lieux */
.tl-name--grp, .tl-row--grp { height: 40px; background: var(--bg-surface); }
.tl-name--grp { padding: 0 16px 0 20px; }
.tl-name--grp a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 var(--text-xs)/1 var(--font-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--gray-700); }
.tl-row--grp + .tl-row, .tl-name--grp + .tl-name { border-top-color: var(--border-subtle); }
.grid-table .grp-row td { height: 40px; background: var(--bg-surface); }
.grid-table tbody tr.grp-row:hover td { background: var(--bg-surface); }
.grp-row a { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font: 500 var(--text-xs)/1 var(--font-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--gray-700); }
.grp-row a:hover { color: var(--accent); }
.grp-row a svg { width: 13px; height: 13px; }
.grp-row .dim { font-size: var(--text-xs); }
.analytics--portfolio .tl-names { width: 200px; }
.tl-name--grp { position: relative; z-index: 3; overflow: visible; }
.tl-name--grp a { overflow: visible; text-overflow: clip; }
.tl-row--grp { z-index: 1; }

/* Évolutions : texte et icône colorés, sans pastille de fond */
.delta, .delta--up, .delta--down { padding: 0; border: 0; background: none; }

/* ── Carte des projets (Portefeuilles · Analytics) ─────────────────────── */
.pm .panel__head { gap: 16px; }
.pm-scope { display: inline-flex; align-items: baseline; gap: 10px; margin-left: auto; font-size: var(--text-sm); color: var(--fg-strong); }
.pm-scope b { font-weight: 500; }
.pm-scope .dim { font-size: var(--text-xs); }
.pm-scope .link-cta { align-self: center; }
.pm-clear { display: inline-flex; align-items: center; gap: 4px; align-self: center; height: 26px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-full); background: var(--bg-surface); font: 500 var(--text-xs)/1 var(--font-sans); color: var(--fg-body); cursor: pointer; }
.pm-clear:hover { border-color: var(--accent-border); color: var(--accent); }
.pm-clear svg { width: 12px; height: 12px; }
.pm-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 28px 24px 8px; background: var(--bg-surface); }
.pm-kpi { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pm-kpi__v { font: 300 44px/1 var(--font-sans); letter-spacing: -0.02em; color: var(--fg-strong); min-height: 44px; }
.pm-kpi__v small { margin-left: 2px; font-size: 20px; color: var(--fg-muted); }
.pm-kpi__dash { color: var(--fg-subtle); }
.pm-kpi__bar { width: 18px; height: 2px; border-radius: 2px; background: var(--accent); }
.pm-kpi--crit .pm-kpi__bar { background: var(--badge-critical); }
.pm-kpi__l { font-size: var(--text-sm); color: var(--fg-muted); }
.pm-stage { position: relative; height: 560px; overflow: hidden; background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-raised) 100%); cursor: grab; touch-action: none; }
.pm-stage.is-drag { cursor: grabbing; }
.pm-stage::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(180deg, transparent, var(--bg-raised)); pointer-events: none; }
.pm-canvas { position: absolute; inset: 0; }
.pm-pins { position: absolute; inset: 0; pointer-events: none; }
.pm-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; transition: opacity .25s; }
/* Épingle fine : pied au sol, tige, tête ronde */
.pm-pin__foot { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.pm-pin__stem { position: absolute; left: -0.75px; top: -26px; width: 1.5px; height: 26px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent)); transform-origin: bottom; transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
.pm-pin__head { position: absolute; left: -7px; top: -38px; display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--bg-surface), 0 4px 10px -3px rgba(22, 24, 29, .35); transition: transform .25s cubic-bezier(.22, 1, .36, 1), background .2s; }
.pm-pin--multi .pm-pin__head { left: -10px; top: -44px; width: 20px; height: 20px; }
.pm-pin__head b { font: 600 var(--text-2xs)/1 var(--font-sans); color: var(--fg-on-accent); }
.pm-pin__crit { position: absolute; left: 5px; top: -42px; width: 7px; height: 7px; border-radius: 50%; background: var(--badge-critical); box-shadow: 0 0 0 2px var(--bg-surface); }
.pm-pin--multi .pm-pin__crit { left: 8px; top: -48px; }
.pm-pin:hover .pm-pin__head, .pm-pin.is-sel .pm-pin__head { transform: scale(1.2); }
.pm-pin:hover .pm-pin__stem, .pm-pin.is-sel .pm-pin__stem { transform: scaleY(1.15); }
.pm-pin.is-sel .pm-pin__head, .pm-pin.is-sel .pm-pin__foot { background: var(--fg-strong); }
.pm-pin.is-dim { opacity: .35; }
.pm-pin.is-drop .pm-pin__head, .pm-pin.is-drop .pm-pin__crit { animation: pm-drop .6s cubic-bezier(.22, 1, .36, 1) both; animation-delay: inherit; }
.pm-pin.is-drop .pm-pin__stem { animation: pm-stem .5s cubic-bezier(.22, 1, .36, 1) both; animation-delay: inherit; }
.pm-pin.is-drop .pm-pin__foot { animation: pm-shadow .4s ease-out both; animation-delay: inherit; }
@keyframes pm-drop { from { opacity: 0; translate: 0 -14px; } }
@keyframes pm-stem { from { scale: 1 0; } }
@keyframes pm-shadow { from { opacity: 0; scale: .3; } }
.pm-card { position: absolute; left: 0; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 2px; width: 280px; padding: 12px; border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-md), 0 0 0 1px var(--border-subtle); pointer-events: auto; animation: pm-card .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes pm-card { from { opacity: 0; translate: 0 6px; } }
.pm-card__city { padding: 0 6px 6px; font: 500 var(--text-xs)/1.2 var(--font-sans); letter-spacing: 0; color: var(--fg-muted); }
.pm-card__stem { position: absolute; top: var(--stem-y); right: 100%; width: 14px; height: 1px; background: var(--accent-border); }
.pm-card.is-left .pm-card__stem { right: auto; left: 100%; }
.pm-card__stem::after { content: ''; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.pm-card.is-left .pm-card__stem::after { left: auto; right: -2px; }
.pm-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; }
.pm-item + .pm-item { border-top: 1px solid var(--border-subtle); border-radius: 0; }
.pm-item:hover, .pm-item.is-on { background: var(--bg-raised); }
.pm-item__name { font: 500 var(--text-sm)/1.3 var(--font-sans); color: var(--fg-strong); }
.pm-item:hover .pm-item__name { color: var(--accent); }
.pm-item__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pm-item__score { font: 500 var(--text-md)/1 var(--font-sans); color: var(--fg-strong); }
.pm-item__score small { font-size: var(--text-xs); color: var(--fg-muted); margin-left: 1px; }
.pm-item__row { display: flex; align-items: center; gap: 12px; font-size: var(--text-xs); color: var(--fg-muted); }
.pm-item__row svg { width: 12px; height: 12px; margin-right: -6px; }
.pm-item__row b { font-weight: 500; }
.pm-item__crit { display: inline-flex; align-items: center; gap: 5px; color: var(--badge-critical); }
.pm-item__crit i { width: 6px; height: 6px; border-radius: 50%; background: var(--badge-critical); }
.pm-tools { position: absolute; right: 16px; top: 16px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.pm-tool { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface); color: var(--fg-strong); cursor: pointer; box-shadow: var(--shadow-sm); }
.pm-tool:hover { color: var(--accent); border-color: var(--accent-border); }
.pm-tool svg { width: 15px; height: 15px; }
.pm-hint { position: absolute; left: 20px; bottom: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--text-xs); color: var(--fg-muted); pointer-events: none; }
.pm-hint svg { width: 13px; height: 13px; }
.pm-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: var(--text-sm); color: var(--fg-muted); }
@media (prefers-reduced-motion: reduce) { .pm-card { animation: none; } }

/* Bouton tertiaire unique (Partager, Exporter) : teinte d'accent, sans filet ni ombre, à droite de la barre d'outils. */
body .rf-export, body .btn-soft, body .rr-share .btn-outline, body .rp-bshare .btn-outline {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius);
  background: var(--accent-tint); box-shadow: none; font: 500 var(--text-sm)/1 var(--font-sans); color: var(--accent); cursor: pointer; }
body .rf-export:hover, body .btn-soft:hover, body .rr-share .btn-outline:hover, body .rp-bshare .btn-outline:hover { background: var(--accent-subtle); }
body .rf-export svg, body .btn-soft svg, body .rr-share .btn-outline svg, body .rp-bshare .btn-outline svg { width: 15px; height: 15px; }

/* Séparateurs de portefeuille (Gantt + état des lieux) : titre medium lisible, bandeau grisé et filet marqué */
.tl-name--grp, .tl-row--grp { height: 44px; background: var(--bg-raised); border-top: 1px solid var(--border-default); }
.tl-name--grp { display: flex; align-items: center; gap: 8px; }
.tl-name--grp a { overflow: visible; white-space: nowrap; font: 500 var(--text-sm)/1.2 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--fg-strong); }
.tl-name--grp a:hover { color: var(--accent); }
.tl-grp__n { position: relative; z-index: 3; white-space: nowrap; font-size: var(--text-xs); color: var(--fg-muted); }
.tl-row--grp + .tl-row, .tl-name--grp + .tl-name { border-top-color: var(--border-subtle); }
.grid-table .grp-row td { height: 44px; background: var(--bg-raised); border-top: 1px solid var(--border-default); }
.grid-table tbody tr.grp-row:hover td { background: var(--bg-raised); }
.grp-row a { font: 500 var(--text-sm)/1.2 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--fg-strong); }
.grp-row .dim { font-size: var(--text-xs); }
.tl-row--grp { position: relative; z-index: 2; }

/* Portefeuille sans photo : aplat d'accent et graticule discret, initiales en filigrane */
.group-card__ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 28px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #0e1320) 100%);
  font: 700 88px/1 var(--font-sans); letter-spacing: -0.04em; color: rgba(255,255,255,.12); }

/* Carte projet entièrement cliquable : le lien « Ouvrir » s'étend à toute la carte */
.project-card { position: relative; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.project-card:hover { box-shadow: var(--shadow-md); }
.project-card .card-action::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.project-card:hover .card-action { color: var(--accent); }
.project-card .card-action:focus-visible { outline: none; }
.project-card:has(.card-action:focus-visible) { box-shadow: 0 0 0 2px var(--accent); }
.panel__empty { margin: 0; padding: 28px 20px; background: var(--bg-surface); font-size: var(--text-sm); color: var(--fg-muted); }
.pm-item__name { display: inline-flex; align-items: center; gap: 4px; }
.pm-item__go { width: 13px; height: 13px; opacity: 0; transition: opacity .15s; }
.pm-item:hover .pm-item__go { opacity: 1; }

/* Pont invisible entre l'épingle et la fiche : le survol ne se perd pas dans l'écart */
.pm-card::before { content: ''; position: absolute; top: 0; bottom: 0; right: 100%; width: 28px; }
.pm-card.is-left::before { right: auto; left: 100%; }
/* Les épingles restent au-dessus de la fiche et de son pont : un clic sur l'épingle n'est jamais intercepté */
.pm-pins { z-index: 4; }
.pm-card::before { width: 14px; }
