/* Zelio Pulse design system (2026-11 refresh): light sidebar, warm neutrals, one indigo accent (#4263eb), Inter. */
@font-face { font-family: "Inter Variable"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* warm neutrals (zinc family), one indigo accent; every text pair ≥ 4.65:1 (checked) */
  --app-bg: #f7f7f8; --app-surface: #fff; --app-surface-2: #fafafa; --app-border: #ececef; --app-border-strong: #dcdce1;
  --app-text: #18181b; --app-muted: #5c5c66; --app-faint: #6b6b75; --app-sidebar: #fbfbfb; --app-hover: #f1f1f3;
  --app-pos: #1d7a36; --app-neg: #b42318; --app-warn: #b63c0d;
  --indigo-0: #eef1ff; --indigo-1: #dde3ff; --indigo-3: #91a7ff; --indigo-5: #5c7cfa; --indigo-7: #4263eb; --indigo-9: #364fc7;
  --accent: var(--indigo-7); --accent-soft: var(--indigo-0); --accent-ink: var(--indigo-9);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04); --shadow-md: 0 8px 24px -6px rgba(24, 24, 27, .10), 0 2px 6px rgba(24, 24, 27, .04);
  --shadow-lg: 0 24px 48px -12px rgba(24, 24, 27, .18);
  --radius: 12px; --radius-sm: 8px; --topbar-h: 56px; --sidebar-w: 248px;
  --c-green: #2f9e44; --c-red: #e03131; --c-orange: #e8590c; --c-blue: #748ffc; --c-grey: #a1a1aa; --c-violet: #7048e8;
  --chat-bg: #efeae2; --chat-in: #fff; --chat-out: #d9fdd3;
  --ch-won: #2f9e44; --ch-other: #91a7ff; --ch-none: #f03e3e; --ch-line: #e8590c; --skel: #ececef;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --app-bg: #0e0e11; --app-surface: #16161a; --app-surface-2: #1a1a1f; --app-border: #26262d; --app-border-strong: #34343c;
  --app-text: #ececef; --app-muted: #a1a1aa; --app-faint: #8f8f99; --app-sidebar: #121215; --app-hover: #202026;
  --app-pos: #69db7c; --app-neg: #ff8787; --app-warn: #ffa94d;
  --accent: #748ffc; /* links: #4263eb on the dark surface was 3.5:1, this is 6.1:1 (WCAG AA 4.5) */
  --accent-soft: rgba(116, 143, 252, .14); --accent-ink: #bac8ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, .7);
  --chat-bg: #0b141a; --chat-in: #202c33; --chat-out: #005c4b;
  --ch-won: #51cf66; --ch-other: #5c7cfa; --ch-none: #ff6b6b; --ch-line: #ff922b; --skel: #232329;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--app-bg); color: var(--app-text); -webkit-font-smoothing: antialiased; }
body { font: 14px/1.5 "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif; font-feature-settings: "cv11", "ss01"; letter-spacing: -.003em; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--app-muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; }

/* ---------------- shell: one light sidebar + slim top bar (+ bottom bar on phones) ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; z-index: 50; display: flex; flex-direction: column;
  background: var(--app-sidebar); border-inline-end: 1px solid var(--app-border); }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; min-height: 64px; }
.sb-logo { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; }
.sb-logo img { width: 30px; height: 30px; }
.sb-org { display: grid; min-width: 0; flex: 1; }
.sb-org-name { font-weight: 600; font-size: 14px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-org-sub { font-size: 11.5px; color: var(--app-faint); }
.sb-org .coswitch { height: 30px; font-weight: 600; font-size: 13px; padding: 0 6px; border-color: transparent; background-color: transparent; margin-inline-start: -6px; }
.sb-org .coswitch:hover { border-color: var(--app-border); background-color: var(--app-surface); }
.sb-head .sb-close { display: none; } /* mobile drawer only */
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 1px; }
.sb-link { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: 8px; color: var(--app-muted); font-size: 13.5px; font-weight: 500;
  width: 100%; border: 0; background: none; cursor: pointer; text-align: start; transition: background .12s, color .12s; }
.sb-link:hover { background: var(--app-hover); color: var(--app-text); }
.sb-link > .i { color: var(--app-faint); flex: none; }
.sb-link:hover > .i { color: var(--app-text); }
.sb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-link[aria-current="page"] { background: var(--app-surface); color: var(--app-text); font-weight: 600; box-shadow: 0 0 0 1px var(--app-border), var(--shadow-sm); }
.sb-link[aria-current="page"] > .i { color: var(--accent); }
.sb-group-btn > .i:last-child { width: 14px; height: 14px; transition: transform .15s; opacity: .7; }
.sb-group[data-open] .sb-group-btn > .i:last-child { transform: rotate(90deg); }
.sb-group.is-current > .sb-group-btn { color: var(--app-text); }
.sb-group.is-current > .sb-group-btn > .i:first-child { color: var(--accent); }
.sb-sub { display: none; padding: 2px 0 6px 18px; margin-inline-start: 9px; border-inline-start: 1px solid var(--app-border); }
.sb-group[data-open] .sb-sub { display: grid; gap: 1px; }
.sb-link.is-sub { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.sb-sublabel { padding: 8px 10px 2px; font-size: 11px; font-weight: 500; color: var(--app-faint); letter-spacing: .01em; }
.sb-group[data-open] .sb-group-count { display: none; } /* the open group shows the count on its page instead */
.sb-spacer { flex: 1; min-height: 12px; }
.sb-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--app-border); }
.sb-avatar { width: 32px; height: 32px; font-size: 11.5px; }
.sb-user { min-width: 0; flex: 1; }
.sb-user-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-role { font-size: 11.5px; color: var(--app-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 11px; font-weight: 600; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--c-red) 12%, var(--app-surface)); color: color-mix(in srgb, var(--c-red) 70%, var(--app-text)); flex: none; }
.sb-overlay { display: none; }
/* collapsed (desktop): icons only */
.app-sidebar[data-collapsed] { width: 64px; }
.app-sidebar[data-collapsed] .sb-org, .app-sidebar[data-collapsed] .sb-label, .app-sidebar[data-collapsed] .sb-sub, .app-sidebar[data-collapsed] .sb-user,
.app-sidebar[data-collapsed] .sb-group-btn > .i:last-child, .app-sidebar[data-collapsed] .count { display: none; }
.app-sidebar[data-collapsed] .sb-head, .app-sidebar[data-collapsed] .sb-foot { justify-content: center; padding-inline: 8px; flex-direction: column; }
.app-sidebar[data-collapsed] .sb-link { justify-content: center; padding: 8px; }
.bottom-nav { display: none; }
.pane-label { padding: 12px 8px 2px; font-size: 12px; color: var(--app-faint); } /* section labels inside AI pages */

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 0 24px 0 16px;
  background: color-mix(in srgb, var(--app-bg) 80%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--app-border) 70%, transparent); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--app-muted); cursor: pointer; }
.icon-btn:hover { background: var(--app-hover); color: var(--app-text); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; white-space: nowrap; }
.crumb-parent { color: var(--app-muted); } .crumb-sep { color: var(--app-faint); } .crumb-current { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-spacer { flex: 1; }
.company { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 5px; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface); font-weight: 600; font-size: 13.5px; }
.company i { width: 28px; height: 28px; border-radius: 7px; background: var(--indigo-7); color: #fff; font-style: normal; font-size: 11.5px; display: grid; place-items: center; }
.app-content { padding: 28px 32px 56px; max-width: 1400px; width: 100%; margin: 0 auto; animation: page-in .22s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- page header + controls ---------------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; display: flex; align-items: center; gap: 10px; }
.page-title .tally { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--app-hover); color: var(--app-muted); letter-spacing: 0; }
.page-subtitle { color: var(--app-muted); font-size: 13.5px; margin-top: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--app-border); background: var(--app-surface); padding: 0 13px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 13.5px; color: var(--app-text);
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: var(--app-border-strong); background: var(--app-surface-2); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.primary { background: var(--indigo-7); color: #fff; border-color: var(--indigo-7); box-shadow: 0 1px 2px rgba(66, 99, 235, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--indigo-9); }
.btn.wa { background: #1a7f45; border-color: #1a7f45; color: #fff; } /* WhatsApp green darkened: white text 5.0:1 (was 4.1:1) */
.btn.danger { color: var(--app-neg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--app-hover); border: 1px solid var(--app-border); }
.seg button { border: 0; background: none; padding: 0 12px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--app-muted); font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--app-surface); color: var(--app-text); box-shadow: 0 0 0 1px var(--app-border), var(--shadow-sm); }
select, input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], input[type=datetime-local], input[type=date], input[type=url], input[type=tel], textarea {
  height: 36px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); padding: 0 10px; background: var(--app-surface); min-width: 0; font-size: 13.5px; outline: none;
  box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
select:hover, input:hover, textarea:hover { border-color: var(--app-border-strong); }
select:focus, input:focus, textarea:focus { border-color: var(--indigo-5); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
input[type=color] { width: 40px; height: 32px; border: 1px solid var(--app-border); border-radius: 8px; padding: 2px; background: var(--app-surface); }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 10px; top: 9px; width: 18px; height: 18px; color: var(--app-faint); }
.search input { padding-inline-start: 34px; width: 280px; }

/* ---------------- cards ---------------- */
.card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
a.card { color: inherit; transition: border-color .15s, box-shadow .15s; } a.card:hover { border-color: var(--app-border-strong); box-shadow: var(--shadow-md); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 18px 20px 4px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 16px; }
.kpi { padding: 18px 20px; }
.kpi .l { font-size: 13px; font-weight: 500; color: var(--app-muted); }
.kpi .v { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12.5px; color: var(--app-muted); margin-top: 2px; }
.kpi.bad .v { color: var(--app-neg); } .kpi.warn .v { color: var(--app-warn); } .kpi.good .v { color: var(--app-pos); }
.cols2 { grid-template-columns: 1.5fr 1fr; } .cols2e { grid-template-columns: 1fr 1fr; }
.mt { margin-top: 16px; }
@media (max-width: 1100px) { .cols2, .cols2e { grid-template-columns: 1fr; } }

/* ---------------- tables (Zelio list) ---------------- */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 12px; font-weight: 500; color: var(--app-muted); background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border); white-space: nowrap; height: 38px; padding: 0 14px; text-align: start; }
tbody td { height: 52px; padding: 6px 14px; border-bottom: 1px solid var(--app-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--app-hover); }
td.r, th.r { text-align: end; }
td.num, td.r { white-space: nowrap; }
.strong { font-weight: 600; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .muted { white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
  background: color-mix(in srgb, var(--c, var(--indigo-7)) 14%, var(--app-surface)); color: color-mix(in srgb, var(--c, var(--indigo-7)) 62%, var(--app-text)); } /* ≥ 4.5:1 on its tint (ui-check, light and dark) */
.bar { height: 6px; border-radius: 4px; background: var(--app-hover); overflow: hidden; min-width: 56px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--indigo-5); }
.cell-bar { display: flex; align-items: center; gap: 10px; } .cell-bar .bar { flex: 1; } .cell-bar span { white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: 13px; }
.tablebar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

