/* ============================================================
   Secrétaire IA — Design 2026 "Soft Luxe"
   Aéré, lumineux, cartes nettes, couleur par touches, data-viz.
   ============================================================ */

:root {
  /* Duotone signature : Indigo × Corail */
  --brand: #6366f1;
  --brand-2: #fb7185;
  --brand-grad: linear-gradient(120deg, #6366f1 0%, #a855f7 52%, #fb7185 100%);
  --coral: #fb7185;

  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --text: #14142a;
  --muted: #6b6f8a;
  --border: #ececf4;

  --violet: #7c6cff;
  --sky: #0ea5e9;
  --amber: #f59e0b;
  --emerald: #10b981;
  --rose: #f43f5e;

  --shadow: 0 14px 40px -20px rgba(30, 22, 80, 0.28), 0 4px 12px -8px rgba(30, 22, 80, 0.08);
  --shadow-lg: 0 30px 70px -30px rgba(30, 22, 80, 0.4);
  --shadow-brand: 0 16px 36px -16px rgba(99, 102, 241, 0.5);

  --radius: 22px;
  --radius-sm: 13px;
  --radius-lg: 26px;
  --sidebar-w: 264px;
}

[data-theme="dark"] {
  /* "Command Center" — navy profond, cartes anthracite */
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --bg: #0a0e1a;
  --surface: #121826;
  --surface-2: #1a2233;
  --text: #eef2fb;
  --muted: #8b95ad;
  --border: rgba(255, 255, 255, 0.07);

  --shadow: 0 22px 54px -30px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 40px 90px -34px rgba(0, 0, 0, 0.85);
  --shadow-brand: 0 16px 36px -18px rgba(59, 130, 246, 0.55);
}
[data-theme="dark"] .card,
[data-theme="dark"] .stat,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .qa { backdrop-filter: blur(6px); }

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  background-image:
    radial-gradient(60% 45% at 100% 0%, rgba(251, 113, 133, 0.12), transparent 70%),
    radial-gradient(52% 42% at 0% 0%, rgba(99, 102, 241, 0.12), transparent 70%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(50% 40% at 100% 0%, rgba(59, 130, 246, 0.14), transparent 70%),
    radial-gradient(48% 38% at 0% 3%, rgba(139, 92, 246, 0.12), transparent 72%);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--rose); font-size: 0.85rem; margin-top: 10px; min-height: 1em; font-weight: 600; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.03em; }
a { color: var(--brand); }

.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--brand-grad); color: #fff; font-size: 1.5rem;
  box-shadow: var(--shadow-brand);
}
.logo-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 1.2rem; }

/* ============ Boutons & champs ============ */
button { font-family: inherit; cursor: pointer; border: none; }

.btn-primary,
#content button:not(.small):not(.ghost):not(.icon-btn):not(.hero-cta),
#login-form button {
  background: var(--brand-grad); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 700;
  box-shadow: var(--shadow-brand);
  transition: transform 0.14s ease, box-shadow 0.22s ease, filter 0.2s ease;
}
.btn-primary:hover,
#content button:not(.small):not(.ghost):not(.icon-btn):not(.hero-cta):hover,
#login-form button:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 22px 44px -16px rgba(99, 102, 241, 0.6); }
.btn-block { width: 100%; margin-top: 22px; }

button.ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.85rem;
  transition: all 0.16s ease; box-shadow: var(--shadow);
}
button.ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
button.small { padding: 7px 13px; font-size: 0.78rem; border-radius: 10px; margin: 0; box-shadow: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: all 0.16s ease;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

label { display: block; margin: 15px 0 6px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.92rem; font-family: inherit;
  background: var(--surface-2); color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.65; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
textarea { min-height: 120px; resize: vertical; }

/* ============ Login ============ */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #4338ca, #9333ea 52%, #fb7185);
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.auth-aside::before, .auth-aside::after { content: ""; position: absolute; border-radius: 50%; filter: blur(20px); }
.auth-aside::before { width: 360px; height: 360px; top: -100px; right: -80px; background: rgba(56, 189, 248, 0.4); }
.auth-aside::after { width: 280px; height: 280px; bottom: -90px; left: -70px; background: rgba(244, 63, 94, 0.32); }
.auth-aside-inner { position: relative; color: #fff; max-width: 400px; }
.auth-aside-inner h2 { font-size: 2.1rem; margin: 22px 0 12px; }
.auth-aside-inner p { font-size: 1.05rem; opacity: 0.92; line-height: 1.6; }
.auth-feats { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 13px; }
.auth-feats li { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.auth-feats span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(255, 255, 255, 0.25); font-size: 0.75rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 38px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.8rem; margin: 22px 0 4px; }
.auth-card > p { margin: 0 0 8px; }

/* ============ App shell ============ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 26px; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand-name strong { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 14px;
  background: transparent; color: var(--muted);
  font-size: 0.92rem; font-weight: 700; text-align: left; width: 100%;
  transition: all 0.16s ease;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: rgba(99, 102, 241, 0.12); color: var(--brand); }
.nav-item.active svg { stroke: var(--brand); }

.sidebar-foot { display: flex; align-items: center; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; text-transform: uppercase; box-shadow: var(--shadow-brand); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta strong { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .muted { font-size: 0.72rem; }

/* ============ Main ============ */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px 36px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.5rem; }
.topbar #page-sub { font-size: 0.88rem; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 32px 36px 56px; max-width: 1280px; width: 100%; margin: 0 auto; animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

[data-theme="light"] .ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }

/* ============ Cartes ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.section-title { font-size: 1.12rem; margin: 4px 0 16px; }
.row { display: flex; gap: 22px; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

/* ============ Dashboard ============ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); padding: 34px 36px; margin-bottom: 26px;
  background: linear-gradient(115deg, #4f46e5 0%, #9333ea 50%, #fb7185 108%);
  color: #fff; box-shadow: var(--shadow-lg);
}
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; top: -130px; right: -70px; background: rgba(255, 255, 255, 0.14); }
.hero-eyebrow { position: relative; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.hero h2 { font-size: 1.95rem; position: relative; margin-top: 8px; }
.hero p { opacity: 0.94; margin-top: 8px; font-size: 1rem; position: relative; max-width: 560px; }
.hero-cta {
  position: relative; margin-top: 20px; background: #fff; color: #5b21b6;
  padding: 11px 20px; border-radius: 12px; font-weight: 800; font-size: 0.9rem;
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.4); transition: transform 0.15s ease;
}
.hero-cta:hover { transform: translateY(-2px); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 8px; box-shadow: var(--shadow); transition: transform 0.18s ease, box-shadow 0.22s ease; overflow: hidden; }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.chip { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.chip svg { width: 22px; height: 22px; }
.chip.violet { background: rgba(99, 102, 241, 0.14); color: var(--brand); }
.chip.rose { background: rgba(251, 113, 133, 0.16); color: var(--coral); }
.chip.sky { background: rgba(14, 165, 233, 0.14); color: var(--sky); }
.chip.amber { background: rgba(245, 158, 11, 0.16); color: var(--amber); }
.chip.emerald { background: rgba(16, 185, 129, 0.14); color: var(--emerald); }
.delta { font-size: 0.74rem; font-weight: 800; padding: 4px 9px; border-radius: 20px; }
.delta.up { background: rgba(16, 185, 129, 0.14); color: var(--emerald); }
.delta.down { background: rgba(244, 63, 94, 0.14); color: var(--rose); }
.stat-num { font-size: 2.15rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-top: 16px; }
.stat-lbl { color: var(--muted); font-size: 0.85rem; margin-top: 6px; font-weight: 600; }
.spark { width: calc(100% + 40px); height: 40px; display: block; margin: 10px -20px -8px; }

.chart svg { width: 100%; height: 190px; display: block; }
.chart-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.74rem; font-weight: 600; margin-top: 10px; padding: 0 4px; }

.svc-row { display: flex; flex-direction: column; gap: 10px; }
.svc { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 0.86rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-left: auto; }
.dot.up { background: var(--emerald); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
.dot.down { background: var(--rose); box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.2); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.qa { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 700; flex: 1; min-width: 210px; transition: all 0.18s ease; cursor: pointer; }
.qa:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.qa .chip { width: 44px; height: 44px; }

/* ============ Tables ============ */
/* BUG RÉEL corrigé (P1.1, CLAUDE.md, 2026-07-24) : `overflow: hidden` sur ce
   conteneur ROGNAIT silencieusement les colonnes de droite dès qu'un tableau
   contenait plus de colonnes que la largeur visible (ex. « Statut » coupé en
   « Stat » dans E-mails envoyés) — jamais un simple problème visuel, une
   vraie perte d'information. `overflow-x: auto` permet un défilement
   horizontal (le tableau entier reste lisible, rien n'est jamais coupé) ;
   `overflow-y: hidden` conservé uniquement pour que les coins arrondis
   restent nets verticalement (aucun effet sur le défilement horizontal). */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 18px; font-size: 0.9rem; }
