:root {
  color-scheme: light;
  --brand: #F5A300;
  --brand-ink: #b97a00;
  --brand-soft: #fff4dc;
  --brand-line: #f3dca8;
  --brand-deep: #5c4300;
  --brand-ring: var(--brand-ring);
  --brand-mid: #f3c66b;
  --brand-faint: #fffaf0;
  --brand-hover: #e89a00;
  --on-brand: #2b2226;
  --ink: #4B3F47;
  --ink-2: #6e6369;
  --muted: #8f878b;
  --line: #ebe6e2;
  --line-2: #f3efec;
  --page: #f7f5f3;
  --card: #ffffff;
  --grid: #eeeae6;
  --axis: #cfc8c3;
  --s-answered: #1f9d55;
  --s-missed: #eda100;
  --s-abandoned: #d03b3b;
  --s-voicemail: #e87ba4;
  --s-outbound: #2a78d6;
  --s-internal: #a39c97;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(75, 63, 71, .06), 0 2px 8px rgba(75, 63, 71, .05);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { display: block; padding: 4px 6px 18px; }
.side .logo img { max-width: 100%; max-height: 120px; width: auto; height: auto; display: block; margin: 0 auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 8px 6px; border-top: 1px solid var(--line); }
.side .foot b { color: var(--ink); font-weight: 600; }
.side .foot button { background: none; border: 0; padding: 0; color: var(--brand-ink); cursor: pointer; text-decoration: underline; font-size: 12px; }

.main { min-width: 0; padding: 0 28px 48px; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0 14px; position: sticky; top: 0; background: var(--page); z-index: 20; }
.top h1 { font-size: 21px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.top .sub { color: var(--muted); font-size: 13px; }
.top .grow { flex: 1; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-pill.ok .dot { background: var(--s-answered); box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: pulse 2s infinite; }
.live-pill.err .dot { background: var(--s-abandoned); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.45); } 70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.demo-banner { background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-deep); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 16px; margin-top: 16px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3-1 { grid-template-columns: 3fr 1.2fr; }
.g-1-1-1 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1280px) { .g-2, .g-3-1, .g-1-1-1 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 2px; font-weight: 600; }
.card .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card-head > div:first-child { flex: 1; }
.card-head .hint { margin: 2px 0 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 27px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -.3px; }
.kpi .val small { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: #d9d1cb; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- filters ---------- */
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 4px; }
.f > label, .f > .lab { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.f input[type=text], .f input[type=search], .f input[type=datetime-local], .f input[type=time], .f select, .inp {
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; background: #fff; min-height: 34px; outline: none;
}
.f input:focus, .f select:focus, .inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.f input[type=datetime-local] { width: 186px; }
.f input[type=time] { width: 98px; }
.f input.w-num { width: 150px; }
.row { display: flex; gap: 6px; align-items: center; }
.presets { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.chip:hover { border-color: #d9d1cb; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input { display: none; }
.st-chip.on { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.st-chip:not(.on) { color: var(--muted); }
.st-chip:not(.on) .sw { opacity: .3; }
.days .chip { padding: 5px 8px; min-width: 30px; justify-content: center; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 14px; cursor: pointer; font-weight: 600; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: #d0c8c2; }
.btn { white-space: nowrap; }
.form-grid .row { flex-wrap: wrap; }
#t-days td:first-child { white-space: nowrap; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--s-abandoned); }
.btn.sm { padding: 4px 9px; min-height: 28px; font-size: 12.5px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
.filters .actions { margin-left: auto; display: flex; gap: 8px; }
.more-filters { display: contents; }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; max-width: 100%; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff; position: sticky; top: 0; z-index: 1; }
table.t th.sort { cursor: pointer; user-select: none; }
table.t th.sort:hover { color: var(--ink); }
table.t th .arr { color: var(--brand-ink); margin-left: 3px; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td.num, table.t .mono { white-space: nowrap; }
table.t tbody tr:hover td { background: #fbf9f7; }
table.t tr.click { cursor: pointer; }
table.t tr.grp td { background: #faf7f4; font-weight: 600; border-top: 1px solid var(--line); cursor: pointer; }
table.t tr.grp:hover td { background: #f6f1ec; }
table.t tr.tot td { font-weight: 600; border-top: 2px solid var(--line); background: #fff; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--line-2); white-space: nowrap; }
.badge .sw { width: 8px; height: 8px; border-radius: 50%; }
.cb { font-size: 12px; white-space: nowrap; }
.cb.ok { color: #157a41; }
.cb.no { color: var(--s-abandoned); font-weight: 600; }
.cb.part { color: #9a6a00; }
.minibar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line-2); min-width: 80px; gap: 1px; margin-top: 5px; }
.minibar span { display: block; height: 100%; }
.pct { display: inline-flex; align-items: center; gap: 8px; }
.pct .track { width: 60px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.pct .track i { display: block; height: 100%; background: var(--s-answered); border-radius: 3px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 12px; font-size: 13px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; align-items: center; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + g rect, .chart g.bar:hover rect { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: #2f272c; color: #fff; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-width: 320px; }
.tip b { font-weight: 600; }
.tip .r { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.tip .r span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.tip .sw { width: 8px; height: 8px; }

/* tree */
.tree-wrap { overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; background: #fdfcfb; }
.tree-wrap svg { display: block; }
.tnode { cursor: pointer; }
.tnode rect.box { fill: #fff; stroke: var(--line); }
.tnode:hover rect.box { stroke: var(--brand); }
.tnode text { font-size: 12px; fill: var(--ink); }
.tnode text.c { font-size: 11.5px; fill: var(--muted); }
.tnode text.tg { font-size: 11px; fill: var(--brand-ink); font-weight: 700; }
.tlink { fill: none; stroke: #e7ddd3; }
.tlink.zero { stroke-dasharray: 4 4; stroke: #ddd5ce; }
/* schéma fixe : vue libre (déplacer, zoomer) */
.tree-wrap.canvas { overflow: hidden; position: relative; background-color: #fdfcfb; background-image: radial-gradient(#e9e2db 1px, transparent 1px); background-size: 18px 18px; }
svg.fcanvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; }
svg.fcanvas.panning { cursor: grabbing; }
svg.fcanvas.moving, svg.fcanvas.moving .fnode { cursor: move; }
.fnode.moved rect.box { stroke: var(--brand-line); }
.canvas-hint { position: absolute; right: 10px; bottom: 8px; font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .85); padding: 3px 8px; border-radius: 6px; pointer-events: none; }
/* schéma fixe lisible */
.fnode { cursor: pointer; }
.fnode rect.box { fill: #fff; stroke: var(--line); stroke-width: 1.2; }
.fnode:hover rect.box { stroke: var(--brand); }
.fnode text { fill: var(--ink); font-family: inherit; }
.fnode text.fl { font-size: 14.5px; font-weight: 600; }
.fnode text.fc { font-size: 12px; fill: var(--ink-2); }
.fnode text.fv { font-size: 10.5px; fill: var(--brand-ink); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fnode text.fs { font-size: 11px; fill: var(--muted); font-weight: 600; }
.fnode .fsep { stroke: var(--line-2); }
.fnode text.ta { font-size: 11.5px; fill: var(--muted); }
.fnode text.ta.n { font-variant-numeric: tabular-nums; }
.fnode text.ta.n.on { fill: var(--ink); font-weight: 700; }
.fnode .tann-bg { fill: transparent; }
.fnode .tann:hover .tann-bg { fill: var(--brand-soft); }
.fnode .tann:hover text.ta { fill: var(--ink); }
.fnode.zero rect.box { fill: #faf8f6; stroke-dasharray: 4 3; }
.fnode.zero text.fl, .fnode.zero text.fc { fill: var(--muted); }
.flow-legends { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; margin: 0 0 10px; }
.flow-legends .lg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.flow-legends .legend { margin: 0; }
.flow-legends .lab { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.flow-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.flow-tools .lab { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.dl-group td { background: #faf7f4; font-weight: 600; }
.gtag { display: inline-block; background: var(--line-2); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; margin: 1px 2px; color: var(--ink-2); white-space: nowrap; }
.tnode.zero rect.box { fill: #faf8f6; stroke-dasharray: 4 3; }
.tnode.zero text { fill: var(--muted); }
.tnode text.tv { font-size: 10.5px; fill: var(--brand-ink); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tnode text.ts { font-size: 10.5px; fill: var(--muted); font-weight: 600; }
.tcol { font-size: 11px; fill: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }

/* heatmap */
.heat { table-layout: fixed; }
.heat th:first-child { width: 44px; }
.heat th.tot, .heat td.tot { width: 58px; font-weight: 700; color: var(--ink); background: #fff; font-size: 12px; text-align: center; }
.heat td.tot { border-left: 2px solid var(--line); }
.heat tr.totrow td.tot { border-top: 2px solid var(--line); border-left: 0; background: #fff; }
.heat tr.totrow td.grand { background: var(--brand-soft); border-left: 2px solid var(--line); }
.heat tr.totrow th { font-weight: 700; color: var(--ink); }
.heat td { height: 26px; text-align: center; font-size: 10.5px; border: 2px solid #fff; border-radius: 4px; font-variant-numeric: tabular-nums; }
.heat th { font-size: 11px; color: var(--muted); font-weight: 500; padding: 2px; }
.heat { border-collapse: separate; border-spacing: 0; width: 100%; }

/* live */
.live-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.live-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; }
.live-item .who { flex: 1; min-width: 0; }
.live-item .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item .t { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(47, 39, 44, .28); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 96vw); background: #fff; z-index: 51; box-shadow: -8px 0 30px rgba(0,0,0,.12); overflow: auto; padding: 22px 24px; }
.drawer h3 { margin: 0 0 4px; font-size: 18px; }
.drawer .close { position: absolute; top: 14px; right: 16px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { border-left: 2px solid var(--line); margin: 8px 0 8px 6px; padding-left: 16px; }
.tl { position: relative; padding: 6px 0 10px; }
.tl::before { content: ""; position: absolute; left: -22px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--axis); }
.tl.ans::before { border-color: var(--s-answered); background: var(--s-answered); }
.tl.unans::before { border-color: var(--s-abandoned); }
.tl .h { font-weight: 600; }
.tl .d { font-size: 12px; color: var(--muted); }

/* forms */
.form-grid { display: grid; grid-template-columns: 190px 1fr; gap: 10px 14px; align-items: center; max-width: 760px; }
.form-grid label { color: var(--ink-2); font-size: 13px; }
.form-grid .inp { width: 100%; }
.msg { padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0; }
.msg.ok { background: #e9f6ee; color: #135c33; }
.msg.err { background: #fdecec; color: #8f2020; }
.msg.info { background: var(--brand-soft); color: var(--brand-deep); }
.drop { display: block; margin-top: 8px; border: 2px dashed #ddd3cb; border-radius: 12px; padding: 38px; text-align: center; background: #fdfbf9; cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.kvtable td { padding: 4px 6px; }
.kvtable input { width: 100%; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, var(--brand-faint), var(--page) 55%); }
.login form { background: #fff; padding: 34px 36px; border-radius: 16px; width: 380px; box-shadow: 0 10px 40px rgba(75,63,71,.12); border: 1px solid var(--line); }
.login img { max-width: 240px; max-height: 200px; width: auto; height: auto; display: block; margin: 0 auto 26px; }
.login .f { margin-bottom: 14px; }
.login .f input { width: 100%; }
.login .btn { width: 100%; justify-content: center; margin-top: 6px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* ---------- barre de filtres épurée, toujours visible ---------- */
#fb { position: sticky; top: var(--toph, 66px); z-index: 19; background: var(--page); padding: 2px 0 10px; margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
#fb.stuck { box-shadow: 0 8px 12px -10px rgba(75, 63, 71, .25); }
.fbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dd { position: relative; }
.ddbtn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; font-size: 13.5px; white-space: nowrap; box-shadow: var(--shadow); }
.ddbtn:hover, .dd.open .ddbtn { border-color: #d3cac3; }
.ddbtn b { font-weight: 600; }
.ddbtn svg, .search svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); margin-left: 2px; }
.cnt { background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(47, 39, 44, .16); padding: 10px; width: 330px; }
.pop.right { left: auto; right: 0; }
.dd.open .pop { display: block; }
.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.prow:hover { background: var(--line-2); }
.prow.on { font-weight: 600; }
.prow .ck { width: 16px; color: var(--brand-ink); font-weight: 700; }
.pfoot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.pfoot .lab, .pf > label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.pfoot .inp { font-size: 12.5px; padding: 5px 6px; min-height: 32px; }
.pf { margin-bottom: 12px; }
.pf .inp { width: 100%; }
.pf .row .inp { width: auto; }
.crow { display: flex; align-items: center; gap: 9px; padding: 6px 4px; cursor: pointer; font-size: 13.5px; border-radius: 6px; }
.crow:hover { background: var(--line-2); }
.crow input { accent-color: var(--ink); }
.search { flex: 1; min-width: 220px; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.search input { border: 0; outline: none; flex: 1; min-width: 0; background: none; font-size: 13.5px; }
.achips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.achips:empty { display: none; }
.achip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-deep); border-radius: 999px; padding: 3px 4px 3px 11px; font-size: 12.5px; }
.achip button { border: 0; background: none; cursor: pointer; color: var(--brand-ink); font-size: 15px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; }
.achip button:hover { background: rgba(0, 0, 0, .07); }
.linkbtn { border: 0; background: none; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 12.5px; }
.demo-pill { background: var(--brand-soft); color: var(--brand-deep); border: 1px solid var(--brand-line); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 4px 10px; cursor: help; }

/* ---------- sélecteur de période (deux fenêtres) ---------- */
.pop.period-pop { width: auto; padding: 0; overflow: hidden; }
.pp { display: grid; grid-template-columns: 190px auto; }
.pp-left { background: #fbf8f5; border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; }
.pp-left .prow.on { background: var(--brand-soft); }
.pp-right { padding: 14px 18px 14px; }
.calnav { display: flex; justify-content: space-between; align-items: center; margin-bottom: -26px; position: relative; z-index: 1; pointer-events: none; }
.navb { pointer-events: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 17px; line-height: 1; color: var(--ink-2); }
.navb:hover { border-color: var(--brand); color: var(--ink); }
.cals { display: flex; gap: 26px; }
.cal { width: 252px; }
.calh { text-align: center; font-weight: 600; text-transform: capitalize; height: 30px; line-height: 30px; margin-bottom: 6px; }
.calw, .calg { display: grid; grid-template-columns: repeat(7, 36px); }
.calw span { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cd { height: 34px; border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--ink); position: relative; font-variant-numeric: tabular-nums; }
.cd:hover { background: var(--line-2); border-radius: 8px; }
.cd.future { color: #c4bcb6; }
.cd.in { background: var(--brand-soft); border-radius: 0; }
.cd.start, .cd.end { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.cd.start { border-radius: 8px 0 0 8px; }
.cd.end { border-radius: 0 8px 8px 0; }
.cd.start.end { border-radius: 8px; }
.cd.today::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--brand-ink); }
.cd.start.today::after, .cd.end.today::after { display: none; }
.pp-times { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tbox { flex: 1; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.tbox .lab { grid-column: 1 / 3; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.tbox b { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.pp-times .arrow { color: var(--muted); }
.tinp { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 13px; background: #fff; color: var(--ink); outline: none; }
.tinp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.tinp::-webkit-calendar-picker-indicator { opacity: .5; }
.pp-slice { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.pp-slice .lab, .pp .lab { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.wds { display: flex; gap: 4px; }
.wd { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 7px; font-size: 12.5px; cursor: pointer; }
.wd.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pp-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .cals .cal + .cal { display: none; } }

/* ---------- équipe ---------- */
table.team td { vertical-align: top; padding: 10px 12px; }
.reg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cfc8c3; margin-right: 7px; vertical-align: 1px; }
.reg.on { background: var(--s-answered); box-shadow: 0 0 0 3px rgba(31, 157, 85, .15); }
.gtag.dept { background: #efeaf6; color: #4a3c7a; }
table.hgrid { table-layout: fixed; min-width: 900px; }
table.hgrid th:first-child { width: 230px; }
table.hgrid th.today, table.hgrid td.today { background: var(--brand-faint); }
table.hgrid td { vertical-align: top; padding: 10px 8px; }
table.hgrid tr.hot .hlab b { color: var(--brand-ink); }
.hbar { position: relative; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; margin-bottom: 5px; }
.hbar span { position: absolute; top: 0; bottom: 0; background: var(--s-answered); border-radius: 5px; }
tr.hot .hbar span { background: var(--brand); }
.hbar.off { background: repeating-linear-gradient(45deg, #f1ece8, #f1ece8 4px, #f8f5f2 4px, #f8f5f2 8px); }
.htxt { font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.opennow { display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.opennow.on { background: #e9f6ee; color: #157a41; }

/* ---------- journal lisible ---------- */
table.jt { font-size: 13.5px; }
table.jt th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 10px 12px; }
table.jt td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
table.jt tr.jr-row td:first-child { box-shadow: inset 4px 0 0 var(--st); padding-left: 16px; }
table.jt tr.jr-row:hover td { background: #fbf8f4; }
table.jt tr.jr-day td { background: #f8f5f1; font-weight: 600; font-size: 13px; padding: 8px 16px; border-top: 1px solid var(--line); text-transform: none; }
table.jt tr.jr-day td::first-letter { text-transform: uppercase; }
.jr-time b { font-size: 14px; font-variant-numeric: tabular-nums; }
.jr-who { display: flex; align-items: center; gap: 10px; }
.jr-dir { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.jr-dir.in { background: #e9f6ee; color: #157a41; }
.jr-dir.out { background: #e8f0fb; color: #1d5fae; }
.jr-dir.int { background: var(--line-2); color: var(--ink-2); }
.jr-route { color: var(--ink-2); font-size: 12.5px; }
.jr-arr { font-style: normal; color: var(--axis); margin: 0 6px; }
.jr-out { color: #1d5fae; font-size: 12.5px; }

/* ---------- statistiques par jour : galerie, choix du jour, page du jour ---------- */
.wk-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wk { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.wk:hover { border-color: var(--brand); transform: translateY(-1px); }
.wk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; }
.wk-h b { font-size: 15px; }
.wk-h .muted { font-size: 12px; white-space: nowrap; }
.wk-big { font-size: 28px; font-weight: 600; letter-spacing: -.3px; }
.wk-big small { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.wk-kpis { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.wk-kpis span { display: inline-flex; align-items: center; gap: 5px; }
.wk-kpis .sw { width: 8px; height: 8px; border-radius: 50%; }
.wk-kpis .bad { color: var(--s-abandoned); font-weight: 600; }
.wk-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; height: 54px; margin-top: 6px; align-items: end; }
.wk-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.wk-bar span { width: 100%; max-width: 22px; background: var(--brand-mid); border-radius: 3px 3px 0 0; min-height: 0; }
.wk:hover .wk-bar span { background: var(--brand); }
.wk-bar i { font-style: normal; font-size: 10px; color: var(--muted); }
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dg-h { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.dg { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 9px; cursor: pointer; min-height: 104px; }
.dg:hover { border-color: var(--brand); background: var(--brand-faint); }
.dg.empty { background: #faf8f6; }
.dg.future { opacity: .4; cursor: default; }
.dg-d { font-weight: 600; font-size: 13px; }
.dg-d small { font-weight: 500; color: var(--muted); }
.dg-n { font-size: 20px; font-weight: 600; }
.dg .minibar { margin-top: auto; }
.modal.wide { width: min(1120px, 96vw); }
.mnav { position: fixed; top: 50%; z-index: 52; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .16); display: grid; place-items: center; padding-bottom: 4px; }
.mnav:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.mnav:disabled { opacity: .35; cursor: default; }
.mnav.prev { left: max(8px, calc(50% - min(560px, 48vw) - 64px)); }
.mnav.next { right: max(8px, calc(50% - min(560px, 48vw) - 64px)); }
.wk-sum { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.wk-left { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 8px 18px; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 18px; background: #fdfcfb; }
.wk-total { text-align: right; }
.wk-total .num { font-size: 34px; font-weight: 600; letter-spacing: -.5px; line-height: 1; }
.wk-total > div:nth-child(2) { color: var(--ink-2); font-size: 13px; }
.wk-legend { grid-column: 1 / 3; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.wk-legend > div { display: grid; grid-template-columns: 14px 1fr 50px 44px; align-items: center; gap: 6px; }
.wk-legend b { text-align: right; }
.wk-legend .muted { text-align: right; }
.wk-extra { display: block !important; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.wk-right { min-width: 0; }
.wk-right table.t th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.wk-right table.t td, .wk-right table.t th { padding: 7px 7px; }
@media (max-width: 1000px) { .wk-sum { grid-template-columns: 1fr; } }
.day-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.day-title { font-size: 16px; min-width: 230px; text-align: center; }
.day-title::first-letter { text-transform: uppercase; }
.day-kpis { grid-template-columns: repeat(4, 1fr) !important; }
@media (max-width: 1000px) { .day-kpis { grid-template-columns: repeat(2, 1fr) !important; } }
.kpi.alert { background: #fff6f5; border-color: #f3c9c6; }
.kpi.alert .val { color: var(--s-abandoned); }

/* ---------- onglets du tableau de bord ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; }
.tab { border: 0; background: none; padding: 9px 14px 11px; font-size: 14px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tcnt { background: var(--s-abandoned); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- schéma : bouton déplier + fenêtre de détail ---------- */
.ttog { cursor: pointer; }
.ttog circle { fill: #fff; stroke: var(--axis); stroke-width: 1.2; }
.ttog path { stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.ttog:hover circle { fill: var(--brand); stroke: var(--brand); }
.ttog:hover path { stroke: var(--on-brand); }
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, 94vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); padding: 24px 28px; }
.modal h3 { margin: 4px 0 4px; font-size: 20px; font-weight: 600; }
.modal h4 { margin: 22px 0 8px; font-size: 14px; }
.modal .close { position: absolute; top: 16px; right: 18px; }
.crumbs { color: var(--muted); font-size: 12.5px; }
.crumbs span { margin: 0 4px; }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.mstat { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fdfcfb; }
.mstat .sw { margin-top: 4px; }
.mstat .l { font-size: 12px; color: var(--ink-2); }
.mstat .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
.mstat .s { font-size: 12px; color: var(--muted); }
.mbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 16px 0 8px; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.kid { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; cursor: pointer; font-size: 13px; }
.kid:hover { border-color: var(--brand); }
.kid > span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