/* status pills (Zelio): tint + dot */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, var(--p) 12%, var(--app-surface)); color: color-mix(in srgb, var(--p) 65%, var(--app-text)); } /* text ≥ 5.2:1 in both themes */
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p); }
.h-unanswered { --p: #e03131; } .h-waiting { --p: #e8590c; } .h-cold { --p: #4263eb; } .h-active { --p: #2f9e44; } .h-won { --p: #0c8599; } .h-lost { --p: #868e96; } .h-demo { --p: #868e96; } .h-qr { --p: #e8590c; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; border: 1px solid var(--app-border); background: var(--app-surface); border-radius: 99px; padding: 0 13px; box-shadow: var(--shadow-sm); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--app-muted); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--app-text); border-color: var(--app-border-strong); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }

/* charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-size: 11px; fill: var(--app-muted); font-family: inherit; }
svg.chart .gl { stroke: var(--app-border); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--app-muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; background: var(--c); }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(130px, 1.2fr) 2fr 56px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar .bar { height: 8px; }
.hbar b { text-align: end; font-weight: 600; }

/* drawer */
.overlay { position: fixed; inset: 0; background: rgba(9, 9, 11, .32); backdrop-filter: blur(3px); z-index: 60; }
.drawer { position: fixed; top: 8px; inset-inline-end: 8px; bottom: 8px; width: min(560px, calc(100% - 16px)); background: var(--app-surface); z-index: 61; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); border: 1px solid var(--app-border); border-radius: 14px; overflow: hidden; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer header { padding: 16px 18px; border-bottom: 1px solid var(--app-border); display: flex; gap: 12px; align-items: flex-start; }
.drawer header .t { flex: 1; min-width: 0; }
.drawer header h3 { margin: 0 0 2px; font-size: 17px; font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer .body { flex: 1; overflow: auto; padding: 16px 18px; background: var(--chat-bg); }
.drawer footer { border-top: 1px solid var(--app-border); padding: 14px 18px; display: grid; gap: 10px; }
.msg { max-width: 80%; padding: 7px 10px 5px; border-radius: 9px; margin: 4px 0; box-shadow: 0 1px .5px rgba(0, 0, 0, .13); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in { background: var(--chat-in); } .msg.out { background: var(--chat-out); margin-inline-start: auto; }
.msg time { display: block; text-align: end; font-size: 10.5px; color: var(--app-muted); margin-top: 2px; }
.gap, .day { text-align: center; margin: 10px 0; }
.gap span { background: #fff3bf; color: #7a4a00; font-size: 11.5px; padding: 3px 9px; border-radius: 7px; }
.day span { background: var(--app-surface); color: var(--app-muted); font-size: 11.5px; padding: 3px 9px; border-radius: 7px; box-shadow: var(--shadow-sm); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* misc */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }
.login .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; margin-bottom: 6px; }
.login .brand img { width: 34px; height: 34px; }
.err { color: var(--app-neg); font-size: 13px; }
.empty { padding: 48px 20px; text-align: center; color: var(--app-muted); }
.qr { display: grid; place-items: center; gap: 8px; padding: 10px; }
.qr img { width: 260px; height: 260px; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 6px; }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--accent-ink); padding: 12px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.note svg { margin-top: 1px; }

@media (max-width: 62em) {
  /* sidebar becomes a drawer; a bottom bar gives the 3 main places + the menu */
  .app-sidebar, .app-sidebar[data-collapsed] { position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); z-index: 70; }
  .app-sidebar[data-open] { transform: none; }
  .app-sidebar[data-collapsed] .sb-org, .app-sidebar[data-collapsed] .sb-label, .app-sidebar[data-collapsed] .sb-user, .app-sidebar[data-collapsed] .count, .app-sidebar[data-collapsed] .sb-group-btn > .i:last-child { display: revert; }
  .app-sidebar[data-collapsed] .sb-group[data-open] .sb-sub { display: grid; }
  .app-sidebar[data-collapsed] .sb-head, .app-sidebar[data-collapsed] .sb-foot { flex-direction: row; justify-content: flex-start; padding: 14px; }
  .app-sidebar[data-collapsed] .sb-link { justify-content: flex-start; padding: 6px 10px; }
  .sb-head .sb-close { display: grid; }
  .sb-link { min-height: 44px; } .sb-link.is-sub { min-height: 44px; }
  .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(9, 9, 11, .35); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .sb-overlay { opacity: 1; pointer-events: auto; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; z-index: 45;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--app-surface) 92%, transparent); backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--app-border); }
  .bottom-nav a, .bottom-nav button { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 2px 4px; border: 0; background: none; border-radius: 10px;
    color: var(--app-muted); font-size: 11px; font-weight: 500; cursor: pointer; }
  .bottom-nav [aria-current="page"] { color: var(--accent); }
  .bottom-nav .count { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; }
  .app-main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .app-content { padding: 20px 16px 32px; }
  .app-topbar { padding: 0 12px; }
  .company span { display: none; }
  .search, .search input { width: 100%; }
  .hbar { grid-template-columns: 1fr 1fr 44px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .v { font-size: 22px; }
  .filters, .filters select { width: 100%; }
}

/* ---------------- AI assistant ---------------- */
.ai-grid { display: grid; grid-template-columns: 280px minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }
.ai-grid.sim { grid-template-columns: minmax(320px, 440px) 1fr; }
@media (max-width: 1200px) { .ai-grid { grid-template-columns: 1fr 1fr; } .ai-list { grid-column: 1 / -1; display: flex; overflow-x: auto; } .ai-list .ai-item { min-width: 240px; border-bottom: 0; border-inline-end: 1px solid var(--app-border); } }
@media (max-width: 62em) { .ai-grid, .ai-grid.sim { grid-template-columns: 1fr; } }
.ai-item { display: block; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--app-border); background: none; padding: 14px 16px; cursor: pointer; }
.ai-item:last-child { border-bottom: 0; }
.ai-item:hover { background: var(--app-hover); }
.ai-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--indigo-7); }
.phone { border-radius: 26px; border: 1px solid var(--app-border); background: var(--chat-bg); box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column; height: 640px; }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
.ph-head .small { opacity: .8; }
:root[data-theme="dark"] .ph-head { background: #202c33; }
.ph-body { flex: 1; overflow-y: auto; padding: 12px; }
.phone .msg { max-width: 85%; font-size: 13.5px; }
.msg.ai { background: var(--chat-out); }
.who-ai { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--indigo-9); margin-bottom: 2px; }
:root[data-theme="dark"] .who-ai { color: #bac8ff; }
.who-ai.human { color: #1a7f45; }
.voice { display: inline-flex; align-items: center; gap: 6px; color: var(--app-muted); }
.evt { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 90%; margin: 8px auto; padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 500;
  background: color-mix(in srgb, var(--e, #4263eb) 12%, var(--app-surface)); color: color-mix(in srgb, var(--e, #4263eb) 60%, var(--app-text)); }
.evt-qualify, .evt-qualified { --e: #2f9e44; } .evt-handoff { --e: #e8590c; } .evt-info { --e: #868e96; }
.ph-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 0; background: var(--app-surface-2); }
.ph-chips .chip { flex: none; height: 28px; font-size: 12px; }
.ph-input { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--app-surface-2); }
.ph-input input { flex: 1; border-radius: 99px; height: 38px; }
.ph-send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #1a7f45; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.qrow { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--app-border); font-size: 13.5px; }
.qrow:has(> .muted:first-child) { grid-template-columns: 1fr auto; }
.qrow b { font-weight: 600; text-align: end; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .ok { width: 18px; height: 18px; border-radius: 50%; background: #2f9e44; color: #fff; display: grid; place-items: center; }
.qrow .no { width: 18px; height: 18px; border-radius: 50%; border: 1.5px dashed var(--app-border-strong); }
.cfg .card + .card, .cfg .card + .grid { margin-top: 16px; }
.cfg td input { width: 100%; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; margin-inline-end: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 36px; height: 20px; border-radius: 99px; background: var(--app-border-strong); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + span { background: var(--indigo-7); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 10px; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--indigo-5); background: var(--accent-soft); }
.mode.locked { cursor: not-allowed; opacity: .75; }
.mode input { margin-top: 3px; accent-color: var(--indigo-7); }
.aibox { border-top: 1px solid var(--app-border); padding: 12px 18px; background: var(--app-surface-2); max-height: 42vh; overflow-y: auto; }
.aibox .strong { display: inline-flex; align-items: center; gap: 6px; }
.sugg { background: var(--app-surface); border: 1px solid var(--app-border); border-inline-start: 3px solid var(--indigo-5); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.sugg-text { white-space: pre-wrap; }
.cfg .grid > .card { margin-top: 0; }

/* WhatsApp Cloud API */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-top: 0; }
.opt { border: 1px solid var(--app-border); border-radius: 10px; padding: 14px 16px; }
.opt h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 650; display: flex; gap: 6px; align-items: center; }
.opt .grid { gap: 8px; }
.opt-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.opt-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--app-surface-2); border: 1px solid var(--app-border); color: var(--app-muted); }
.opt-tag.good { color: var(--ch-won); border-color: currentColor; background: transparent; }
.opt .btn { white-space: normal; max-width: 100%; }
@media (max-width: 700px) { .opt-grid { grid-template-columns: minmax(0, 1fr); } }
.composer { border-top: 1px solid var(--app-border); padding: 10px 18px; display: grid; gap: 8px; }
.composer textarea { flex: 1; min-height: 44px; resize: vertical; }
.composer select { flex: 1; min-width: 0; }
.msg .tick { letter-spacing: -3px; margin-inline-end: 3px; } .msg .tick.read { color: #1c7ed6; }
.msg.failed { outline: 1px solid var(--app-neg); }
.msg .mimg { max-width: 220px; max-height: 220px; border-radius: 6px; display: block; }
.msg audio { width: 220px; height: 34px; }
@media (max-width: 62em) { .grid2 { grid-template-columns: 1fr; } }

/* roles, platform, integrations */
.coswitch { height: 36px; max-width: 220px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.kv span { color: var(--app-muted); }
.card h2 .pill { margin-inline-start: 8px; vertical-align: middle; }
.card h3 { font-size: 14px; margin: 0 0 6px; }
code { background: var(--app-bg, #f1f3f5); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* pillars */
.reco h2 { font-size: 15px; }
.mb { margin-bottom: 12px; }
.c360 { border-top: 1px solid var(--app-border); padding: 10px 18px; display: grid; gap: 6px; font-size: 13px; }
.c360 .kv { grid-template-columns: repeat(4, auto); justify-content: start; gap: 2px 18px; font-size: 13px; }
.picker { position: relative; }
.picker .list { position: absolute; bottom: 100%; inset-inline-start: 0; inset-inline-end: 0; max-height: 240px; overflow: auto; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 10px; box-shadow: var(--shadow-md); z-index: 5; }
.picker .list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: start; border: 0; background: none; padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--app-text); }
.picker .list button:hover { background: var(--app-hover); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.pillar { padding: 14px 18px; }
.pillar .t { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--app-muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.pillar .row { margin-top: 6px; gap: 18px; }
.pillar b { font-size: 18px; }
@media (max-width: 62em) { .pillars { grid-template-columns: 1fr; } .c360 .kv { grid-template-columns: 1fr 1fr; } }
a.card { color: inherit; text-decoration: none; } a.card:hover { border-color: var(--app-border-strong); }
/* engineering audit: attribution review, consent banner */
.warnbox { border-inline-start: 3px solid var(--app-warn, #b7791f); padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
td .btn.sm { margin: 3px 3px 0 0; }
/* Revenue Recovery: queue cards, task rows, modal, bell (mobile first) */
.rc-chips { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.on { border-color: var(--indigo-7); color: var(--app-text); background: var(--app-hover); }
.rc-list { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 18px; }
@media (min-width: 1100px) { .rc-list { grid-template-columns: 1fr 1fr; } }
.rc { display: grid; gap: 7px; padding: 14px 16px; }
.rc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rc-type { font-weight: 600; font-size: 13.5px; }
.rc-due { margin-inline-start: auto; font-size: 12.5px; color: var(--app-muted); display: inline-flex; gap: 4px; align-items: center; }
.late { color: var(--app-neg); font-weight: 600; }
.rc-who { font-size: 15px; }
.rc-why { font-size: 13.5px; }
.rc-next { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; color: var(--indigo-7); }
.rc-next .i { flex: none; margin-top: 2px; }
.rc-msgs { display: grid; gap: 3px; padding: 8px 10px; border-radius: 8px; background: var(--app-hover); overflow-wrap: anywhere; }
.rc-score summary { cursor: pointer; color: var(--app-muted); }
.rc-score ul { margin: 6px 0 0; padding-inline-start: 18px; }
.rc-score .num { display: inline-block; min-width: 30px; font-weight: 600; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-actions select.sm { height: 30px; font-size: 12.5px; }
.rc-mini { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.rbox { margin: 0 16px 10px; padding: 10px 12px; }
.rbox .quote, .zmodal .quote { margin: 4px 0; padding: 6px 10px; border-inline-start: 3px solid var(--app-border-strong); color: var(--app-muted); }
.myday-block { margin-bottom: 22px; }
.myday-block h2, .sec-title { font-size: 16px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.pad { padding: 6px 0 4px; }
.empty-rich { padding: 22px; display: grid; gap: 6px; text-align: center; }
.trow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--app-border); }
.trow:last-child { border-bottom: 0; }
.trow-main { min-width: 0; flex: 1 1 280px; display: grid; gap: 3px; overflow-wrap: anywhere; }
.trow-act { display: flex; flex-wrap: wrap; gap: 6px; }
.zmodal { position: fixed; z-index: 61; inset-inline-start: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 10px; padding: 18px; }
.zmodal h3 { margin: 0; }
.zmodal .f, .rule .f { display: grid; gap: 4px; font-size: 13px; }
.zmodal input, .zmodal select, .zmodal textarea { width: 100%; }
.zmodal .row, .rule .row { flex-wrap: wrap; gap: 6px; }
.rule { display: grid; gap: 10px; margin-bottom: 10px; }
.rule .f { flex: 1 1 180px; }
.icon-btn.bell { position: relative; }
.icon-btn.bell .dotbadge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--c-red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.icon-btn.bell .dotbadge[hidden] { display: none; }
.bellpanel { position: fixed; z-index: 70; top: 56px; inset-inline-end: 12px; width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; padding: 10px 0; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.15)); }
.bellpanel > .row { padding: 0 12px 8px; }
.nrow { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--app-border); cursor: pointer; }
.nrow.unread { background: var(--app-hover); }
.nrow .ndot { width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; background: var(--p); }
.pref { margin-top: 6px; }
.defs summary { cursor: pointer; font-weight: 600; } .defs ul { margin: 8px 0; padding-inline-start: 18px; } .defs li { margin: 3px 0; }

/* ---------------------------------------------------------------- shared design rules */
/* one focus ring for every interactive element (keyboard users) */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--indigo-5); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.t-bad { color: var(--app-neg); } .t-warn { color: var(--app-warn); } .t-ok { color: var(--app-pos); }
.skel-wrap { display: grid; gap: 10px; padding: 4px 0; }
.skel { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--skel) 0%, var(--app-surface-2) 50%, var(--skel) 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.chart-data { margin-top: 8px; } .chart-data summary { cursor: pointer; color: var(--app-muted); }

/* ---------------------------------------------------------------- dashboard (premium refinement; scoped to #main.dash)
   4 px spacing scale · radius 12 (cards) / 10 (controls) · one indigo accent · status = dot + text, never colour alone */
.dash { --d-gap: 16px; --d-pad: 20px; --d-radius: 12px; --d-link: var(--accent-ink); --dot-ok: var(--app-pos); --dot-warn: var(--app-warn); --dot-bad: var(--app-neg);
  --dot-info: var(--indigo-5); --dot-off: var(--c-grey); }
:root[data-theme="dark"] .dash { --dot-info: var(--indigo-3); --dot-off: #5c6370; }
.dash .card { border-radius: var(--d-radius); padding: var(--d-pad); box-shadow: none; }
.dash h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }

/* header + toolbar */
.dash-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.dash-titles { min-width: 0; }
.dash .page-title { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.dash-sub { margin: 4px 0 0; color: var(--app-muted); font-size: 13.5px; }
.dash-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-toolbar .seg { border-radius: 10px; padding: 3px; }
.dash-toolbar .seg button { height: 30px; border-radius: 7px; padding: 0 12px; font-size: 13px; }
.dash-toolbar select { height: 36px; border-radius: 10px; max-width: 210px; font-size: 13px; background-color: var(--app-surface); }

/* KPI cards: label / value / detail rows aligned across cards (subgrid) */
.dash-kpis { display: grid; gap: var(--d-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--d-gap); }
.dkpi { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; padding: 18px 20px; color: inherit; position: relative; }
.dkpi .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dkpi .l { font-size: 13px; font-weight: 500; color: var(--app-muted); line-height: 1.35; }
.dkpi .kpi-ic { color: var(--app-faint); display: inline-flex; flex: none; opacity: .8; }
.dkpi .v { font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin: 0; align-self: end; white-space: nowrap; }
.dkpi .s { font-size: 12.5px; color: var(--app-muted); line-height: 1.45; margin: 0; }
.dkpi.bad .v { color: var(--app-neg); } .dkpi.warn .v { color: var(--app-warn); }
a.dkpi { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.dkpi:hover { border-color: var(--app-border-strong); box-shadow: var(--shadow-md); }
a.dkpi .kpi-ic { color: var(--d-link); opacity: 0; transform: translateX(-3px); transition: opacity .15s, transform .15s; }
a.dkpi:hover .kpi-ic, a.dkpi:focus-visible .kpi-ic { opacity: 1; transform: none; }
.dkpi.is-loading { row-gap: 12px; } .dkpi .skel-lg { height: 22px; }

/* layout */
.dash-main { display: grid; gap: var(--d-gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: var(--d-gap); align-items: start; }
.dash-export { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--d-gap); }
.dash-pair { display: grid; gap: var(--d-gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: var(--d-gap); align-items: start; }

/* section header */
.dash-h { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.dash-h > .legend { flex-wrap: wrap; justify-content: flex-end; }
.dash-h-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.dash-h-meta { font-size: 12.5px; font-weight: 500; color: var(--app-muted); margin-inline-start: 4px; }
.dash-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--d-link); white-space: nowrap; border-radius: 6px; }
.dash-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dash-foot { margin-top: 12px; font-size: 12.5px; color: var(--app-muted); line-height: 1.5; }
.dash-foot a { color: var(--d-link); display: inline-flex; align-items: center; gap: 6px; }

/* status dots (meaning is always also in the text next to them) */
.dash-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--dot-off); }
.dash-dot.t-ok { background: var(--dot-ok); } .dash-dot.t-warn { background: var(--dot-warn); } .dash-dot.t-bad { background: var(--dot-bad); }
.dash-dot.t-info { background: var(--dot-info); } .dash-dot.t-off, .dash-dot.t-muted { background: var(--dot-off); }
.dash .t-info { color: var(--dot-info); } .dash .t-muted, .dash .t-off { color: var(--app-muted); }

/* À traiter maintenant: the operational section, full-bleed rows */
.dash .dash-attn { padding: 0; overflow: hidden; border-top: 2px solid var(--indigo-7); }
.dash-attn > .dash-h { padding: 18px var(--d-pad) 0; margin-bottom: 10px; }
.dash-attn > .dash-foot, .dash-attn > .dash-error, .dash-attn > .dash-empty, .dash-attn > .skel-wrap { margin: 0; padding: 12px var(--d-pad) 16px; }
.dash-counts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 var(--d-pad) 12px; font-size: 12.5px; color: var(--app-muted); }
.dash-count { display: inline-flex; align-items: center; gap: 6px; } .dash-count b { color: var(--app-text); font-weight: 600; }
.dash-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--app-border); }
.dash-item { width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--app-border); border-radius: 0; cursor: pointer; color: inherit;
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; padding: 12px var(--d-pad); min-height: 56px; transition: background .12s; }
.dash-item:hover { background: var(--app-hover); }
.dash-item:focus-visible { outline-offset: -2px; border-radius: 0; }
.dash-item > .dash-dot { margin-top: 6px; }
.dash-item-main { display: grid; gap: 2px; min-width: 0; }
.dash-item-who { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-what { font-size: 12.5px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-what > span:first-child { font-weight: 600; }
.dash-item-next { font-size: 13px; color: var(--app-text); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-when { font-size: 12.5px; color: var(--app-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.dash-item-when.is-late { color: var(--app-neg); font-weight: 500; }
.dash-attn .dash-foot { border-top: 0; }
.dash-empty { display: flex; align-items: center; gap: 12px; padding: 20px var(--d-pad) 24px; }
.dash-empty-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--app-pos) 14%, transparent); color: var(--app-pos); flex: none; }

/* État */
.slist { list-style: none; margin: 0; padding: 0; display: grid; }
.srow { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--app-border); }
.srow:first-child { border-top: 0; padding-top: 0; }
.srow-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--app-surface-2); border: 1px solid var(--app-border); color: var(--app-muted); }
.srow-title { font-weight: 600; font-size: 13.5px; }
.srow-text { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; color: var(--app-muted); line-height: 1.45; margin-top: 2px; }
.srow-text .dash-dot { transform: translateY(-1px); }
.srow-link { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--app-muted); }
.srow-link:hover { background: var(--app-hover); color: var(--d-link); }

/* chart */
.dash-legend { margin: 0; gap: 14px; font-size: 12px; }
.dash-trend .chart { width: 100%; height: auto; }
.dash-trend .chart text, #hours .chart text { font-size: 11.5px; fill: var(--app-muted); }
.dash-trend .chart .gl { stroke-dasharray: 2 4; }
.dash-trend .chart-data summary, .dash-trend .dash-foot { font-size: 12.5px; }

/* team */
.tlist { display: grid; }
.trow2 { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 8px 6px; min-height: 48px;
  border-top: 1px solid var(--app-border); color: inherit; border-radius: 0; }
.trow2:hover { background: var(--app-hover); }
.trow2-head { min-height: 0; padding: 0 6px 8px; border-top: 0; font-size: 11.5px; font-weight: 500; color: var(--app-muted); text-transform: uppercase; letter-spacing: .04em; }
.trow2-head:hover { background: none; }
.trow2-head span:not(:first-child) { text-align: end; }
.trow2 .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trow2 .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.trow2 .who .strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow2 .num { text-align: end; font-size: 13.5px; }

/* acquisition */
.alist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.arow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; }
.aname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anum { flex: none; white-space: nowrap; font-size: 13px; } .anum b { font-weight: 600; }
.abar { height: 4px; border-radius: 2px; background: var(--app-hover); margin-top: 6px; overflow: hidden; }
.abar i { display: block; height: 100%; border-radius: 2px; background: var(--indigo-5); opacity: .85; }

