/* Tableau de bord des agents vocaux : design validé par David le 27/10 (maquette v2, esprit Aircall).
   Mise en page : barre d'application à gauche, colonne de rubriques de l'agent, panneau de réglages, barre Brouillon / Publier en bas.
   Une teinte par famille de réglages (voix = violet, script = bleu, actions = ambre, sortant = corail, leads = sarcelle, suivi = vert). */
:root {
  --bg: #e9eeeb; --surface: #ffffff; --surface-2: #f4f7f5; --ink: #142019; --muted: #5d6b64; --line: #e0e7e3;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 6px 20px rgba(16, 40, 30, .06);
  --shadow-up: 0 2px 4px rgba(16, 40, 30, .08), 0 14px 32px rgba(16, 40, 30, .12);
  --accent: #0c8a63; --accent-2: #12b886; --accent-ink: #ffffff; --accent-soft: #dff5ec;
  --side-1: #0f2a21; --side-2: #12382b; --side-ink: #cfe3da;
  --violet: #7048e8; --violet-soft: #ece6ff; --bleu: #1c7ed6; --bleu-soft: #e1efff; --ambre: #d9480f; --ambre-soft: #ffe8d9;
  --corail: #e03170; --corail-soft: #ffe3ee; --sarcelle: #0b7285; --sarcelle-soft: #d9f3f7; --or: #b7791f; --or-soft: #fdf0d5;
  --off: #87938d; --off-soft: #e9eeeb; --danger: #c92a2a; --danger-soft: #ffe3e3;
  --font: "Figtree", "Segoe UI", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 12px; color-scheme: light;
}
/* Mode sombre mis de côté (David, 27/10 : « mode clair pour l'instant ») : remettre « @media (prefers-color-scheme: dark) » pour le rétablir. */
@media not all { :root {
  --bg: #0c110f; --surface: #151c19; --surface-2: #1b2420; --ink: #e5eee9; --muted: #95a59d; --line: #26312c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25); --shadow-up: 0 2px 6px rgba(0,0,0,.5), 0 16px 36px rgba(0,0,0,.4);
  --accent: #2fd39b; --accent-2: #63e6be; --accent-ink: #062018; --accent-soft: #123a2c; --side-1: #08100d; --side-2: #0e1f19; --side-ink: #bfd5cb;
  --violet: #9775fa; --violet-soft: #2a2145; --bleu: #4dabf7; --bleu-soft: #14304a; --ambre: #ff922b; --ambre-soft: #3d2614;
  --corail: #f06595; --corail-soft: #401a2a; --sarcelle: #3bc9db; --sarcelle-soft: #10343a; --or: #f2b84b; --or-soft: #3a2d12;
  --off: #76837d; --off-soft: #222b27; --danger: #ff8787; --danger-soft: #3f1d1d; color-scheme: dark } }

* { box-sizing: border-box }
[hidden] { display: none !important }   /* sinon .section (display:flex) affiche toutes les rubriques à la fois */
html, body { height: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45 }
button, input, textarea, select { font: inherit; color: inherit }
a { color: inherit }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0 }

.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100% }

/* barre d'application */
.appnav { background: linear-gradient(175deg, var(--side-2), var(--side-1)); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh }
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; text-decoration: none }
.logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(18, 184, 134, .35); color: #fff }
.logo svg { width: 22px; height: 22px }
.marque b { display: block; font-size: 15px; color: #fff; font-weight: 700 }
.marque small { font-size: 12px; opacity: .7 }
.appnav a.nav { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; color: var(--side-ink);
  text-decoration: none; font-weight: 500; transition: background .15s, color .15s }
.appnav a.nav:hover { background: rgba(255,255,255,.06); color: #fff }
.appnav a.nav.on { background: rgba(47, 211, 155, .14); color: #fff }
.appnav a.nav.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-2) }
.appnav .compte { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 99px }
.moi { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05) }
.moi .ini { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--bleu)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none }
.moi div { font-size: 12px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere } .moi b { color: #fff; font-weight: 600; display: block }

.main { padding: 14px; min-width: 0 }
.vue { background: var(--surface); border-radius: 18px; min-height: calc(100vh - 28px); min-width: 0; box-shadow: var(--shadow); animation: entree .28s ease both }
@keyframes entree { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -.01em; text-wrap: balance }
h2 { font-size: 20px; margin: 0; font-weight: 700; text-wrap: balance }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 15px;
  font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s }
