:root {
  --c-marque: #3595A9;
  --c-marque-12: rgba(53, 149, 169, 0.12);
  --c-marque-08: rgba(53, 149, 169, 0.08);
  --c-entreprise: #001D4B;
  --c-entreprise-08: rgba(0, 29, 75, 0.08);
  --c-complement: #E7B46F;
  --c-complement-15: rgba(231, 180, 111, 0.18);
  --c-alerte: #EE2E6B;
  --c-alerte-12: rgba(238, 46, 107, 0.12);
  --c-encours: #E9870C;
  --c-encours-12: rgba(233, 135, 12, 0.12);
  --c-valide: #01C0AA;
  --c-valide-12: rgba(1, 192, 170, 0.14);
  --c-text: #0E1828;
  --c-text-2: #4A5568;
  --c-text-3: #8A94A6;
  --c-bg: #F4F7FA;
  --c-surface: #FFFFFF;
  --c-border: #E4EAF1;
  --c-border-2: #EFF3F8;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-soft: 0 1px 2px rgba(0, 29, 75, 0.04);
  --shadow-1: 0 1px 3px rgba(0, 29, 75, 0.05), 0 1px 2px rgba(0, 29, 75, 0.04);
  --shadow-2: 0 4px 14px rgba(0, 29, 75, 0.07), 0 2px 4px rgba(0, 29, 75, 0.04);
  --shadow-3: 0 12px 36px rgba(0, 29, 75, 0.14), 0 4px 8px rgba(0, 29, 75, 0.06);
  --shadow-side: 1px 0 3px rgba(0, 29, 75, 0.04);
  --shadow-top: 0 1px 3px rgba(0, 29, 75, 0.04);
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .25s ease;
}

/* ===== Sidebar réduite quand Walfy est ouvert ===== */
body.walfy-open .app { grid-template-columns: 68px 1fr; }
body.walfy-open .sidebar { padding: 0 8px 8px; transition: padding .25s ease; }
body.walfy-open .sidebar .brand { justify-content: center; gap: 0; }
body.walfy-open .sidebar .brand-img-full { display: none; }
body.walfy-open .sidebar .brand-img-icon { display: block; }
body.walfy-open .sidebar .nav-item { justify-content: center; padding: 10px 8px; gap: 0; }
body.walfy-open .sidebar .nav-item > span { display: none; }
body.walfy-open .sidebar .nav-item.active::before { left: -8px; }
body.walfy-open .sidebar .walfy-mascot-img-wrap { width: 48px; height: 48px; border-radius: 12px; margin: 0 auto; }
body.walfy-open .sidebar .walfy-mascot-text { display: none; }
body.walfy-open .sidebar .walfy-img-fullbody { object-position: 50% 15%; }

/* Quand Walfy est ouvert : panneau expanded se rapproche de la nouvelle sidebar */
body.walfy-open .ai-panel.expanded { left: calc(68px + 16px); }
body.rtl.walfy-open .ai-panel.expanded { left: 16px; right: calc(68px + 16px); }

/* ===== Sidebar ===== */
.sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  box-shadow: var(--shadow-side);
  display: flex;
  flex-direction: column;
  padding: 0 14px 8px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  margin-bottom: 14px;
}
.brand-img { height: 48px; width: auto; display: block; }
.brand-img-icon { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-bottom {
  position: sticky;
  bottom: 16px;
  background: var(--c-surface);
  padding-top: 14px;
  box-shadow: 0 -10px 14px -8px var(--c-surface);
  flex-shrink: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--c-text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover { background: var(--c-marque-08); color: var(--c-marque); }
}
.nav-item.active {
  background: var(--c-marque-12);
  color: var(--c-marque);
  font-weight: 600;
  position: relative;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--c-marque);
  border-radius: 0 3px 3px 0;
}

/* ===== Topbar ===== */
.main { display: flex; flex-direction: column; min-width: 0; position: relative; }
.main.ai-floating-open .view { padding-right: 360px; }
.topbar {
  height: 64px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--c-marque-08);
  color: var(--c-marque);
}
.page-icon svg { width: 18px; height: 18px; }
.page-title { font-size: 18px; font-weight: 600; margin: 0; color: var(--c-entreprise); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--c-text-2);
  display: grid;
  place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--c-bg); }
.icon-btn svg { width: 18px; height: 18px; }
.badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--c-alerte);
  border-radius: 50%;
  border: 2px solid white;
}
.lang { display: flex; align-items: center; gap: 6px; color: var(--c-text-2); font-weight: 500; }
.flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.flag svg { display: block; width: 100%; height: 100%; }
.user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: 8px; transition: background .15s; }
.user:hover { background: var(--c-bg); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-marque), var(--c-entreprise));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.avatar.avatar-img { object-fit: cover; background: none; }
.user-meta .user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-meta .user-role { color: var(--c-text-3); font-size: 12px; line-height: 1.2; }
.chev { width: 14px; height: 14px; color: var(--c-text-3); }

/* ===== View ===== */
.view { padding: 24px 28px; min-width: 0; }

/* ===== Tabs ===== */
.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--c-surface);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-soft);
}
.tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--c-text-2);
  font-weight: 500;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--c-marque); }
.tab.active { background: var(--c-marque); color: white; font-weight: 600; }
.tab-count {
  background: rgba(255,255,255,0.2);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
}
.tab:not(.active) .tab-count { background: var(--c-bg); color: var(--c-text-3); }

/* En-tête d'onglets (fournisseurs, conformité, documents) : sans cadre, coins bas carrés */
.tabs-row > .tabs:first-child {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
  border-radius: 0;
}
.tabs-row > .tabs:first-child .tab {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px 10px 0 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-bottom: none;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.tabs-row > .tabs:first-child .tab + .tab { margin-left: -1px; }
.tabs-row > .tabs:first-child .tab.active {
  background: var(--c-marque);
  color: white;
  border-color: var(--c-marque);
  z-index: 2;
}
.tabs-row > .tabs:first-child .tab:not(.active):hover {
  background: rgba(53, 149, 169, 0.08);
  color: var(--c-marque);
  border-color: rgba(53, 149, 169, 0.25);
  z-index: 1;
}

.tabs-actions { display: flex; align-items: center; gap: 8px; }

/* Barre de recherche étendue, avec icône intégrée à droite */
.search-group {
  flex: 1;
  min-width: 240px;
  margin: 0 20px;
}
.search-has-btn input { padding-right: 44px; }
.search-inline-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--c-text-3);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .15s, background .15s;
}
.search-inline-btn:hover {
  color: var(--c-marque);
  background: rgba(53, 149, 169, 0.08);
}
.search-inline-btn svg { width: 16px; height: 16px; }
.toolbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--c-text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
  flex-shrink: 0;
  padding: 0;
}
.toolbar-icon-btn:hover {
  color: var(--c-marque);
  background: rgba(53, 149, 169, 0.1);
}
.toolbar-icon-btn svg { width: 16px; height: 16px; }
.toolbar-icon-btn.primary-add {
  margin-left: 4px;
  background: var(--c-marque);
  color: white;
  border-color: var(--c-marque);
}
.toolbar-icon-btn.primary-add svg { width: 22px; height: 22px; }
.toolbar-icon-btn.primary-add:hover {
  background: var(--c-entreprise);
  border-color: var(--c-entreprise);
  color: white;
}
.toolbar-icon-btn.active {
  background: var(--c-marque);
  color: white;
  border-color: var(--c-marque);
  box-shadow: 0 4px 10px rgba(53, 149, 169, 0.25);
}
.toolbar-icon-btn { position: relative; }
.toolbar-icon-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--c-complement);
  color: var(--c-entreprise);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--c-surface);
  box-shadow: 0 1px 3px rgba(0, 29, 75, 0.15);
}