/* states */
.dash-error { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; }
.dash-error-msg { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--app-neg); }
.dash-error-msg .i { flex: none; margin-top: 1px; }
.dash-kpis > .dash-error { grid-column: 1 / -1; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--d-radius); padding: 14px var(--d-pad); }
.dash-start { display: flex; gap: 12px; align-items: flex-start; margin-bottom: var(--d-gap); }
.dash-start-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.dash-start a { color: var(--d-link); }

/* responsive */
@media (max-width: 1280px) { .dash-header { align-items: flex-start; } .dash-toolbar { width: 100%; } }
@media (max-width: 1100px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-main, .dash-pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 62em) {
  .dash { --d-gap: 12px; --d-pad: 16px; }
  .dash-header { margin-bottom: 16px; }
  .dash .page-title { font-size: 20px; }
  /* touch: every control and link at least 44 px high */
  .dash-toolbar .seg button { min-height: 44px; height: 44px; }
  .dash-toolbar select { min-height: 44px; }
  .dash-link, .dash-foot a, .srow-link, .chart-data summary, .dash-error .btn { min-height: 44px; display: inline-flex; align-items: center; }
  .dash-start a { padding-block: 12px; } /* bigger touch area, the sentence stays on its line */
  .srow-link { width: 44px; justify-content: center; }
  .dkpi { padding: 14px 16px; }
  .dkpi .v { font-size: 24px; }
  .dash-item { padding: 12px var(--d-pad); }
}
@media (max-width: 600px) {
  .dash-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .dash-toolbar .seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-toolbar .seg button { padding: 0 4px; }
  .dash-toolbar select { max-width: none; width: 100%; }
  .dash-toolbar select:only-of-type { grid-column: 1 / -1; }
  .dkpi .v { font-size: clamp(19px, 6vw, 24px); }
  .dkpi .l { font-size: 12.5px; }
  .dkpi .kpi-ic { display: none; }
  .dash-item { gap: 2px 10px; }
  .dash-item-when { font-size: 12px; }
  .dash-item-next { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .dash-trend .dash-h { flex-wrap: wrap; } .dash-trend .dash-h > .legend { justify-content: flex-start; } /* other headers keep their link on the right */
  .dash-h-meta { margin-inline-start: 0; }
  .dash-toolbar select { font-size: 12.5px; padding-inline-end: 22px; text-overflow: ellipsis; }
  .trow2 { grid-template-columns: minmax(0, 1fr) repeat(3, 52px); gap: 6px; padding-inline: 2px; }
  .trow2-head { font-size: 10.5px; letter-spacing: .02em; }
  .trow2 .avatar { width: 24px; height: 24px; font-size: 10px; }
  .trow2 .who { gap: 8px; }
  .trow2 .c-leads { display: none; }
  .arow { flex-wrap: wrap; gap: 2px 12px; } .aname { flex-basis: 100%; }
}

/* Respect the system "reduce motion" setting everywhere (page entry, drawer slide, hovers, skeletons). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Arabic (or mixed) messages: each paragraph takes the direction of its own text (RTL for Arabic) */
.msg { unicode-bidi: plaintext; text-align: start; }

/* ---------------- Automatisations: workflow editor (palette · canvas · settings) ---------------- */
.app-content.wf-main { max-width: none; padding: 0; animation: none; }
.wf { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); min-height: 520px; }
.wf-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--app-border); background: var(--app-surface); flex-wrap: wrap; }
.wf-bar > a.btn:first-child svg { transform: rotate(180deg); }
.wf-bar .switch { margin-inline-end: 0; }
.wf-title { font-size: 15px; font-weight: 600; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 8px; min-width: 200px; }
.wf-title:hover, .wf-title:focus { border-color: var(--app-border); background: var(--app-surface); }
.wf-problems { padding: 8px 16px; background: color-mix(in srgb, var(--c-orange) 10%, var(--app-surface)); color: var(--app-warn); display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--app-border); }
.wf-problems[hidden] { display: none; }
.wf-body { flex: 1; display: grid; grid-template-columns: 230px 1fr 320px; min-height: 0; }
.wf-palette, .wf-panel { overflow-y: auto; padding: 14px; background: var(--app-surface); }
.wf-palette { border-inline-end: 1px solid var(--app-border); }
.wf-panel { border-inline-start: 1px solid var(--app-border); display: flex; flex-direction: column; gap: 10px; }
.wf-panel h2 { margin: 0; }
.wf-panel textarea, .wf-panel input:not([type=checkbox]), .wf-panel select { width: 100%; }
.wf-panel .switch { margin-inline-end: 0; }
.wf-panel .mt { margin-top: 4px; }
.wf-pgroup { display: grid; gap: 6px; margin-bottom: 14px; }
.wf-pitem { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface); cursor: grab; box-shadow: var(--shadow-sm); user-select: none; }
.wf-pitem:hover { border-color: var(--c); }
.wf-pitem:active { cursor: grabbing; }
.wf-pitem b { display: block; font-size: 13px; }
.wf-pitem small { display: block; color: var(--app-muted); font-size: 11.5px; line-height: 1.35; }
.wf-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c); }
.wf-canvas { position: relative; overflow: hidden; background-color: var(--app-bg); cursor: default; outline: none; touch-action: none;
  background-image: radial-gradient(circle, var(--app-border-strong) 1px, transparent 1.2px); }