.btn:hover { background: var(--surface-2); transform: translateY(-1px) }
.btn:active { transform: none }
.btn.prim { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 4px 14px rgba(12, 138, 99, .3) }
.btn.prim:hover { box-shadow: 0 6px 20px rgba(12, 138, 99, .4) }
.btn.prim:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none }
.btn.contour { color: var(--accent); border-color: var(--accent); background: transparent }
.btn.contour:hover { background: var(--accent-soft) }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent }
.btn svg.i { width: 16px; height: 16px }
.btn.petit { padding: 5px 11px; font-size: 13px }

/* liste */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 28px 6px; flex-wrap: wrap }
.entete .sous { margin-top: 2px }
.annonce { margin: 16px 28px 4px; border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: #fff;
  background: linear-gradient(120deg, #0b5d48 0%, #0c8a63 45%, #1c7ed6 100%); position: relative; overflow: hidden }
.annonce::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08) }
.annonce .badge { background: rgba(255,255,255,.2); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700 }
.annonce p { margin: 0; flex: 1; min-width: 220px } .annonce p b { display: block; font-size: 15px }
.annonce .btn { background: #fff; color: #0b5d48; border: 0; position: relative; z-index: 1 }
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 28px }
.tuile { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: center; transition: transform .15s, box-shadow .15s }
.tuile:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.pastille { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none }
.pastille svg.i { width: 20px; height: 20px }
.p-vert { background: var(--accent-soft); color: var(--accent) } .p-violet { background: var(--violet-soft); color: var(--violet) }
.p-bleu { background: var(--bleu-soft); color: var(--bleu) } .p-ambre { background: var(--ambre-soft); color: var(--ambre) }
.p-corail { background: var(--corail-soft); color: var(--corail) } .p-sarcelle { background: var(--sarcelle-soft); color: var(--sarcelle) }
.p-or { background: var(--or-soft); color: var(--or) } .p-gris { background: var(--off-soft); color: var(--off) }
.p-rouge { background: var(--danger-soft); color: var(--danger) }
.tuile b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.15 }
.tuile span { color: var(--muted); font-size: 12.5px }

.cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 4px 28px 28px }
.carte { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface);
  text-decoration: none; color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s }
