:root {
  --black: #060606; --orange: #fb7c00; --amber: #e08a00; --cream: #faf8f5; --line: #e6e2dc;
  --green: #2e9e6b; --red: #b4232a; --redbg: #fff8f8; --ink: #1b1b1b; --muted: #777;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--cream); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* En-tête */
.top { background: var(--black); color: #fff; padding: 14px 28px; display: flex; align-items: center; gap: 18px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.01em; text-decoration: none; color: #fff; }
.logo span { color: var(--orange); }
.logo small { font-weight: 600; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #aaa; margin-left: 10px; }
.top .sp { flex: 1; }
.top .who { color: #bbb; font-size: 13px; }
.top a.lnk, .top button.lnk { color: #fff; background: none; border: 1px solid #333; border-radius: 8px; padding: 6px 12px; font-size: 13px; text-decoration: none; }
.top a.lnk:hover, .top button.lnk:hover { border-color: var(--orange); }

main { max-width: 1180px; margin: 0 auto; padding: 32px 28px 60px; }
.kicker { font-size: 11px; letter-spacing: .22em; font-weight: 800; color: var(--orange); text-transform: uppercase; }
h1 { font-size: 40px; line-height: 1.05; margin: 8px 0 10px; letter-spacing: -.02em; font-weight: 800; }
h1 .o { color: var(--orange); }
h2 { font-size: 22px; margin: 0 0 12px; font-weight: 800; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 800; }
.lead { color: var(--muted); font-size: 16px; max-width: 680px; margin: 0 0 26px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } h1 { font-size: 30px; } }

a.btn { text-decoration: none; display: inline-block; }
.btn { border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 700; background: var(--orange); color: #fff; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.dark { background: var(--black); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.red { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label.f { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
input.in, textarea.in, select.in { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fff; }
input.in:focus, textarea.in:focus, select.in:focus { outline: 2px solid var(--orange); border-color: transparent; }
textarea.in { min-height: 90px; resize: vertical; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 320px; }

.msg { padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.msg.err { background: var(--redbg); color: var(--red); border-left: 3px solid #e5484d; }
.msg.ok { background: #eef9f3; color: #1d6b47; border-left: 3px solid var(--green); }
.msg.info { background: #fff4e6; color: #5a3a12; border-left: 3px solid var(--orange); }

/* Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .side { background: var(--black); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login .side h1 { font-size: 46px; }
.login .side p { color: #bdbdbd; max-width: 460px; }
.login .form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login .form .card { width: 100%; max-width: 400px; }
.code-in { font-size: 28px; letter-spacing: 10px; text-align: center; font-weight: 800; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login .side { padding: 32px; } }

/* Choix du client */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 26px; }
.client { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 22px; transition: border-color .15s, transform .15s; }
.client:hover { border-color: #f5b97a; transform: translateY(-2px); }
.client.sel { border-color: var(--orange); box-shadow: 0 0 0 4px #fff0de; }
.client .nm { font-size: 22px; font-weight: 800; }
.client .tg { color: var(--muted); font-size: 14px; margin-top: 6px; }
.client .ct { margin-top: 14px; font-size: 12px; font-weight: 700; color: var(--orange); }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 7px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--black); color: #fff; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--black); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fffaf3; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eee; }
.pill.rdv { background: #e5f6ee; color: #1d6b47; }
.pill.refus { background: var(--redbg); color: var(--red); }
.pill.rappel { background: #fff4e6; color: #8a5200; }
.score { font-weight: 800; }

/* Préparation */
.prep { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 960px) { .prep { grid-template-columns: 1fr; } }
.fiche dl { display: grid; grid-template-columns: 190px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.fiche dt { color: var(--muted); font-weight: 600; }
.fiche dd { margin: 0; word-break: break-word; }
.fiche .who { font-size: 13px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 28px; }
.goalbar { background: var(--black); color: #fff; border-radius: 14px; padding: 16px 20px; margin-bottom: 18px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.goalbar b { color: var(--orange); }
details.trame { margin-top: 18px; }
details.trame summary { cursor: pointer; font-weight: 700; }
details.trame pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--cream); padding: 14px; border-radius: 10px; max-height: 420px; overflow: auto; }

/* Appel */
.call { background: var(--black); color: #fff; border-radius: 22px; padding: 34px; min-height: 520px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.call .who { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: #999; }
.call .name { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.call .co { color: #bbb; }
.call .clock { font-variant-numeric: tabular-nums; color: var(--orange); font-weight: 700; margin-top: 8px; }
.orb { width: 150px; height: 150px; border-radius: 50%; margin: 30px 0 18px; display: grid; place-items: center; font-size: 44px; background: #1b1b1b; border: 2px solid #333; transition: all .2s; }
.orb.listen { border-color: var(--green); box-shadow: 0 0 0 10px rgba(46,158,107,.15), 0 0 0 22px rgba(46,158,107,.07); animation: pulse 1.6s infinite; }
.orb.speak { border-color: var(--orange); box-shadow: 0 0 0 10px rgba(251,124,0,.18), 0 0 0 22px rgba(251,124,0,.08); }
.orb.think { border-color: #777; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(46,158,107,.10), 0 0 0 30px rgba(46,158,107,.04); } }
.state { font-weight: 700; min-height: 24px; }
.live { color: #cfcfcf; min-height: 48px; max-width: 640px; font-size: 16px; margin: 8px 0 16px; }
.call .ctrls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: auto; }
.call .ctrls .btn.ghost { background: #1b1b1b; color: #fff; border-color: #333; }
.sub { width: 100%; max-width: 720px; text-align: left; margin-top: 18px; }
.bubble { padding: 9px 13px; border-radius: 12px; margin: 6px 0; max-width: 85%; font-size: 14px; }
.bubble.prospect { background: #1f1f1f; color: #eee; }
.bubble.buddy { background: var(--orange); color: #fff; margin-left: auto; }
.typebox { display: flex; gap: 8px; width: 100%; max-width: 640px; margin: 12px 0 16px; }
.typebox input { flex: 1; background: #1b1b1b; border: 1px solid #333; color: #fff; border-radius: 10px; padding: 10px 12px; }

/* Débrief */
.scorebig { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.ring { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 800; background: conic-gradient(var(--orange) calc(var(--p) * 1%), #eee 0); position: relative; }
.ring::after { content: ''; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.ring span { position: relative; z-index: 1; }
.ring small { font-size: 14px; color: var(--muted); }
.bar { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.crit { padding: 12px 0; border-bottom: 1px solid var(--line); }
.crit .h { display: flex; justify-content: space-between; font-weight: 700; }
.crit p { margin: 4px 0 0; color: #444; font-size: 14px; }
.quote { border-left: 3px solid var(--orange); padding: 6px 12px; background: var(--cream); border-radius: 0 8px 8px 0; font-style: italic; margin: 6px 0; }
ul.clean { padding-left: 18px; margin: 6px 0; }
ul.clean li { margin-bottom: 6px; }
.obj { background: var(--redbg); border-left: 3px solid #e5484d; padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 8px 0; font-size: 14px; }
.obj .q { color: var(--red); font-weight: 700; }
.spinner { width: 42px; height: 42px; border: 4px solid #eee; border-top-color: var(--orange); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--orange); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Courbe de progression */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { flex: 1 1 150px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.stat .sl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .sv { font-size: 22px; font-weight: 800; color: var(--ink); }
.stat .sv.up::first-letter { color: var(--green); }
.stat .sv.down::first-letter { color: var(--red); }
.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: #bdb7ae; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .line { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--orange); stroke: #fff; stroke-width: 2; pointer-events: none; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .dot, .chart .hit:hover { fill: rgba(251, 124, 0, .12); }
.tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--black); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; z-index: 2; }
.tip .muted { color: #bbb; }