.wf-world { position: absolute; inset-inline-start: 0; top: 0; transform-origin: 0 0; }
.wf-edges { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.wf-edges .line { fill: none; stroke: var(--app-faint); stroke-width: 2; }
.wf-edges .yes .line { stroke: var(--c-green); }
.wf-edges .no .line { stroke: var(--c-red); }
.wf-edges .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.wf-edges g:hover .line, .wf-edges .sel .line { stroke: var(--accent); stroke-width: 3; }
.wf-edges .temp { stroke: var(--accent); stroke-dasharray: 6 4; }
.wf-node { position: absolute; width: 220px; background: var(--app-surface); border: 1px solid var(--app-border-strong); border-top: 3px solid var(--c); border-radius: 10px;
  box-shadow: var(--shadow-md); cursor: grab; user-select: none; }
.wf-node.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.wf-node.drop { box-shadow: 0 0 0 3px var(--c-green), var(--shadow-md); }
.wf-nhead { display: flex; align-items: center; gap: 8px; padding: 9px 12px 4px; font-size: 13px; }
.wf-nhead .wf-ico { width: 22px; height: 22px; border-radius: 6px; }
.wf-nbody { padding: 0 12px 8px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.wf-outs { display: grid; gap: 4px; padding: 0 0 8px; }
.wf-out { display: flex; justify-content: flex-end; align-items: center; gap: 6px; height: 16px; color: var(--app-muted); padding-inline-end: 14px; position: relative; }
.wf-port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--app-surface); border: 2px solid var(--app-faint); }
.wf-port.in { inset-inline-start: -8px; top: 14px; }
.wf-port.out { inset-inline-end: -8px; top: 1px; cursor: crosshair; }
.wf-port.out:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
.wf-port.out.yes { border-color: var(--c-green); }
.wf-port.out.no { border-color: var(--c-red); }
.wf-port.out.ok { border-color: var(--c-green); }
.wf-port.out.error { border-color: var(--c-red); }
.wf-zoom { position: absolute; inset-inline-end: 12px; bottom: 12px; display: flex; gap: 4px; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 10px; padding: 3px; box-shadow: var(--shadow-sm); }
.wf-phead { display: flex; align-items: center; gap: 10px; }
.wf-vars { display: flex; flex-wrap: wrap; gap: 4px; }
.wf-vars .chip { height: 26px; padding: 0 9px; font-size: 12px; }
.wf-file { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface-2); }
.wf-file audio { width: 100%; height: 36px; }
.wf-file a { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.wf-leads { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-steps { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.wf-steps li.failed b { color: var(--app-neg); }
.wf-steps li.ok::marker { color: var(--app-pos); }
.drawer .body.wf-runs { background: var(--app-bg); display: grid; gap: 8px; align-content: start; }
.wf-runs details { padding: 10px 12px; }
.wf-runs summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 1100px) { .wf-body { grid-template-columns: 190px 1fr 280px; } }
@media (max-width: 62em) {
  .wf { height: auto; }
  .wf-body { grid-template-columns: 1fr; }
  .wf-palette { border-inline-end: 0; border-bottom: 1px solid var(--app-border); display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; }
  .wf-palette .wf-pgroup { margin: 0; display: flex; } .wf-palette .sb-sublabel, .wf-palette p, .wf-pitem small { display: none; }
  .wf-pitem { white-space: nowrap; }
  .wf-canvas { height: 60vh; }
  .wf-panel { border-inline-start: 0; border-top: 1px solid var(--app-border); padding: 16px; }
}

/* ---------------- Catalogue: product drawer ---------------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--app-hover); }
.pdrawer .body { background: var(--app-surface); display: grid; gap: 12px; align-content: start; }
.pdrawer textarea { width: 100%; resize: vertical; }
.pd-imgs { display: flex; gap: 8px; overflow-x: auto; }
.pd-imgs img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--app-border); flex: none; }
.pd-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.pd-facts dt { color: var(--app-muted); }
.pd-facts dd { margin: 0; }

/* Facebook Ads card (dashboard) */
.dash-fbads { margin-top: var(--d-gap); }
.fbkpis { display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fbk { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--app-border, rgba(127,127,127,.2)); border-radius: 10px; min-width: 0; }
.fbk .l { font-size: 12px; color: var(--app-muted); }
.fbk b { font-size: 18px; }
.fbk .s { font-size: 11.5px; color: var(--app-muted); }
@media (max-width: 1100px) { .fbkpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fbkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- Connect a number + Connexion Facebook */
.card-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.card-h .i { color: var(--app-muted); }
.hint { font-size: 12px; font-weight: 400; color: var(--app-muted); }
.hint.err { color: var(--app-neg); font-weight: 500; }
.grow { flex: 1; }
/* step 1: method cards (real radio inputs, whole card is the label) */
.cstep { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.cstep legend { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14.5px; margin-bottom: 10px; padding: 0; }
.cstep-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.mcards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mcard { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border: 1.5px solid var(--app-border); border-radius: 12px;
  background: var(--app-surface); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; min-width: 0; }
.mcard:hover { border-color: var(--app-border-strong); }
.mcard input { position: absolute; opacity: 0; pointer-events: none; }
.mcard:has(input:focus-visible) { outline: 2px solid var(--indigo-5); outline-offset: 2px; }
.mcard.is-on, .mcard:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.mcard.is-off { opacity: .6; cursor: not-allowed; }
.mcard-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--app-surface-2); border: 1px solid var(--app-border); color: var(--accent-ink); }
.mcard.is-on .mcard-ic { background: var(--app-surface); }
.mcard-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.mcard-title { font-weight: 650; font-size: 14px; }
.mcard-desc { font-size: 13px; color: var(--app-muted); line-height: 1.45; }
.mcard-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.mcard-list li { display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; }
.mcard-list .i { flex: none; margin-top: 2px; }
.mcard-list .pro .i { color: var(--app-pos); } .mcard-list .con { color: var(--app-muted); } .mcard-list .con .i { color: var(--app-neg); }
.opt-tag.warn { color: var(--app-warn); border-color: currentColor; background: transparent; }
/* step 2 */
.cfields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 640px; }
.cfields input[aria-invalid="true"] { border-color: var(--app-neg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-neg) 15%, transparent); }
.csteps-how { margin: 0 0 12px; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--app-muted); max-width: 640px; }
.cadv { margin-top: 4px; border-top: 1px solid var(--app-border); padding-top: 12px; font-size: 13px; }
.cadv summary { cursor: pointer; color: var(--app-muted); font-weight: 500; width: max-content; max-width: 100%; }
.cadv summary:hover { color: var(--app-text); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; display: inline-block; margin-inline-end: 8px; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .mcard { transition: none; } }
/* callouts */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--app-border); background: var(--app-surface-2); font-size: 13.5px; }
.callout > .i { flex: none; margin-top: 1px; color: var(--app-muted); }
.callout.good { border-color: color-mix(in srgb, var(--app-pos) 35%, transparent); background: color-mix(in srgb, var(--app-pos) 8%, var(--app-surface)); } .callout.good > .i { color: var(--app-pos); }
.callout.warn { border-color: color-mix(in srgb, var(--app-warn) 35%, transparent); background: color-mix(in srgb, var(--app-warn) 8%, var(--app-surface)); } .callout.warn > .i { color: var(--app-warn); }
.callout.bad { border-color: color-mix(in srgb, var(--app-neg) 35%, transparent); background: color-mix(in srgb, var(--app-neg) 7%, var(--app-surface)); } .callout.bad > .i { color: var(--app-neg); }
/* Connexion Facebook: setup checklist */
.setup { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.setup li { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 6px; border-radius: 99px; border: 1px solid var(--app-border); background: var(--app-surface); font-size: 13px; font-weight: 500; color: var(--app-muted); }
.setup li[data-s] { cursor: pointer; } .setup li[data-s]:hover { border-color: var(--app-border-strong); color: var(--app-text); }
.setup-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--app-surface-2); border: 1px solid var(--app-border); }
.setup li.now { color: var(--app-text); } .setup li.now .setup-n { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.setup li.done { color: var(--app-text); } .setup li.done .setup-n { background: var(--app-pos); color: var(--app-surface); border-color: transparent; }
.fbacc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fbacc-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #1877f2; color: #fff; flex: none; }
.fbacc-main { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.fbempty p { margin: 0 0 8px; } .fbempty .mcard-list { margin: 0 0 14px; font-size: 13.5px; }
/* selectable rows (ad accounts) */
.selgroup { margin-top: 10px; }
.selgroup-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--app-muted); margin-bottom: 6px; }
.selrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--app-border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.selrow + .selrow { margin-top: 6px; }
.selrow:hover { border-color: var(--app-border-strong); }
.selrow:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.selrow input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.selrow-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.selrow-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--app-border); }
.synline { display: flex; align-items: center; gap: 8px; min-height: 20px; color: var(--app-muted);
  --dot-ok: var(--app-pos); --dot-warn: var(--app-warn); --dot-bad: var(--app-neg); --dot-off: var(--app-border-strong); }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--app-border); background: var(--app-surface-2); font-size: 13px; }
.lchip .i { color: var(--app-pos); }
@media (max-width: 560px) { .selbar .btn { flex: 1; } .setup li { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- Boîte de réception */
.app-content.ib-page { max-width: none; padding: 16px 20px; }
.inbox { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); height: calc(100dvh - var(--topbar-h) - 32px); min-height: 420px;
  border: 1px solid var(--app-border); border-radius: var(--radius); background: var(--app-surface); overflow: hidden; }
.ib-list { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--app-border); }
.ib-tools { display: grid; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--app-border); }
.ib-title { font-size: 17px; font-weight: 650; margin: 0; }
.ib-search { position: relative; }
.ib-search .i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--app-muted); pointer-events: none; }
.ib-search input { width: 100%; padding-inline-start: 34px; }
.ib-tools select { width: 100%; }
.ib-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--app-surface-2); border: 1px solid var(--app-border); }
.ib-tabs button { flex: 1; min-height: 32px; border: 0; background: none; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--app-muted); cursor: pointer; white-space: nowrap; padding: 0 6px; }
.ib-tabs button[aria-selected="true"] { background: var(--app-surface); color: var(--app-text); box-shadow: var(--shadow-sm); font-weight: 600; }
.ib-tabs .num { color: var(--accent-ink); }
.ib-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ib-row { position: relative; display: flex; gap: 10px; align-items: flex-start; width: 100%; min-height: 72px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--app-border);
  background: none; text-align: start; cursor: pointer; color: inherit; font: inherit; transition: background-color .12s; }