a.carte:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); border-color: transparent }
.carte.grise { opacity: .72 }
.carte-tete { display: flex; gap: 14px; align-items: center }
.av { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex: none }
.av svg { width: 24px; height: 24px }
.av-0 { background: linear-gradient(135deg, #12b886, #1c7ed6) } .av-1 { background: linear-gradient(135deg, #845ef7, #1c7ed6) }
.av-2 { background: linear-gradient(135deg, #20c997, #0b7285) } .av-lea { background: linear-gradient(135deg, #f06595, #ae3ec9) }
.av-antoine { background: linear-gradient(135deg, #fd7e14, #e8590c) } .av-banc { background: linear-gradient(135deg, #868e96, #495057) }
.carte-tete .nom { font-weight: 700; font-size: 16px }
.carte-tete > div:nth-child(2) { min-width: 0; flex: 1 }
.sous { color: var(--muted); font-size: 12.5px }
.meta { display: flex; gap: 8px; flex-wrap: wrap }
.meta span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--muted) }
.meta span b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums }
.meta svg.i { width: 14px; height: 14px }
.carte .bas { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap }
.carte .bas .fleche { margin-left: auto; color: var(--accent); font-weight: 600; display: inline-flex; gap: 4px; align-items: center }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.pill.nodot::before { display: none }
.pill.essai { background: var(--or-soft); color: var(--or) }
.pill.essai::before { animation: pouls 1.6s ease-in-out infinite }
.pill.ok { background: var(--accent-soft); color: var(--accent) }
.pill.ok::before { animation: pouls 2.2s ease-in-out infinite }
.pill.off { background: var(--off-soft); color: var(--off) }
.pill.coupe { background: var(--danger-soft); color: var(--danger) }
@keyframes pouls { 0%, 100% { box-shadow: 0 0 0 0 currentColor } 50% { box-shadow: 0 0 0 4px transparent } }

/* fiche */
.fiche { display: grid; grid-template-columns: 256px 1fr; overflow: clip }
.rubriques { border-right: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 2px }
.retour { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; padding: 4px 6px 12px; text-decoration: none }
.retour:hover { color: var(--ink) }
.carte-agent { border-radius: 14px; padding: 14px; margin-bottom: 10px; color: #fff; background: linear-gradient(135deg, #0b5d48, #0c8a63 55%, #1c7ed6); position: relative; overflow: hidden }
.carte-agent::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.1) }
.carte-agent .t { font-weight: 800; font-size: 17px; margin: 6px 0 8px }
.duo { display: flex } .duo span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid rgba(255,255,255,.85) }
.duo span + span { margin-left: -8px }
.carte-agent .ligne { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .92; flex-wrap: wrap; position: relative; z-index: 1 }
.carte-agent .pill { background: rgba(255,255,255,.18); color: #fff }
.groupe { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 8px 5px; font-weight: 700 }
.rub { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; cursor: pointer; background: none; border: 0;
  text-align: left; width: 100%; font-weight: 500; transition: background .15s }
.rub:hover { background: var(--surface-2) }
.rub.on { background: var(--surface-2); font-weight: 700 }
.rub .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; transition: transform .15s }
.rub:hover .ic { transform: scale(1.08) }
.rub .ic svg.i { width: 15px; height: 15px }
.rub .tag { margin-left: auto; font-size: 10.5px; padding: 1px 7px }
.rub .tag::before { width: 5px; height: 5px }

.panneau { display: flex; flex-direction: column; min-width: 0 }
.ptete { display: flex; align-items: center; gap: 12px; padding: 16px 26px; border-bottom: 1px solid var(--line); flex-wrap: wrap }
.ptete .pastille { width: 36px; height: 36px }
.ptete .droite { margin-left: auto; display: flex; gap: 8px }
.pcorps { padding: 22px 26px 30px; flex: 1; max-width: 1000px; width: 100% }
.section { display: flex; flex-direction: column; gap: 16px; animation: entree .25s ease both }
.pied-fiche { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 2;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px);
  padding: 12px 26px calc(12px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; border-radius: 0 0 18px 0 }
.etat { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted) }
.etat .pt { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none }
.etat.sale { color: var(--or); font-weight: 600 } .etat.sale .pt { background: var(--or); animation: pouls 1.4s infinite }
.pied-fiche .actions { display: flex; gap: 8px }
.lecture { background: var(--bleu-soft); color: var(--bleu); border-radius: 10px; padding: 10px 14px; font-weight: 600 }

.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.champ > label, .lbl { font-weight: 700 }
.aide { color: var(--muted); font-size: 12.5px }
input[type=text], input[type=number], textarea, select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); width: 100%;
  transition: border-color .15s, box-shadow .15s }
input[type=text]:focus, input[type=number]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
input:disabled, textarea:disabled, select:disabled { opacity: .7; cursor: not-allowed }
textarea { min-height: 84px; resize: vertical; line-height: 1.55 }
textarea.long { min-height: 320px; font-size: 13.5px }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 420px }
.bloc { background: var(--surface-2); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.bloc-titre { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; flex-wrap: wrap }
.bloc-titre .pastille { width: 30px; height: 30px; border-radius: 9px } .bloc-titre .pastille svg.i { width: 16px; height: 16px }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }

/* segments (boutons radio) */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; flex-wrap: wrap; align-self: flex-start }
.seg label { cursor: pointer }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg span { display: inline-flex; gap: 6px; align-items: center; padding: 7px 13px; font-weight: 600; border-radius: 8px; color: var(--muted); transition: all .15s }
.seg span svg.i { width: 15px; height: 15px }
.seg input:checked + span { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12) }
.seg input:focus-visible + span { outline: 2px solid var(--accent) }
.bloc .seg { background: var(--surface) } .bloc .seg input:checked + span { background: var(--accent-soft) }

