/* ==========================================================================
   SELACV – Gestion de site : onglet Analyse complète (V2.0.0, 15/11/2026)
   Même famille que les Analyses de Logistique, Maintenance, Événements et Audiovisuel
   (bandeau, chiffres clés, cartes, palmarès), aux couleurs de Gestion de site (lavande, violet, champagne).
   Tout est rangé sous #analysisView ; les variables suivent le thème clair / sombre (css/site-theme.css).
   ========================================================================== */
#analysisView {
  --an-track: color-mix(in srgb, var(--line) 70%, transparent);
  --an-shadow: var(--card-shadow, 0 6px 20px #3d2f5214);
  --an-violet: #68518d;
  --an-violet-2: #8a6fc0;
  --an-green: #3f9c6a;
  color: var(--ink);
}
#analysisView .an-head { align-items: flex-end; }
#analysisView .an-head p { max-width: 900px; }
#analysisView .an-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#analysisView .an-seg button { padding: 8px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--label); font-size: 12.5px; font-weight: 800; cursor: pointer; transition: background .2s, color .2s; }
#analysisView .an-seg button:hover { background: var(--soft); }
#analysisView .an-seg button.active { background: linear-gradient(135deg, #4a3a66, #8a6fc0); color: #fff; box-shadow: 0 6px 14px #68518d40; }
#analysisView button:focus-visible, #analysisView [role="button"]:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Bandeau « le bilan » */
#analysisView .an-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; margin-bottom: 14px; padding: 26px 30px; border-radius: 20px; background: linear-gradient(120deg, #2e2342 0%, #4a3a66 48%, #7d63ad 100%); color: #fff; box-shadow: var(--an-shadow); }
#analysisView .an-hero.has-photo { background: linear-gradient(100deg, #2a2038f2 0%, #3d3053e0 45%, #4a3a6699 100%), var(--photo) center / cover no-repeat; }
#analysisView .an-hero::before, #analysisView .an-hero::after { content: ""; position: absolute; border-radius: 50%; background: #ffffff12; pointer-events: none; }
#analysisView .an-hero::before { width: 300px; height: 300px; right: -80px; top: -140px; }
#analysisView .an-hero::after { width: 180px; height: 180px; right: 220px; bottom: -120px; }
#analysisView .an-hero-text { position: relative; z-index: 1; max-width: 980px; }
#analysisView .an-eyebrow { margin: 0 0 8px; color: #f2e3c4; font-size: 11.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
#analysisView .an-hero h3 { margin: 0 0 10px; color: #fff; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; }
#analysisView .an-hero p { margin: 0; color: #ece4f8; font-size: 14.5px; line-height: 1.6; }
#analysisView .an-hero b { color: #fff; }
#analysisView .an-balance { display: inline-block; margin-left: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; vertical-align: middle; }
#analysisView .an-balance.is-good { background: #3f9c6a55; color: #c9f5dc; }
#analysisView .an-balance.is-bad { background: #c2413c66; color: #ffd8d3; }
#analysisView .an-hero-gauge { position: relative; z-index: 1; display: grid; flex: none; justify-items: center; gap: 2px; width: 190px; padding: 14px 10px 12px; border: 1px solid #ffffff38; border-radius: 18px; background: #ffffff14; text-align: center; backdrop-filter: blur(6px); }
#analysisView .an-gauge { width: 160px; }
#analysisView .an-gauge-track, #analysisView .an-gauge-bar { fill: none; stroke-width: 12; stroke-linecap: round; }
#analysisView .an-gauge-track { stroke: #ffffff2e; }
#analysisView .an-gauge-bar { transition: stroke-dasharray 1s ease; }
#analysisView .an-gauge text { fill: #fff; font-size: 22px; font-weight: 900; }
#analysisView .an-hero-gauge small { color: #ece4f8; font-size: 11.5px; font-weight: 800; line-height: 1.25; }

