/* Apportoo — tokens & base */
:root {
  /* Brand */
  --bg: #ffffff;
  --bg-1: #f5f6f5;
  --bg-2: #ebedec;
  --surface: #ffffff;
  --surface-soft: #fafbfa;
  --line: #e7e8e6;
  --line-soft: #eeefed;
  --ink: #2b302f;
  --ink-2: #4c5454;
  --ink-3: #767d7b;
  --ink-4: #9ea4a1;
  --ink-5: #c8cccb;

  --coral: #ff715b;
  --coral-soft: #ffe5de;
  --coral-deep: #d8543f;

  --turq: #1ea896;
  --turq-soft: #d3efeb;
  --turq-deep: #157a6e;

  --brown: #523f38;
  --brown-soft: #ece4dc;

  --hot: var(--coral);
  --warm: #e8a76e;
  --cold: #8aa3a5;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 1px 0 rgba(82, 63, 56, 0.04), 0 2px 8px rgba(82, 63, 56, 0.05);
  --shadow-pop: 0 12px 40px rgba(82, 63, 56, 0.18), 0 2px 6px rgba(82, 63, 56, 0.06);
  --shadow-inset: inset 0 0 0 1px var(--line);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Lora', 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #18171a;
  --bg-1: #1f1d20;
  --bg-2: #26242a;
  --surface: #1e1c1f;
  --surface-soft: #232126;
  --line: #2e2b30;
  --line-soft: #28262b;
  --ink: #ece8df;
  --ink-2: #c8c4bb;
  --ink-3: #97938b;
  --ink-4: #6b6864;
  --ink-5: #45433f;
  --coral-soft: #3a201c;
  --turq-soft: #15302d;
  --brown-soft: #2d2520;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
::selection { background: var(--coral-soft); color: var(--brown); }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.main-scroll {
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
}

/* Sidebar */
.sb {
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
}
.sb-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 70%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 10px rgba(255,113,91,0.25);
}
.sb-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--brown);
  line-height: 1;
}
[data-theme="dark"] .sb-name { color: var(--ink); }

.sb-sect {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  padding: 14px 8px 4px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  font-size: 13.5px;
  position: relative;
}
.sb-item:hover { background: rgba(82, 63, 56, 0.05); color: var(--ink); }
.sb-item.is-active {
  background: var(--surface);
  color: var(--brown);
  box-shadow: 0 1px 0 rgba(82,63,56,.04), 0 1px 3px rgba(82,63,56,.06), inset 0 0 0 1px var(--line);
}
[data-theme="dark"] .sb-item.is-active { color: var(--ink); }
.sb-item .icn { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ink-3); }
.sb-item.is-active .icn { color: var(--coral); }
.sb-item .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--coral);
  color: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.sb-item.is-muted .count { background: var(--ink-5); color: var(--surface); }
.sb-shortcut {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  background: var(--bg-1);
  padding: 1px 6px;
  border-radius: 4px;
}
.sb-item.is-active .sb-shortcut { background: var(--bg-2); color: var(--ink-3); }

.sb-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
}
.sb-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
}
.sb-sync .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--turq);
  box-shadow: 0 0 0 3px rgba(30, 168, 150, 0.18);
}
.sb-sync.off .dot { background: var(--ink-5); box-shadow: none; }
.sb-sync .sync-meta { color: var(--ink-4); margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; }
.sb-sync-toggle {
  margin-left: 6px;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: var(--turq);
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.sb-sync.off .sb-sync-toggle { background: var(--ink-5); }
.sb-sync-toggle::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 13px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.sb-sync.off .sb-sync-toggle::after { left: 1px; }

.sb-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.sb-me:hover { background: rgba(82, 63, 56, 0.05); }
.sb-me .av { width: 24px; height: 24px; border-radius: 50%; background: var(--brown-soft); color: var(--brown); display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.sb-me .who { display: flex; flex-direction: column; }
.sb-me .who b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.sb-me .who span { font-size: 11px; color: var(--ink-4); }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  min-height: 60px;
  position: relative;
  z-index: 5;
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--brown);
  font-weight: 500;
}
[data-theme="dark"] .topbar h1 { color: var(--ink); }
.topbar .sub {
  color: var(--ink-3);
  font-size: 13px;
}
.topbar .grow { flex: 1; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }

/* Capture banner */
.capture-banner {
  background: var(--turq-soft);
  border-bottom: 1px solid var(--line);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--turq-deep);
}
[data-theme="dark"] .capture-banner { color: var(--ink); }
.capture-banner b { color: var(--brown); }
[data-theme="dark"] .capture-banner b { color: var(--ink); }
.capture-banner .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--turq);
  box-shadow: 0 0 0 0 rgba(30, 168, 150, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 168, 150, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(30, 168, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 168, 150, 0); }
}
.capture-banner button {
  margin-left: auto;
  border: 0;
  background: var(--surface);
  color: var(--brown);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.capture-banner button:hover { background: var(--bg-1); }
.capture-banner .dismiss {
  background: transparent;
  border: 0;
  color: var(--ink-4);
  margin-left: 4px;
  width: 22px; height: 22px;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.capture-banner .dismiss:hover { color: var(--ink); background: rgba(0,0,0,0.05); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s ease;
}
.btn:hover { background: var(--bg-1); color: var(--ink); }
.btn.primary {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 2px 6px rgba(255,113,91,0.22);
}
.btn.primary:hover { background: var(--coral-deep); border-color: var(--coral-deep); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-1); }
.btn.turq { background: var(--turq); border-color: var(--turq); color: #fff; }
.btn.turq:hover { background: var(--turq-deep); border-color: var(--turq-deep); color: #fff; }
.btn.icon { width: 30px; height: 30px; padding: 0; justify-content: center; }
.btn .kbd {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  background: var(--bg-1);
  padding: 1px 5px;
  border-radius: 4px;
}
.btn.primary .kbd { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.85); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-1);
  color: var(--ink-2);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
.chip:hover { background: var(--bg-2); }
.chip.is-on {
  background: var(--brown);
  color: #fff;
}
[data-theme="dark"] .chip.is-on { background: var(--ink); color: var(--bg); }
.chip.dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.chip.hot { background: var(--coral-soft); color: var(--coral-deep); }
.chip.warm { background: #fcecd9; color: #a36724; }
[data-theme="dark"] .chip.warm { background: #3a2a18; color: #e8a76e; }
.chip.cold { background: #e6ecec; color: #4f6669; }
[data-theme="dark"] .chip.cold { background: #25303030; color: #8aa3a5; }
.chip.turq { background: var(--turq-soft); color: var(--turq-deep); }
[data-theme="dark"] .chip.turq { color: #6ed1c4; }
.chip.brown { background: var(--brown-soft); color: var(--brown); }
[data-theme="dark"] .chip.brown { color: #d6b89c; }
.chip.is-on.hot { background: var(--coral); color: #fff; }
.chip.sm { padding: 2px 8px; font-size: 11px; }

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink-3);
  width: 100%;
  font-size: 13px;
}
.search:focus-within { border-color: var(--ink-4); }
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: var(--ink);
}
.search .kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-1);
  color: var(--ink-4);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Avatars */
.av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--brown);
  flex: 0 0 36px;
  position: relative;
}
.av.lg { width: 56px; height: 56px; font-size: 18px; flex-basis: 56px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; flex-basis: 28px; }
.av.xs { width: 22px; height: 22px; font-size: 10px; flex-basis: 22px; }
.av .badge-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--turq);
}
.av .badge-dot.hot { background: var(--coral); }
.av .badge-dot.warm { background: var(--warm); }
.av .badge-dot.cold { background: var(--cold); }

/* Score pill */
.score {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.02em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-1);
  color: var(--ink-2);
}
.score .out { color: var(--ink-4); font-weight: 400; font-size: 10.5px; }
.score.hot { background: var(--coral-soft); color: var(--coral-deep); }
.score.turq { background: var(--turq-soft); color: var(--turq-deep); }
.score.warm { background: #fcecd9; color: #a36724; }
[data-theme="dark"] .score.warm { background: #3a2a18; color: #e8a76e; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.card-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--brown);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
[data-theme="dark"] .card-head h2 { color: var(--ink); }
.card-head .count-pill {
  background: var(--bg-1);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Page padding */
.page {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Lead row */
.lead-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .1s ease;
  position: relative;
}
.lead-row.dm-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
}
.lead-row.qualify-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: var(--surface-soft); }
.lead-row.is-selected { background: var(--coral-soft); }
.lead-row.is-selected::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--coral);
  border-radius: 0 3px 3px 0;
}
[data-theme="dark"] .lead-row.is-selected { background: rgba(255,113,91,0.13); }

.lead-row .name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.lead-row .head {
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-row .preview { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lead-row .time { color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; font-family: var(--font-mono); white-space: nowrap; }
.lead-row .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lead-row .meta-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.lead-row .meta-row > * { flex-shrink: 0; }
.lead-row .meta-row > .name { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }

/* List (vertical leads) */
.lead-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Two col layout for leads page */
.split {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.split-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 0;
}
.split-list-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
}
.split-list-scroll {
  flex: 1;
  overflow: auto;
}
.split-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Compact lead card in split list */
.lead-compact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  align-items: center;
}
.lead-compact:hover { background: var(--surface-soft); }
.lead-compact.is-selected { background: var(--coral-soft); }
.lead-compact.is-selected::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--coral);
}
.lead-compact .top {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.lead-compact .nm { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-compact .hd { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-compact .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Accordion */
.acc {
  border-bottom: 1px solid var(--line-soft);
}
.acc:last-child { border-bottom: 0; }
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  cursor: pointer;
  user-select: none;
}
.acc-head:hover { background: var(--surface-soft); }
.acc-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown);
}
[data-theme="dark"] .acc-head h3 { color: var(--ink-2); }
.acc-head .chev { color: var(--ink-4); transition: transform .15s; }
.acc.is-open .chev { transform: rotate(90deg); }
.acc-head .badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.acc-body {
  padding: 4px 22px 22px;
  display: none;
}
.acc.is-open .acc-body { display: block; }

/* Profile grid */
.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.kv dt { color: var(--ink-4); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink); }
.kv dd .tag {
  display: inline-block;
  background: var(--bg-1);
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 4px;
  font-size: 11.5px;
}

/* Scoring */
.score-big {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 16px;
}
.score-circ {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--turq) calc(var(--p) * 1%), var(--bg-1) 0);
  position: relative;
  flex: 0 0 88px;
}
.score-circ.hot { background: conic-gradient(var(--coral) calc(var(--p) * 1%), var(--bg-1) 0); }
.score-circ.warm { background: conic-gradient(var(--warm) calc(var(--p) * 1%), var(--bg-1) 0); }
.score-circ.cold { background: conic-gradient(var(--cold) calc(var(--p) * 1%), var(--bg-1) 0); }
.score-circ::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--surface);
  border-radius: 50%;
}
.score-circ .num {
  position: relative;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .score-circ .num { color: var(--ink); }
.score-circ .num .out { font-size: 14px; color: var(--ink-4); }
.score-breakdown { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.score-bar {
  display: grid;
  grid-template-columns: 120px 1fr 36px;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
  align-items: center;
}
.score-bar .bar {
  height: 4px;
  background: var(--bg-1);
  border-radius: 999px;
  overflow: hidden;
}
.score-bar .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--turq);
}
.score-bar.hot .bar i { background: var(--coral); }
.score-bar.warm .bar i { background: var(--warm); }
.score-bar.cold .bar i { background: var(--cold); }
.score-bar .v { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); color: var(--ink-3); font-size: 11.5px; }