/* voix */
.ab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.voix { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, box-shadow .2s; min-width: 0 }
.voix.joue { border-color: var(--teinte, var(--violet)); box-shadow: 0 0 0 4px var(--teinte-soft, var(--violet-soft)) }
.voix-tete { display: flex; align-items: center; gap: 12px }
.voix-tete input[type=text] { font-weight: 700; padding: 6px 10px }
.rond { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; flex: none }
.r-0 { background: linear-gradient(135deg, #b197fc, #7048e8) } .r-1 { background: linear-gradient(135deg, #74c0fc, #1c7ed6) }
.r-2 { background: linear-gradient(135deg, #63e6be, #0c8a63) } .r-3 { background: linear-gradient(135deg, #ffa8a8, #e03131) }
.onde { display: flex; align-items: center; gap: 3px; height: 30px; min-width: 0 }
.onde i { flex: 1; max-width: 5px; border-radius: 3px; background: var(--teinte, var(--violet)); opacity: .35; height: 30% }
.voix.joue .onde i { opacity: 1; animation: onde .9s ease-in-out infinite }
@keyframes onde { 0%, 100% { height: 20% } 50% { height: 100% } }
.ecoute { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--teinte, var(--violet)); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: transform .12s }
.ecoute:hover { transform: scale(1.07) }
.ecoute:disabled { opacity: .35; cursor: not-allowed; transform: none }
.ecoute svg { width: 15px; height: 15px; fill: currentColor; stroke: none }
.regle { display: grid; grid-template-columns: 74px 1fr 56px; align-items: center; gap: 10px }
.regle > span:first-child { color: var(--muted); font-size: 12.5px; font-weight: 600 }
.regle output { font-family: var(--mono); font-size: 12.5px; text-align: right; font-weight: 500 }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; cursor: pointer; margin: 8px 0;
  background: linear-gradient(90deg, var(--c, var(--accent)) var(--pc, 50%), var(--off-soft) var(--pc, 50%)) }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--accent)); box-shadow: 0 1px 4px rgba(0,0,0,.25) }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--accent)) }
.partage { display: flex; height: 10px; border-radius: 99px; overflow: hidden }
.partage i { display: block; height: 100%; transition: width .2s }

/* interrupteurs */
.inter { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 14px 16px; border: 1px solid transparent; transition: border-color .2s, background .2s }
.inter.actif { border-color: var(--accent); background: var(--accent-soft) }
.inter.blanc { background: var(--surface); border-color: var(--line) }
.inter.blanc.actif { border-color: var(--accent); background: var(--accent-soft) }
.inter .pastille { width: 38px; height: 38px }
.inter .txt { flex: 1; min-width: 0 }
.inter .txt b { display: block }
.inter .txt .aide b { display: inline }
.sw { position: relative; width: 44px; height: 26px; flex: none }
.sw input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1 }
.sw span { position: absolute; inset: 0; background: var(--off-soft); border: 1px solid var(--line); border-radius: 99px; transition: background .2s }
.sw span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s cubic-bezier(.3,1.4,.6,1) }
.sw input:checked + span { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent }
.sw input:checked + span::after { transform: translateX(18px) }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px }
.sw input:disabled { cursor: not-allowed }

/* actions IA */
.outils { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.outil { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); transition: transform .15s, box-shadow .15s }
.outil:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.outil .haut { display: flex; align-items: center; gap: 12px }
.outil .haut b { flex: 1; min-width: 0 }
.outil .pastille { width: 36px; height: 36px; border-radius: 10px }