/* Dropdown Import / Export */
.io-menu-wrap { position: relative; }
.io-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 29, 75, 0.15), 0 2px 6px rgba(0, 29, 75, 0.08);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: io-menu-in .15s ease-out;
}
@keyframes io-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.io-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--c-text-1);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.io-menu-item:hover {
  background: rgba(53, 149, 169, 0.08);
  color: var(--c-marque);
}
.io-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Menu "Configurer les colonnes" */
.columns-menu-wrap { position: relative; }
.columns-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 29, 75, 0.15), 0 2px 6px rgba(0, 29, 75, 0.08);
  padding: 12px;
  z-index: 40;
  animation: io-menu-in .15s ease-out;
}
.columns-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 6px;
}
.columns-menu-title { font-size: 13px; font-weight: 700; color: var(--c-entreprise); }
.columns-menu-sub { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }
.columns-menu-sub strong { color: var(--c-marque); font-weight: 700; }
.columns-menu-reset {
  background: transparent;
  border: none;
  color: var(--c-marque);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background .12s;
}
.columns-menu-reset:hover { background: rgba(53, 149, 169, 0.08); }
.columns-menu-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 340px;
  overflow-y: auto;
}
.columns-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--c-text-1);
  cursor: pointer;
  transition: background .12s;
}
.columns-menu-item:hover { background: rgba(53, 149, 169, 0.06); }
.columns-menu-item.disabled { opacity: 0.42; cursor: not-allowed; }
.columns-menu-item.disabled:hover { background: transparent; }
.columns-menu-item.locked { cursor: default; background: rgba(53, 149, 169, 0.04); }
.columns-menu-item.locked:hover { background: rgba(53, 149, 169, 0.04); }
.columns-menu-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--c-marque);
  cursor: inherit;
  flex-shrink: 0;
}
.columns-menu-item span { flex: 1; }
.columns-menu-lock {
  font-size: 10px;
  color: var(--c-text-3);
  background: var(--c-bg);
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ===== Search ===== */
.search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  outline: none;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.search:has(> svg) input { padding-left: 36px; }
.search input:hover {
  border-color: rgba(53, 149, 169, 0.25);
  background: rgba(53, 149, 169, 0.03);
}
.search input:focus {
  border-color: var(--c-marque);
  box-shadow: 0 0 0 3px var(--c-marque-12), var(--shadow-soft);
}
.search > svg {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 16px;
  height: 16px;
  color: var(--c-text-3);
  pointer-events: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--c-marque); color: white; }
.btn-primary:hover { background: #2A8294; }
.btn-secondary { background: var(--c-surface); border-color: var(--c-border); color: var(--c-text); }
.btn-secondary:hover { border-color: var(--c-marque); color: var(--c-marque); }
.btn-ghost { background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }
.btn-danger { background: var(--c-alerte); color: white; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ===== Toggle ===== */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
}
.toggle input { display: none; }
.toggle .switch {
  width: 36px; height: 20px;
  background: var(--c-border);
  border-radius: 20px;
  position: relative;
  transition: background .15s;
}
.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .switch { background: var(--c-marque); }
.toggle input:checked + .switch::after { transform: translateX(16px); }

/* ===== KPI cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, transform .15s;
}
.kpi-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-title { font-size: 13px; color: var(--c-text-2); font-weight: 500; }
.kpi-period {
  font-size: 11px;
  color: var(--c-text-3);
  background: var(--c-bg);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.kpi-value-row { display: flex; align-items: baseline; gap: 10px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--c-entreprise); letter-spacing: -0.5px; line-height: 1; }
.kpi-value-suffix { font-size: 16px; color: var(--c-text-3); font-weight: 600; margin-left: 1px; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.kpi-delta.up { background: var(--c-valide-12); color: var(--c-valide); }
.kpi-delta.down { background: var(--c-alerte-12); color: var(--c-alerte); }
.kpi-spark { height: 36px; }
.kpi-spark svg { width: 100%; height: 100%; display: block; }

/* Variante compacte (6 indicateurs sur une ligne) */
.kpi-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-grid-6 .kpi-card { padding: 10px 12px; gap: 4px; border-radius: 10px; }
.kpi-grid-6 .kpi-period { display: none; }
.kpi-grid-6 .kpi-title { font-size: 11px; font-weight: 600; }
.kpi-grid-6 .kpi-value-row { gap: 6px; align-items: center; }
.kpi-grid-6 .kpi-value { font-size: 20px; letter-spacing: -0.3px; }
.kpi-grid-6 .kpi-value-suffix { font-size: 11px; }
.kpi-grid-6 .kpi-delta { font-size: 10px; padding: 1px 6px; }
.kpi-grid-6 .kpi-spark { height: 20px; }

/* ===== Filter chips ===== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--c-marque); color: var(--c-marque); }
.chip.active { background: var(--c-marque-12); border-color: var(--c-marque); color: var(--c-marque); font-weight: 600; }
.chip svg { width: 12px; height: 12px; }
.chip-clear { color: var(--c-text-3); border-style: dashed; }

/* ===== Table ===== */
.table-wrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-1);
  position: relative;
}
.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--c-marque-08);
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-marque);
}
.bulk-bar.show { display: flex; }
.bulk-bar-actions { display: flex; gap: 6px; }

table.data {
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
table.data thead th {
  background: #FAFCFE;
  text-align: left;
  font-weight: 600;
  color: var(--c-text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  letter-spacing: 0.1px;
  white-space: nowrap;
  position: relative;
}
/* Resize handle on right edge of resizable headers */
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 1;
  transition: background .15s;
}
.col-resizer:hover { background: rgba(53, 149, 169, 0.25); }
table.data thead th.resizing .col-resizer,
table.data thead th.resizing { background: rgba(53, 149, 169, 0.12); }
table.data thead th.resizing .col-resizer { background: var(--c-marque); }
/* Drag handle on label */
.col-drag {
  cursor: grab;
  display: inline-block;
  user-select: none;
}
.col-drag:active { cursor: grabbing; }
th.col-dragging { opacity: 0.4; }
th.col-drop-target { background: var(--c-marque-12) !important; box-shadow: inset 2px 0 0 var(--c-marque); }
/* Sticky last column (actions) — always visible on the right */
table.data thead th:last-child,
table.data tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--c-surface);
  box-shadow: -6px 0 10px -6px rgba(0, 29, 75, 0.15);
}
table.data thead th:last-child {
  background: #FAFCFE;
  z-index: 3;
}
table.data tbody tr:hover td:last-child { background: var(--c-marque-08); }
table.data tbody tr.selected td:last-child { background: var(--c-marque-12); }
table.data thead th .sort {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  color: inherit;
}
table.data thead th svg { width: 12px; height: 12px; opacity: 0.6; }
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border-2);
  vertical-align: middle;
}
table.data tbody tr { transition: background .12s; cursor: pointer; }
table.data tbody tr:hover { background: var(--c-marque-08); }
table.data tbody tr.selected { background: var(--c-marque-12); }
table.data tbody tr:last-child td { border-bottom: none; }

.cell-name {
  display: flex; align-items: center; gap: 10px;
}
.cell-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--c-marque-08);
  color: var(--c-marque);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.cell-name-main { font-weight: 600; color: var(--c-text); }
.cell-name-sub { font-size: 11px; color: var(--c-text-3); }

.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  background: white;
  transition: all .15s;
}
.checkbox.checked { background: var(--c-marque); border-color: var(--c-marque); }
.checkbox.checked::after {
  content: "";
  width: 4px; height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-strategique { background: var(--c-complement-15); color: #B5760E; }
.badge-normal { background: var(--c-border-2); color: var(--c-text-2); }
.badge-faible { background: var(--c-marque-12); color: var(--c-marque); }
.badge-partenariat { background: var(--c-valide-12); color: var(--c-valide); }
.badge-transactionnelle { background: var(--c-border-2); color: var(--c-text-2); }
.badge-prospect { background: var(--c-encours-12); color: var(--c-encours); }
.badge-actif { background: var(--c-valide-12); color: var(--c-valide); }
.badge-inactif { background: var(--c-border-2); color: var(--c-text-3); }

/* ===== Score bar ===== */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}
.score-track {
  flex: 1;
  height: 6px;
  background: var(--c-border-2);
  border-radius: 3px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}
.score-fill.high { background: var(--c-valide); }
.score-fill.mid { background: var(--c-encours); }
.score-fill.low { background: var(--c-alerte); }
.score-value { font-weight: 700; font-size: 12px; min-width: 32px; text-align: right; }

/* ===== Row actions ===== */
.row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}
.row-action {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--c-text-3);
  transition: all .15s;
}
.row-action:hover { background: var(--c-marque-12); color: var(--c-marque); }
.row-action.danger:hover { background: var(--c-alerte-12); color: var(--c-alerte); }
.row-action svg { width: 15px; height: 15px; }

/* ===== Pagination ===== */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-2);
}
.pager { display: flex; gap: 4px; }
.pager-btn {
  min-width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  background: white;
  color: var(--c-text-2);
  font-weight: 500;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
}
.pager-btn:hover { border-color: var(--c-marque); color: var(--c-marque); }
.pager-btn.active { background: var(--c-marque); color: white; border-color: var(--c-marque); }

