  /* Les tokens (:root) vivent dans theme-baresto.css (charte Baresto + Bootstrap 5.3) : ce fichier ne fait que
     décrire les composants de la coquille Pulse avec ces tokens. Ordre de chargement : bootstrap → theme → styles. */
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }   /* l'attribut hidden doit toujours gagner sur les display: des classes (.spinner-sm, .btn-*, .legacy .d-flex…) */
  html, body { margin: 0; padding: 0; height: 100%; }
  body { background: var(--bg-app); font-family: var(--font-sans); color: var(--text-primary); display: flex; flex-direction: column; min-height: 100vh; font-size: 13px; line-height: 1.45; }
  h1, h2, h3, h4, h5, h6 { margin-top: 0; }

  /* ── Top bar (D'Clic-style) ─────────────────────────────── */
  .topbar { background: var(--bg-card); border-bottom: 0.5px solid var(--border); padding: 10px 20px; display: flex; align-items: center; gap: 16px; z-index: 10; }
  .topbar .pulse-logo { font-size: 20px; }
  .topbar .logo-sub { font-size: 12px; font-weight: 700; color: var(--text-secondary); padding-left: 12px; border-left: 1px solid var(--border-strong); line-height: 1.1; }
  .topbar .logo-sub small { display: block; font-weight: 400; font-size: 10px; color: var(--text-tertiary); }
  .topbar .tb-badge { padding: 2px 8px; background: var(--bg-tile-gray); border-radius: 10px; font-size: 10px; color: var(--text-tertiary); }
  .topbar .tb-retour { margin-left: 10px; padding: 3px 10px; border: 1px solid var(--border-color, rgba(31,26,26,.14)); border-radius: 14px; font-size: 12px; color: var(--text-bordeaux); text-decoration: none; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tb-retour:hover { background: var(--bg-tile-gray); }
  .topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; }
  .topbar .tb-search { position: relative; margin-left: 18px; flex: 0 1 380px; }
  .topbar .tb-search input { width: 100%; font: inherit; font-size: 12.5px; padding: 6px 12px 6px 30px; border: 0.5px solid var(--border-strong); border-radius: 16px; background: var(--bg-tile-gray) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236F6664' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center; outline: none; }
  .topbar .tb-search input:focus { border-color: var(--text-bordeaux); background-color: var(--bg-card); }
  .tb-sugg { position: absolute; top: calc(100% + 6px); left: 0; width: min(560px, 90vw); max-height: 70vh; overflow: auto; background: var(--bg-card); border: 0.5px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(31,26,26,.18); z-index: 200; font-size: 12.5px; }
  .tb-sugg-grp { padding: 6px 12px 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-tertiary); background: var(--bg-tile-gray); }
  .tb-sugg-it { display: block; padding: 6px 12px; text-decoration: none; color: inherit; border-bottom: 0.5px solid var(--border); }
  .tb-sugg-it .t { display: block; font-weight: 600; } .tb-sugg-it .s { display: block; font-size: 11px; color: var(--text-tertiary); }
  .tb-sugg-it:hover, .tb-sugg-it.on { background: var(--bg-tile-bordeaux, #F5EDEC); }
  .tb-sugg-tout { text-align: center; color: var(--text-bordeaux); font-weight: 600; }
  .tb-sugg-vide { padding: 10px 12px; color: var(--text-tertiary); }
  .topbar .role-picker { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-tile-gray); border-radius: 6px; }
  .topbar .role-picker select { background: transparent; color: var(--text-primary); border: none; font-family: inherit; font-size: 12px; cursor: pointer; outline: none; }
  .topbar .user { padding: 6px 12px; border-radius: 16px; background: var(--bg-tile-gray); font-size: 12px; color: var(--text-secondary); }
  .topbar .help { color: var(--text-muted); cursor: pointer; }

  /* ── App shell ───────────────────────────────────────────── */
  .shell { display: grid; grid-template-columns: 240px 1fr; flex: 1; overflow: hidden; }
  @media (max-width: 1100px) { .shell { grid-template-columns: 200px 1fr; } }

  /* ── Sidebar (D'Clic menu replication) ──────────────────── */
  .sidebar { background: var(--bg-side); border-right: 0.5px solid var(--border); overflow-y: auto; padding: 12px 6px; }
  .menu-section { margin-bottom: 4px; }
  .menu-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-secondary); font-weight: 500; cursor: pointer; border-radius: 5px; }
  .menu-header:hover { background: var(--bg-side-hover); }
  .menu-header .icon { width: 18px; opacity: 0.6; font-size: 14px; }
  .menu-header .caret { margin-left: auto; font-size: 10px; opacity: 0.5; transition: transform 0.15s; }
  .menu-header.expanded .caret { transform: rotate(90deg); }
  .submenu { padding: 2px 0 6px 26px; display: none; }
  .menu-section.expanded .submenu { display: block; }
  .submenu .item { display: block; padding: 5px 10px; font-size: 12px; color: var(--text-secondary); cursor: pointer; border-radius: 4px; text-decoration: none; }
  .submenu .item:hover { background: var(--bg-side-hover); color: var(--text-primary); }
  .submenu .item.active { background: var(--bg-side-active); color: var(--text-bordeaux); font-weight: 700; }
  .submenu .item.disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.6; }
  .menu-item-direct { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-secondary); font-weight: 500; cursor: pointer; border-radius: 5px; }
  .menu-item-direct:hover { background: var(--bg-side-hover); }
  .menu-item-direct.active { background: var(--bg-side-active); color: var(--text-bordeaux); }
  .menu-item-direct .icon { width: 18px; opacity: 0.6; font-size: 14px; }

  /* ── Main content ────────────────────────────────────────── */
  .main { overflow-y: auto; padding: 18px 26px 32px; }
  .breadcrumb { display: block; padding: 0; margin: 0 0 6px; list-style: none; font-size: 11px; color: var(--text-tertiary); }
  .breadcrumb a { color: var(--text-tertiary); text-decoration: none; }
  .breadcrumb a:hover { color: var(--text-bordeaux); }
  .breadcrumb .sep { margin: 0 6px; opacity: 0.5; }
  h1.page-title { font-size: 20px; margin: 0 0 4px 0; }
  .page-sub { font-size: 12px; color: var(--text-tertiary); margin: 0 0 16px 0; }

  /* ── Filter bar (D'Clic-style) ──────────────────────────── */
  .filter-bar { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .filter-bar input, .filter-bar select { padding: 5px 10px; border: 0.5px solid var(--border-strong); border-radius: 5px; font-family: inherit; font-size: 12px; background: var(--bg-card); }
  .filter-bar input { min-width: 180px; }
  .filter-bar .spacer { flex: 1; }
  .filter-bar .btn { padding: 5px 12px; }
  /* Boutons : composant Bootstrap 5.3 (variables --bs-btn-* posées dans theme-baresto.css) à la densité de la maquette.
     .btn seul = bouton neutre (blanc, bord fin) · .btn-primary = action (rouge charte) · .btn-secondary = lie de vin · .btn-success = sauge. */
  .btn { --bs-btn-padding-y: 6px; --bs-btn-padding-x: 12px; --bs-btn-font-size: 12px; --bs-btn-border-radius: 5px; --bs-btn-line-height: 1.35;
         --bs-btn-color: var(--text-secondary); --bs-btn-bg: var(--bg-card); --bs-btn-border-color: var(--border-strong);
         --bs-btn-hover-color: var(--text-primary); --bs-btn-hover-bg: var(--bg-side-hover); --bs-btn-hover-border-color: var(--border-strong);
         --bs-btn-active-color: var(--text-primary); --bs-btn-active-bg: var(--bg-side-hover); --bs-btn-active-border-color: var(--border-strong);
         --bs-btn-disabled-color: var(--text-muted); --bs-btn-disabled-bg: var(--bg-card); --bs-btn-disabled-border-color: var(--border);
         border-width: 0.5px; }
  .btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--br-rouge); --bs-btn-border-color: var(--br-rouge); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--br-rouge-dark); --bs-btn-hover-border-color: var(--br-rouge-dark); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--br-rouge-dark); --bs-btn-active-border-color: var(--br-rouge-dark); --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--br-rouge); --bs-btn-disabled-border-color: var(--br-rouge); font-weight: 700; }
  .btn-bordeaux { --bs-btn-color: #fff; --bs-btn-bg: var(--br-bordeaux); --bs-btn-border-color: var(--br-bordeaux); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--br-bordeaux-dark); --bs-btn-hover-border-color: var(--br-bordeaux-dark); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--br-bordeaux-dark); font-weight: 700; }
  .btn-blue, .btn-info { --bs-btn-color: #fff; --bs-btn-bg: var(--br-lie-de-vin); --bs-btn-border-color: var(--br-lie-de-vin); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--br-lie-de-vin-dark); --bs-btn-hover-border-color: var(--br-lie-de-vin-dark); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--br-lie-de-vin-dark); font-weight: 500; }
  .btn-amber, .btn-warning { --bs-btn-color: var(--br-bordeaux-dark); --bs-btn-bg: var(--br-rose); --bs-btn-border-color: var(--br-rose); --bs-btn-hover-color: var(--br-bordeaux-dark); --bs-btn-hover-bg: #EE8383; --bs-btn-hover-border-color: #EE8383; font-weight: 500; }
  .btn-teal, .btn-success { --bs-btn-color: #fff; --bs-btn-bg: var(--br-sauge-dark); --bs-btn-border-color: var(--br-sauge-dark); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #5A6138; --bs-btn-hover-border-color: #5A6138; --bs-btn-active-color: #fff; --bs-btn-active-bg: #5A6138; font-weight: 500; }
  .btn-sm { --bs-btn-padding-y: 3px; --bs-btn-padding-x: 8px; --bs-btn-font-size: 11px; --bs-btn-border-radius: 5px; }

  /* ── KPI tiles (D'Clic-style) ───────────────────────────── */
  .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
  .kpi-tile { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 14px 16px; cursor: pointer; position: relative; }
  .kpi-tile:hover { border-color: var(--border-strong); }
  .kpi-tile.active { border-color: var(--text-bordeaux); border-width: 1.5px; }
  .kpi-tile .v { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--text-primary); }
  .kpi-tile .l { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .kpi-tile .h { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
  /* Variantes couleur de border-left · charte unifiée */
  .kpi-tile.tile-info     { border-left: 3px solid var(--text-info); }
  .kpi-tile.tile-success  { border-left: 3px solid var(--text-success); }
  .kpi-tile.tile-warning  { border-left: 3px solid var(--text-warning); }
  .kpi-tile.tile-coral    { border-left: 3px solid var(--text-coral); }
  .kpi-tile.tile-purple   { border-left: 3px solid var(--text-purple); }
  .kpi-tile.tile-bordeaux { border-left: 3px solid var(--text-bordeaux); }
  .kpi-tile.tile-teal     { border-left: 3px solid var(--text-teal); }

  /* KPI hero · même charte blanche · layout flex pour valeur + sous-info + jauge */
  .kpi-hero {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--text-warning);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .kpi-hero.hero-spectrum { border-left-color: var(--text-warning); }
  .kpi-hero.hero-warm     { border-left-color: var(--text-success); }
  .kpi-hero .hero-l { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; line-height: 1; }
  .kpi-hero .hero-v { font-size: 26px; font-weight: 700; color: var(--text-bordeaux); line-height: 1.15; margin-top: 2px; }
  .kpi-hero .hero-h { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

  /* Mini-KPI ligne (captation économique · 6 colonnes) */
  .kpi-mini { padding: 4px 0 4px 6px; border-left: 2px solid var(--text-tertiary); }
  .kpi-mini.mini-success { border-left-color: var(--text-success); }
  .kpi-mini.mini-coral   { border-left-color: var(--text-coral); }
  .kpi-mini.mini-warning { border-left-color: var(--text-warning); }
  .kpi-mini.mini-info    { border-left-color: var(--text-info); }
  .kpi-mini .mini-l { color: var(--text-tertiary); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; }
  .kpi-mini .mini-v { font-weight: 600; font-size: 14px; }
  .kpi-mini .mini-h { color: var(--text-tertiary); font-size: 10.5px; }

  /* Bandeau synthèse · blanc avec border-left bordeaux */
  .kpi-band {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--text-bordeaux);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .kpi-band .band-l { color: var(--text-bordeaux); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
  .kpi-band .band-v { font-weight: 700; font-size: 20px; color: var(--text-bordeaux); }
  .kpi-band .band-h { font-size: 10.5px; color: var(--text-tertiary); margin-top: 2px; }

  /* Vignettes étapes Candidats · cartes blanches cliquables, border-left selon étape */
  .step-card {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-left-width: 3px;
    border-left-style: solid;
    border-left-color: var(--text-tertiary);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
    user-select: none;
  }
  .step-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.10); border-color: var(--border-strong); }
  .step-card.active { box-shadow: 0 4px 14px rgba(0,0,0,0.14); border-color: var(--border-strong); }
  .step-card[data-step="1"] { border-left-color: var(--text-info); }
  .step-card[data-step="2"] { border-left-color: var(--text-purple); }
  .step-card[data-step="3"] { border-left-color: var(--text-teal); }
  .step-card[data-step="4"] { border-left-color: var(--text-success); }
  .step-card[data-step="5"] { border-left-color: var(--text-bordeaux); }
  .step-card.active[data-step="1"] { border-color: var(--text-info); }
  .step-card.active[data-step="2"] { border-color: var(--text-purple); }
  .step-card.active[data-step="3"] { border-color: var(--text-teal); }
  .step-card.active[data-step="4"] { border-color: var(--text-success); }
  .step-card.active[data-step="5"] { border-color: var(--text-bordeaux); }
  .kpi-tile .corner-icon { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
  .corner-blue { background: var(--bg-tile-info); color: var(--text-info); }
  .corner-green { background: var(--bg-tile-success); color: var(--text-success); }
  .corner-red { background: var(--bg-tile-coral); color: var(--text-coral); }
  .corner-gray { background: var(--bg-tile-gray); color: var(--text-tertiary); }
  .corner-amber { background: var(--bg-tile-warning); color: var(--text-warning); }
  .corner-teal { background: var(--bg-tile-teal); color: var(--text-teal); }

  /* ── Panels & tables ────────────────────────────────────── */
  .panel { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; overflow: hidden; }
  .panel-header { padding: 10px 16px; border-bottom: 0.5px solid var(--border); display: flex; align-items: center; gap: 10px; }
  .panel-header h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
  .panel-header .right { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
  .table-wrap { overflow-x: auto; }
  table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  table.data th { text-align: left; padding: 9px 12px; background: var(--bg-table-head); font-size: 11px; color: var(--text-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 0.5px solid var(--border); }
  table.data td { padding: 10px 12px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
  table.data tr.clickable:hover { background: var(--bg-side-hover); cursor: pointer; }
  table.data tr.alert { background: rgba(229, 0, 64, 0.06); padding: 0; margin: 0; border: 0; border-radius: 0; --bs-alert-bg: transparent; }
  table.data .strong { font-weight: 500; color: var(--text-primary); }
  table.data .muted { color: var(--text-tertiary); font-size: 11px; }
  table.data .amount { text-align: right; font-variant-numeric: tabular-nums; }

  /* ── Chips ──────────────────────────────────────────────── */
  .chip { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
  .chip-phase-1 { background: var(--bg-tile-gray); color: var(--text-tertiary); }
  .chip-phase-2 { background: var(--bg-tile-info); color: var(--text-info); }
  .chip-phase-3 { background: var(--bg-tile-teal); color: var(--text-teal); }
  .chip-phase-4 { background: var(--bg-tile-purple); color: var(--text-purple); }
  .chip-stade-A { background: var(--bg-tile-warning); color: var(--text-warning); }
  .chip-stade-B { background: var(--bg-tile-info); color: var(--text-info); }
  .chip-stade-C { background: var(--bg-tile-success); color: var(--text-success); }
  .chip-alert { background: var(--bg-tile-coral); color: var(--text-coral); }
  .chip-success { background: var(--bg-tile-success); color: var(--text-success); }
  .chip-warning { background: var(--bg-tile-warning); color: var(--text-warning); }
  .chip-info { background: var(--bg-tile-info); color: var(--text-info); }
  .chip-muted { background: var(--bg-tile-gray); color: var(--text-tertiary); }
  .chip-bordeaux { background: var(--br-bordeaux-tint); color: var(--br-bordeaux); font-weight: 700; }

  /* ── IA hint banner (when something is enriched) ───────── */
  .ai-hint { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-tile-teal); border-radius: 5px; font-size: 11px; color: var(--text-teal); font-weight: 500; margin-bottom: 12px; }
  .ai-hint::before { content: "✨"; }

  /* ── Inbox cards ────────────────────────────────────────── */
  .inbox-section { margin-bottom: 14px; }
  .inbox-header { padding: 8px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; border-radius: 5px; margin-bottom: 6px; }
  .inbox-header.urgent { background: var(--bg-tile-coral); color: var(--text-coral); }
  .inbox-header.week { background: var(--bg-tile-info); color: var(--text-info); }
  .inbox-header.opp { background: var(--bg-tile-gray); color: var(--text-tertiary); }
  .inbox-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 5px; padding: 10px 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 12px; }
  .inbox-card:hover { border-color: var(--border-strong); }
  .inbox-card.urgent { border-left: 3px solid var(--text-coral); }
  .inbox-card .icn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 5px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
  .inbox-card .body { flex: 1; }
  .inbox-card .ttl { font-size: 13px; font-weight: 500; }
  .inbox-card .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
  .inbox-card .meta { font-size: 11px; color: var(--text-tertiary); }
  .inbox-card .source { font-size: 10px; color: var(--text-tertiary); font-style: italic; }

  /* ── Detail header (fiche adhérent/etab) ─────────────────── */
  .detail-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
  .detail-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-tile-info); color: var(--text-info); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; }
  .detail-name { font-size: 18px; font-weight: 500; margin-bottom: 2px; }
  .detail-meta { font-size: 11px; color: var(--text-tertiary); }
  .detail-actions { margin-left: auto; display: flex; gap: 6px; }

  /* ── Tabs (D'Clic style) ─────────────────────────────────── */
  .tabs { display: flex; gap: 0; border-bottom: 0.5px solid var(--border); margin-bottom: 14px; }
  .tab { padding: 9px 12px; font-size: 12.5px; white-space: nowrap; color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .tab:hover { color: var(--text-secondary); }
  .tab.active { color: var(--text-bordeaux); border-bottom-color: var(--text-bordeaux); font-weight: 700; }

  /* ── Phase bar ──────────────────────────────────────────── */
  .phase-bar { padding: 14px 18px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
  .phase-bar h4 { margin: 0 0 12px 0; font-size: 12px; color: var(--text-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
  .phase-track { position: relative; padding: 0 16px; }
  .phase-line { position: absolute; top: 11px; left: 28px; right: 28px; height: 2px; background: var(--border-strong); z-index: 0; }
  .phase-line-fill { position: absolute; top: 11px; left: 28px; height: 2px; background: var(--text-bordeaux); z-index: 1; }
  .phase-steps { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; z-index: 2; }
  .phase-step { text-align: center; }
  .phase-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-tile-gray); color: var(--text-tertiary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; border: 2px solid var(--bg-card); }
  .phase-dot.done, .phase-dot.current { background: var(--text-bordeaux); color: #fff; }
  .phase-step .label { font-size: 11px; margin-top: 6px; }
  .phase-step .label.active { color: var(--text-bordeaux); font-weight: 700; }
  .phase-step .sub { font-size: 10px; color: var(--text-tertiary); }
  .phase-step .sub.muted { opacity: 0.6; }

  /* ── Milestones ─────────────────────────────────────────── */
  .milestones { display: grid; grid-template-columns: 1fr; gap: 5px; }
  .milestone { padding: 10px 14px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 5px; display: flex; align-items: center; gap: 10px; }
  .milestone.done { background: var(--bg-side); }
  .milestone.current { background: var(--bg-side-active); border-color: var(--text-bordeaux); border-left-width: 3px; }
  .milestone .mdot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0; }
  .milestone.done .mdot, .milestone.current .mdot { background: var(--text-bordeaux); }
  .milestone.pending .mdot { background: var(--border-strong); }
  .milestone .body { flex: 1; }
  .milestone .ttl { font-size: 13px; font-weight: 500; }
  .milestone .ttl.muted { color: var(--text-tertiary); }
  .milestone .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
  .milestone .when { font-size: 11px; color: var(--text-tertiary); margin-right: 8px; white-space: nowrap; }

  /* ── Section title within page ──────────────────────────── */
  h2.section { font-size: 13.5px; font-weight: 700; margin: 18px 0 8px 0; color: var(--text-bordeaux); display: flex; align-items: center; gap: 8px; }
  h2.section .ai-tag { font-size: 9px; padding: 2px 6px; background: var(--bg-tile-teal); color: var(--text-teal); border-radius: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

  /* ── Two-col layout ─────────────────────────────────────── */
  .two-col { display: grid; grid-template-columns: 2.2fr 1fr; gap: 14px; }
  @media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

  /* ── Cobot interface ────────────────────────────────────── */
  .cobot-shell { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
  @media (max-width: 1100px) { .cobot-shell { grid-template-columns: 1fr; } }
  .cobot-chat { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 14px; }
  .cobot-msg { padding: 10px 14px; margin-bottom: 8px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
  .cobot-msg.bot { background: var(--bg-tile-teal); border-left: 3px solid var(--text-teal); }
  .cobot-msg.user { background: var(--bg-side-hover); margin-left: 40px; }
  .cobot-msg .who { font-size: 10px; color: var(--text-tertiary); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
  .cobot-suggestion { padding: 10px 12px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 5px; margin-bottom: 6px; }
  .cobot-suggestion .name { font-size: 12px; font-weight: 500; color: var(--text-teal); }
  .cobot-suggestion .why { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

  /* ── Placeholder ────────────────────────────────────────── */
  .placeholder-block { padding: 40px 30px; text-align: center; background: var(--bg-card); border: 0.5px dashed var(--border-strong); border-radius: 8px; }
  .placeholder-block h3 { color: var(--text-tertiary); margin-top: 0; font-weight: 500; font-size: 15px; }
  .placeholder-block p { color: var(--text-tertiary); font-size: 12px; line-height: 1.55; max-width: 600px; margin: 6px auto; }
  .placeholder-block .badge-existing { display: inline-block; padding: 3px 10px; background: var(--bg-tile-success); color: var(--text-success); border-radius: 10px; font-size: 11px; font-weight: 500; margin-bottom: 14px; }
  .placeholder-block .badge-enriched { background: var(--bg-tile-teal); color: var(--text-teal); }
  .placeholder-block .badge-readonly { background: var(--bg-tile-gray); color: var(--text-tertiary); }

  /* ── Score circle for candidats ─────────────────────────── */
  .score-circle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 13px; }
  .score-high { background: var(--text-success); }
  .score-mid { background: var(--text-warning); }
  .score-low { background: var(--text-muted); }

  /* ── Sub-list inside fiche ──────────────────────────────── */
  .sub-list-item { padding: 10px 14px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 5px; margin-bottom: 5px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
  .sub-list-item:hover { border-color: var(--border-strong); background: var(--bg-side-hover); }
  .sub-list-item .name { font-size: 13px; font-weight: 500; }
  .sub-list-item .meta { font-size: 11px; color: var(--text-tertiary); }
  .sub-list-item .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

  /* ── Timeline ───────────────────────────────────────────── */
  .timeline { position: relative; padding-left: 32px; }
  .timeline::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: 10px; width: 2px; background: var(--border-strong); }
  .tl-event { position: relative; padding: 8px 0 8px 12px; margin-bottom: 4px; }
  .tl-event::before { content: ''; position: absolute; left: -28px; top: 11px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-bordeaux); border: 2px solid var(--bg-app); }
  .tl-event.amber::before { background: var(--text-warning); }
  .tl-event.muted::before { background: var(--text-tertiary); }
  .tl-event.special::before { background: var(--text-coral); }
  .tl-event .date { font-size: 10px; color: var(--text-tertiary); }
  .tl-event .ttl { font-size: 12.5px; font-weight: 500; }
  .tl-event .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

  /* ── Diag access tiles ──────────────────────────────────── */
  .diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
  .diag-tile { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 14px 16px; cursor: pointer; }
  .diag-tile:hover { border-color: var(--text-teal); }
  .diag-tile .name { font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text-teal); }
  .diag-tile .desc { font-size: 11px; color: var(--text-tertiary); line-height: 1.5; }
  .diag-tile .status { margin-top: 8px; font-size: 11px; }

  /* ── Show/hide ──────────────────────────────────────────── */
  .screen { display: none; }
  .screen.active { display: block; }
  .sidebar[data-role] { display: none; }
  .sidebar[data-role].active { display: block; }

  /* ── Counter tiles (D'Clic spécifique) ──────────────────── */
  .counter-tile { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 14px 16px; display: flex; align-items: center; cursor: pointer; }
  .counter-tile .left { flex: 1; }
  .counter-tile .left .v { font-size: 26px; font-weight: 500; line-height: 1.1; }
  .counter-tile .left .l { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .counter-tile .left .h { font-size: 11px; color: var(--text-bordeaux); cursor: pointer; }
  .counter-tile .right-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }


  /* ── Filter-bar standardisée · 1 ligne · filtres uniformes ───── */
  .filter-bar-std { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; overflow-x: auto; }
  .filter-bar-std > input,
  .filter-bar-std > select { flex: 1 1 0; min-width: 0; width: auto; text-overflow: ellipsis; }
  .filter-bar-std > .btn,
  .filter-bar-std > .btn-sm,
  .filter-bar-std > .spacer { flex: 0 0 auto; }
  .filter-bar-std .spacer { width: 6px; }
  /* ── Toggle vs N-1 partagé sur toutes les vues ─────────────── */
  /* Mode N (défaut) · seules les valeurs N sont visibles · aucun delta · aucune progression */
  .val-n { display: inline; }
  .val-n1, .progress-to-n, .delta-n1 { display: none; }
  /* Mode vs N-1 · valeur N-1 grise + flèche → valeur N + badges delta */
  body.show-n1 .val-n { display: none; }
  body.show-n1 .val-n1,
  body.show-n1 .progress-to-n,
  body.show-n1 .delta-n1 { display: inline; }
  .btn-vs-n1-active { background: var(--text-bordeaux) !important; color: white !important; }
  .val-n1 { color: var(--text-tertiary); }
  .progress-to-n { color: var(--text-success); font-weight: 600; margin-left: 8px; }

  /* ══════════════════════════════════════════════════════════
     Compléments Pulse (hors maquette) · formulaires, flashs,
     modales, sidebar cliquable, états vides
     ══════════════════════════════════════════════════════════ */
  .sidebar a.item, .sidebar a.menu-item-direct, .sidebar a.menu-header { text-decoration: none; }
  .sidebar .menu-header a { color: inherit; text-decoration: none; flex: 1; }
  .sidebar .legacy-hint { font-size: 10px; color: var(--text-muted); padding: 2px 10px 6px 26px; }
  .topbar .user a { color: inherit; text-decoration: none; }
  .topbar .notif { position: relative; cursor: pointer; text-decoration: none; color: var(--text-secondary); }
  .topbar .notif .count { position: absolute; top: -6px; right: -8px; background: var(--text-coral); color: #fff; border-radius: 8px; font-size: 9px; padding: 1px 5px; font-weight: 600; }

  /* Volet déroulant Notifications dans le Header */
  .tb-notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 330px;
    max-width: 90vw;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-strong, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .tb-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tile-gray, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
  }
  .tb-notif-list {
    max-height: 360px;
    overflow-y: auto;
  }
  .tb-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text-primary, #1e293b);
    border-bottom: 1px solid var(--border, #f1f5f9);
    transition: background 0.15s ease;
    font-size: 11.5px;
  }
  .tb-notif-item:hover {
    background: var(--bg-tile-info, #f0f9ff);
  }
  .tb-notif-item.unread {
    background: rgba(185, 28, 28, 0.05);
    font-weight: 600;
  }
  .tb-notif-item .notif-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
  }
  .tb-notif-item .notif-body {
    flex: 1;
    min-width: 0;
  }
  .tb-notif-item .notif-text {
    line-height: 1.35;
    word-break: break-word;
  }
  .tb-notif-item .notif-date {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
    font-weight: normal;
  }
  .tb-notif-footer {
    padding: 8px 12px;
    text-align: center;
    background: var(--bg-tile-gray, #f8fafc);
    border-top: 1px solid var(--border, #e2e8f0);
  }

  .flash { padding: 9px 14px; border-radius: 5px; font-size: 12px; margin-bottom: 10px; border: 0.5px solid var(--border); background: var(--bg-tile-info); color: var(--text-info); }
  .flash.info { background: var(--bg-tile-info); color: var(--text-info); }
  .flash.success { background: var(--bg-tile-success); color: var(--text-success); }
  .flash.warning { background: var(--bg-tile-warning); color: var(--text-warning); }
  .flash.error, .flash.danger { background: var(--bg-tile-coral); color: var(--text-coral); }

  .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
  .form-grid .full { grid-column: 1 / -1; }
  .field label { display: block; font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; font-weight: 500; }
  .field input, .field select, .field textarea { width: 100%; padding: 7px 10px; border: 0.5px solid var(--border-strong); border-radius: 5px; font-family: inherit; font-size: 12.5px; background: var(--bg-card); color: var(--text-primary); }
  .field input:focus, .field select:focus, .field textarea:focus, .filter-bar input:focus, .filter-bar select:focus, .fil-form textarea:focus { outline: none; border-color: var(--text-bordeaux); box-shadow: 0 0 0 3px rgba(112,21,15,.12); }
  .field textarea { min-height: 80px; resize: vertical; }
  .field .hint { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
  .form-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
  .panel-body { padding: 14px 16px; }
  .empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 12px; font-style: italic; }
  .placeholder-note { background: var(--bg-tile-warning); color: var(--text-warning); padding: 8px 12px; border-radius: 5px; font-size: 11.5px; margin-bottom: 12px; }
  .inline-form { display: inline; }
  .badge-src { font-size: 9.5px; padding: 1px 6px; border-radius: 8px; background: var(--bg-tile-gray); color: var(--text-tertiary); margin-left: 4px; }
  .gauge { display: inline-block; width: 60px; height: 6px; background: var(--bg-tile-gray); border-radius: 3px; vertical-align: middle; margin-right: 6px; position: relative; overflow: hidden; }
  .gauge > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-bordeaux); border-radius: 3px; }
  .gauge.ok > i { background: var(--text-success); }
  .gauge.low > i { background: var(--text-coral); }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
  .three-col { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
  @media (max-width: 1000px) { .three-col { grid-template-columns: 1fr; } }
  .kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; font-size: 12px; }
  .kv dt { color: var(--text-tertiary); }
  .kv dd { margin: 0; }
  .link { color: var(--text-bordeaux); text-decoration: none; }
  .link:hover { text-decoration: underline; }
  .modal-bg { display: none; position: fixed; inset: 0; background: rgba(31,26,26,0.45); z-index: 1040; align-items: center; justify-content: center; }
  .modal-bg.open { display: flex; }
  .pmodal { background: var(--bg-card); border-radius: 8px; padding: 18px 20px; width: min(560px, 92vw); max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
  .pmodal h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--text-bordeaux); }
  .step-card { cursor: pointer; }
  .step-card a { color: inherit; text-decoration: none; }
  .sortable { cursor: pointer; user-select: none; }
  .sortable::after { content: " ⇅"; opacity: 0.4; font-size: 10px; }
  .sortable.sort-asc::after { content: " ▲"; opacity: 0.9; color: var(--text-bordeaux); }
  .sortable.sort-desc::after { content: " ▼"; opacity: 0.9; color: var(--text-bordeaux); }
  .map-box { height: 480px; border-radius: 6px; border: 0.5px solid var(--border); }
  .text-right { text-align: right; }
  .nowrap { white-space: nowrap; }
  .mt { margin-top: 14px; }
  .mb { margin-bottom: 14px; }

  /* ── Fiches détaillées (candidat / établissement) ─────────── */
  .acc .acc-head { cursor: pointer; user-select: none; }
  .acc .acc-caret { font-size: 11px; color: var(--text-tertiary); transition: transform .15s; }
  .acc:not(.open) .acc-caret { transform: rotate(-90deg); }
  .acc:not(.open) .acc-body { display: none; }
  .acc-body { padding: 12px 16px; }
  .kv3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; font-size: 12.5px; }
  .kv3-item { padding: 4px 0; border-bottom: 0.5px dashed var(--border); }
  .kv3-l { color: var(--text-tertiary); }
  .kv3-v { font-weight: 500; }
  .kv3-v.muted { font-weight: 400; color: var(--text-muted); font-style: italic; }
  .src { font-size: 11px; opacity: .8; }
  .chip-purple { background: var(--bg-tile-purple); color: var(--text-purple); }
  .cand-step { padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: 12px; cursor: pointer; background: var(--bg-tile-gray); color: var(--text-tertiary); border: none; font-family: inherit; transition: transform .12s, box-shadow .12s; }
  .cand-step:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
  .cand-step.done { background: var(--bg-tile-success); color: var(--text-success); }
  a.cand-step { text-decoration: none; display: inline-block; }
  .cand-step.viewed { outline: 2px dashed var(--text-bordeaux); outline-offset: 2px; }
  .cand-step.active { background: var(--text-bordeaux); color: #fff; }
  .steps-band { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
  .steps-band .arrow { color: var(--text-muted); font-size: 12px; }
  .steps-band .lbl { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .4px; margin-right: 4px; }
  .etape-bloc { border-left: 3px solid var(--text-bordeaux); }
  .etape-bloc.dim { opacity: .55; }
  .hero-band { display: grid; grid-template-columns: 2fr 3fr; gap: 14px; margin-bottom: 12px; }
  @media (max-width: 1100px) { .hero-band { grid-template-columns: 1fr; } }
  .hero-id { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; }
  .hero-id .avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--text-bordeaux); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; flex-shrink: 0; }
  .hero-id h1 { font-size: 19px; margin: 0; }
  .hero-kpis { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 6px; padding: 10px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 12px; }
  .hero-kpis .k { padding: 4px 0 4px 8px; border-left: 2px solid var(--border-strong); }
  .hero-kpis .k .l { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .3px; }
  .hero-kpis .k .v { font-size: 15px; font-weight: 600; }
  .hero-kpis .k .h { font-size: 10.5px; color: var(--text-tertiary); }
  .subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
  .subtabs .tab { padding: 6px 12px; border: 0.5px solid var(--border); border-radius: 5px; margin: 0; }
  .subtabs .tab.active { background: var(--bg-side-active); border-color: var(--text-bordeaux); }
  .calendar-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
  .calendar-months .m { text-align: center; padding: 6px 0; border-radius: 4px; background: var(--bg-tile-gray); font-size: 11px; color: var(--text-tertiary); }
  .calendar-months .m.hi { background: var(--bg-tile-success); color: var(--text-success); font-weight: 600; }
  .calendar-months .m.lo { background: var(--bg-tile-coral); color: var(--text-coral); }
  .bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
  .bars .b { flex: 1; background: var(--text-bordeaux); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
  .bars .b.hc { background: var(--br-rose); }
  .bars-lbl { display: flex; gap: 3px; font-size: 9px; color: var(--text-muted); }
  .bars-lbl span { flex: 1; text-align: center; }

/* Saisies hors .field (tableaux de propositions, CR) : même police que la page */
table.data input[type="text"], table.data input[type="date"], table.data input[type="number"], table.data textarea, table.data select,
.panel-body > form > textarea, textarea[name="transcript"], textarea[name="note"] { font-family: inherit; font-size: 12px; padding: 4px 6px; border: 0.5px solid var(--border-strong); border-radius: 4px; background: var(--bg-card); color: var(--text-primary); }
/* Puces participants (modale RDV) */
.rdv-pchip { cursor: pointer; border: 1px solid var(--border-strong); background: var(--bg-card); font-family: inherit; }
.rdv-pchip.on { border-color: var(--text-success); }
/* Choix multiples (type multi du dictionnaire) */
.multi { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.field .multi label, .multi label { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text-primary); font-weight: 400; white-space: nowrap; margin: 0; cursor: pointer; }
.field .multi input[type="checkbox"], .multi input[type="checkbox"] { width: auto; margin: 0; }
/* Rendu Markdown minimal (compte rendu de RDV) */
.md { font-size: 12.5px; line-height: 1.5; }
.md .md-h { margin: 8px 0 3px; font-size: 13px; font-weight: 600; color: var(--text-bordeaux); }
.md h3.md-h { font-size: 13.5px; }
.md .md-ul { margin: 2px 0 6px; padding-left: 18px; }
.md .md-p { margin: 3px 0; }

/* Barre de navigation d'un audit ouvert depuis une fiche (diag achats) */
.audit-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg-tile-teal); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-bottom: 12px; font-size: 12px; }

/* Registre d'identités (clé SIREN/SIRET) */
.identite-ligne{font-size:12px;color:var(--text-tertiary)}
.identite-ligne .inline-details{display:inline-block}
.identite-ligne .inline-details summary{cursor:pointer;display:inline;list-style:none}
.identite-ligne .inline-form{display:inline-flex;gap:4px;margin-left:6px}
.identite-ligne .inline-form input{font-size:12px;padding:2px 6px;width:170px}

/* Cartographie des achats · édition en ligne */
.carto .carto-marche td{font-size:10px;text-transform:uppercase;letter-spacing:.6px;font-weight:700;color:var(--text-bordeaux);background:var(--bg-soft);padding:5px 12px}
.carto .carto-cat.vide td{opacity:.6}
.carto .carto-toggle{cursor:pointer}
.carto .chev{color:var(--text-bordeaux);font-size:10px}
.carto .carto-det td{background:#FBF9F8;font-size:12px}
.ed{display:inline-block;min-width:48px;min-height:16px;border-bottom:1px dashed var(--border-strong);padding:1px 3px;border-radius:2px;cursor:text;font-size:12px;color:var(--text-secondary)}
.ed.strong{color:inherit;font-weight:600}
.ed.num{min-width:36px;text-align:right}
.ed:hover{background:var(--bg-tile-gray)}
.ed:empty:not(:focus):before{content:attr(data-placeholder);color:var(--text-tertiary);font-style:italic}
.ed:focus{outline:none;background:var(--bg-tile-warning)}
.ed:empty::before{content:'+ note';color:var(--text-muted)}
.ed.num:empty::before{content:'—'}
.ed.saving{opacity:.5}
.ed.saved{background:var(--bg-tile-success)}
.ed.err{background:var(--bg-tile-coral)}
.sat{cursor:pointer;font-size:14px;user-select:none}

/* Recalcul du diag achats : voile sur tout le bloc pour ne pas décider sur des chiffres périmés */
.diag-overlay{position:absolute;inset:0;z-index:5;background:rgba(255,255,255,.78);backdrop-filter:blur(1.5px);display:flex;align-items:flex-start;justify-content:center;padding-top:60px;border-radius:6px}
.diag-overlay-box{background:var(--bg-card,#fff);border:1px solid var(--border-strong);border-radius:8px;padding:14px 20px;box-shadow:0 8px 30px rgba(0,0,0,.12);text-align:center;font-size:13px;position:sticky;top:80px}
.diag-overlay .spinner-sm{vertical-align:middle}   /* battement charte : theme-baresto.css */
@keyframes diag-spin{to{transform:rotate(360deg)}}

  /* ─── Dossiers (Actions à mener façon Salesforce) : kanban + fil d'activité ─── */
  .kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
  .kcol { background: var(--bg-tile-gray); border-radius: 8px; padding: 8px; min-height: 120px; }
  .kcol.done { opacity: 0.75; }
  .khead { font-size: 12px; font-weight: 500; color: var(--text-secondary); padding: 2px 4px 8px; display: flex; align-items: center; gap: 6px; }
  .kcard { display: block; background: var(--bg-card); border: 0.5px solid var(--border); border-left: 3px solid var(--text-bordeaux); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; text-decoration: none; color: inherit; }
  .kcard:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
  .kcard.late { border-left-color: var(--text-coral); }
  .kcard.crit { border-left-color: var(--text-alert); }
  .kttl { font-size: 12.5px; font-weight: 500; }
  .ksub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
  .kmeta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-secondary); margin-top: 6px; }
  .kmeta .late { color: var(--text-coral); font-weight: 500; }
  .kempty { font-size: 11px; color: var(--text-tertiary); text-align: center; padding: 12px 0; }
  .fil-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
  .fil-form textarea { flex: 1; padding: 7px 10px; border: 0.5px solid var(--border-strong); border-radius: 5px; font-family: inherit; font-size: 12.5px; resize: vertical; }
  .fil-item { display: flex; gap: 10px; padding: 8px 0; border-top: 0.5px solid var(--border); }
  .fil-item.evenement .fil-text { color: var(--text-secondary); font-style: italic; }
  .fil-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-tile-info); color: var(--text-info); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .fil-meta { font-size: 11px; color: var(--text-tertiary); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .fil-text { font-size: 12.5px; white-space: pre-wrap; margin-top: 2px; }

  /* ═══════════════════════════════════════════════════════════════════════
     Mobile (≤ 900 px) : sidebar off-canvas + burger, barre de navigation basse,
     grilles en une colonne, onglets défilants, tableaux et kanban en défilement horizontal.
     Rien ne change au-dessus de 900 px.
     ═══════════════════════════════════════════════════════════════════════ */
  .burger { display: none; border: 0.5px solid var(--border-strong); background: var(--bg-card); border-radius: 6px; font-size: 18px; line-height: 1; padding: 6px 10px; cursor: pointer; color: var(--text-secondary); }
  .side-backdrop { display: none; }
  .bottom-nav { display: none; }
  @media (max-width: 900px) {
    html, body { height: auto; }
    body { display: block; min-height: 100vh; -webkit-text-size-adjust: 100%; }
    .topbar { padding: 8px 10px; gap: 8px; position: sticky; top: 0; z-index: 30; }
    .topbar .logo-sub, .topbar .tb-badge, .topbar .help { display: none; }
    .topbar .tb-retour { max-width: 140px; }
    .topbar .tb-search { flex: 1 1 120px; margin-left: 4px; } .topbar .tb-search input { padding-left: 26px; }
    .topbar .pulse-logo { font-size: 17px; }
    .topbar .right { gap: 8px; }
    .topbar .user { padding: 4px 8px; }
    .burger { display: inline-block; }
    .shell { display: block; overflow: visible; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); z-index: 60; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,0.25); padding-top: 14px; }
    body.side-open .sidebar { transform: translateX(0); }
    body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 55; }
    body.side-open { overflow: hidden; }
    .sidebar .item, .sidebar .menu-header, .sidebar .menu-item-direct { padding-top: 10px; padding-bottom: 10px; }   /* cibles tactiles */
    .main { padding: 12px 12px 84px; overflow: visible; min-width: 0; }
    .audit-nav { flex-wrap: wrap; }
    h1.page-title { font-size: 19px; }
    .breadcrumb { white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kpi-tile .v { font-size: 22px; }
    .two-col, .three-col, .hero-band, .cobot-shell { grid-template-columns: 1fr; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs .tab { padding: 10px 12px; flex: 0 0 auto; }
    .subtabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .subtabs .tab { flex: 0 0 auto; }
    .filter-bar { padding: 8px; gap: 6px; }
    .filter-bar input, .filter-bar select { min-width: 0; flex: 1 1 45%; font-size: 14px; }   /* 14 px = pas de zoom iOS au focus */
    .filter-bar .btn { flex: 0 0 auto; }
    .btn { --bs-btn-padding-y: 8px; --bs-btn-padding-x: 12px; --bs-btn-font-size: 13px; }
    .btn-sm { --bs-btn-padding-y: 6px; --bs-btn-padding-x: 9px; --bs-btn-font-size: 12px; }
    .field input, .field select, .field textarea, .fil-form textarea, .ed { font-size: 14px; }
    .form-grid { grid-template-columns: 1fr; }
    .panel-header { flex-wrap: wrap; row-gap: 6px; padding: 10px 12px; }
    .panel-header .right { margin-left: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
    .panel-body { padding-left: 12px; padding-right: 12px; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.data { min-width: 560px; }
    table.data th, table.data td { padding: 8px 8px; }
    .kanban { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; }
    .kcol { scroll-snap-align: start; }
    .pmodal { width: 96vw; max-height: 92vh; padding: 14px; }
    .inbox-card { flex-wrap: wrap; }
    .fil-form { flex-direction: column; align-items: stretch; }
    .cand-steps, .cand-step { font-size: 11px; }
    /* Barre basse */
    .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg-card); border-top: 0.5px solid var(--border); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
    .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-tertiary); text-decoration: none; padding: 4px 0; }
    .bottom-nav a span { font-size: 18px; line-height: 1; position: relative; }
    .bottom-nav a.active { color: var(--text-bordeaux); font-weight: 500; }
    .bottom-nav .dot { position: absolute; top: -6px; right: -10px; background: var(--text-coral); color: #fff; border-radius: 9px; font-size: 9px; padding: 1px 5px; font-weight: 600; }
    #feedback-btn { bottom: 72px !important; }
  }
  @media (max-width: 480px) {
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-tile { padding: 10px; }
    .kanban { grid-auto-columns: 88vw; }
  }
  /* Chatter · réponses sous un message */
  .fil-reponses { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--br-bordeaux-tint); }
  .fil-item.fil-rep { border-top: 0; padding: 5px 0; }
  .fil-form-rep { margin: 6px 0 0; }
  .fil-form-rep textarea { min-height: 30px; font-size: 12px; }
  .fil-item:target { background: var(--br-bordeaux-tint); border-radius: 6px; padding-left: 6px; padding-right: 6px; }
  /* @mentions : liste de l'équipe sous la zone de saisie */
  .mention-box { position: absolute; z-index: 1060; background: var(--bg-card); border: 0.5px solid var(--border-strong); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; font-size: 12px; }
  .mention-item { padding: 5px 8px; border-radius: 4px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
  .mention-item.sel, .mention-item:hover { background: var(--bg-side-active); color: var(--text-bordeaux); }

  /* ── Assistant Pulse (panneau latéral · Ctrl+J) ─────────────── */
  .topbar .tb-asst { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border: 0.5px solid var(--border-strong); border-radius: 14px; background: linear-gradient(120deg, #fff6f3, #f3eef8); color: var(--text-bordeaux); cursor: pointer; }
  .topbar .tb-asst:hover { border-color: var(--text-bordeaux); }
  .asst { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 96vw); background: var(--bg-card); border-left: 0.5px solid var(--border-strong); box-shadow: -8px 0 30px rgba(31,26,26,.16); z-index: 150; display: flex; flex-direction: column; font-size: 12.5px; }
  .asst-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 0.5px solid var(--border); background: linear-gradient(120deg, #fff6f3, #f3eef8); }
  .asst-title { font-weight: 700; font-size: 13.5px; } .asst-ctx { font-weight: 500; color: var(--text-secondary); font-size: 12px; }
  .asst-tools { display: flex; gap: 4px; }
  .asst-ib { font: inherit; font-size: 13px; line-height: 1; padding: 5px 7px; border: 0.5px solid transparent; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; text-decoration: none; }
  .asst-ib:hover { border-color: var(--border-strong); background: var(--bg-card); color: var(--text-primary); }
  .asst-histlist { max-height: 40vh; overflow: auto; border-bottom: 0.5px solid var(--border); background: var(--bg-tile-gray); }
  .asst-histit { display: block; padding: 7px 12px; text-decoration: none; color: inherit; border-bottom: 0.5px solid var(--border); }
  .asst-histit:hover, .asst-histit.on { background: var(--bg-tile-bordeaux, #F5EDEC); }
  .asst-body { flex: 1; overflow: auto; padding: 12px; }
  .asst-note { color: var(--text-secondary); font-size: 12px; margin: 0 0 10px; }
  .asst-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
  .asst-chip { font: inherit; font-size: 12px; padding: 5px 10px; border: 0.5px solid var(--border-strong); border-radius: 14px; background: var(--bg-tile-gray); cursor: pointer; text-align: left; }
  .asst-chip:hover { border-color: var(--text-bordeaux); color: var(--text-bordeaux); }
  .asst-msg { margin: 10px 0; }
  .asst-bubble { padding: 8px 12px; border-radius: 10px; background: var(--bg-tile-gray); }
  .asst-user .asst-bubble { background: var(--bg-tile-bordeaux, #F5EDEC); margin-left: 14%; }
  .asst-erreur .asst-bubble { background: var(--bg-tile-coral); color: var(--text-coral); }
  .asst-bubble .md-h { font-size: 12.5px; margin: 8px 0 4px; } .asst-bubble .md-p { margin: 4px 0; } .asst-bubble .md-ul { margin: 4px 0; padding-left: 18px; }
  .asst-bubble .md-q, .md-q { margin: 4px 0; padding: 4px 10px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); font-style: italic; }
  .asst-src { font-size: 11px; color: var(--text-tertiary); margin: 4px 4px 0; }
  .asst-prop { margin: 8px 0 0 10px; padding: 8px 10px; border: 0.5px solid var(--border-strong); border-left: 3px solid var(--text-bordeaux); border-radius: 8px; background: var(--bg-card); }
  .asst-prop-valide { border-left-color: var(--text-success, #2e7d32); } .asst-prop-rejete { opacity: .6; border-left-color: var(--border-strong); }
  .asst-prop-t { font-weight: 700; margin-bottom: 4px; }
  .asst-prop label { display: block; font-size: 11px; color: var(--text-secondary); margin: 4px 0; }
  .asst-prop input, .asst-prop textarea, .asst-prop select { display: block; width: 100%; font: inherit; font-size: 12px; padding: 4px 6px; border: 0.5px solid var(--border-strong); border-radius: 6px; margin-top: 2px; }
  .asst-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .asst-prop-btns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
  .asst-brouillon-txt { margin-top: 6px; padding: 8px 10px; background: var(--bg-tile-gray); border-radius: 6px; max-height: 40vh; overflow: auto; }
  .asst-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 0.5px solid var(--border); align-items: flex-end; }
  .asst-form textarea { flex: 1; font: inherit; font-size: 12.5px; padding: 6px 10px; border: 0.5px solid var(--border-strong); border-radius: 8px; resize: vertical; min-height: 40px; }
  .asst-foot { padding: 4px 12px 8px; font-size: 10.5px; color: var(--text-tertiary); }
  .asst-dots i { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--text-tertiary); animation: asst-b 1s infinite; } .asst-dots i:nth-child(2) { animation-delay: .2s; } .asst-dots i:nth-child(3) { animation-delay: .4s; }
  @keyframes asst-b { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
  body.asst-open .main { padding-right: min(470px, 96vw); }
  /* mode page */
  .asst-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
  .asst.asst-page { position: static; width: auto; height: min(74vh, 820px); box-shadow: none; border: 0.5px solid var(--border-strong); border-radius: 10px; }
  .asst-synth .md-h { font-size: 14px; margin: 12px 0 6px; color: var(--text-bordeaux); }
  /* bloc « à surveiller » des fiches */
  .asst-alertes { display: flex; flex-direction: column; gap: 4px; }
  .asst-al { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 6px; background: var(--bg-tile-gray); font-size: 12px; text-decoration: none; color: inherit; }
  .asst-al.alerte { background: var(--bg-tile-coral); } .asst-al.attention { background: var(--bg-tile-warning, #FFF4E0); }
  .asst-al:hover { outline: 0.5px solid var(--border-strong); }
  @media (max-width: 900px) { .asst-layout { grid-template-columns: 1fr; } body.asst-open .main { padding-right: 14px; } .asst { width: 100vw; } }
  .asst-prop .md-h, .asst-brouillon-txt .md-h { font-size: 12.5px; margin: 6px 0 3px; }
  .asst-prop .md-p, .asst-prop .md-ul { margin: 3px 0; } .asst-prop .md-ul { padding-left: 18px; }
  table.data tr.row-alert td { background: var(--bg-tile-coral); }
  .cle-affichee { user-select: all; font-size: 12px; padding: 2px 6px; background: var(--bg-card); border: 0.5px solid var(--border-strong); border-radius: 4px; }

/* ── Chantier · frise des six étapes (15/09) ── */
.ch-frise .ch-cartes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px 12px 4px; }
.ch-carte { border: 0.5px solid var(--border-strong); border-radius: 8px; background: var(--bg-card); padding: 8px 10px; font-size: 11.5px; position: relative; transition: transform .12s; }
.ch-carte.fait { border-color: var(--text-success); background: var(--bg-tile-success); }
.ch-carte.courant { border: 2px solid var(--br-bordeaux); background: var(--br-bordeaux-tint); transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.ch-carte.a_venir { opacity: .72; }
.ch-carte.arrete { border-color: var(--text-tertiary); border-style: dashed; }
.ch-carte.retard.courant, .ch-carte.retard .ch-date { color: var(--text-coral); }
.ch-tete { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.ch-num { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; background: var(--bg-tile-gray); color: var(--text-secondary); }
.ch-carte.fait .ch-num { background: var(--text-success); color: #fff; }
.ch-carte.courant .ch-num { background: var(--br-bordeaux); color: #fff; }
.ch-date { margin-left: auto; font-size: 10.5px; color: var(--text-tertiary); white-space: nowrap; }
.ch-carte.fait .ch-date { color: var(--text-success); font-weight: 600; }
.ch-carte.courant .ch-date { color: var(--br-bordeaux); font-weight: 700; }
.ch-indic { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ch-indic .chip { font-size: 9.5px; }
.ch-txt { margin: 0; }
.ch-txt dt { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); margin-top: 5px; }
.ch-txt dd { margin: 1px 0 0; line-height: 1.4; color: var(--text-secondary); }
.ch-carte.courant .ch-txt dd { color: var(--text-primary); }
.ch-action { margin-top: 8px; }
.ch-pied { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 12px 10px; }
/* mode compact : une ligne, cartes dépliables */
.ch-frise.compact .ch-cartes { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ch-frise.compact .ch-carte { padding: 5px 8px; cursor: pointer; transform: none; }
.ch-frise.compact .ch-carte:not(.open) .ch-corps { display: none; }
.ch-frise.compact .ch-carte:not(.open) .ch-tete b { font-size: 11.5px; }
@media (max-width: 1100px) { .ch-frise .ch-cartes { grid-template-columns: repeat(3, 1fr); } .ch-frise.compact .ch-cartes { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 700px) { .ch-frise .ch-cartes { grid-template-columns: 1fr; } }
/* mini-frise (plan achats, listes) : six points + étape courante */
.ch-mini { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 10.5px; }
.ch-mini i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-tile-gray); border: 0.5px solid var(--border-strong); }
.ch-mini i.fait { background: var(--text-success); border-color: var(--text-success); }
.ch-mini i.courant { background: var(--br-bordeaux); border-color: var(--br-bordeaux); width: 10px; height: 10px; }
.ch-mini i.courant.retard { background: var(--text-coral); border-color: var(--text-coral); }
.ch-mini i.arrete { background: var(--text-tertiary); }
.ch-mini b { margin-left: 4px; font-weight: 600; }

/* ── Chantier · parcours par partenaire (4 jalons) ── */
.ch-parts { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; }
.ch-part { border: 0.5px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; background: var(--bg-card); }
.ch-part.perdue { opacity: .6; } .ch-part.active { border-color: var(--text-success); background: var(--bg-tile-success); }
.ch-part-tete { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.ch-jalons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.ch-jalon { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; border-radius: 6px; padding: 6px 8px; border: 0.5px solid var(--border-strong); background: var(--bg-card); }
.ch-jalon > i { flex: 0 0 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--bg-tile-gray); color: var(--text-secondary); }
.ch-jalon > div { min-width: 0; } .ch-jalon b { display: block; font-size: 11.5px; } .ch-jalon span { display: block; color: var(--text-tertiary); font-size: 10.5px; line-height: 1.35; margin: 1px 0 4px; }
.ch-jalon.fait { border-color: var(--text-success); } .ch-jalon.fait > i { background: var(--text-success); color: #fff; }
.ch-jalon.courant { border: 1.5px solid var(--br-bordeaux); background: var(--br-bordeaux-tint); } .ch-jalon.courant > i { background: var(--br-bordeaux); color: #fff; }
.ch-jalon.a_venir { opacity: .65; }
@media (max-width: 1100px) { .ch-jalons { grid-template-columns: repeat(2, 1fr); } }

/* ── Analyse des achats mensuels (onglet Diags) : barres empilées mercuriale / hors mercuriale, colonnes glissables → nouveau diag ── */
.am-leg { display:inline-block; width:10px; height:10px; border-radius:2px; vertical-align:middle; } .am-leg.cat { background: var(--br-bordeaux); } .am-leg.hc { background: #c9c7c0; }
.am-wrap { position:relative; height:260px; padding: 6px 4px 22px 48px; }
.am-grid { position:absolute; left:48px; right:4px; top:6px; bottom:22px; pointer-events:none; }
.am-gl { position:absolute; left:0; right:0; border-top: 1px solid var(--border); }
.am-gl span { position:absolute; left:-46px; top:-7px; width:40px; text-align:right; font-size:10px; color: var(--text-tertiary); }
.am-chart { position:relative; display:flex; gap:3.2%; align-items:flex-end; height:100%; }
.am-col { flex:1; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-end; height:100%; position:relative; }
.am-col[draggable="true"] { cursor: grab; } .am-col[draggable="true"]:hover .am-stack { filter: brightness(1.08); } .am-col.dragging { opacity:.5; }
.am-stack { display:flex; flex-direction:column; width:100%; min-height:1px; }
.am-seg { display:flex; align-items:center; justify-content:center; font-size:10.5px; font-weight:600; min-height:0; overflow:hidden; }
.am-seg.cat { background: var(--br-bordeaux); color:#fff; } .am-seg.hc { background: #c9c7c0; color: var(--text-primary); }
.am-lbl { position:absolute; top:100%; left:0; right:0; text-align:center; font-size:10px; color: var(--text-tertiary); margin-top:5px; white-space:nowrap; }
#am-drop { font-size:11.5px; border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 5px 10px; color: var(--text-secondary); transition: all .15s; }
#am-drop.armee { border-color: var(--br-bordeaux); color: var(--br-bordeaux); background: var(--br-bordeaux-tint); }
#am-drop.survol { background: var(--bg-tile-success); border-color: var(--text-success); color: var(--text-success); transform: scale(1.04); }

/* ── Pages legacy (rapport stratégie, achats…) dans la coquille : --bs-body-bg est mis à transparent par ces pages, ce qui rendait
   invisibles les modales Bootstrap (fond, champs, cartes). Règles communes, quel que soit le layout (15/09). ── */
.legacy .modal { --bs-modal-bg: var(--bg-card, #fff); --bs-modal-color: var(--text-primary); }
.legacy .modal-content { background-color: var(--bg-card, #fff); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.legacy .modal .card.bg-light, .legacy .modal .bg-light { background-color: var(--bg-tile-gray, #F5F3F0) !important; }
.legacy .form-control, .legacy .form-select, .legacy .input-group-text { background-color: var(--bg-card, #fff); color: var(--text-primary); }
.legacy .form-control:disabled, .legacy .form-control[readonly] { background-color: var(--bg-tile-gray, #F5F3F0); color: var(--text-secondary); }
.legacy .modal .table-light th, .legacy .modal .table thead th { background: var(--bg-table-head); }
.legacy .modal .table-group-divider { border-top-color: var(--border-strong); }
.legacy .modal-header.bg-dark { background-color: var(--br-bordeaux-dark, #4a0d09) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   Indicateur de chargement global (Page Loader - délai 0.5s)
   ═══════════════════════════════════════════════════════════════════════════ */
.pulse-page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.pulse-page-loader.is-loading {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Barre supérieure animée (style NProgress avec dégradé charte) ── */
.pulse-page-loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #70150F 0%, #E50040 30%, #959D64 60%, #E50040 85%, #70150F 100%);
  background-size: 250% 100%;
  animation: pulsePageLoaderBarAnim 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 10px rgba(229, 0, 64, 0.55), 0 0 4px rgba(112, 21, 15, 0.35);
  z-index: 1000001;
}

@keyframes pulsePageLoaderBarAnim {
  0% { background-position: 250% 0; }
  100% { background-position: -150% 0; }
}

/* ── Voile en verre poli (backdrop blur) ── */
.pulse-page-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 245, 243, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: wait;
  z-index: 1000000;
}

/* ── Carte centrale Pulse ── */
.pulse-page-loader-box {
  background: var(--bg-card, #ffffff);
  border: 1px solid rgba(112, 21, 15, 0.12);
  border-radius: 16px;
  padding: 26px 36px 20px;
  box-shadow: 0 20px 48px -10px rgba(112, 21, 15, 0.14), 0 6px 18px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  transform: translateY(10px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.pulse-page-loader.is-loading .pulse-page-loader-box {
  transform: translateY(0) scale(1);
}

/* ── Battement d'icône Pulse ── */
.pulse-loader-heartbeat-wrap {
  width: 56px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pulse-loader-heartbeat {
  width: 48px;
  height: 48px;
  color: var(--br-bordeaux, #70150F);
  animation: pulseLoaderHeartbeat 1.15s ease-in-out infinite;
  transform-origin: center;
}

@keyframes pulseLoaderHeartbeat {
  0%, 100% { transform: scale(1); color: var(--br-bordeaux, #70150F); filter: drop-shadow(0 0 0 rgba(229,0,64,0)); }
  14% { transform: scale(1.18); color: var(--br-rouge, #E50040); filter: drop-shadow(0 0 10px rgba(229,0,64,0.45)); }
  28% { transform: scale(0.98); color: var(--br-bordeaux, #70150F); }
  42% { transform: scale(1.12); color: var(--br-rouge, #E50040); filter: drop-shadow(0 0 6px rgba(229,0,64,0.35)); }
  70% { transform: scale(1); color: var(--br-bordeaux, #70150F); }
}

.pulse-loader-title {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1F1A1A);
  letter-spacing: 0.1px;
  margin: 0;
}

.pulse-loader-subtitle {
  font-size: 12px;
  color: var(--text-tertiary, #6F6664);
  margin: 0;
  line-height: 1.4;
}

/* ── Micro-points d'animation ── */
.pulse-loader-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.pulse-loader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--br-lie-de-vin, #973756);
  opacity: 0.3;
  animation: pulseLoaderDotsAnim 1.3s infinite ease-in-out both;
}

.pulse-loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.pulse-loader-dots span:nth-child(2) { animation-delay: -0.16s; }
.pulse-loader-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes pulseLoaderDotsAnim {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; background: var(--br-rouge, #E50040); }
}

.pulse-loader-cancel {
  background: transparent;
  border: 1px solid var(--border, #E6E0DD);
  color: var(--text-tertiary, #6F6664);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.pulse-loader-cancel:hover {
  background: var(--br-gris-tint, #F3F0EE);
  color: var(--text-primary, #1F1A1A);
  border-color: var(--border-strong, #D8D0CD);
}

@media (prefers-reduced-motion: reduce) {
  .pulse-loader-heartbeat, .pulse-page-loader-bar, .pulse-loader-dots span {
    animation: none !important;
  }
}

/* ─── Tempo Badges (Sidebar & Topbar) ─────────────────────── */
.tempo-menu-badges {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tempo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.tempo-badge.todo {
  background-color: #2563EB;
  color: #ffffff;
}

.tempo-badge.progress {
  background-color: #D97706;
  color: #ffffff;
}

.tempo-dot-critique {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #DC2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
  display: inline-block;
  animation: tempo-critique-pulse 2s infinite ease-in-out;
}

@keyframes tempo-critique-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.tb-tempo-btn {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.tb-tempo-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--text-primary);
}

