/* ───────────────────────── CRM Leads — Styles ───────────────────────── */
:root {
  /* ── Palette Sec & Libre — or premium (#c9a24b) + bleu (#86bfff) sur fond sombre ── */
  --accent: #c9a24b;                       /* OR — accent principal */
  --accent-soft: rgba(201, 162, 75, .14);
  --accent-line: rgba(201, 162, 75, .34);
  --accent-deep: #a88842;
  --accent-bright: #e3c676;
  --accent-glow: rgba(201, 162, 75, .30);
  --blue: #86bfff;                         /* BLEU — secondaire */
  --blue-soft: rgba(134, 191, 255, .13);
  --blue-line: rgba(134, 191, 255, .30);
  --bg: #0a0a0c;
  --bg-2: #111114;
  --panel: #16161b;
  --panel-2: #1e1e25;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f5f5f7;
  --muted: #9a9aa2;
  --muted-2: #6c6c75;
  --danger: #d46b6b;
  --danger-soft: rgba(212, 107, 107, .14);
  --won: #86bfff;                          /* statut « synchro / live » en bleu S&L */
  --won-soft: rgba(134, 191, 255, .13);
  --reach: #5ec88a;                        /* « Joint » — vert doux */
  --reach-soft: rgba(94, 200, 138, .14);
  --reach-line: rgba(94, 200, 138, .40);
  --radius: 14px;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .65);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 80% -10%, rgba(201, 162, 75, .08), transparent 60%),
    radial-gradient(900px 480px at 0% 105%, rgba(134, 191, 255, .04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232b36; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3644; }

.hidden { display: none !important; }

/* ───────────── Layout shell ───────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  background: rgba(11, 14, 19, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;   /* déplacer la fenêtre en attrapant le header */
  user-select: none;
}
/* les éléments cliquables du header restent utilisables (pas de drag) */
.topbar button, .topbar input, .topbar .search { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .2px; }
.logo {
  background: linear-gradient(150deg, var(--accent-bright), var(--accent-deep));
  display: grid; place-items: center; color: #1c1509; font-weight: 900;
  box-shadow: 0 6px 18px -4px var(--accent-glow);
}
.brand .logo { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
.brand h1 { font-size: 16px; margin: 0; }
.mode-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.mode-badge.demo { color: #f0c46a; border-color: rgba(240, 196, 106, .35); background: rgba(240, 196, 106, .1); }
.mode-badge.live { color: var(--won); border-color: rgba(84, 214, 147, .35); background: var(--won-soft); }

.toolbar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 8px 12px; min-width: 230px; transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 15px; height: 15px; color: var(--muted-2); flex: none; }
.search input { background: none; border: none; color: var(--text); outline: none; width: 100%; min-width: 0; font-size: 13.5px; }
.search input::placeholder { color: var(--muted-2); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  padding: 9px 13px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #1c1509; border-color: transparent; font-weight: 700; }
.btn.primary:hover { background: var(--accent-bright); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 9px; }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 122, .3); background: var(--danger-soft); }
.btn.danger:hover { background: rgba(255, 107, 122, .2); }
.btn.book { color: var(--blue); border-color: var(--blue-line); background: var(--blue-soft); }
.btn.book:hover { background: rgba(134, 191, 255, .2); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }

/* ───────────── Tabs ───────────── */
.tabs { display: flex; gap: 4px; padding: 14px 22px 0; }
.tab {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; color: var(--muted);
  padding: 10px 16px; border-radius: 11px 11px 0 0; font-size: 14px; font-weight: 600;
  position: relative; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: var(--bg-2); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.tab .count {
  font-size: 11.5px; font-weight: 700; min-width: 20px; text-align: center;
  padding: 1px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted);
}
.tab.active .count { background: var(--accent-soft); color: var(--accent); }