/* ===== ScoreCards (grille) ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.score-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, border-color .15s, transform .15s;
  cursor: pointer;
}
.score-card:hover { box-shadow: var(--shadow-2); border-color: var(--c-marque); transform: translateY(-2px); }
.score-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-card-head .cell-name { flex: 1; min-width: 0; }
.score-card-head .cell-name-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.score-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ring-item {
  text-align: center;
  padding: 10px 4px;
  background: var(--c-bg);
  border-radius: 8px;
}
.ring {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
}
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { stroke: var(--c-border); }
.ring-fg { transition: stroke-dasharray .3s; }
.ring-fg.high { stroke: var(--c-valide); }
.ring-fg.mid { stroke: var(--c-encours); }
.ring-fg.low { stroke: var(--c-alerte); }
.ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text);
}
.ring-label { font-size: 11px; color: var(--c-text-3); font-weight: 600; }

.score-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border-2);
}
.stat { text-align: center; }
.stat-value { font-size: 14px; font-weight: 700; color: var(--c-entreprise); }
.stat-label { font-size: 11px; color: var(--c-text-3); font-weight: 600; }

/* ===== Détail Fiche ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--c-text-3);
  font-size: 13px;
  font-weight: 500;
}
.breadcrumb a { color: var(--c-text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-marque); }
.breadcrumb svg { width: 12px; height: 12px; }

.detail-header {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.detail-logo {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--c-marque-08);
  color: var(--c-marque);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
}
.detail-id {
  font-size: 12px;
  color: var(--c-text-3);
  font-weight: 500;
}
.detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-entreprise);
  margin: 2px 0 6px;
}
.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.detail-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 18px;
  gap: 2px;
}
.detail-tabs-filler { flex: 1; }
.detail-tabs-filter { margin-bottom: 6px; position: relative; }
.detail-tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: var(--c-text-2);
  font-weight: 500;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.detail-tab:hover { color: var(--c-marque); }
.detail-tab.active { color: var(--c-marque); border-bottom-color: var(--c-marque); font-weight: 600; }

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.summary-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px;
}
.summary-label { font-size: 12px; color: var(--c-text-3); font-weight: 600; }
.summary-value { font-size: 22px; font-weight: 700; color: var(--c-entreprise); margin-top: 4px; letter-spacing: -0.3px; }
.summary-sub { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }

/* Carte "Période" : juste un label + icône filtre qui ouvre un menu */
.summary-card-period { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.period-filter-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--c-text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.period-filter-btn svg { width: 15px; height: 15px; }
.period-filter-btn:hover {
  color: var(--c-marque);
  background: rgba(53, 149, 169, 0.1);
}
.period-filter-btn.active {
  background: var(--c-marque);
  color: white;
}

/* Popover Période */
.period-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 29, 75, 0.15), 0 2px 6px rgba(0, 29, 75, 0.08);
  padding: 12px;
  z-index: 40;
  animation: io-menu-in .15s ease-out;
}
.period-menu-head { padding-bottom: 10px; border-bottom: 1px solid var(--c-border); margin-bottom: 6px; }
.period-menu-title { font-size: 13px; font-weight: 700; color: var(--c-entreprise); }
.period-menu-sub { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }
.period-menu-sub strong { color: var(--c-marque); font-weight: 700; }
.period-menu-list { display: flex; flex-direction: column; gap: 1px; max-height: 340px; overflow-y: auto; }
.period-menu-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  color: var(--c-text-1);
  cursor: pointer;
  transition: background .12s;
  text-align: left;
}
.period-menu-item:hover { background: rgba(53, 149, 169, 0.06); }
.period-menu-item.active { background: var(--c-marque-12); color: var(--c-marque); font-weight: 600; }
.period-menu-item-label { font-size: 13px; }
.period-menu-item-sub { font-size: 11px; color: var(--c-text-3); }
.period-menu-item.active .period-menu-item-sub { color: var(--c-marque); }
.period-menu-item-check { color: var(--c-valide); display: grid; place-items: center; }
.period-menu-item-check svg { width: 14px; height: 14px; }

/* Pilotage (2 colonnes x 3 lignes) + Évaluations (1 colonne) côte à côte */
.pilotage-eval-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: stretch; }
.pilotage-eval-row > .panel { min-width: 0; }
.pilotage-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* Panneau Évaluations : 3 rings individuels + moyenne globale mise en avant */
.eval-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: stretch; }
.ring-item .ring-sub { font-size: 10px; color: var(--c-text-3); margin-top: 2px; }
.ring-item-featured {
  background: var(--c-marque-08);
  border: 1px solid var(--c-marque-30, rgba(53, 149, 169, 0.25));
  border-radius: 10px;
  padding: 10px 4px;
}
.ring-item-featured .ring-label { color: var(--c-entreprise); font-weight: 700; font-size: 12px; }
.ring-item-featured .ring-sub { color: var(--c-marque); font-weight: 600; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
/* Vue d'Ensemble : chaque colonne empile ses panneaux avec le même gap,
   indépendamment de l'autre colonne (pas d'alignement forcé) */
.detail-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.detail-col > .panel, .detail-col > .pilotage-eval-row > .panel, .detail-col > .detail-summary { margin-bottom: 0; }
.detail-col > .detail-summary .summary-card { padding: 12px 14px; }
.detail-col > .detail-summary .summary-value { font-size: 20px; }

.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-entreprise);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title svg { width: 16px; height: 16px; color: var(--c-marque); }
.panel-body { padding: 14px 18px; }
.panel-list { display: flex; flex-direction: column; }
.panel-list-item {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--c-border-2);
  font-size: 13px;
}
.panel-list-item:last-child { border-bottom: none; }
.panel-list-item .icon-mini {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--c-marque-08);
  color: var(--c-marque);
}
.panel-list-item .icon-mini svg { width: 14px; height: 14px; }
.panel-list-item .meta { color: var(--c-text-3); font-size: 12px; }
.panel-empty {
  padding: 26px;
  text-align: center;
  color: var(--c-text-3);
  font-size: 13px;
}

/* ===== Form ===== */
.form-page {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  margin-bottom: 80px;
}
.form-section {
  padding: 22px 26px;
  border-bottom: 1px solid var(--c-border);
}
.form-section:last-child { border-bottom: none; }
.form-section-head {
  margin-bottom: 18px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-entreprise);
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-title svg {
  width: 16px; height: 16px;
  color: var(--c-marque);
}
.form-section-sub {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 4px;
  margin-left: 26px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field-tall { grid-row: span 2; }
.field-tall .logo-uploader-tall { flex: 1; width: auto; aspect-ratio: 1; align-self: flex-start; min-height: 0; }
.field-label {
  font-size: 12px;
  color: var(--c-text-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-label .req { color: var(--c-alerte); }
.field input, .field select, .field textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: white;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { padding: 10px 12px; height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-marque);
  box-shadow: 0 0 0 3px var(--c-marque-12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--c-text-3); }
.field-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}
.logo-uploader {
  width: 96px; height: 96px;
  border-radius: 12px;
  border: 1.5px dashed var(--c-border);
  background: var(--c-bg);
  display: grid;
  place-items: center;
  color: var(--c-text-3);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.logo-uploader:hover { border-color: var(--c-marque); background: var(--c-marque-08); color: var(--c-marque); }
.logo-uploader svg { width: 22px; height: 22px; }

.save-bar {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  background: white;
  border-top: 1px solid var(--c-border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 12px rgba(0, 29, 75, 0.04);
  z-index: 50;
}
.save-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-text-3); }
.save-status .dot { width: 6px; height: 6px; background: var(--c-encours); border-radius: 50%; }
.save-bar-actions { display: flex; gap: 10px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 29, 75, 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: slideUp .2s ease-out;
}
.modal.modal-wide { max-width: 780px; }

/* ===== Modal : configuration d'un indicateur ===== */
.ind-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.ind-mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ind-mode-card:hover { border-color: rgba(53, 149, 169, 0.35); background: rgba(53, 149, 169, 0.04); }
.ind-mode-card.active { border-color: var(--c-marque); background: var(--c-marque-08); box-shadow: 0 2px 8px rgba(53, 149, 169, 0.15); }
.ind-mode-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--c-marque-12); color: var(--c-marque);
  display: grid; place-items: center; flex-shrink: 0;
}
.ind-mode-card.active .ind-mode-icon { background: var(--c-marque); color: white; }
.ind-mode-icon svg { width: 18px; height: 18px; }
.ind-mode-title { font-size: 13px; font-weight: 700; color: var(--c-entreprise); }
.ind-mode-desc { font-size: 11px; color: var(--c-text-3); margin-top: 2px; line-height: 1.3; }

.ind-cfg-panel {
  padding: 16px 18px;
  background: var(--c-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ind-cfg-block { display: flex; flex-direction: column; gap: 6px; }
.ind-cfg-block .field-label { font-size: 12px; font-weight: 600; color: var(--c-text-2); }
.ind-cfg-block select, .ind-cfg-block input[type="number"], .ind-cfg-block input[type="text"] {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface);
  font-family: inherit; font-size: 13px;
}
.ind-cfg-block select:focus, .ind-cfg-block input:focus, .ind-formule:focus {
  outline: none; border-color: var(--c-marque); box-shadow: 0 0 0 3px var(--c-marque-12);
}
.ind-cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ind-cfg-hint { font-size: 11px; color: var(--c-text-3); line-height: 1.5; padding: 8px 12px; background: var(--c-surface); border-radius: 8px; border: 1px dashed var(--c-border); }
.ind-cfg-hint code { background: var(--c-marque-08); color: var(--c-marque); padding: 1px 6px; border-radius: 4px; font-size: 11px; font-family: 'Menlo', 'Consolas', monospace; }

.ind-formule {
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface);
  font-family: 'Menlo', 'Consolas', monospace; font-size: 13px; color: var(--c-entreprise);
  resize: vertical;
}