/* script */
.vars { display: flex; gap: 6px; flex-wrap: wrap; align-items: center }
.var { font-family: var(--mono); font-size: 12px; background: var(--bleu-soft); color: var(--bleu); border: 0; border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: transform .12s }
.var:hover { transform: translateY(-1px) }
.apercu-tel { background: var(--surface-2); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.bulle { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere }
.bulle.ia { background: linear-gradient(135deg, #9775fa, #7048e8); color: #fff; border-bottom-left-radius: 4px }
.bulle.moi { background: var(--surface); border: 1px solid var(--line); align-self: flex-end; border-bottom-right-radius: 4px }
.bulle small { display: block; opacity: .8; font-size: 11px; margin-bottom: 2px; font-weight: 700 }
.bulle .outils-appel { font-size: 11.5px; opacity: .85; margin-top: 4px; font-family: var(--mono) }
.evt { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 3px 12px; max-width: 90%; overflow-wrap: anywhere }
.compteur { font-family: var(--mono); font-size: 11.5px; color: var(--muted); align-self: flex-end }

/* semaine */
.semaine { display: grid; grid-template-columns: 44px repeat(13, minmax(0, 1fr)); gap: 4px; font-size: 11.5px; align-items: center; user-select: none; touch-action: none }
.semaine .h { color: var(--muted); text-align: center; font-family: var(--mono); font-size: 10.5px }
.semaine .j { color: var(--muted); font-weight: 700 }
.semaine .c { height: 26px; border-radius: 6px; background: var(--off-soft); cursor: pointer; border: 0; padding: 0; transition: transform .1s, background .15s }
.semaine .c:hover { transform: scale(1.08) }
.semaine .c.on { background: linear-gradient(180deg, var(--corail), color-mix(in srgb, var(--corail) 75%, #000)) }
.semaine.ro .c { cursor: default } .semaine.ro .c:hover { transform: none }
.legende { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted) }
.legende b { color: var(--ink) }
.carre { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px }

/* puces */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; background: var(--surface); font-weight: 600; transition: all .15s }
.chip svg.i { width: 14px; height: 14px }
label.chipbox { cursor: pointer }
label.chipbox input { position: absolute; opacity: 0; pointer-events: none }
label.chipbox span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; background: var(--surface); font-weight: 600; transition: all .15s }
label.chipbox span svg.i { width: 14px; height: 14px }
label.chipbox input:checked + span { background: var(--sarcelle-soft); color: var(--sarcelle); border-color: transparent }
label.chipbox input:focus-visible + span { outline: 2px solid var(--accent) }
.chip.non { background: var(--danger-soft); color: var(--danger); border-color: transparent }
.chip.non button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-weight: 800; font-size: 15px; line-height: 1 }
.ajout { display: inline-flex; gap: 6px } .ajout input { width: 180px; padding: 6px 10px; border-radius: 99px }

.entonnoir { display: flex; flex-direction: column; gap: 8px }
.etage { display: grid; grid-template-columns: 170px 1fr 48px; gap: 12px; align-items: center; font-size: 13px }
.etage .barre { height: 26px; border-radius: 8px; background: var(--off-soft); overflow: hidden }
.etage .barre i { display: block; height: 100%; border-radius: 8px; animation: pousse .7s cubic-bezier(.2,.8,.2,1) both }
@keyframes pousse { from { width: 0 !important } }
.etage b { font-variant-numeric: tabular-nums; text-align: right }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.kpi { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s; min-width: 0 }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.kpi .pastille { width: 34px; height: 34px }
.kpi .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1 }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600 }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center }
.duel .cote { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: center; background: var(--surface) }
.duel .cote.gagne { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.duel .vs { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 12px }
.vide { text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 16px; padding: 30px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px }
.vide b { color: var(--ink); font-size: 15px }
.vide .pastille { width: 54px; height: 54px; border-radius: 16px } .vide .pastille svg.i { width: 26px; height: 26px }

.versions { list-style: none; margin: 0; padding: 0 }
.versions li { display: flex; gap: 14px; align-items: center; padding: 12px 0 12px 30px; position: relative; flex-wrap: wrap }
.versions li::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--line) }
.versions li::after { content: ""; position: absolute; left: 2px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--off); box-shadow: 0 0 0 4px var(--off-soft) }
.versions li.enligne::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft) }
.versions li.brouillon::after { background: var(--or); box-shadow: 0 0 0 4px var(--or-soft) }
.versions li .droite { margin-left: auto }
pre.ecart { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; overflow: auto; max-height: 360px; margin: 0 }
pre.ecart .plus { color: var(--accent) } pre.ecart .moins { color: var(--danger) }
details.avance summary { cursor: pointer; font-weight: 700; padding: 6px 0 }

/* tableaux (écoute) */
.tablewrap { overflow-x: auto }
table.liste { width: 100%; border-collapse: collapse; min-width: 640px }
table.liste th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line) }
table.liste td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle }
table.liste tr.lien { cursor: pointer } table.liste tr.lien:hover td { background: var(--surface-2) }
table.liste a { text-decoration: none; font-weight: 600 }
.num { font-variant-numeric: tabular-nums }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
audio { width: 100%; border-radius: 12px }
.transcription { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: 18px; padding: 16px }

