:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #001738;
  --muted: #64748b;
  --brand: #001738;
  --brand-navy: #001738;
  --brand-cyan: #00b4d8;
  --brand-green: #10b981;
  --brand-gradient: linear-gradient(135deg, #00b4d8 0%, #10b981 100%);
  --ok: #10b981;
  --warn: #f59e0b;
  --crit: #ef4444;
  --line: #e2e8f0;
}
* { box-sizing: border-box; }
body { margin:0; font:14px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--ink); }
header {
  display:flex; align-items:center; gap:1.2rem; padding:.6rem 1.4rem;
  background: linear-gradient(135deg, #001738 0%, #061f42 100%);
  color:#fff; position:sticky; top:0; z-index:50;
  border-bottom: 2px solid var(--brand-cyan);
  box-shadow: 0 4px 12px rgba(0, 23, 56, 0.15);
}
.brand-box {
  display:flex; align-items:center; gap:10px; text-decoration:none;
}
.brand-logo {
  height:32px; width:auto; object-fit:contain;
  background:#ffffff; padding:2px 8px; border-radius:6px;
  box-shadow:0 2px 4px rgba(0,0,0,0.15);
}
.brand-title {
  font-size:14.5px; font-weight:700; color:#fff; letter-spacing:.02em; white-space:nowrap;
}
nav { display:flex; gap:.35rem; flex:1; align-items:center; }
nav button {
  background:transparent; color:#94a3b8; border:0; padding:.5rem .85rem;
  border-radius:6px; cursor:pointer; font-size:13.5px; font-weight:500;
  transition: all .15s ease;
}
nav button.active, nav button:hover {
  background:rgba(0, 180, 216, 0.18); color:#ffffff; font-weight:600;
}
nav button.active {
  box-shadow: inset 0 -2px 0 var(--brand-cyan);
}
.badge { padding:.22rem .65rem; border-radius:99px; font-size:12px; font-weight:600; background:#fff; color:var(--brand); }
.badge.demo { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }

/* User badge & logout in header */
.user-section {
  display:flex; align-items:center; gap:.55rem; margin-left:auto;
  padding-left:.8rem; border-left:1px solid rgba(255,255,255,0.15);
}
.user-name { font-weight:600; font-size:13px; color:#fff; white-space:nowrap; }
.role-badge {
  display:inline-block; padding:.18rem .55rem; border-radius:99px;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
}
.role-badge.role-admin { background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; }
.role-badge.role-gestion { background:#ecfdf5; color:#047857; border:1px solid #a7f3d0; }
.role-badge.role-lecture { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }
.btn-logout {
  background:rgba(239, 68, 68, 0.15); color:#fca5a5; border:1px solid rgba(239, 68, 68, 0.35);
  border-radius:6px; padding:.3rem .6rem; font-size:12px; cursor:pointer; font-weight:600;
  transition: background .15s;
}
.btn-logout:hover { background:rgba(239, 68, 68, 0.3); color:#fff; }

main { max-width:1460px; margin:1rem auto; padding:0 1.2rem; }
.card { background:var(--card); border-radius:12px; padding:1.15rem 1.35rem; margin-bottom:1rem; box-shadow:0 2px 8px rgba(0,23,56,.05); border:1px solid var(--line); }
.card h3 { margin:.1rem 0 .8rem; font-size:1.05rem; color:var(--brand-navy); font-weight:700; }
.card-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.6rem; margin-bottom:.75rem; }
.card-head h3 { margin:0; }
.table-filters { display:flex; gap:.45rem; align-items:center; flex-wrap:wrap; }
.table-wrap { overflow-x:auto; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:.75rem; margin-bottom:1rem; }
@media (min-width: 1100px) {
  .kpis-live { grid-template-columns:repeat(5, 1fr); }
}
.kpi {
  background:var(--card); border-radius:10px; padding:.85rem 1.05rem;
  box-shadow:0 2px 6px rgba(0,23,56,.04); border-left:4px solid var(--brand-cyan);
  border:1px solid var(--line); border-left-width:4px; transition:transform .15s, box-shadow .15s;
}
.kpi:hover { transform:translateY(-1px); box-shadow:0 4px 10px rgba(0,23,56,.08); }
.kpi b { display:block; font-size:1.7rem; line-height:1.2; font-variant-numeric:tabular-nums; color:var(--brand-navy); }
.kpi span { color:var(--muted); font-size:12px; font-weight:500; }
.kpi.ok { border-left-color:var(--brand-green); }
.kpi.warn { border-left-color:var(--warn); }
.kpi.crit { border-left-color:var(--crit); }
.cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:1rem; }
.live-bottom { display:grid; grid-template-columns:1.85fr 1fr; gap:1rem; align-items:start; }
@media (max-width: 1150px) {
  .live-bottom { grid-template-columns:1fr; }
}
.qhead { display:flex; justify-content:space-between; align-items:baseline; }
.pill { display:inline-block; min-width:1.6rem; text-align:center; padding:.1rem .5rem; border-radius:99px; background:var(--line); font-weight:600; }
.call { display:flex; justify-content:space-between; align-items:center; padding:.45rem .6rem; border-radius:6px; margin:.25rem 0; background:#f8fafc; border-left:4px solid var(--brand-green); border:1px solid var(--line); border-left-width:4px; }
.call.warn { border-left-color:var(--warn); background:#fffbeb; }
.call.crit { border-left-color:var(--crit); background:#fef2f2; }
.call.active { border-left-color:var(--brand-cyan); background:#f0f9ff; }
.call .t { font-variant-numeric:tabular-nums; font-weight:700; }
.sub { margin:.7rem 0 .2rem; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:.45rem .65rem; border-bottom:1px solid var(--line); }
th { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; background:#f8fafc; font-weight:600; }
td.n, th.n { text-align:right; font-variant-numeric:tabular-nums; }
.st-done { color:var(--ok); font-weight:600; }
.st-abandoned { color:var(--crit); font-weight:600; }
.st-missed { color:var(--warn); font-weight:600; }
.toolbar { display:flex; flex-wrap:wrap; gap:.8rem; align-items:end; }
label { display:flex; flex-direction:column; gap:.2rem; font-size:12px; color:var(--muted); font-weight:500; }
label:has(input[type=checkbox]), label:has(input[type=radio]) { flex-direction:row; align-items:center; gap:.4rem; font-size:14px; color:var(--ink); font-weight:normal; }
input, select, button { font:inherit; padding:.45rem .65rem; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:var(--ink); }
input:focus, select:focus { outline:none; border-color:var(--brand-cyan); box-shadow:0 0 0 2px rgba(0,180,216,0.2); }
button { cursor:pointer; font-weight:500; transition:all .15s; }
button:hover { background:#f1f5f9; }
button.primary {
  background: var(--brand-navy); color:#fff; border-color:var(--brand-cyan);
  font-weight:600; box-shadow:0 2px 4px rgba(0,23,56,.12);
}
button.primary:hover {
  background: linear-gradient(135deg, #001738 0%, #00b4d8 100%);
  border-color:var(--brand-green);
}
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:.8rem; align-items:end; }
.muted { color:var(--muted); } code { background:#e2e8f0; padding:.1rem .35rem; border-radius:4px; color:#0f172a; font-size:12.5px; }
.result { background:#001738; color:#e0f2fe; padding:.85rem; border-radius:8px; overflow:auto; white-space:pre-wrap; border:1px solid #1e293b; }
#toast { position:fixed; bottom:1rem; right:1rem; background:#001738; color:#fff; padding:.65rem 1.1rem; border-radius:8px; opacity:0; transition:.3s; pointer-events:none; z-index:3000; border-left:4px solid var(--brand-cyan); box-shadow:0 6px 16px rgba(0,0,0,0.25); }
#toast.show { opacity:1; }
.chart svg { width:100%; height:auto; } .legend span { margin-right:1rem; font-size:12px; } .legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:4px; }
.empty { color:var(--muted); font-style:italic; padding:.3rem .6rem; }
[hidden] { display:none !important; }

/* --- extensions --- */
header a.wall {
  color:#fff; text-decoration:none; background:rgba(0,180,216,0.18);
  padding:.4rem .75rem; border-radius:6px; font-size:13px; font-weight:600;
  border:1px solid rgba(0,180,216,0.3); transition:all .15s;
}
header a.wall:hover { background:rgba(0,180,216,0.35); }
.agents { display:flex; flex-wrap:wrap; gap:.35rem; margin:.2rem 0 .4rem; }
.ag { padding:.15rem .6rem; border-radius:99px; font-size:12px; font-weight:600; border:1px solid transparent; }
.ag-ok { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.ag-call { background:#e0f2fe; color:#0284c7; border-color:#bae6fd; }
.ag-meeting { background:#f3e8ff; color:#7c3aed; border-color:#d8b4fe; }
.ag-busy { background:#fef3c7; color:#b45309; border-color:#fde68a; }
.ag-dnd { background:#fee2e2; color:#b91c1c; border-color:#fca5a5; }
.ag-away { background:#f1f5f9; color:#64748b; border-color:#cbd5e1; }
.ag-offline { background:#e2e8f0; color:#475569; border-color:#cbd5e1; }
.checks { display:flex; flex-wrap:wrap; gap:1.5rem; margin-top:.3rem; }
.cgroup { display:flex; flex-direction:column; gap:.25rem; min-width:220px; }
.cgroup b { font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
#rpTable td, #rpTable th { white-space:nowrap; }

/* --- Mur d'affichage TV (Wallboard GFP.tech) --- */
.wallbody {
  background: radial-gradient(circle at 50% 15%, #082142 0%, #001229 65%, #000a18 100%);
  color: #fff; min-height: 100vh; padding: 1rem 1.6rem;
}
.wallhead {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid rgba(0, 180, 216, 0.25);
}
.wallbrand { display: flex; align-items: center; gap: 14px; }
.wall-logo {
  height: 48px; width: auto; object-fit: contain; background: #fff;
  padding: 4px 12px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.wallbrand h1 { margin: 0; font-size: 1.85rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.wall-subtitle { font-size: 12px; color: #94a3b8; font-weight: 500; display: block; margin-top: 2px; }

.wallmeta { display: flex; align-items: center; gap: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #34d399; letter-spacing: .05em;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px #10b981; animation: pulseDot 1.5s infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }
#wClock { font-size: 2.3rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #38bdf8; text-shadow: 0 0 12px rgba(56, 189, 248, 0.35); }

/* KPIs géants */
.wkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.wk {
  background: rgba(8, 28, 56, 0.85); border-radius: 12px; padding: .85rem 1.15rem;
  border: 1px solid #13335e; border-left: 6px solid #4b5875;
  box-shadow: 0 6px 18px rgba(0, 10, 25, 0.35);
}
.wk b { display: block; font-size: 3.2rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wk span { color: #94a3b8; font-size: 1.05rem; font-weight: 500; }
.wk.ok { border-left-color: #10b981; } .wk.ok b { color: #34d399; }
.wk.warn { border-left-color: #f59e0b; } .wk.warn b { color: #fbbf24; }
.wk.crit {
  border-left-color: #ef4444; background: rgba(90, 20, 30, 0.5);
  animation: blink 1.2s infinite;
}
.wk.crit b { color: #f87171; }
.wk.blue { border-left-color: #00b4d8; } .wk.blue b { color: #38bdf8; }

/* Files d'attente temps réel */
.wqueues { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.wq {
  background: rgba(8, 28, 56, 0.85); border-radius: 12px; padding: 1.1rem 1.35rem;
  border: 1px solid #13335e; border-top: 6px solid #10b981;
  box-shadow: 0 6px 18px rgba(0, 10, 25, 0.35);
}
.wq.warn { border-top-color: #f59e0b; } .wq.crit { border-top-color: #ef4444; }
.wqh { display: flex; justify-content: space-between; align-items: baseline; }
.wqh h2 { margin: 0; font-size: 1.7rem; font-weight: 700; color: #fff; }
.wqh .big { font-size: 3.4rem; font-weight: 800; color: #38bdf8; }
.wqh small { font-size: 1.05rem; color: #94a3b8; font-weight: 400; }
.wsub { color: #94a3b8; margin: .35rem 0; font-size: 1.05rem; } .wsub b { color: #fff; }
.wwait { display: flex; flex-wrap: wrap; gap: .45rem; margin: .55rem 0; min-height: 2.4rem; }
.wchip {
  background: #10b981; color: #fff; padding: .25rem .75rem; border-radius: 6px;
  font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wchip.warn { background: #f59e0b; color: #001738; } .wchip.crit { background: #ef4444; }
.wagents { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .45rem; margin: .6rem 0; }
.wag {
  border-radius: 8px; padding: .45rem .75rem; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.wag b { font-size: 1.08rem; } .wag span { font-size: .9rem; opacity: .88; }
.wag.ag-ok { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.wag.ag-call { background: rgba(0, 180, 216, 0.18); color: #7dd3fc; border-color: rgba(0, 180, 216, 0.35); }
.wag.ag-meeting { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.35); }
.wag.ag-busy { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
.wag.ag-dnd { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.wag.ag-away { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border-color: rgba(148, 163, 184, 0.2); }
.wag.ag-offline { background: rgba(100, 116, 139, 0.12); color: #94a3b8; border-color: rgba(100, 116, 139, 0.2); }

/* --- Bandeau d'information et de performance murale en direct --- */
.wlive-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.28) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 12px;
  padding: 0.65rem 1.4rem; margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); font-size: 13.5px; color: #e2e8f0;
  flex-wrap: wrap;
}
.wlive-banner-item { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.wlive-banner-item b { color: #38bdf8; font-weight: 700; }
.wlive-banner-tag {
  padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px;
}
.wlive-banner-tag.ok { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.wlive-banner-tag.warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.wlive-banner-tag.crit { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

/* --- Nouvelle section basse du Wallboard --- */
.wbottom {
  display: grid; grid-template-columns: 1.55fr 1.25fr 1.2fr; gap: 1.25rem; align-items: stretch;
}
@media (max-width: 1400px) {
  .wbottom { grid-template-columns: 1fr; }
}
.wcard {
  background: rgba(8, 28, 56, 0.85); border-radius: 14px; padding: 1.1rem 1.3rem;
  border: 1px solid #13335e; box-shadow: 0 8px 24px rgba(0, 10, 25, 0.35);
  display: flex; flex-direction: column;
}
.wcard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .85rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: .55rem;
}
.wcard-head h3 { margin: 0; font-size: 1.15rem; color: #e2e8f0; font-weight: 700; }
.wlegend { display: flex; gap: .9rem; font-size: 11.5px; color: #94a3b8; }
.wlegend span { display: inline-flex; align-items: center; gap: 5px; }
.wlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.wbadge-count {
  font-size: 11.5px; background: rgba(0, 180, 216, 0.18); color: #38bdf8;
  padding: 2px 7px; border-radius: 99px; font-weight: 700; border: 1px solid rgba(0, 180, 216, 0.35);
}

.whour-chart { width: 100%; height: 140px; }
.wall-svg { width: 100%; height: 100%; overflow: visible; }
.bar-group text { user-select: none; }
.bar-group.current rect:last-of-type { stroke: #38bdf8; stroke-width: 1.5; }

.wmetrics-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem;
  margin-top: .8rem; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,0.08);
}
.wm-item {
  display: flex; flex-direction: column; background: rgba(255,255,255,0.03);
  padding: .45rem .6rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.05);
}
.wm-item span { font-size: 10.5px; color: #94a3b8; text-transform: uppercase; font-weight: 600; }
.wm-item b { font-size: 1.25rem; color: #f8fafc; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Liste murale sans ascenseur ni hauteur tronquée */
.wlist { display: flex; flex-direction: column; gap: .35rem; overflow: visible; max-height: none; }
.wlist-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: .45rem .75rem; background: rgba(255,255,255,0.035); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06); font-size: 13px;
  transition: background .15s ease;
}
.wlist-item:hover { background: rgba(255,255,255,0.07); }
.wlist-main { display: flex; flex-direction: column; gap: 2px; }
.wlist-title { font-weight: 600; color: #f1f5f9; display: flex; align-items: center; }
.wlist-sub { font-size: 11.5px; color: #94a3b8; }
.wlist-stat { text-align: right; font-variant-numeric: tabular-nums; }
.wlist-stat b { font-size: 14px; color: #fff; }
.wlist-stat .sla-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.sla-tag.ok { background: rgba(16, 185, 129, 0.22); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.sla-tag.warn { background: rgba(245, 158, 11, 0.22); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.sla-tag.crit { background: rgba(239, 68, 68, 0.22); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

/* Badges podium & rangs pour les agents */
.agent-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 800; margin-right: 8px; flex-shrink: 0;
}
.agent-rank.gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e1b4b; box-shadow: 0 0 10px rgba(251, 191, 36, 0.45); }
.agent-rank.silver { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #0f172a; }
.agent-rank.bronze { background: linear-gradient(135deg, #f59e0b, #78350f); color: #ffffff; }
.agent-rank.standard { background: rgba(255, 255, 255, 0.08); color: #94a3b8; }

/* Badges de présence équipe */
.wteam-status-pills { display: inline-flex; gap: 5px; font-size: 11px; font-weight: 600; }
.wteam-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; }
.wteam-pill.ready { color: #34d399; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.wteam-pill.call { color: #38bdf8; background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); }
.wteam-pill.busy { color: #fbbf24; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.wteam-pill.away { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); }

.wallbody .muted { color: #64748b; }
@keyframes blink { 50% { background: rgba(150, 20, 30, 0.8); } }

/* --- Modal et Timeline de cycle de vie d'appel --- */
.modal-backdrop {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 20, 32, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: #fff; border-radius: 12px; width: 92%; max-width: 620px;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-header h3 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.modal-close {
  background: transparent; border: none; font-size: 1.5rem; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 6px;
}
.modal-close:hover { background: #eef1f8; color: var(--ink); }

.timeline-summary {
  padding: 1rem 1.4rem; background: #f8f9fc; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem;
}
.tl-stat { display: flex; flex-direction: column; }
.tl-stat span { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tl-stat b { font-size: 14px; color: var(--ink); }

.timeline-events {
  padding: 1.4rem; position: relative;
}
.tl-item {
  position: relative; padding-left: 28px; padding-bottom: 1.2rem;
  border-left: 2px solid var(--line);
}
.tl-item:last-child {
  border-left-color: transparent; padding-bottom: 0;
}
.tl-dot {
  position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
}
.tl-item.incoming .tl-dot { border-color: #2b579a; background: #2b579a; }
.tl-item.escalation .tl-dot { border-color: #7a4fc4; background: #7a4fc4; }
.tl-item.busy_agent .tl-dot { border-color: #0284c7; background: #0284c7; }
.tl-item.rona .tl-dot { border-color: #d6394b; background: #d6394b; }
.tl-item.answered .tl-dot { border-color: #2e9e5b; background: #2e9e5b; }
.tl-item.abandoned .tl-dot { border-color: #d6394b; background: #fff; }
.tl-item.ended .tl-dot { border-color: #6b7385; background: #6b7385; }

.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.tl-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-desc { font-size: 12.5px; color: #4e5566; margin-top: 0.2rem; }

/* Table row interactive click */
#recent tr.clickable, #callbacks tr.clickable { cursor: pointer; transition: background 0.15s; }
#recent tr.clickable:hover, #callbacks tr.clickable:hover { background: #f0f4fc; }
.badge-rona {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 4px;
  background: #fdecee; color: #a81c2d; font-size: 11px; font-weight: 600;
  border: 1px solid #f9cbd0;
}
.sub-rona {
  font-size: 11px; color: #a81c2d; margin-top: 2px; font-weight: 500;
}
.badge-speed {
  display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
  background: #eaf0fb; color: #2b579a; font-size: 11px; font-weight: 600;
  margin-left: 0.3rem;
}
.badge-client {
  display: inline-block; padding: 0.08rem 0.42rem; border-radius: 4px;
  background: #f0ebf8; color: #5b359c; font-size: 11px; font-weight: 600;
  border: 1px solid #d9ccf0; margin-top: 2px;
}
.q-flow {
  display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap;
}
.q-tag {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 5px;
  background: #eef1f8; color: #2b579a; font-size: 11.5px; font-weight: 600;
}
.q-tag.q-esc {
  background: #e6f4ec; color: #1d7a43;
}
.view-btn {
  background: #eef1f8; border: 1px solid #c9cedb; border-radius: 5px;
  padding: 0.2rem 0.55rem; font-size: 11.5px; cursor: pointer; color: var(--brand); font-weight: 600;
  white-space: nowrap;
}
.view-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
header button.wall {
  color: #fff; background: rgba(255,255,255,.18); border: 0;
  padding: .35rem .7rem; border-radius: 6px; font-size: 13px; cursor: pointer;
}
header button.wall:hover { background: rgba(255,255,255,.3); }
.sync-status {
  font-size: 12px; color: #dbe5f5; white-space: nowrap;
}
.ag-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle; background: currentColor;
}
.ag-cnt {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 99px;
  background: rgba(0,0,0,0.08); font-size: 10.5px; font-weight: 700;
}
.sec-alert {
  padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem;
  font-size: 13px; display: flex; align-items: center; gap: .6rem;
}
.sec-alert.warn { background: #fff7e3; border: 1px solid #f5d487; color: #7a5200; }
.sec-alert.ok { background: #e4f5ea; border: 1px solid #bfe5cd; color: #1d7a43; }

/* --- Écran de connexion GFP.tech --- */
.login-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: radial-gradient(circle at 50% 25%, #082852 0%, #001738 75%, #000c1e 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 1rem;
}
.login-card {
  background: #ffffff; border-radius: 16px; width: 100%; max-width: 440px;
  padding: 2.2rem 2.4rem; box-shadow: 0 25px 60px rgba(0, 10, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15); animation: fadeInScale .25s ease-out;
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.login-brand { text-align: center; margin-bottom: 1.6rem; }
.login-logo {
  height: 52px; width: auto; object-fit: contain; margin-bottom: 0.8rem;
  background: #fff; padding: 4px 10px; border-radius: 8px;
}
.login-brand h2 {
  margin: 0 0 0.3rem; font-size: 1.25rem; color: #001738; font-weight: 700;
}
.login-brand p { margin: 0; font-size: 12.5px; }
.login-form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-form label { font-size: 12.5px; font-weight: 600; color: #334155; }
.login-form input {
  padding: 0.6rem 0.8rem; font-size: 14px; border: 1.5px solid #cbd5e1;
  border-radius: 8px; width: 100%;
}
.login-form input:focus {
  border-color: #00b4d8; box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2); outline: none;
}
.btn-login {
  padding: 0.7rem; font-size: 14.5px; font-weight: 700; margin-top: 0.4rem;
  border-radius: 8px; background: linear-gradient(135deg, #001738 0%, #00b4d8 100%) !important;
  color: #fff !important; border: none !important; cursor: pointer; transition: transform .15s;
}
.btn-login:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #001738 0%, #10b981 100%) !important;
}
.alert-error {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
  padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 12.5px; font-weight: 500;
}
.login-roles-guide {
  margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid #e2e8f0;
  display: flex; flex-direction: column; gap: 0.45rem; font-size: 11.5px;
}
.guide-title {
  font-weight: 700; color: #001738; font-size: 12px; margin-bottom: 0.2rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.guide-item {
  display: flex; align-items: flex-start; gap: 0.6rem; color: #475569;
}
.guide-item .role-badge { flex-shrink: 0; min-width: 58px; text-align: center; }

/* Actions table utilisateurs */
.btn-sm {
  padding: 0.2rem 0.5rem; font-size: 11.5px; border-radius: 4px;
  border: 1px solid #cbd5e1; background: #fff; cursor: pointer;
}
.btn-sm:hover { background: #f1f5f9; }
.btn-danger {
  color: #b91c1c; border-color: #fca5a5; background: #fff5f5;
}
.btn-danger:hover { background: #fee2e2; }