.ind-metrics { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; padding: 6px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; }
.ind-metric-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 16px;
  font-family: inherit; font-size: 12px; color: var(--c-text-1);
  cursor: pointer; transition: all .12s;
}
.ind-metric-chip:hover { background: var(--c-marque-08); border-color: var(--c-marque); color: var(--c-marque); }
.ind-metric-key { font-family: 'Menlo', 'Consolas', monospace; font-size: 10px; color: var(--c-text-3); background: var(--c-surface); padding: 1px 5px; border-radius: 4px; }
.ind-metric-chip:hover .ind-metric-key { color: var(--c-marque); background: white; }

.ind-agg-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; padding: 6px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; }
.ind-agg-row { display: grid; grid-template-columns: auto 1fr 80px auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; transition: background .12s; cursor: pointer; }
.ind-agg-row:hover { background: var(--c-bg); }
.ind-agg-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--c-marque); }
.ind-agg-label { font-size: 13px; color: var(--c-text-1); }
.ind-agg-weight { height: 30px; padding: 0 8px; border: 1px solid var(--c-border); border-radius: 6px; font-size: 12px; text-align: right; font-family: inherit; }
.ind-agg-unit { font-size: 11px; color: var(--c-text-3); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--c-entreprise); margin: 0; }
.modal-sub { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #FAFCFE;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.template-item {
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.template-item:hover { border-color: var(--c-marque); color: var(--c-marque); background: var(--c-marque-08); }
.template-item.active { border-color: var(--c-marque); color: var(--c-marque); background: var(--c-marque-12); font-weight: 600; }
.template-item svg { width: 14px; height: 14px; }

/* ===== Drawer (aperçu rapide) ===== */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 29, 75, 0.35);
  z-index: 90;
  animation: fadeIn .2s;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 460px;
  background: white;
  box-shadow: var(--shadow-3);
  z-index: 91;
  display: flex;
  flex-direction: column;
  animation: slideLeft .25s ease-out;
}
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ===== Utility ===== */
.row { display: flex; gap: 12px; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--c-text-3); }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ===== Custom fields ===== */
.cf-list { display: flex; flex-direction: column; gap: 10px; }
.cf-item {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.6fr 32px;
  gap: 10px;
  align-items: center;
}
.cf-item input, .cf-item select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 13px;
}
.cf-item .row-action.danger { color: var(--c-text-3); }
.cf-item .row-action.danger:hover { color: var(--c-alerte); background: var(--c-alerte-12); }
.cf-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: transparent;
  border: 1.5px dashed var(--c-border);
  color: var(--c-marque);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
}
.cf-add:hover { background: var(--c-marque-08); border-color: var(--c-marque); }

/* ===== AI Strategy ===== */
.ai-hero {
  background: linear-gradient(135deg, var(--c-entreprise) 0%, var(--c-marque) 100%);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.ai-hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(231,180,111,0.25), transparent 70%);
  pointer-events: none;
}
.ai-hero-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ai-hero-icon svg { width: 26px; height: 26px; }
.ai-hero h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; position: relative; z-index: 1; }
.ai-hero p { margin: 0; font-size: 13px; opacity: 0.9; position: relative; z-index: 1; }
.ai-hero-meta {
  font-size: 11px;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 10px;
  margin-left: auto;
  position: relative; z-index: 1;
  font-weight: 600;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.ai-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 20px;
  position: relative;
}
.ai-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-card-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-card-icon svg { width: 16px; height: 16px; }
.ai-card-title { font-size: 14px; font-weight: 700; color: var(--c-entreprise); flex: 1; }
.ai-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--c-complement-15);
  color: #B5760E;
  letter-spacing: 0.3px;
}
.ai-card p { margin: 0 0 10px; font-size: 13px; color: var(--c-text-2); line-height: 1.5; }
.ai-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ai-list li {
  font-size: 13px;
  color: var(--c-text);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.ai-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-marque);
}
.ai-list.recos li::before { background: var(--c-valide); }
.ai-list.alerts li::before { background: var(--c-alerte); }
.ai-list.opps li::before { background: var(--c-encours); }

.ai-savings {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 12px;
}
.ai-savings-value { font-size: 26px; font-weight: 700; color: var(--c-valide); letter-spacing: -0.3px; }
.ai-savings-label { font-size: 12px; color: var(--c-text-3); }

.ai-bench {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.ai-bench-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.ai-bench-row .ai-bench-name { font-weight: 600; color: var(--c-text); }
.ai-bench-row.self .ai-bench-name { color: var(--c-marque); }
.ai-bench-bar { height: 8px; background: var(--c-border-2); border-radius: 4px; overflow: hidden; }
.ai-bench-fill { height: 100%; background: var(--c-text-3); border-radius: 4px; }
.ai-bench-row.self .ai-bench-fill { background: var(--c-marque); }
.ai-bench-row .ai-bench-val { text-align: right; font-weight: 700; color: var(--c-text); }

.ai-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ===== AI Agent (FAB + panel — refonte épurée) ===== */
.ai-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 64px; height: 64px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 80;
  padding: 0;
}
.ai-fab-core {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-marque) 0%, var(--c-entreprise) 100%);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(53, 149, 169, 0.45), 0 2px 6px rgba(0, 29, 75, 0.15);
  transition: transform .2s, box-shadow .2s;
  z-index: 2;
}
.ai-fab-core svg { width: 28px; height: 28px; }
.ai-fab-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 149, 169, 0.45) 0%, rgba(53, 149, 169, 0) 70%);
  animation: halo-pulse 2.4s infinite;
  z-index: 1;
}
@keyframes halo-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 0.2; }
}
.ai-fab:hover .ai-fab-core { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 32px rgba(53, 149, 169, 0.55), 0 4px 10px rgba(0, 29, 75, 0.2); }
.ai-fab-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 22px; height: 22px;
  background: var(--c-complement);
  color: var(--c-entreprise);
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(231, 180, 111, 0.5);
  z-index: 3;
  padding: 0 5px;
}

.ai-panel {
  position: fixed;
  background: white;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 29, 75, 0.18), 0 4px 12px rgba(0, 29, 75, 0.08);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border);
}
/* Floating : ancré sous le header, colonne étroite qui exploite toute la hauteur */
.ai-panel.floating {
  top: 76px;
  right: 16px;
  bottom: 16px;
  width: 340px;
  animation: slideUp .2s ease-out;
}
/* Expanded : remplit toute la zone de contenu (sous topbar, à droite du menu) sur toute la hauteur */
.ai-panel.expanded {
  top: 76px;
  right: 16px;
  bottom: 16px;
  left: calc(220px + 16px);
  animation: fadeIn .15s;
}

/* Header */
.ai-panel-head {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--c-border);
}
.ai-panel-head .ai-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-marque);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-panel-head .ai-avatar svg { width: 18px; height: 18px; }
.ai-panel-head .walfy-avatar {
  background-image: url('mascotte.png');
  background-repeat: no-repeat;
  background-size: 420% auto;
  background-position: 82% 15%;
  background-color: #FFF4E9;
  padding: 0;
  border: 2px solid var(--c-marque);
  box-shadow: 0 2px 6px rgba(53, 149, 169, 0.25);
}
.ai-panel-head .walfy-avatar > * { display: none; }
/* Avatar renard dans les bulles de chat */
.walfy-avatar-small {
  background-image: url('mascotte.png') !important;
  background-repeat: no-repeat !important;
  background-size: 430% auto !important;
  background-position: 82% 15% !important;
  background-color: #FFF4E9 !important;
  padding: 0 !important;
  border: 1.5px solid var(--c-marque-30, rgba(53, 149, 169, 0.35));
}
.walfy-avatar-small > * { display: none; }
.ai-panel-head .ai-head-text { flex: 1; min-width: 0; }
.ai-panel-head h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--c-entreprise); }
.ai-panel-head .ai-status {
  font-size: 12px;
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.ai-panel-head .ai-status::before {
  content: ""; width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-valide);
}
.ai-panel-head .ai-status.thinking::before { background: var(--c-encours); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.ai-head-actions { display: flex; gap: 4px; }
.ai-head-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--c-text-3);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ai-head-btn:hover { background: var(--c-bg); color: var(--c-text); }
.ai-head-btn svg { width: 16px; height: 16px; }

/* Body */
.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-panel.expanded .ai-panel-body { padding: 24px 28px; gap: 18px; }

