/* ============================================================
   HOTELIUM — Dashboard d'audit · Direction « Dossier Canopée »
   L'audit comme un dossier d'expert vivant : substrat ivoire,
   encre vert forêt, données en laiton/mono, alertes terracotta.
   Triptyque typographique Canopée : Fraunces · Inter · JetBrains Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── TOKENS · Design System Platform (Canopée supprimée) ─────
   Mêmes noms de variables que l'ancienne version (le JS de rendu
   les lit via cssVar) mais valeurs alignées sur platform.css :
   Inter + JetBrains Mono, vert-blanc, lime, danger rouge. */
:root {
  /* Primitives (repointées — conservées pour refs directes) */
  --ivoire-0: #F7F9F7;  --ivoire-1: #FFFFFF;  --ivoire-2: #FAFBF9;  --ivoire-3: #EEF2EC;
  --voile-canopee: #EBF5E6;
  --encre: #0D1A0A;  --encre-2: #3F5A36;  --encre-3: #5C7A52;  --encre-4: #8AA17F;
  --canopee-900: #0F2A1B;  --canopee-800: #1A3A2A;  --canopee-700: #2D6A4F;  --canopee-600: #3F8A5E;
  --lime: #7ECF2E;  --lime-soft: #E7F7D7;
  --laiton: #B7861A;  --laiton-soft: #FEF3C7;
  --terracotta: #B91C1C;  --terracotta-soft: #FEE2E2;
  --miel: #B7861A;  --miel-soft: #FEF3C7;
  --sarcelle: #2A7D77;  --sarcelle-soft: #DBEDEB;
  --filet: #E6EBE3;  --filet-soft: #EEF2EC;  --filet-fort: #D4E4C8;

  /* Tokens fonctionnels (noms conservés pour le JS) */
  --bg-page: #F7F9F7;  --bg-card: #FFFFFF;  --bg-sidebar: #FFFFFF;  --bg-soft: #FAFBF9;  --bg-tint: #EBF5E6;
  --border: #E6EBE3;  --border-soft: #EEF2EC;  --border-tint: #E8F0E4;  --border-strong: #D4E4C8;
  --ink: #0D1A0A;  --ink-2: #3F5A36;  --ink-3: #5C7A52;  --ink-4: #8AA17F;
  --green-900: #0F2A1B;  --green-800: #1A3A2A;  --green-700: #2D6A4F;  --green-600: #3F8A5E;

  /* Statut (palette vive Platform) */
  --success-bg: #D1FAE5;  --success-fg: #065F46;
  --warning-bg: #FEF3C7;  --warning-fg: #92400E;
  --neutral-bg: #F3F4F6;  --neutral-fg: #6B7280;
  --info-bg: #DBEAFE;     --info-fg: #1E40AF;
  --danger-bg: #FEE2E2;   --danger-fg: #991B1B;
  --premium-bg: #FEF3C7;  --premium-fg: #92400E;

  /* Notes RSE A→E : vert performant → ambre → rouge critique */
  --note-a: #2D6A4F;  --note-a-bg: #D8F0E4;
  --note-b: #4E9A52;  --note-b-bg: #E4F3DC;
  --note-c: #B7861A;  --note-c-bg: #FBEFC9;
  --note-d: #C2611C;  --note-d-bg: #FBE2CE;
  --note-e: #B91C1C;  --note-e-bg: #FBD9D9;
  --note-nd: #8AA17F; --note-nd-bg: #EEF2EC;

  /* Palette catégorielle (séries) — 8 teintes ancrées vert/lime */
  --cat-1: #1A3A2A;  --cat-2: #2D6A4F;  --cat-3: #7ECF2E;  --cat-4: #2A7D77;
  --cat-5: #4F6F86;  --cat-6: #B7861A;  --cat-7: #C2611C;  --cat-8: #8AA17F;

  /* Sémantique financière */
  --fin-capex: #C2611C;  --fin-aide: var(--green-700);  --fin-eco: var(--green-600);  --fin-net: var(--green-900);

  /* Typographie (plus de serif — Inter partout) */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Radii (Platform) */
  --r-card: 8px;  --r-btn: 6px;  --r-badge: 4px;  --r-pill: 999px;

  /* Ombres (Platform) */
  --shadow-card: 0 1px 4px rgba(13,26,10,0.06);
  --shadow-pop:  0 4px 18px rgba(13,26,10,0.08);
  --shadow-modal: 0 12px 40px rgba(13,26,10,0.14);
  --shadow-lg:   0 18px 44px rgba(13,26,10,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 88% -4%, rgba(126,207,46,0.05), transparent 42%),
    radial-gradient(circle at 2% 100%, rgba(26,58,42,0.035), transparent 38%),
    var(--bg-page);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  font-feature-settings: 'cv11', 'ss01';
}
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
a { color: inherit; }
::selection { background: rgba(126,207,46,0.28); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; width: 100%; min-height: 100vh; }