thead th { color: var(--muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ============ Badges ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 0.74rem; font-weight: 800; background: rgba(99, 102, 241, 0.12); color: var(--brand); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.done { background: rgba(16, 185, 129, 0.14); color: var(--emerald); }
.badge.pending { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.badge.important, .badge.down { background: rgba(244, 63, 94, 0.14); color: var(--rose); }
.badge.neutral { background: rgba(107, 111, 138, 0.16); color: var(--muted); }
.badge.info { background: rgba(99, 102, 241, 0.14); color: var(--brand); }

/* Avatars dégradés (duotone) */
.av { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.76rem; color: #fff; flex-shrink: 0; letter-spacing: 0.02em; }
.av-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.av-coral { background: linear-gradient(135deg, #fb7185, #f59e0b); }
.av-sky { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.cell { display: flex; align-items: center; gap: 12px; }
.cell .sub { color: var(--muted); font-size: 0.78rem; }

/* Pastille de priorité */
.pri { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 9px; vertical-align: middle; }
.pri.high { background: var(--coral); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18); }
.pri.normal { background: var(--brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.pri.low { background: var(--muted); }

/* Barre d'outils de page + compteur */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.count { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 7px 14px; border-radius: 20px; box-shadow: var(--shadow); }
.count b { color: var(--text); }
.amount { font-weight: 800; letter-spacing: -0.02em; }
.empty { padding: 30px; text-align: center; color: var(--muted); font-weight: 600; }

/* ============ Divers ============ */
.flash { padding: 13px 17px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; font-size: 0.88rem; }
.flash.ok { background: rgba(16, 185, 129, 0.14); color: #047857; }
.flash.err { background: rgba(244, 63, 94, 0.14); color: var(--rose); }
.flash.warn { background: rgba(245, 158, 11, 0.14); color: #92600a; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
pre { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.85rem; background: var(--surface-2); padding: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.skeleton { color: var(--muted); padding: 46px; text-align: center; font-weight: 600; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); z-index: 6; }
  .sidebar-brand { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item span { display: none; }
  .nav-item { padding: 11px; }
  .sidebar-foot { border-top: none; padding-top: 0; margin: 0 0 0 auto; }
  .user-meta { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ============================================================
   BAYA v2 — Operation Command Center (Module 6)
   ============================================================ */

/* ---- Sidebar brand + sections + sociétés ---- */
.brand-block { display: flex; flex-direction: column; line-height: 1.05; }
.brand-sub { font-size: 0.56rem; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); margin-top: 3px; }
.sidebar { padding: 20px 14px; }
.nav { overflow-y: auto; gap: 3px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.nav-item { padding: 10px 13px; font-size: 0.88rem; position: relative; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 0.72rem; font-weight: 800; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center; }
.nav-item.active .nav-badge { background: rgba(59, 130, 246, 0.2); color: var(--brand); }
.nav-section { display: flex; align-items: center; justify-content: space-between; padding: 20px 12px 8px; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.nav-add { width: 20px; height: 20px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.nav-add:hover { background: var(--brand); color: #fff; }
.companies-nav { display: flex; flex-direction: column; gap: 2px; }
.co-item { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-radius: 12px; background: transparent; color: var(--text); font-size: 0.86rem; font-weight: 700; text-align: left; width: 100%; transition: all 0.15s ease; }
.co-item:hover { background: var(--surface-2); }
.co-item.active { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.co-dot { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 800; color: #fff; flex-shrink: 0; }

/* ---- Theme switch (bas de sidebar) ---- */
.sidebar-foot { border-top: 1px solid var(--border); }
.theme-switch { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.84rem; transition: all 0.15s ease; }
.theme-switch svg { width: 18px; height: 18px; color: var(--muted); }
.theme-switch span { flex: 1; text-align: left; }
.switch-track { width: 38px; height: 22px; border-radius: 12px; background: var(--brand); position: relative; transition: background 0.2s ease; flex-shrink: 0; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
[data-theme="light"] .switch-track { background: var(--border); }
[data-theme="light"] .switch-thumb { transform: translateX(16px); }
[data-theme="light"] .ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }

/* ---- Topbar : recherche + actions + user ---- */
.main { min-height: 100vh; }
.topbar { padding: 16px 30px; }
.search-box { display: flex; align-items: center; gap: 11px; flex: 1; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow); }
.search-box svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-box input { border: none; background: transparent; box-shadow: none; padding: 12px 0; font-size: 0.9rem; }
.search-box input:focus { box-shadow: none; }
.search-box kbd { font-family: inherit; font-size: 0.7rem; font-weight: 800; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 7px; }
.search-box #search-mic { width: 28px; height: 28px; border-radius: 9px; font-size: 0.95rem; flex-shrink: 0; box-shadow: none; }
.search-box #search-mic.mic-live { color: var(--rose); border-color: var(--rose); }
.icon-btn.has-badge { position: relative; }
.ico-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--rose); color: #fff; font-size: 0.64rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 12px 6px 6px; box-shadow: var(--shadow); transition: all 0.15s ease; }
.topbar .user-chip:hover { border-color: var(--brand); }
.topbar .user-meta { text-align: left; }
.topbar .user-meta strong { font-size: 0.82rem; }
.topbar .user-meta .muted { font-size: 0.7rem; }
#sync-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Barre d'état (footer) ---- */
.statusbar { display: flex; align-items: center; gap: 22px; padding: 12px 30px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(10px); font-size: 0.78rem; font-weight: 600; margin-top: auto; }
.st-item { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.st-item b { color: var(--text); }
.st-spacer { flex: 1; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; }
.st-dot.up { background: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* ---- Dashboard : entête + sélecteur société ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-head h2 { font-size: 1.9rem; }
.dash-head p { color: var(--muted); margin-top: 4px; font-size: 0.9rem; }
.co-select { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 9px 14px; box-shadow: var(--shadow); font-weight: 800; font-size: 0.9rem; cursor: pointer; position: relative; }
.co-select select { border: none; background: transparent; box-shadow: none; padding: 0 22px 0 0; font-weight: 800; -webkit-appearance: none; appearance: none; cursor: pointer; }
.co-select select:focus { box-shadow: none; }
.co-select::after { content: "▾"; position: absolute; right: 14px; color: var(--muted); pointer-events: none; }

/* ---- KPI ×6 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); transition: transform 0.16s ease, box-shadow 0.2s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-lbl { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 6px; }
.kpi-sub { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.kpi-sub.up { color: var(--emerald); }
.kpi-sub.down { color: var(--rose); }
.k-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.k-red { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.k-amber { background: rgba(245, 158, 11, 0.16); color: #f59e0b; }
.k-violet { background: rgba(139, 92, 246, 0.16); color: #8b5cf6; }
.k-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.k-cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

/* ---- Grille 3 colonnes du dashboard ---- */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1.6fr 1.25fr; gap: 20px; align-items: start; }
.dash-grid .card { padding: 20px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title h3 { font-size: 1rem; letter-spacing: -0.01em; }
.panel-title .link { font-size: 0.78rem; font-weight: 800; color: var(--brand); cursor: pointer; }

/* Aperçu rapide (liste) */
.mini-list { display: flex; flex-direction: column; gap: 3px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 11px; cursor: pointer; transition: background 0.12s ease; }
.mini-row:hover { background: var(--surface-2); }
.mini-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-ico svg { width: 15px; height: 15px; }
.mini-row .lbl { flex: 1; font-weight: 700; font-size: 0.87rem; }
.mini-row .val { font-weight: 800; font-size: 0.9rem; }
.mini-row .val.warn { color: var(--amber); }
.mini-row .chev { color: var(--muted); }

/* Activité (légende + chart) */
.legend { display: flex; gap: 16px; }
.legend span { display: flex; align-items: center; gap: 7px; font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* État de la plateforme (Mode Production) */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ops-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; }
.ops-item .task-dot { margin-top: 5px; flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; }

/* Tâches prioritaires */
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row.ceo-action-go { cursor: pointer; }
.task-row.ceo-action-go:hover { background: var(--surface-2); border-radius: 8px; }
.task-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.task-main { flex: 1; min-width: 0; }
.task-main .t { font-weight: 700; font-size: 0.88rem; }
.task-main .s { color: var(--muted); font-size: 0.76rem; margin-top: 2px; }
.task-tag { text-align: right; flex-shrink: 0; }
.task-tag .p { font-size: 0.72rem; font-weight: 800; }
.task-tag .d { color: var(--muted); font-size: 0.72rem; margin-top: 2px; }

/* Échéances */
.due-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.due-row:last-child { border-bottom: none; }
.due-main { flex: 1; min-width: 0; }
.due-main .t { font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.due-main .s { color: var(--muted); font-size: 0.75rem; margin-top: 2px; }
.due-pill { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.due-pill.soon { background: rgba(244, 63, 94, 0.14); color: var(--rose); }
.due-pill.mid { background: rgba(245, 158, 11, 0.16); color: #f59e0b; }
.due-pill.far { background: rgba(16, 185, 129, 0.14); color: var(--emerald); }

/* Donut répartition */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.donut-center span { font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dl-row { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; }
.dl-row i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.dl-row .n { font-weight: 700; flex: 1; }
.dl-row .v { color: var(--muted); font-weight: 700; }

/* Documents récents */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: none; }
.doc-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-ico svg { width: 15px; height: 15px; color: var(--muted); }
.doc-main { flex: 1; min-width: 0; }
.doc-main .t { font-weight: 700; font-size: 0.83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main .s { color: var(--muted); font-size: 0.73rem; }
.tag { font-size: 0.66rem; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }

/* Placeholder "module à venir" */
.soon-panel { text-align: center; padding: 60px 30px; }
.soon-panel .big { font-size: 2.4rem; margin-bottom: 10px; }
.soon-panel h3 { font-size: 1.2rem; margin-bottom: 8px; }
.soon-panel p { color: var(--muted); max-width: 440px; margin: 0 auto; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: sticky; flex-direction: column; height: 100vh; overflow-y: auto; }
  .nav-section, .companies-nav, .brand-sub { display: none; }
  .search-box { max-width: none; }
  .topbar .user-meta { display: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .statusbar { flex-wrap: wrap; gap: 12px; }
}

/* ---- Boîte triée : grille de dossiers (Phase 3) ---- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.folder-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, border-color .15s ease; position: relative; }
.folder-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.folder-card.active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent); }
.fc-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.fc-lbl { font-weight: 800; font-size: .9rem; letter-spacing: -.01em; }
.fc-n { position: absolute; top: 12px; right: 14px; font-weight: 800; color: var(--muted); font-size: .95rem; }
.fc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1.05rem; }

/* ============================================================
   BAYA v3 — UX premium (briefing secrétaire IA, listes sobres)
   Accent = violet, réservé à l'emphase. Le reste : sobre.
   ============================================================ */
:root { --accent: #8b5cf6; --accent-soft: rgba(139,92,246,.12); }
[data-theme="dark"] { --accent: #a78bfa; --accent-soft: rgba(167,139,250,.14); }

.content { max-width: 1120px; padding: 28px 40px 64px; }
.dash-head { margin-bottom: 22px; }
.dash-head h2 { font-size: 1.7rem; letter-spacing: -0.03em; }

/* CEO Command Center (D063, étendu D070) — état du groupe, alertes, "que dois-je faire",
   pipeline commercial/opérationnel, rapports stratégiques */
.ceo-command-center { margin-bottom: 28px; }
.ceo-command-center .sec-head { margin-top: 22px; }
.ceo-command-center .sec-head h4 { font-size: 0.95rem; letter-spacing: -0.01em; color: var(--muted); }
.ceo-kpi-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.ceo-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ceo-alert {
  padding: 10px 14px; border-radius: 10px; border-left: 4px solid var(--muted);
  background: var(--surface); border-top: 1px solid var(--border);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.ceo-today-btn { width: 100%; margin-bottom: 10px; }
.ceo-today-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ceo-methodology { font-size: 0.8rem; margin-top: 8px; }
.ceo-reports-list { display: flex; flex-direction: column; gap: 16px; }
.ceo-reports-cat-lbl { font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); margin-bottom: 4px; }
.ceo-reports-list code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 11px; }
.rp-row { cursor: pointer; }
.rp-row:hover { background: var(--surface-2); border-radius: 8px; }
.rp-current { background: var(--surface-2); border-radius: 8px; opacity: 0.75; }

/* Lien profond générique (D075) : l'élément visé clignote brièvement pour que
   l'utilisateur sache immédiatement qu'il est bien arrivé sur le bon élément. */
@keyframes deepLinkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
  20% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.45); }
}
.deep-link-flash { animation: deepLinkPulse 1.1s ease-out 2; border-radius: 10px; }
@media (max-width: 780px) { .ceo-kpi-grid { grid-template-columns: repeat(1, 1fr); } }

/* Rapports Stratégiques (D074) — rendu Markdown minimal */
.rp-content { line-height: 1.65; overflow-x: auto; }
.rp-content h3, .rp-content h4, .rp-content h5 { margin: 20px 0 10px; letter-spacing: -0.01em; }
.rp-content h3 { font-size: 1.15rem; }
.rp-content h4 { font-size: 1.02rem; }
.rp-content h5 { font-size: 0.92rem; color: var(--muted); }
.rp-content p { margin: 8px 0; font-size: 0.92rem; }
.rp-content ul { margin: 8px 0; padding-left: 22px; }
.rp-content li { font-size: 0.92rem; margin: 3px 0; }
.rp-content blockquote { border-left: 3px solid var(--brand); margin: 10px 0; padding: 4px 14px; color: var(--muted); font-size: 0.9rem; }
.rp-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.rp-content code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 0.82em; }
.md-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 10px 0; }
.md-table td { padding: 6px 10px; border: 1px solid var(--border); vertical-align: top; }
.md-table tr:first-child td { background: var(--surface-2); font-weight: 700; }

/* Briefing IA — le message de la secrétaire */
.brief {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 22px 24px; border-radius: 20px; margin-bottom: 34px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--border);
}
.brief-mark {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent);
}
.brief-body { padding-top: 2px; }
.brief-lead { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.4; margin: 0; }
.brief-lead b { color: var(--accent); }
.brief-attn { color: var(--muted); margin: 6px 0 0; font-size: .95rem; font-weight: 600; }

/* Titres de section */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 14px; }
.sec-head h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.sec-head.sep { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border); }
/* P1.2 (CLAUDE.md, 2026-07-24) : catégories de Rapports Stratégiques en
   menus déroulants natifs (<details>). `display:flex` sur <summary>
   supprime le triangle natif d'ouverture/fermeture (comportement navigateur
   documenté) — remplacé par un chevron explicite, pivoté quand ouvert. */
summary.sec-head { list-style: none; }
summary.sec-head::-webkit-details-marker { display: none; }
.rp-chevron { display: inline-block; transition: transform 0.15s ease; color: var(--muted); }
details[open] > summary.sec-head .rp-chevron { transform: rotate(90deg); }

/* « À faire maintenant » — liste d'actions */
.todo-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.todo {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 18px; border-radius: 15px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.todo:hover { transform: translateY(-2px); border-color: var(--accent); }
.todo-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.todo-ic svg { width: 20px; height: 20px; }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.todo-t { font-weight: 700; font-size: .98rem; letter-spacing: -0.01em; }
.todo-s { color: var(--muted); font-size: .82rem; margin-top: 1px; }
.todo-n { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--text); }
.todo-chev { color: var(--muted); font-size: 1.3rem; margin-left: 4px; }
.todo-clear { padding: 26px; text-align: center; color: var(--muted); font-weight: 600; background: var(--surface); border: 1px dashed var(--border); border-radius: 16px; }

/* Boîte triée : liste de dossiers (plus de grosses cartes) */
.folder-grid { grid-template-columns: 1fr; gap: 6px; }
.folder-card { flex-direction: row; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 13px; }
.folder-card:hover { transform: none; background: var(--surface-2); }
.folder-card.active { transform: none; background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.fc-ic { width: 36px; height: 36px; font-size: 1.05rem; }
.fc-lbl { font-size: .92rem; }
.fc-n { position: static; margin-left: auto; font-size: 1rem; }

/* ============================================================
   BAYA v4 — Dashboard « briefing exécutif »
   ============================================================ */
/* Briefing : liste de ce que BAYA a fait */
.brief-lead { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.brief-did { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.brief-did li { position: relative; padding-left: 20px; font-size: .98rem; color: var(--muted); font-weight: 600; }
.brief-did li b { color: var(--text); }
.brief-did li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Votre journée : recommandations nommées */
.journee { margin-bottom: 30px; padding: 4px 4px 4px; }
.journee-h { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px 2px; }
.journee-h span { color: var(--muted); font-weight: 600; font-size: .92rem; }
.journee-list { margin: 0; padding: 0; list-style: none; counter-reset: j; display: flex; flex-direction: column; gap: 2px; }
.journee-list li { counter-increment: j; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; cursor: pointer; transition: background .12s ease; }
.journee-list li:hover { background: var(--surface-2); }
.journee-list li::before { content: counter(j); flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.jr-ic { font-size: 1.05rem; }
.journee-list li span:nth-child(3) { flex: 1; font-weight: 600; font-size: .95rem; }
.journee-list li b { font-weight: 800; }
.jr-go { color: var(--muted); font-weight: 800; }

/* Bandeau de synthèse : toute la situation en 2 secondes */
.synth { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 0 0 34px; }
.synth-cell { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.synth-ic { font-size: 1.25rem; }
.synth-k { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.synth-v { font-size: .9rem; font-weight: 700; margin-top: 1px; }

/* Cartes d'action compactes (sobres, pas de gros boutons violets) */
.act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.act { display: flex; flex-direction: column; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); transition: transform .14s ease, border-color .14s ease; }
.act:hover { transform: translateY(-2px); border-color: var(--accent); }
.act-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.act-ic { font-size: 1.2rem; }
.act-badge { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .82rem; display: flex; align-items: center; justify-content: center; }
.act-title { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.act-why { color: var(--muted); font-size: .84rem; margin: 3px 0 14px; line-height: 1.4; flex: 1; }
.act-btn { align-self: flex-start; padding: 7px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: .82rem; border: 1px solid var(--border); transition: all .14s ease; }
.act-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Suivi des e-mails (cycle de vie) */
.life-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.life { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.life-n { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.life-k { font-weight: 700; font-size: .84rem; margin-top: 8px; }
.life-s { color: var(--muted); font-size: .75rem; margin-top: 2px; }

@media (max-width: 1100px) {
  .synth, .life-grid { grid-template-columns: repeat(3, 1fr); }
  .act-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .synth, .life-grid, .act-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ BAYA v5 — File de travail intelligente ============ */
.jr-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.jr-t { font-weight: 600; }
.jr-why { font-size: 12px; color: var(--muted); }
.jr-co { color: var(--accent, var(--brand)); font-weight: 600; }

.tk-form { margin: 4px 0 16px; padding: 16px; gap: 10px; display: flex; flex-direction: column; }
.tk-form.hidden { display: none; }

.tk-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.tk-filter { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.tk-filter em { font-style: normal; opacity: .6; font-variant-numeric: tabular-nums; }
.tk-filter:hover { border-color: var(--accent, var(--brand)); color: var(--text); }
.tk-filter.on { background: var(--accent, var(--brand)); border-color: transparent; color: #fff; }
.tk-filter.on em { opacity: .85; }

.tk-list { display: flex; flex-direction: column; gap: 10px; }
.tk { display: flex; gap: 14px; padding: 15px 17px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); transition: box-shadow .15s, transform .05s; }
.tk:hover { box-shadow: 0 6px 22px rgba(20, 20, 42, .07); }
.tk-archived { opacity: .72; }
.tk-archived:hover { opacity: 1; }

/* --- Supervision --- */
.sup-wait { padding: 22px; line-height: 1.6; }
.sup-quality { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; }
.sup-q-score { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.sup-q-score span { font-size: 16px; font-weight: 600; opacity: .55; }
.sup-quality.q-ok .sup-q-score { color: #17915a; } .sup-quality.q-good .sup-q-score { color: #3b7ddd; }
.sup-quality.q-warn .sup-q-score { color: #d08700; } .sup-quality.q-crit .sup-q-score { color: #d33; }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sup-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.sup-kpi-v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sup-kpi-l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sup-kpi-s { color: var(--muted); font-size: 11px; opacity: .8; margin-top: 3px; }
.sup-aging { display: flex; gap: 12px; flex-wrap: wrap; }
.sup-age { flex: 1; min-width: 90px; text-align: center; padding: 12px; border-radius: var(--radius-sm); background: var(--bg, #f6f7fb); }
.sup-age b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.sup-age span { color: var(--muted); font-size: 12px; }
.sup-age-warn b { color: #d08700; } .sup-age-crit b { color: #d33; }
.sup-dets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.sup-det .sup-count { font-size: 12px; background: var(--border); border-radius: 10px; padding: 1px 8px; margin-left: 6px; }
.sup-list { list-style: none; margin: 0; padding: 0; }
.sup-list li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sup-list li:last-child { border-bottom: 0; }
.sup-list em { float: right; color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }

/* --- BAYA Execute --- */
.nav-exec span { font-weight: 700; }
.exec-hero { padding: 8px 0 4px; }
.exec-hero h2 { margin: 0 0 4px; }
.exec-bar { display: flex; gap: 10px; margin: 14px 0 10px; }
.exec-bar input { flex: 1; padding: 14px 16px; font-size: 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.exec-bar input:focus { outline: none; border-color: var(--accent, var(--brand)); }
.exec-examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.exec-chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 20px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.exec-chip:hover { border-color: var(--accent, var(--brand)); color: var(--text); }
.exec-card { margin: 18px 0; padding: 20px; }
.exec-plan-head { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 14px; }
.exec-badge { background: var(--accent, var(--brand)); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.exec-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.exec-kpis > div { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.exec-kpis span { display: block; font-size: 20px; font-weight: 800; }
.exec-list { margin: 0 0 12px; padding-left: 18px; color: var(--text); }
.exec-list li { padding: 2px 0; }
.exec-conseq { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 14px; }
.exec-conseq ul { margin: 6px 0 0; padding-left: 18px; }
.exec-conseq li { padding: 2px 0; font-size: 13.5px; }
.exec-actions { display: flex; justify-content: flex-end; gap: 10px; }
.exec-done { margin-top: 14px; padding: 12px 16px; background: rgba(23,145,90,.12);
  border: 1px solid rgba(23,145,90,.4); border-radius: var(--radius-sm); color: #17915a; font-weight: 600; }
.exec-nok { border-color: rgba(210,130,0,.4); }
.exec-hist { margin-top: 26px; }
.exec-hrow { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.exec-hrow:last-child { border-bottom: 0; }
.exec-rev { color: #d33; font-weight: 600; }

/* --- Mémoire BAYA --- */
.rc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.rc-tab { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.rc-tab.active { background: rgba(99, 102, 241, 0.12); color: var(--brand); border-color: var(--brand); }
.rc-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; line-height: 1.55; }
.rc-info h4 { margin-bottom: 8px; }
.kb-filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; }
.kb-filters input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.kb-filters select { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); }
.kb-editor { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.kb-editor textarea, .kb-editor input, .kb-editor select { width: 100%; }
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 220px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.12); margin-top: 2px; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; }
.autocomplete-item:hover { background: var(--bg-hover, rgba(0,0,0,0.05)); }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px;
  background: var(--bg-hover, rgba(99,102,241,0.1)); border: 1px solid var(--border); font-size: 0.82rem; }
.att-chip-x { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 0 2px; }
.att-chip-x:hover { color: var(--rose, #f43f5e); }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 17px; margin-bottom: 12px; }
.kb-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.kb-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: var(--accent, var(--brand)); color: #fff; padding: 2px 8px; border-radius: 5px; }
.kb-soc { font-size: 12px; color: var(--muted); margin-left: 8px; }
.kb-soc-all { font-style: italic; }
.kb-conf { font-size: 11px; margin-left: 8px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--border); }
.kb-conf-haute, .kb-conf-confirmee { color: #17915a; border-color: rgba(23,145,90,.4); }
.kb-conf-faible { color: #d08700; border-color: rgba(208,135,0,.4); }
.kb-title { font-weight: 700; margin-bottom: 3px; }
.kb-content { color: var(--text); white-space: pre-wrap; margin-bottom: 8px; }
.kb-meta { font-size: 12px; color: var(--muted); }
.kb-acts { display: flex; gap: 6px; }
.kb-why { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px 0 6px; font-size: 13px; }
.kb-revs { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.kb-revs li { padding: 4px 0; border-top: 1px solid var(--border); }
.kb-revs em { color: var(--muted); font-style: normal; }
.kb-lock { font-size: 12px; }

/* --- Centre de Décision --- */
.dc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.dc-tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: var(--radius-sm); padding: 7px 14px; cursor: pointer; }
.dc-tab.on { background: var(--accent, var(--brand)); border-color: transparent; color: #fff; }

/* --- Centre des Brouillons : ligne cliquable + fiche modale (correctif
   bloquant 2026-07-12 — avant ce correctif, seul un petit bouton dépliait
   une ligne inline discrète ; la ligne elle-même n'avait aucun clic). --- */
.dc-row { cursor: pointer; }
.dc-row:hover, .dc-row:focus-visible { background: var(--bg-soft, rgba(0,0,0,.035)); outline: none; }
.dc-hint { opacity: 0; margin-left: 8px; font-size: 12px; color: var(--accent, var(--brand)); white-space: nowrap; transition: opacity .12s; }
.dc-row:hover .dc-hint, .dc-row:focus-visible .dc-hint { opacity: 1; }

/* Colonnes du Centre des Brouillons (correctif 2026-07-20, Greg) : la colonne
   Objet était illisible (tronquée à quelques mots) car le tableau se
   répartissait sur 9 colonnes sans largeur imposée. `table-layout: fixed` +
   colgroup donne à l'Objet l'essentiel de la largeur et l'affiche sur 2
   lignes plutôt que de le couper sur une seule ; les colonnes techniques
   (Société, Langue) restent volontairement étroites. */
.dc-table { table-layout: fixed; }
.dc-table .dc-col-soc { width: 6%; }
.dc-table .dc-col-four { width: 15%; }
.dc-table .dc-col-objet { width: 34%; }
.dc-table .dc-col-lang { width: 5%; }
.dc-table .dc-col-exp { width: 13%; }
.dc-table .dc-col-etat { width: 10%; }
.dc-table .dc-col-maj { width: 11%; }
.dc-table .dc-col-act { width: 12%; }
.dc-table .dc-cell-objet strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; line-height: 1.3; word-break: break-word; }
.dc-table .dc-cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .dc-table { table-layout: auto; }
  .dc-table .dc-cell-truncate { white-space: normal; }
}
.dc-fiche { max-width: 720px; width: 100%; }
.dc-fiche-head { margin-bottom: 10px; }
.dc-fiche-head h3 { margin: 4px 0 0; }
.dc-fiche-body > div { padding: 3px 0; }
.dc-fiche-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.dc-origin-body { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; padding: 8px 10px; background: var(--bg-soft, rgba(0,0,0,.03)); border-radius: 6px; max-height: 220px; overflow-y: auto; }
.dc-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--border); }
.dc-thread-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.dc-thread-item:last-child { border-bottom: none; }

/* Lecture intégrale type Apple Mail (mandat « poste de travail », 2026-07-12) —
   iframe sandboxée pour le corps HTML d'un e-mail reçu (jamais de contenu
   fournisseur injecté directement dans le DOM de BAYA). */
.dc-html-frame { width: 100%; min-height: 260px; max-height: 460px; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.dc-links { margin-top: 6px; font-size: 13px; }
.dc-links a { margin-right: 6px; }

/* Pièces jointes enrichies (fournisseur/RFQ/catégorie GED + actions). */
.dc-att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 6px; }
.dc-att-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--bg-soft, rgba(0,0,0,.02)); }
.dc-att-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-att-name { font-weight: 600; margin-top: 4px; word-break: break-word; }
.dc-att-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dc-att-tr-panel { margin-top: 6px; }
.tr-widget { margin-top: 6px; }
.tr-panel { margin-top: 6px; }
.tr-result { padding: 8px 10px; background: var(--bg-soft, rgba(0,0,0,.03)); border-left: 3px solid var(--accent, var(--brand)); border-radius: 4px; }
.dc-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dc-chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 20px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.dc-chip.on { border-color: var(--accent, var(--brand)); color: var(--text); }
.dc-chip em { font-style: normal; opacity: .6; }
.dc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 12px; }
.dc-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dc-catbadge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 9px;
  border-radius: 5px; color: #fff; background: #64748b; }
.dc-c-juridique { background: #d33; } .dc-c-financiere { background: #d08700; }
.dc-c-strategique { background: #7c3aed; } .dc-c-commerciale { background: #2563eb; }
.dc-c-technique { background: #0891b2; } .dc-c-administrative { background: #64748b; }
.dc-auto { font-size: 11px; margin-left: 8px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); }
.dc-auto.yes { color: #17915a; border-color: rgba(23,145,90,.4); }
.dc-auto.no { color: #d33; border-color: rgba(221,51,51,.4); }
.dc-status { font-size: 12px; font-weight: 600; }
.dc-s-pending { color: #d08700; } .dc-s-approved { color: #17915a; } .dc-s-rejected { color: #d33; } .dc-s-auto_executed { color: #0891b2; }
.dc-title { font-weight: 700; margin-bottom: 10px; }
.dc-bars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin-bottom: 10px; }
.dc-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dc-bar > span { width: 66px; color: var(--muted); }
.dc-bar > b { width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.dc-track { flex: 1; height: 7px; background: var(--bg, #eef0f6); border-radius: 4px; overflow: hidden; }
.dc-track i { display: block; height: 100%; border-radius: 4px; background: #64748b; }
.dc-track i.r { background: #d33; } .dc-track i.f { background: #d08700; }
.dc-track i.j { background: #7c3aed; } .dc-track i.u { background: #2563eb; }
.dc-reco { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; }
.dc-cons ul { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; }
.dc-opts { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.dc-opts span { border: 1px solid var(--border); border-radius: 12px; padding: 2px 9px; margin-right: 6px; }

/* --- Centre des Notifications --- */
.nav-badge.badge-alert { background: #d33; color: #fff; opacity: 1; }
.nt-list { display: flex; flex-direction: column; gap: 8px; }
.nt-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.nt-unreadrow { border-left: 3px solid var(--accent, var(--brand)); }
.nt-p-haute.nt-unreadrow { border-left-color: #d33; }
.nt-ico { font-size: 18px; line-height: 1.4; }
.nt-body { flex: 1; }
.nt-title { font-weight: 600; }
.nt-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.nt-prio { text-transform: capitalize; }
.nt-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* --- Journal BAYA --- */
.jr-ask { display: flex; gap: 10px; margin-bottom: 14px; }
.jr-ask input { flex: 1; padding: 13px 16px; font-size: 15px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.jr-ask input:focus { outline: none; border-color: var(--accent, var(--brand)); }
.jr-answer { background: var(--bg, #f6f7fb); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 16px; font-size: 15px; }
.jr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.jr-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; }
.jr-tile.jr-err { border-color: rgba(221,51,51,.5); }
.jr-tile[data-tile-ds], .jr-tile[data-tile-st], .jr-tile.jr-clickable { cursor: pointer; transition: border-color .12s, transform .12s; }
.jr-tile[data-tile-ds]:hover, .jr-tile[data-tile-st]:hover, .jr-tile.jr-clickable:hover { border-color: var(--brand); transform: translateY(-1px); }
.jr-tile.jr-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.jr-ico { font-size: 20px; }
.jr-n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
.jr-l { font-size: 12px; color: var(--muted); }
.jr-feed { display: flex; flex-direction: column; }
.jr-ev { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.jr-ev:last-child { border-bottom: 0; }
.jr-ev-k { font-size: 11px; font-weight: 700; text-transform: uppercase; background: var(--border);
  border-radius: 5px; padding: 1px 7px; }
.jr-ev-t { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Règles & Automatisation --- */
.rl-list { display: flex; flex-direction: column; gap: 12px; }
.rl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.rl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rl-trig { font-size: 12px; color: var(--muted); margin-left: 8px; }
.rl-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.rl-s-active { color: #17915a; } .rl-s-disabled { color: #d08700; } .rl-s-archived { color: var(--muted); }
.rl-rule { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0 8px; font-size: 13.5px; line-height: 1.8; }
.rl-cond { border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; margin: 0 3px; display: inline-block; }
.rl-act { border: 1px solid var(--accent, var(--brand)); color: var(--accent, var(--brand)); border-radius: 6px; padding: 1px 8px; margin: 0 3px; display: inline-block; }
.rl-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rl-editor { display: flex; flex-direction: column; gap: 10px; }
.rl-editor b { margin-top: 4px; }
.rl-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.rl-row select, .rl-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }

/* --- Moteur de Campagnes --- */
.cp-list { display: flex; flex-direction: column; gap: 12px; }
.cp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.cp-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.cp-tabs-content { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cp-tabs-content b { margin-top: 6px; }
.cp-steps { margin: 4px 0; padding-left: 18px; font-size: 13.5px; }
.cp-steps li { padding: 3px 0; }
.cp-addstep, .cp-addrecip { display: grid; grid-template-columns: 1fr 2fr auto auto; gap: 8px; margin-bottom: 6px; }
.cp-addrecip { grid-template-columns: 1fr 1fr auto; }
.cp-addstep input, .cp-addrecip input { padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.cp-reciplist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.cp-reciplist li { padding: 3px 0; }
.cp-reciplist em { color: var(--muted); font-style: normal; }

/* --- Centre de Prospection --- */
.pr-board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pr-col { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 10px; min-width: 180px; }
.pr-col-head { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pr-col-head em { font-style: normal; background: var(--border); border-radius: 10px; padding: 0 7px; font-weight: 700; }
.pr-colval { width: 100%; font-size: 11px; color: var(--muted); font-weight: 500; }
.pr-cards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; }
.pr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; font-size: 13px; }
.pr-card:hover { border-color: var(--accent, var(--brand)); }
.pr-val { color: #17915a; font-weight: 700; font-size: 12px; margin-top: 3px; }
.pr-next { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pr-score { float: right; display: inline-block; min-width: 22px; text-align: center; border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 700; }
.pr-score-hot { background: #17915a22; color: #17915a; }
.pr-score-warm { background: #d9822622; color: #d98226; }
.pr-score-cold { background: var(--border); color: var(--muted); }
.pr-stagebar { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
@media (max-width: 1100px) { .pr-board { grid-template-columns: repeat(3, minmax(180px, 1fr)); } }

/* --- Tableau de Bord Prospection --- */
.pd-camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.pd-camp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; font-size: 13px; transition: border-color .12s, transform .12s; }
.pd-camp-card:hover { border-color: var(--accent, var(--brand)); transform: translateY(-1px); }
.pd-camp-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pd-camp-card .rl-status { display: inline-block; margin-top: 6px; }
.pd-best-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.pd-rank { margin: 8px 0 0 18px; padding: 0; font-size: 13px; }
.pd-rank li { margin-bottom: 3px; }
.pd-row-active { background: rgba(23,145,90,.08); }
.pd-icons-row { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; margin: 10px 0 14px; }
.pd-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; max-height: 260px; overflow-y: auto; }
.pd-log li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.pd-log li:last-child { border-bottom: none; }

/* --- Assistant Commercial --- */
.cm-calc { margin-bottom: 16px; }
.cm-calcrow { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.cm-calcrow input { width: 160px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.cm-comptable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.cm-comptable th, .cm-comptable td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.cm-comptable th { color: var(--muted); font-weight: 600; font-size: 12px; }
.cm-best { background: rgba(23,145,90,.08); }
/* Tableau de décision Fournisseurs (Greg, 2026-07-25) : lisibilité en 10s —
   teinte de ligne selon la compatibilité en 5 états, jamais seulement une
   icône. 🟢 Compatible (cm-best) / 🟡 Compatible sous conditions
   (cm-subconditions) / ⏳ En attente de réponse fournisseur (cm-waiting) /
   🟠 À confirmer, info manquante de notre côté (cm-unconfirmed) / 🔴
   Incompatible (cm-incompat) — « en attente » et « à confirmer » ne
   partagent jamais la même teinte : deux situations différentes (balle
   dans le camp du fournisseur vs analyse encore en cours chez nous). */
.cm-incompat { background: rgba(196,44,44,.08); }
.cm-subconditions { background: rgba(196,150,20,.08); }
.cm-unconfirmed { background: rgba(214,120,20,.07); }
.cm-waiting { background: rgba(120,120,120,.07); }
.cm-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin: 14px 0; }
.cm-summary-card { border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface); }
.cm-summary-card h4 { margin: 0 0 8px; font-size: 13px; }
.cm-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }

/* --- Pilotage multi-sociétés (cockpit) --- */
.hb-totals { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.hb-t { flex: 1; min-width: 110px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; }
.hb-t b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hb-t { font-size: 12px; color: var(--muted); }
.hb-t.hb-alert b { color: #d33; }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.hb-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--soc, #64748b);
  border-radius: var(--radius-sm); padding: 16px 18px; }
.hb-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; }
.hb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--soc, #64748b); }
.hb-badge { margin-left: auto; background: rgba(221,51,51,.12); color: #d33; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 10px; }
.hb-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.hb-kpi { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 9px; text-align: center;
  font-size: 11px; color: var(--muted); }
.hb-kpi span { display: block; font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.hb-alerts { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.hb-al { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); }
.hb-a-urgent { color: #d33; border-color: rgba(221,51,51,.4); background: rgba(221,51,51,.06); }
.hb-a-important { color: #d08700; border-color: rgba(208,135,0,.4); }
.hb-a-info { color: var(--muted); }
.hb-noalert { font-size: 12.5px; color: #17915a; margin-bottom: 12px; }
.hb-open { width: 100%; }

/* --- Apprentissage --- */
.lr-list { display: flex; flex-direction: column; gap: 8px; }
.lr-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lr-row.lr-on { border-left: 3px solid #17915a; }
.lr-body { flex: 1; min-width: 0; }
.lr-val { font-weight: 700; color: var(--accent, var(--brand)); }
.lr-bar { height: 6px; background: var(--bg, #eef0f6); border-radius: 4px; overflow: hidden; margin: 6px 0; max-width: 320px; }
.lr-bar i { display: block; height: 100%; background: #17915a; border-radius: 4px; }
.lr-active { color: #17915a; }

/* --- Cockpit dirigeant --- */
.ck-hero h2 { margin: 0 0 2px; }
.ck-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 20px; }
.ck-big { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.ck-n { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ck-l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ck-urg { display: flex; flex-direction: column; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.ck-urg b { font-size: 18px; }
.ck-prio { list-style: none; margin: 0; padding: 0; }
.ck-prio li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.ck-prio em { color: var(--muted); font-style: normal; font-size: 12px; margin-left: auto; }
.ck-act { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ck-act > div { background: var(--bg, #f6f7fb); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; color: var(--muted); }
.ck-act b { display: inline-block; font-size: 17px; color: var(--text); margin-right: 6px; font-variant-numeric: tabular-nums; }
.ck-act .ck-err b { color: #d33; }
.ck-socs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ck-soc { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--soc, #64748b);
  border-radius: var(--radius-sm); padding: 13px 16px; cursor: pointer; }
.ck-soc:hover { box-shadow: 0 4px 16px rgba(20,20,42,.07); }
.ck-soc-h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }

/* --- BAYA Mobile (MISSION 29) --- */
.mtopbar { display: none; }
.nav-scrim { display: none; }
.mic-live { animation: micpulse 1s infinite; color: #d33 !important; }
@keyframes micpulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

@media (max-width: 860px) {
  .mtopbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 40;
  }
  .mtopbar-title { flex: 1; font-weight: 800; font-size: 16px; }
  .topbar .search-box { display: none; }        /* la recherche ⌘K passe en secondaire */
  .app-shell { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    width: 82vw; max-width: 320px; box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5);
  }
  .main { margin-left: 0 !important; width: 100%; }
  .topbar { padding: 8px 12px; }
  .topbar-actions .user-meta { display: none; }
  .content { padding: 14px !important; }
  /* grilles denses -> une colonne sur mobile */
  .ck-head, .hb-grid, .hb-totals, .sup-grid, .jr-tiles, .exec-kpis,
  .dc-bars, .cm-grid, .ck-socs, .pr-board { grid-template-columns: 1fr !important; display: grid; }
  .pr-board { grid-auto-flow: row; }
  .hb-totals, .exec-actions { flex-wrap: wrap; }
  .row { flex-direction: column; }
  table.cm-comptable { font-size: 12px; }
  .exec-bar, .jr-ask, .kb-filters, .cm-calcrow { flex-wrap: wrap; }
}
.tk-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 42px; padding-top: 2px; }
.tk-status { font-size: 15px; line-height: 1; }
.tk-score { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.tk-body { flex: 1; min-width: 0; }
.tk-title { font-weight: 700; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-dup { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px; }
.tk-why { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tk-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.tk-chip { font-size: 12px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tk-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 9px; border-radius: 999px; color: #fff; }
.tk-relance { background: #f59e0b; } .tk-juridique { background: #ef4444; }
.tk-contrat { background: #8b5cf6; } .tk-facture { background: #10b981; }
.tk-rdv { background: #3b82f6; } .tk-echeance { background: #64748b; } .tk-tache { background: #94a3b8; }
.due-pill.soon { color: #ef4444; } .due-pill.mid { color: #f59e0b; }
.tk-acts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.tk-act { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: all .12s; }
.tk-act:hover { border-color: var(--accent, var(--brand)); background: var(--surface-2); }
.tk-act.primary { background: var(--accent, var(--brand)); border-color: transparent; color: #fff; }
.tk-act.primary:hover { filter: brightness(1.05); }

@media (max-width: 640px) { .tk-acts { gap: 6px; } .tk { padding: 13px; } }

/* ============ BAYA v6 — Détail tâche (drawer) + modale + workflow ============ */
.tk { cursor: pointer; align-items: center; }
.tk-open { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.tk:hover .tk-open { opacity: 1; }
.tk:hover { border-color: var(--accent, var(--brand)); }
.tk-est { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 16px; margin: 0 0 14px; font-size: 14px; color: var(--text); }

.tk-drawer { position: fixed; inset: 0 0 0 auto; width: min(520px, 94vw); background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: -18px 0 50px rgba(10,14,26,.28);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); z-index: 60; overflow-y: auto; }
.tk-drawer.open { transform: translateX(0); }
.tk-dr-inner { padding: 26px 26px 40px; }
.tk-dr-close { position: absolute; top: 16px; right: 18px; background: var(--surface-2); border: 1px solid var(--border);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--muted); }
.tk-dr-close:hover { color: var(--text); }
.dr-head { display: flex; align-items: flex-start; gap: 11px; margin: 6px 30px 14px 0; }
.dr-head .dr-ic { font-size: 20px; }
.dr-head h2 { font-size: 20px; line-height: 1.25; margin: 0; }
.dr-why { background: var(--accent-soft, rgba(139,92,246,.1)); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.5; margin-bottom: 18px; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dr-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.dr-k { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 3px; }
.dr-v { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dr-reco { color: #f59e0b; font-weight: 600; }
.dr-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 4px 0 9px; font-weight: 700; }
.dr-origin { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; margin-bottom: 18px; }
.dr-subj { font-weight: 600; color: var(--text); margin-top: 4px; }
.dr-summary { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; white-space: pre-wrap; max-height: 130px; overflow: auto; }
.dr-acts { display: flex; flex-direction: column; gap: 8px; }
.dr-act { text-align: left; padding: 11px 15px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: all .12s; }
.dr-act:hover { background: var(--surface-2); border-color: var(--accent, var(--brand)); }
.dr-act.primary { background: var(--accent, var(--brand)); border-color: transparent; color: #fff; }
.dr-act.ok { border-color: #10b981; color: #10b981; }
.dr-act.ok:hover { background: #10b981; color: #fff; }
.dr-act.ghost { color: var(--muted); }
.dr-act[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ Commencer ma journée — mode guidé (2026-07-12) ============ */
.ck-startday { background: linear-gradient(135deg, var(--accent, var(--brand)) 0%, #6d5bd0 100%);
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 18px; color: #fff; }
.ck-startday h2 { margin: 0 0 6px; font-size: 22px; }
.ck-startday .sd-sub { opacity: .92; font-size: 14px; margin: 0 0 16px; }
.ck-startday .sd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ck-startday .sd-chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; }
.ck-startday .sd-chip.urgent { background: rgba(239,68,68,.35); border-color: rgba(239,68,68,.55); }
.ck-startday .sd-go { background: #fff; color: var(--accent, var(--brand)); border: none; border-radius: 11px;
  padding: 13px 22px; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.ck-startday .sd-go:hover { opacity: .92; }
.ck-startday .sd-empty { font-size: 14.5px; opacity: .95; }

.myday-ov { position: fixed; inset: 0; background: var(--bg, #f3f4f8); z-index: 90;
  display: flex; flex-direction: column; }
.myday-top { display: flex; align-items: center; gap: 14px; padding: 14px 22px;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.myday-top .myday-progress { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.myday-top .myday-progress-bar { height: 100%; background: var(--accent, var(--brand)); transition: width .25s ease; }
.myday-top .myday-count { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.myday-top .myday-quit { background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; color: var(--muted); font-size: 14px; }
.myday-body { flex: 1; overflow-y: auto; padding: 22px; }
.myday-body .tk-dr-inner { max-width: 640px; margin: 0 auto; padding: 0; position: relative; }
.myday-body .tk-dr-close { display: none; } /* navigation pilotée par myday-foot uniquement */
.myday-body [data-a="done"], .myday-body [data-a="archive"] { display: none; } /* évite un double chemin « terminer » qui n'avancerait pas la séquence */
.myday-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface); }
.myday-foot .dr-act { flex: none; }
.myday-done { max-width: 480px; margin: 10vh auto; text-align: center; }
.myday-done .big { font-size: 44px; margin-bottom: 10px; }
.myday-done h2 { margin: 0 0 8px; }

/* Modale (e-mail / réponse) */
.modal-ov { position: fixed; inset: 0; background: rgba(8,10,20,.55); display: flex; align-items: center;
  justify-content: center; z-index: 80; padding: 24px; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  width: min(720px, 96vw); max-height: 88vh; overflow: auto; padding: 26px; position: relative; box-shadow: 0 30px 80px rgba(8,10,20,.4); }
.modal.modal-wide { width: min(1100px, 96vw); }
.modal .bs-label { width: 100%; min-width: 180px; }
.modal .bs-amount { width: 100px; }
.modal-x { position: absolute; top: 14px; right: 16px; background: var(--surface-2); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.mv-h { margin: 2px 34px 14px 0; }
.mv-subj { font-size: 17px; font-weight: 700; }
.mv-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.mv-body { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow: auto; font-family: inherit; }
.mv-acts, .rc-acts { display: flex; gap: 9px; margin-top: 16px; align-items: center; }
.rc-body { width: 100%; min-height: 200px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; font-size: 14px; line-height: 1.55; font-family: inherit; background: var(--surface-2); color: var(--text); resize: vertical; }
.rc-status { font-size: 13px; color: var(--muted); margin-top: 9px; }
.rc-to { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--surface-2); color: var(--text); margin-bottom: 10px; }

/* Recette fonctionnelle P3 — actions e-mail complètes (transférer/lu/archiver/
   supprimer/déplacer), partagées entre la modale et le panneau de lecture. */
.mv-acts2 { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.dr-act.small { padding: 6px 11px; font-size: 12.5px; border-radius: 999px; }
select.dr-act.small { font-weight: 600; -webkit-appearance: none; appearance: none;
  background-image: none; padding-right: 11px; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #10b981; color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(16,185,129,.4); opacity: 0; transition: all .3s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; box-shadow: 0 10px 30px rgba(220,38,38,.4); }
.toast.info { background: #475569; box-shadow: 0 10px 30px rgba(71,85,105,.4); }

@media (max-width: 560px) { .dr-grid { grid-template-columns: 1fr; } }

/* ============ BAYA v7 — Tableau de pilotage « Votre journée » ============ */
.jtable { margin: 4px 0 24px; }
.jt-reco { background: var(--accent-soft, rgba(139,92,246,.1)); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.jt { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.jt thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.jt thead th:nth-child(2), .jt thead th:nth-child(3) { text-align: right; }
.jt-row { cursor: pointer; transition: background .12s; }
.jt-row td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14.5px; vertical-align: middle; }
.jt-row:hover { background: var(--surface-2); }
.jt-row:hover .jt-go { color: var(--accent, var(--brand)); transform: translateX(2px); }
.jt-cat { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.jt-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.jt-row:first-child .jt-rank { background: var(--accent, var(--brand)); color: #fff; border-color: transparent; }
.jt-ic { font-size: 17px; }
.jt-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.jt-t { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jt-go { width: 20px; text-align: right; color: var(--muted); font-size: 18px; transition: all .12s; }
.jt-total td { font-weight: 800; border-bottom: none; background: var(--surface-2); }
.jt-total td:nth-child(2), .jt-total td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }

.tk-catbanner { display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; margin-bottom: 16px; width: fit-content; }
.tk-catbanner button { margin-left: 8px; background: none; border: none; color: var(--accent, var(--brand));
  font-weight: 600; cursor: pointer; font-size: 13px; }

/* Bloc « À traiter aujourd'hui » (urgents) + légende backlog */
.jt-today { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer;
  background: linear-gradient(100deg, rgba(244,63,94,.12), rgba(244,63,94,.04)); border: 1px solid rgba(244,63,94,.3);
  border-radius: var(--radius-sm); padding: 15px 18px; margin-bottom: 12px; transition: all .15s; }
.jt-today:hover { border-color: rgba(244,63,94,.55); transform: translateY(-1px); }
.jt-today-l { display: flex; align-items: center; gap: 13px; }
.jt-today-ic { font-size: 20px; }
.jt-today-k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.jt-today-v { font-size: 16px; margin-top: 2px; }
.jt-today-v b { color: #f43f5e; }
.jt-today-go { color: #f43f5e; font-weight: 700; font-size: 14px; white-space: nowrap; }
.jt-cap { font-size: 12px; color: var(--muted); margin: 2px 2px 8px; }

/* ============ BAYA v8 — Chronologie (année → mois → éléments) ============ */
.tl { display: flex; flex-direction: column; gap: 8px; }
.tl-year { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.tl-yh { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; font-size: 16px; }
.tl-yh:hover { background: var(--surface-2); }
.tl-caret { color: var(--muted); transition: transform .15s; display: inline-block; }
.tl-year.open > .tl-yh .tl-caret { transform: rotate(90deg); }
.tl-ycount { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.tl-months { display: none; padding: 4px 10px 10px; }
.tl-year.open > .tl-months { display: block; }
.tl-month { border-top: 1px solid var(--border); padding: 10px 6px; }
.tl-mh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-mlabel { font-weight: 600; font-size: 14px; min-width: 130px; }
.tl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: all .12s; white-space: nowrap; }
.tl-chip:hover { color: var(--text); border-color: var(--accent, var(--brand)); }
.tl-chip.on { background: var(--accent, var(--brand)); color: #fff; border-color: transparent; }
.tl-items { margin-top: 8px; display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; transition: background .1s; }
.tl-item:hover { background: var(--surface-2); }
.tl-item.static { cursor: default; }
.tl-item.static:hover { background: none; }
.tl-idate { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; }
.tl-itx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tl-itx b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ifrom { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-open { font-size: 12px; color: var(--accent, var(--brand)); font-weight: 600; opacity: 0; white-space: nowrap; }
.tl-item:hover .tl-open { opacity: 1; }

/* ============ BAYA v9 — Agenda / Calendrier ============ */
.ag-sec { margin-bottom: 22px; }
.ag-sh { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.ag-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 7px; transition: all .12s; }
.ag-item.clickable { cursor: pointer; }
.ag-item.clickable:hover { border-color: var(--accent, var(--brand)); box-shadow: 0 4px 16px rgba(20,20,42,.06); }
.ag-date { font-size: 12.5px; font-weight: 700; color: var(--text); min-width: 58px; font-variant-numeric: tabular-nums; }
.ag-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ag-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ag-tx b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-kind { font-size: 12px; color: var(--muted); }
.ag-go { font-size: 12.5px; color: var(--accent, var(--brand)); font-weight: 600; opacity: 0; white-space: nowrap; }
.ag-item.clickable:hover .ag-go { opacity: 1; }

/* ============ BAYA v10 — Sociétés (registre) ============ */
/* Recette fonctionnelle P9 : présentation premium — dégradé de marque en
   fond de carte (à très faible opacité), badge plus imposant, indicateurs
   réels (boîtes connectées/e-mails/non triés) au lieu d'une fiche muette. */
.soc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.soc-card { border: 1px solid var(--border); border-radius: 16px; background:
  linear-gradient(165deg, color-mix(in srgb, var(--soc, var(--brand)) 7%, var(--surface)) 0%, var(--surface) 55%);
  padding: 0 0 16px; overflow: hidden; cursor: pointer; transition: all .18s;
  border-top: 3px solid var(--soc, var(--brand)); box-shadow: 0 1px 3px rgba(20,20,42,.04); }
.soc-card:hover { box-shadow: 0 14px 34px rgba(20,20,42,.12); transform: translateY(-3px); }
.soc-top { display: flex; align-items: center; gap: 13px; padding: 18px 18px 12px; }
.soc-badge { width: 46px; height: 46px; border-radius: 13px; background: var(--soc, var(--brand)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex: none;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--soc, var(--brand)) 45%, transparent); }
.soc-id { min-width: 0; }
.soc-name { font-weight: 800; font-size: 16px; letter-spacing: -.1px; }
.soc-code { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }
.soc-tasks { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--rose); background: rgba(244,63,94,.1);
  padding: 4px 11px; border-radius: 999px; white-space: nowrap; flex: none; }
.soc-tasks.zero { color: #10b981; background: rgba(16,185,129,.1); }
.soc-kpis { display: flex; gap: 8px; padding: 2px 18px 12px; }
.soc-kpi { flex: 1; text-align: center; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 4px; }
.soc-kpi b { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.soc-kpi span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.soc-kpi-warn b { color: #f59e0b; }
.soc-meta { padding: 0 18px; }
.soc-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.soc-pill { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 9px; border-radius: 999px; }
.soc-notes { font-size: 12px; color: var(--muted); line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.soc-open { margin: 12px 18px 0; font-size: 13px; font-weight: 700; color: var(--soc, var(--brand)); background: none; border: none; padding: 0; cursor: pointer; }

/* Verrouillage société (D044) : sélecteur société désactivé parce qu'une
   société est déjà active dans la sidebar (tooltip du titre = "Verrouillé
   sur <société>"). */
select.soc-locked { opacity: .75; cursor: not-allowed; }

/* ============ BAYA v11 — Rapports ============ */
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.rep-kpi { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 16px 18px; border-left: 3px solid var(--brand); }
.rep-kpi.rose { border-left-color: var(--rose); } .rep-kpi.amber { border-left-color: #f59e0b; } .rep-kpi.green { border-left-color: #10b981; }
.rep-n { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.rep-l { font-size: 13px; font-weight: 600; margin-top: 2px; }
.rep-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rep-bars { display: flex; flex-direction: column; gap: 8px; }
.rep-bar { display: flex; align-items: center; gap: 12px; padding: 6px 4px; cursor: pointer; border-radius: 8px; transition: background .1s; }
.rep-bar:hover { background: var(--surface-2); }
.rep-bl { font-size: 13.5px; font-weight: 600; min-width: 170px; }
.rep-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.rep-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.rep-bn { font-size: 13px; font-weight: 700; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ BAYA v12 — Documents ============ */
.doc-list { display: flex; flex-direction: column; gap: 7px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; transition: all .12s; }
.doc-item:hover { border-color: var(--accent, var(--brand)); box-shadow: 0 4px 16px rgba(20,20,42,.06); }
.doc-cat { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; color: #fff; }
.doc-contrat { background: #8b5cf6; } .doc-devis { background: #f59e0b; } .doc-facture { background: #10b981; }
.doc-bon_livraison { background: #0891b2; } .doc-document { background: #64748b; }
.doc-ftype { font-size: 15px; }
.doc-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-tx b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-ver { font-style: normal; color: var(--accent, var(--brand)); font-size: 11px; margin-left: 6px;
  border: 1px solid var(--accent, var(--brand)); border-radius: 10px; padding: 0 7px; cursor: pointer; }
.doc-from { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============ BAYA v13 — Commerce (Shopify scaffolding) ============ */
.cm-status { display: flex; align-items: center; gap: 13px; padding: 15px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 18px; }
.cm-status.wait { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); }
.cm-status.ok { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.3); }
.cm-dot { width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; flex: none; }
.cm-status.ok .cm-dot { background: #10b981; }
.cm-keys { margin-bottom: 8px; }
.cm-klist { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.cm-klist code, .cm-keys code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cm-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 16px; text-align: center; }
.cm-tile.wait { opacity: .75; }
.cm-ic { font-size: 22px; } .cm-n { font-size: 22px; font-weight: 800; margin-top: 4px; } .cm-l { font-size: 13px; color: var(--muted); }

/* ============ Recette fonctionnelle P2 — Arborescence société -> boîte ============ */
.mbx-tree { display: flex; flex-direction: column; gap: 4px; }
.mbx-soc-group { margin-top: 6px; }
.mbx-soc-label { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); padding: 8px 4px 4px; }
.mbx-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.mbx-row:hover { background: var(--surface-2); }
.mbx-row.active { background: var(--surface-2); border-color: var(--border); font-weight: 700; }
.mbx-row.mbx-all { font-weight: 600; margin-bottom: 4px; }
.mbx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.mbx-dot.on { background: #10b981; }
.mbx-role { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-n { font-size: 12px; color: var(--muted); flex: none; }
.mbx-row.active .mbx-n { color: var(--brand); font-weight: 700; }

/* ============ BAYA v15 — CRM (Contacts auto) ============ */
.crm-search { margin: 0 0 16px; max-width: 420px; }
.crm-list { display: flex; flex-direction: column; gap: 7px; }
.crm-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-sm); }
.crm-main { flex: 1; min-width: 0; }
.crm-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.crm-auto { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); padding: 1px 6px; border-radius: 999px; }
.crm-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-meta { text-align: right; white-space: nowrap; }
.crm-count { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-last { font-size: 12px; color: var(--muted); }

/* ============ BAYA v16 — Documents dans le drawer ============ */
.dr-docs { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.dr-doc { display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .12s; }
.dr-doc:hover { border-color: var(--accent, var(--brand)); }
.dr-doc span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-doc em { font-style: normal; color: var(--accent, var(--brand)); font-size: 12px; }

/* ============ BAYA v17 — Recherche globale ============ */
.search-box { position: relative; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 90;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 18px 50px rgba(10,14,26,.28); max-height: 66vh; overflow-y: auto; display: none; min-width: 340px; }
.search-results.open { display: block; }
.sr-empty { padding: 16px; color: var(--muted); font-size: 13.5px; }
.sr-group { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sr-group:last-child { border-bottom: none; }
.sr-glabel { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  font-weight: 700; padding: 6px 14px 4px; }
.sr-item { display: flex; align-items: center; gap: 11px; padding: 8px 14px; cursor: pointer; }
.sr-item:hover { background: var(--surface-2); }
.sr-ic { font-size: 15px; width: 20px; text-align: center; }
.sr-tx { display: flex; flex-direction: column; min-width: 0; }
.sr-tx b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* score de pertinence dans la recherche */
.sr-score { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums; }

/* Centre de gestion des demandes de devis World Export (Phase 2, 2026-07-26) */
.wd-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 12px 0; }
.wd-actions-grid button { text-align: left; }
button.ghost.danger { border-color: #e2b4b4; color: #c0392b; }
button.ghost.danger:hover { border-color: #c0392b; color: #c0392b; }
.wd-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.wd-edit-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.wd-edit-f input, .wd-edit-f select, .wd-edit-f textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; }
#wd-a-sub .card { margin-top: 12px; }
#wd-table .wd-status-sel { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px; max-width: 190px; }
#wd-table .wd-comment { max-width: 220px; }
