:root{--bg:#f0f2f5;--panel:#fff;--border:#dadde1;--text:#1c1e21;--muted:#65676b;--blue:#1877f2;--blue-d:#166fe5;--blue-l:#e7f3ff;--green:#31a24c;--red:#e41e3f;--orange:#f7b928;--radius:8px;--shadow:0 1px 2px rgba(0,0,0,.1),0 2px 8px rgba(0,0,0,.05)}
*{box-sizing:border-box}html,body{height:100%;margin:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:13px;color:var(--text);background:var(--bg);display:flex;flex-direction:column}
a{color:var(--blue);text-decoration:none}
button,select,input,textarea{font:inherit;color:inherit}
.topbar{height:52px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 16px;gap:16px;flex-shrink:0}
.brand{font-weight:700;font-size:16px;color:var(--blue);display:flex;align-items:center;gap:8px}
.brand span{background:var(--blue);color:#fff;border-radius:6px;padding:2px 7px;font-size:12px}
.topbar .kpis{display:flex;gap:18px;margin-left:auto;color:var(--muted)}
.topbar .kpis b{color:var(--text)}
.layout{display:flex;flex:1;min-height:0}
.sidebar{width:220px;background:#fff;border-right:1px solid var(--border);padding:12px 8px;flex-shrink:0;display:flex;flex-direction:column;gap:2px}
.sidebar a{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;border-radius:var(--radius);color:var(--text);font-weight:500}
.sidebar a:hover{background:#f2f2f2}.sidebar a.active{background:var(--blue-l);color:var(--blue)}
.sidebar .badge{background:#e4e6eb;border-radius:10px;padding:1px 8px;font-size:11px;color:var(--muted)}
.sidebar a.active .badge{background:var(--blue);color:#fff}
.sidebar .sep{height:1px;background:var(--border);margin:8px 4px}
.sidebar .foot{margin-top:auto;color:var(--muted);font-size:11px;padding:8px 12px}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.toolbar{display:flex;align-items:center;gap:8px;padding:10px 16px;background:#fff;border-bottom:1px solid var(--border);flex-wrap:wrap}
.toolbar h1{font-size:18px;margin:0 12px 0 0;font-weight:700}
.tabs{display:flex;gap:2px;background:#fff;border-bottom:1px solid var(--border);padding:0 16px;overflow-x:auto}
.tabs button{border:0;background:none;padding:10px 12px;border-bottom:3px solid transparent;color:var(--muted);font-weight:600;cursor:pointer;white-space:nowrap}
.tabs button.active{color:var(--blue);border-bottom-color:var(--blue)}
.tabs button .n{margin-left:6px;background:#e4e6eb;border-radius:10px;padding:0 7px;font-size:11px;color:var(--muted)}
.content{flex:1;min-height:0;overflow:auto;padding:12px 16px;display:flex;flex-direction:column;gap:12px}
.card{background:var(--panel);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px}
.card h3{margin:0 0 10px;font-size:14px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.btn{border:1px solid var(--border);background:#fff;border-radius:6px;padding:6px 12px;cursor:pointer;font-weight:600;display:inline-flex;align-items:center;gap:6px}
.btn:hover{background:#f2f2f2}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.primary:hover{background:var(--blue-d)}
.btn.danger{color:var(--red)}.btn.sm{padding:3px 8px;font-size:12px}.btn.ok{background:var(--green);border-color:var(--green);color:#fff}
input[type=text],input[type=date],input[type=number],select,textarea{border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:#fff}
input[type=text].search{width:260px}
textarea{width:100%;min-height:90px;resize:vertical}
.bulkbar{display:none;align-items:center;gap:8px;padding:8px 16px;background:var(--blue-l);border-bottom:1px solid #c7e0ff}
.bulkbar.on{display:flex;flex-wrap:wrap}
.bulkbar b{color:var(--blue)}
.tablewrap{flex:1;min-height:300px}
.tabulator{border:0;border-radius:var(--radius);box-shadow:var(--shadow);font-size:12.5px;background:#fff}
.tabulator .tabulator-header{background:#f5f6f7;border-bottom:1px solid var(--border);font-weight:600;color:var(--muted)}
.tabulator .tabulator-header .tabulator-col{background:#f5f6f7;border-right:1px solid #eceef0}
.tabulator-row{border-bottom:1px solid #eceef0;min-height:34px}
.tabulator-row.tabulator-selected{background:var(--blue-l)!important}
.tabulator-row:hover{background:#f7f8fa}
.tabulator .tabulator-cell{padding:7px 8px;border-right:1px solid #f0f2f5}
.tabulator .tabulator-footer{background:#fff;border-top:1px solid var(--border)}
.pill{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;white-space:nowrap}
.pill.a_prospecter{background:#e4e6eb;color:#444}.pill.prospecte{background:#e7f3ff;color:var(--blue)}.pill.en_discussion{background:#fff3cd;color:#8a6d00}
.pill.en_attente{background:#f3e8ff;color:#6b21a8}.pill.rdv{background:#d1fae5;color:#065f46}.pill.gagne{background:var(--green);color:#fff}
.pill.perdu{background:#fde8ec;color:var(--red)}.pill.sans_reponse{background:#f0f0f0;color:#888}
.pill.mail{background:#e7f3ff;color:var(--blue)}.pill.whatsapp{background:#dcfce7;color:#15803d}.pill.appel{background:#fef3c7;color:#92400e}.pill.sms{background:#ede9fe;color:#5b21b6}
.muted{color:var(--muted)}.right{margin-left:auto}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.drawer{position:fixed;top:0;right:-560px;width:560px;max-width:95vw;height:100%;background:#fff;box-shadow:-4px 0 20px rgba(0,0,0,.15);transition:right .2s;z-index:50;display:flex;flex-direction:column}
.drawer.open{right:0}
.drawer header{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px}
.drawer header h2{font-size:16px;margin:0}
.drawer .body{padding:14px 16px;overflow:auto;flex:1;display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:3px}.field label{font-size:11px;color:var(--muted);font-weight:600;text-transform:uppercase}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.timeline{display:flex;flex-direction:column;gap:8px}
.tl{border-left:3px solid var(--border);padding:4px 10px}.tl.in{border-color:var(--green)}.tl.out{border-color:var(--blue)}.tl .when{font-size:11px;color:var(--muted)}
.tl pre{white-space:pre-wrap;margin:4px 0 0;font:inherit;background:#f7f8fa;padding:8px;border-radius:6px}
.msg{border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;background:#fff}
.msg.valide{border-color:#9ad0b0}.msg.envoye{opacity:.55}.msg.echec{border-color:var(--red)}
.msg .head{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.msg pre{white-space:pre-wrap;font:inherit;margin:0;max-height:160px;overflow:auto;background:#f7f8fa;padding:8px;border-radius:6px}
.msg textarea{min-height:140px}
.callcard{display:grid;grid-template-columns:1.2fr 1fr;gap:14px}
.callcard .big{font-size:22px;font-weight:700}
.callcard .num{font-size:20px;font-family:ui-monospace,Menlo,monospace}
.outcomes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.outcomes .btn{justify-content:center;padding:12px}
.script{background:#f7f8fa;border-radius:6px;padding:10px;white-space:pre-wrap;font-size:13px;line-height:1.45}
.alert{background:#fff4e5;border:1px solid #ffd8a8;color:#7a4b00;padding:8px 12px;border-radius:6px}
.alert.red{background:#fde8ec;border-color:#f5b5c0;color:#8a1226}
.kv{display:grid;grid-template-columns:auto 1fr;gap:4px 12px}
.toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#1c1e21;color:#fff;padding:10px 16px;border-radius:8px;opacity:0;transition:opacity .2s;z-index:99}
.toast.on{opacity:1}
table.simple{width:100%;border-collapse:collapse}table.simple th,table.simple td{padding:6px 8px;border-bottom:1px solid #eceef0;text-align:left}
table.simple th{font-size:11px;color:var(--muted);text-transform:uppercase}
.stat{display:flex;flex-direction:column}.stat b{font-size:22px}.stat small{color:var(--muted)}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
.progress{height:6px;background:#e4e6eb;border-radius:3px;overflow:hidden}.progress i{display:block;height:100%;background:var(--blue)}
.menu-btn{display:none;border:1px solid var(--border);background:#fff;border-radius:6px;padding:4px 9px;font-size:16px;cursor:pointer}
@media (max-width:900px){
  .menu-btn{display:inline-block}
  .sidebar{display:none;position:fixed;top:52px;left:0;bottom:0;width:240px;z-index:40;box-shadow:4px 0 20px rgba(0,0,0,.15)}
  .sidebar.open{display:flex}
  .topbar .kpis{display:none}
  .grid3,.callcard,.stats{grid-template-columns:1fr}.fields{grid-template-columns:1fr}.outcomes{grid-template-columns:repeat(2,1fr)}
  .content{padding:10px}.toolbar{padding:8px 10px}.toolbar h1{font-size:16px}
  input[type=text].search{width:100%}
  .callcard .big{font-size:19px}.callcard .num{font-size:17px}
  .msg pre,.script{font-size:12px}
  .drawer{width:100vw;max-width:100vw}
  .tabulator{font-size:12px}
  body{overflow-x:hidden}
}

.msg.bloque{border-color:var(--orange);background:#fffbf0}

/* ---- refonte du 26/10 : barre du haut, menu groupé, fenêtre maison, cockpit, agenda ---- */
.pill.proposition{background:#e0e7ff;color:#3730a3}
.topbar{gap:12px}
.topbar .kpis{gap:6px;align-items:center}
.kp{border:1px solid var(--border);background:#fff;border-radius:14px;padding:3px 10px;font-size:12px;color:var(--muted);cursor:pointer;white-space:nowrap}
.kp b{color:var(--text)}.kp:hover{background:#f2f2f2}
.kp.ok{background:#e9f7ee;border-color:#b7e1c4;color:#1d6b35}.kp.warn{background:#fff4e5;border-color:#ffd8a8;color:#7a4b00}.kp.bad{background:#fde8ec;border-color:#f5b5c0;color:#8a1226}
.kp.ok b,.kp.warn b,.kp.bad b{color:inherit}
.gsearch{position:relative;flex:1;max-width:420px;min-width:0}
.gsearch input{width:100%;border:1px solid var(--border);border-radius:18px;padding:6px 12px;background:#f0f2f5}
.gsearch input:focus{background:#fff;outline:2px solid var(--blue-l)}
.gsearch .res{display:none;position:absolute;top:36px;left:0;right:0;background:#fff;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);z-index:60;max-height:60vh;overflow:auto}
.gsearch .res.on{display:block}
.gsearch .res a{display:flex;gap:8px;align-items:center;padding:8px 12px;color:var(--text);border-bottom:1px solid #f0f2f5}
.gsearch .res a.sel,.gsearch .res a:hover{background:var(--blue-l)}
.sidebar .grp{font-size:10.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:10px 12px 4px}
.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:80;align-items:flex-start;justify-content:center;padding:8vh 12px}
.modal.on{display:flex}
.modal .box{background:#fff;border-radius:10px;box-shadow:0 10px 40px rgba(0,0,0,.25);width:500px;max-width:100%;max-height:84vh;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.modal .box h2{font-size:16px;margin:0}
.modal .box .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:4px}
.modal .box input[type=text],.modal .box input[type=date],.modal .box input[type=datetime-local],.modal .box select{width:100%}
.slots{display:flex;flex-wrap:wrap;gap:6px}
.slots .jour{width:100%;font-size:11px;color:var(--muted);font-weight:700;margin-top:4px}.slots .jour::first-letter{text-transform:uppercase}
.slot{border:1px solid var(--border);background:#fff;border-radius:6px;padding:5px 9px;cursor:pointer;font-size:12px}
.slot:hover{background:var(--blue-l)}.slot.on{background:var(--blue);border-color:var(--blue);color:#fff}
.cases{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}
.cases label{display:flex;gap:6px;align-items:center}
.rappel{background:#fde8ec;border:2px solid var(--red);border-radius:var(--radius);padding:10px 14px;color:#8a1226}
.rappel b.t{display:block;font-size:13px;letter-spacing:.08em;margin-bottom:4px}
.rappel ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:2px}
.rappel a{color:#8a1226;text-decoration:underline}
.cockpit{display:grid;grid-template-columns:1.25fr 1fr;gap:12px;align-items:start}
.rdvline{display:grid;grid-template-columns:64px 1fr;gap:2px 12px;padding:10px 0;border-bottom:1px solid #eceef0}
.rdvline:last-child{border-bottom:0}
.rdvline .h{font-size:20px;font-weight:700;color:var(--green);line-height:1.2}
.rdvline.passe .h{color:var(--muted)}
.rdvline .acts{grid-column:2;display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.tile{display:flex;align-items:center;gap:12px;padding:9px 6px;border-bottom:1px solid #eceef0;color:var(--text);cursor:pointer;border-radius:6px}
.tile:last-child{border-bottom:0}.tile:hover{background:#f7f8fa}
.tile .n{font-size:18px;font-weight:700;min-width:44px;text-align:right}
.tile .n.bad{color:var(--red)}.tile .n.warn{color:#b26a00}.tile .n.ok{color:var(--green)}
.tile .go{margin-left:auto;color:var(--muted)}
.retard{color:var(--red);font-weight:600}
table.lot{width:100%;border-collapse:collapse;font-size:12.5px}
table.lot th{font-size:11px;color:var(--muted);text-transform:uppercase;text-align:left;padding:6px 8px;border-bottom:1px solid var(--border);background:#fff}
table.lot td{padding:6px 8px;border-bottom:1px solid #f0f2f5;vertical-align:top}
table.lot tr.it{cursor:pointer}table.lot tr.it:hover{background:#f7f8fa}
table.lot tr.bloque{background:#fffbf0}
.filtres{display:flex;gap:4px;flex-wrap:wrap}
.filtres button{border:1px solid var(--border);background:#fff;border-radius:14px;padding:3px 10px;font-size:12px;cursor:pointer}
.filtres button.on{background:var(--blue);border-color:var(--blue);color:#fff}
.ag{display:grid;grid-template-columns:56px repeat(6,minmax(110px,1fr));background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.ag .hd{background:#f5f6f7;border-bottom:1px solid var(--border);padding:8px 4px;font-weight:600;font-size:12px;text-align:center}
.ag .hd.auj{background:var(--blue-l);color:var(--blue)}
.ag .hr{font-size:11px;color:var(--muted);padding:6px;text-align:right;border-top:1px solid #f0f2f5}
.ag .cell{border-top:1px solid #f0f2f5;border-left:1px solid #f0f2f5;padding:4px;min-height:42px;display:flex;flex-direction:column;gap:3px;min-width:0}
.ag .cell.demo{background:#fafbfc}
.ag .cell.auj{background:#f5faff}
.ev{border-radius:5px;padding:3px 6px;font-size:11.5px;cursor:pointer;border-left:3px solid;line-height:1.3;overflow:hidden;text-overflow:ellipsis}
.ev small{display:block;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ev.rdv{background:#d1fae5;border-color:#059669;color:#065f46}
.ev.rdv.clore{background:#fff3cd;border-color:#d39e00;color:#7a5a00}
.ev.rdv.initiative{background:#fce7f3;border-color:#db2777;color:#831843}
.ev.appel{background:#e7f3ff;border-color:var(--blue);color:#0b4a9e}
.ev.retard{background:#fde8ec;border-color:var(--red);color:#8a1226}
.ev.libre{background:none;border:1px dashed #c9ced6;color:var(--muted);text-align:center}
.ev.libre:hover{border-color:var(--blue);color:var(--blue)}
.ev.pris{background:repeating-linear-gradient(135deg,#eef0f3 0 6px,#e3e6eb 6px 12px);border-color:#8d96a2;color:#3d4652;cursor:pointer}
.legende{display:flex;gap:10px;flex-wrap:wrap;align-items:center;font-size:12px}
.legende .ev{cursor:default;display:inline-block}
.ag-liste{display:none}
@media (max-width:900px){
  .cockpit{grid-template-columns:1fr}
  .gsearch{max-width:none}
  .ag{display:none}.ag-liste{display:flex;flex-direction:column;gap:10px}
  .modal{padding:4vh 8px}
  .cases{grid-template-columns:1fr}
  table.lot .opt{display:none}
}

/* ---- Réponses en deux volets (26/10) ---- */
.inbox{display:grid;grid-template-columns:340px 1fr;gap:12px;align-items:start}
.ib-liste{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);max-height:calc(100vh - 150px);overflow:auto;position:sticky;top:0}
.ib-it{padding:10px 12px;border-bottom:1px solid #eceef0;cursor:pointer}
.ib-it:hover{background:#f7f8fa}.ib-it.on{background:var(--blue-l);box-shadow:inset 3px 0 0 var(--blue)}
.ib-nom{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}
.ib-age{margin-left:auto;font-size:11.5px;white-space:nowrap}
.ib-extrait{color:var(--muted);font-size:12px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ib-carte{display:flex;flex-direction:column;gap:10px;padding:16px 18px}
.ib-section{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-top:8px}
.fil{display:flex;flex-direction:column;gap:8px}
.bulle{max-width:88%;border-radius:10px;padding:8px 12px;font-size:13px;line-height:1.5}
.bulle.out{align-self:flex-end;background:#e7f3ff}
.bulle.in{align-self:flex-start;background:#f0f2f5}
.bulle.courante{background:#fff4e5;border:1px solid #ffd8a8}
.bulle-tete{font-size:11px;color:var(--muted);margin-bottom:4px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.bulle-texte{white-space:pre-wrap;word-break:break-word}
.seg{display:flex;flex-wrap:wrap;gap:6px}
.seg button{border:1px solid var(--border);background:#fff;border-radius:6px;padding:5px 10px;cursor:pointer;font-size:12.5px}
.seg button:hover{background:#f2f2f2}.seg button.on{background:var(--blue);border-color:var(--blue);color:#fff}
.ib-brouillon{font-size:13.5px;line-height:1.55;padding:10px 12px;min-height:180px;resize:vertical}
.ib-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:6px;padding-top:12px;border-top:1px solid #eceef0}
.autonomie{font-size:12.5px;display:flex;gap:6px;align-items:center}
/* espacements : une rangée de boutons ne colle jamais au champ au-dessus (Appels, fiche, fenêtres) */
.field + .row,.field + .btn,textarea + .row,.script + .field{margin-top:12px}
@media (max-width:900px){ .inbox{grid-template-columns:1fr} .ib-liste{position:static;max-height:40vh} .bulle{max-width:100%} .ib-nom{max-width:none} }

/* ---- Agenda : vues Calendrier · Tableau · Board, à la Notion (27/10) ---- */
/* bug d'affichage du 27/10 : la grille (overflow:hidden) rétrécissait pour tenir dans l'écran et écrasait les appels d'une même heure ; elle garde sa hauteur, la page défile */
.ag-c > *{flex-shrink:0}
.ag .cell > *{flex-shrink:0}
.vues{display:flex;gap:2px}
.vues button{border:0;background:none;padding:6px 10px;border-radius:6px 6px 0 0;cursor:pointer;color:var(--muted);font-weight:600;white-space:nowrap}
.vues button:hover{background:#f2f2f2}.vues button.on{color:var(--text);box-shadow:inset 0 -2px 0 var(--text)}
.ag-outils{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ag-outils input[type=search]{border:1px solid var(--border);border-radius:16px;padding:5px 12px;width:190px;background:#f0f2f5}
.ag-outils input[type=search]:focus{background:#fff;outline:2px solid var(--blue-l)}
.dd{position:relative}
.dd-menu{display:none;position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);z-index:50;min-width:200px;padding:4px;flex-direction:column}
.dd.on .dd-menu{display:flex}
.dd-menu button{text-align:left;border:0;background:none;padding:8px 10px;border-radius:6px;cursor:pointer;white-space:nowrap}.dd-menu button:hover{background:var(--blue-l)}
.tag{display:inline-block;border-radius:4px;padding:1px 6px;font-size:11px;font-weight:600;white-space:nowrap}
.tag.vert{background:#dcfce7;color:#166534}.tag.bleu{background:#e0edff;color:#1e4fa8}.tag.rouge{background:#fde2e6;color:#9f1239}
.tag.orange{background:#ffedd5;color:#9a3412}.tag.violet{background:#ede9fe;color:#5b21b6}.tag.gris{background:#eceef1;color:#4b5563}.tag.rose{background:#fce7f3;color:#9d174d}
.etat{display:inline-flex;align-items:center;gap:6px;border-radius:12px;padding:2px 10px;font-size:12px;font-weight:600;white-space:nowrap}
.etat::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.etat.retard{background:#fde2e6;color:#b4232f}.etat.auj{background:#e0edff;color:#1d5fd1}.etat.avenir{background:#eceef1;color:#4b5563}
.etat.clore{background:#ffedd5;color:#b45309}.etat.fait{background:#dcfce7;color:#15803d}
.ag-tab{padding:0;overflow-x:auto}
table.ag-table th[data-tri]{cursor:pointer;user-select:none}table.ag-table th[data-tri]:hover{color:var(--text)}
table.ag-table td.retard{color:var(--red);font-weight:600}
.nowrap{white-space:nowrap}
.board-wrap{overflow-x:auto;padding-bottom:6px}
.board{display:grid;grid-template-columns:repeat(5,minmax(220px,1fr));gap:0 10px;min-width:1150px;align-items:start}
.bd-hd{display:flex;align-items:center;gap:8px;padding:4px 6px 6px}
.bd-grp{grid-column:1/-1;display:flex;align-items:center;gap:8px;padding:12px 2px 6px}
.bd-tog{border:0;background:none;cursor:pointer;color:var(--muted);font-size:12px;padding:2px 6px;border-radius:4px}.bd-tog:hover{background:#e9ebee;color:var(--text)}
.bd-cell{border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:6px;min-height:52px;min-width:0}
.bd-cell.retard{background:#fdf2f3}.bd-cell.auj{background:#f1f6fe}.bd-cell.avenir{background:#f6f7f8}.bd-cell.clore{background:#fff7ed}.bd-cell.fait{background:#f0fbf3}
.bd-card{background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:8px 10px;box-shadow:0 1px 2px rgba(0,0,0,.05);cursor:pointer;display:flex;flex-direction:column;gap:3px;min-width:0}
.bd-card:hover{border-color:#c9ced6;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.bd-card b{font-size:12.5px;overflow-wrap:anywhere}
.bd-meta{font-size:11.5px;color:var(--muted)}.bd-meta.retard{color:var(--red);font-weight:600}
.bd-det{font-size:11.5px;color:#4b5563;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.bd-tags{display:flex;gap:4px;flex-wrap:wrap}
.bd-acts{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.bd-acts button{border:1px solid var(--border);background:#fff;border-radius:5px;padding:2px 7px;font-size:11px;cursor:pointer}.bd-acts button:hover{background:var(--blue-l)}
.bd-new{border:0;background:none;color:var(--muted);text-align:left;padding:4px 6px;border-radius:6px;cursor:pointer;font-size:12px}.bd-new:hover{background:rgba(0,0,0,.05);color:var(--text)}
@media (max-width:900px){
  .ag-outils{width:100%}.ag-outils.right{margin-left:0}
  .ag-outils input[type=search]{flex:1;min-width:0;width:auto}
}

/* ---- Écrans pliables (07/11) : ouvert presque carré, ouvert large, fermé étroit. Plages de largeur et proportions, jamais un appareil. ---- */
/* défaut prouvé de 561 à 900 px (tablette 768 comprise) : la fiche fermée (100vw de large, décalée de 560 px seulement) masquait la droite de l'écran */
@media (max-width:900px){ .drawer{right:calc(-100vw - 40px)} }
/* ouvert, au doigt : portrait 600-743 px (Fold, Duo ; sous la largeur des iPad) ou paysage 760-900 px. Audit du 08/11 : la proportion seule prenait les iPad dans Safari et les fenêtres de bureau réduites */
@media (pointer:coarse) and (min-width:600px) and (max-width:743px) and (min-height:480px) and (min-aspect-ratio:7/10),
       (pointer:coarse) and (min-width:760px) and (max-width:900px) and (min-height:480px) and (orientation:landscape){
  .content{padding:12px 16px}.toolbar{padding:10px 16px}
  .stats{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
  .grid3{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
  .fields,.cases{grid-template-columns:1fr 1fr}
  .outcomes{grid-template-columns:repeat(3,1fr)}
  .drawer{width:560px;max-width:92vw}.drawer:not(.open){right:-600px}
  .modal{padding:6vh 16px}
  .bulle{max-width:88%}
}
/* paysage 760-900 px : deux volets ; la carte d'appel reste sur une colonne (audit : numéros rognés à deux colonnes) */
@media (pointer:coarse) and (min-width:760px) and (max-width:900px) and (min-height:480px) and (orientation:landscape){
  .cockpit{grid-template-columns:1.25fr 1fr}
  .inbox{grid-template-columns:290px 1fr}.ib-liste{position:sticky;max-height:calc(100vh - 150px)}.ib-nom{max-width:170px}
  table.lot .opt{display:table-cell}
}
@media (pointer:coarse) and (min-width:800px) and (max-width:900px) and (min-height:480px) and (orientation:landscape){
  .ag{display:grid;grid-template-columns:44px repeat(6,minmax(0,1fr))}.ag-liste{display:none}
}
/* ouvert large, 901-1023 px au doigt : menu plus étroit, recherche lisible, pastilles du haut qui défilent au lieu d'écraser la recherche */
@media (min-width:901px) and (max-width:1023px) and (min-height:480px) and (pointer:coarse){
  .sidebar{width:184px}.sidebar a{padding:9px 10px}
  .gsearch{flex:1 1 200px;min-width:180px}
  .topbar .kpis{min-width:0;overflow-x:auto;scrollbar-width:none}.topbar .kpis::-webkit-scrollbar{display:none}
  .ag{grid-template-columns:48px repeat(6,minmax(0,1fr))}
  .inbox{grid-template-columns:290px 1fr}.ib-nom{max-width:170px}
}
/* au doigt sur ces écrans (ouverts, et fermés de 460 à 599 px) : cibles de 44 px, champs à 16 px (sinon Safari zoome à la saisie), texte à 14 px une fois ouvert */
@media (pointer:coarse) and (min-width:600px) and (max-width:743px) and (min-height:480px) and (min-aspect-ratio:7/10),
       (pointer:coarse) and (min-width:760px) and (max-width:900px) and (min-height:480px) and (orientation:landscape),
       (pointer:coarse) and (min-width:901px) and (max-width:1023px) and (min-height:480px),
       (pointer:coarse) and (min-width:460px) and (max-width:599px){
  .btn,.menu-btn,.sidebar a,.tabs button,.vues button,.filtres button,.seg button,.slot,.dd-menu button,.kp,.gsearch .res a,.tabulator-page,.ev.libre{min-height:44px}
  .kp{line-height:36px}
  .menu-btn{min-width:44px;line-height:42px;padding-top:0;padding-bottom:0}
  .sidebar{overflow-y:auto;overscroll-behavior:contain}   /* audit : sur écran court, les liens à 44 px poussaient Paramètres et Journal hors de l'écran */
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]),select,textarea{font-size:16px}
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]),select{min-height:44px}
  :where(input[type=datetime-local],input[type=tel],input[type=search],input[type=email],input[type=password],input[type=time],input[type=month]){border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:#fff}   /* :where : la recherche globale garde sa pilule (audit 2) */
  .legende .ev.libre{min-height:0}
}
@media (pointer:coarse) and (min-width:600px) and (max-width:743px) and (min-height:480px) and (min-aspect-ratio:7/10),
       (pointer:coarse) and (min-width:760px) and (max-width:900px) and (min-height:480px) and (orientation:landscape),
       (pointer:coarse) and (min-width:901px) and (max-width:1023px) and (min-height:480px){
  body{font-size:14px}.tabulator{font-size:13px}
}

/* ---- Pliable ouvert en paysage (Fold 8 : 933 × 553 px CSS, Chrome Android). La largeur suffit, la HAUTEUR manque : chaque règle rend de la hauteur. ---- */
/* 40 px = 7 mm sur cet écran (2,625 px physiques par px CSS, ~383 ppp) : l'équivalent des 44 pt d'Apple ; les 44 px d'hier gonflaient chaque ligne de 10 %. */
@media (pointer:coarse) and (min-width:901px) and (max-width:1023px) and (min-height:480px) and (max-height:760px) and (orientation:landscape){
  .btn,.tabs button,.vues button,.filtres button,.seg button,.slot,.dd-menu button,.gsearch .res a,.tabulator-page,.ev.libre,.sidebar a{min-height:40px}
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]),select{min-height:40px}
  .btn.sm{padding:3px 10px;font-size:13px}
  /* barre du haut : « dda » seul, recherche qui s'élargit au toucher, pastilles resserrées ; la dernière (Réponses) n'est plus coupée */
  .brand{font-size:0;gap:0}.brand span{font-size:13px;padding:3px 8px}
  .gsearch{flex:0 1 150px;min-width:120px;transition:flex-basis .15s}.gsearch:focus-within{flex-basis:360px}
  .topbar{gap:10px;padding:0 12px}
  .topbar .kpis{gap:4px}
  .kp{min-height:36px;line-height:28px;padding:3px 8px}
  /* menu : tient dans la hauteur, sans défilement ni « Journal » caché */
  .sidebar{padding:8px 6px;gap:0}
  .sidebar a{padding:4px 10px}
  .sidebar .grp{padding:6px 10px 0;font-size:10px}
  .sidebar .foot{display:none}
  /* en-têtes de vue : un titre plus discret, le texte d'aide en petit, les raccourcis clavier masqués (inutiles au doigt) */
  .toolbar{padding:6px 14px;gap:6px 8px}.toolbar h1{font-size:17px;margin-right:6px}
  .toolbar>span.muted{flex:1 1 220px;min-width:0;font-size:12px;line-height:1.35}
  .toolbar>span.muted.right{display:none}
  .toolbar>span.muted:has(+.btn.right){order:1;flex-basis:100%}
  .ib-actions>.muted.right{display:none}
  .autonomie .muted{display:none}
  .toolbar>.autonomie+.btn{margin-left:auto}
  .content{padding:10px 14px}
  /* fiche fermée : son ombre débordait sur le bord droit de toutes les pages */
  .drawer:not(.open){box-shadow:none}
  /* Appels : chaque ligne de la liste devient une petite carte (nom, motif, numéro visible) */
  .callcard{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:12px}
  .callcard>.card:last-child{max-height:calc(100dvh - 130px)!important}
  .callcard .script{max-height:34dvh;overflow:auto}
  #list table.simple,#list tbody{display:block}
  #list tr{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:0 8px;align-items:baseline;border-bottom:1px solid #eceef0;padding:6px 4px}
  #list tr>th{grid-column:1/-1;border:0;padding:8px 0 2px}
  #list tr>td{border:0;padding:0}
  #list tr>td:nth-child(3){grid-column:2/4;grid-row:2;font-size:12px;line-height:1.35}
  #list tr>td:nth-child(4){grid-column:3;grid-row:1;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:12.5px}
  .outcomes .btn{padding:8px}
  /* Réponses : la liste tient dans l'écran (vh compte une hauteur sans la barre de Chrome) */
  .inbox{grid-template-columns:280px minmax(0,1fr)}
  .ib-liste{max-height:calc(100dvh - 190px)}
  .ib-carte{padding:12px 14px}
  .ib-carte>.row:first-child>.muted.right{flex-basis:100%;margin-left:0;font-size:12px}
  .bulle{max-width:94%}
  /* Agenda, tableau : étiquette et numéro sur une ligne */
  .ag-table td .bd-tags{display:inline-flex;margin-right:6px;vertical-align:middle}
  .ag-table td .bd-tags+.muted{display:inline;margin-top:0}
  .ag-outils{flex:1 1 auto;justify-content:flex-end}.ag-outils input[type=search]{flex:1 1 140px;width:auto;min-width:0}
  /* Séquences : une ligne d'en-tête, colonnes à leur mesure */
  .card[data-id]>.row{flex-wrap:nowrap}
  .card[data-id]>.row>input[data-nom]{width:auto!important;flex:1 1 160px;min-width:0}
  .card[data-id]>.row>span.muted,.card[data-id]>.row>label{white-space:nowrap}
  .card[data-id] table.simple th{font-size:10.5px;line-height:1.25}
  .card[data-id] table.simple th:nth-child(2){width:150px}
  .card[data-id] table.simple td{padding:4px 8px;vertical-align:middle}
  .card[data-id] table.simple select{width:100%}
  /* Performance : une colonne de tableaux lisibles au lieu de trois qui débordaient de 700 px */
  .grid3{grid-template-columns:repeat(auto-fit,minmax(440px,1fr))}.grid3>.card{min-width:0;overflow-x:auto}
  /* Agenda, calendrier : créneaux libres à 32 px (cible large d’une colonne entière), légende sur une ligne : la semaine montre 4 heures au lieu de 2 */
  .ag .ev.libre{min-height:32px;padding:5px 6px}
  .legende{font-size:11.5px;gap:6px 8px}.legende .ev{white-space:nowrap;flex:none}   /* 08/11 : sur une seule ligne, les étiquettes étaient tronquées (« R… », « appel pr… ») */
}