/* ───────────── Table ───────────── */
.migrate-banner { display: flex; align-items: center; gap: 13px; margin: 14px 22px 0; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.migrate-banner span { font-size: 13.5px; color: var(--text); flex: 1; }
.board { padding: 0 22px 40px; border-top: 1px solid var(--line); }
.table { margin-top: 14px; }

.row-grid {
  display: grid;
  grid-template-columns:
    minmax(150px, .8fr)    /* contact */
    230px                   /* tél + email côte à côte */
    minmax(54px, .4fr)      /* ad */
    64px                    /* opt-in */
    130px                   /* appels (5 pastilles) */
    112px                   /* joint (« Non joint ») */
    minmax(66px, .6fr)      /* note (tronquée) */
    286px;                  /* action : WhatsApp · micro · planifier · relance · Booké · Perdu */
  align-items: center;
  gap: 14px;
}

.table-head {
  position: sticky; top: 57px; z-index: 10;
  padding: 9px 16px; margin-bottom: 4px;
  background: rgba(11, 14, 19, .9); backdrop-filter: blur(8px);
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted-2); font-weight: 700;
  border-radius: 10px;
}
.table-head .col-label { display: flex; align-items: center; }

.lead-row {
  padding: 13px 16px; margin-bottom: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .14s, background .14s, transform .05s;
}
.lead-row:hover { background: var(--panel-2); border-color: var(--line-2); }
.lead-row:active { transform: scale(.997); }
.lead-row.is-lost { opacity: .72; }

/* contact cell */
.c-contact { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #06121f; letter-spacing: .3px;
}
.contact-text { min-width: 0; }
.contact-name-row { display: flex; align-items: center; min-width: 0; }
.contact-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.contact-name-row .plat-badge, .contact-name-row .rec-dot { flex: none; }
.rec-dot.has-rec { color: #e0a04a; } .rec-dot.has-recap { color: var(--reach); }
.contact-mail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-mail:hover { color: var(--accent); }

/* Bouton note sur la ligne (doré si une note existe) */
/* Colonne Note (aperçu texte, juste avant l'action) */
.c-note { min-width: 0; display: flex; align-items: center; }
.note-text { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; max-width: 100%; }
.note-text:hover { color: var(--text); }
.note-add { font-size: 12px; color: var(--muted-2); opacity: 0; cursor: pointer; transition: .14s; }
.lead-row:hover .note-add { opacity: .6; }
.note-add:hover { opacity: 1; color: var(--accent); }

/* phone */
.c-phone { min-width: 0; }
.coord-stack { display: flex; flex-direction: row; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.coord-stack .copy-pill:first-child { flex: none; }
.coord-stack .copy-pill.email { flex: 1 1 auto; min-width: 0; }
.copy-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--panel); color: var(--text); font-family: inherit;
  font-variant-numeric: tabular-nums; font-size: 12.5px;
  padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line);
  cursor: pointer; transition: border-color .14s, color .14s, background .14s, transform .05s;
}
.copy-pill svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.copy-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-pill:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.copy-pill:active { transform: translateY(1px); }
.copy-pill.email svg { color: var(--blue); }
.copy-pill.email:hover { border-color: var(--blue-line); color: var(--blue); background: var(--blue-soft); }
.c-phone .none, .cell-none { color: var(--muted-2); font-size: 12.5px; }