.ib-row:hover { background: var(--app-hover); }
.ib-row.is-sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ib-row:focus-visible { outline-offset: -2px; border-radius: 0; }
.ib-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ib-top { display: flex; align-items: baseline; gap: 8px; }
.ib-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.ib-top time { font-size: 11.5px; color: var(--app-muted); flex: none; }
.ib-prev { font-size: 13px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-row.is-unread .ib-name { font-weight: 700; } .ib-row.is-unread .ib-prev { color: var(--app-text); } .ib-row.is-unread time { color: var(--accent-ink); font-weight: 600; }
.ib-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.ib-line { font-size: 11.5px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ib-dot { position: absolute; inset-inline-end: 14px; top: 36px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ib-chip { display: inline-flex; align-items: center; gap: 3px; flex: none; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.ib-chip.on { color: var(--app-pos); background: color-mix(in srgb, var(--app-pos) 12%, transparent); }
.ib-chip.soon { color: var(--app-warn); background: color-mix(in srgb, var(--app-warn) 14%, transparent); }
.ib-chip.off { color: var(--app-muted); background: var(--app-surface-2); border-color: var(--app-border); }
.ib-chip.qr { color: var(--app-muted); border-color: var(--app-border); }
.ib-more { margin: 12px auto; display: block; }
.ib-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 20px; color: var(--app-muted); }
.ib-empty b { color: var(--app-text); }
.ib-pick { height: 100%; align-content: center; }
/* thread */
.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.ib-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 60px; background: var(--app-surface); border-bottom: 1px solid var(--app-border); }
.ib-head-main { flex: 1; min-width: 0; } .ib-head-main > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-back { display: none; } .ib-back .i { transform: rotate(180deg); }
.ib-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.ib-body .msg { max-width: min(560px, 80%); }
.ib-compose { background: var(--app-surface); }
.ib-compose .composer { border-top: 1px solid var(--app-border); }
.ib-compose textarea { min-height: 44px; }
.ib-closed { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: 13.5px; }
.ib-closed b { color: var(--app-text); }
.ib-loading { padding: 20px; }
@media (max-width: 62em) {
  .app-content.ib-page { padding: 0; }
  .inbox { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; height: calc(100dvh - var(--topbar-h) - 64px - env(safe-area-inset-bottom)); min-height: 0; }
  .ib-list { border-inline-end: 0; }
  .inbox.has-thread .ib-list, .inbox:not(.has-thread) .ib-thread { display: none; }
  .ib-back { display: grid; }
  .ib-head [data-fiche] { padding: 0 10px; }
  .ib-head .pill { display: none; }
  .ib-body { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .ib-row { transition: none; } }

/* ================= 2026-11-17 redesign: five places, tabs, Aujourd'hui, Conversations ================= */
/* sidebar: flat list of places (no sub-menus), bigger rows */
.sb-nav > .sb-link.sb-top { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.sb-nav > .sb-link .count { margin-inline-start: auto; }

/* tabs of the open place, under the top bar */
.app-tabs { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--app-border); background: var(--app-bg); overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--topbar-h); z-index: 30; }
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--app-muted); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.app-tabs a:hover { color: var(--app-text); }
.app-tabs a[aria-current="page"] { color: var(--app-text); font-weight: 600; border-bottom-color: var(--accent); }
.crumbs .crumb-current { font-weight: 600; }

/* ---------- Aujourd'hui ---------- */
.today .td-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.td-date { font-size: 13.5px; color: var(--app-muted); }
.td-hello { margin: 2px 0 0; font-size: 28px; }
.td-for { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--app-muted); }
.td-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.td-cards > .dash-error { grid-column: 1 / -1; }
.td-card { display: flex; flex-direction: column; gap: 6px; min-height: 172px; color: inherit; }
.td-card.is-bad { border-color: color-mix(in srgb, var(--app-neg) 32%, var(--app-border)); }
.td-card.is-warn { border-color: color-mix(in srgb, var(--app-warn) 28%, var(--app-border)); }
.td-card-l { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.td-card.is-bad .td-card-l { color: var(--app-neg); } .td-card.is-warn .td-card-l { color: var(--app-warn); }
.td-card-v { font-size: 16px; color: var(--app-muted); } .td-card-v b { font-size: 36px; font-weight: 700; letter-spacing: -.02em; color: var(--app-text); margin-inline-end: 4px; }
.td-card-s { font-size: 13.5px; color: var(--app-muted); }
.td-card-btn { align-self: flex-start; margin-top: auto; height: 38px; padding: 0 16px; font-weight: 600; }
.td-card-link { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13.5px; color: var(--accent-ink); }
.td-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.td-side { display: grid; gap: 16px; }
/* who to notify (Réglages › Règles des clients) */
.esc-card { display: grid; gap: 10px; margin-top: 16px; }
.esc-list { display: grid; gap: 6px; }
.esc-u { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; font-weight: 400; }
.today .td-wait { padding: 0; overflow: hidden; }
.td-wait > .dash-h { padding: 18px 20px 4px; margin: 0; }
.td-wait > .dash-empty, .td-wait > .skel-wrap, .td-wait > .dash-error { padding: 16px 20px 20px; }
.td-wait > .dash-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--app-border); }
.td-list { list-style: none; margin: 0; padding: 0; }
.td-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--app-border); }
.td-row-main { flex: 1; min-width: 0; }
.td-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.td-name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-row-sub { font-size: 13px; color: var(--app-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.td-row-wait { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag { flex: none; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
.tag-bad { background: color-mix(in srgb, var(--app-neg) 12%, transparent); color: var(--app-neg); }
.tag-warn { background: color-mix(in srgb, var(--app-warn) 13%, transparent); color: var(--app-warn); }
.td-sent { list-style: none; margin: 0; padding: 0; }
.td-sent li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--app-border); font-size: 13.5px; }
.td-sent li:first-child { border-top: 0; }
.td-sp { width: 92px; flex: none; font-weight: 600; color: var(--app-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-sp:hover { color: var(--accent-ink); text-decoration: underline; }
.td-fix-list { list-style: none; margin: 0; padding: 0; }
.td-fix-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--app-border); font-size: 13.5px; }
.td-fix-list li:first-child { border-top: 0; }
.td-fix-t { flex: 1; }
.td-fix-list a { font-weight: 600; color: var(--accent-ink); }
@media (max-width: 1100px) { .td-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 62em) {
  .app-tabs { padding: 0 8px; }
  .td-hello { font-size: 24px; }
  .td-for, .td-for select { width: 100%; }
  .td-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .td-cards > :last-child { grid-column: 1 / -1; min-height: 0; }
  .td-card { min-height: 0; padding: 14px; }
  .td-card-v b { font-size: 28px; }
  .td-card-btn { width: 100%; justify-content: center; height: 44px; }
  .td-row { flex-wrap: wrap; padding: 12px 14px; gap: 8px 10px; }
  .td-row-main { flex-basis: calc(100% - 50px); }
  .td-row-wait { margin-inline-start: 46px; flex: 1; }
  .td-reply { height: 40px; padding: 0 18px; }
  .td-wait > .dash-h { padding: 16px 14px 4px; }
}

/* ---------- Conversations: list · conversation · customer card ---------- */
.app-content.cv-page { max-width: none; padding: 16px; }
.cv { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) 320px; height: calc(100dvh - var(--topbar-h) - 44px - 33px); min-height: 460px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cv-list { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--app-border); }
.cv-tools { display: grid; gap: 10px; padding: 14px 14px 8px; border-bottom: 1px solid var(--app-border); }
.cv-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cv-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.cv-titlebar select { height: 32px; font-size: 13px; max-width: 170px; }
.cv-tools > select { width: 100%; }
.cv-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.cv-tabs::-webkit-scrollbar { display: none; }
.cv-tabs button { flex: none; min-height: 34px; border: 0; background: none; border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--app-muted); cursor: pointer; white-space: nowrap; }
.cv-tabs button:hover { background: var(--app-hover); color: var(--app-text); }
.cv-tabs button[aria-selected="true"] { background: var(--app-text); color: var(--app-surface); }
.cv-tabs .num { opacity: .75; font-weight: 500; }
.cv-hint { margin: 0; font-size: 12.5px; color: var(--app-muted); }
.cv-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cv-row .ib-top time { font-weight: 600; }
.ib-chip.bad { color: var(--app-neg); background: color-mix(in srgb, var(--app-neg) 11%, transparent); }
.cv-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.cv-ai:empty { display: none; }
.cv-ai .aibox { margin: 0; border-radius: 0; border: 0; border-top: 1px solid var(--app-border); max-height: 34vh; overflow-y: auto; }
.cv-card { border-inline-start: 1px solid var(--app-border); overflow-y: auto; overscroll-behavior: contain; background: var(--app-surface); min-height: 0; }
.cv-card-in { display: grid; gap: 0; padding-bottom: 16px; }
.cv-card-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; }
.cv-card-close { display: none; }
.cv-sec { padding: 12px 16px; border-bottom: 1px solid var(--app-border); display: grid; gap: 8px; }
.cv-lab { font-size: 12px; font-weight: 600; color: var(--app-muted); }
.cv-say { margin: 0; font-size: 13.5px; }
.cv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cv-actions .btn { justify-content: center; height: 38px; font-weight: 600; }
.cv-won { color: var(--app-pos); border-color: color-mix(in srgb, var(--app-pos) 35%, var(--app-border)); background: color-mix(in srgb, var(--app-pos) 8%, var(--app-surface)); }
.cv-lost { color: var(--app-neg); }
.cv-form { display: grid; gap: 8px; }
.cv-form .f { display: grid; gap: 4px; font-size: 12.5px; color: var(--app-muted); }
.cv-sec select, .cv-sec textarea, .cv-form input { width: 100%; }
.cv-card .card { margin: 12px 16px 0 !important; box-shadow: none; }
.cv-card .c360 { margin: 12px 16px 0; }
.cv-card .row.small.muted { padding: 10px 16px !important; flex-wrap: wrap; }
.cv-facts { font-size: 12.5px; color: var(--app-muted); border-bottom: 0; }
.cv-card [data-err]:empty { display: none; } .cv-card [data-err] { padding: 0 16px; }
.cv-card-btn { display: none; }
@media (max-width: 1280px) {
  .cv { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); position: relative; }
  .cv-card { position: absolute; top: 0; inset-inline-end: 0; bottom: 0; width: min(360px, 100%); z-index: 5; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .2s ease; visibility: hidden; }
  .cv.show-card .cv-card { transform: none; visibility: visible; }
  .cv-card-close { display: grid; }
  .cv-card-btn { display: inline-flex; }
}
@media (max-width: 62em) {
  .app-content.cv-page { padding: 0; }
  .cv { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; height: calc(100dvh - var(--topbar-h) - 45px - 64px - env(safe-area-inset-bottom)); min-height: 0; }
  .cv-list { border-inline-end: 0; }
  .cv.has-thread .cv-list, .cv:not(.has-thread) .cv-thread { display: none; }
  .cv-card { width: 100%; }
  .cv .ib-back { display: grid; }
  .cv .ib-body { padding: 12px; }
  .cv-hide-sm { display: none; }
  .cv-tabs button { min-height: 40px; }
  .cv-card .btn, .cv-sec select { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .cv-card { transition: none; } }
.cv-form[hidden] { display: none; }
.ib-row.cv-row time.t-bad { color: var(--app-neg); } .ib-row.cv-row time.t-warn { color: var(--app-warn); }
.cv-tabs { flex-wrap: wrap; overflow: visible; }
/* Assistant IA settings: numbered steps + checklist */
.ai-banner { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
  background: color-mix(in srgb, var(--app-neg) 9%, var(--app-surface)); border: 1px solid color-mix(in srgb, var(--app-neg) 30%, var(--app-border)); color: var(--app-neg); }
.ai-banner b { color: inherit; }
.know { list-style: none; margin: 0; padding: 0; }
.know li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--app-border); }
.know li:first-child { border-top: 0; }
.know-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.know-ic.ok { background: color-mix(in srgb, var(--app-pos) 14%, transparent); color: var(--app-pos); }
.know-ic.todo { background: color-mix(in srgb, var(--app-warn) 15%, transparent); color: var(--app-warn); }
.know-main { flex: 1; min-width: 0; } .know-main .small { color: var(--app-muted); }
.cfg-step { font-size: 13px; font-weight: 600; color: var(--app-muted); margin: 24px 0 10px; }
.cfg .card.flash { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md); transition: box-shadow .3s; }
@media (max-width: 600px) {
  .td-cards { grid-template-columns: minmax(0, 1fr); }
  .td-card-v b { font-size: 26px; }
  .td-for { display: grid; gap: 4px; }
  .td-wait > .dash-h { flex-wrap: wrap; }
}
@media (max-width: 62em) {
  body:has(.cv.has-thread) .app-tabs { display: none; }
  body:has(.cv.has-thread) .cv { height: calc(100dvh - var(--topbar-h) - 64px - env(safe-area-inset-bottom)); }
  .cv-ai .aibox { max-height: 26vh; }
}