/* direct, qualité, écoute, analyse (27/10 soir) */
.pill.live { background: var(--danger-soft); color: var(--danger) }
.pill.live::before { animation: pouls 1s ease-in-out infinite }
.live-nav { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #e03131; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center; animation: pouls 1.2s infinite }
.live-nav + .compte { margin-left: 6px }
.note { display: inline-flex; padding: 2px 9px; border-radius: 99px; font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums }
.note.n-ok { background: var(--accent-soft); color: var(--accent) } .note.n-moyen { background: var(--or-soft); color: var(--or) }
.note.n-ko { background: var(--danger-soft); color: var(--danger) }
.liste-cq { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px }
.bulle.cliquable { cursor: pointer; transition: transform .12s, box-shadow .15s }
.bulle.cliquable:hover { transform: translateX(2px); box-shadow: var(--shadow) }
.bulle.lecture { outline: 3px solid var(--or); outline-offset: 2px }
.filtres select { width: auto; padding: 7px 10px; font-size: 13px }
svg.barres { width: 100%; min-width: 420px; height: auto; display: block }
svg.barres .b-appels { fill: var(--bleu) } svg.barres .b-rdv { fill: var(--accent) }
svg.barres .grille-l { stroke: var(--line); stroke-width: 1 } svg.barres .etiq { fill: var(--muted); font-size: 9px; font-family: var(--mono) }

/* connexion */
.connexion { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--side-2), var(--side-1)) }
.connexion .boite { background: var(--surface); border-radius: 20px; padding: 32px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; box-shadow: var(--shadow-up) }
.connexion .logo { width: 56px; height: 56px; border-radius: 16px } .connexion .logo svg { width: 30px; height: 30px }

/* modale + toast */
.voile { position: fixed; inset: 0; background: rgba(5, 15, 10, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 30; padding: 16px; animation: fondu .2s ease both }
@keyframes fondu { from { opacity: 0 } }
.modale { background: var(--surface); border-radius: 20px; max-width: 460px; width: 100%; padding: 24px; box-shadow: var(--shadow-up); display: flex; flex-direction: column; gap: 14px; animation: pop .25s cubic-bezier(.2,1.3,.5,1) both; max-height: calc(100% - 32px); overflow: auto }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px) } }
.modale ul { margin: 0; padding-left: 18px; color: var(--muted) }
.modale .bas { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap }
.alerte { background: var(--or-soft); color: var(--or); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13px }
.sonne { width: 76px; height: 76px; border-radius: 50%; margin: 6px auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); position: relative }
.sonne svg.i { width: 32px; height: 32px; animation: sonnerie 1s ease-in-out infinite }
.sonne::before, .sonne::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent-2); animation: onde-ext 1.8s ease-out infinite }
.sonne::after { animation-delay: .9s }
@keyframes onde-ext { from { transform: scale(1); opacity: .8 } to { transform: scale(1.8); opacity: 0 } }
@keyframes sonnerie { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(-14deg) } 40% { transform: rotate(14deg) } 60% { transform: rotate(-8deg) } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 12px; font-weight: 600; z-index: 40; max-width: calc(100% - 32px); box-shadow: var(--shadow-up);
  animation: monte .3s cubic-bezier(.2,1.3,.5,1) both }
.toast svg.i { color: var(--accent-2) } .toast.ko svg.i { color: var(--danger) }
@keyframes monte { from { opacity: 0; transform: translate(-50%, 14px) } }

/* mobile */
@media (max-width: 1100px) { .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)) } .cartes { grid-template-columns: 1fr } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr }
  .appnav { flex-direction: row; overflow-x: auto; padding: 10px 16px; position: static; height: auto }
  .appnav .marque, .moi { display: none }
  .appnav a.nav { white-space: nowrap } .appnav a.nav.on::before { display: none }
  .main { padding: 10px }
  .vue { min-height: 0 }
  .fiche { grid-template-columns: 1fr }
  .rubriques { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; gap: 4px }
  .rubriques .groupe, .rubriques .retour, .carte-agent { width: 100% }
  .rub { width: auto }
  .grille2, .grille3, .outils, .ab { grid-template-columns: 1fr }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .duel { grid-template-columns: 1fr } .duel .vs { margin: 0 auto }
  .pcorps, .ptete, .pied-fiche { padding-left: 16px; padding-right: 16px }
  .entete, .tuiles, .cartes { padding-left: 16px; padding-right: 16px } .annonce { margin-left: 16px; margin-right: 16px }
  .etage { grid-template-columns: 110px 1fr 40px }
}
@media (max-width: 520px) { .tuiles { grid-template-columns: 1fr } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }
