:root {
  --bg: #f6f2ea;
  --grid: #ece6da;
  --ink: #16181d;
  --muted: #6b6f78;
  --card: #fffdf9;
  --line: #e2dccf;
  --orange: #e8622c;
  --yellow: #f4b62c;
  --blue: #2457c5;
  --green: #2c9a5a;
  --red: #d8452e;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--yellow); color: var(--ink); font-family: "Archivo Black", sans-serif;
}
.brand h1 { margin: 0; font-family: "Archivo Black", sans-serif; font-size: 20px; letter-spacing: .5px; }
.sub { margin: 0; font-size: 12px; color: #c9ccd3; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tabs button {
  border: 0; background: transparent; color: #d7d9de; padding: 8px 12px; border-radius: 999px;
  font: 600 13px Inter, sans-serif; cursor: pointer;
}
.tabs button b {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); color: #fff; font-size: 11px; margin-right: 4px;
}
.tabs button.active, .tabs button:hover { background: #2a2d35; color: #fff; }

.banner { background: var(--yellow); padding: 8px 20px; font-size: 13px; font-weight: 500; }
.banner.hidden { display: none; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.tab { display: none; }
.tab.active { display: block; }

.section-title {
  font-family: "Archivo Black", sans-serif; text-transform: uppercase; font-size: 24px;
  display: flex; align-items: center; gap: 10px; margin: 8px 0 18px;
}
.num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: #fff; font: 700 16px Inter, sans-serif;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.04);
}
.card h4 { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 15px; }
.step {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 11px;
}

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.mt { margin-top: 12px; }
textarea, input, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font: 400 14px Inter, sans-serif; color: var(--ink);
}
input[type="time"] { display: inline-block; width: auto; margin: 0 0 0 4px; padding: 2px 6px; }
.row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.row input { flex: 1; min-width: 200px; margin: 0; }
.row select { width: auto; margin: 0; }
.row.end { justify-content: flex-end; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

button.primary {
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer;
  padding: 10px 18px; font: 600 14px Inter, sans-serif;
}
button.primary:hover { background: var(--orange); }
button.primary:disabled { opacity: .5; cursor: wait; }
button.ghost {
  border: 1px solid #555; background: transparent; color: inherit; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font: 600 13px Inter, sans-serif;
}
dialog button.ghost { border-color: var(--line); }

/* Vue d'ensemble */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ov-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.ov-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.ov-card h3 { display: inline; margin-left: 8px; font-size: 18px; }
.ov-card p { color: var(--muted); font-size: 14px; }
.ov-card code {
  display: block; background: var(--ink); color: #fff; font: 12px Inter, sans-serif;
  padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--yellow);
}
.powered { text-align: center; color: var(--muted); margin-top: 26px; }

