:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel2: #eef1f7;
  --border: #d9e0ec;
  --text: #1c2333;
  --muted: #5c6a85;
  --accent: #2f6fe4;
  --green: #1d9e5f;
  --orange: #e8930c;
  --red: #d64045;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
nav .brand { font-weight: 700; font-size: 18px; color: var(--text); }
nav a { color: var(--muted); font-weight: 500; }
nav a.active, nav a:hover { color: var(--text); text-decoration: none; }
nav .spacer { flex: 1; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
main.wide { max-width: 1500px; }

h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(28, 35, 51, .05);
}
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

button, .btn {
  display: inline-block; border: none; border-radius: 10px; cursor: pointer;
  font-size: 16px; font-weight: 600; padding: 10px 18px;
  background: var(--panel2); color: var(--text); text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(.96); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { filter: brightness(1.08); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-xl { font-size: 22px; padding: 18px 36px; border-radius: 14px; }
.btn-lg { font-size: 18px; padding: 14px 26px; }

input, select, textarea {
  width: 100%; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
}
textarea { resize: vertical; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(28, 35, 51, .025); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--panel2); color: var(--muted);
}
.pill.s { background: #fff1cf; color: #8a6100; }
.pill.a { background: #e1eeff; color: #1758ad; }
.pill.green { background: #ddf5e8; color: #14724a; }
.pill.red { background: #fbe2e3; color: #ab2328; }
.pill.orange { background: #fdeed3; color: #8f5a05; }

/* ---------- ecran de session ---------- */
.session-layout {
  display: grid; grid-template-columns: 330px 1fr 300px; gap: 16px;
  align-items: start;
}
.phone-big {
  font-size: 52px; font-weight: 800; letter-spacing: 2px;
  text-align: center; margin: 8px 0 2px; color: var(--text);
}
.phone-big a { color: var(--text); }
.phone-sub { text-align: center; color: var(--muted); margin-bottom: 10px; }
.phone-alt { text-align: center; font-size: 14px; color: var(--muted); }
.phone-alt .tried { text-decoration: line-through; opacity: .6; }

.script-box {
  white-space: pre-wrap; background: #fafbfe; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; font-size: 16.5px; line-height: 1.65;
  max-height: 46vh; overflow-y: auto;
}
.hook-inline {
  background: #e1eeff; border-bottom: 2px dashed var(--accent);
  border-radius: 4px; padding: 1px 3px; cursor: text;
}
.hook-inline:hover { background: #d3e5ff; }
.hook-inline:focus { outline: 2px solid var(--accent); background: #fff; }
.lead-field { margin-bottom: 8px; }
.lead-field .k { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.lead-field .v { font-size: 15.5px; }
.lead-name { font-size: 22px; font-weight: 700; margin-bottom: 2px; }

.history-item { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.history-item:last-child { border-bottom: none; }

.post-snap {
  margin-top: 6px; padding: 8px 10px; background: #fafbfe;
  border-left: 3px solid var(--border); border-radius: 6px; font-size: 13.5px;
  max-height: 130px; overflow-y: auto; white-space: pre-wrap;
}
.post-snap.comment { border-left-color: var(--accent); background: #f2f7ff; }
.post-snap .post-author { font-weight: 700; margin-bottom: 3px; }

.actions-bar {
  position: sticky; bottom: 0; margin-top: 18px;
  display: flex; gap: 14px; justify-content: center; align-items: center;
  padding: 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 -2px 10px rgba(28, 35, 51, .06);
}
.outcome-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.topbar {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.topbar .spacer { flex: 1; }

/* ---------- agenda des creneaux (follow-up) ---------- */
.slot-agenda {
  display: flex; gap: 12px; overflow-x: auto; max-height: 340px;
  overflow-y: auto; padding: 4px 2px 8px;
}
.slot-col { min-width: 148px; flex: 0 0 auto; }
.slot-day {
  font-weight: 700; font-size: 13.5px; text-align: center;
  padding: 6px 4px; margin-bottom: 8px; border-bottom: 2px solid var(--border);
  position: sticky; top: 0; background: var(--panel); text-transform: capitalize;
}
.slot-col button {
  display: block; width: 100%; margin-bottom: 6px;
  font-size: 14.5px; padding: 8px 10px; text-align: center;
  background: var(--panel2);
}
.slot-col button.selected { background: var(--accent); color: #fff; }
.manual-slot {
  margin-top: 12px; padding: 12px; border: 1px dashed var(--border);
  border-radius: 10px; background: #fafbfe;
}
.manual-slot .row { display: flex; gap: 10px; align-items: end; }
.manual-slot.selected { border-color: var(--accent); background: #eef4ff; }

.overlay {
  position: fixed; inset: 0; background: rgba(20, 28, 45, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.overlay .card { width: min(780px, 94vw); max-height: 90vh; overflow-y: auto; }

.hidden { display: none !important; }
.stat-num { font-size: 34px; font-weight: 800; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14.5px; }
.flash.err { background: #fbe2e3; color: #ab2328; }
.flash.ok { background: #ddf5e8; color: #14724a; }

@media (max-width: 1100px) {
  .session-layout { grid-template-columns: 1fr; }
}