/* Chat bubbles */
.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 85%;
}
.bubble.me { flex-direction: row-reverse; margin-left: auto; }
.bubble .body {
  background: var(--bg-1);
  padding: 9px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 13.5px;
  color: var(--ink);
  position: relative;
  line-height: 1.4;
}
.bubble.me .body {
  background: var(--coral);
  color: #fff;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
.bubble .meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 3px;
}
.bubble .ai-icn {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brown);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  opacity: 0;
  transition: opacity .15s;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.bubble:hover .ai-icn { opacity: 1; }
.bubble.me .ai-icn { display: none; }

.ai-suggest {
  margin-top: 4px;
  background: var(--brown-soft);
  border: 1px solid var(--brown);
  color: var(--brown);
  padding: 10px 12px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  font-size: 13px;
  position: relative;
  max-width: 85%;
}
[data-theme="dark"] .ai-suggest { background: rgba(82,63,56,0.3); border-color: rgba(214,184,156,0.4); color: var(--ink); }
.ai-suggest .hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
.ai-suggest .acts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.ai-suggest .acts button {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brown);
  cursor: pointer;
}
.ai-suggest .acts button:hover { background: var(--bg-1); }
.ai-suggest .acts button.primary { background: var(--brown); color: #fff; border-color: var(--brown); }

/* Team Lead Agent on Home */
.team-lead {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.team-lead::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 320px at 12% -120px, rgba(82, 63, 56, 0.05), transparent 60%),
    radial-gradient(700px 280px at 86% 110%, rgba(30, 168, 150, 0.05), transparent 60%);
  pointer-events: none;
}
.tl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.tl-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brown), #6e5648);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 10px rgba(82,63,56,0.22);
  flex: 0 0 38px;
  position: relative;
}
.tl-avatar::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 12px; height: 12px;
  background: var(--turq);
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 0 rgba(30,168,150,0.6);
  animation: pulse 2.4s infinite;
}
.tl-meta { flex: 1; min-width: 0; }
.tl-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--brown);
  line-height: 1.1;
}
[data-theme="dark"] .tl-name { color: var(--ink); }
.tl-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.tl-body {
  flex: 1;
  overflow: auto;
  padding: 18px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  min-height: 0;
}

.tl-clean {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  position: relative;
  min-height: 0;
}
.tl-clean::before {
  content: "";
  position: absolute;
  inset: 20px;
  background:
    radial-gradient(60% 70% at 50% 50%, rgba(82,63,56,0.025), transparent 70%);
  pointer-events: none;
}
.tl-hero { max-width: 580px; position: relative; }
.tl-h1 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--brown);
  line-height: 1;
}
[data-theme="dark"] .tl-h1 { color: var(--ink); }
.tl-h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  color: var(--ink-3);
  margin-top: 10px;
  letter-spacing: -0.005em;
  line-height: 1.15;
}
.tl-greeting {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 760px;
}
.tl-greeting b { color: var(--brown); font-weight: 600; }
[data-theme="dark"] .tl-greeting b { color: var(--ink); }

.tl-insights {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-insight {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ink-5);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-size: 13px;
}
.tl-insight:hover { background: var(--bg-1); }
.tl-insight.urgent { border-left-color: var(--coral); }
.tl-insight.urgent .icn { color: var(--coral); }
.tl-insight.opportunity { border-left-color: var(--turq); }
.tl-insight.opportunity .icn { color: var(--turq); }
.tl-insight.info { border-left-color: var(--brown); }
.tl-insight.info .icn { color: var(--brown); }
.tl-insight .icn { width: 18px; height: 18px; display: grid; place-items: center; }
.tl-insight .lbl { color: var(--ink); line-height: 1.4; }
.tl-insight .lbl b { font-weight: 600; }
.tl-insight .tag-pill {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  margin-right: 6px;
}
.tl-insight.urgent .tag-pill { background: var(--coral-soft); color: var(--coral-deep); }
.tl-insight.opportunity .tag-pill { background: var(--turq-soft); color: var(--turq-deep); }
.tl-insight.info .tag-pill { background: var(--brown-soft); color: var(--brown); }

.tl-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.tl-kpi {
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.tl-kpi .kpi-v {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--brown);
  line-height: 1;
}
[data-theme="dark"] .tl-kpi .kpi-v { color: var(--ink); }
.tl-kpi.coral .kpi-v { color: var(--coral-deep); }
.tl-kpi.turq .kpi-v { color: var(--turq-deep); }
.tl-kpi .kpi-l {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-top: 6px;
}
.tl-kpi .kpi-s {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 1px;
}
.tl-kpi .kpi-trend {
  position: absolute;
  top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.tl-kpi .kpi-trend.up { background: var(--turq-soft); color: var(--turq-deep); }
.tl-kpi .kpi-trend.down { background: var(--coral-soft); color: var(--coral-deep); }

.tl-input {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.tl-input-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tl-input-pills .chip {
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
}
.tl-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
  transition: border-color .15s;
}
.tl-input-row:focus-within { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(82,63,56,0.06); }
.tl-input-row input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 6px 0;
}
.tl-input-row input::placeholder { color: var(--ink-4); }

/* Home bottom: 2 column cards */
.home-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}
.home-bottom .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.home-bottom .card-body { flex: 1; overflow: auto; }

/* Compact lead row variants for half-width cards */
.lead-row.compact {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px 16px;
  gap: 10px;
}
.lead-row.compact-dm {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  padding: 10px 14px;
  gap: 10px;
}
.lead-row .row-actions-inline { display: flex; gap: 4px; align-items: center; }

