/* AMI Care · wireframes v2. Base WhatsApp, sobre. Couleurs réservées :
   brouillon (violet clair), liseré de l'agent (jaune), alertes (rouge), action principale (vert). */
:root {
  --page: #dcdcdc; --bg: #ffffff; --panel: #f0f2f5; --chat: #efeae2; --in: #ffffff; --out: #e2e6ea;
  --ink: #111b21; --muted: #667781; --line: #e3e6e8; --fill: #eef0f2;
  --draft: #ece6fb; --draft-line: #7c5cd6; --agent: #f5c51e; --alert: #d23b3b; --alert-bg: #fdeaea; --primary: #128c5e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--page); }
body { font-family: "Liberation Sans", Arial, sans-serif; color: var(--ink); font-size: 15px; line-height: 1.35; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

.app { background: var(--bg); display: flex; flex-direction: column; }
.m { width: 390px; min-height: 844px; }
.d { width: 1440px; height: 900px; flex-direction: row; overflow: hidden; }
.statusbar { height: 26px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel); }

/* en-têtes */
.hd { min-height: 60px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; background: var(--panel); border-bottom: 1px solid var(--line); }
.hd .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.hd .name { font-weight: 700; font-size: 17px; }
.hd .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd h1 { margin: 0 0 0 12px; font-size: 22px; flex: 1; }
.ib { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; font-size: 20px; color: var(--muted); }
.av { width: 40px; height: 40px; border-radius: 20px; background: #cfd4d8; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #3b4a54; flex-shrink: 0; }
.av.s { width: 34px; height: 34px; font-size: 12px; }
.av.l { width: 84px; height: 84px; border-radius: 42px; font-size: 26px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--agent); margin-right: 5px; vertical-align: 1px; }

/* fil */
.chat { flex: 1; background: var(--chat); padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.chat.agent { box-shadow: inset 0 0 0 4px var(--agent); }
.day { align-self: center; background: #fff; color: var(--muted); font-size: 12px; border-radius: 8px; padding: 3px 10px; margin: 6px 0; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.ev { align-self: center; background: #fbfbfa; color: var(--muted); font-size: 12.5px; border-radius: 8px; padding: 4px 10px; text-align: center; box-shadow: 0 1px 0 rgba(0,0,0,.06); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ev a { color: var(--primary); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.d .ev a { min-height: 0; }
.bub { max-width: 80%; border-radius: 10px; padding: 6px 9px 5px; font-size: 15px; box-shadow: 0 1px 0 rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 2px; }
.bub.in { align-self: flex-start; background: var(--in); border-top-left-radius: 2px; }
.bub.out { align-self: flex-end; background: var(--out); border-top-right-radius: 2px; }
.bub .by { font-size: 12px; font-weight: 700; color: var(--muted); }
.bub .meta { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.bub .meta .tr { margin-right: auto; font-style: italic; }
.tk { letter-spacing: -3px; margin-right: 3px; }
.tk.read { color: #3b4a54; font-weight: 700; }
.note { align-self: stretch; background: #f7f7f5; border: 1px dashed #b9bfc4; border-radius: 10px; padding: 6px 10px; font-size: 14px; color: #3b4a54; }
.note b { font-size: 12px; color: var(--muted); display: block; }

/* brouillon */
.bub.draft { align-self: flex-end; background: var(--draft); border: 2px dashed var(--draft-line); border-top-right-radius: 2px; max-width: 88%; gap: 6px; }
.dl { font-size: 12px; font-weight: 700; color: var(--draft-line); display: flex; justify-content: space-between; gap: 8px; }
.quote { background: rgba(255,255,255,.65); border-left: 3px solid #9aa4ab; border-radius: 6px; padding: 4px 8px; font-size: 13px; color: #3b4a54; }
.quote b { display: block; font-size: 12px; color: var(--muted); }
.dact { display: flex; gap: 8px; margin-top: 2px; }
.dact .btn { flex: 1; }
.more { font-size: 12.5px; color: var(--draft-line); font-weight: 700; min-height: 32px; display: inline-flex; align-items: center; }
.m .more { min-height: 44px; }

/* saisie */
.bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px; background: var(--panel); }
.bar .in { flex: 1; min-height: 44px; background: #fff; border-radius: 22px; display: flex; align-items: center; padding: 0 16px; color: var(--muted); font-size: 15px; }
.bar .send { width: 48px; height: 48px; border-radius: 24px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tabs2 { display: flex; gap: 4px; padding: 6px 12px 0; background: var(--panel); }
.tabs2 span { font-size: 12.5px; padding: 6px 10px; border-radius: 8px 8px 0 0; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.m .tabs2 span { min-height: 44px; }
.tabs2 span.on { background: #fff; color: var(--ink); font-weight: 700; }
.handbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #fff; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.handbar a { margin-left: auto; color: var(--primary); font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.d .handbar a { min-height: 32px; }

/* boutons et éléments */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid #c9cfd3; background: #fff; font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.d .btn { min-height: 36px; font-size: 14px; border-radius: 18px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.alert { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn.off { background: var(--fill); color: #9aa4ab; border-color: var(--fill); }
.btn.flat { border-color: transparent; background: transparent; color: var(--primary); padding: 0 8px; }
.btn.block { width: 100%; }
.content { flex: 1; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.content.grey { background: var(--panel); }
.card { background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); }
.card.alert { border: 2px solid var(--alert); background: var(--alert-bg); }
.card.draftc { border: 2px dashed var(--draft-line); background: var(--draft); }
.k { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.big { font-size: 20px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.b { font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.row.sel { background: #f0f2f5; }
.row .mid { flex: 1; min-width: 0; }
.row .t { display: flex; justify-content: space-between; gap: 8px; }
.row .t b { font-size: 16px; }
.row .t span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row .p { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.row .p .x { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt { background: var(--primary); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.cnt.draft { background: var(--draft-line); }
.tag { font-size: 11.5px; border-radius: 6px; padding: 1px 6px; background: var(--fill); color: #3b4a54; white-space: nowrap; }
.tag.draft { background: var(--draft); color: var(--draft-line); font-weight: 700; }
.tag.alert { background: var(--alert-bg); color: var(--alert); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chipf { font-size: 14px; border-radius: 18px; padding: 0 14px; min-height: 36px; display: inline-flex; align-items: center; background: var(--fill); color: #3b4a54; }
.m .chipf { min-height: 44px; }
.chipf.on { background: #d9ede4; color: var(--primary); font-weight: 700; }
.li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.li .mid { flex: 1; min-width: 0; }
.li .r { color: var(--muted); font-size: 13px; }
.chev { color: #aab2b8; font-size: 20px; }
.tl { display: flex; flex-direction: column; gap: 0; }
.tl .e { display: flex; gap: 12px; }
.tl .e .d0 { width: 12px; display: flex; flex-direction: column; align-items: center; }
.tl .e .d0 i { width: 12px; height: 12px; border-radius: 6px; border: 2px solid #9aa4ab; background: #fff; margin-top: 4px; }
.tl .e .d0 u { flex: 1; width: 2px; background: #d5d9dc; }
.tl .e.on .d0 i { background: #3b4a54; border-color: #3b4a54; }
.tl .e .x { padding-bottom: 12px; }
.tl .e .x .w { font-size: 12px; color: var(--muted); }
.field { border: 1px solid #c9cfd3; border-radius: 12px; padding: 12px; font-size: 15px; min-height: 48px; background: #fff; }
.field.big { min-height: 120px; color: var(--muted); }
.toast { background: #3b4a54; color: #fff; border-radius: 10px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.toast a { margin-left: auto; color: #b8f0d6; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.d .toast a { min-height: 0; }
.tabbar { display: flex; border-top: 1px solid var(--line); background: #fff; }
.tabbar a { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tabbar a i { width: 24px; height: 20px; border-radius: 6px; background: #d5d9dc; display: block; }
.tabbar a.on { color: var(--ink); font-weight: 700; }
.tabbar a.on i { background: #3b4a54; }
.tabbar a em { font-style: normal; font-size: 10px; background: var(--draft-line); color: #fff; border-radius: 8px; padding: 0 5px; margin-left: 3px; }
.sheet { background: #fff; border-radius: 18px 18px 0 0; padding: 10px 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.grab { width: 40px; height: 5px; background: #d5d9dc; border-radius: 3px; align-self: center; }
.dim { position: relative; }
.dim::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.ph { background: repeating-linear-gradient(45deg, #eceff1, #eceff1 8px, #e1e5e8 8px, #e1e5e8 16px); border-radius: 10px; display: flex; align-items: flex-end; padding: 6px; font-size: 11px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check i { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #9aa4ab; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.check i.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.env { background: repeating-linear-gradient(135deg, #3b4a54, #3b4a54 10px, #2f3b43 10px, #2f3b43 20px); color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px; letter-spacing: .02em; }

/* bureau */
.rail { width: 64px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; flex-shrink: 0; }
.rail a { width: 48px; min-height: 48px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9.5px; color: var(--muted); position: relative; }
.rail a i { width: 22px; height: 18px; border-radius: 5px; background: #cfd4d8; display: block; }
.rail a.on { background: #dfe3e6; color: var(--ink); font-weight: 700; }
.rail a.on i { background: #3b4a54; }
.rail a em { position: absolute; top: 2px; right: 2px; font-style: normal; font-size: 9px; background: var(--draft-line); color: #fff; border-radius: 7px; padding: 0 4px; }
.rail .me { margin-top: auto; }
.list { width: 400px; border-right: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; background: #fff; }
.list .top { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.list .top h2 { margin: 0; font-size: 22px; }
.search { height: 36px; border-radius: 10px; background: var(--panel); display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 14px; }
.pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.drawer { width: 380px; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.drawer .dh { min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer .db { padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.center { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--panel); }
.center .in { padding: 24px 32px; display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.center h2 { margin: 0; font-size: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi .v { font-size: 30px; font-weight: 700; }
.bar2 { height: 10px; border-radius: 5px; background: #e1e5e8; overflow: hidden; }
.bar2 i { display: block; height: 100%; background: #3b4a54; }
.kan { display: flex; gap: 12px; }
.kcol { width: 250px; flex-shrink: 0; background: #e9ecef; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcol h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; padding: 2px 4px; }
.kc { background: #fff; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border: 1px solid transparent; }
.kc.sel { border-color: #3b4a54; }
.kc .n { font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kc .n span { font-size: 12px; color: var(--muted); font-weight: 400; }
.kc .s { font-size: 13px; color: var(--muted); }
.agentmark { display: inline-block; width: 10px; height: 10px; border-radius: 5px; background: var(--agent); }
.humanmark { display: inline-block; width: 10px; height: 10px; border-radius: 5px; border: 2px solid #3b4a54; }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--draft-line); }
.step span { width: 20px; height: 20px; border-radius: 10px; background: var(--draft-line); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.help { background: var(--fill); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: #3b4a54; }
.card.warn { border: 2px solid #3b4a54; background: #fff; }
.tag.dark { background: #3b4a54; color: #fff; font-weight: 700; }