/* Chiffres clés */
#analysisView .an-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
#analysisView .an-kpi { position: relative; overflow: hidden; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--an-shadow); transition: transform .2s, box-shadow .2s; }
#analysisView .an-kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 28px #3d2f5222; }
#analysisView .an-kpi::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, var(--an-violet), var(--an-violet-2)); }
#analysisView .an-kpi.is-ok::after { background: linear-gradient(90deg, #2f7d4f, #4fbf7a); }
#analysisView .an-kpi.is-alert::after { background: linear-gradient(90deg, #b42335, #e85262); }
#analysisView .an-kpi.is-wait::after { background: linear-gradient(90deg, #c98a00, #f0c24f); }
#analysisView .an-kpi.is-info::after { background: linear-gradient(90deg, #2f6fb0, #6aa6e0); }
#analysisView .an-kpi.is-teal::after { background: linear-gradient(90deg, #2f7c86, #5cb8c1); }
#analysisView .an-kpi-icon { position: absolute; top: 12px; right: 12px; font-size: 22px; }
#analysisView .an-kpi > b { display: block; color: var(--heading); font-size: 30px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
#analysisView .an-kpi.is-ok > b { color: var(--ok); } #analysisView .an-kpi.is-alert > b { color: var(--alert); } #analysisView .an-kpi.is-wait > b { color: var(--warn); }
#analysisView .an-kpi h3 { margin: 6px 0 3px; color: var(--heading); font-size: 13px; }
#analysisView .an-kpi p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
#analysisView .an-kpi-spark { margin-top: 8px; }
#analysisView .an-spark { display: block; width: 100%; height: 34px; }

/* Sections */
#analysisView .an-section { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; color: var(--heading); font-size: 19px; }
#analysisView .an-section small { color: var(--muted); font-size: 13px; font-weight: 600; }
#analysisView .an-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#analysisView .an-card { min-width: 0; padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--an-shadow); }
#analysisView .an-wide { grid-column: span 2; }
#analysisView .an-full { grid-column: 1 / -1; }
#analysisView .an-card > h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; color: var(--heading); font-size: 15px; }
#analysisView .an-card > h3 > span { font-size: 18px; }
#analysisView .an-h-hint { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 700; }
#analysisView .an-mini-title { margin: 14px 0 8px; color: var(--label); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
#analysisView .an-mini { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }
#analysisView .an-note { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--soft); color: var(--label); font-size: 12.5px; line-height: 1.45; }
#analysisView .an-note b { color: var(--heading); }
#analysisView .an-empty { margin: 4px 0 0; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; }
#analysisView .an-foot { margin: 18px 2px 4px; color: var(--muted); font-size: 12px; }
#analysisView .is-late { color: var(--alert); }

/* Graphique du flux (SVG) */
#analysisView .an-flow { display: block; width: 100%; height: auto; overflow: visible; }
#analysisView .an-gridline { stroke: var(--line); stroke-dasharray: 3 4; }
#analysisView .an-axis { fill: var(--muted); font-size: 10.5px; font-weight: 700; }
#analysisView .an-axis-stock { fill: #a9813f; }
#analysisView .an-bar-created { fill: var(--an-violet); }
#analysisView .an-bar-solved { fill: var(--an-green); }
#analysisView .an-stock-line { fill: none; stroke: var(--champagne); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 2px 3px #a9813f55); }
#analysisView .an-stock-dot { fill: var(--surface); stroke: var(--champagne); stroke-width: 2.5; }
#analysisView .an-area { fill: url(#none); fill: color-mix(in srgb, var(--an-violet) 18%, transparent); }
#analysisView .an-area-line { fill: none; stroke: var(--an-violet-2); stroke-width: 2.5; stroke-linejoin: round; }
#analysisView .an-area-dot { fill: var(--surface); stroke: var(--an-violet-2); stroke-width: 2; }
#analysisView .an-avg { stroke: var(--champagne); stroke-width: 1.5; stroke-dasharray: 6 4; }
#analysisView .an-avg-lbl { fill: #a9813f; }

/* Légendes */
#analysisView .an-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--label); font-size: 12px; font-weight: 700; }
#analysisView .an-legend span { display: inline-flex; align-items: center; gap: 6px; }
#analysisView .an-legend i { width: 11px; height: 11px; border-radius: 3px; }

/* Anneau */
#analysisView .an-donut-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
#analysisView .an-donut { width: 150px; height: 150px; }
#analysisView .an-donut circle { fill: none; stroke-width: 22; transition: stroke-width .2s; }
#analysisView .an-donut .an-donut-track { stroke: var(--an-track); }
#analysisView .an-donut g circle:hover { stroke-width: 28; }
#analysisView .an-donut-num { fill: var(--heading); font-size: 26px; font-weight: 900; }
#analysisView .an-donut-lbl { fill: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
#analysisView .an-donut-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#analysisView .an-donut-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 12.5px; }
#analysisView .an-donut-legend i { width: 12px; height: 12px; border-radius: 4px; }
#analysisView .an-donut-legend span { overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#analysisView .an-donut-legend b { color: var(--heading); }
#analysisView .an-donut-legend small { min-width: 24px; color: var(--muted); text-align: right; }
#analysisView .an-donut-legend .an-more span { color: var(--muted); font-weight: 600; }