.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-marque);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-msg-avatar svg { width: 14px; height: 14px; }
.ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--c-bg);
  color: var(--c-text);
  max-width: 88%;
}
.ai-msg.user .ai-msg-bubble {
  background: var(--c-marque-12);
  color: var(--c-text);
  border-radius: 14px 14px 4px 14px;
}
.ai-msg:not(.user) .ai-msg-bubble { border-radius: 4px 14px 14px 14px; }

/* Suggestions: cards pleine largeur */
.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 4px;
}
.ai-sugg {
  text-align: left;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-shadow: var(--shadow-soft);
}
.ai-sugg:hover {
  border-color: var(--c-marque);
  background: var(--c-marque-08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.ai-sugg svg { display: none; }

.ai-action-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.ai-action-card-title { font-size: 12px; font-weight: 700; color: var(--c-entreprise); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-action-card-title svg { width: 13px; height: 13px; color: var(--c-marque); }
.ai-action-card .row-mini { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--c-border-2); }
.ai-action-card .row-mini:last-child { border: none; }

/* Input area */
.ai-panel-input {
  padding: 14px 18px 12px;
  border-top: 1px solid var(--c-border);
  background: white;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ai-attach {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text-3);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.ai-attach:hover { border-color: var(--c-marque); color: var(--c-marque); }
.ai-attach svg { width: 16px; height: 16px; }
.ai-input-wrap {
  flex: 1;
  position: relative;
}
.ai-input-wrap textarea {
  width: 100%;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  outline: none;
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color .15s, background .15s;
}
.ai-input-wrap textarea:focus { border-color: var(--c-marque); background: white; }
.ai-input-wrap textarea::placeholder { color: var(--c-text-3); }
.ai-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-marque);
  color: white;
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.ai-send:hover { background: #2A8294; }
.ai-send:disabled { background: var(--c-border); cursor: not-allowed; }
.ai-send svg { width: 16px; height: 16px; }

/* Footer with model badge */
.ai-panel-foot {
  padding: 8px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  background: white;
}
.ai-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-3);
  font-weight: 500;
}
.ai-model-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-valide);
}
.ai-foot-info { color: var(--c-complement); font-weight: 600; }

/* Typing indicator */
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ai-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-text-3);
  animation: dot 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ===== Module Projets ===== */
.proj-header {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 2.2fr 2fr auto;
  gap: 22px;
  align-items: center;
}
.proj-header-main { min-width: 0; }
.proj-header-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-left: 22px;
  border-left: 1px solid var(--c-border);
}
.proj-stat { min-width: 0; }
.proj-stat-label {
  font-size: 11px;
  color: var(--c-text-3);
  font-weight: 600;
  margin-bottom: 4px;
}
.proj-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-entreprise);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-stat-sub {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.proj-header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.proj-header-actions .btn { white-space: nowrap; justify-content: center; }

.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--c-alerte-12);
  border: 1px solid rgba(238, 46, 107, 0.25);
  border-left: 4px solid var(--c-alerte);
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--c-text);
}
.alert-banner svg { width: 20px; height: 20px; color: var(--c-alerte); flex-shrink: 0; }
.alert-banner > div:nth-child(2) { flex: 1; }

/* ===== Phase Stepper ===== */
.phase-stepper {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 22px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  position: relative;
}
.phase-step {
  background: transparent;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  text-align: left;
  transition: opacity .15s;
}
.phase-step:hover { opacity: 0.85; }
.phase-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  color: var(--c-text-3);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 2;
  position: relative;
  transition: all .15s;
}
.phase-step-num svg { width: 14px; height: 14px; }
.phase-step.done .phase-step-num {
  background: var(--c, var(--c-marque));
  border-color: var(--c, var(--c-marque));
  color: white;
}
.phase-step.current .phase-step-num {
  background: white;
  border-color: var(--c, var(--c-marque));
  color: var(--c, var(--c-marque));
  box-shadow: 0 0 0 4px rgba(53, 149, 169, 0.15);
}
.phase-step.blocked .phase-step-num {
  background: var(--c-alerte);
  border-color: var(--c-alerte);
  color: white;
}
.phase-step.selected .phase-step-num {
  outline: 2px solid var(--c-marque);
  outline-offset: 2px;
}
.phase-step-label { min-width: 0; }
.phase-step-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.2;
}
.phase-step.pending .phase-step-name { color: var(--c-text-3); }
.phase-step-status {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.phase-step.done .phase-step-status { color: var(--c-valide); font-weight: 600; }
.phase-step.current .phase-step-status { color: var(--c-marque); font-weight: 600; }
.phase-step.blocked .phase-step-status { color: var(--c-alerte); font-weight: 600; }
.phase-step-line {
  position: absolute;
  top: 21px;
  left: 38px;
  right: -6px;
  height: 2px;
  background: var(--c-border);
  z-index: 1;
}
.phase-step-line.done { background: var(--c-valide); }

/* Sub-stepper */
.sub-stepper {
  display: flex;
  gap: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.sub-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all .15s;
  cursor: pointer;
}
.sub-step:hover { background: var(--c-marque-08); color: var(--c-marque); }
.sub-step.active { background: var(--c-marque-12); color: var(--c-marque); font-weight: 700; }
.sub-step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-bg);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: var(--c-text-3);
}
.sub-step.active .sub-step-num { background: var(--c-marque); color: white; }

/* Layouts grid */
.proj-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.proj-grid-sourcing {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 16px;
}
.proj-step-body { padding-bottom: 30px; }

/* Rich editor mock */
.rich-editor-mock {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-2);
}
.rich-toolbar svg { width: 12px; height: 12px; }
.rich-content {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-text);
  max-height: 480px;
  overflow-y: auto;
}
.rich-content h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.rich-content h4 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: var(--c-entreprise); }
.rich-content ol, .rich-content ul { padding-left: 22px; margin: 6px 0; }
.rich-content li { margin: 3px 0; }

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 3px solid var(--c-border);
}
.kanban-col-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--c-border);
  background: #FAFCFE;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
}
.kanban-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
}
.kanban-card:hover { border-color: var(--c-marque); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.kanban-empty {
  text-align: center;
  color: var(--c-text-3);
  font-size: 12px;
  padding: 20px;
}

/* ===== Galerie Assistants ===== */
.assist-hero {
  background: linear-gradient(135deg, var(--c-entreprise) 0%, var(--c-marque) 100%);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 22px 26px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
  overflow: hidden;
}
.assist-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(231,180,111,0.28), transparent 70%);
  pointer-events: none;
}
.assist-hero-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.assist-hero-icon svg { width: 26px; height: 26px; }
.assist-hero-text { flex: 1; position: relative; z-index: 1; min-width: 0; }
.assist-hero-text h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.assist-hero-text p { margin: 0; font-size: 13px; opacity: 0.92; }
.assist-hero-stats {
  display: flex;
  gap: 22px;
  padding-left: 22px;
  border-left: 1px solid rgba(255,255,255,0.2);
  position: relative; z-index: 1;
}
.assist-stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; line-height: 1; }
.assist-stat-label { font-size: 11px; opacity: 0.85; margin-top: 4px; font-weight: 500; }

.assist-section {
  margin-bottom: 26px;
}
.assist-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.assist-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-entreprise);
  display: flex;
  align-items: center;
  gap: 8px;
}
.assist-section-title svg { width: 16px; height: 16px; color: var(--c-marque); }
.assist-section-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.assist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.assist-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  position: relative;
}
.assist-card:hover {
  border-color: var(--c-marque);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.assist-card-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.assist-card-icon svg { width: 22px; height: 22px; }
.assist-card-body { flex: 1; min-width: 0; }
.assist-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.assist-card-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-entreprise);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assist-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.assist-card-badge.new {
  background: var(--c-complement-15);
  color: #B5760E;
}
.assist-card-body p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--c-text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.assist-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--c-text-3);
  font-weight: 500;
}
.assist-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.assist-card-meta svg { width: 11px; height: 11px; }
.assist-card-arrow {
  display: grid;
  place-items: center;
  color: var(--c-text-3);
  transition: color .15s, transform .15s;
  flex-shrink: 0;
}
.assist-card-arrow svg { width: 18px; height: 18px; }
.assist-card:hover .assist-card-arrow {
  color: var(--c-marque);
  transform: translateX(3px);
}