/* Empty state */
.empty {
  display: grid;
  place-items: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.empty .mark {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: var(--brown-soft);
  display: grid; place-items: center;
  margin-bottom: 14px;
  color: var(--brown);
}

/* Counters / hero */
.counters {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.counters > span { flex-shrink: 0; }
.counters b { color: var(--brown); font-weight: 600; }
[data-theme="dark"] .counters b { color: var(--ink); }
.counters .dotsep { color: var(--ink-5); margin: 0 2px; }
.counters .n {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
  margin-right: 4px;
}
[data-theme="dark"] .counters .n { color: var(--ink); }

/* ═══════════════════════════════════════════════════════════ */
/* MISE EN RELATION (placement tracker)                          */
/* ═══════════════════════════════════════════════════════════ */
.mer-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: 0;
}
.mer-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.mer-rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}
.mer-rail-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .mer-rail-head h2 { color: var(--ink); }
.mer-rail-list {
  flex: 1;
  overflow: auto;
}
.mer-mission-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  position: relative;
}
.mer-mission-row:hover { background: var(--surface-soft); }
.mer-mission-row.active { background: var(--coral-soft); }
.mer-mission-row.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--coral);
  border-radius: 0 3px 3px 0;
}
.mer-mission-meta { flex: 1; min-width: 0; }
.mer-client-co {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--ink-3);
}
.mer-client-mi {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
  line-height: 1.3;
}
.mer-client-st {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.mer-mission-count {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}
.mer-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  min-width: 22px;
  text-align: center;
}
.mer-pill.go { background: var(--turq); color: #fff; }
.mer-pill.go::before { content: 'GO '; font-size: 9px; opacity: 0.8; }
.mer-pill.nogo { background: var(--coral); color: #fff; }
.mer-pill.nogo::before { content: 'NO '; font-size: 9px; opacity: 0.8; }

/* Tracker */
.mer-tracker {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.mer-tracker-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-soft), transparent);
}
.mer-tracker-co {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--ink-3);
}
.mer-tracker-head h2 {
  margin: 4px 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: -0.01em;
  line-height: 1;
}
[data-theme="dark"] .mer-tracker-head h2 { color: var(--ink); }
.mer-tracker-sub {
  font-size: 13px;
  color: var(--ink-3);
}
.mer-tracker-counts {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  font-weight: 500;
  flex-shrink: 0;
  padding-top: 4px;
}
.mer-tracker-counts .cnt { display: inline-flex; align-items: center; gap: 5px; }
.mer-tracker-counts .cnt i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-5);
}
.mer-tracker-counts .cnt.go { color: var(--turq-deep); }
.mer-tracker-counts .cnt.go i { background: var(--turq); }
.mer-tracker-counts .cnt.nogo { color: var(--coral-deep); }
.mer-tracker-counts .cnt.nogo i { background: var(--coral); }
.mer-tracker-counts .cnt.maybe { color: #a36724; }
.mer-tracker-counts .cnt.maybe i { background: var(--warm); }
.mer-tracker-counts .cnt.pending { color: var(--ink-3); }
.mer-tracker-counts .cnt.total { color: var(--ink-4); }
.mer-tracker-counts .cnt.total i { display: none; }

.mer-tools {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  align-items: center;
}
.mer-mission-info { margin-left: auto; }

/* Table */
.mer-table-wrap {
  flex: 1;
  overflow: auto;
}
.mer-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.mer-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
}
.mer-row td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.mer-row:hover td { background: var(--surface-soft); }
.mer-row-num {
  width: 28px;
  font-size: 12px;
  color: var(--ink-4);
}
.mer-row-presta {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  max-width: 220px;
}
.mer-row-presta .nm {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mer-row-presta:hover .nm { color: var(--coral-deep); }

.mer-cell {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12.5px;
  background: transparent;
  outline: none;
  color: var(--ink);
}
.mer-cell:hover { border-color: var(--line); background: var(--surface); }
.mer-cell:focus { border-color: var(--ink-4); background: var(--surface); }
.mer-time-cell { font-family: var(--font-mono); font-size: 12px; }
.mer-comment-cell { color: var(--ink-2); }

/* Status pill */
.mer-status {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  padding-right: 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 92px;
  justify-content: space-between;
}
.mer-status:hover { border-color: var(--ink-4); }
.mer-status-go {
  background: var(--turq-soft);
  color: var(--turq-deep);
  border-color: rgba(30, 168, 150, 0.3);
}
.mer-status-nogo {
  background: var(--coral-soft);
  color: var(--coral-deep);
  border-color: rgba(216, 84, 63, 0.3);
}
.mer-status-maybe {
  background: #fcecd9;
  color: #a36724;
  border-color: rgba(163, 103, 36, 0.25);
}
[data-theme="dark"] .mer-status-maybe { background: #3a2a18; color: #e8a76e; border-color: rgba(232, 167, 110, 0.3); }

.mer-status-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  z-index: 50;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mer-status-opt {
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--ink-2);
}
.mer-status-opt:hover { background: var(--bg-1); }
.mer-status-opt.mer-status-go { color: var(--turq-deep); }
.mer-status-opt.mer-status-nogo { color: var(--coral-deep); }
.mer-status-opt.mer-status-maybe { color: #a36724; }

.mer-del {
  border: 0;
  background: transparent;
  color: var(--ink-4);
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
}
.mer-del:hover { background: var(--coral-soft); color: var(--coral-deep); }

/* ═══════════════════════════════════════════════════════════ */
/* OLD MATCHINGS (deprecated, kept for reference)                */
/* ═══════════════════════════════════════════════════════════ */
.match-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.match-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.match-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .12s, border-color .12s, transform .12s;
}
.match-card:hover { background: var(--surface-soft); }
.match-card.is-selected { background: var(--coral-soft); }
.match-card.is-match-target { background: var(--turq-soft); border-left: 3px solid var(--turq); }
.match-card.is-match-target.muted { opacity: 0.7; }
.match-card.is-dimmed { opacity: 0.45; }
.match-card.drag-over { background: var(--turq-soft); box-shadow: inset 0 0 0 2px var(--turq); }
.match-card .row { display: flex; gap: 10px; align-items: center; }
.match-card .nm { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.match-card .hd { font-size: 12px; color: var(--ink-3); }
.match-card .tag-row { display: flex; gap: 4px; flex-wrap: wrap; }
.match-card .ms {
  display: flex; flex-direction: column;
  align-items: center;
  background: var(--turq);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-mono);
  line-height: 1;
}
.match-card .ms span { font-size: 9px; font-weight: 500; opacity: 0.85; margin-top: 2px; }

/* Tag (skill) */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  background: var(--bg-1);
  color: var(--ink-2);
  font-weight: 500;
}
.tag.turq { background: var(--turq-soft); color: var(--turq-deep); }
.tag.brown { background: var(--brown-soft); color: var(--brown); }
[data-theme="dark"] .tag.turq { color: #6ed1c4; }
[data-theme="dark"] .tag.brown { color: #d6b89c; }

/* Agent side panel */
.agent-side {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 32px rgba(82,63,56,0.08);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,.2,.2,1);
}
.agent-side.is-open { transform: translateX(0); }
.agent-side .head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.agent-side .head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .agent-side .head h3 { color: var(--ink); }
.agent-side .ctx {
  background: var(--brown-soft);
  color: var(--brown);
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 5px;
  font-weight: 500;
}
[data-theme="dark"] .agent-side .ctx { background: rgba(82,63,56,0.4); color: var(--ink); }
.agent-side .scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.agent-side .input {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-soft);
}
.agent-side textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  resize: none;
  min-height: 60px;
  outline: none;
}
.agent-side textarea:focus { border-color: var(--ink-4); }
.agent-side .input-actions { display: flex; gap: 6px; }
.agent-side .input-actions .chip { font-size: 11px; padding: 3px 8px; cursor: pointer; }
.agent-side .input-actions .grow { flex: 1; }
.agent-side .suggest-pills {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.agent-side .suggest-pills .chip { cursor: pointer; }

/* Agent FAB */
.agent-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  background: var(--brown);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(82,63,56,0.3), 0 1px 0 rgba(255,255,255,0.15) inset;
  border: 0;
  transition: transform .12s ease;
}
.agent-fab:hover { transform: scale(1.05); }
.agent-fab .sparkle { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 2px var(--brown); }

/* Command palette */
.cmdk-back {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 22, 0.45);
  display: grid;
  place-items: flex-start center;
  padding-top: 14vh;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.cmdk {
  width: 560px;
  max-width: 92vw;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.cmdk .inp {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.cmdk .inp input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--ink);
}
.cmdk .grp {
  padding: 6px 0;
}
.cmdk .grp-h {
  padding: 8px 18px 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}
.cmdk-item.active { background: var(--coral-soft); color: var(--coral-deep); }
[data-theme="dark"] .cmdk-item.active { background: rgba(255,113,91,0.18); color: var(--coral); }
.cmdk-item .icn { color: var(--ink-3); }
.cmdk-item.active .icn { color: var(--coral); }
.cmdk-item .grow { flex: 1; }
.cmdk-item .shortcut {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-1);
  color: var(--ink-4);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--brown);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-pop);
  animation: tin .25s ease;
}
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Actions list */
.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.action-row:last-child { border-bottom: 0; }
.action-row .check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--ink-4);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  color: transparent;
  transition: all .12s;
}
.action-row.done .check { background: var(--turq); border-color: var(--turq); color: #fff; }
.action-row.done .label { color: var(--ink-4); text-decoration: line-through; }
.action-row .label { font-size: 13px; color: var(--ink); flex: 1; }
.action-row .due {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--ink-4);
}
.action-row .due.urgent { color: var(--coral); }

/* Timeline */
.timeline { position: relative; padding-left: 16px; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.tl-item { position: relative; padding: 6px 0 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -16px; top: 9px;
  width: 9px; height: 9px;
  background: var(--surface);
  border: 2px solid var(--coral);
  border-radius: 50%;
}
.tl-item.cold::before { border-color: var(--cold); }
.tl-item.turq::before { border-color: var(--turq); }
.tl-item.brown::before { border-color: var(--brown); }
.tl-item .when { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.tl-item .what { font-size: 13px; color: var(--ink); }
.tl-item .who { font-size: 12px; color: var(--ink-3); }

/* Conversations layout */
.conv-list {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
  cursor: pointer;
  position: relative;
}
.conv-list:hover { background: var(--surface-soft); }
.conv-list.is-selected { background: var(--coral-soft); }
.conv-list.unread::before {
  content: ""; position: absolute; left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
}
.conv-list .ttl { font-weight: 600; font-size: 13px; color: var(--ink); }
.conv-list.unread .ttl { font-weight: 700; }
.conv-list .pv { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-list .tm { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }

/* helpers */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.tiny { font-size: 11px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(82,63,56,0.14); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(82,63,56,0.24); }

/* Hot status indicator stripe */
.status-stripe {
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--cold);
}
.status-stripe.hot { background: var(--coral); }
.status-stripe.warm { background: var(--warm); }

/* density */
[data-density="compact"] .lead-row { padding: 8px 16px; }
[data-density="compact"] .lead-compact { padding: 7px 12px; }
[data-density="comfy"] .lead-row { padding: 16px 20px; }

/* Quick action floating in row */
.row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .1s;
}
.lead-row:hover .row-actions,
.lead-compact:hover .row-actions { opacity: 1; }

/* Drag presentation cursor for matchings */
.match-card.dragging { opacity: 0.5; cursor: grabbing; }

/* Inline avatar group */
.av-stack {
  display: flex;
  align-items: center;
}
.av-stack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av:first-child { margin-left: 0; }

/* Notes textarea */
.notes-area {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  resize: vertical;
  line-height: 1.55;
  outline: none;
}
.notes-area:focus { border-color: var(--ink-4); background: var(--surface); }

/* Section header for detail */
.detail-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(180deg, var(--surface-soft), transparent 80%);
}
.detail-head .meta-stack { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.detail-head .name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: -0.01em;
  line-height: 1;
}
[data-theme="dark"] .detail-head .name { color: var(--ink); }
.detail-head .head { font-size: 13px; color: var(--ink-3); }
.detail-head .quick-actions { display: flex; gap: 6px; }

/* Settings */
.set-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
.set-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.set-nav-item.is-active {
  background: var(--brown-soft);
  color: var(--brown);
  font-weight: 600;
}
[data-theme="dark"] .set-nav-item.is-active { background: rgba(82,63,56,0.4); color: var(--ink); }
.set-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.set-card h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .set-card h2 { color: var(--ink); }
.set-card .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.set-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.set-row:last-child { border-bottom: 0; }
.set-row .lbl { flex: 1; }
.set-row .lbl b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.set-row .lbl span { font-size: 12px; color: var(--ink-3); }
.set-row .val { flex: 0 0 auto; }

/* Grid criterion in scoring grid editor */
.grid-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.grid-row .nm { color: var(--ink); }
.grid-row input[type=number] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  text-align: center;
  background: var(--surface);
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════ */
/* AGENT FULL-SCREEN MODAL (Mode 3 - session longue)            */
/* ═══════════════════════════════════════════════════════════ */
.agent-fs-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.5);
  z-index: 120;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  padding: 24px;
  animation: tin .18s ease;
}
.agent-fs {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  max-height: 92vh;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.agent-fs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.agent-fs-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
  line-height: 1.1;
}
[data-theme="dark"] .agent-fs-head h2 { color: var(--ink); }
.agent-fs-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.agent-fs-body {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  min-height: 0;
}
.agent-fs-rail {
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agent-fs-rail .rail-head {
  padding: 14px 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-fs-rail h3 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0;
  flex: 1;
}
.agent-fs-rail .sessions { flex: 1; overflow: auto; padding: 4px 8px 16px; }
.agent-fs-session {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.agent-fs-session:hover { background: var(--surface); }
.agent-fs-session.active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.agent-fs-session .st {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.agent-fs-session .sw {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--ink-4);
}
.agent-fs-session .sp {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-fs-session .ping {
  width: 7px; height: 7px;
  background: var(--coral);
  border-radius: 50%;
}

.agent-fs-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.agent-fs-thread {
  flex: 1;
  overflow: auto;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.agent-fs-thread .fs-msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.agent-fs-thread .fs-msg.me { flex-direction: row-reverse; }
.agent-fs-thread .fs-av {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.agent-fs-thread .fs-msg .fs-av-agent {
  background: var(--brown);
  color: #fff;
}
.agent-fs-thread .fs-msg.me .fs-av {
  background: var(--coral);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}
.agent-fs-thread .fs-body {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.agent-fs-thread .fs-msg.me .fs-body {
  background: var(--coral-soft);
  border-radius: 14px;
  padding: 10px 14px;
  max-width: 70%;
}
[data-theme="dark"] .agent-fs-thread .fs-msg.me .fs-body { background: rgba(255,113,91,0.16); }
.agent-fs-thread .fs-body b { color: var(--brown); font-weight: 600; }
[data-theme="dark"] .agent-fs-thread .fs-body b { color: var(--ink); font-weight: 700; }
.agent-fs-thread .fs-body p { margin: 0 0 8px; }
.agent-fs-thread .fs-body ul {
  margin: 0 0 8px;
  padding-left: 0;
  list-style: none;
}
.agent-fs-thread .fs-body li {
  padding: 3px 0 3px 18px;
  position: relative;
}
.agent-fs-thread .fs-body li::before {
  content: "›";
  position: absolute;
  left: 4px;
  color: var(--coral);
  font-weight: 700;
}
.agent-fs-thread .fs-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 6px;
  font-family: var(--font-mono);
}
.agent-fs-thread .fs-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  margin: 4px 4px 0 0;
}
.agent-fs-thread .fs-source:hover { background: var(--bg-1); }

.agent-fs-composer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 28px 16px;
}
.agent-fs-composer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-fs-composer .composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 6px 6px 6px 14px;
  transition: border-color .15s;
}
.agent-fs-composer .composer-row:focus-within { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(82,63,56,0.06); }
.agent-fs-composer textarea {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 0;
  resize: none;
  min-height: 22px;
  max-height: 200px;
}
.agent-fs-composer .composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-4);
}
.agent-fs-composer .composer-tools .chip { cursor: pointer; font-size: 11px; padding: 2px 8px; }

.agent-fs-ctx {
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-fs-ctx h3 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0;
}
.agent-fs-ctx-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.agent-fs-ctx-block b { color: var(--ink); }
.agent-fs-ctx-lead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.agent-fs-ctx-lead:hover { background: var(--bg-1); }
.agent-fs-ctx-lead .l { font-size: 12.5px; color: var(--ink); font-weight: 500; line-height: 1.1; }
.agent-fs-ctx-lead .h { font-size: 10.5px; color: var(--ink-3); }
.agent-fs-ctx-lead .x { color: var(--ink-4); font-size: 12px; padding: 2px 4px; }