/* Matrice */
.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.q { border: 2px solid; border-radius: 12px; padding: 12px; min-height: 140px; background: #fff; }
.q h5 { margin: 0 0 8px; text-transform: uppercase; font-size: 11px; letter-spacing: .6px; }
.q ul { margin: 0; padding-left: 18px; font-size: 14px; }
.q li { margin-bottom: 6px; }
.q li small { color: var(--muted); }
.q-ui { border-color: var(--red); } .q-ui h5 { color: var(--red); }
.q-i { border-color: var(--blue); } .q-i h5 { color: var(--blue); }
.q-u { border-color: var(--yellow); } .q-u h5 { color: #b07c00; }
.q-w { border-color: var(--line); } .q-w h5 { color: var(--muted); }

/* Second cerveau */
.drop {
  display: block; text-align: center; padding: 24px; border: 2px dashed var(--line);
  border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 500;
}
.drop.over { border-color: var(--orange); background: #fff4ee; }
.chips { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chips li {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.chips li::before { content: "📄 "; }
.cats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cat { border: 2px solid var(--blue); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.cat span { color: var(--muted); font-weight: 400; }
.cat:nth-child(4n+1) { border-color: var(--orange); }
.cat:nth-child(4n+2) { border-color: var(--green); }
.cat:nth-child(4n+3) { border-color: var(--blue); }
.cat:nth-child(4n+4) { border-color: var(--yellow); }

.answer { margin-top: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.answer:empty { display: none; }
.answer.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.source { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--orange); font-weight: 700; text-transform: uppercase; }

/* Bilan */
.pill { display: inline-flex; align-items: center; border: 2px solid var(--blue); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { border-top: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.hist b { color: var(--orange); }
.tomorrow { background: #fff; border-left: 4px solid var(--orange); padding: 10px 14px; border-radius: 8px; }
.tomorrow h6 { margin: 0 0 4px; color: var(--orange); text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }

/* Fiche de style */
.stylesheet:empty { display: none; }
.stylesheet { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.stylesheet h6 { margin: 0 0 8px; color: var(--orange); text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }
.swatches { display: flex; gap: 8px; margin-bottom: 10px; }
.sw { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); }
.stylesheet img { max-height: 48px; margin-bottom: 8px; }

/* Equipe */
.team { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.agent {
  display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; font-size: 26px; transition: all .2s;
}
.agent small { font-size: 11px; font-weight: 600; }
.agent.chef { background: var(--orange); color: #fff; border-color: var(--orange); }
.agent.busy { border-color: var(--orange); box-shadow: 0 0 0 6px #ffe1d3; }
.agent.done { border-color: var(--green); }
.res { color: var(--orange); text-transform: uppercase; letter-spacing: .6px; }
.log { font-size: 12px; color: var(--muted); }
.log div::before { content: "› "; }

dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(460px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.hint { font-size: 12px; color: var(--muted); }

.spinner::after { content: " ⏳"; }

/* Prospection */
.spacer { flex: 1; }
button.small { padding: 4px 10px; font-size: 12px; }
.prospects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.prospect { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.prospect h5 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.score { border-radius: 999px; padding: 1px 8px; font-size: 12px; color: #fff; background: var(--muted); white-space: nowrap; }
.score.hot { background: var(--red); } .score.warm { background: var(--orange); }
.prospect .why { color: var(--muted); }
.prospect .actions { display: flex; gap: 6px; margin-top: auto; }
.audit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.audit .box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; }
.audit h6 { margin: 0 0 6px; color: var(--orange); text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }
.audit ul { margin: 0; padding-left: 18px; }
.seq { margin-top: 12px; display: grid; gap: 10px; }
.seq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.seq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.seq pre { white-space: pre-wrap; font: 13px/1.5 Inter, sans-serif; margin: 10px 0; }
.followups:empty { display: none; }
.followups { background: #fff4ee; border: 1px solid #f6c7b0; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.kanban { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.col { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; }
.col h5 { margin: 2px 4px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.lead { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 12px; background: var(--card); }
.lead b { display: block; font-size: 13px; }
.lead select, .lead input { margin-top: 6px; padding: 4px 6px; font-size: 12px; }
.lead .late { color: var(--red); font-weight: 600; }
.lead .del { float: right; border: 0; background: none; cursor: pointer; color: var(--muted); }

/* Employé IA */
.emp-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--orange); }
.emp-id { flex: 1; min-width: 200px; }
.emp-id h3 { margin: 0; font-size: 20px; }
.emp-id small { font-size: 13px; color: var(--muted); font-weight: 500; }
.emp-status { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 4px; }
.dot.on { background: var(--green); }
.dot.busy { background: var(--orange); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.emp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.switch input, label.check input { display: inline; width: auto; margin: 0; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
button.ghost.dark { border-color: var(--line); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.kpi b { display: block; font: 22px "Archivo Black", sans-serif; }
.kpi span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.alert { background: #fff7e0; border: 1px solid #f4d48a; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 10px; }
.alert.ok { background: #e9f7ef; border-color: #a9dcbd; }
.badge { background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.tag { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; height: fit-content; }
.queue { display: grid; gap: 14px; }
.qitem { border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 12px; padding: 14px; background: #fff; }
.qhead { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.qitem label { margin: 10px 0 0; }
.qitem .row { margin-top: 12px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.journal { max-height: 520px; overflow-y: auto; font-size: 13px; }
.j { padding: 6px 0; border-bottom: 1px solid var(--line); }
.j time { color: var(--muted); font-size: 11px; margin-right: 4px; }
.j.error { color: var(--red); } .j.warn { color: #9a6a00; } .j.success { color: var(--green); font-weight: 600; }
.profile label { margin-bottom: 10px; }
details.manual summary { cursor: pointer; }
.lead details { margin-top: 6px; }
.lead summary { cursor: pointer; color: var(--muted); }
.hint { font-weight: 400; }
.err { color: var(--red); font-size: 13px; }

/* Inès, community manager */
.cm-queue, .cm-manual { display: grid; gap: 16px; }
.cm-item { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 18px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; padding: 14px; background: #fff; }
.cm-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cm-body label { margin: 0; }
.cm-body .row label { flex: 0 0 auto; }
.slides { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.slides a { flex: 0 0 auto; scroll-snap-align: start; }
.phone { display: block; width: 100%; max-width: 300px; border-radius: 14px; border: 1px solid var(--line); background: #000; }
.slides .phone { width: 220px; }
.slides .phone.tall { width: 170px; }
video.phone { max-height: 520px; width: auto; max-width: 100%; }
.phone.empty { display: grid; place-items: center; aspect-ratio: 4/5; background: var(--bg); color: var(--muted); text-align: center; }
.checks { gap: 12px; align-items: center; }
.colors input { width: 56px; height: 40px; padding: 2px; margin: 0; }
.caption { white-space: pre-wrap; font: 13px/1.5 Inter, sans-serif; background: var(--bg); padding: 10px; border-radius: 10px; margin: 0; max-height: 220px; overflow: auto; }
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.day { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.day h5 { margin: 0 0 8px; font-size: 12px; text-transform: capitalize; color: var(--muted); }
.slot { border-left: 4px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.slot b { font-size: 13px; }
.slot.st-idee { border-color: var(--line); }
.slot.st-a_valider { border-color: var(--orange); }
.slot.st-approuve { border-color: var(--blue); }
.slot.st-publie { border-color: var(--green); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.media-grid figure { margin: 0; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.media-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-grid figcaption { font-size: 11px; padding: 6px; color: var(--muted); }
.media-grid .del { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 24px; height: 24px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.logo-prev { height: 36px; background: var(--ink); border-radius: 6px; padding: 4px; }
button.primary.small { padding: 4px 12px; font-size: 12px; }

/* Hugo, rédacteur web */
.bl-list { display: grid; gap: 14px; }
.bl-item { display: grid; grid-template-columns: 260px 1fr; gap: 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; padding: 14px; background: #fff; }
.bl-item:not(:has(.bl-cover)) { grid-template-columns: 1fr; }
.bl-cover { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.pill-st { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; height: fit-content; white-space: nowrap; background: var(--bg); }
.pill-st.warn { background: #fff1e6; color: #b2470f; } .pill-st.ok { background: #e9f7ef; color: var(--green); }
.pill-st.info { background: #e8eefb; color: var(--blue); } .pill-st.err { background: #fdeaea; color: var(--red); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 14px; font-size: 13px; }
.checklist .ok { color: var(--green); } .checklist .ko { color: #b2470f; font-weight: 600; }
.bl-read { max-height: 420px; overflow: auto; font-size: 14px; line-height: 1.6; background: var(--bg); border-radius: 10px; padding: 4px 16px; margin-top: 8px; }
.bl-read h3 { font-size: 16px; margin: 16px 0 6px; }
.bl-date { max-width: 210px; margin: 0; padding: 4px 8px; font-size: 12px; }

@media (max-width: 720px) {
  .bl-item { grid-template-columns: 1fr; }
  .cm-item { grid-template-columns: 1fr; }
  .cols2 { grid-template-columns: 1fr; }
  .audit { grid-template-columns: 1fr; }

  .topbar { padding: 12px 16px; }
  .tabs { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .tabs button { white-space: nowrap; }
  #settingsBtn { margin-left: auto; }
  .cols3, .matrix { grid-template-columns: 1fr; }
  .section-title { font-size: 19px; }
}
a.ghost { display: inline-block; text-decoration: none; color: inherit; border-color: var(--line); }
.row input[type="checkbox"], .row input[type="color"], .row input[type="radio"] { flex: 0 0 auto; min-width: 0; width: auto; }
.row input[type="color"] { width: 56px; }
a.ghost { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font: 600 12px Inter, sans-serif; }
