/* Pilotage Marketing — identité Skarlett : beige floral, vert sapin, vert citron, bleu givré.
   Typographies : Skarlett Americane (titres), Manrope (texte et chiffres). Touches de « liquid glass ». */

@font-face { font-family: 'Manrope'; src: url('/assets/fonts/Manrope-Variable.ttf') format('truetype'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Skarlett Americane'; src: url('/assets/fonts/SkarlettAmericane-Black.woff2') format('woff2'), url('/assets/fonts/SkarlettAmericane-Black.woff') format('woff'); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  /* Marque */
  --sapin: #19392E; --sapin-2: #12543E; --citron: #B2FF8D; --givre: #9AFFFF; --beige: #FFFEF6; --beige-2: #F6F4EA;

  --page: #F6F4EA;
  --surface: #FFFEF6;
  --surface-2: #FAF9F0;
  --surface-3: #EEECDF;
  --ink: #19392E;
  --ink-2: #4E6359;
  --muted: #84948C;
  --grid: #EAE8DC;
  --axis: #D2CFBF;
  --border: rgba(25, 57, 46, 0.08);
  --border-strong: rgba(25, 57, 46, 0.16);
  --shadow: 0 1px 2px rgba(25, 57, 46, 0.04), 0 18px 40px -22px rgba(25, 57, 46, 0.22);
  --shadow-pop: 0 24px 60px -18px rgba(25, 57, 46, 0.32), 0 6px 18px -6px rgba(25, 57, 46, 0.12);

  /* Données : réalisé = sapin, prévu = neutre, mise en avant = citron */
  --accent: #12543E;
  --accent-strong: #19392E;
  --accent-soft: #E3EEDB;
  --accent-wash: rgba(178, 255, 141, 0.32);
  --area-top: rgba(178, 255, 141, 0.75);
  --area-bottom: rgba(178, 255, 141, 0.04);
  --plan: #A7B3AB;
  --plan-fill: #E6E6D8;
  --ramp-1: #8CCB9F; --ramp-2: #4E9B74; --ramp-3: #2E7A59; --ramp-4: #12543E; --ramp-5: #19392E;
  --div-neg: #D24E3E; --div-mid: #F1EFE3; --div-pos: #12543E;

  /* Volets */
  --c1: #12543E; --c2: #1FA9B0; --c3: #6DBF45; --c4: #B4A57A; --c5: #8E86C9; --c6: #19392E; --c7: #4a3aa7; --c8: #e34948;

  /* Statuts (toujours avec icône + libellé) */
  --good: #22A05C; --warning: #E5A119; --serious: #E8794E; --critical: #D24E3E;
  --good-text: #17784A; --critical-text: #B23A2C; --warning-text: #835800;
  --good-wash: rgba(34, 160, 92, 0.12); --warning-wash: rgba(229, 161, 25, 0.16); --critical-wash: rgba(210, 78, 62, 0.11); --neutral-wash: rgba(25, 57, 46, 0.06);

  /* Verre */
  --glass: linear-gradient(155deg, rgba(255, 254, 246, 0.82), rgba(255, 254, 246, 0.56));
  --glass-solid: rgba(255, 254, 246, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(25, 57, 46, 0.04), 0 28px 60px -24px rgba(25, 57, 46, 0.34), 0 6px 16px -6px rgba(25, 57, 46, 0.10);
  --blob-1: rgba(178, 255, 141, 0.55); --blob-2: rgba(154, 255, 255, 0.50); --blob-3: rgba(178, 255, 141, 0.28);

  --radius: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Skarlett Americane', 'Manrope', system-ui, sans-serif;
  --sidebar-w: 264px;
  --sidebar-collapsed: 80px;
  --gutter: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0C1F18; --surface: #132C23; --surface-2: #17342A; --surface-3: #1F4035;
    --ink: #FFFEF6; --ink-2: #C7D5CC; --muted: #8DA699; --grid: #21423A; --axis: #2D5246;
    --border: rgba(255, 254, 246, 0.08); --border-strong: rgba(255, 254, 246, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 18px 40px -22px rgba(0, 0, 0, 0.6); --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
    --accent: #B2FF8D; --accent-strong: #D8FFC6; --accent-soft: #25493D; --accent-wash: rgba(178, 255, 141, 0.14);
    --area-top: rgba(178, 255, 141, 0.42); --area-bottom: rgba(178, 255, 141, 0.02);
    --plan: #6F8B7F; --plan-fill: #29483D;
    --ramp-1: #2F5A49; --ramp-2: #3F7A5E; --ramp-3: #62A97D; --ramp-4: #92D68A; --ramp-5: #B2FF8D;
    --div-mid: #24443A; --div-pos: #8EE36C;
    --c1: #B2FF8D; --c2: #9AFFFF; --c3: #6FD37F; --c4: #D6C79A; --c5: #B3ACEB;
    --good-text: #6FE09E; --critical-text: #FF9B8C; --warning-text: #FFC75C;
    --neutral-wash: rgba(255, 254, 246, 0.07);
    --glass: linear-gradient(155deg, rgba(25, 57, 46, 0.78), rgba(19, 44, 35, 0.56)); --glass-solid: rgba(22, 50, 40, 0.9); --glass-edge: rgba(255, 254, 246, 0.12);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 28px 60px -24px rgba(0, 0, 0, 0.7);
    --blob-1: rgba(178, 255, 141, 0.12); --blob-2: rgba(154, 255, 255, 0.10); --blob-3: rgba(18, 84, 62, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0C1F18; --surface: #132C23; --surface-2: #17342A; --surface-3: #1F4035;
  --ink: #FFFEF6; --ink-2: #C7D5CC; --muted: #8DA699; --grid: #21423A; --axis: #2D5246;
  --border: rgba(255, 254, 246, 0.08); --border-strong: rgba(255, 254, 246, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 18px 40px -22px rgba(0, 0, 0, 0.6); --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
  --accent: #B2FF8D; --accent-strong: #D8FFC6; --accent-soft: #25493D; --accent-wash: rgba(178, 255, 141, 0.14);
  --area-top: rgba(178, 255, 141, 0.42); --area-bottom: rgba(178, 255, 141, 0.02);
  --plan: #6F8B7F; --plan-fill: #29483D;
  --ramp-1: #2F5A49; --ramp-2: #3F7A5E; --ramp-3: #62A97D; --ramp-4: #92D68A; --ramp-5: #B2FF8D;
  --div-mid: #24443A; --div-pos: #8EE36C;
  --c1: #B2FF8D; --c2: #9AFFFF; --c3: #6FD37F; --c4: #D6C79A; --c5: #B3ACEB;
  --good-text: #6FE09E; --critical-text: #FF9B8C; --warning-text: #FFC75C;
  --neutral-wash: rgba(255, 254, 246, 0.07);
  --glass: linear-gradient(155deg, rgba(25, 57, 46, 0.78), rgba(19, 44, 35, 0.56)); --glass-solid: rgba(22, 50, 40, 0.9); --glass-edge: rgba(255, 254, 246, 0.12);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 28px 60px -24px rgba(0, 0, 0, 0.7);
  --blob-1: rgba(178, 255, 141, 0.12); --blob-2: rgba(154, 255, 255, 0.10); --blob-3: rgba(18, 84, 62, 0.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 500 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
/* Champs de couleur diffus derrière le verre */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(42vmax 42vmax at 4% 0%, var(--blob-1), transparent 62%), radial-gradient(38vmax 38vmax at 100% 6%, var(--blob-2), transparent 60%), radial-gradient(50vmax 40vmax at 72% 108%, var(--blob-3), transparent 64%); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-title); font-weight: 900; letter-spacing: 0.005em; line-height: 1.05; }
p { margin: 0; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--sapin-2); outline-offset: 2px; border-radius: 8px; }
[data-theme="dark"] :focus-visible { outline-color: var(--citron); }
::selection { background: var(--citron); color: var(--sapin); }

/* ---------- Structure : menu flottant rétractable ---------- */
.app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; top: var(--gutter); left: var(--gutter); bottom: var(--gutter); width: var(--sidebar-w); display: flex; flex-direction: column; padding: 22px 14px 14px; border-radius: 30px;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); transition: width 0.28s cubic-bezier(.2,.8,.2,1), transform 0.28s cubic-bezier(.2,.8,.2,1); }
.sidebar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 50% at 0% 0%, rgba(255, 255, 255, 0.55), transparent 55%); mix-blend-mode: soft-light; }
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.sidebar-scroll::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; min-height: 54px; padding: 0 10px 12px; text-decoration: none; min-width: 0; border-radius: 14px; }
.brand-logo { height: 42px; width: auto; max-width: 100%; }
.brand-mark { display: none; width: 44px; height: auto; margin: 0 auto; filter: drop-shadow(0 8px 12px rgba(18, 84, 62, 0.22)); }
/* Logo à texte noir sur fond clair, à texte blanc sur fond sombre */
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-on-light { display: none; } :root:not([data-theme="light"]) .logo-on-dark { display: block; } }
.nav-group { margin: 14px 0 5px; padding: 0 12px; font-size: 10.5px; color: var(--muted); letter-spacing: 0.09em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--neutral-wash); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--sapin); color: var(--beige); box-shadow: 0 8px 18px -10px rgba(25, 57, 46, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
.nav a[aria-current="page"] .ico { color: var(--citron); opacity: 1; }
[data-theme="dark"] .nav a[aria-current="page"] { background: var(--citron); color: var(--sapin); }
[data-theme="dark"] .nav a[aria-current="page"] .ico { color: var(--sapin); }
.nav a .ico { width: 19px; height: 19px; flex: none; opacity: 0.85; }
.nav a .lbl { overflow: hidden; text-overflow: ellipsis; }
.collapse-btn { position: absolute; top: 50%; right: -15px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(25, 57, 46, 0.35); transform: translateY(-50%); z-index: 2; }
.collapse-btn:hover { color: var(--ink); background: var(--surface-2); }
.collapse-btn svg { width: 15px; height: 15px; transition: transform 0.25s; }
.sidebar-foot { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.presence { display: flex; align-items: center; gap: 10px; padding: 4px 8px; min-height: 34px; border-radius: 14px; text-decoration: none; }
.presence:hover { background: var(--neutral-wash); }
.presence-label { font-size: 12px; color: var(--ink-2); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }
.sync-box { position: relative; display: grid; gap: 2px; padding: 10px 12px; border-radius: 16px; background: var(--neutral-wash); font-size: 12px; }
.sync-line { display: flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; }
.sync-line .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sync-refresh { width: 28px; height: 28px; margin: -5px -6px -5px 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.sync-refresh:hover { background: var(--surface); color: var(--ink); }
.sync-refresh svg { width: 15px; height: 15px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px var(--good-wash); }
.sync-dot.syncing { background: var(--sapin-2); animation: pulse 1.2s ease-in-out infinite; }
.sync-dot.error { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-wash); }
@keyframes pulse { 50% { opacity: 0.35; } }
.sync-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sync-actions { display: flex; gap: 6px; margin-top: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 16px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.user-chip:hover { background: var(--neutral-wash); }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.user-chip .chev { width: 16px; height: 16px; color: var(--muted); flex: none; }

.presence, .user-chip { position: relative; }

/* Menu replié (écran large) : icônes seules, libellés en infobulle */
@media (min-width: 901px) {
  .app.collapsed .sidebar { width: var(--sidebar-collapsed); padding-left: 12px; padding-right: 12px; }
  .app.collapsed .nav a .lbl, .app.collapsed .presence-label, .app.collapsed .sync-sub, .app.collapsed .user-chip .who, .app.collapsed .user-chip .chev, .app.collapsed .sync-line .t, .app.collapsed .sync-refresh { display: none; }
  .app.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.collapsed .brand .brand-logo { display: none !important; }
  .app.collapsed .brand-mark { display: block; }
  .app.collapsed .nav a { justify-content: center; padding: 0; }
  .app.collapsed .nav-group { height: 1px; margin: 12px 12px; padding: 0; background: var(--border); font-size: 0; }
  .app.collapsed .collapse-btn svg { transform: rotate(180deg); }
  .app.collapsed .presence, .app.collapsed .user-chip { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.collapsed .avatars .avatar:nth-child(n+3) { display: none; }
  .app.collapsed .sync-box { padding: 12px 0; justify-items: center; }
  .app.collapsed .sync-line { justify-content: center; }
  .app.collapsed .sidebar [data-label]:hover::after, .app.collapsed .sidebar [data-label]:focus-visible::after { content: attr(data-label); position: absolute; left: calc(100% + 18px); top: 50%; transform: translateY(-50%); padding: 7px 12px; border-radius: 10px; background: var(--sapin); color: var(--beige); font: 700 12.5px/1.3 var(--font); white-space: nowrap; box-shadow: var(--shadow-pop); pointer-events: none; z-index: 5; }
  .app.collapsed .main { margin-left: calc(var(--sidebar-collapsed) + var(--gutter) * 2); }
}
:root[data-theme="dark"] .app.collapsed .sidebar [data-label]:hover::after { background: var(--citron); color: var(--sapin); }

.main { margin-left: calc(var(--sidebar-w) + var(--gutter) * 2); min-width: 0; transition: margin-left 0.28s cubic-bezier(.2,.8,.2,1); }
.topbar { position: sticky; top: 0; z-index: 20; transition: background 0.2s, box-shadow 0.2s; }
.topbar.scrolled { background: color-mix(in srgb, var(--page) 72%, transparent); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 1px 0 var(--border); }
.topbar-in { max-width: 1480px; margin: 0 auto; padding: 30px 40px 22px 22px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; transition: padding 0.2s; }
.topbar.scrolled .topbar-in { padding-top: 14px; padding-bottom: 12px; align-items: center; }
.page-title { flex: 1 1 320px; min-width: 0; }
.page-title h1 { font-size: 44px; line-height: 0.96; text-transform: uppercase; letter-spacing: 0.01em; transition: font-size 0.2s; }
.topbar.scrolled .page-title h1 { font-size: 28px; }
.page-title .sub { color: var(--ink-2); margin-top: 10px; font-size: 13.5px; font-weight: 500; }
.topbar.scrolled .page-title .sub { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.menu-btn { display: none; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 6px 40px 80px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; transition: opacity 0.2s; }
.content.refreshing { opacity: 0.55; pointer-events: none; }

/* ---------- Grilles & bento ---------- */
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.bento { display: grid; gap: 22px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
.stack-col { display: grid; gap: 22px; align-content: start; grid-template-columns: minmax(0, 1fr); min-width: 0; }

/* ---------- Cartes ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; min-width: 0; }
.card.tight { padding: 22px 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card.glass { background: var(--glass); border-color: var(--glass-edge); box-shadow: var(--glass-shadow); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); }
.card.dark { background: radial-gradient(120% 120% at 100% 0%, #1F4A3B 0%, var(--sapin) 55%); color: var(--beige); border-color: rgba(255, 255, 255, 0.06); --ink: #FFFEF6; --ink-2: #C9D9CF; --muted: #93AE9F; --border: rgba(255, 254, 246, 0.10); --accent: #B2FF8D; --accent-soft: rgba(255, 254, 246, 0.12); --neutral-wash: rgba(255, 254, 246, 0.08); --surface: #19392E; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 22px; line-height: 1.05; }
.card-head .desc { color: var(--ink-2); font-size: 13px; margin-top: 7px; max-width: 72ch; font-weight: 500; }
.card-foot { margin-top: 18px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--sapin-2); font-weight: 800; font-size: 13px; text-decoration: none; transition: gap 0.15s; }
[data-theme="dark"] .card-link, .card.dark .card-link { color: var(--citron); }
.card-link:hover { gap: 9px; }
.card-link svg { width: 15px; height: 15px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 16px 2px -2px; flex-wrap: wrap; }
.section-title h2 { font-size: 30px; }
.section-title p { color: var(--ink-2); font-size: 13px; font-weight: 500; }
a.card { text-decoration: none; transition: transform 0.18s, box-shadow 0.18s; display: block; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }

/* ---------- Cartes de statistique (haut de page) ---------- */
.bento.top4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { display: flex; flex-direction: column; min-height: 236px; }
.stat-card.compact { min-height: 0; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-head.center { justify-content: center; }
.stat-card .t { font-family: var(--font-title); font-size: 22px; line-height: 1; }
.stat-card .big { display: flex; align-items: baseline; gap: 4px 12px; margin: 22px 0 10px; flex-wrap: wrap; }
.trend-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stat-card .big .v { font-size: clamp(34px, 2.7vw, 46px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.stat-card .big .v.v-sm { font-size: 30px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.trend svg { width: 19px; height: 19px; }
.trend.good { color: var(--good-text); } .trend.bad { color: var(--critical-text); } .trend.neutral { color: var(--ink-2); }
.stat-card .cap { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.stat-card .cap b { color: var(--ink); font-weight: 800; }
.stat-card .progress.sm { margin: 16px 0 2px; }
.stat-card .grow { flex: 1; min-height: 8px; }
.stat-card .card-link { margin-top: 14px; }
.mini-kv { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.mini-kv b { color: var(--ink); font-weight: 800; }
.card-link.center { align-self: center; }

/* ---------- Jauge ---------- */
:root { --gauge-a: #12543E; --gauge-b: #3FA36E; --gauge-track: #E3EEDB; }
:root[data-theme="dark"] { --gauge-a: #5CC27A; --gauge-b: #B2FF8D; --gauge-track: #25493D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gauge-a: #5CC27A; --gauge-b: #B2FF8D; --gauge-track: #25493D; } }
.gauge { position: relative; margin: 16px auto 0; width: 100%; max-width: 236px; }
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.gauge .g-val { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge .g-val strong { display: block; font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.gauge .g-val span { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.gauge-knob { fill: var(--citron); stroke: var(--sapin); stroke-width: 2.5; }
.gauge-legend { display: flex; justify-content: center; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); font-weight: 600; margin-top: 14px; }
.gauge-legend b { color: var(--ink); font-weight: 800; }
.gauge-legend .knob { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--citron); border: 2px solid var(--sapin); margin-right: 6px; vertical-align: -1px; }

/* ---------- Héros (cible) ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-label { color: var(--ink-2); font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-label .ttl { font-family: var(--font-title); font-weight: 900; font-size: 22px; color: var(--ink); }
.hero-figure { font-size: 62px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; margin: 20px 0 10px; }
.hero-figure .of { font-size: 22px; color: var(--muted); font-weight: 600; letter-spacing: -0.01em; }
.hero-caption { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-stats > div { padding: 16px 18px; border-radius: 18px; background: var(--neutral-wash); }
.stat-label { color: var(--ink-2); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.stat-note { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 600; }

/* ---------- Barre de progression vers la cible ---------- */
.progress { position: relative; margin: 54px 0 26px; }
.progress-track { position: relative; height: 16px; border-radius: 999px; background: var(--accent-soft); }
.progress.sm .progress-track { height: 8px; }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sapin-2), #2E8A63); min-width: 3px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .progress-fill, .card.dark .progress-fill { background: linear-gradient(90deg, #8EE36C, var(--citron)); }
.progress-marker { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--ink); border-radius: 1px; }
.progress.sm .progress-marker { top: -5px; bottom: -5px; }
.progress-marker::after { content: ""; position: absolute; left: -6px; top: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--citron); border: 2.5px solid var(--sapin); box-shadow: 0 2px 6px rgba(25, 57, 46, 0.3); }
.progress.sm .progress-marker::after { display: none; }
.progress-tag { position: absolute; top: -40px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.progress-tag strong { color: var(--ink); font-weight: 800; }
.progress-scale { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 700; }
.progress.sm { margin: 12px 0 8px; }

/* ---------- Statuts, écarts, badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--neutral-wash); color: var(--ink); font-family: var(--font); letter-spacing: 0; line-height: 1.4; }
.pill svg { width: 14px; height: 14px; flex: none; }
.pill.good { background: var(--good-wash); } .pill.good svg { color: var(--good); }
.pill.warning { background: var(--warning-wash); } .pill.warning svg { color: #C78A0C; }
.pill.serious { background: rgba(232, 121, 78, 0.16); } .pill.serious svg { color: var(--serious); }
.pill.critical { background: var(--critical-wash); } .pill.critical svg { color: var(--critical); }
.pill.neutral svg { color: var(--muted); }
.delta { font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.delta.good { color: var(--good-text); } .delta.bad { color: var(--critical-text); } .delta.neutral { color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); vertical-align: middle; }
.badge svg { width: 12px; height: 12px; color: #C78A0C; }
.badge.lime { background: var(--citron); color: var(--sapin); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch.line { width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }
.swatch.round { border-radius: 50%; }

/* ---------- Avatars ---------- */
.avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; background: var(--citron); color: var(--sapin); }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.c1 { background: var(--citron); color: var(--sapin); } .avatar.c2 { background: var(--givre); color: var(--sapin); } .avatar.c3 { background: var(--sapin); color: var(--citron); } .avatar.c4 { background: #E9E2C8; color: var(--sapin); } .avatar.c5 { background: var(--sapin-2); color: var(--beige); } .avatar.c6 { background: #CFF5BE; color: var(--sapin-2); }
.avatar .on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Tuiles KPI ---------- */
.kpis { display: grid; gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { color: var(--ink-2); font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin-top: 8px; }
.kpi-value .unit { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi-target { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; font-weight: 600; }
.kpi-foot { border-top: 1px dashed var(--border-strong); margin-top: 14px; }
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); cursor: help; flex: none; vertical-align: middle; }
.info:hover { color: var(--ink); }
.info svg { width: 16px; height: 16px; }

/* ---------- Boutons & contrôles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, transform 0.1s, box-shadow 0.15s; }
.btn:hover { background: var(--surface-2); box-shadow: 0 6px 16px -10px rgba(25, 57, 46, 0.5); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--sapin); color: var(--beige); border-color: var(--sapin); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn.primary:hover { background: var(--sapin-2); }
.btn.lime { background: var(--citron); color: var(--sapin); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 16px -10px rgba(25, 57, 46, 0.6); }
.btn.lime:hover { background: #A2F27B; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--neutral-wash); }
.btn.glass { background: var(--glass); border-color: var(--glass-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn.danger { color: var(--critical-text); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 11px; }
.btn.icon { width: 42px; padding: 0; } .btn.sm.icon { width: 34px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
[data-theme="dark"] .btn.primary { background: var(--citron); color: var(--sapin); border-color: var(--citron); }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-3); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(25, 57, 46, 0.12), 0 4px 10px -6px rgba(25, 57, 46, 0.3); }
.select, .input, .textarea { height: 42px; max-width: 100%; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 13px; padding: 0 14px; min-width: 0; font-weight: 700; font-size: 13.5px; transition: border-color 0.15s, box-shadow 0.15s; }
.select:hover, .input:hover, .textarea:hover { border-color: rgba(25, 57, 46, 0.28); }
.select:focus, .input:focus, .textarea:focus { outline: none; border-color: var(--sapin-2); box-shadow: 0 0 0 4px var(--accent-wash); }
.select { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2384948C' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
.select.glass { background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2384948C' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"), var(--glass); border-color: var(--glass-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--glass-shadow); }
.input { font-weight: 600; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; width: 100%; line-height: 1.5; font-weight: 500; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 800; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 600; }
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 800; cursor: pointer; color: var(--ink-2); text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s; }
.chip:hover { color: var(--ink); border-color: rgba(25, 57, 46, 0.3); }
.chip[aria-pressed="true"] { background: var(--sapin); color: var(--beige); border-color: var(--sapin); }
.chip svg { width: 16px; height: 16px; }
.chip.action { background: linear-gradient(135deg, color-mix(in srgb, var(--givre) 34%, var(--surface)), color-mix(in srgb, var(--citron) 30%, var(--surface))); border-color: var(--border); color: var(--ink); }
.chip.action:hover { transform: translateY(-1px); }
.chip.action svg { color: var(--sapin-2); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -30px; padding: 0 30px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 800; color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; padding: 0 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th.n, table.data td.n { text-align: right; }
table.data th[data-sort] { cursor: pointer; user-select: none; }
table.data th[data-sort]:hover { color: var(--ink); }
table.data th .arrow { opacity: 0.7; }
table.data td { padding: 15px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-weight: 600; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: var(--accent-wash); }
table.data tbody tr.clickable:hover td:first-child { border-radius: 12px 0 0 12px; }
table.data tbody tr.clickable:hover td:last-child { border-radius: 0 12px 12px 0; }
table.data tfoot td { font-weight: 800; border-top: 1px solid var(--border-strong); border-bottom: 0; padding-top: 15px; }
table.data td.name { font-weight: 800; }
table.data td .sub { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
table.data tr.child td { background: var(--surface-2); font-size: 13px; }
table.data tr.child td.name { padding-left: 34px; font-weight: 700; }
table.data tr.child2 td.name { padding-left: 56px; }
.cell-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-width: 170px; }
.mini-track { position: relative; height: 7px; border-radius: 999px; background: var(--accent-soft); }
.mini-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--sapin-2), #2E8A63); }
[data-theme="dark"] .mini-fill { background: var(--citron); }
.mini-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }

/* ---------- Listes (sources, équipe) ---------- */
.list { display: grid; gap: 2px; margin: 0 -12px; }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 12px; border-radius: 16px; text-decoration: none; color: inherit; transition: background 0.15s; }
.list-row:hover, .list-row:focus-within { background: var(--accent-wash); }
.list-row .main-l b { display: block; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .main-l span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .side { display: flex; align-items: center; gap: 0; }
.list-row .acts { display: flex; gap: 4px; margin-left: 10px; }
@media (hover: hover) { .list-row .acts { width: 0; margin-left: 0; opacity: 0; overflow: hidden; transition: width 0.18s, margin 0.18s, opacity 0.15s; } .list-row:hover .acts, .list-row:focus-within .acts { width: 32px; margin-left: 10px; opacity: 1; } }
.list-row .acts .btn { height: 32px; width: 32px; padding: 0; border-radius: 10px; background: var(--surface); }
.list-row .acts .btn svg { color: var(--sapin-2); }
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 4px 6px 0; }
.highlights .h-k { font-family: var(--font-title); font-size: 19px; color: var(--ink-2); }
.highlights .h-v { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; color: var(--sapin-2); margin-top: 10px; line-height: 1.1; display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .highlights .h-v { color: var(--citron); }
.highlights .h-s { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 3px; }
.hbars { display: grid; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.hbar { position: relative; height: 36px; border-radius: 11px; overflow: hidden; background: var(--neutral-wash); }
.hbar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 11px; background: linear-gradient(90deg, color-mix(in srgb, var(--givre) 60%, var(--surface)), color-mix(in srgb, var(--citron) 45%, var(--surface))); transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .hbar .fill { background: linear-gradient(90deg, rgba(154, 255, 255, 0.28), rgba(178, 255, 141, 0.32)); }
.hbar .lab { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; padding: 0 12px; font-weight: 800; font-size: 13px; gap: 8px; white-space: nowrap; }
.hbar-val { font-weight: 800; font-size: 13px; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar-val small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Synthèse ---------- */
.insights { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.insights li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; line-height: 1.55; font-weight: 500; }
.insights li > svg { width: 20px; height: 20px; margin-top: 1px; }
.insights strong { font-weight: 800; }
.insights .good > svg { color: var(--good); } .insights .warning > svg { color: #C78A0C; } .insights .critical > svg { color: var(--critical); } .insights .neutral > svg { color: var(--sapin-2); }
[data-theme="dark"] .insights .neutral > svg { color: var(--givre); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-weight: 700; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--ink-2); font-weight: 600; }
.notice svg { width: 19px; height: 19px; flex: none; margin-top: 1px; color: var(--sapin-2); }
.notice.warning { background: var(--warning-wash); border-color: transparent; } .notice.warning svg { color: #B97E08; }
.notice.critical { background: var(--critical-wash); border-color: transparent; } .notice.critical svg { color: var(--critical); }

/* ---------- Volets ---------- */
.volet-card { display: grid; gap: 14px; }
.volet-card .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.volet-card .name { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 20px; }
.volet-card .figures { display: flex; align-items: baseline; gap: 8px; }
.volet-card .figures .big { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 16px; font-size: 13px; }
.kv dt { color: var(--ink-2); font-weight: 600; } .kv dd { margin: 0; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Graphiques ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; font-weight: 600; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .lbl-strong { fill: var(--ink); font-weight: 800; font-size: 12.5px; }
.chart .lbl { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.mk-actual { fill: var(--accent); } .st-actual { stroke: var(--accent); }
.mk-plan { fill: var(--plan-fill); } .st-plan { stroke: var(--plan); }
.mk-proj { stroke: var(--accent); }
.today-line { stroke: var(--ink); stroke-width: 1; opacity: 0.25; }
.cross { stroke: var(--ink); stroke-width: 1; opacity: 0.35; pointer-events: none; }
.dot-ring { stroke: var(--surface); stroke-width: 2.5; }
.hit { fill: transparent; cursor: crosshair; }
.bar-hit { fill: transparent; cursor: pointer; }
.bar-group:hover .mk-actual, .bar-group:focus .mk-actual { fill: var(--accent-strong); }
.bar-group:hover .mk-plan { fill: var(--axis); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); align-items: center; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: 16px; align-items: center; padding: 9px 0; }
.funnel-row .lab { font-weight: 800; font-size: 13.5px; }
.funnel-row .lab .sub { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.funnel-row .val { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-row .val strong { display: block; font-size: 16px; font-weight: 800; }
.funnel-row .val span { color: var(--muted); font-size: 12px; font-weight: 700; }
.funnel-bar { position: relative; height: 30px; border-radius: 10px; background: var(--surface-2); }
.funnel-bar .fb { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; }
.funnel-bar .fb-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: 0.55; border-radius: 1px; }

/* ---------- Infobulle (verre) ---------- */
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--glass-solid); color: var(--ink); border: 1px solid var(--glass-edge); border-radius: 16px; box-shadow: var(--shadow-pop); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); padding: 12px 14px; min-width: 180px; max-width: 320px; font-size: 12.5px; opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s; font-weight: 600; }
.tooltip.show { opacity: 1; transform: none; }
.tt-title { font-weight: 800; margin-bottom: 8px; color: var(--ink); font-size: 12.5px; }
.tt-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; margin-top: 5px; }
.tt-row .v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.tt-row .k { color: var(--ink-2); }
.tt-note { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 12px; font-weight: 500; }

/* ---------- Tiroir, dialogues, menus, toasts ---------- */
.drawer-back, .modal-back { position: fixed; inset: 0; background: rgba(12, 31, 24, 0.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 60; animation: fadeIn 0.18s ease; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(740px, calc(100vw - 24px)); background: var(--surface); border-radius: 26px; z-index: 61; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slideIn 0.24s cubic-bezier(.2,.8,.2,1); border: 1px solid var(--border); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 28px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 26px; }
.drawer-body { overflow: auto; padding: 22px 28px 40px; }
.modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-pop); border: 1px solid var(--border); animation: popIn 0.2s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(620px, calc(100vw - 32px)); }
.modal-form { display: grid; gap: 18px; padding: 28px 30px 26px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal h2 { font-size: 30px; line-height: 1; padding-top: 4px; }
.modal .lead { color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-top: -6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.menu-pop { position: fixed; z-index: 70; min-width: 240px; padding: 8px; border-radius: 18px; background: var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-pop); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); animation: menuIn 0.16s ease; }
.menu-pop .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 11px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 13.5px; text-align: left; color: var(--ink); text-decoration: none; }
.menu-pop .mi:hover, .menu-pop .mi:focus-visible { background: var(--neutral-wash); outline: none; }
.menu-pop .mi svg { width: 17px; height: 17px; color: var(--ink-2); }
.menu-pop .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-pop .mh { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.menu-pop .mh b { display: block; font-size: 14px; } .menu-pop .mh > div > span { font-size: 12px; color: var(--muted); font-weight: 600; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } }
@keyframes menuIn { from { opacity: 0; transform: translateY(6px); } }
.toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 120; }
.toast { background: var(--sapin); color: var(--beige); padding: 13px 18px; border-radius: 16px; box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 700; max-width: 420px; animation: toastIn 0.2s ease; border: 1px solid rgba(255, 255, 255, 0.08); }
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--citron); margin-right: 10px; vertical-align: 1px; }
.toast.error { background: #7E2A20; } .toast.error::before { background: #FFB4A8; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Connexion (verre sur le tore Skarlett) ---------- */
body.is-auth { overflow-x: hidden; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; }
.login-stage { position: relative; width: min(450px, 100%); }
.login-torus { position: absolute; z-index: 0; width: 420px; height: auto; right: -250px; top: -150px; transform: rotate(-12deg); filter: drop-shadow(0 34px 44px rgba(18, 84, 62, 0.28)); pointer-events: none; animation: floaty 10s ease-in-out infinite; }
@keyframes floaty { 50% { transform: rotate(-8deg) translateY(12px); } }
.login-card { position: relative; z-index: 1; width: 100%; display: grid; gap: 18px; padding: 36px 34px 28px; border-radius: 32px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); }
.login-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 60% at 0% 0%, rgba(255, 255, 255, 0.55), transparent 55%); mix-blend-mode: soft-light; }
.login-logo img { height: 46px; width: auto; max-width: 100%; }
.login-card h1 { font-size: 48px; text-transform: uppercase; line-height: 0.92; }
.login-card .lead { color: var(--ink-2); font-size: 14px; font-weight: 500; margin-top: 10px; }
.login-card .btn { height: 50px; font-size: 14.5px; }
.login-card .input { height: 48px; width: 100%; }
.login-foot { color: var(--muted); font-size: 12px; text-align: center; font-weight: 600; }
.pw-field { position: relative; display: block; }
.pw-field .input { width: 100%; padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--neutral-wash); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.2s, background 0.2s; }
.secret { font: 800 18px/1.4 ui-monospace, Menlo, monospace; letter-spacing: 0.04em; padding: 12px 16px; border-radius: 14px; background: var(--accent-wash); border: 1px dashed var(--sapin-2); text-align: center; user-select: all; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row .secret { flex: 1; min-width: 0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--sapin-2); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .link-btn { color: var(--citron); }
.form-error { padding: 12px 14px; border-radius: 12px; background: var(--critical-wash); color: var(--critical-text); font-size: 13px; font-weight: 700; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 300; padding: 10px 16px; border-radius: 12px; border: 0; background: var(--sapin); color: var(--beige); font-weight: 800; cursor: pointer; }
.skip-link:focus { top: 16px; }

/* ---------- Menu du compte ---------- */
.user-menu { min-width: 290px; }
.menu-pop .mh > div { min-width: 0; }
.menu-pop .mh > div > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.menu-pop .mh .role-tag { display: inline-block; margin-top: 7px; padding: 2px 8px; border-radius: 6px; background: var(--accent-wash); color: var(--sapin-2); font-size: 11px; font-weight: 800; }
:root[data-theme="dark"] .menu-pop .mh .role-tag { color: var(--citron); }
.menu-pop .mi.danger { color: var(--critical-text); } .menu-pop .mi.danger svg { color: var(--critical); }
.menu-pop .mi small { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 12px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.seg.sm { padding: 3px; border-radius: 12px; }
.seg.sm button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; font-size: 12px; border-radius: 9px; }
.seg.sm button svg { width: 14px; height: 14px; }

/* ---------- Haut de page : période ---------- */
.period { position: relative; display: inline-flex; }
.period .period-ico { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; z-index: 1; }
.period .select { padding-left: 40px; min-width: 230px; }
.input.glass { background: var(--glass); border-color: var(--glass-edge); box-shadow: var(--glass-shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------- Listes à avatars ---------- */
.list-card { display: flex; flex-direction: column; }
.list-card .card-head { flex-wrap: nowrap; }
.list-row { position: relative; }
.list-row .main-l { text-decoration: none; color: inherit; min-width: 0; }
.list-row .stretch::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.list-row .stretch:focus-visible { outline: none; }
.list-row .stretch:focus-visible::after { outline: 2px solid var(--sapin-2); outline-offset: -2px; }
.list-row .side { position: relative; z-index: 1; }
.list-row .val { display: grid; justify-items: end; line-height: 1.3; min-width: 64px; }
.list-row .val b { font-size: 15px; font-weight: 800; }
.select-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.select-inline select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 9px; padding: 6px 24px 6px 6px; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2384948C' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center; }
.select-inline select:hover { background-color: var(--neutral-wash); }
.select-inline select:focus-visible { outline: 2px solid var(--sapin-2); outline-offset: 1px; }
.avatar.more { background: var(--surface-3); color: var(--ink-2); }

/* ---------- Sections ouvertes (sans carte) ---------- */
.open-section { padding: 8px 6px 0; min-width: 0; }
.open-section h3 { font-size: 22px; }
.open-section .sub { color: var(--ink-2); font-size: 13px; font-weight: 500; margin: 6px 0 18px; }
.av-tiles { display: flex; gap: 12px; flex-wrap: wrap; }
.av-tile { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; text-decoration: none; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform 0.15s; }
.av-tile:hover { transform: translateY(-2px); }
.av-tile .avatar { width: 38px; height: 38px; font-size: 13.5px; }
.av-tile.me { background: color-mix(in srgb, var(--citron) 35%, var(--surface)); }
.av-tile.add { background: transparent; border: 1.5px dashed var(--border-strong); box-shadow: none; color: var(--sapin-2); backdrop-filter: none; }
.av-tile.add svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .av-tile.add { color: var(--citron); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.hbar-row { color: inherit; text-decoration: none; }
a.hbar-row:hover .lab { text-decoration: underline; text-underline-offset: 2px; }
/* Repère « attendu à date » : triangle sous la barre */
.hbar-wrap { position: relative; padding-bottom: 7px; min-width: 0; }
.hbar-ref { position: absolute; bottom: 0; width: 0; height: 0; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid var(--ink); opacity: 0.75; pointer-events: none; }
.highlights a { color: inherit; text-decoration: none; }
.highlights a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Équipe ---------- */
.members { display: grid; gap: 2px; margin: 0 -12px; }
.member { display: grid; grid-template-columns: auto minmax(0, 1.3fr) auto minmax(0, 1.2fr) 34px; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; }
.member:hover { background: var(--neutral-wash); }
.member.inactive > :not(:last-child) { opacity: 0.5; }
.m-main b { display: block; font-weight: 800; font-size: 14px; }
.m-main > span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--citron); color: var(--sapin); font-size: 10.5px; font-weight: 800; vertical-align: 1px; }
.role-pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--neutral-wash); color: var(--ink-2); }
.role-pill.admin { background: var(--sapin); color: var(--citron); }
.role-pill.editor { background: var(--accent-wash); color: var(--sapin-2); }
:root[data-theme="dark"] .role-pill.admin { background: var(--citron); color: var(--sapin); }
:root[data-theme="dark"] .role-pill.editor { color: var(--citron); }
.m-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.m-status.on { color: var(--good-text); font-weight: 700; }
.m-status.wait { color: var(--warning-text); }
.m-status.off { color: var(--muted); }
.online-list { display: grid; gap: 14px; }
.online-row { display: flex; align-items: center; gap: 12px; }
.online-row > div b { display: block; font-size: 13.5px; font-weight: 800; }
.online-row > div > span { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.roles { display: grid; gap: 16px; margin: 0; }
.roles > div { display: grid; gap: 6px; justify-items: start; }
.roles dd { margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.act-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.act-tag svg { width: 15px; height: 15px; color: var(--sapin-2); }
:root[data-theme="dark"] .act-tag svg { color: var(--citron); }
.avatars-cap { display: flex; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.inline-ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--sapin-2); }

/* ---------- Dialogues ---------- */
.role-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.role-choices legend { font-size: 12.5px; color: var(--ink-2); font-weight: 800; margin-bottom: 8px; padding: 0; }
.role-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-strong); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.role-choice:hover { border-color: rgba(25, 57, 46, 0.3); }
.role-choice:has(input:checked) { border-color: var(--sapin-2); background: var(--accent-wash); }
.role-choice input { margin: 3px 0 0; accent-color: var(--sapin-2); }
.role-choice b { display: block; font-weight: 800; font-size: 13.5px; }
.role-choice small { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.role-choices[disabled] { opacity: 0.55; }
.btn.danger-solid { background: var(--critical); color: #fff; border-color: var(--critical); }
.btn.danger-solid:hover { background: #B23A2C; }
.btn .spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; }
.btn.busy { cursor: progress; }
.tt-note.solo { margin-top: 0; padding-top: 0; border-top: 0; color: var(--ink); font-size: 12.5px; }
.progress.no-tag { margin-top: 26px; }

/* ---------- Divers ---------- */
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 6px 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-screen { display: grid; place-items: center; min-height: 60vh; color: var(--muted); gap: 14px; text-align: center; font-weight: 700; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--sapin-2); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--citron); } 100% { box-shadow: 0 0 0 0 transparent; } }
kbd { font: 700 11px var(--font); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); }
input[type="range"] { accent-color: var(--sapin-2); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); vertical-align: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 1640px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1400px) {
  .col-3 { grid-column: span 6; } .col-5, .col-7 { grid-column: span 12; }
}
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento.top4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-4 { grid-column: span 6; } .col-4.last-odd { grid-column: span 12; }
}
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .g-2-1, .g-1-2, .g3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .col-4, .col-6, .col-8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  :root { --gutter: 10px; }
  .sidebar { transform: translateX(calc(-100% - 24px)); width: min(300px, calc(100vw - 20px)); visibility: hidden; transition: transform 0.28s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0.28s; }
  .app.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.28s cubic-bezier(.2,.8,.2,1); }
  .collapse-btn { display: none; }
  .main { margin-left: 0; }
  .btn.menu-btn { display: inline-flex; }
  .topbar-in { padding: 16px 16px 12px; align-items: center; }
  .page-title h1 { font-size: 32px; }
  .content { padding: 4px 14px 56px; gap: 16px; }
  .g2 { grid-template-columns: 1fr; }
  .card { padding: 22px 20px; border-radius: 22px; }
  .table-wrap { margin: 0 -20px; padding: 0 20px; }
  .hero-figure { font-size: 48px; }
  .highlights { grid-template-columns: 1fr 1fr; }
  .col-3 { grid-column: span 12; }
  .stat-card { min-height: 0; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(12, 31, 24, 0.3); z-index: 30; }
}
@media (max-width: 700px) {
  .member { grid-template-columns: auto minmax(0, 1fr) 34px; row-gap: 6px; }
  .member .role-pill { grid-column: 2; grid-row: 2; justify-self: start; }
  .member .m-status { grid-column: 2; grid-row: 3; }
  .member > :last-child { grid-column: 3; grid-row: 1; }
  .field-row { grid-template-columns: 1fr; }
  .login { padding-top: 110px; }
  .login-torus { width: 220px; right: -18px; top: -112px; }
  .login-card { padding: 30px 22px 24px; }
  .login-card h1 { font-size: 40px; }
  .bento.top4 { grid-template-columns: 1fr; }
  .period .select { min-width: 0; }
}
@media (max-width: 560px) {
  .kpis, .kpis.k6, .g4 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .funnel-row { grid-template-columns: 96px 1fr 84px; gap: 10px; }
  .stat-card .big .v { font-size: 40px; }
  .highlights { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .sidebar, .topbar, .toasts, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  body { background: #fff; } body::before { display: none; }
}

/* ---------- Rapports : barre de réglages ---------- */
.rp-controls { display: grid; gap: 20px; align-items: end; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.6fr) auto; }
.rp-controls .select, .rp-controls .textarea { width: 100%; }
@media (max-width: 1280px) { .rp-controls { grid-template-columns: minmax(0, 1fr) auto; } .rp-controls > :nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 700px) { .rp-controls { grid-template-columns: 1fr; } .rp-controls > * { grid-column: auto !important; } }

/* ---------- Simulations ---------- */
.sim-grid { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 36px; }
@media (max-width: 900px) { .sim-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* ---------- Chargement (squelette) ---------- */
.skel-page { display: grid; gap: 22px; }
.skel-page .bento { margin: 0; }
.skel-card { min-height: 0; }
i.skeleton { display: block; height: 12px; border-radius: 8px; }
.skel-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; }
.skel-row > span { flex: 1; min-width: 0; }
.skel-dot { width: 34px !important; height: 34px !important; border-radius: 50% !important; flex: none; }
.skel-note { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 13px; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }

/* ---------- Aide à la configuration ---------- */
.setup-card { max-width: 880px; }
.setup-head { display: flex; gap: 16px; align-items: flex-start; }
.setup-head h2 { font-size: 26px; }
.setup-head .desc { color: var(--ink-2); font-size: 13px; margin-top: 8px; font-weight: 500; }
.setup-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-wash); color: var(--sapin-2); display: grid; place-items: center; flex: none; }
.setup-ico svg { width: 22px; height: 22px; }
:root[data-theme="dark"] .setup-ico { color: var(--citron); }
.setup-steps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.setup-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; font-weight: 500; line-height: 1.55; }
.setup-steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--sapin); color: var(--citron); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
:root[data-theme="dark"] .setup-steps li::before { background: var(--citron); color: var(--sapin); }