/* ═══════════════════════════════════════════════════════════ */
/* MES MISSIONS                                                  */
/* ═══════════════════════════════════════════════════════════ */
.me-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  min-height: 0;
  height: 100%;
}
.me-profile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.me-profile .hero {
  padding: 22px 22px 14px;
  background: linear-gradient(180deg, var(--surface-soft), transparent 80%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.me-profile .av-xl {
  width: 84px; height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brown), #6e5648);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 20px rgba(82,63,56,0.28);
}
.me-profile .nm {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: -0.01em;
  line-height: 1;
}
[data-theme="dark"] .me-profile .nm { color: var(--ink); }
.me-profile .hd {
  font-size: 13px;
  color: var(--ink-3);
  text-wrap: balance;
}
.me-profile .me-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}
.me-profile .me-stat {
  background: var(--surface);
  padding: 12px 14px;
  text-align: center;
}
.me-profile .me-stat .v {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
  line-height: 1;
}
[data-theme="dark"] .me-profile .me-stat .v { color: var(--ink); }
.me-profile .me-stat .l {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.me-profile .me-body {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.me-profile .me-sect {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  margin-bottom: 6px;
}
.me-profile .me-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.linkedin-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #eef3f9;
  border: 1px solid #d8e3ee;
  border-radius: 10px;
  position: relative;
}
[data-theme="dark"] .linkedin-sync {
  background: rgba(10, 102, 194, 0.12);
  border-color: rgba(10, 102, 194, 0.25);
}
.linkedin-sync .li-logo {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: #0a66c2;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-sans);
  flex-shrink: 0;
}
.linkedin-sync .li-meta { flex: 1; min-width: 0; }
.linkedin-sync .li-meta b {
  display: block;
  color: #0a66c2;
  font-size: 12.5px;
  font-weight: 600;
}
[data-theme="dark"] .linkedin-sync .li-meta b { color: #5da3d9; }
.linkedin-sync .li-meta span {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.linkedin-sync .li-meta b::after {
  content: "●";
  margin-left: 6px;
  font-size: 8px;
  vertical-align: 2px;
  color: var(--turq);
}

.me-missions {
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 0;
  overflow: hidden;
}
.me-missions-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.me-missions-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--brown);
  margin: 0;
}
[data-theme="dark"] .me-missions-head h2 { color: var(--ink); }
.me-missions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}
.mission-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform .12s, box-shadow .12s, border-color .12s;
  cursor: pointer;
}
.mission-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(82,63,56,0.05), 0 6px 18px rgba(82,63,56,0.08);
}
.mission-card.won { border-left: 3px solid var(--turq); }
.mission-card.shortlist { border-left: 3px solid var(--warm); }
.mission-card.sent { border-left: 3px solid var(--brown); }
.mission-card.pending { border-left: 3px solid var(--cold); }
.mission-card .mc-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mission-card .mc-client {
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.mission-card .mc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.mission-card .mc-score {
  background: var(--turq);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  flex-shrink: 0;
}
.mission-card.shortlist .mc-score { background: var(--warm); }
.mission-card.pending .mc-score { background: var(--cold); }
.mission-card .mc-progress {
  height: 6px;
  background: var(--bg-1);
  border-radius: 999px;
  overflow: hidden;
}
.mission-card .mc-progress i {
  display: block;
  height: 100%;
  background: var(--turq);
  border-radius: inherit;
  transition: width .3s;
}
.mission-card.shortlist .mc-progress i { background: var(--warm); }
.mission-card.pending .mc-progress i { background: var(--cold); }
.mission-card .mc-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
}
.mission-card .mc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.mission-card .mc-next {
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
}
.mission-card .mc-next b { color: var(--ink); }
.mission-card .mc-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.mission-card .mc-meta { font-size: 11px; color: var(--ink-4); }