/* ===== Module Conformité ===== */
.templates-carousel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.templates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.templates-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-entreprise);
  display: flex;
  align-items: center;
  gap: 8px;
}
.templates-title svg { width: 16px; height: 16px; color: var(--c-marque); }
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.template-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  transition: all .15s;
}
.template-card:hover {
  border-color: var(--c-marque);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.template-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.template-icon svg { width: 18px; height: 18px; }
.template-body { min-width: 0; flex: 1; }
.template-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-entreprise);
  line-height: 1.2;
}
.template-desc {
  font-size: 11px;
  color: var(--c-text-2);
  margin-top: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-meta {
  font-size: 10px;
  color: var(--c-text-3);
  font-weight: 600;
  margin-top: 4px;
}

/* Timeline (compact, dans tableau) */
.conf-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 110px;
}
.conf-tl-step {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}
.conf-tl-step:last-child { flex: 0; }
.conf-tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-border);
  border: 2px solid var(--c-bg);
  z-index: 1;
  flex-shrink: 0;
  position: relative;
}
.conf-tl-step.done .conf-tl-dot { background: var(--c-valide); }
.conf-tl-step.failed .conf-tl-dot { background: var(--c-alerte); }
.conf-tl-line {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  min-width: 24px;
  margin: 0 -1px;
}
.conf-tl-line.done { background: var(--c-valide); }

/* Email preview */
.email-preview {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.email-preview-head {
  padding: 10px 14px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  font-size: 11px;
  color: var(--c-text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.email-preview-head strong { color: var(--c-text); }
.email-preview-body {
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-text);
  max-height: 240px;
  overflow-y: auto;
}
.email-preview-body p { margin: 0 0 8px; }
.email-preview-body p:last-child { margin-bottom: 0; }

/* ===== Module Achats — Catalogues ===== */
.article-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--c-bg);
  display: grid;
  place-items: center;
  font-size: 22px;
  border: 1px solid var(--c-border);
}
.article-thumb-lg {
  width: 72px; height: 72px;
  border-radius: 14px;
  background: var(--c-bg);
  display: grid;
  place-items: center;
  font-size: 38px;
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.article-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  border-color: var(--c-marque);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.article-card-photo {
  height: 130px;
  background: linear-gradient(135deg, var(--c-bg), #FFFFFF);
  display: grid;
  place-items: center;
  font-size: 56px;
  border-bottom: 1px solid var(--c-border);
}
.article-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-entreprise);
  margin: 4px 0 6px;
  line-height: 1.3;
}
.article-card-price {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--c-border-2);
}

/* Supplier comparator */
.supplier-comparator {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px;
}
.supplier-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: all .15s;
}
.supplier-card:hover {
  box-shadow: var(--shadow-2);
}
.supplier-card.principal {
  border-color: var(--c-marque);
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--c-marque-12);
}
.supplier-badge {
  position: absolute;
  top: -10px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.supplier-badge.principal {
  background: var(--c-marque);
  color: white;
}
.supplier-badge.best-price {
  background: var(--c-valide);
  color: white;
  left: auto;
  right: 12px;
}
.supplier-badge.best-delai {
  background: var(--c-encours);
  color: white;
  left: auto;
  right: 12px;
}

/* ===== Workflow Stepper (Demandes) ===== */
.workflow-stepper {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.wf-step {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 4px 4px;
  text-align: left;
}
.wf-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  color: var(--c-text-3);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: all .15s;
}
.wf-step-num svg { width: 13px; height: 13px; }
.wf-step.done .wf-step-num {
  background: var(--c-valide);
  border-color: var(--c-valide);
  color: white;
}
.wf-step.current .wf-step-num {
  background: white;
  border-color: var(--c-encours);
  color: var(--c-encours);
  box-shadow: 0 0 0 4px rgba(233,135,12,0.18);
}
.wf-step.failed .wf-step-num {
  background: var(--c-alerte);
  border-color: var(--c-alerte);
  color: white;
}
.wf-step-label { min-width: 0; }
.wf-step-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.2;
}
.wf-step.pending .wf-step-name { color: var(--c-text-3); }
.wf-step-meta {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.wf-step.done .wf-step-meta { color: var(--c-valide); font-weight: 500; }
.wf-step.failed .wf-step-meta { color: var(--c-alerte); font-weight: 500; }
.wf-step-line {
  position: absolute;
  top: 19px;
  left: 36px;
  right: -6px;
  height: 2px;
  background: var(--c-border);
  z-index: 1;
}
.wf-step-line.done { background: var(--c-valide); }

/* ===== 3-way Matching (Commandes) ===== */
.three-way-matching {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.tw-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  position: relative;
  transition: all .2s;
}
.tw-step.done {
  background: white;
  border-color: var(--c-valide);
  box-shadow: 0 0 0 3px var(--c-valide-12);
}
.tw-step-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--c-bg);
  color: var(--c-text-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tw-step.done .tw-step-icon {
  background: var(--c-valide-12);
  color: var(--c-valide);
}
.tw-step-icon svg { width: 18px; height: 18px; }
.tw-step-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-entreprise);
}
.tw-step.done .tw-step-name { color: var(--c-text); }
.tw-step.pending .tw-step-name { color: var(--c-text-3); }
.tw-step-meta {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.tw-step-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-valide);
  color: white;
  display: grid;
  place-items: center;
  border: 2px solid white;
}
.tw-step-check svg { width: 12px; height: 12px; }
.tw-arrow {
  color: var(--c-text-3);
  font-size: 18px;
  font-weight: 700;
}
.tw-arrow svg { width: 16px; height: 16px; }
.tw-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  background: var(--c-bg);
  color: var(--c-text-3);
  white-space: nowrap;
}
.tw-result.matched {
  background: var(--c-valide-12);
  color: var(--c-valide);
}

/* ===== Bannière PDP / Réforme e-invoicing ===== */
.pdp-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--c-entreprise-08), var(--c-marque-08));
  border: 1px solid var(--c-marque);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 18px;
}
.pdp-banner-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--c-marque);
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pdp-banner-icon svg { width: 18px; height: 18px; }
.pdp-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--c-entreprise);
  line-height: 1.5;
}
.pdp-banner-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-entreprise);
  flex-shrink: 0;
}

.anomalies-banner {
  background: linear-gradient(135deg, var(--c-alerte-12), white);
  border: 1px solid var(--c-alerte);
  border-left: 4px solid var(--c-alerte);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.anomalie-item {
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--c-alerte);
  border-opacity: 0.3;
}

/* ===== Anomalies — Timeline & SLA ===== */
.anomalie-timeline {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.anomalie-tl-item {
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
}
.anomalie-tl-item:last-child { padding-bottom: 0; }
.anomalie-tl-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.anomalie-tl-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-marque-12);
  color: var(--c-marque);
  display: grid;
  place-items: center;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--c-border);
}
.anomalie-tl-dot svg { width: 14px; height: 14px; }
.anomalie-tl-line {
  flex: 1;
  width: 2px;
  background: var(--c-border);
  margin-top: 4px;
  min-height: 12px;
}
.anomalie-tl-content {
  flex: 1;
  padding-top: 6px;
}

.sla-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--c-encours-12);
  border: 1px solid rgba(233,135,12,0.3);
  border-left: 4px solid var(--c-encours);
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--c-text);
}
.sla-banner svg { width: 18px; height: 18px; color: var(--c-encours); flex-shrink: 0; }
.sla-banner > div:nth-child(2) { flex: 1; }

/* ===== Budgets — Barres stackées ===== */
.stacked-bar {
  display: flex;
  width: 100%;
  height: 8px;
  background: var(--c-border-2);
  border-radius: 4px;
  overflow: hidden;
}
.stacked-bar-lg {
  display: flex;
  width: 100%;
  height: 28px;
  background: var(--c-border-2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.stacked-seg {
  height: 100%;
  transition: width .3s;
}
.stacked-marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 0;
  z-index: 2;
}
.stacked-marker-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--c-entreprise);
  border-radius: 2px;
}
.stacked-marker-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--c-entreprise);
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--c-entreprise);
  white-space: nowrap;
}

/* ===== Workflow Pyramide (Budgets — seuils de validation) ===== */
.workflow-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
}
.wf-pyr-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  background: var(--c-marque-08);
  border: 2px solid var(--c-marque);
  border-radius: 8px;
  transition: transform .15s;
}
.wf-pyr-row:hover { transform: translateX(2px); }
.wf-pyr-role {
  font-weight: 700;
  font-size: 13px;
  color: var(--c-entreprise);
}
.wf-pyr-seuil {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  font-family: monospace;
}
.wf-pyr-sla {
  font-size: 11px;
  color: var(--c-text-3);
  font-weight: 600;
  text-align: right;
}

/* ===== Documents — Cycle de Vie ===== */
.lifecycle-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lc-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-left: 4px;
}
.lc-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: -16px;
  width: 2px;
  background: var(--c-border);
}
.lc-step.done:not(:last-child)::after { background: var(--c-valide); }
.lc-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.lc-step.done .lc-dot {
  background: var(--c-valide);
  border-color: var(--c-valide);
}
.lc-step.current .lc-dot {
  background: white;
  border-color: var(--c-encours);
  box-shadow: 0 0 0 3px rgba(233,135,12,0.18);
}
.lc-step.failed .lc-dot {
  background: var(--c-alerte);
  border-color: var(--c-alerte);
}