/* ---------- Modules (§16) ---------- */
.td-cards.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mod-card { max-width: 860px; }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-row { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--app-border); }
.mod-list .mod-row:first-child { border-top: 0; }
.mod-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.mod-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mod-needs { color: var(--app-muted); }
.mod-sw { display: flex; gap: 14px; flex: none; }
.mod-h { font-size: 13px; font-weight: 600; color: var(--app-muted); margin: 22px 0 6px; }
.mod-more { margin: 14px 0 0; }
.mod-caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.mod-caps li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-caps .ok { color: var(--app-pos); display: inline-flex; } .mod-caps .no { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--app-border-strong); }
.mod-hist { margin-top: 18px; font-size: 13px; } .mod-hist summary { cursor: pointer; font-weight: 600; color: var(--app-muted); }
.mod-hist ul { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
[data-moderr]:empty { display: none; } [data-moderr] { margin-top: 10px; }
.zmodal.mod-modal { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
.mod-pick { width: 100%; border: 1px solid var(--app-border); border-radius: 10px; padding: 10px 14px 12px; margin: 4px 0 0; display: grid; gap: 10px; }
.mod-pick legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.mod-pick-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mod-pick .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
@media (max-width: 62em) { .mod-row { flex-wrap: wrap; } .mod-sw { width: 100%; } .td-cards.is-two { grid-template-columns: minmax(0, 1fr); } }
.zmodal .switch input { width: auto; }

/* ---------- Historique (timeline) ---------- */
.cv-card-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--app-surface-2); border: 1px solid var(--app-border); }
.cv-card-tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--app-muted); cursor: pointer; min-height: 30px; }
.cv-card-tabs button[aria-selected="true"] { background: var(--app-surface); color: var(--app-text); box-shadow: var(--shadow-sm); }
.cv-hist { padding: 8px 16px 16px; }
.cv-hist[hidden], .cv-card-body[hidden] { display: none; }
.tl-sw { margin: 6px 0 10px; font-size: 12.5px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-day { font-size: 12px; font-weight: 600; color: var(--app-muted); padding: 12px 0 4px; }
.tl-ev { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.tl-ev::before { content: ""; position: absolute; inset-inline-start: 12px; top: 32px; bottom: -6px; width: 1px; background: var(--app-border); }
.tl-ev:last-child::before { display: none; }
.tl-ic { flex: none; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: var(--app-surface-2); border: 1px solid var(--app-border); color: var(--app-muted); position: relative; z-index: 1; }
.tl-ai .tl-ic { color: #6941c6; background: color-mix(in srgb, #7048e8 10%, var(--app-surface)); }
.tl-customer .tl-ic { color: var(--app-pos); }
.tl-integration .tl-ic { color: var(--accent-ink); }
.tl-main { min-width: 0; flex: 1; }
.tl-text { font-size: 13.5px; overflow-wrap: anywhere; }
.tl-meta { font-size: 11.5px; color: var(--app-muted); margin-top: 1px; }
.tl-mod { font-weight: 600; }
.tl-where { color: var(--app-text); }
.cv-person-view { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.cv-person-view .btn { margin-inline-start: auto; }
.cv-person-form { display: grid; gap: 8px; }
.cv-person-form[hidden], .cv-person-view[hidden] { display: none; }
.cv-person-others { margin-top: 8px; }
.cv-person-others ul { margin: 4px 0 0; padding-inline-start: 18px; }
.cv-person-others li { margin: 2px 0; }
/* score (§16 module D) */
.sc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sc-num { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.sc-manual { color: var(--app-text); }
.sc-why summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--indigo-5); }
.sc-why[open] summary { margin-bottom: 6px; }
.sc-items { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.sc-items li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: baseline; }
.sc-pts { font-weight: 700; text-align: end; }
.sc-yes .sc-pts { color: #2f9e44; }
.sc-yes.sc-neg .sc-pts { color: #e03131; }
.sc-unknown, .sc-no { color: var(--app-muted); }
.sc-unknown .sc-pts { color: var(--app-faint); }
.sc-ai { margin: 2px 0 6px; }
.sc-rest { margin: 0 0 6px; line-height: 1.45; }
/* qualified leads centre (§16.7) */
.q-tabs { margin: 0 0 12px; }
.q-filters { margin-bottom: 14px; }
.q-filters summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 10px; align-items: end; }
.q-reset { display: flex; align-items: end; }
.q-table td { vertical-align: top; }
.q-sel { margin-top: 4px; height: 30px; font-size: 12.5px; max-width: 170px; }
.q-table td:first-child { min-width: 130px; } .q-clip { max-width: 170px; } .q-table td:first-child + td { line-height: 1.45; }
.q-table .q-sel { margin-top: 0; max-width: 150px; } .q-table td > .q-sel + .small { margin-top: 3px; }
.nowrap { white-space: nowrap; }
.q-urgent { color: var(--app-text); font-weight: 600; }
.q-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.q-card { display: grid; gap: 6px; }
.q-card-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.q-card-pills { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.q-msg { color: var(--app-text); font-style: italic; }
.q-card-actions { gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.q-card-actions .q-sel { margin-top: 0; }
.q-pager { gap: 8px; justify-content: flex-end; margin-top: 10px; }
@media (max-width: 600px) { .q-cards { grid-template-columns: 1fr; } .q-grid { grid-template-columns: 1fr 1fr; } }
.sc-actions { gap: 6px; flex-wrap: wrap; }
.sc-form { display: grid; gap: 8px; }
.sc-form[hidden] { display: none; }
.sc-settings { max-width: 760px; }
.sc-crit { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.sc-crit input { margin-top: 3px; }
.sc-hint { display: block; }
.sc-pts-in { width: 76px; text-align: end; }
.sc-th { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 6px; }
.sc-custom { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 76px 32px; gap: 8px; align-items: center; margin: 8px 0; }
@media (max-width: 600px) {
  .sc-th { grid-template-columns: 1fr; }
  .sc-custom { grid-template-columns: minmax(0, 1fr) 76px 32px; }
  .sc-custom [data-c="keywords"] { grid-column: 1 / -1; grid-row: 2; }
}
.tl-why { font-size: 12px; color: var(--app-muted); margin-top: 2px; font-style: italic; }
.tl-ch { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--app-muted); margin-top: 2px; }
.tl-wrap { max-height: 70vh; overflow-y: auto; }

/* subscriptions (§16.9) */
.sub-banner { display: flex; gap: 8px; align-items: flex-start; padding: 10px 24px; font-size: 13.5px; background: color-mix(in srgb, #fd7e14 12%, var(--app-bg, #fff)); border-bottom: 1px solid color-mix(in srgb, #fd7e14 35%, transparent); }
.sub-banner.bad { background: color-mix(in srgb, var(--app-neg, #e03131) 12%, var(--app-bg, #fff)); border-bottom-color: color-mix(in srgb, var(--app-neg, #e03131) 35%, transparent); }
.sub-usage { display: grid; gap: 12px; }
.sub-u .bar { height: 6px; border-radius: 3px; background: var(--app-line, #e9ecef); overflow: hidden; margin-top: 4px; }
.sub-u .bar i { display: block; height: 100%; background: var(--c-blue); }
.sub-hist { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.plan-form { display: grid; gap: 10px; }
@media (max-width: 600px) { .sub-banner { padding: 10px 16px; } }

/* Zelio Pulse wordmark (2026-11-18): "Zelio" navy, "Pulse" teal; light text in dark mode. Logo files: zelio-pulse-mark.svg, zelio-pulse-logo.svg */
:root { --brand-navy: #0a1033; --brand-teal: #1fbfa3; }
:root[data-theme="dark"] { --brand-navy: #ececef; --brand-teal: #2bdcbc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand-navy: #ececef; --brand-teal: #2bdcbc; } }
.wm { font-weight: 700; color: var(--brand-navy); letter-spacing: 0.01em; white-space: nowrap; }
.wm b { font-weight: 700; color: var(--brand-teal); }
.sb-org-sub .wm { font-size: 11.5px; }
.login .brand-full { gap: 14px; font-size: 24px; margin-bottom: 14px; }
.login .brand-full img { width: 40px; height: 40px; }
.brand-sep { width: 1px; align-self: stretch; margin: 4px 0; background: var(--app-line, #d9dce3); }

/* Meta Ads: from advertising to sales (2026-11-18) */
.ads-seg { flex-wrap: wrap; }
.ads-dates { display: inline-flex; gap: 6px; }
.ads-dates input { height: 34px; }
.ads-sync { margin: -6px 0 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.warn-text { color: #b45309; }
.ads-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ad-tile { display: grid; gap: 4px; padding: 16px 18px; }
.ad-tile.bad .v { color: var(--app-neg); }
.ad-tile-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ad-tile .l { font-size: 13px; color: var(--app-muted); }
.ad-tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.ad-tile .s { font-size: 12.5px; color: var(--app-muted); }
.ad-delta { font-size: 12px; color: var(--app-muted); }
.ad-delta.good { color: #2f9e44; } .ad-delta.bad { color: var(--app-neg); }
.src { font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 1px 7px; white-space: nowrap; letter-spacing: 0.01em; }
.src-meta { background: #e7f0ff; color: #1d4ed8; } .src-crm { background: #e2f8f3; color: #0b7c69; } .src-calc { background: #f1f1f3; color: #52525b; }
:root[data-theme="dark"] .src-meta { background: #1e2a44; color: #93b4ff; } :root[data-theme="dark"] .src-crm { background: #10332c; color: #5eead4; } :root[data-theme="dark"] .src-calc { background: #26262b; color: #c4c4cc; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fn-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fn-l { flex: 1; min-width: 160px; }
.fn-rate { flex-basis: 100%; }
.fn-bar { height: 8px; border-radius: 4px; background: var(--app-line, #e9ecef); overflow: hidden; margin-top: 4px; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2bdcbc, #4263eb); }
.fn-amount { display: flex; justify-content: space-between; border-top: 1px dashed var(--app-line, #e5e7eb); padding-top: 8px; }
.ads-insights { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; }
.ads-insights .ins-bad::marker { color: var(--app-neg); } .ads-insights .ins-good::marker { color: #2f9e44; } .ads-insights .ins-warn::marker { color: #f08c00; }
.ads-table th.sortable { cursor: pointer; user-select: none; } .ads-table th.sorted { color: var(--app-text); }
.ads-grp-row th { padding-top: 10px; padding-bottom: 2px; font-weight: 400; text-align: center; }
.ads-grp { border-bottom: 2px solid var(--app-line, #e5e7eb); }
.ads-grp-meta { border-bottom-color: #93b4ff; } .ads-grp-crm { border-bottom-color: #5eead4; }
.ad-sub { margin-top: 2px; }
.ads-crumbs { margin: 0 0 10px; }
.ad-owner { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; text-align: start; }
.ad-owner .avatar { width: 20px; height: 20px; font-size: 10px; }
.ads-plist { list-style: none; padding: 0; margin: 0 0 8px; display: flex; gap: 22px; flex-wrap: wrap; }
.ads-plist li { display: flex; gap: 8px; align-items: baseline; }
.ads-attr { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 16px; }
.ads-empty { max-width: 680px; }
.ads-chart { min-height: 160px; }

/* Live updates (2026-11-19): toasts for new customer messages (public/app.js toast()) */
.toasts { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; text-align: start; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--app-border-strong); background: var(--app-surface); color: var(--app-text); box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; font: inherit;
  animation: toast-in .2s ease-out; }
.toast:hover { background: var(--app-hover); }
.toast-ic { flex: none; color: var(--app-pos); margin-top: 2px; }
.toast-tx { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.toast-tx b { font-size: 14px; }
.toast-tx span { color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#notifask { flex: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ================= 2026-11-19 conversation: grouped bubbles, media, composer with files and voice notes ================= */
:root { --chat-in-ink: var(--app-text); --chat-meta: #667781; --chat-tick: #53bdeb; --chat-shadow: 0 1px .5px rgba(11, 20, 26, .13); --rec: #e03131; --wa: #00a884; --wa-ink: #fff; }
:root[data-theme="dark"] { --chat-meta: #8696a0; --chat-shadow: 0 1px .5px rgba(0, 0, 0, .35); --wa: #00a884; }
.ib-body, .drawer .body { background-color: var(--chat-bg); background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .035) 1px, transparent 0); background-size: 22px 22px; }
:root[data-theme="dark"] .ib-body, :root[data-theme="dark"] .drawer .body { background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .03) 1px, transparent 0); }
.ib-body { padding: 14px clamp(12px, 4%, 56px) 18px; scroll-behavior: auto; }

/* rows and bubbles */
.msg-row { display: flex; margin: 1px 0; }
.msg-row.first { margin-top: 8px; }
.msg-row.out { justify-content: flex-end; }
.msg-row .msg { position: relative; margin: 0; max-width: min(540px, 78%); padding: 6px 8px 7px 9px; border-radius: 10px; box-shadow: var(--chat-shadow); color: var(--app-text);
  font-size: 14.2px; line-height: 1.42; white-space: normal; }
.msg-row.in .msg { background: var(--chat-in); }
.msg-row.out .msg { background: var(--chat-out); }
.msg-row.first.in .msg { border-top-left-radius: 2px; }
.msg-row.first.out .msg { border-top-right-radius: 2px; }
.msg-row.first .msg::before { content: ""; position: absolute; top: 0; width: 9px; height: 13px; background: inherit; }
.msg-row.first.in .msg::before { inset-inline-start: -8px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.msg-row.first.out .msg::before { inset-inline-end: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.msg-row .msg.bare { background: none; box-shadow: none; padding: 0; }
.msg-row .msg.bare::before { display: none; }
.msg-who { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.msg-row.out .msg-who { color: #0b846a; }
:root[data-theme="dark"] .msg-row.out .msg-who { color: #7ae3c3; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
.msg-text a { color: #027eb5; text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .msg-text a { color: #53bdeb; }
/* time + ticks float bottom-right, inside the bubble */
.msg-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -4px 10px; font-size: 11px; color: var(--chat-meta); white-space: nowrap; position: relative; top: 3px; }
.msg-meta time { display: inline; margin: 0; font-size: 11px; color: inherit; }
.msg-row .msg .tick { letter-spacing: -3px; margin: 0 3px 0 0; font-size: 12px; }
.msg-row .msg .tick.read { color: var(--chat-tick); }
.msg-row .msg.failed { outline: 1px solid var(--app-neg); }
.msg-row .msg.failed .tick { color: var(--app-neg); letter-spacing: 0; }
.msg-row .msg::after { content: ""; display: block; clear: both; }
/* media that fills the bubble edge to edge */
.msg-row .msg.flush { padding: 3px 3px 6px; }
.msg-row .msg.flush .msg-text { padding: 4px 6px 0; }
.msg-row .msg.only-media .msg-meta { position: absolute; inset-inline-end: 8px; bottom: 8px; top: auto; margin: 0; float: none; padding: 1px 7px; border-radius: 10px; background: rgba(11, 20, 26, .45); color: #fff; }
.msg-row .msg.only-media .tick.read { color: #a5e3ff; }
.msg-row .msg.bare .msg-meta { float: none; display: flex; justify-content: flex-end; margin-top: 2px; top: 0; }
.day { margin: 14px 0 8px; }
.day span { display: inline-block; background: var(--app-surface); color: var(--chat-meta); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 8px; box-shadow: var(--chat-shadow); }
.gap { margin: 8px 0; }

/* photo, video, sticker */
.mm-img { display: block; padding: 0; border: 0; background: var(--skel); border-radius: 7px; overflow: hidden; cursor: zoom-in; max-width: 100%; }
.mm-img img { display: block; width: auto; max-width: min(330px, 100%); max-height: 360px; min-width: 120px; min-height: 90px; object-fit: cover; }
.mm-img:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-video { display: block; width: min(330px, 100%); max-height: 380px; border-radius: 7px; background: #000; }
.mm-sticker { display: block; width: 140px; height: 140px; object-fit: contain; }
.mm-none { display: inline-flex; gap: 4px; font-size: 13px; padding: 2px 0; }

/* voice note player */
.vp { display: flex; align-items: center; gap: 10px; width: min(300px, 70vw); padding: 4px 2px 0; }
.vp audio { display: none; }
.vp-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--wa); color: var(--wa-ink); }
.vp-play:hover { filter: brightness(1.06); }
.vp-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vp-track { flex: 1; min-width: 0; display: grid; gap: 2px; }
.vp-seek { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; --p: 0%; }
.vp-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--wa) var(--p), rgba(102, 119, 129, .35) var(--p)); }
.vp-seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(102, 119, 129, .35); }
.vp-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--wa); }
.vp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--wa); margin-top: -4.5px; border: 0; }
.vp-seek::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--wa); border: 0; }
.vp-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--chat-meta); font-variant-numeric: tabular-nums; }
.vp-rate { border: 0; border-radius: 10px; padding: 1px 7px; font: inherit; font-size: 11px; font-weight: 650; background: rgba(102, 119, 129, .16); color: var(--chat-meta); cursor: pointer; }
.vp-mic { flex: none; color: var(--wa); display: grid; place-items: center; width: 22px; }
.vp.is-playing .vp-mic { color: var(--chat-tick); }
.vp.is-error .vp-play { background: var(--app-border-strong); }
.vp-fallback { color: inherit; margin-inline-start: 4px; }

/* document, location and contact cards */
.mm-doc, .mm-card { display: flex; align-items: center; gap: 10px; min-width: min(260px, 66vw); max-width: 340px; padding: 8px 10px; border-radius: 8px; background: rgba(11, 20, 26, .05); color: inherit; text-decoration: none; }
:root[data-theme="dark"] .mm-doc, :root[data-theme="dark"] .mm-card { background: rgba(255, 255, 255, .06); }
.mm-doc { padding: 0; }
.mm-doc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 10px; color: inherit; text-decoration: none; }
.mm-card:hover, .mm-doc-main:hover { filter: brightness(.98); }
.mm-doc-ic, .mm-card-ic { flex: none; position: relative; width: 38px; height: 44px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.mm-card-ic { width: 40px; height: 40px; border-radius: 50%; }
.mm-doc-ic i { position: absolute; bottom: 5px; font-style: normal; font-size: 8.5px; font-weight: 800; letter-spacing: .02em; }
.t-pdf { background: #e5484d; } .t-doc { background: #2b6fd6; } .t-xls { background: #1f8a4c; } .t-ppt { background: #d9620c; } .t-txt, .t-zip { background: #6b7280; }
.t-prod { background: #0b846a; } .t-loc { background: #e5484d; } .t-user { background: #7048e8; } .t-img { background: #7048e8; } .t-aud { background: #e8590c; }
.mm-card-tx { flex: 1; min-width: 0; display: grid; }
.mm-card-tx b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-card-tx span { font-size: 12px; color: var(--chat-meta); }
.mm-dl { flex: none; display: grid; place-items: center; width: 40px; align-self: stretch; color: var(--chat-meta); border-inline-start: 1px solid rgba(102, 119, 129, .2); }
.mm-dl:hover { color: var(--app-text); }

/* sending */
.msg-row.pending .msg { opacity: .85; }
.msg-row.pending.failed .msg { outline: 1px solid var(--app-neg); }
.pend-bar { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(102, 119, 129, .25); overflow: hidden; min-width: 160px; }
.pend-bar i { display: block; height: 100%; width: 4%; background: var(--wa); transition: width .2s; }

/* jump to the latest messages */
.cv-thread { position: relative; }
.cv-down { position: absolute; inset-inline-end: 16px; bottom: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--app-surface); color: var(--chat-meta); box-shadow: var(--shadow-md); }
.cv-down[hidden] { display: none; }
.cv-down .num:not(:empty) { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--wa); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cv-thread.is-drop::after, .drawer.is-drop::after { content: "Déposez les fichiers pour les envoyer"; position: absolute; inset: 8px; z-index: 20; border: 2px dashed var(--wa); border-radius: 14px;
  display: grid; place-items: center; font-weight: 650; color: var(--app-text); background: color-mix(in srgb, var(--app-surface) 88%, transparent); pointer-events: none; }

/* composer */
.composer.cmp { gap: 6px; padding: 8px 12px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--app-surface-2); }
.cmp-bar { display: flex; align-items: flex-end; gap: 6px; }
.cmp-bar[hidden], .cmp-rec[hidden], .cmp-tray[hidden], .cmp-send[hidden], .cmp-ic[hidden] { display: none; }
.cmp-bar textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 160px; resize: none; padding: 10px 14px; border-radius: 22px; border: 1px solid var(--app-border); background: var(--app-surface);
  font: inherit; font-size: 14.5px; line-height: 1.4; overflow-y: auto; }
.cmp-bar textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmp-ic { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: none; color: var(--chat-meta); display: grid; place-items: center; cursor: pointer; }
.cmp-ic:hover { background: var(--app-hover); color: var(--app-text); }
.cmp-ic:focus-visible, .cmp-send:focus-visible, .cmp-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmp-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--wa); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.cmp-send:hover { filter: brightness(1.07); }
.cmp-send:disabled { opacity: .55; cursor: progress; }
.cmp-attach { position: relative; }
.cmp-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 30; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--app-surface); border: 1px solid var(--app-border);
  box-shadow: var(--shadow-lg); display: grid; gap: 2px; animation: cmp-pop .14s ease-out; }
.cmp-menu[hidden] { display: none; }
.cmp-menu button { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14px; color: var(--app-text); cursor: pointer; text-align: start; }
.cmp-menu button:hover { background: var(--app-hover); }
.cmp-mi { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
@keyframes cmp-pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
/* attachments waiting to be sent */
.cmp-tray { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.tr-item { position: relative; flex: none; width: 96px; display: grid; gap: 2px; padding: 4px; border-radius: 10px; border: 1px solid var(--app-border); background: var(--app-surface); }
.tr-item img, .tr-item video, .tr-ic { width: 100%; height: 68px; border-radius: 7px; object-fit: cover; display: grid; place-items: center; color: #fff; background: var(--skel); }
.tr-badge { position: absolute; inset-inline-start: 8px; top: 50px; color: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.tr-name { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-size { font-size: 11px; color: var(--app-muted); }
.tr-ic.t-doc { background: #2b6fd6; } .tr-ic.t-aud { background: #e8590c; }
.tr-item.is-sending { opacity: .7; } .tr-item.is-failed { border-color: var(--app-neg); }
.tr-item.is-failed .tr-size { color: var(--app-neg); }
.tr-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--app-text); color: var(--app-surface); }
/* voice recording */
.cmp-rec { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: rec-blink 1s infinite; flex: none; }
.cmp-rec.is-paused .rec-dot { animation: none; background: var(--chat-meta); }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 38px; }
.rec-level { flex: 1; display: flex; align-items: center; gap: 3px; height: 28px; --lv: 0; }
.rec-level i { flex: 1; max-width: 5px; border-radius: 2px; background: var(--wa); height: calc(4px + var(--lv) * 22px); transition: height .08s; }
.rec-level i:nth-child(3n) { height: calc(4px + var(--lv) * 14px); } .rec-level i:nth-child(4n) { height: calc(4px + var(--lv) * 18px); } .rec-level i:nth-child(5n) { height: calc(4px + var(--lv) * 9px); }
.cmp-rec.is-paused .rec-level i { background: var(--chat-meta); }
.rec-preview { flex: 1; min-width: 0; height: 40px; }
@keyframes rec-blink { 50% { opacity: .25; } }

/* photo viewer */
.lb { position: fixed; inset: 0; z-index: 1100; background: rgba(8, 10, 12, .92); display: grid; place-items: center; animation: toast-in .15s ease-out; }
.lb img { max-width: min(96vw, 1400px); max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-bar { position: fixed; top: 0; inset-inline-start: 0; inset-inline-end: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 14px; color: #fff; }
.lb-n { margin-inline-end: auto; font-size: 13.5px; opacity: .8; }
.lb-btn, .lb-nav { border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover, .lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); }
.lb-nav.prev { inset-inline-start: 14px; } .lb-nav.prev .i { transform: rotate(180deg); } .lb-nav.next { inset-inline-end: 14px; }
.lb :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* conversation list: a touch more air */
.cv-row .ib-prev { color: var(--app-muted); }
.cv-row.is-unread .ib-prev { color: var(--app-text); font-weight: 500; }

@media (max-width: 62em) {
  .ib-body { padding: 10px 10px 14px; }
  .msg-row .msg { max-width: 86%; }
  .cv-down { inset-inline-end: 10px; }
  .lb-nav { top: auto; bottom: 18px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .rec-dot, .cmp-menu, .lb { animation: none; } .pend-bar i, .rec-level i { transition: none; } }

/* thread scroller + collapsible analysis (2026-11-19) */
.ib-scroll { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ib-scroll > .ib-body { flex: 1; min-height: 0; }
.cv-ai .aibox > .row:first-child { cursor: pointer; user-select: none; }
.cv-ai .aibox > .row:first-child::after { content: ""; width: 8px; height: 8px; margin-inline-start: auto; border-inline-end: 2px solid var(--app-muted); border-bottom: 2px solid var(--app-muted); transform: rotate(-135deg) translate(-2px, -2px); flex: none; }
.cv-ai:not(.is-open) .aibox { max-height: none; overflow: hidden; padding-top: 9px; padding-bottom: 9px; }
.cv-ai:not(.is-open) .aibox > :not(.row:first-child) { display: none; }
.cv-ai:not(.is-open) .aibox > .row:first-child::after { transform: rotate(45deg) translate(-2px, -2px); }
.cv-ai:not(.is-open) .aibox > .row:first-child { flex-wrap: nowrap; }
.composer.cmp .picker[hidden] { display: none; }
.ib-body, .drawer .body { overflow-anchor: none; }

/* WhatsApp template builder (Réglages › Modèles WhatsApp) */
.tplb { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.tplb-form { display: grid; gap: 14px; min-width: 0; }
.tplb-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.tplb-sec { border: 1px solid var(--app-border); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.tplb-sec legend { font-weight: 600; font-size: 13.5px; padding: 0 6px; }
.tplb-sec .seg { flex-wrap: wrap; height: auto; }
.tplb-sec .seg button { display: inline-flex; align-items: center; gap: 5px; }
.tplb-ex { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tplb-btn { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tplb-btn input { flex: 1 1 160px; min-width: 0; }
.tplb-prev { position: sticky; top: 12px; }
.tplb-phone { background: var(--chat-bg, var(--app-surface-2)); border: 1px solid var(--app-border); border-radius: 14px; padding: 14px 12px; min-height: 180px; }
.tplp { max-width: 300px; margin-inline-start: auto; }
.tplp-msg { max-width: 100%; margin: 0; }
.tplp-h { font-weight: 700; margin-bottom: 4px; }
.tplp-img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.tplp-media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 120px; border-radius: 6px; margin-bottom: 6px;
  background: color-mix(in srgb, var(--app-muted) 14%, transparent); color: var(--app-muted); font-size: 12px; }
.tplp-f { font-size: 12px; color: var(--app-muted); margin-top: 4px; }
.tplp-btns { display: grid; gap: 2px; margin-top: 2px; }
.tplp-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 9px; background: var(--chat-out); color: #1c7ed6; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 1px .5px rgba(0, 0, 0, .13); }
@media (max-width: 62em) { .tplb { grid-template-columns: minmax(0, 1fr); } .tplb-prev { position: static; order: -1; } .tplb-row { grid-template-columns: minmax(0, 1fr); } .tplp { margin: 0 auto; } }
:root[data-theme="dark"] .tplp-btn { color: #53bdeb; }

/* ---------------------------------------------------------------- tenancy: companies (operator), brand, branded sign-in */
.stack { display: grid; gap: 12px; }
.co-logo { display: inline-grid; place-items: center; flex: none; border-radius: 10px; overflow: hidden; background: var(--c, #4263eb); color: #fff; font-weight: 650; font-size: 13px; letter-spacing: .02em; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.co-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.co-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--app-border); }
.co-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--app-border); border-radius: 8px; padding: 0 10px; background: var(--app-surface); color: var(--app-muted); flex: 1 1 220px; max-width: 340px; }
.co-search input { border: 0; box-shadow: none; padding-inline-start: 0; background: transparent; width: 100%; }
.co-search:focus-within { border-color: var(--indigo-5); box-shadow: 0 0 0 3px var(--accent-soft); }
.co-table .co-row { cursor: pointer; }
.co-table .co-row:hover td { background: var(--app-hover, rgba(66, 99, 235, .04)); }
.co-table .co-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.co-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 16px; }
.co-head-txt { flex: 1 1 260px; display: grid; gap: 6px; min-width: 0; }
.co-head-actions { justify-content: flex-end; }
.co-brand { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 16px; }
.dom-list { display: grid; gap: 8px; margin-bottom: 12px; }
.dom-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 10px; }
.dom-row > div { min-width: 0; overflow-wrap: anywhere; }
.dom-input { display: inline-flex; align-items: center; gap: 4px; }
.dom-input input { width: 150px; }
.sb-logo .sb-logo-co { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; background: #fff; }
.sb-logo .co-logo { width: 32px; height: 32px; }
/* sign-in on a company's own address: its logo first, Zelio Pulse discreetly underneath */
.login { align-content: center; gap: 14px; }
.login-co { background: linear-gradient(180deg, color-mix(in srgb, var(--brand, #4263eb) 10%, transparent), transparent 55%); }
.login .brand-co { display: grid; justify-items: center; gap: 10px; margin-bottom: 8px; text-align: center; }
.login .brand-co img { width: auto; height: auto; max-width: 180px; max-height: 72px; object-fit: contain; }
.login .brand-co-name { font-size: 18px; font-weight: 650; }
.login-co .btn.primary { background: var(--brand, var(--indigo-7)); border-color: var(--brand, var(--indigo-7)); color: var(--brand-ink, #fff); }
.login .powered { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--app-muted); }
.login .powered img { width: 16px; height: 16px; }
@media (max-width: 640px) { .co-head-actions { justify-content: flex-start; } .co-brand { flex-direction: column; } }
.zmodal .chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.zmodal .chk input[type=checkbox] { width: auto; flex: none; }
.zmodal .mod-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.zmodal.co-modal { width: min(620px, calc(100vw - 24px)); }
.co-brand .btn { justify-self: start; }
.back-link { display: inline-flex; align-items: center; gap: 4px; }
.back-link .i { transform: rotate(180deg); }

/* Zelio › Sociétés: the Meta app cell and its discreet edit pencil (shown fully on row hover / focus) */
.meta-cell { display: flex; align-items: flex-start; gap: 6px; }
.meta-edit { width: 28px; height: 28px; border-radius: 99px; flex: none; opacity: .45; transition: opacity .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
.co-row:hover .meta-edit, .meta-edit:focus-visible, .row:hover > .meta-edit { opacity: 1; }
.meta-edit:hover { background: var(--app-hover); color: var(--c-blue); transform: scale(1.08); }
.meta-edit:active { transform: scale(.96); }
.meta-edit:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 1px; }
@media (hover: none) { .meta-edit { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .meta-edit { transition: none; } .meta-edit:hover, .meta-edit:active { transform: none; } }

/* Assistant IA › Données de l'IA: the system message as the AI receives it */
.sys-prompt { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0;
  padding: 12px 14px; border: 1px solid var(--app-border, #e5e7eb); border-radius: 8px; background: var(--app-surface-2);
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; unicode-bidi: plaintext; }
#k-pdfs td input[type=text] { min-width: 90px; }
#k-pdfs td, #k-pdfs th { padding-inline-start: 8px; padding-inline-end: 8px; }
#k-pdfs .pdf-act { gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }

/* Assistant IA › Documents de référence (files the AI reads) and the uploaded catalogue PDF */
.know-files { display: grid; gap: 10px; }
.kf { border: 1px solid var(--app-border); border-radius: 10px; padding: 10px 12px; background: var(--app-surface); }
.kf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kf-main { flex: 1 1 220px; min-width: 0; }
.kf-main input { width: 100%; font-weight: 600; }
.kf-act { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kf-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--app-border); }
.kf-pdf { display: inline-flex; align-items: center; justify-content: center; font: 700 11px/1 ui-sans-serif, system-ui, sans-serif; color: #c92a2a; background: var(--app-surface-2); }
.kf details { margin-top: 8px; }
.kf details summary { cursor: pointer; }
.kf textarea { width: 100%; margin-top: 6px; }

/* Assistant IA › usage & estimated cost KPIs */
.ai-usage .kpis { margin-bottom: 8px; }
.skel-kpi { min-height: 104px; background: var(--skel); border: 0; }
.budget-bar { height: 6px; border-radius: 99px; background: var(--app-border); overflow: hidden; margin: 0 0 8px; }
.budget-bar i { display: block; height: 100%; background: var(--app-pos); border-radius: inherit; }
.budget-bar.warn i { background: var(--app-warn); } .budget-bar.bad i { background: var(--app-neg); }
.usage-sum { cursor: pointer; padding: 14px 20px; }
.cc-wrap { overflow-x: auto; }

/* ===================================================================== UI wave 1 (2026-11-21, ui-ux-pro-max)
   Design tokens, accessible dialogs, toasts, command palette, skip link, focus and touch targets.
   Layout uses logical properties (inline-start / inline-end) so an Arabic RTL version only needs dir="rtl". */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 28px;
  --z-sticky: 40; --z-overlay: 60; --z-modal: 61; --z-palette: 70; --z-toast: 1000;
  --dur-fast: 120ms; --dur: 200ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --ok-bg: #ebfbee; --ok-ink: #1b6b30; --err-bg: #fff0f0; --err-ink: #a51d14; --warn-bg: #fff4e6; --warn-ink: #9a3412; --info-bg: var(--indigo-0); --info-ink: var(--indigo-9);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
:root[data-theme="dark"] {
  --ok-bg: rgba(81, 207, 102, .14); --ok-ink: #8ce99a; --err-bg: rgba(255, 107, 107, .14); --err-ink: #ffa8a8; --warn-bg: rgba(255, 146, 43, .14); --warn-ink: #ffc078;
  --info-bg: rgba(116, 143, 252, .14); --info-ink: #bac8ff;
}

/* focus: always visible for keyboard users, on every control (fields included) */
:where(a, button, input, select, textarea, summary, [tabindex], [role="tab"], [role="option"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(input, select, textarea):focus-visible { outline-offset: 0; box-shadow: var(--focus-ring); }
.app-content:focus { outline: none; }

/* skip link: first stop of the keyboard, hidden until focused */
.skip-link { position: fixed; inset-inline-start: 12px; top: 8px; z-index: var(--z-toast); transform: translateY(-160%); padding: 8px 14px; border-radius: var(--radius-sm);
  border: 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; transition: transform var(--dur) var(--ease); }
.skip-link:focus { transform: none; }

/* search / command palette button in the top bar */
.topsearch { display: inline-flex; align-items: center; gap: 8px; height: 34px; min-width: 220px; padding: 0 8px 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--app-border); background: var(--app-surface-2); color: var(--app-muted); font-size: var(--fs-sm); cursor: pointer; transition: border-color var(--dur-fast); }
.topsearch:hover { border-color: var(--app-border-strong); color: var(--app-text); }
.topsearch span { flex: 1; text-align: start; }
kbd { font: 600 11px/1 "Inter Variable", system-ui, sans-serif; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--app-border-strong); background: var(--app-surface); color: var(--app-muted); }
@media (max-width: 760px) { .topsearch { min-width: 0; width: 34px; padding: 0; justify-content: center; } .topsearch span, .topsearch kbd { display: none; } }

/* dialogs */
.zmodal { z-index: var(--z-modal); animation: dlg-in var(--dur) var(--ease); }
.zmodal:focus { outline: none; }
.ui-confirm { width: min(440px, calc(100vw - 24px)); gap: 6px; padding: 22px; }
.ui-confirm h3 { font-size: var(--fs-lg); line-height: 1.35; }
.ui-confirm p { margin: 0; line-height: 1.5; }
.ui-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn.danger-solid { background: #c92a2a; border-color: #c92a2a; color: #fff; } /* white on #c92a2a: 5.4:1 */
.btn.danger-solid:hover { background: #a61e1e; }
@keyframes dlg-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 6px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* toasts: success / error / info, announced, dismissible */
.ui-toast { cursor: default; align-items: center; }
.ui-toast .toast-msg { white-space: normal; color: var(--app-text); }
.ui-toast.t-success .toast-ic { color: var(--ok-ink); } .ui-toast.t-error .toast-ic { color: var(--err-ink); } .ui-toast.t-info .toast-ic { color: var(--info-ink); }
.ui-toast.t-error { border-color: color-mix(in srgb, var(--err-ink) 40%, var(--app-border)); }
.toast-x { flex: none; margin-inline-start: auto; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--app-muted); cursor: pointer; }
.toast-x:hover { background: var(--app-hover); color: var(--app-text); }
.toast-x .i { width: 16px; height: 16px; }

/* command palette */
.cmdk { z-index: var(--z-palette); top: 14vh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); padding: 0; gap: 0; overflow: hidden; animation: none; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--app-border); color: var(--app-muted); }
.cmdk-in input { flex: 1; border: 0; background: none; font-size: var(--fs-lg); padding: 4px 0; box-shadow: none !important; outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow: auto; }
.cmdk-list li { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.cmdk-list li[aria-selected="true"] { background: var(--accent-soft); }
.cmdk-l { font-weight: 550; } .cmdk-s { color: var(--app-muted); font-size: var(--fs-sm); margin-inline-start: auto; }
.cmdk-empty { color: var(--app-muted); justify-content: center; cursor: default; }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--app-border); }
.cmdk-foot kbd { margin-inline-end: 3px; }

/* touch: 44 px targets on coarse pointers (phones, tablets) */
@media (pointer: coarse) {
  .btn, .icon-btn, .app-tabs a, .chip, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .toast-x { min-height: 44px; }
  .icon-btn, .toast-x { min-width: 44px; }
  .btn.sm { min-height: 44px; }
  .seg button, .btn.sm.danger { min-height: 44px; min-width: 44px; }
}
/* reduced motion everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
#tout[data-state="ok"] { color: var(--ok-ink); } #tout[data-state="error"] { color: var(--err-ink); }

.sc-why summary { color: var(--app-muted); cursor: pointer; }
.linkbtn { min-height: 24px; }
@media (pointer: coarse) { .ph-send, .cmp-send { width: 44px; height: 44px; } .linkbtn { min-height: 44px; } }
.focus-start { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* Assistant IA › Clé API IA dialog (aiKeyModal) */
.akm { display: grid; gap: 16px; }
.akm-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--app-hover); font-size: 13.5px; }
.akm-status > svg { flex: none; margin-top: 2px; color: var(--app-muted); }
.akm-status.is-own { background: var(--accent-soft); }
.akm-status.is-own > svg { color: var(--accent); }
.akm-step { display: grid; gap: 6px; }
.akm-label { font-size: 13px; font-weight: 600; }
.akm-providers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 30em) { .akm-providers { grid-template-columns: 1fr; } }
.akm-prov { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--app-border); border-radius: 10px; cursor: pointer; }
.akm-prov:hover { border-color: var(--app-border-strong); }
.akm-prov:has(input:checked) { border-color: var(--indigo-5); background: var(--accent-soft); }
.zmodal .akm-prov input { width: auto; flex: none; margin-top: 3px; accent-color: var(--indigo-7); }
.akm-prov > span { display: grid; gap: 2px; }
.akm-warn { margin: 0; }
.akm-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; }
.akm .err:empty { display: none; }

/* ===================================================================== UI wave 2 (2026-11-21): daily pages
   Vue tableau (sort, export, keyboard rows, cards on phones), Conversations (shortcuts, compact phone filters), chips rows. */
.tablebar-end { display: flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.sortsel { display: inline-flex; align-items: center; gap: 6px; color: var(--app-muted); }
.sortsel select { height: 34px; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; text-align: center; color: var(--app-text); }
.empty-state > .i { color: var(--app-muted); }
.empty-state .btn { margin-top: 6px; }
table.leadtable tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 4px 0 8px; align-items: center; }
.keys dt { white-space: nowrap; } .keys dd { margin: 0; color: var(--app-muted); }
.keys kbd { font-size: 12px; padding: 3px 7px; }
.cv-keys { margin-inline-start: auto; }
@media (hover: none) { .cv-keys { display: none; } }

/* phones: filters take one line each, chips scroll sideways instead of wrapping over three lines */
@media (max-width: 640px) {
  .chips-scroll, .q-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-block: 2px; scroll-snap-type: x proximity; }
  .chips-scroll::-webkit-scrollbar, .q-tabs::-webkit-scrollbar { display: none; }
  .chips-scroll .chip, .q-tabs .chip { flex: none; scroll-snap-align: start; }
  .tablebar { gap: 8px; }
  .tablebar .search { flex: 1 1 100%; }
  .tablebar-end { width: 100%; margin-inline-start: 0; }
  .tablebar-end .sortsel { flex: 1; } .tablebar-end .sortsel select { width: 100%; }
  /* the table becomes one card per client: name + state on top, details below */
  table.leadtable thead { display: none; }
  table.leadtable, table.leadtable tbody { display: block; }
  table.leadtable tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--app-border); }
  table.leadtable td { display: block; padding: 0; border: 0; }
  table.leadtable td:nth-child(1) { grid-column: 1; } table.leadtable td:nth-child(2) { grid-column: 2; text-align: end; }
  table.leadtable td:nth-child(n+3) { grid-column: 1 / -1; }
  table.leadtable td:nth-child(4) { display: none; } /* source: on the client's card */
  table.leadtable .clip { max-width: none !important; }
  /* conversations: the list starts higher */
  .cv-tools { gap: 8px; padding: 10px 12px 6px; }
  .cv-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .cv-hint { display: none; }
  .cv-titlebar select { max-width: 150px; }
}
@media (max-width: 640px) {
  /* header filters: period on its own line, then the two lists side by side */
  .page-header .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .page-header .filters > .seg { grid-column: 1 / -1; }
  .page-header .filters > select, .page-header .filters > label select { width: 100%; min-width: 0; }
  .page-header .filters > select:only-of-type { grid-column: 1 / -1; }
  /* client cards: the salesperson on one short line */
  table.leadtable td:nth-child(3) .avatar { display: none; }
  table.leadtable td:nth-child(3) .who { min-width: 0 !important; }
  table.leadtable td:nth-child(3) .who > div { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
}