/* PDF dossier modal */
.dossier-back {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, 0.55);
  z-index: 100;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  padding: 32px;
}
.dossier {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  max-height: 86vh;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.dossier-head {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dossier-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .dossier-head h2 { color: var(--ink); }
.dossier-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 0;
  overflow: hidden;
}
.dossier-preview {
  background: var(--bg-1);
  padding: 26px;
  overflow: auto;
}
.dossier-page {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 22px rgba(30, 27, 24, 0.18);
  padding: 38px 44px;
  max-width: 720px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  color: #2b302f;
  position: relative;
  min-height: 940px;
}
.dossier-page h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--brown);
  margin: 0 0 4px;
}
.dossier-page .dp-sub {
  color: #767d7b;
  font-size: 13.5px;
  margin-bottom: 18px;
}
.dossier-page .dp-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--coral), var(--brown));
  border-radius: 999px;
  margin-bottom: 22px;
}
.dossier-page h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--brown);
  font-weight: 500;
  margin: 18px 0 6px;
  letter-spacing: -0.005em;
}
.dossier-page .dp-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 12.5px;
  padding: 3px 0;
  border-bottom: 1px dashed #ece4dc;
}
.dossier-page .dp-row span { color: #767d7b; }
.dossier-page .dp-row b { color: #2b302f; }
.dossier-page .dp-stack { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.dossier-page .dp-stack .tag {
  background: #ece4dc; color: #523f38; padding: 2px 8px; border-radius: 4px; font-size: 11px;
}
.dossier-page .dp-stack .tag.highlighted {
  background: var(--coral); color: #fff;
  box-shadow: 0 2px 8px rgba(255, 113, 91, 0.3);
  animation: pulse-tag 1.4s ease-in-out infinite;
}
@keyframes pulse-tag {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.dossier-page .dp-exp {
  padding: 8px 0;
  border-bottom: 1px solid #f5f6f5;
}
.dossier-page .dp-exp:last-child { border-bottom: 0; }
.dossier-page .dp-exp .y { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: #767d7b; }
.dossier-page .dp-exp .r { font-size: 13.5px; font-weight: 600; color: #2b302f; }
.dossier-page .dp-exp .c { font-size: 12px; color: #4c5454; font-style: italic; }
.dossier-page .dp-exp .d { font-size: 12.5px; color: #4c5454; margin-top: 3px; }
.dossier-page .highlight {
  background: linear-gradient(180deg, transparent 55%, rgba(255, 113, 91, 0.25) 55%);
  font-weight: 500;
}

.dossier-side {
  background: var(--surface);
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dossier-side h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .dossier-side h3 { color: var(--ink); }
.dossier-side .dseparator {
  border-top: 1px solid var(--line-soft);
  margin: 4px 0;
}
.dossier-suggest {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-2);
}
.dossier-suggest .icn {
  color: var(--brown);
  margin-top: 2px;
  flex-shrink: 0;
}
.dossier-suggest .lbl { flex: 1; }
.dossier-suggest .lbl b { color: var(--ink); }
.dossier-suggest button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--coral-deep);
  font-weight: 600;
  font-size: 11.5px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.dossier-side .kw-list {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.dossier-side .kw-list .tag.match { background: var(--turq-soft); color: var(--turq-deep); }
.dossier-side .kw-list .tag.miss { background: var(--coral-soft); color: var(--coral-deep); }

/* ═══════════════════════════════════════════════════════════ */
/* CALENDRIER                                                    */
/* ═══════════════════════════════════════════════════════════ */
.cal-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  height: 100%;
  min-height: 0;
}
.cal-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.cal-toolbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
}
[data-theme="dark"] .cal-toolbar h2 { color: var(--ink); }
.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cal-nav button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}
.cal-nav button:hover { background: var(--bg-1); }
.cal-week {
  flex: 1;
  display: grid;
  grid-template-columns: 56px repeat(5, 1fr);
  grid-template-rows: 44px 1fr;
  min-height: 0;
  overflow: hidden;
}
.cal-week-head-blank {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.cal-week-head-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.cal-week-head-cell:last-child { border-right: 0; }
.cal-week-head-cell .d {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}
.cal-week-head-cell.today .d {
  background: var(--coral);
  color: #fff;
  border-radius: 8px;
  padding: 4px 9px;
  display: inline-block;
  width: fit-content;
}
.cal-week-body {
  grid-column: 1 / -1;
  overflow: auto;
  display: grid;
  grid-template-columns: 56px repeat(5, 1fr);
  position: relative;
}
.cal-hour-col {
  border-right: 1px solid var(--line-soft);
  display: grid;
  grid-template-rows: repeat(11, 56px);
}
.cal-hour-col .hour {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  text-align: right;
  padding: 0 8px;
  top: -7px;
}
.cal-day-col {
  border-right: 1px solid var(--line-soft);
  display: grid;
  grid-template-rows: repeat(11, 56px);
  position: relative;
}
.cal-day-col:last-child { border-right: 0; }
.cal-day-col.today { background: rgba(255, 113, 91, 0.025); }
.cal-day-col .slot {
  border-bottom: 1px solid var(--line-soft);
}
.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  background: var(--turq-soft);
  color: var(--turq-deep);
  border-left: 3px solid var(--turq);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
}
.cal-event:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.06); }
.cal-event.coral { background: var(--coral-soft); color: var(--coral-deep); border-left-color: var(--coral); }
.cal-event.brown { background: var(--brown-soft); color: var(--brown); border-left-color: var(--brown); }
.cal-event .et { font-weight: 600; line-height: 1.25; }
.cal-event .em { font-family: var(--font-mono); font-size: 10px; opacity: 0.8; }
.cal-now-line {
  position: absolute;
  left: 56px; right: 0;
  height: 2px;
  background: var(--coral);
  z-index: 3;
  pointer-events: none;
}
.cal-now-line::before {
  content: "";
  position: absolute;
  left: -5px; top: -3px;
  width: 8px; height: 8px;
  background: var(--coral);
  border-radius: 50%;
}

.cal-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.cal-side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}
.cal-side-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--brown);
}
[data-theme="dark"] .cal-side-card h3 { color: var(--ink); }
.cal-side-card .sub { font-size: 12px; color: var(--ink-3); margin: -6px 0 12px; }
.cal-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--turq-soft);
  border-radius: 8px;
  border: 1px solid rgba(30, 168, 150, 0.18);
}
.cal-sync .logo {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--turq-deep);
  border: 1px solid rgba(30, 168, 150, 0.2);
}
.cal-sync .info { flex: 1; }
.cal-sync .info b { display: block; color: var(--turq-deep); font-size: 13px; }
.cal-sync .info span { font-size: 11px; color: var(--turq-deep); opacity: 0.8; }

.booking-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.booking-link:hover { background: var(--bg-1); }
.booking-link .b-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brown);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.booking-link .b-meta { flex: 1; min-width: 0; }
.booking-link .b-meta b { font-size: 13px; color: var(--ink); display: block; }
.booking-link .b-meta span { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upcoming-row {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.upcoming-row:hover { background: var(--bg-1); }
.upcoming-row .when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  width: 50px;
  flex-shrink: 0;
  padding-top: 1px;
}
.upcoming-row .what {
  font-size: 12.5px;
  color: var(--ink);
}
.upcoming-row .stripe {
  width: 3px;
  border-radius: 999px;
  background: var(--turq);
  align-self: stretch;
  flex-shrink: 0;
}
.upcoming-row.coral .stripe { background: var(--coral); }
.upcoming-row.brown .stripe { background: var(--brown); }