.sidebar {
  width: 252px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-tint);
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; text-decoration: none; }
.sb-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--canopee-800); display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: 0 2px 8px rgba(26,58,42,0.22); }
.sb-brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.sb-section-label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; padding: 16px 10px 8px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); font-weight: 500;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.sb-item:hover { background: var(--ivoire-2); color: var(--ink); }
.sb-item.active { background: var(--bg-tint); color: var(--canopee-800); font-weight: 600; border-color: var(--border-tint); }
.sb-item.active .sb-ic { color: var(--canopee-800); }
.sb-ic { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; display: grid; place-items: center; }
.sb-ic i { font-size: 17px; }
.sb-item .sb-count { margin-left: auto; font-size: 11px; color: var(--ink-4); background: var(--ivoire-2); padding: 1px 7px; border-radius: 999px; font-weight: 600; font-family: var(--font-data); }
.sb-item.active .sb-count { background: rgba(26,58,42,0.10); color: var(--canopee-800); }
.sb-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; text-decoration: none; }
.sb-user:hover { background: var(--ivoire-2); }
.sb-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--canopee-800); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
.sb-user-info { display: flex; flex-direction: column; min-width: 0; }
.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-email { font-size: 11px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: rgba(255,253,247,0.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 16px; flex-shrink: 0;
  position: sticky; top: 0; z-index: 40;
}
.crumb { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.crumb a { text-decoration: none; color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }
.crumb-current { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--border-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.content { flex: 1; padding: 28px 34px 64px; max-width: 1520px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 24px; flex-wrap: wrap; }
.page-pretitle { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--canopee-700); font-weight: 600; margin-bottom: 8px; }
.page-title { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); line-height: 1.08; }
.page-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }
.page-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--r-btn); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .16s;
}
.btn:active { transform: translateY(0.5px); }
.btn i { font-size: 16px; }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-primary { background: var(--canopee-800); color: #fff; box-shadow: 0 2px 10px rgba(26,58,42,0.20); }
.btn-primary:hover { background: var(--canopee-900); }
.btn-secondary { background: var(--bg-card); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--ivoire-2); border-color: var(--ink-4); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--ivoire-2); color: var(--ink); }
.btn-danger { background: var(--terracotta); color: #fff; }
.btn-danger:hover { background: #88341A; }
.btn-outline-success { background: var(--bg-card); color: var(--canopee-700); border-color: var(--border-strong); }
.btn-outline-success:hover { background: var(--bg-tint); }
.btn-outline-danger { background: var(--bg-card); color: var(--terracotta); border-color: #E3C8BC; }
.btn-outline-danger:hover { background: var(--terracotta-soft); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-badge); white-space: nowrap; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success-fg); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-info    { background: var(--info-bg);    color: var(--info-fg); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.badge-lime    { background: var(--lime-soft);  color: #3D6A0E; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-data); font-size: 11px; letter-spacing: .02em; padding: 5px 11px; border-radius: var(--r-pill); font-weight: 600; }
.pill.ok   { background: var(--success-bg); color: var(--success-fg); }
.pill.warn { background: var(--warning-bg); color: var(--warning-fg); }
.pill.bad  { background: var(--danger-bg);  color: var(--danger-fg); }
.pill.info { background: var(--info-bg);     color: var(--info-fg); }

.segmented { display: inline-flex; background: var(--ivoire-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented > button { font: inherit; font-size: 12px; font-weight: 500; color: var(--ink-3); border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.segmented > button.active { background: var(--bg-card); color: var(--ink); box-shadow: var(--shadow-card); font-weight: 600; }

/* ============================================================
   GRID & CARDS
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }
.mt-row { margin-top: 18px; }

.card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.viz { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 20px 22px; min-width: 0; }
.viz.pad-lg { padding: 24px 26px; }
.vhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.vhead-left { min-width: 0; }
.vtitle { font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.vtitle i { color: var(--canopee-700); font-size: 17px; }
.vsub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.vcap { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; line-height: 1.55; }
.vcap b { color: var(--ink-2); font-weight: 600; }

/* ============================================================
   KPI cards — la note d'abord, le chiffre en laiton/Fraunces
   ============================================================ */
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi { position: relative; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r-card); padding: 18px; overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 12px; transition: transform .18s, box-shadow .18s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.kpi .wash { position: absolute; inset: 0 0 auto 0; height: 88px; opacity: 0.09; pointer-events: none; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; position: relative; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.kpi-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-tint); color: var(--canopee-800); display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic i { font-size: 15px; }
.kpi-core { display: flex; align-items: center; gap: 14px; position: relative; }
.kpi-grade { width: 58px; height: 58px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; color: #fff; line-height: 1; font-family: var(--font-display); font-size: 33px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,0.22); }
.kpi-valwrap { min-width: 0; }
.kpi-value { font-family: var(--font-display); font-size: 27px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); line-height: 1.05; white-space: nowrap; }
.kpi-value small { font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.kpi-delta { font-family: var(--font-data); font-size: 11px; margin-top: 6px; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.kpi-delta.good { color: var(--note-a); } .kpi-delta.bad { color: var(--note-e); } .kpi-delta.flat { color: var(--ink-3); }
.gauge5 { display: flex; gap: 3px; }
.gauge5 .s { flex: 1; height: 7px; border-radius: 2px; opacity: 0.28; }
.gauge5 .s.on { opacity: 1; height: 9px; margin-top: -1px; box-shadow: 0 1px 5px rgba(0,0,0,0.16); }
.gscale { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: 8.5px; color: var(--ink-4); margin-top: 4px; letter-spacing: .05em; }

.kpi-mini { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.kpi-mini-top { display: flex; align-items: center; gap: 8px; }
.kpi-mini-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-tint); color: var(--canopee-800); display: grid; place-items: center; flex-shrink: 0; }
.kpi-mini-ic i { font-size: 15px; }
.kpi-mini-label { font-size: 11.5px; color: var(--ink-3); font-weight: 500; line-height: 1.25; }
.kpi-mini-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); line-height: 1; white-space: nowrap; }
.kpi-mini-value small { font-family: var(--font-ui); font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi-mini-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.trend-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.trend-chip.good { background: var(--success-bg); color: var(--success-fg); }
.trend-chip.bad  { background: var(--danger-bg);  color: var(--danger-fg); }
.trend-chip.flat { background: var(--neutral-bg); color: var(--neutral-fg); }

.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-tile { background: var(--ivoire-2); border: 1px solid var(--border-soft); border-radius: 9px; padding: 13px 15px; }
.stat-tile-label { font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; }
.stat-tile-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.stat-tile-value small { font-family: var(--font-ui); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.stat-tile-sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.grade-badge { display: inline-grid; place-items: center; border-radius: 8px; font-family: var(--font-display); font-weight: 600; color: #fff; width: 30px; height: 30px; font-size: 17px; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,0.20); }

/* Hero RSE */
.hero-rse { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: center; }
@media (max-width: 900px) { .hero-rse { grid-template-columns: 1fr; } }
.gauge-wrap { text-align: center; }
.gauge-niveau { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.gauge-niveau-desc { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; max-width: 240px; margin-left: auto; margin-right: auto; }

/* ============================================================
   Charts (SVG)
   ============================================================ */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.legend .it { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend .sw-d { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend .ln { width: 18px; height: 0; border-top-width: 3px; border-top-style: solid; flex-shrink: 0; }

.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-leg-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.donut-leg-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.donut-leg-name { color: var(--ink-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-leg-val { color: var(--ink); font-weight: 600; font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.donut-leg-pct { color: var(--ink-4); font-family: var(--font-data); font-variant-numeric: tabular-nums; width: 42px; text-align: right; }

.bench-row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.bench-row:last-child { border-bottom: 0; }
.bench-label-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.bench-label-unit { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; font-family: var(--font-data); }
.bench-track { position: relative; height: 26px; background: var(--ivoire-2); border-radius: 7px; }
.bench-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 7px; }
.bench-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 3px; }
.bench-marker-lbl { position: absolute; top: -16px; transform: translateX(-50%); font-size: 9px; color: var(--ink-3); white-space: nowrap; font-weight: 700; }
.bench-verdict { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.bench-verdict-delta { font-size: 12.5px; font-weight: 700; font-family: var(--font-data); font-variant-numeric: tabular-nums; }

.decret-track-wrap { position: relative; padding: 44px 8px 30px; }
.decret-bar { position: relative; height: 8px; background: var(--bg-tint); border-radius: 999px; }
.decret-bar-done { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--canopee-700), var(--lime)); }
.decret-ms { position: absolute; top: -3px; transform: translateX(-50%); }
.decret-ms-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--bg-card); border: 2.5px solid var(--border-strong); }
.decret-ms.reached .decret-ms-dot { border-color: var(--canopee-700); background: var(--canopee-700); }
.decret-ms.current .decret-ms-dot { border-color: var(--canopee-800); background: var(--bg-card); box-shadow: 0 0 0 4px rgba(26,58,42,0.12); }
.decret-ms-year { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-family: var(--font-data); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.decret-ms-target { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-family: var(--font-data); font-size: 10px; color: var(--ink-3); white-space: nowrap; text-align: center; }
.decret-ms-target b { display: block; color: var(--ink); font-weight: 700; font-size: 11px; }

/* ============================================================
   Texte IA / bandeaux
   ============================================================ */
.ai-text { font-size: 13.5px; line-height: 1.68; color: var(--ink-2); }
.ai-banner { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(118deg, var(--voile-canopee) 0%, #F3F8EC 100%); border: 1px solid var(--border-tint); border-radius: 11px; padding: 16px 18px; }
.ai-banner-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--canopee-800); color: var(--lime); display: grid; place-items: center; flex-shrink: 0; }
.ai-banner-ic i { font-size: 18px; }
.ai-banner-title { font-size: 13px; font-weight: 700; color: var(--canopee-900); }
.ai-banner-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; }

.pts-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.pts-list li { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.pts-list li i { flex-shrink: 0; font-size: 15px; margin-top: 1px; }
.pts-list.good li i { color: var(--note-a); }
.pts-list.bad li i  { color: var(--note-e); }

/* ============================================================
   Alertes
   ============================================================ */
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-card); border-left-width: 3px; }
.alert-item + .alert-item { margin-top: 10px; }
.alert-item.sev-5, .alert-item.sev-4 { border-left-color: var(--terracotta); background: #FEF2F2; }
.alert-item.sev-3 { border-left-color: var(--miel); background: #FFFBEB; }
.alert-item.sev-2, .alert-item.sev-1 { border-left-color: var(--ink-4); }
.alert-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.alert-item.sev-5 .alert-ic, .alert-item.sev-4 .alert-ic { background: var(--danger-bg); color: var(--danger-fg); }
.alert-item.sev-3 .alert-ic { background: var(--warning-bg); color: var(--warning-fg); }
.alert-item.sev-2 .alert-ic, .alert-item.sev-1 .alert-ic { background: var(--neutral-bg); color: var(--neutral-fg); }
.alert-body { flex: 1; min-width: 0; }
.alert-msg { font-size: 12.5px; color: var(--ink); font-weight: 500; line-height: 1.45; }
.alert-action { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.alert-meta { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* ============================================================
   Tables
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--ivoire-2); }
.table thead th.num { text-align: right; }
.table thead th.center { text-align: center; }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); color: var(--ink-2); vertical-align: middle; }
.table tbody td.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.table tbody td.center { text-align: center; }
.table tbody tr:hover td { background: var(--ivoire-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-strong { color: var(--ink); font-weight: 600; }
/* Icône d'aide au survol des libellés */
.help-i { font-size: 12px; color: var(--ink-4); cursor: help; vertical-align: middle; opacity: 0.65; transition: opacity .12s, color .12s; }
.help-i:hover { opacity: 1; color: var(--canopee-700); }
/* Pied de tableau : ligne de total annuel */
.table tfoot td { padding: 13px 14px; border-top: 2px solid var(--border); color: var(--ink); font-weight: 700; background: var(--ivoire-2); }
.table tfoot td.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
/* Variante compacte pour les tableaux à nombreuses colonnes */
.table-monthly { font-size: 12px; }
.table-monthly thead th { padding: 9px 10px; }
.table-monthly tbody td, .table-monthly tfoot td { padding: 10px 10px; }

/* ============================================================
   Plan d'action
   ============================================================ */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.plan-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.plan-stat-label { font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.plan-stat-value { font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-top: 4px; }
.plan-stat-value.eco { color: var(--canopee-700); }
.progress { height: 6px; width: 100%; background: var(--border-tint); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--canopee-700), var(--lime)); border-radius: 999px; transition: width .4s; }

.action-card { display: grid; grid-template-columns: 38px 1fr auto; gap: 14px; padding: 16px 18px; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--bg-card); box-shadow: var(--shadow-card); align-items: start; transition: box-shadow .18s, border-color .18s; }
.action-card:hover { box-shadow: var(--shadow-pop); border-color: var(--border); }
.action-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-tint); color: var(--canopee-800); display: grid; place-items: center; }
.action-icon i { font-size: 19px; }
.action-main { min-width: 0; }
.action-title { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.action-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.action-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.action-metrics { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.action-metric { display: flex; flex-direction: column; gap: 2px; }
.action-metric-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-4); font-weight: 600; }
.action-metric-value { font-family: var(--font-data); font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.action-metric-value.eco { color: var(--canopee-700); }
.action-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.prio-dot { width: 7px; height: 7px; border-radius: 50%; }
.prio.high .prio-dot { background: var(--terracotta); } .prio.high { color: var(--terracotta); }
.prio.med .prio-dot  { background: var(--miel); } .prio.med  { color: var(--warning-fg); }
.prio.low .prio-dot  { background: var(--ink-4); } .prio.low { color: var(--ink-3); }
.roi-bar { display: inline-block; width: 60px; height: 5px; border-radius: 999px; background: var(--bg-tint); position: relative; vertical-align: middle; }
.roi-bar > span { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; background: var(--canopee-600); }
.att-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--ivoire-2); border: 1px solid var(--border-soft); color: var(--ink-2); }
.att-chip a { text-decoration: none; color: var(--canopee-700); font-weight: 500; }
.att-chip .att-del { cursor: pointer; color: var(--ink-4); }
.att-chip .att-del:hover { color: var(--danger-fg); }

/* ============================================================
   Tooltip premium
   ============================================================ */
.tip { position: fixed; pointer-events: none; z-index: 600; opacity: 0; transform: translateY(4px); transition: opacity .14s, transform .14s; background: linear-gradient(180deg, #1F3A2C, #122017); color: #fff; border: 1px solid rgba(255,255,255,0.10); border-radius: 11px; box-shadow: var(--shadow-lg); min-width: 150px; overflow: hidden; }
.tip .t-head { padding: 9px 13px 7px; border-bottom: 1px solid rgba(255,255,255,0.10); display: flex; align-items: center; gap: 8px; }
.tip .t-head .dot { width: 9px; height: 9px; border-radius: 3px; }
.tip .t-head .ttl { font-weight: 600; font-size: 13px; }
.tip .t-body { padding: 9px 13px 11px; display: flex; flex-direction: column; gap: 5px; }
.tip .t-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; font-family: var(--font-data); font-size: 11.5px; color: rgba(255,255,255,0.7); }
.tip .t-row .v { color: #fff; font-weight: 500; }
.tip .t-big { font-family: var(--font-display); font-size: 22px; color: #fff; }
.tip .t-big small { font-size: 12px; color: rgba(255,255,255,0.65); font-family: var(--font-ui); }
svg .hit { cursor: pointer; }

/* ============================================================
   États
   ============================================================ */
.state-center { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px; }
.state-center h2 { font-family: var(--font-display); font-weight: 600; }
.spinner { width: 42px; height: 42px; border: 3px solid var(--border-tint); border-top-color: var(--canopee-700); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade .26s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab-pane.active { animation: none; } }

.empty-hint { font-size: 12.5px; color: var(--ink-4); padding: 14px; text-align: center; font-style: italic; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,28,18,0.42); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 800; padding: 24px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-card); border-radius: 15px; box-shadow: var(--shadow-modal); width: 560px; max-width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-header h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.modal-close { cursor: pointer; color: var(--ink-4); background: none; border: 0; font-size: 22px; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-input, .field-select, textarea.field-input { width: 100%; padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--ivoire-1); border: 1px solid var(--border-strong); border-radius: var(--r-btn); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.field-input:focus, .field-select:focus { border-color: var(--canopee-700); box-shadow: 0 0 0 3px rgba(45,106,79,0.14); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { font-size: 11.5px; color: var(--ink-3); }

/* Focus visible clavier (accessibilité de base) */
:focus-visible { outline: 2px solid var(--canopee-700); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   BENCHMARK — Configurateur de panel CHSB
   ============================================================ */

/* Layout global : panneau gauche fixe + résultats droite */
.bm-layout { display: grid; grid-template-columns: 296px 1fr; gap: 18px; align-items: start; }
.bm-panel  { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.bm-results { display: flex; flex-direction: column; gap: 18px; }
.bm-results-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-4); font-size: 13px; padding: 64px 0; }

/* Compteur principal */
.bm-counter { background: var(--bg-tint); border: 1px solid var(--border-tint); border-radius: var(--r-card); padding: 20px 18px 16px; text-align: center; }
.bm-counter-num { font-family: var(--font-data); font-size: 42px; font-weight: 700; color: var(--green-800); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-height: 42px; display: flex; align-items: center; justify-content: center; }
.bm-counter-label { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.1em; }
.bm-counter-src { font-size: 10px; color: var(--ink-4); margin-top: 4px; }

/* Spinner inline */
.bm-spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid rgba(45,106,79,0.25); border-top-color: var(--green-700); border-radius: 50%; animation: bm-spin .8s linear infinite; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
.bm-spin { animation: bm-spin .9s linear infinite; }

/* Sections de filtre */
.bm-filter-section { display: flex; flex-direction: column; gap: 7px; }
.bm-filter-heading { font-size: 11.5px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: 0.09em; display: flex; align-items: center; gap: 6px; }
.bm-filter-heading i { color: var(--green-700); font-size: 14px; flex-shrink: 0; }
.bm-sel-badge { font-size: 10px; font-weight: 600; background: var(--success-bg); color: var(--success-fg); padding: 2px 7px; border-radius: var(--r-badge); margin-left: auto; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-filter-desc { font-size: 11.5px; color: var(--ink-4); line-height: 1.5; }

/* Barre de recherche */
.bm-search-wrap { position: relative; }
.bm-search-ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-size: 13px; pointer-events: none; }
.bm-search { width: 100%; padding: 6px 10px 6px 29px; border: 1px solid var(--border); border-radius: var(--r-card); font-size: 12.5px; font-family: var(--font-ui); background: var(--bg-card); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.bm-search:focus { border-color: var(--green-700); box-shadow: 0 0 0 2px rgba(45,106,79,0.12); }

/* Liste scrollable des géographies */
.bm-options-scroll { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--r-card); background: var(--ivoire-2); scrollbar-width: thin; }

/* Groupe de géographies */
.bm-geo-group { padding: 2px 0; }
.bm-geo-group-hd { font-size: 9.5px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.11em; padding: 8px 10px 3px; display: flex; align-items: center; gap: 5px; }
.bm-geo-group-hd i { font-size: 11px; }

/* Option (géo ou segment) */
.bm-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid transparent; border-radius: 5px; margin: 1px 4px; background: none; cursor: pointer; text-align: left; width: calc(100% - 8px); transition: background .13s, border-color .13s; }
.bm-opt:hover { background: var(--bg-card); border-color: var(--border); }
.bm-opt--on { background: var(--success-bg) !important; border-color: var(--success-fg) !important; }
.bm-opt--on .bm-opt-lbl { color: var(--success-fg); font-weight: 700; }
.bm-opt--dim { opacity: 0.38; cursor: not-allowed; }
.bm-opt-lbl { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.bm-opt-cnt { font-family: var(--font-data); font-size: 10px; color: var(--ink-4); background: var(--neutral-bg); padding: 2px 7px; border-radius: var(--r-badge); flex-shrink: 0; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.bm-opt-cnt--warn { background: var(--warning-bg); color: var(--warning-fg); }
.bm-opt-cnt--na { background: none; }
.bm-hl { background: rgba(126,207,46,0.30); color: inherit; border-radius: 2px; font-style: normal; }

/* Liste des segments (sans scroll — tous visibles) */
.bm-options-list { display: flex; flex-direction: column; gap: 2px; }
.bm-seg-opt { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--border-soft); border-radius: var(--r-card); background: var(--bg-card); cursor: pointer; text-align: left; width: 100%; transition: background .13s, border-color .13s; }
.bm-seg-opt:hover:not([disabled]) { background: var(--ivoire-2); border-color: var(--border); }
.bm-seg-opt.bm-opt--on { background: var(--success-bg) !important; border-color: var(--success-fg) !important; }
.bm-seg-opt.bm-opt--on .bm-opt-lbl { color: var(--success-fg); font-weight: 700; }
.bm-seg-opt.bm-opt--on .bm-seg-ic { color: var(--success-fg); }
.bm-seg-opt[disabled] { opacity: 0.32; cursor: not-allowed; }
.bm-seg-group-header { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 12px 4px 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 2px; }
.bm-seg-group-header:first-child { padding-top: 2px; }
.bm-seg-group-header i { font-size: 12px; }
.bm-seg-inner { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; }
.bm-seg-ic { font-size: 15px; color: var(--ink-3); margin-top: 1px; flex-shrink: 0; }
.bm-seg-text { display: flex; flex-direction: column; gap: 2px; }
.bm-seg-desc { font-size: 10.5px; color: var(--ink-4); line-height: 1.4; }

/* Utilitaires */
.bm-loading-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-4); padding: 10px 10px; }
.bm-empty-row { font-size: 12px; color: var(--ink-4); padding: 10px 10px; }
.bm-fallback-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--warning-fg); background: var(--warning-bg); border: 1px solid rgba(146,64,14,0.2); border-radius: var(--r-card); padding: 10px 14px; }

/* Responsive benchmark */
@media (max-width: 1100px) {
  .bm-layout { grid-template-columns: 260px 1fr; }
}
@media (max-width: 900px) {
  .bm-layout { grid-template-columns: 1fr; }
  .bm-panel  { position: static; max-height: none; }
  .bm-options-scroll { max-height: 180px; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .span-2, .span-3, .span-4 { grid-template-columns: 1fr; grid-column: auto; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 18px 48px; }
}
@media (max-width: 680px) {
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 25px; }
}