/* chips */
.chip {
  display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: var(--bg-2); border: 1px solid var(--line);
  color: #c4ccd8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.chip.asset { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip.ad { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }

/* opt-in */
.c-optin .d { font-size: 13px; font-weight: 600; }
.c-optin .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-optin .rel { font-size: 11px; color: var(--muted-2); }

/* calls */
.calls { display: flex; align-items: center; gap: 5px; }
.call-dot {
  width: 21px; height: 21px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-2); background: transparent; color: var(--muted-2);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  transition: .12s; padding: 0;
}
.call-dot:hover { border-color: var(--accent-line); color: var(--accent); transform: scale(1.12); }
.call-dot.on { background: var(--accent); border-color: var(--accent); color: #06121f; }
.call-dot.on:hover { background: var(--danger); border-color: var(--danger); color: #1a0508; }

/* Toggle Joint / Non joint */
.joint-toggle {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: border-color .14s, color .14s, background .14s, transform .05s;
}
.joint-toggle svg { width: 13px; height: 13px; flex: none; }
.joint-toggle:hover { border-color: var(--reach-line); color: var(--reach); }
.joint-toggle.on { background: var(--reach-soft); border-color: var(--reach-line); color: var(--reach); }
.joint-toggle:active { transform: translateY(1px); }
.c-joint { display: flex; align-items: center; gap: 8px; }

/* action */
.c-action { display: flex; justify-content: flex-end; gap: 6px; }
.rec-row {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.rec-row svg { width: 15px; height: 15px; }
.rec-row:hover { color: var(--text); border-color: var(--accent); }
.rec-row.on { background: rgba(212, 107, 107, .14); border-color: var(--danger); color: var(--danger); animation: recRowPulse 1.2s ease-in-out infinite; }
.rec-row:active { transform: translateY(1px); }
@keyframes recRowPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.wa-row {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.wa-row svg { width: 16px; height: 16px; }
.wa-row:hover { color: #25d366; border-color: #25d366; background: rgba(37, 211, 102, .12); }
.wa-row:active { transform: translateY(1px); }
.plan-row {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.plan-row svg { width: 16px; height: 16px; }
.plan-row:hover { color: var(--accent); border-color: var(--accent); background: rgba(201, 162, 75, .12); }
.plan-row:active { transform: translateY(1px); }
/* @ Instagram + badge plateforme */
.ig-handle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  max-width: 100%; padding: 1px 7px 1px 5px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: #c879c0; font-size: 11.5px; cursor: pointer; line-height: 1.6;
}
.ig-handle svg { width: 12px; height: 12px; flex: none; }
.ig-handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-handle:hover { border-color: #c879c0; background: rgba(200, 121, 192, .12); color: #d98fd0; }
.plat-badge { font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; margin-left: 6px; letter-spacing: .04em; vertical-align: middle; }
.plat-badge.ig { color: #e1306c; background: rgba(225, 48, 108, .15); }
.plat-badge.fb { color: #6f9ad6; background: rgba(111, 154, 214, .16); }
.ig-link { color: #c879c0; text-decoration: none; }
.ig-link:hover { text-decoration: underline; }
/* Relances */
.fu-row {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.fu-row svg { width: 16px; height: 16px; }
.fu-row:hover { color: var(--accent); border-color: var(--accent); }
.fu-row.set { color: var(--accent); border-color: var(--accent); background: rgba(201, 162, 75, .12); }
.fu-row.due { color: #e0a04a; border-color: #e0a04a; background: rgba(224, 160, 74, .16); }
.fu-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11px;
  border: 1px solid rgba(201, 162, 75, .4); color: var(--accent); background: rgba(201, 162, 75, .1);
}
.fu-badge svg { width: 11px; height: 11px; flex: none; }
.fu-badge.due { color: #e0a04a; border-color: rgba(224, 160, 74, .55); background: rgba(224, 160, 74, .15); }
.fu-pop {
  position: fixed; z-index: 1000; min-width: 212px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; gap: 1px;
}
.fu-head { font-size: 11px; color: var(--muted-2); padding: 4px 8px 3px; }
.fu-pop button { text-align: left; padding: 8px 10px; border-radius: 8px; background: transparent; border: none; color: var(--text); font-size: 13px; cursor: pointer; }
.fu-pop button:hover { background: rgba(255, 255, 255, .06); }
.fu-pop .fu-clear { color: var(--danger); margin-top: 3px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.fu-pick { display: flex; flex-direction: column; gap: 5px; padding: 7px 10px 4px; font-size: 12px; color: var(--muted); }
.fu-pick input { width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; color: var(--text); padding: 5px 7px; font-size: 12.5px; color-scheme: dark; }

/* ───────────── Empty / loading ───────────── */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state .ico { margin-bottom: 14px; opacity: .5; }
.empty-state .ico svg { width: 46px; height: 46px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.skeleton { height: 64px; margin-bottom: 7px; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* status bar */
.statusbar { margin-top: auto; padding: 11px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; color: var(--muted-2); font-size: 12px; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--won); box-shadow: 0 0 9px var(--won); }
.statusbar .spacer { margin-left: auto; }

/* ───────────── Drawer (détail lead) ───────────── */
.backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, .55); backdrop-filter: blur(2px); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; z-index: 50;
  background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head .avatar { width: 46px; height: 46px; font-size: 16px; border-radius: 12px; }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { margin: 0 0 3px; font-size: 18px; }
.drawer-title .sub { color: var(--muted); font-size: 12.5px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); font-weight: 700; margin-bottom: 6px; }
.field .val { font-size: 14px; }
.field .val a:hover { color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input, textarea.input {
  width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; transition: .15s;
}
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 72px; line-height: 1.5; }
#d-notes { min-height: 104px; }

.drawer .calls-big { display: flex; gap: 9px; }
.drawer .call-dot { width: 32px; height: 32px; font-size: 13px; }
.call-log { display: flex; flex-direction: column; margin-top: 10px; }
.call-log-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.call-log-row:last-child { border-bottom: none; }
.call-log .cl-n { color: var(--muted); }
.call-log .cl-at { color: var(--text); font-variant-numeric: tabular-nums; }
/* Tooltip instantané (remplace le title natif, lent) */
.tip {
  position: fixed; z-index: 9999; display: none;
  background: #0b0e13; color: var(--text); border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 7px; font-size: 11.5px; white-space: nowrap;
  pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
  opacity: 0; transition: opacity .07s ease-out;
}
.tip.show { opacity: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.lost-banner { margin: 0 0 18px; padding: 11px 14px; border-radius: 10px; background: var(--danger-soft); border: 1px solid rgba(255, 107, 122, .3); color: var(--danger); font-size: 13px; }

/* Segmented control de statut (drawer) */
.status-seg { display: flex; gap: 6px; }
.status-seg button { flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .14s; }
.status-seg button:hover { color: var(--text); background: var(--panel); }
.status-seg button.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.status-seg button.on.booked { color: var(--blue); border-color: var(--blue-line); background: var(--blue-soft); }
.status-seg button.on.lost { color: var(--danger); border-color: rgba(212, 107, 107, .4); background: var(--danger-soft); }

/* Enregistreur d'appels (style Vocaroo) */
.rec-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rec-addlink { display: flex; gap: 8px; margin-bottom: 12px; }
.rec-addlink input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 8px 10px; font-size: 13px; }
.rec-addlink input::placeholder { color: var(--muted-2); }
.rec-link-add { flex: none; width: 40px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.rec-link-add svg { width: 16px; height: 16px; }
.rec-link-add:hover { color: var(--accent); border-color: var(--accent); }
.rec-link { display: inline-flex; align-items: center; gap: 7px; color: var(--reach); text-decoration: none; font-size: 13px; padding: 5px 0; }
.rec-link svg { width: 15px; height: 15px; flex: none; }
.rec-link:hover { text-decoration: underline; }
.rec-item.is-link { gap: 5px; }
/* Recap IA */
.recap-gen-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
}
.recap-gen-btn svg { width: 15px; height: 15px; }
.recap-gen-btn:hover { background: rgba(201, 162, 75, .2); }
.rec-recap { margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.rec-recap.loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.recap-text { font-size: 12.5px; line-height: 1.55; color: var(--text); }
.recap-text .recap-h { display: block; margin: 11px 0 3px; color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.recap-text .recap-h:first-child { margin-top: 0; }
.recap-text .recap-li { display: block; padding-left: 13px; position: relative; }
.recap-text .recap-li::before { content: "•"; position: absolute; left: 1px; color: var(--accent); }
.recap-regen { margin-top: 10px; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 7px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; }
.recap-regen:hover { color: var(--text); border-color: var(--accent); }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
/* durée + vitesse de lecture */
.rec-dur { color: var(--muted); }
.rec-speed { flex: none; min-width: 36px; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.rec-speed:hover { color: var(--accent); border-color: var(--accent); }
/* pastille « call enregistré » sur la ligne */
.rec-dot { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; }
.rec-dot svg { width: 14px; height: 14px; }
.rec-dot.has-rec { color: #e0a04a; }
.rec-dot.has-recap { color: var(--reach); }
/* Gestion des accès */
.modal-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.access-add { display: flex; gap: 8px; margin-bottom: 14px; }
.access-add .input { flex: 1; }
.access-new { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px; padding: 11px 13px; font-size: 13px; color: var(--text); margin-bottom: 14px; }
.access-new .cred { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.access-new code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; }
.access-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.access-row.blocked { opacity: .6; }
.access-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.access-mail { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-status { font-size: 11px; color: var(--muted-2); }
.access-row.blocked .access-status { color: var(--danger); }
.access-actions { display: flex; gap: 6px; flex: none; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger);
  cursor: pointer; transition: background .14s, transform .05s;
}
.rec-btn svg { width: 15px; height: 15px; }
.rec-btn:hover { background: rgba(212, 107, 107, .22); }
.rec-btn:active { transform: translateY(1px); }
.rec-btn.recording { background: var(--danger); color: #fff; animation: recpulse 1.3s ease-in-out infinite; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 107, 107, .55); } 50% { box-shadow: 0 0 0 8px rgba(212, 107, 107, 0); } }
.rec-timer { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; color: var(--danger); min-width: 42px; }
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-item { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.rec-item audio { width: 100%; height: 36px; filter: invert(.9) hue-rotate(180deg) brightness(1.08); border-radius: 8px; }
.rec-item-foot { display: flex; align-items: center; gap: 8px; }
.rec-name { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.rec-ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: .14s; }
.rec-ic svg { width: 14px; height: 14px; }
.rec-ic:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.rec-ic.danger:hover { color: var(--danger); border-color: rgba(212, 107, 107, .4); background: var(--danger-soft); }

/* ───────────── Modal (ajout) ───────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.show { opacity: 1; pointer-events: auto; }
.modal-card { width: 480px; max-width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); transform: translateY(8px) scale(.99); opacity: 0; transition: .2s; }
.modal.show .modal-card { transform: none; opacity: 1; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* Import */
.import-help { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 14px; }
.import-help strong { color: var(--text); }
#import-text { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 150px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.import-preview { margin-top: 12px; padding: 11px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; min-height: 42px; display: flex; align-items: center; }
.import-preview strong { color: var(--accent); font-size: 15px; }
.import-preview .muted { color: var(--muted); }
.import-preview .danger-text { color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ───────────── Login ───────────── */
#login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 360px; max-width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-card .logo { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 18px; font-size: 22px; }
.login-card h2 { text-align: center; margin: 0 0 4px; }
.login-card p { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* ───────────── Toast ───────────── */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); z-index: 80; opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-card { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 16px; font-size: 13.5px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; }
.toast-card.ok { border-color: var(--accent-line); }
.toast-card svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.toast-card .u { color: var(--accent); font-weight: 600; cursor: pointer; margin-left: 4px; }

/* ───────────── Responsive : cartes sur mobile ───────────── */
@media (max-width: 920px) {
  .table-head { display: none; }
  /* Topbar en grid : impossible de déborder, les colonnes somment à la largeur dispo */
  .topbar {
    display: grid; align-items: center; gap: 10px 8px; padding: 12px 16px;
    grid-template-columns: 1fr auto auto auto auto;
    grid-template-areas: "brand brand brand brand brand" "search refresh import add logout";
  }
  .brand { grid-area: brand; min-width: 0; }
  .toolbar { display: contents; }
  .search { grid-area: search; min-width: 0; }
  #refresh-btn { grid-area: refresh; }
  #import-btn { grid-area: import; }
  #add-btn { grid-area: add; }
  #logout-btn { grid-area: logout; }
  .btn-label { display: none; }   /* boutons en icône seule sur mobile */
  .tabs, .board { padding-left: 16px; padding-right: 16px; }

  .row-grid { grid-template-columns: 1fr; gap: 10px; }
  .lead-row { padding: 14px 15px; }
  .c-phone, .c-note, .c-ad, .c-optin, .c-calls, .c-joint, .c-action { display: flex; align-items: center; }
  .c-phone::before, .c-note::before, .c-ad::before, .c-optin::before, .c-calls::before, .c-joint::before {
    content: attr(data-label); width: 78px; flex: none; color: var(--muted-2);
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
  }
  .c-action { justify-content: flex-start; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; }
  .c-action::before { content: ""; }
  .drawer { width: 100vw; }
}