/* Barres horizontales */
#analysisView .an-hbars { display: grid; gap: 9px; }
#analysisView .an-hbar { display: grid; grid-template-columns: minmax(110px, 44%) minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 12.5px; }
#analysisView .an-hbar[data-service] { cursor: pointer; border-radius: 8px; } #analysisView .an-hbar[data-service]:hover { background: var(--soft); }
#analysisView .an-hbar-label { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#analysisView .an-hbar-label em { flex: none; width: 22px; font-style: normal; text-align: center; }
#analysisView .an-hbar-label em small { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--soft); color: var(--label); font-size: 10px; font-weight: 900; }
#analysisView .an-hbar-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--an-track); }
#analysisView .an-hbar-track i { display: block; width: var(--w); height: 100%; border-radius: inherit; transform-origin: left; }
#analysisView .an-hbar b { color: var(--heading); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Colonnes */
#analysisView .an-columns { display: grid; gap: 8px; align-items: end; height: var(--h, 200px); padding-top: 8px; }
#analysisView .an-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-width: 0; text-align: center; }
#analysisView .an-col-value { min-height: 18px; color: var(--heading); font-size: 12px; font-weight: 900; white-space: nowrap; }
#analysisView .an-col-bar { display: flex; flex-direction: column-reverse; overflow: hidden; border-radius: 9px 9px 3px 3px; background: var(--an-track); }
#analysisView .an-col-bar i { display: block; width: 100%; transform-origin: bottom; }
#analysisView .an-col-bar i + i { box-shadow: 0 -1px 0 var(--surface); }
#analysisView .an-col.is-record .an-col-bar { outline: 2px solid var(--champagne); outline-offset: 2px; }
#analysisView .an-col.is-future .an-col-bar { opacity: .55; background: repeating-linear-gradient(45deg, var(--an-track) 0 6px, transparent 6px 12px); }
#analysisView .an-col.is-now .an-col-label { color: var(--heading); }
#analysisView .an-col-label { padding-top: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
#analysisView .an-col-label small { display: block; color: var(--accent); font-size: 10px; }

/* Matrice équipe × campus */
#analysisView .an-matrix { display: grid; gap: 4px; align-items: center; overflow-x: auto; }
#analysisView .an-m-head { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 4px; color: var(--label); font-size: 11.5px; font-weight: 800; text-align: center; }
#analysisView .an-m-head i, #analysisView .an-m-team i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
#analysisView .an-m-head.is-on { color: var(--heading); text-decoration: underline 2px var(--champagne); text-underline-offset: 4px; }
#analysisView .an-m-team { display: flex; align-items: center; gap: 7px; overflow: hidden; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
#analysisView .an-m-team:hover { background: var(--soft); }
#analysisView .an-m-cell { display: grid; place-items: center; height: 34px; border-radius: 8px; background: color-mix(in srgb, #68518d calc(var(--a) * 85%), var(--surface-alt)); color: var(--ink); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
#analysisView .an-m-cell[style*="--a:0.6"], #analysisView .an-m-cell[style*="--a:0.7"], #analysisView .an-m-cell[style*="--a:0.8"], #analysisView .an-m-cell[style*="--a:0.9"], #analysisView .an-m-cell[style*="--a:1"] { color: #fff; }
#analysisView .an-m-cell.is-on { box-shadow: inset 0 0 0 2px var(--champagne); }
#analysisView .an-m-total { color: var(--heading); text-align: center; font-variant-numeric: tabular-nums; }

/* Barre empilée, pastilles, grands chiffres */
#analysisView .an-stack { display: flex; overflow: hidden; height: 16px; border-radius: 999px; background: var(--an-track); }
#analysisView .an-stack i { display: block; min-width: 4px; }
#analysisView .an-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
#analysisView .an-pill { display: grid; gap: 2px; padding: 10px 6px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); text-align: center; }
#analysisView .an-pill span { font-size: 19px; }
#analysisView .an-pill b { color: var(--c); font-size: 20px; }
#analysisView .an-pill small { color: var(--label); font-size: 11.5px; font-weight: 700; }
#analysisView .an-bigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 14px; }
#analysisView .an-bigs > div { padding: 10px; border-radius: 12px; background: var(--surface-alt); text-align: center; }
#analysisView .an-bigs b { display: block; color: var(--heading); font-size: 22px; font-weight: 900; }
#analysisView .an-bigs small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
#analysisView .an-lead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#analysisView .an-lead b { color: var(--ok); font-size: 32px; font-weight: 900; }
#analysisView .an-lead span { color: var(--label); font-size: 12.5px; font-weight: 700; line-height: 1.3; }
#analysisView .an-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#analysisView .an-chips span { padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 700; }
#analysisView .an-chips span b { margin-left: 3px; color: var(--accent); }
#analysisView .an-chips span.is-warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); }
#analysisView .an-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }

/* Âges par équipe */
#analysisView .an-agebars { display: grid; gap: 8px; }
#analysisView .an-agebar { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr) 44px; gap: 10px; align-items: center; width: 100%; padding: 3px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 12.5px; text-align: left; cursor: pointer; }
#analysisView .an-agebar:hover { background: var(--soft); }
#analysisView .an-agebar-label { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#analysisView .an-agebar-track { display: flex; width: var(--w); min-width: 6px; height: 16px; overflow: hidden; border-radius: 6px; transform-origin: left; }
#analysisView .an-agebar-track i { display: block; min-width: 3px; }
#analysisView .an-agebar b { color: var(--heading); text-align: right; }

/* États GestSup */
#analysisView .an-states { display: grid; gap: 7px; }
#analysisView .an-state { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; padding: 7px 12px; border-radius: 9px; background: var(--surface-alt); font-size: 12.5px; font-weight: 800; }
#analysisView .an-state i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--bg); opacity: .22; }
#analysisView .an-state span { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
#analysisView .an-state span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--bg); }
#analysisView .an-state b { position: relative; color: var(--heading); }

/* Liste des plus anciens */
#analysisView .an-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
#analysisView .an-list button { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
#analysisView .an-list button:hover { background: var(--soft); }
#analysisView .an-age { color: var(--alert); font-size: 14px; font-weight: 900; text-align: center; }
#analysisView .an-list-main { min-width: 0; }
#analysisView .an-list-main b, #analysisView .an-list-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#analysisView .an-list-main b { font-size: 12.5px; } #analysisView .an-list-main small { color: var(--muted); font-size: 11.5px; }
#analysisView .an-list-state { max-width: 150px; overflow: hidden; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--fg); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }

/* Anneaux de pourcentage */
#analysisView .an-rings { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 12px; }
#analysisView .an-ring { display: grid; justify-items: center; gap: 6px; width: 120px; text-align: center; }
#analysisView .an-ring > div { display: grid; place-content: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(closest-side, var(--surface) 72%, transparent 73% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--an-track) 0); }
#analysisView .an-ring > div span { font-size: 16px; line-height: 1; }
#analysisView .an-ring > div b { color: var(--heading); font-size: 17px; font-weight: 900; }
#analysisView .an-ring small { color: var(--label); font-size: 11.5px; font-weight: 700; line-height: 1.25; }

/* Calendrier d'activité */
#analysisView .an-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
#analysisView .an-cal { display: grid; gap: 4px; overflow-x: auto; }
#analysisView .an-cal-month { color: var(--label); font-size: 11px; font-weight: 800; white-space: nowrap; }
#analysisView .an-cal-day { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 18px; }
#analysisView .an-cal-cell { display: block; min-width: 14px; aspect-ratio: 1; border-radius: 5px; background: var(--an-track); }
#analysisView .an-cal-cell.l1 { background: color-mix(in srgb, #8a6fc0 32%, var(--surface)); }
#analysisView .an-cal-cell.l2 { background: color-mix(in srgb, #8a6fc0 58%, var(--surface)); }
#analysisView .an-cal-cell.l3 { background: #7d63ad; }
#analysisView .an-cal-cell.l4 { background: #4a3a66; }
#analysisView .an-cal-cell.is-future { outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -1px; opacity: .85; }
#analysisView .an-cal-cell.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--champagne); }
#analysisView .an-cal-scale { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
#analysisView .an-cal-scale i { width: 16px; height: 16px; }
#analysisView .an-pills-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Horloge de la main courante */
#analysisView .an-clock-wrap { display: grid; place-items: center; }
#analysisView .an-clock { width: min(100%, 250px); height: auto; overflow: visible; }
#analysisView .an-clock path { transition: opacity .2s; } #analysisView .an-clock path:hover { opacity: 1 !important; }
#analysisView .an-clock-hub { fill: var(--surface-alt); }
#analysisView .an-clock-num { fill: var(--heading); font-size: 20px; font-weight: 900; }