/* ===== Messagerie ===== */
.messagerie-layout {
  display: grid;
  grid-template-columns: 240px 360px 1fr;
  gap: 14px;
  height: calc(100vh - 140px);
}
.msg-sidebar {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px;
  overflow-y: auto;
}
.msg-folders { display: flex; flex-direction: column; gap: 2px; }
.msg-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.msg-folder svg { width: 16px; height: 16px; flex-shrink: 0; }
.msg-folder:hover { background: var(--c-marque-08); color: var(--c-marque); }
.msg-folder.active { background: var(--c-marque-12); color: var(--c-marque); font-weight: 700; }
.msg-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--c-text-3);
  background: var(--c-bg);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.msg-folder.active .msg-count { background: white; color: var(--c-marque); }
.msg-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--c-alerte);
  color: white;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.msg-list-pane {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.msg-list-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
}
.msg-list { flex: 1; overflow-y: auto; }
.msg-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border-2);
  cursor: pointer;
  transition: background .15s;
}
.msg-item:hover { background: var(--c-bg); }
.msg-item.active { background: var(--c-marque-12); border-left: 3px solid var(--c-marque); padding-left: 11px; }
.msg-item.unread { background: var(--c-marque-08); }
.msg-avatar { position: relative; flex-shrink: 0; }
.msg-unread-dot {
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 10px;
  background: var(--c-alerte);
  border-radius: 50%;
  border: 2px solid white;
}
.msg-body { flex: 1; min-width: 0; }
.msg-line1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.msg-who { font-weight: 600; font-size: 13px; color: var(--c-entreprise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.unread .msg-who { font-weight: 700; }
.msg-date { font-size: 11px; color: var(--c-text-3); flex-shrink: 0; }
.msg-objet {
  font-size: 12px;
  color: var(--c-text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-item.unread .msg-objet { color: var(--c-text); font-weight: 600; }
.msg-tag { margin-top: 6px; }

.msg-preview {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.msg-preview-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--c-border);
}
.msg-preview-body {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-2);
}
.msg-empty {
  flex: 1;
  display: grid;
  place-items: center;
}

/* ===== Notifications ===== */
.notif-unread {
  background: linear-gradient(90deg, var(--c-alerte-12) 0%, transparent 30%);
}

/* ===== Dropdowns Topbar ===== */
.notifs-dropdown, .user-menu-dropdown {
  position: fixed;
  top: 70px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  z-index: 200;
  animation: slideUp .15s ease-out;
}
.notifs-dropdown {
  right: 180px;
  width: 380px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}
.notifs-dropdown-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notifs-dropdown-body {
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}
.notifs-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-border-2);
  cursor: pointer;
  transition: background .15s;
}
.notifs-dropdown-item:hover { background: var(--c-bg); }
.notifs-dropdown-item.unread { background: linear-gradient(90deg, var(--c-alerte-12) 0%, transparent 30%); }
.notifs-dropdown-item:last-child { border-bottom: none; }
.notifs-dropdown-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 8px;
}

.user-menu-dropdown {
  right: 28px;
  width: 280px;
  overflow: hidden;
}
.user-menu-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--c-marque-08), white);
}
.user-menu-items { padding: 8px; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background .15s, color .15s;
}
.user-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.user-menu-item:hover { background: var(--c-marque-08); color: var(--c-marque); }

/* User avatar topbar — make clickable */
.user { user-select: none; }

/* ===== Dashboard ===== */
.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.dashboard-actions { display: flex; align-items: center; gap: 10px; }
.dashboard-period {
  display: flex;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 3px;
  box-shadow: var(--shadow-soft);
}
.dash-period-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--c-text-2);
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.dash-period-btn.active { background: var(--c-marque); color: white; }

.dashboard-vues {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.dash-vue {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all .15s;
}
.dash-vue:hover {
  border-color: var(--c-marque);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.dash-vue.active {
  border-color: var(--c-marque);
  background: linear-gradient(135deg, var(--c-marque-12), white);
  box-shadow: var(--shadow-1);
}
.dash-vue-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--c-marque-12);
  color: var(--c-marque);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dash-vue-icon svg { width: 16px; height: 16px; }
.dash-vue-name { font-weight: 700; font-size: 12px; color: var(--c-entreprise); line-height: 1.2; }
.dash-vue-desc { font-size: 10px; color: var(--c-text-3); margin-top: 2px; line-height: 1.2; }
.dash-vue.active .dash-vue-name { color: var(--c-marque); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  grid-auto-rows: minmax(110px, auto);
}
.dashboard-grid.edit-mode .dash-widget {
  outline: 2px dashed var(--c-marque);
  outline-offset: -2px;
}

.dash-widget {
  position: relative;
  min-height: 110px;
}
.widget-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(53, 149, 169, 0.08);
  z-index: 5;
  pointer-events: none;
}
.widget-edit-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  pointer-events: auto;
  z-index: 10;
}
.widget-ctrl {
  background: white;
  border: 1px solid var(--c-marque);
  color: var(--c-marque);
  width: 26px; height: 26px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.widget-ctrl svg { width: 12px; height: 12px; }
.widget-ctrl:hover:not(:disabled) { background: var(--c-marque); color: white; }
.widget-ctrl:disabled { opacity: 0.3; cursor: not-allowed; }
.widget-ctrl.danger { border-color: var(--c-alerte); color: var(--c-alerte); }
.widget-ctrl.danger:hover:not(:disabled) { background: var(--c-alerte); color: white; }

.widget-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.widget-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-entreprise);
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-title svg { width: 14px; height: 14px; color: var(--c-marque); }
.widget-body {
  padding: 14px 16px;
  flex: 1;
  overflow-y: auto;
}

/* KPI widget compact */
.kpi-w {
  padding: 14px 16px;
}
.kpi-w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-w-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.kpi-w-icon svg { width: 14px; height: 14px; }
.kpi-w-title { font-size: 12px; font-weight: 600; color: var(--c-text-2); flex: 1; }
.kpi-w-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--c-entreprise);
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.kpi-w-delta {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.kpi-w-spark {
  height: 28px;
  margin-top: 8px;
}
.kpi-w-spark svg { width: 100%; height: 100%; display: block; }

/* Library item hover */
.lib-item:not(:disabled):hover {
  border-color: var(--c-marque);
  background: var(--c-marque-08);
}
.lib-item:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== Lang dropdown ===== */
.lang-dropdown {
  position: fixed;
  top: 70px;
  right: 280px;
  width: 190px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  z-index: 200;
  padding: 6px;
  animation: slideUp .15s ease-out;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.lang-option:hover { background: var(--c-marque-08); }
.lang-option.active { background: var(--c-marque-12); color: var(--c-marque); font-weight: 700; }
.lang-flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-flag svg { display: block; width: 100%; height: 100%; }
.lang-name { flex: 1; text-align: left; }
.lang-check { color: var(--c-valide); font-weight: 700; }

/* ===== RTL support (Arabic) — vrai effet miroir ===== */
/* Avec dir="rtl" sur <html>, CSS Grid place les colonnes de droite à gauche.
   On ne touche PAS à grid-template-columns (sidebar reste 1er enfant → colonne 1
   → s'affiche à droite en RTL). On adapte juste les bordures/ombres physiques. */

body.rtl .sidebar {
  border-right: none;
  border-left: 1px solid var(--c-border);
  box-shadow: -1px 0 3px rgba(0, 29, 75, 0.04);
}
body.rtl .topbar {
  /* Réinverser car flex se met déjà en row-reverse en RTL — on remet l'ordre logique */
}
body.rtl .nav-item.active::before {
  left: auto;
  right: -14px;
  border-radius: 3px 0 0 3px;
}
body.rtl .save-bar {
  /* save-bar est fixed avec left:220px ; en RTL on doit la pousser depuis la droite */
  left: 0;
  right: 220px;
}

/* Dropdowns flottants — repositionnement en miroir */
body.rtl .lang-dropdown { right: auto; left: 280px; }
body.rtl .notifs-dropdown { right: auto; left: 180px; }
body.rtl .user-menu-dropdown { right: auto; left: 28px; }

/* FAB & overlays */
body.rtl .ai-fab { right: auto; left: 22px; }
body.rtl .ai-panel.floating { right: auto; left: 16px; }
body.rtl .ai-panel.expanded { left: 16px; right: calc(220px + 16px); }
body.rtl .main.ai-floating-open .view { padding-right: 0; padding-left: 360px; }
body.rtl .toast { right: auto; left: 24px; }

/* Drawer slide depuis la gauche en RTL */
body.rtl .drawer { right: auto; left: 0; animation: slideFromLeft .25s ease-out; }
@keyframes slideFromLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Éléments où le BiDi naturel ne suffit pas */
body.rtl .stacked-marker-label { direction: ltr; }
body.rtl .kpi-value, body.rtl .summary-value { direction: ltr; text-align: right; unicode-bidi: plaintext; }

/* Inverser les flèches directionnelles (chevrons de pagination, arrows, breadcrumb) */
body.rtl .breadcrumb svg,
body.rtl .ai-send svg,
body.rtl .pager-btn svg {
  transform: scaleX(-1);
}

/* ===== Walfy — Mascotte Sidebar (sans cadre, juste le renard) ===== */
.walfy-mascot {
  position: relative;
  flex: 0 0 auto;
  margin: auto 4px;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--c-entreprise);
  font-family: inherit;
  text-align: center;
  transition: transform .2s;
}
.walfy-mascot:focus,
.walfy-mascot:focus-visible,
.walfy-mascot:active { outline: 0; box-shadow: none; }
.walfy-mascot-img-wrap { border: 0; outline: 0; box-shadow: none; }
.walfy-mascot-img { border: 0; outline: 0; }
.walfy-mascot:hover { transform: translateY(-2px); }
.walfy-mascot::after,
.walfy-mascot-halo { display: none; }
.walfy-mascot-img-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: transparent;
}
.walfy-mascot-img {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.walfy-img-fullbody {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse closest-side at center, #000 88%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side at center, #000 88%, transparent 100%);
  animation: walfy-bob 3.5s infinite ease-in-out;
  transform-origin: center 70%;
}
@keyframes walfy-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-2px) rotate(1.5deg); }
}