/* Tiroir : actions toujours visibles en bas */
.drawer-actions { position: sticky; bottom: -40px; z-index: 2; margin-top: 18px; padding: 16px 0 40px; background: var(--surface); border-top: 1px solid var(--border); }
.tri-legend { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid var(--ink); opacity: 0.75; vertical-align: 1px; margin: 0 2px; }
.kpi-foot .pill { white-space: normal; max-width: 100%; line-height: 1.25; }

/* ---------- Simulations : curseurs faciles à manier ---------- */
.sim-controls { gap: 22px; }
.sim-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.sim-presets .chip { height: 32px; padding: 0 13px; font-size: 12.5px; }
.sim-ctl { display: grid; gap: 6px; }
.sim-ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sim-ctl-head label { font-size: 13px; font-weight: 800; color: var(--ink); }
.sim-num { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink-2); }
.sim-num .input { width: 78px; height: 36px; padding: 0 10px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.sim-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; padding: 0 4px; }
.sim-range { --thumb: 26px; --pa: 0.5; --pb: 0.5; --pz: 0.5; --track: var(--surface-3); --fill: var(--accent);
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; margin: 0; background: transparent; cursor: grab; touch-action: pan-y; }
.sim-range:active { cursor: grabbing; }
.sim-range:focus { outline: none; }
.sim-range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px;
  background:
    linear-gradient(90deg, transparent calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pz) - 1px), var(--muted) 0 calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pz) + 1px), transparent 0),
    linear-gradient(90deg, var(--track) calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pa)), var(--fill) 0 calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pb)), var(--track) 0); }
.sim-range::-moz-range-track { height: 10px; border-radius: 999px;
  background:
    linear-gradient(90deg, transparent calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pz) - 1px), var(--muted) 0 calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pz) + 1px), transparent 0),
    linear-gradient(90deg, var(--track) calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pa)), var(--fill) 0 calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--pb)), var(--track) 0); }
.sim-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--thumb); height: var(--thumb); margin-top: calc((10px - var(--thumb)) / 2); border-radius: 50%; background: var(--citron); border: 3px solid var(--sapin); box-shadow: 0 3px 10px -2px rgba(25, 57, 46, 0.45); transition: transform 0.12s, box-shadow 0.12s; }
.sim-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--citron); border: 3px solid var(--sapin); box-shadow: 0 3px 10px -2px rgba(25, 57, 46, 0.45); }
.sim-range:hover::-webkit-slider-thumb { transform: scale(1.06); }
.sim-range:active::-webkit-slider-thumb { transform: scale(1.14); }
.sim-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-wash), 0 3px 10px -2px rgba(25, 57, 46, 0.45); }
.sim-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px var(--accent-wash); }
:root[data-theme="dark"] .sim-range::-webkit-slider-thumb { border-color: var(--beige); }
:root[data-theme="dark"] .sim-range::-moz-range-thumb { border-color: var(--beige); }
.sim-table th.hl, .sim-table td.hl { background: var(--accent-wash); font-weight: 800; }
.sim-table th.hl { color: var(--ink); border-radius: 10px 10px 0 0; }
/* La grille de simulation s'empile dès que la carte est étroite (menu ouvert, tablette) */
#pv-sim { container-type: inline-size; }
@container (max-width: 860px) { .sim-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.sim-grid .btn { white-space: normal; height: auto; min-height: 42px; padding-top: 10px; padding-bottom: 10px; text-align: left; }

/* ---------- Logos des sources ---------- */
.avatar.logo { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(25, 57, 46, 0.10); }
.avatar.logo img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.avatar.logo.fit-pad img { object-fit: contain; padding: 16%; }
.avatar.logo.fit-cover img { object-fit: cover; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.title { width: 46px; height: 46px; font-size: 15px; flex: none; transition: width 0.2s, height 0.2s; }
.page-title h1 { display: flex; align-items: center; gap: 14px; }
.topbar.scrolled .page-title h1 .avatar.title { width: 32px; height: 32px; }
.src-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.src-cell > span:last-child { min-width: 0; }
.hbar-logo { width: 18px; height: 18px; object-fit: contain; flex: none; }
@media (max-width: 900px) { .avatar.title { width: 36px; height: 36px; } }