/* Campus côte à côte */
#analysisView .an-campus-rows { display: grid; gap: 8px; }
#analysisView .an-campus-row { display: grid; gap: 5px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
#analysisView .an-campus-row:hover, #analysisView .an-campus-row.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
#analysisView .an-cr-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; }
#analysisView .an-cr-name i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
#analysisView .an-cr-bar { position: relative; height: 9px; overflow: hidden; border-radius: 999px; background: var(--an-track); }
#analysisView .an-cr-bar i, #analysisView .an-cr-bar em { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; }
#analysisView .an-cr-bar i { background: var(--c); opacity: .75; } #analysisView .an-cr-bar em { background: var(--alert); }
#analysisView .an-cr-figs { color: var(--muted); font-size: 11.5px; } #analysisView .an-cr-figs b { color: var(--heading); }

/* Entonnoir */
#analysisView .an-funnel { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#analysisView .an-funnel li { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
#analysisView .an-funnel-bar { width: var(--w); padding: 6px 10px; border-radius: 8px; background: linear-gradient(90deg, #4a3a66, #8a6fc0); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
#analysisView .an-funnel b { color: var(--heading); text-align: right; }

/* Palmarès */
#analysisView .an-trophies { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
#analysisView .an-trophy { position: relative; overflow: hidden; padding: 16px 16px 14px; border: 1px solid color-mix(in srgb, var(--champagne) 45%, var(--line)); border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--champagne) 16%, var(--surface)), var(--surface)); }
#analysisView .an-trophy > span { font-size: 28px; }
#analysisView .an-trophy h4 { margin: 6px 0 4px; color: var(--label); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
#analysisView .an-trophy b { display: block; color: var(--heading); font-size: 16px; line-height: 1.25; }
#analysisView .an-trophy small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* Thème sombre */
:root[data-theme="dark"] #analysisView .an-m-cell { background: color-mix(in srgb, #8a6fc0 calc(var(--a) * 85%), var(--surface-alt)); }
:root[data-theme="dark"] #analysisView .an-cal-cell.l3 { background: #9a80cc; } :root[data-theme="dark"] #analysisView .an-cal-cell.l4 { background: #c7b4ef; }
:root[data-theme="dark"] #analysisView .an-bar-created { fill: #9a80cc; } :root[data-theme="dark"] #analysisView .an-bar-solved { fill: #6fcf98; }

/* Animations d'apparition (une fois par changement de période ou de campus) */
@keyframes an-grow-x { from { transform: scaleX(0); } }
@keyframes an-grow-y { from { transform: scaleY(0); } }
@keyframes an-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes an-draw { from { stroke-dasharray: 0 999; } }
#analysisView.an-anim .an-hbar-track i, #analysisView.an-anim .an-agebar-track { animation: an-grow-x .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
#analysisView.an-anim .an-col-bar i { animation: an-grow-y .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
#analysisView.an-anim .an-bar-created, #analysisView.an-anim .an-bar-solved { transform-box: fill-box; transform-origin: bottom; animation: an-grow-y .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
#analysisView.an-anim .an-card, #analysisView.an-anim .an-kpi, #analysisView.an-anim .an-trophy { animation: an-rise .5s ease both; animation-delay: var(--d, 0ms); }
@media (prefers-reduced-motion: reduce) { #analysisView * { animation: none !important; transition: none !important; } }

/* Écrans moyens et téléphone */
@media (max-width: 1500px) { #analysisView .an-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1150px) {
  #analysisView .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #analysisView .an-wide, #analysisView .an-full { grid-column: 1 / -1; }
  #analysisView .an-cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #analysisView .an-grid { grid-template-columns: 1fr; }
  #analysisView .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #analysisView .an-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  #analysisView .an-hero-gauge { width: 100%; }
  #analysisView .an-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  #analysisView .an-donut-legend { width: 100%; }
  #analysisView .an-list { grid-template-columns: 1fr; }
  #analysisView .an-split { grid-template-columns: 1fr; }
  #analysisView .an-hbar { grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 48px; }
  #analysisView .an-list button { grid-template-columns: 48px minmax(0, 1fr); }
  #analysisView .an-list-state { grid-column: 2; justify-self: start; }
  #analysisView .an-matrix { grid-template-columns: minmax(120px, 1.4fr) repeat(5, 44px) 44px !important; }
  #analysisView .an-cal { grid-template-columns: 30px repeat(17, minmax(12px, 1fr)) !important; }
}

/* Téléphone : les graphiques larges défilent horizontalement plutôt que de rapetisser */
#analysisView #anFlow, #analysisView #anPresence { overflow-x: auto; }
@media (max-width: 760px) { #analysisView .an-flow { min-width: 620px; } }