/* Hover : le renard vibre un peu plus vite */
.walfy-mascot:hover .walfy-img-fullbody { animation-duration: 1.8s; }
.walfy-mascot-text { flex: 0 0 auto; min-width: 0; text-align: center; padding: 0 4px; color: var(--c-entreprise); }
.walfy-mascot-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
  color: var(--c-entreprise);
}
.walfy-mascot-subtitle {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
  font-weight: 500;
}
.walfy-mascot-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 22px; height: 22px;
  background: var(--c-complement);
  color: var(--c-entreprise);
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  display: grid;
  place-items: center;
  border: 2px solid var(--c-surface);
  box-shadow: 0 2px 6px rgba(231, 180, 111, 0.5);
  z-index: 3;
  padding: 0 5px;
  animation: walfy-bounce 2s infinite;
}
@keyframes walfy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* RTL : mascotte adaptée */
body.rtl .walfy-mascot { padding: 12px 14px 12px 12px; text-align: right; }
body.rtl .walfy-mascot-badge { right: auto; left: -4px; }

/* ===== Composer Claude-style (input enrichi) ===== */
.ai-composer {
  margin: 0;
  padding: 14px;
  background: white;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ai-composer-textarea {
  width: 100%;
  resize: none;
  border: 1.5px solid var(--c-border);
  border-radius: 14px 14px 0 0;
  border-bottom: none;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: white;
  outline: none;
  min-height: 80px;
  max-height: 220px;
  transition: border-color .15s;
}
.ai-composer-textarea:focus {
  border-color: var(--c-marque);
}
.ai-composer-textarea::placeholder { color: var(--c-text-3); }
.ai-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: white;
  border: 1.5px solid var(--c-border);
  border-top: 1px solid var(--c-border-2);
  border-radius: 0 0 14px 14px;
  transition: border-color .15s;
}
.ai-composer-textarea:focus + .ai-composer-toolbar {
  border-color: var(--c-marque);
}
.ai-composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-composer-btn {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  display: grid;
  place-items: center;
  color: var(--c-text-2);
  transition: background .15s, color .15s;
}
.ai-composer-btn:hover { background: var(--c-bg); color: var(--c-marque); }
.ai-composer-btn svg { width: 16px; height: 16px; }
.ai-composer-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-left: 6px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all .15s;
}
.ai-composer-mode-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-text-3);
}
.ai-composer-mode:hover { background: white; border-color: var(--c-marque); color: var(--c-marque); }
.ai-composer-mode.on {
  background: linear-gradient(135deg, var(--c-marque), var(--c-entreprise));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(53, 149, 169, 0.3);
}
.ai-composer-mode.on .ai-composer-mode-dot { background: var(--c-complement); animation: blink 1.2s infinite; }
.ai-composer-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c-marque);
  color: white;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(53, 149, 169, 0.3);
}
.ai-composer-send:hover { background: #2A8294; transform: scale(1.06); }
.ai-composer-send:active { transform: scale(0.95); }
.ai-composer-send svg { width: 18px; height: 18px; }

/* Composer en une seule ligne : trombone + champ + envoyer */
.ai-composer.ai-composer-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.ai-composer-inline .ai-composer-textarea {
  flex: 1;
  border: 1.5px solid var(--c-border);
  border-radius: 18px;
  padding: 12px 14px;
  min-height: 80px;
  max-height: 240px;
  font-size: 12px;
  line-height: 1.5;
}
.ai-composer-inline .ai-composer-textarea:focus { border-color: var(--c-marque); }
.ai-composer-inline .ai-composer-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--c-text-3);
}
.ai-composer-inline .ai-composer-btn svg { width: 16px; height: 16px; }
.ai-composer-inline .ai-composer-send {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

/* Désactiver l'ancien FAB s'il subsiste */
.ai-fab { display: none !important; }

/* ===== Agent IA enrichi (Walfy) ===== */
.ai-avatar-wrap { position: relative; flex-shrink: 0; }
.ai-status-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-text-3);
  border: 2px solid white;
}
.ai-status-dot.online { background: var(--c-valide); }
.ai-status-dot.working { background: var(--c-encours); animation: blink 0.9s infinite; }

.ai-tag-pro {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--c-marque), var(--c-entreprise));
  color: white;
  margin-left: 6px;
  vertical-align: middle;
}

.ai-mode-toggle {
  display: flex;
  background: var(--c-bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-right: 6px;
}
.ai-mode-btn {
  background: transparent;
  border: none;
  width: 30px; height: 26px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.ai-mode-btn:hover { background: white; }
.ai-mode-btn.active { background: var(--c-marque); color: white; box-shadow: 0 2px 4px rgba(53, 149, 169, 0.3); }

/* Capabilities panel */
.ai-capabilities {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  animation: slideDown .15s ease-out;
}
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 400px; } }
.ai-cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.ai-cap-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-cap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--c-border);
}
.ai-cap-foot {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--c-text-3);
  text-align: center;
}

/* Quick toolbar (sous l'input) */
.ai-quick-toolbar {
  display: flex;
  gap: 6px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--c-border-2);
  margin-bottom: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.ai-quick-btn {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: all .15s;
  color: var(--c-text-2);
}
.ai-quick-btn svg { width: 14px; height: 14px; }
.ai-quick-btn:hover { background: var(--c-marque-08); border-color: var(--c-marque); color: var(--c-marque); }
.ai-quick-btn.agent-on {
  background: linear-gradient(135deg, var(--c-marque), var(--c-entreprise));
  color: white;
  border: none;
  width: auto;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(53, 149, 169, 0.35);
}
.ai-input-row { display: flex; gap: 10px; align-items: flex-end; }

/* Suggestions proactives par catégorie */
.ai-proactive {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}
.ai-proactive-cat { }
.ai-proactive-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-entreprise);
  margin-bottom: 6px;
}
.ai-proactive-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Action stream — visualisation de l'agent en action */
.ai-stream {
  margin-top: 10px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 10px;
}
.ai-stream-head {
  font-weight: 700;
  font-size: 12px;
  color: var(--c-entreprise);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border-2);
}
.ai-stream-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 5px 0;
}
.ai-stream-icon {
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ai-stream-icon svg { width: 12px; height: 12px; color: var(--c-valide); }
.ai-stream-step.pending .ai-stream-icon { color: var(--c-text-3); }
.ai-stream-spin {
  width: 12px; height: 12px;
  border: 2px solid var(--c-encours);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-stream-text { flex: 1; min-width: 0; }

/* Confirmation cards */
.ai-confirm {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--c-encours-12), white);
  border: 1.5px solid var(--c-encours);
  border-radius: 10px;
  padding: 14px;
}
.ai-confirm-head {
  font-size: 13px;
  color: var(--c-text);
  margin-bottom: 10px;
}
.ai-confirm-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: white;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.ai-confirm-item {
  padding: 4px 0;
  border-bottom: 1px solid var(--c-border-2);
  color: var(--c-text-2);
}
.ai-confirm-item:last-child { border-bottom: none; }
.ai-confirm-detail {
  font-size: 11px;
  color: var(--c-text-3);
  font-style: italic;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
}
.ai-confirm-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-entreprise);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp .2s;
}
.toast svg { width: 16px; height: 16px; color: var(--c-valide); }
