/* Zelio Pulse design system v3 (2026-11-21). One source of truth for colour, type, space, radius and depth.
   Identity: Zelio navy ink for primary actions and the brand, one blue for interaction (links, selection, focus),
   Pulse teal only for the brand mark and "live", violet only for the AI. Cool neutrals, flat surfaces, thin borders.
   Every text pair is checked ≥ 4.5:1 by scripts/ui-check.mjs in both themes. */
@font-face { font-family: "Inter Variable"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* neutrals */
  --app-bg: #f6f7f9; --app-surface: #fff; --app-surface-2: #f9fafb; --app-border: #e4e7ec; --app-border-strong: #cfd4dc;
  --app-text: #101828; --app-muted: #475467; --app-faint: #5d6679; --app-sidebar: #f6f7f9; --app-hover: #eff1f4; --app-sel: #e9eefc;
  /* semantic ink (text on surface) */
  --app-pos: #13703a; --app-neg: #b42318; --app-warn: #a24a05;
  /* interaction blue (kept under the --indigo-* names the pages already use) */
  --indigo-0: #eef2fe; --indigo-1: #dce4fd; --indigo-3: #a4b7f8; --indigo-5: #5675ec; --indigo-7: #2f50d8; --indigo-9: #2340b0;
  --accent: var(--indigo-7); --accent-soft: var(--indigo-0); --accent-ink: var(--indigo-9);
  /* brand */
  --ink: #111a3a; --ink-hover: #0a1030; --on-ink: #fff; --brand-navy: #0d1433; --brand-teal: #0f9b82;
  /* AI */
  --ai: #6941c6; --ai-soft: #f4f1fd; --ai-ink: #53389e; --ai-line: #d9cff7;
  /* depth: borders do the work, shadows only for things that float */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 44px -12px rgba(16, 24, 40, .22), 0 4px 10px -4px rgba(16, 24, 40, .06);
  /* shape */
  --radius: 10px; --radius-sm: 7px; --radius-xs: 5px; --topbar-h: 52px; --sidebar-w: 232px;
  /* chart + status hues (fills, dots; never text on their own) */
  --c-green: #2f9e44; --c-red: #e03131; --c-orange: #e8590c; --c-blue: #5675ec; --c-grey: #98a2b3; --c-violet: #7a5af8;
  --chat-bg: #efeae2; --chat-in: #fff; --chat-out: #d9fdd3;
  --ch-won: #2f9e44; --ch-other: #a4b7f8; --ch-none: #f04438; --ch-line: #e8590c; --skel: #eceef2;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --app-bg: #0b0d12; --app-surface: #12151c; --app-surface-2: #161a22; --app-border: #232835; --app-border-strong: #313848;
  --app-text: #e9ecf2; --app-muted: #a7afbe; --app-faint: #949cad; --app-sidebar: #0e1016; --app-hover: #1b1f29; --app-sel: #1c2440;
  --app-pos: #6ce08a; --app-neg: #ff8f87; --app-warn: #f6ae5a;
  --indigo-0: #18203a; --indigo-1: #1f2a4d; --indigo-3: #5675ec; --indigo-5: #7f98f5; --indigo-7: #8ea4ff; --indigo-9: #c5d1ff;
  --accent: #8ea4ff; --accent-soft: rgba(142, 164, 255, .13); --accent-ink: #c5d1ff;
  --ink: #e9ecf2; --ink-hover: #fff; --on-ink: #0b0d12; --brand-navy: #e9ecf2; --brand-teal: #2fd3b2;
  --ai: #a48afb; --ai-soft: rgba(164, 138, 251, .13); --ai-ink: #cbbdfe; --ai-line: #3b3164;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 8px 22px -6px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, .75);
  --chat-bg: #0b141a; --chat-in: #1f2c33; --chat-out: #005c4b;
  --ch-won: #51cf66; --ch-other: #5675ec; --ch-none: #ff6b6b; --ch-line: #ff922b; --skel: #1f2430;
  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); }
.cv-sort { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cv-sort .seg button { height: 26px; font-size: 12.5px; }
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; }
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-inline-end: 42px; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; padding: 6px; background: none; border: 0; color: var(--app-muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover { color: var(--app-text); }
.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-panel: 200; --z-drawer: 211; --z-overlay: 300; --z-modal: 301; --z-palette: 310; --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; }
}

/* ===================================================================== UI wave 3 (2026-11-21): AI and configuration pages */
/* save bar: shown while a form has unsaved changes, always reachable at the bottom of the screen */
.savebar { position: sticky; bottom: 12px; z-index: var(--z-sticky); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px auto 0; width: fit-content; max-width: 100%;
  padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--app-surface); border: 1px solid var(--app-border-strong); box-shadow: var(--shadow-lg); animation: savebar-in var(--dur) var(--ease); }
.savebar[hidden] { display: none; }
.savebar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-orange); flex: none; }
.savebar-tx { font-weight: 600; margin-inline-end: 6px; }
@keyframes savebar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 991px) { .savebar { bottom: calc(72px + env(safe-area-inset-bottom)); } } /* above the phone bottom bar */
@media (max-width: 480px) { .savebar { width: 100%; } .savebar .btn { flex: 1; justify-content: center; } .savebar-tx { flex: 1 1 100%; } }

/* section menu of long settings forms (Assistant IA › Réglages) */
.secnav { position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 5; display: flex; gap: 6px; padding: 8px 0; margin-bottom: 12px; background: var(--app-bg); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.secnav::-webkit-scrollbar { display: none; }
.secnav .chip { flex: none; text-decoration: none; color: var(--app-text); }

/* automations: ready-made scenarios on the empty list, palette search */
.wf-starters { margin-top: 16px; display: grid; gap: 14px; }
.wf-starters-h h2 { margin-bottom: 4px; } .wf-starters-h p { margin: 0; }
.wf-starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wf-starter { display: grid; gap: 6px; align-content: start; text-align: start; padding: 16px; border-radius: var(--radius); border: 1px solid var(--app-border); background: var(--app-surface); cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); font: inherit; color: inherit; }
.wf-starter:hover { border-color: var(--indigo-3); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.wf-starter .wf-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); }
.wf-psearch { display: flex; align-items: center; gap: 6px; padding: 0 10px; margin-bottom: 10px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface); color: var(--app-muted); }
.wf-psearch input { flex: 1; border: 0; background: none; height: 34px; box-shadow: none !important; outline: none; min-width: 0; }
.wf-psearch:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.wf-pitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wf-pitem[hidden], .wf-pgroup[hidden] { display: none; }

/* Numéros on phones: one card per number, status and actions visible */
@media (max-width: 640px) {
  table.linestable thead { display: none; }
  table.linestable, table.linestable tbody { display: block; }
  table.linestable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 14px; border-bottom: 1px solid var(--app-border); }
  table.linestable td { display: block; padding: 0; border: 0; min-width: 0 !important; }
  table.linestable td:first-child { grid-column: 1 / -1; }
  table.linestable td select { width: 100%; }
  table.linestable td:has(.pill), table.linestable td.r { grid-column: 1 / -1; }
  table.linestable td.r .row { justify-content: flex-start !important; flex-wrap: wrap !important; }
  table.linestable td.num { display: none; }
}
/* number page: edit on the left, test on the right (wide screens) */
@media (min-width: 1200px) {
  #nbf { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 20px; align-items: start; }
  #nbf > .card { grid-column: 1; }
  #nbf > .card:last-child { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--topbar-h) + 16px); }
  #nbf > .card:last-child #nb-log { max-height: 46vh; overflow: auto; }
}
/* automations list on phones: one card per scenario (name, trigger, last run, switch and actions) */
@media (max-width: 640px) {
  table.autotable thead { display: none; }
  table.autotable, table.autotable tbody { display: block; }
  table.autotable tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 14px; border-bottom: 1px solid var(--app-border); }
  table.autotable td { display: block; padding: 0; border: 0; }
  table.autotable td:nth-child(1) { grid-column: 1; } table.autotable td:nth-child(6) { grid-column: 2; grid-row: 1; }
  table.autotable td:nth-child(2), table.autotable td:nth-child(4) { grid-column: 1 / -1; color: var(--app-muted); font-size: var(--fs-sm); }
  table.autotable td:nth-child(3), table.autotable td:nth-child(5) { display: none; }
  table.autotable td:last-child { grid-column: 1 / -1; text-align: start; white-space: normal !important; }
  table.autotable td:last-child .btn { min-width: 44px; justify-content: center; }
}

/* ===================================================================== UI wave 4 (2026-11-21): results, catalogue, settings, operator
   Wide tables show they scroll (edge shadows) and keep their first column on phones; onboarding checklist. */
.tw { position: relative; }
.tw.can-scroll { background:
    linear-gradient(to right, var(--app-surface) 30%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--app-surface) 30%, transparent) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .14), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .14), transparent) right / 12px 100% no-repeat scroll; }
:root[data-theme="dark"] .tw.can-scroll { background:
    linear-gradient(to right, var(--app-surface) 30%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--app-surface) 30%, transparent) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .55), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .55), transparent) right / 12px 100% no-repeat scroll; }
@media (max-width: 640px) {
  /* the first column (what the row is about) stays visible while the other columns scroll */
  .tw.can-scroll table:not(.leadtable):not(.linestable):not(.autotable) :is(th, td):first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--app-surface); box-shadow: 1px 0 0 var(--app-border); }
  .tw.can-scroll table:not(.leadtable):not(.linestable):not(.autotable) thead th:first-child { background: var(--app-surface-2, var(--app-surface)); }
}

/* onboarding checklist (Aujourd'hui) */
.onboard { display: grid; gap: 12px; margin-bottom: 16px; }
.onboard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.onboard-head h2 { margin: 0 0 2px; }
.onboard-bar { height: 6px; border-radius: 99px; background: var(--app-hover); overflow: hidden; }
.onboard-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--dur) var(--ease); }
.onboard-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.onboard-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-radius: 8px; }
.onboard-steps li + li { border-top: 1px solid var(--app-border); }
.onboard-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-top: 1px; }
.onboard-steps li.is-done .onboard-ic { background: var(--ok-bg); color: var(--ok-ink); }
.onboard-steps li.is-done .strong { color: var(--app-muted); text-decoration: line-through; text-decoration-color: var(--app-border-strong); }

/* ===================================================================== Zelio design system v3 (2026-11-21)
   Replaces the "Bold modern" layer (dark gradient sidebar, gradient banner, accent bars, display font).
   Rules here are the reference for every component; earlier blocks keep only layout specific to one page.
   Tokens: top of this file. Scale: 4 / 8 / 12 / 16 / 20 / 24 / 32. Type: 12 / 12.5 / 13 / 14 / 16 / 20. */
:root {
  --ok-bg: #ecfdf3; --ok-ink: #13703a; --err-bg: #fef3f2; --err-ink: #b42318; --warn-bg: #fffaeb; --warn-ink: #a24a05;
  --info-bg: var(--indigo-0); --info-ink: var(--indigo-9);
  --brand-navy: #0d1433; --brand-teal: #0f9b82;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  --control-h: 34px; --control-h-sm: 28px;
}
:root[data-theme="dark"] {
  --ok-bg: rgba(108, 224, 138, .12); --ok-ink: #8be3a3; --err-bg: rgba(255, 143, 135, .12); --err-ink: #ffaba4; --warn-bg: rgba(246, 174, 90, .12); --warn-ink: #f8c27f;
  --info-bg: var(--accent-soft); --info-ink: var(--accent-ink);
  --brand-navy: #e9ecf2; --brand-teal: #2fd3b2;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand-navy: #e9ecf2; --brand-teal: #2fd3b2; } }

/* ---------- base type ---------- */
body { font: 14px/1.5 "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif; font-feature-settings: "cv11", "ss01", "tnum" 0; letter-spacing: -.006em; }
h1, h2, h3 { font-family: inherit; }
h2, .card h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; margin: 0 0 12px; }
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -.018em; line-height: 1.3; gap: 8px; }
.page-title .tally { font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: var(--radius-xs); background: var(--app-hover); color: var(--app-muted); }
.page-subtitle { font-size: 13px; margin-top: 2px; max-width: 72ch; }
.page-header { align-items: flex-end; margin-bottom: 20px; gap: 12px 20px; }
.small { font-size: 12.5px; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a.btn:hover, a.card:hover, .sb-link:hover, .app-tabs a:hover, .bottom-nav a:hover, a.td-card:hover, .td-row a:hover, .cv-row:hover, a.dkpi:hover { text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- shell ---------- */
.app-sidebar { background: var(--app-sidebar); border-inline-end: 1px solid var(--app-border); color: var(--app-text); }
.sb-head { padding: 12px 12px 8px; min-height: 56px; gap: 10px; }
.sb-logo { width: 30px; height: 30px; border-radius: 8px; background: none; }
.sb-logo img { width: 28px; height: 28px; }
.sb-org-name { font-size: 13.5px; font-weight: 600; color: var(--app-text); }
.sb-org-sub { font-size: 11.5px; color: var(--app-faint); }
.sb-org .coswitch { height: 28px; font-size: 13.5px; color: var(--app-text); }
.sb-nav { padding: 4px 8px 8px; gap: 1px; }
.sb-nav > .sb-link.sb-top, .sb-link { min-height: 32px; padding: 5px 10px; font-size: 13.5px; font-weight: 500; border-radius: var(--radius-sm); color: var(--app-muted); gap: 10px; }
.sb-link > .i { width: 17px; height: 17px; color: var(--app-faint); }
.sb-link:hover { background: var(--app-hover); color: var(--app-text); }
.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-section { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--app-faint); letter-spacing: .01em; }
.app-sidebar[data-collapsed] .sb-section { display: none; }
.sb-foot { padding: 10px 12px; border-top: 1px solid var(--app-border); }
.sb-avatar { width: 28px; height: 28px; font-size: 11px; }
.sb-user-name { font-size: 13px; font-weight: 600; }
.count { height: 18px; min-width: 20px; font-size: 11px; font-weight: 600; border-radius: 9px; background: var(--c-red); color: #fff; }
.app-sidebar .wm { color: var(--brand-navy); } .app-sidebar .wm b { color: var(--brand-teal); }

.app-topbar { height: var(--topbar-h); padding: 0 20px 0 12px; gap: 8px; background: var(--app-bg); backdrop-filter: none; border-bottom: 1px solid var(--app-border); }
.crumbs { font-size: 13.5px; gap: 6px; }
.crumb-sep { color: var(--app-border-strong); }
.crumb-parent { color: var(--app-muted); }
.crumb-current { font-weight: 600; color: var(--app-text); }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--app-muted); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--app-hover); color: var(--app-text); }
.topsearch { height: 32px; min-width: 240px; background: var(--app-surface); border-color: var(--app-border); border-radius: var(--radius-sm); font-size: 13px; }
.topsearch .i { width: 15px; height: 15px; }
kbd { font: 500 11px/1 "Inter Variable", system-ui, sans-serif; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--app-border); border-bottom-width: 2px; background: var(--app-surface-2); color: var(--app-muted); }

.app-tabs { padding: 0 24px; gap: 4px; background: var(--app-bg); top: var(--topbar-h); }
.app-tabs a { min-height: 40px; padding: 0 8px; font-size: 13.5px; font-weight: 500; color: var(--app-muted); border-bottom: 2px solid transparent; }
.app-tabs a:hover { color: var(--app-text); }
.app-tabs a[aria-current="page"] { color: var(--app-text); font-weight: 600; border-bottom: 2px solid var(--ink); }
:root[data-theme="dark"] .app-tabs a[aria-current="page"] { color: var(--app-text); }
.app-content { padding: 24px 28px 56px; max-width: 1320px; animation: page-in .18s ease both; }

/* ---------- buttons ---------- */
.btn { height: var(--control-h); padding: 0 12px; gap: 6px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; border: 1px solid var(--app-border-strong);
  background: var(--app-surface); color: var(--app-text); box-shadow: var(--shadow-sm); transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--app-surface-2); border-color: var(--app-border-strong); }
.btn.primary { background: var(--ink); background-image: none; border-color: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.sm { height: var(--control-h-sm); padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn.sm .i { width: 14px; height: 14px; }
.btn.danger { color: var(--app-neg); }
.btn.danger:hover { border-color: color-mix(in srgb, var(--app-neg) 40%, var(--app-border)); background: var(--err-bg); }
.btn.danger-solid { background: #b42318; border-color: #b42318; color: #fff; }
.btn.danger-solid:hover { background: #912018; border-color: #912018; }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--app-muted); }
.btn.ghost:hover { background: var(--app-hover); color: var(--app-text); }
.btn.wa { background: #157a43; border-color: #157a43; color: #fff; }
.btn.wa:hover { background: #106636; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.linkbtn { color: var(--accent); }

/* ---------- fields ---------- */
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: var(--control-h); border-radius: var(--radius-sm); border: 1px solid var(--app-border-strong); background-color: var(--app-surface); box-shadow: none; font-size: 13.5px; color: var(--app-text); }
textarea { height: auto; padding: 8px 10px; line-height: 1.5; }
select { padding-inline-end: 28px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px; }
[dir="rtl"] select { background-position: left 9px center; }
select[multiple] { background-image: none; height: auto; padding: 4px; }
select:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--app-border-strong) 60%, var(--app-muted)); }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--app-faint) 85%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--app-neg); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 16px; height: 16px; }
label.f { gap: 5px; font-size: 13px; font-weight: 500; color: var(--app-text); }
label.f > .muted, label.f > .small { font-weight: 400; }
.search svg { top: 50%; transform: translateY(-50%); width: 16px; height: 16px; }
.search input { padding-inline-start: 32px; }
.ib-search .i { width: 16px; height: 16px; }

/* segmented control (period, view) */
.seg { padding: 2px; gap: 2px; border-radius: 8px; background: var(--app-hover); border: 1px solid var(--app-border); }
.seg button { height: 28px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--app-muted); }
.seg button:hover { color: var(--app-text); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--app-surface); color: var(--app-text); font-weight: 600; box-shadow: 0 0 0 1px var(--app-border), var(--shadow-sm); }

/* filter chips: quiet toggles, not pills */
.chip { height: 30px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--app-border); background: var(--app-surface); box-shadow: none; font-size: 13px; font-weight: 500; color: var(--app-muted); }
.chip:hover { color: var(--app-text); border-color: var(--app-border-strong); }
.chip.on, .chip[aria-pressed="true"] { background: var(--app-sel); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); font-weight: 600; }

/* ---------- surfaces ---------- */
.card { border-radius: var(--radius); border: 1px solid var(--app-border); box-shadow: none; padding: 18px 20px; background: var(--app-surface); }
a.card:hover { border-color: var(--app-border-strong); box-shadow: var(--shadow-sm); }
.card.flush > h2 { padding: 16px 20px 4px; }
.grid { gap: 16px; }
.dkpi, .kpi, .td-card { position: relative; overflow: visible; }
.dkpi::before, .kpi::before, .td-card::before { content: none; display: none; }
.kpi { padding: 16px 18px; }
.kpi .l, .dkpi .l { font-size: 12.5px; font-weight: 500; color: var(--app-muted); }
.kpi .v, .dkpi .v { font-family: inherit; font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.kpi .s, .dkpi .s { font-size: 12.5px; color: var(--app-muted); }

/* callouts: one shape, four tones */
.note { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; background: var(--info-bg); color: var(--info-ink); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--app-warn) 22%, transparent); }
.note.bad, .note.err { background: var(--err-bg); color: var(--err-ink); border-color: color-mix(in srgb, var(--app-neg) 22%, transparent); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: color-mix(in srgb, var(--app-pos) 22%, transparent); }
.note .i { width: 17px; height: 17px; flex: none; }

/* ---------- tables ---------- */
table { font-size: 13.5px; }
thead th, .tw table thead th, table thead th { height: 36px; padding: 0 14px; font-size: 12px; font-weight: 500; color: var(--app-muted); background: var(--app-surface-2); border-bottom: 1px solid var(--app-border); letter-spacing: 0; }
tbody td { height: 48px; padding: 8px 14px; border-bottom: 1px solid var(--app-border); }
tr.click:hover td, table tbody tr.click:hover, table tbody tr[tabindex]:hover { background: var(--app-surface-2); }
tr.click:hover td { background: transparent; }
.pager { padding: 8px 14px; font-size: 12.5px; }

/* ---------- status badges (were pills): small, square-ish, dot + label ---------- */
.pill { gap: 5px; height: 22px; padding: 0 7px 0 6px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1;
  background: color-mix(in srgb, var(--p) 10%, var(--app-surface)); color: color-mix(in srgb, var(--p) 68%, var(--app-text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p) 16%, transparent); }
.pill::before { width: 6px; height: 6px; }
.pill .i { width: 12px; height: 12px; }
.h-unanswered { --p: #d92d20; } .h-waiting { --p: #dc6803; } .h-cold { --p: #2f50d8; } .h-active { --p: #12805c; } .h-won { --p: #0e7490; } .h-lost { --p: #667085; } .h-demo { --p: #667085; } .h-qr { --p: #dc6803; }
:root[data-theme="dark"] .pill { background: color-mix(in srgb, var(--p) 16%, var(--app-surface)); color: color-mix(in srgb, var(--p) 45%, #fff); }
.tag { border-radius: var(--radius-xs); font-weight: 500; font-size: 12px; }
.ib-chip { border-radius: var(--radius-xs); font-weight: 500; height: 20px; }
.avatar { font-weight: 600; }

/* AI marker: one look everywhere (list, bubble, card) */
.ai-mark { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--radius-xs); font-size: 11.5px; font-weight: 600; color: var(--ai-ink); background: var(--ai-soft); white-space: nowrap; flex: none; }
.ai-mark .i { width: 12px; height: 12px; }
.ai-mark.off { color: var(--app-muted); background: var(--app-hover); }
.ai-mark.hand { color: var(--warn-ink); background: var(--warn-bg); }

/* ---------- dialogs, drawers, popovers, toasts ---------- */
.overlay { background: rgba(16, 24, 40, .38); backdrop-filter: none; }
.zmodal { border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--app-border); padding: 20px; gap: 12px; }
.zmodal h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.drawer { border-radius: 12px; box-shadow: var(--shadow-lg); }
.drawer header h3 { font-size: 16px; font-weight: 600; }
.cmp-menu, .cmdk { border-radius: 12px; box-shadow: var(--shadow-lg); }
.toast { border-radius: 10px; box-shadow: var(--shadow-lg); }
.cmdk-list li[aria-selected="true"] { background: var(--app-sel); }
[title] { text-decoration: none; }

/* ---------- empty, loading, error ---------- */
.empty { padding: 40px 20px; font-size: 13.5px; }
.empty-state { padding: 40px 20px; gap: 6px; }
.empty-state > .i { width: 22px; height: 22px; color: var(--app-faint); }
.empty-state b { font-weight: 600; }
.empty.err, .dash-error { color: var(--err-ink); }
.skel { border-radius: 4px; }

/* ---------- Aujourd'hui ---------- */
.today .td-head { background: none; color: inherit; padding: 0; border-radius: 0; box-shadow: none; margin-bottom: 20px; overflow: visible; align-items: flex-end; }
.today .td-head::after { content: none; }
.today .td-date { color: var(--app-muted); font-size: 13px; }
.today .td-hello { color: var(--app-text); font-size: 20px; font-weight: 600; margin-top: 2px; }
.today .td-for { color: var(--app-muted); }
.today .td-for select { background-color: var(--app-surface); color: var(--app-text); border-color: var(--app-border-strong); }
.td-cards { gap: 12px; }
.td-card { min-height: 0; padding: 16px 18px; gap: 4px; }
.td-card-l { font-size: 13px; font-weight: 500; color: var(--app-muted); }
.td-card.is-bad .td-card-l, .td-card.is-warn .td-card-l { color: var(--app-muted); }
.td-card.is-bad { border-color: var(--app-border); }
.td-card.is-warn { border-color: var(--app-border); }
.td-card-v { font-size: 13.5px; color: var(--app-muted); }
.td-card-v b, .today .td-card-v b { font-family: inherit; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--app-text); }
.td-card.is-bad .td-card-v b { color: var(--app-neg); }
.td-card-s { font-size: 12.5px; }
.td-card-btn { height: 30px; padding: 0 12px; font-size: 13px; margin-top: 10px; font-weight: 500; }
.td-card-link { font-size: 13px; font-weight: 500; margin-top: 10px; color: var(--accent); }
.td-main { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.td-wait > .dash-h { padding: 16px 20px 8px; }
.td-row { padding: 10px 20px; gap: 12px; }
.td-name { font-size: 13.5px; }
.td-row-sub { font-size: 12.5px; color: var(--app-muted); }
.td-row-wait { font-size: 12.5px; font-weight: 500; }
.dash-h h2 { margin: 0; }
.dash-dot { width: 7px; height: 7px; }

/* ---------- Conversations workspace ---------- */
.app-content.cv-page { padding: 0; }
.cv { border: 0; border-radius: 0; box-shadow: none; height: calc(100dvh - var(--topbar-h) - 41px); grid-template-columns: minmax(300px, 340px) minmax(0, 1fr) 320px; background: var(--app-surface); }
.cv-tools { padding: 12px 12px 8px; gap: 8px; }
.cv-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* the tab already says it */
.cv-titlebar { justify-content: flex-end; }
.cv-titlebar select { height: 28px; font-size: 12.5px; max-width: 160px; }
.cv-tools > select { height: 30px; font-size: 13px; }
.cv-filters { display: flex; gap: 6px; }
.cv-filters select { flex: 1; min-width: 0; height: 30px; font-size: 12.5px; }
.cv-tabs { gap: 2px; flex-wrap: wrap; margin: 0; padding: 0; }
.cv-tabs button { min-height: 28px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--app-muted); }
.cv-tabs button[aria-selected="true"] { background: var(--app-sel); color: var(--accent-ink); font-weight: 600; }
.cv-tabs .num { opacity: 1; font-weight: 500; color: inherit; margin-inline-start: 2px; }
.cv-tabs button[aria-selected="false"] .num { color: var(--app-faint); }
.cv-hint { font-size: 12px; color: var(--app-faint); }
.ib-search input { height: 32px; }
.ib-row { min-height: 0; padding: 10px 12px 10px 14px; gap: 10px; border-bottom: 1px solid color-mix(in srgb, var(--app-border) 70%, transparent); }
.ib-row .avatar { width: 32px; height: 32px; }
.ib-row:hover { background: var(--app-surface-2); }
.ib-row.is-sel { background: var(--app-sel); box-shadow: inset 2px 0 0 var(--accent); }
.ib-name { font-weight: 500; font-size: 13.5px; }
.ib-row.is-unread .ib-name { font-weight: 650; }
.ib-top time { font-size: 11.5px; font-weight: 500; color: var(--app-faint); }
.ib-prev { font-size: 12.5px; }
.ib-prev .who-ai-p { color: var(--ai-ink); font-weight: 500; }
.ib-meta { gap: 6px; margin-top: 3px; }
.ib-line { font-size: 11.5px; color: var(--app-faint); }
.ib-unread { position: absolute; inset-inline-start: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.ib-row .sp-ini { margin-inline-start: auto; flex: none; width: 18px; height: 18px; font-size: 9px; }
.cv-load-more { padding: 12px; text-align: center; color: var(--app-faint); font-size: 12px; }
.ib-head { min-height: 56px; padding: 8px 14px; gap: 10px; }
.ib-head .ib-name { font-size: 14px; }
.ib-head-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-switch { display: inline-flex; align-items: center; height: 28px; padding: 2px; gap: 2px; border-radius: 7px; background: var(--app-hover); border: 1px solid var(--app-border); }
.ai-switch button { height: 22px; padding: 0 8px; border: 0; border-radius: 5px; background: none; font-size: 12px; font-weight: 500; color: var(--app-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ai-switch button .i { width: 12px; height: 12px; }
.ai-switch button[aria-pressed="true"] { background: var(--app-surface); color: var(--app-text); font-weight: 600; box-shadow: 0 0 0 1px var(--app-border); }
.ai-switch button[data-mode="ai"][aria-pressed="true"] { color: var(--ai-ink); }
.ai-switch button:disabled { cursor: progress; }
.cv-handover { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12.5px; background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid color-mix(in srgb, var(--app-warn) 20%, transparent); }
.cv-handover b { font-weight: 600; }
.cv-handover .btn { margin-inline-start: auto; }
.msg-row.ai .msg { box-shadow: var(--chat-shadow), inset 3px 0 0 var(--ai); }
[dir="rtl"] .msg-row.ai .msg { box-shadow: var(--chat-shadow), inset -3px 0 0 var(--ai); }
.msg-who { font-size: 11.5px; font-weight: 600; color: var(--app-muted); }
.msg-row.out .msg-who { color: #136c55; }
.msg-row.ai .msg-who { color: var(--ai-ink); display: inline-flex; align-items: center; gap: 4px; }
.msg-row.ai .msg-who .i { width: 12px; height: 12px; }
:root[data-theme="dark"] .msg-row.out .msg-who { color: #7ae3c3; }
:root[data-theme="dark"] .msg-row.ai .msg-who { color: #d7cbff; }
.msg-fail { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--app-neg); font-weight: 500; }
.msg-fail .i { width: 13px; height: 13px; }
.cv-card { background: var(--app-surface); }
.cv-card-top { padding: 10px 14px 2px; }
.cv-card-tabs button { font-size: 12.5px; }
.cv-sec { padding: 12px 14px; gap: 6px; }
.cv-lab { font-size: 11.5px; font-weight: 500; color: var(--app-faint); letter-spacing: .01em; }
.cv-actions .btn { height: 32px; font-weight: 500; }
.cv-won { background: var(--ok-bg); color: var(--ok-ink); border-color: color-mix(in srgb, var(--app-pos) 30%, var(--app-border)); }
.composer.cmp { background: var(--app-surface); }

/* ---------- sign-in ---------- */
.login { background: var(--app-bg); }
.login .card { border-radius: 12px; box-shadow: var(--shadow-md); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .cv { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); } }
@media (max-width: 62em) {
  .app-content { padding: 16px 16px 32px; }
  .app-tabs { padding: 0 8px; }
  .app-topbar { padding: 0 8px; }
  .cv { height: calc(100dvh - var(--topbar-h) - 41px - 64px - env(safe-area-inset-bottom)); }
  .app-sidebar { background: var(--app-surface); }
  .sb-nav > .sb-link.sb-top, .sb-link { min-height: 44px; }
  .page-title { font-size: 18px; }
  .td-main { grid-template-columns: minmax(0, 1fr); }
  .ib-head-ctl .ai-switch button span { display: none; }
}
@media (max-width: 640px) {
  .page-title { font-size: 18px; }
  .today .td-hello { font-size: 18px; }
  .td-card-v b, .today .td-card-v b { font-size: 22px; }
}
@media (pointer: coarse) { .btn.sm { min-width: 44px; justify-content: center; } }
@media (pointer: coarse) {
  .ai-switch { height: 44px; } .ai-switch button { height: 38px; padding: 0 10px; }
  .cv-tabs button { min-height: 40px; }
}

/* ---------- onboarding: one compact row of steps under the day's work ---------- */
.onboard { gap: 10px; margin: 0 0 16px; padding: 16px 18px; }
.onboard-head h2 { margin: 0; }
.onboard-bar { height: 4px; }
.onboard-bar span { background: var(--brand-teal); }
.onboard-steps { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.onboard-steps li, .onboard-steps li + li { border: 1px solid var(--app-border); border-radius: var(--radius-sm); padding: 10px 12px; gap: 10px; background: var(--app-surface-2); }
.onboard-steps li .strong { font-size: 13px; font-weight: 600; }
.onboard-steps li .muted.small { font-size: 12px; line-height: 1.4; }
.onboard-steps li.is-done { background: none; }
.onboard-steps li.is-done .strong { text-decoration: none; color: var(--app-muted); font-weight: 500; }
.onboard-steps li.is-done .muted.small { display: none; }
.onboard-ic { width: 22px; height: 22px; }
.onboard-ic .i { width: 13px; height: 13px; }

/* ---------- Assistant IA › Réglages: state in one sentence ---------- */
.ai-state { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; }
.ai-state-main { flex: 1; min-width: 0; }
.ai-state-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-green) 18%, transparent); }
.ai-state-dot.off { background: var(--c-grey); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-grey) 20%, transparent); }
.ai-state-dot.bad { background: var(--c-red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-red) 18%, transparent); }
.ai-cost > .cfg-step { margin-top: 28px; }
.ai-banner { border-radius: var(--radius-sm); }

/* ---------- Vue tableau: quick owner + actions ---------- */
.lt-assign { height: 30px; font-size: 13px; max-width: 190px; min-width: 140px; }
.lt-none { color: var(--app-faint); }
.lt-actions { display: flex; gap: 4px; justify-content: flex-end; }
.lt-actions .btn { width: 30px; padding: 0; justify-content: center; }
.leadtable .who-ai-p { color: var(--ai-ink); }

/* top bar on narrow screens: the search is an icon, the page name keeps its room */
@media (max-width: 760px) {
  .topsearch { min-width: 0; width: 32px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .topsearch span, .topsearch kbd { display: none; }
  .crumbs { flex: 1; }
}
@media (max-width: 62em) {
  .cv { grid-template-columns: minmax(0, 1fr); }
  .ib-head [data-win] { display: none; } /* the composer states the 24 h window */
  .ib-head { gap: 6px; padding: 6px 8px; }
}
/* contrast (ui-check): status text uses the semantic inks, not the chart hues */
.opt-tag.good { color: var(--app-pos); }
.sc-yes .sc-pts { color: var(--app-pos); } .sc-yes.sc-neg .sc-pts { color: var(--app-neg); }
@media (pointer: coarse) { .lt-actions .btn, .linestable .btn.sm { min-width: 44px; } }

/* ===================================================================== Workspaces (2026-11-21): switcher, Zelio administration, team */
/* workspace switcher (top of the sidebar) */
.sb-head { position: relative; }
.ws { position: relative; flex: 1; min-width: 0; }
.ws-btn, .ws-static { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: start; }
.ws-btn { cursor: pointer; }
.ws-btn:hover, .ws-btn[aria-expanded="true"] { background: var(--app-hover); border-color: var(--app-border); }
.ws-btn > .i { width: 14px; height: 14px; color: var(--app-faint); transform: rotate(90deg); flex: none; }
.ws-logo { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.ws-logo-img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.ws-logo .co-logo { border-radius: 7px; font-size: 11px; }
.ws-txt { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.ws-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sub { font-size: 11.5px; color: var(--app-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pop { position: absolute; z-index: 80; top: calc(100% + 4px); inset-inline-start: 0; width: max(100%, 290px); max-height: min(70vh, 520px); display: flex; flex-direction: column;
  padding: 6px; border-radius: 12px; background: var(--app-surface); border: 1px solid var(--app-border); box-shadow: var(--shadow-lg); color: var(--app-text); }
.ws-pop[hidden] { display: none; }
.ws-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; color: var(--app-text); min-height: 40px; }
.ws-item:hover, .ws-item:focus-visible { background: var(--app-hover); text-decoration: none; outline: none; }
.ws-item.is-cur { background: var(--app-sel); }
.ws-item > .i:last-child { margin-inline-start: auto; color: var(--accent); width: 15px; height: 15px; }
.ws-adminlink { font-weight: 600; font-size: 13.5px; }
.ws-adminlink > .i:first-child { color: var(--app-muted); width: 16px; height: 16px; }
.ws-sep { height: 1px; background: var(--app-border); margin: 6px 2px; }
.ws-search { display: flex; align-items: center; gap: 6px; padding: 0 8px; margin: 2px 0 4px; border: 1px solid var(--app-border-strong); border-radius: var(--radius-sm); }
.ws-search .i { width: 15px; height: 15px; color: var(--app-faint); }
.ws-search input { flex: 1; border: 0 !important; box-shadow: none !important; height: 32px; padding: 0; background: none; min-width: 0; }
.ws-search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.ws-lab { padding: 8px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--app-faint); }
.ws-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.ws-co { display: grid; min-width: 0; line-height: 1.3; }
.ws-co-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-co-sub { font-size: 12px; color: var(--app-muted); }
.ws-co-sub .pill { height: 18px; font-size: 11px; margin-top: 2px; }
.ws-empty { padding: 12px 8px; color: var(--app-muted); font-size: 13px; }
.app-sidebar[data-collapsed] .ws-txt, .app-sidebar[data-collapsed] .ws-btn > .i { display: none; }
.app-sidebar[data-collapsed] .ws-pop { width: 290px; }
.sb-head .sb-logo, .sb-head .sb-org { display: none; }

/* Zelio administration: the operator's own control panel, visibly not a customer's workspace */
.is-admin .app-sidebar { background: #0d1433; border-inline-end-color: #0d1433; color: #d6dbf5; }
.is-admin .app-sidebar .ws-name { color: #fff; } .is-admin .app-sidebar .ws-sub { color: #a8b0d9; }
.is-admin .app-sidebar .ws-btn:hover, .is-admin .app-sidebar .ws-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); }
.is-admin .app-sidebar .ws-btn > .i { color: #a8b0d9; }
.is-admin .app-sidebar .sb-link { color: #c3c9ea; }
.is-admin .app-sidebar .sb-link > .i { color: #8f98c9; }
.is-admin .app-sidebar .sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.is-admin .app-sidebar .sb-link[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.is-admin .app-sidebar .sb-link[aria-current="page"] > .i { color: #5ee0c4; }
.is-admin .app-sidebar .sb-foot { border-top-color: rgba(255, 255, 255, .1); }
.is-admin .app-sidebar .sb-user-name { color: #fff; } .is-admin .app-sidebar .sb-user-role { color: #a8b0d9; }
.is-admin .app-sidebar .icon-btn { color: #c3c9ea; } .is-admin .app-sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.is-admin .app-sidebar :focus-visible { outline-color: #a4b7f8; }
.is-admin .app-topbar .crumb-parent { color: var(--app-muted); }
:root[data-theme="dark"] .is-admin .app-sidebar { background: #070a1c; border-inline-end-color: var(--app-border); }

/* operator inside a customer's workspace */
.op-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 24px; font-size: 12.5px; background: #0d1433; color: #d6dbf5; }
.op-banner b { color: #fff; font-weight: 600; }
.op-banner .i { color: #5ee0c4; flex: none; }
.op-banner span { flex: 1; min-width: 200px; }
.op-banner a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.op-banner a:focus-visible { outline-color: #a4b7f8; }
@media (max-width: 62em) { .op-banner { padding: 7px 12px; } }

/* administration pages */
.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .adm-grid { grid-template-columns: minmax(0, 1fr); } }
.adm-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px 10px; border-bottom: 1px solid var(--app-border); }
.adm-h h2 { margin: 0; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li + li { border-top: 1px solid var(--app-border); }
.adm-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; color: inherit; }
.adm-row:hover { background: var(--app-surface-2); text-decoration: none; }
.adm-row > .i { color: var(--app-faint); width: 14px; height: 14px; }
.adm-main { flex: 1; min-width: 0; display: grid; }
.adm-main b { font-weight: 600; font-size: 13.5px; }
.t-bad { color: var(--app-neg); } .t-warn { color: var(--app-warn); }
.adm-act td { height: auto; padding-block: 9px; vertical-align: top; }
.adm-act td:first-child { white-space: nowrap; width: 1%; }
.mship { display: flex; flex-wrap: wrap; gap: 4px; }
.mship-i { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: var(--radius-xs); background: var(--app-hover); color: var(--app-text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.mship-i span { color: var(--app-muted); font-weight: 400; }
.mship-i:hover { background: var(--app-sel); text-decoration: none; }
.mship-i.is-off { text-decoration: line-through; color: var(--app-faint); }

/* Équipe */
.team-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; border: 1px solid var(--app-border); border-radius: var(--radius); background: var(--app-surface); }
.team-stat { display: grid; gap: 2px; padding: 12px 16px; }
.team-stat + .team-stat { border-inline-start: 1px solid var(--app-border); }
.team-stat-v { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
@media (max-width: 760px) { .team-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .team-stat:nth-child(4) { border-inline-start: 0; } .team-stat:nth-child(n+4) { border-top: 1px solid var(--app-border); } }
.teamtable select { height: 30px; font-size: 13px; min-width: 170px; }
.teamtable .mt-xs { display: block; margin-top: 6px; }
.teamtable tr.is-off td { color: var(--app-muted); }
.acct-shared { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--app-muted); }
.acct-shared .i { width: 12px; height: 12px; }
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .role-cards { grid-template-columns: minmax(0, 1fr); } }
.role-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface-2); }
.role-card b { font-size: 13.5px; font-weight: 600; }
.role-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.role-pick legend { margin-bottom: 6px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); cursor: pointer; }
.role-opt:hover { border-color: var(--app-border-strong); }
.role-opt:has(input:checked) { border-color: var(--accent); background: var(--app-sel); }
.zmodal .role-opt input { width: auto; flex: none; margin-top: 3px; }
.role-opt > span { display: grid; gap: 2px; }
@media (max-width: 640px) {
  table.teamtable thead { display: none; }
  table.teamtable, table.teamtable tbody { display: block; }
  table.teamtable tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--app-border); }
  table.teamtable td { display: block; padding: 0; border: 0; height: auto; }
  table.teamtable td:nth-child(1) { grid-column: 1; } table.teamtable td:nth-child(3) { grid-column: 2; grid-row: 1; }
  table.teamtable td:nth-child(2), table.teamtable td:nth-child(4), table.teamtable td:nth-child(5) { grid-column: 1 / -1; }
  table.teamtable td:nth-child(5) .row { justify-content: flex-start !important; flex-wrap: wrap !important; }
  table.teamtable select { width: 100%; }
}

/* ===================================================================== UX stage 1 (2026-11-22)
   Tableau de bord (.tb), one "À faire" list, a score badge on every client, sale state + salesperson in the conversation header. */
/* score badge: 0–100 chance of buying. Colour + the number itself (never colour alone) */
.scb { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 11.5px; font-weight: 650;
  font-variant-numeric: tabular-nums; line-height: 1; border: 1px solid var(--app-border); background: var(--app-surface-2); color: var(--app-muted); }
.scb.hi { color: var(--app-warn); background: color-mix(in srgb, var(--app-warn) 13%, transparent); border-color: transparent; }
.scb.md { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.scb.lg { min-width: 34px; height: 26px; font-size: 13.5px; border-radius: 7px; }
/* why a client is in À faire */
.rsn { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--app-muted); }
.rsn.bad { color: var(--app-neg); } .rsn.warn { color: var(--app-warn); } .rsn.ai { color: var(--ai-ink); }
.cv-meta { flex-wrap: wrap; row-gap: 3px; }
.cv-meta .ib-line { flex: 1 1 100%; }
.cv-tabs.is-search button[aria-selected="true"] { background: none; color: var(--app-muted); font-weight: 500; }

/* conversation header: score · state menu · salesperson */
.cv-hctl { display: flex; align-items: center; gap: 8px; flex: none; }
.cv-state { position: relative; }
.cv-state-btn { gap: 4px; font-weight: 600; }
.cv-state-btn.st-won { color: var(--app-pos); border-color: color-mix(in srgb, var(--app-pos) 35%, var(--app-border)); }
.cv-state-btn.st-lost { color: var(--app-muted); }
.cv-state-menu { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 40; min-width: 220px; padding: 4px; display: grid; gap: 2px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.cv-state-menu button { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; text-align: start; border: 0; background: none;
  border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; font-weight: 600; }
.cv-state-menu button .small { grid-column: 2; font-weight: 400; }
.cv-state-menu button:hover, .cv-state-menu button:focus-visible { background: var(--app-hover); }
.cv-owner { height: 32px; max-width: 170px; border: 1px solid var(--app-border-strong); border-radius: var(--radius-sm); background: var(--app-surface); padding: 0 8px; font-size: 13px; }
.cv-only-sm { display: none; }
@media (max-width: 62em) { .cv-hctl .scb { display: none; } }

/* ---------------- Tableau de bord ---------------- */
.tb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-date { color: var(--app-muted); font-size: 13px; }
.tb-head .page-title { font-size: 21px; margin-top: 2px; }
.tb-for { color: var(--app-muted); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.tb-for select { background-color: var(--app-surface); color: var(--app-text); border-color: var(--app-border-strong); }
.tb-tiles { display: grid; grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tb-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: inherit; min-width: 0; }
.tb-tile.is-link:hover { border-color: var(--app-border-strong); box-shadow: var(--shadow-md); }
.tb-tile.is-bad { border-color: color-mix(in srgb, var(--app-neg) 35%, var(--app-border)); }
.tb-tile-k { font-size: 13px; font-weight: 600; color: var(--app-muted); }
.tb-tile-v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; color: var(--app-text); }
.tb-tile-s { font-size: 12.5px; color: var(--app-muted); }
.tb-tile-s.t-bad { color: var(--app-neg); font-weight: 600; }
.tb-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.tb-cols.is-one { grid-template-columns: minmax(0, 1fr); }
.tb-side { display: grid; gap: 16px; min-width: 0; }
.tb-card { padding: 16px 18px; min-width: 0; }
.tb-list { list-style: none; margin: 0; padding: 0; }
.tb-list li + li { border-top: 1px solid var(--app-border); }
.tb-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; color: inherit; border-radius: var(--radius-sm); }
.tb-row:hover { background: var(--app-hover); text-decoration: none; }
.tb-row-main { display: grid; gap: 2px; min-width: 0; }
.tb-row-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tb-row-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-row-sub { font-size: 12.5px; color: var(--app-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-team { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb-team th { font-size: 11.5px; font-weight: 500; color: var(--app-muted); text-align: start; padding: 0 0 6px; }
.tb-team td { padding: 7px 0; border-top: 1px solid var(--app-border); }
.tb-team .r { text-align: end; padding-inline-start: 12px; }
.tb-team a { color: var(--app-text); font-weight: 500; }
.tb-legend { display: flex; gap: 14px; font-size: 12px; color: var(--app-muted); }
.tb-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }
.tb-legend .l-new::before { background: var(--ch-other); } .tb-legend .l-won::before { background: var(--ch-won); }
.tb-week-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.tb-week-bars li { display: grid; justify-items: center; gap: 6px; }
.tb-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 96px; width: 100%; border-bottom: 1px solid var(--app-border); }
.tb-bars i { display: block; width: min(16px, 30%); min-height: 2px; border-radius: 3px 3px 0 0; }
.tb-bars .b-new { background: var(--ch-other); } .tb-bars .b-won { background: var(--ch-won); }
.tb-day { font-size: 11.5px; color: var(--app-muted); } .tb-day.is-today { color: var(--app-text); font-weight: 600; }
@media (max-width: 75em) { .tb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tb-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 36em) { .tb-tile { padding: 12px 14px; } .tb-tile-v { font-size: 24px; } .tb-tiles { gap: 8px; } .tb-row { padding: 12px 2px; } }
.cv-hrow { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--app-surface); border-bottom: 1px solid var(--app-border); }
.cv-hrow:has(.cv-hctl:empty):has(.ib-head-ctl:empty) { display: none; }
#tb-start .onboard { margin-bottom: 16px; }
.cv-state-menu[hidden] { display: none; }
.cv-state-btn svg.i { transform: rotate(90deg); }

/* ===================================================================== UX stage 2 (2026-11-22): one step per client */
.stp { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--app-surface-2); color: var(--app-muted); border: 1px solid var(--app-border); }
.stp::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stp.st-talk { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.stp.st-ready { background: color-mix(in srgb, var(--app-warn) 13%, transparent); color: var(--app-warn); border-color: transparent; }
.stp.st-won { background: color-mix(in srgb, var(--app-pos) 12%, transparent); color: var(--app-pos); border-color: transparent; }
.stp.st-lost { color: var(--app-faint); }
.cv-state-btn.st-talk { color: var(--accent-ink); }
.cv-state-btn.st-ready { color: var(--app-warn); border-color: color-mix(in srgb, var(--app-warn) 35%, var(--app-border)); }
.cv-state-btn.st-new { color: var(--app-muted); }
.cv-state-menu [role="menuitemradio"] { font-weight: 500; }
.cv-state-menu [aria-checked="true"] { font-weight: 650; color: var(--accent-ink); }
.cv-state-why { padding: 6px 10px 4px; }
.cv-state-sep { height: 1px; background: var(--app-border); margin: 4px 2px; }
.tb-row-end { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 36em) { .tb-row-end .stp { display: none; } }
.rc-mini.rc-next { display: grid; grid-template-columns: 16px 1fr; gap: 6px; align-items: start; } .rc-mini.rc-next svg.i { margin-top: 2px; }

/* ===================================================================== UX stage 3 (2026-11-22): Assistant IA in tabs */
#main[data-aitab="when"] [data-g="know"], #main[data-aitab="know"] [data-g="when"] { display: none !important; }
#main[data-aitab] .cfg > [data-g]:first-of-type { margin-top: 0; }
.ai-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ai-lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: var(--radius-sm); background: var(--app-surface-2); }
.cv-approve { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--ai-soft); color: var(--app-text); border-bottom: 1px solid var(--ai-line); font-size: 13px; }
.cv-approve > svg.i { color: var(--ai-ink); }
.cv-approve-t { flex: 1 1 260px; min-width: 0; }
.cv-approve-b { display: inline-flex; gap: 6px; }

/* ===================================================================== UX stage 4 (2026-11-22): Résultats on one page */
.rs .rs-ins { margin-bottom: 16px; }
.rs-recs { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.rs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rs-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
.rs-kv > div { background: var(--app-surface-2); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.rs-kv span { font-size: 12px; color: var(--app-muted); }
.rs-kv b { font-size: 18px; font-weight: 650; }
.rs-bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.rs-bars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rs-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-bars i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--ch-none) var(--w), var(--app-surface-2) var(--w)); }
.rs-more { margin-top: 16px; }
@media (max-width: 75em) { .rs-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 36em) { .rs-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===================================================================== UX stage 5 (2026-11-22): Réglages on one page, five places */
.setup-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.setup-g { padding: 16px 18px 8px; }
.setup-g h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.setup-g > p { margin: 0 0 6px; }
.setup-g ul { list-style: none; margin: 0; padding: 0; }
.setup-g li + li { border-top: 1px solid var(--app-border); }
.setup-g a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 4px; color: var(--app-text); border-radius: var(--radius-sm); }
.setup-g a:hover { background: var(--app-hover); text-decoration: none; }
.setup-t { display: grid; gap: 1px; min-width: 0; }
.setup-g a > svg.i { color: var(--app-faint); }
.sb-user { color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.sb-user:hover { background: var(--app-hover); text-decoration: none; }
.cv-table { margin-inline-start: auto; gap: 4px; }
@media (max-width: 62em) { .setup-hub { grid-template-columns: minmax(0, 1fr); } }
.rc-task { display: grid; grid-template-columns: 16px 1fr; gap: 4px 6px; align-items: start; } .rc-task-b { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ===================================================================== UX v2 (2026-11-22): a calmer conversation screen, Assistant settings as a list */
/* list: title + one Filtres menu, search, tabs; one line of facts per client */
.cv-titlebar { display: flex; align-items: center; gap: 8px; }
.cv-filt { position: relative; margin-inline-start: auto; }
.cv-filt > .btn { gap: 6px; }
.cv-filt-n { font-weight: 600; color: var(--accent-ink); }
.cv-filt-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 45; width: 280px; padding: 12px; display: grid; gap: 10px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.cv-filt-pop[hidden] { display: none; }
.cv-filt-pop .f { display: grid; gap: 4px; font-size: 12.5px; color: var(--app-muted); }
.cv-filt-links { display: grid; gap: 2px; border-top: 1px solid var(--app-border); padding-top: 8px; }
.cv-filt-links a, .cv-filt-links button { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border: 0; background: none; color: var(--app-text); font-size: 13px; text-align: start; border-radius: var(--radius-sm); cursor: pointer; }
.cv-filt-links a:hover, .cv-filt-links button:hover { background: var(--app-hover); text-decoration: none; }
.cv-meta { flex-wrap: nowrap; overflow: hidden; }
.cv-meta .ib-line { flex: 1 1 auto; min-width: 0; }
.cv-meta .rsn, .cv-meta .stp { flex: 0 1 auto; }
/* header: one row; it wraps rather than hiding anything */
.ib-head { flex-wrap: wrap; row-gap: 8px; }
.ib-head .ib-head-main { min-width: 120px; }
.ib-head .cv-hctl { flex: none; }
.cv-owner { display: inline-block; max-width: 150px; }
.cv-ai-chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--ai-line); background: var(--ai-soft); color: var(--ai-ink); white-space: nowrap; }
.cv-ai-chip.off { border-color: var(--app-border-strong); background: var(--app-surface-2); color: var(--app-muted); }
.cv-wa { color: var(--wa, #00a884); }
@media (max-width: 62em) { .ib-head .cv-hctl, .ib-head .ib-head-ctl { order: 5; } .ib-head .cv-hctl { flex: 1 1 auto; } }
/* composer: a suggestion on demand */
.cv-sugg { display: flex; align-items: center; gap: 10px; padding: 0 2px 8px; }
.cv-sugg .btn { color: var(--ai-ink); border-color: var(--ai-line); background: var(--ai-soft); gap: 6px; }
/* card: who, what they want, reminders, note; the rest under "Plus d'infos" */
.cv-plus > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.cv-plus > summary::-webkit-details-marker { display: none; }
.cv-plus > summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--app-muted); }
.cv-plus[open] > summary::before { transform: rotate(90deg); }
.cv-want-more summary { cursor: pointer; color: var(--accent-ink); margin-top: 6px; } a.cv-wa { color: var(--app-muted); display: inline-flex; align-items: center; gap: 3px; } a.cv-wa svg.i { color: var(--wa, #00a884); }
/* Assistant IA: the list of settings and the side panel */
.aip-list { margin-top: 16px; padding-bottom: 6px; }
.aip-list ul { list-style: none; margin: 0; padding: 0; }
.aip-list li + li { border-top: 1px solid var(--app-border); }
.aip-list button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border: 0; background: none;
  color: var(--app-text); text-align: start; cursor: pointer; border-radius: var(--radius-sm); font: inherit; }
.aip-list button:hover { background: var(--app-hover); }
.aip-t { display: grid; gap: 2px; min-width: 0; }
.aip-list button > svg.i { color: var(--app-faint); }
.aip { position: fixed; inset: 0; z-index: 200; }
.aip[hidden] { display: none; }
.aip-back { position: absolute; inset: 0; background: rgba(16, 24, 40, .35); }
.aip-box { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(720px, 100%); background: var(--app-bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.aip-box > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--app-surface); border-bottom: 1px solid var(--app-border); }
.aip-box > header h2 { margin: 0; font-size: 16px; }
.aip-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.aip-body > .card, .aip-body > .grid, .aip-body > section { margin-top: 0 !important; }
.aip-body > #k-hours { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--radius); padding: 16px; }
.aip-box > footer { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--app-surface); border-top: 1px solid var(--app-border); }
body.aip-on { overflow: hidden; }
@media (max-width: 62em) { .aip-body > #k-hours, .aip-body > .grid { grid-template-columns: minmax(0, 1fr); } }
body.aip-on .app-content { animation: none !important; transform: none !important; }
.aip-body > .card > h2:first-child { display: none; } .aip-body > .card { box-shadow: none; }
/* opening hours: 24 h menus, same look as the other fields */
.hours-lab { display: block; margin-top: 14px; }
.hours-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--app-muted); }
.time-sel { width: 112px; height: 38px; font-variant-numeric: tabular-nums; }

/* layers (2026-11-22): popups opened from a side panel showed BEHIND it (Assistant IA panel 200, drawers 61, mobile menu 70,
   confirm/modal 61). Order now: side panels < drawers < popups (confirm, forms) < search palette < toasts / lightbox.
   Each backdrop takes the layer of the window that follows it. */
.aip { z-index: var(--z-panel); }
.overlay:has(+ .drawer) { z-index: calc(var(--z-drawer) - 1); }
.drawer { z-index: var(--z-drawer); }
.overlay:has(+ .zmodal) { z-index: var(--z-overlay); }
.overlay:has(+ .cmdk) { z-index: calc(var(--z-palette) - 1); }

/* ---------------------------------------------------------------- Objectifs (2026-11-22) */
.obj-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.obj-nav { display: inline-flex; align-items: center; gap: 4px; }
.obj-tools select { height: 32px; }
.obj-main { margin-bottom: 16px; }
.obj-ks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr); gap: 24px; }
.obj-k { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.obj-k-l { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--app-muted); }
.obj-k-v { font-size: 28px; font-weight: 700; letter-spacing: -.01em; color: var(--app-text); line-height: 1.15; }
.obj-k-v small { font-size: 16px; font-weight: 500; color: var(--app-muted); }
.obj-k-s { font-size: 13px; color: var(--app-muted); }
.obj-k-s.strong { color: var(--app-text); font-weight: 600; }
.obj-k-side { padding-inline-start: 20px; border-inline-start: 1px solid var(--app-border); }
.obj-bar { position: relative; height: 10px; border-radius: 99px; background: var(--app-hover); box-shadow: inset 0 0 0 1px var(--app-border); min-width: 90px; }
.obj-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ch-other); }
.obj-bar > i.is-reached, .obj-bar > i.is-on_track { background: var(--ch-won); }
.obj-bar > i.is-close { background: var(--ch-line); }
.obj-bar > i.is-behind, .obj-bar > i.is-missed { background: var(--ch-none); }
.obj-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-inline-start: -1px; background: var(--app-text); border-radius: 1px; opacity: .55; }
.tb-card.flush { padding: 0; }
.obj-pad { padding: 16px 18px 6px; }
.obj-mgmt th, .obj-mgmt td { padding-inline: 8px; }
.obj-table { width: 100%; }
.obj-table td, .obj-table th { white-space: nowrap; }
.obj-cell { min-width: 180px; }
.obj-cell .obj-bar { margin-bottom: 4px; }
.obj-table .who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--app-text); }
.obj-total td { border-top: 2px solid var(--app-border-strong); background: var(--app-surface-2); }
.obj-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin: 16px 0; }
.obj-chart { width: 100%; overflow: hidden; }
.tb-legend .l-goal::before { height: 0; border-top: 2.5px dashed var(--ch-line); border-radius: 0; width: 14px; vertical-align: 3px; background: none; }
.obj-funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.obj-funnel li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr) auto 3.2em; align-items: center; gap: 10px; font-size: 13px; }
.obj-funnel i { display: block; height: 10px; width: var(--w); border-radius: 99px; background: var(--ch-other); }
.obj-funnel li:last-child i { background: var(--ch-won); }
.obj-funnel .muted { text-align: end; }
.obj-form { width: 100%; }
.obj-form input { width: 100%; min-width: 90px; }
.obj-form td { padding: 6px 6px; }
.obj-dlg { width: min(640px, calc(100vw - 32px)); }
.obj-dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.obj-dlg-h h3 { margin: 0; }
.tb-goal { margin-bottom: 16px; }
.tb-goal-ps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px 24px; }
.tb-goal-p { display: grid; gap: 8px; }
.tb-goal-p.is-range { padding-inline-end: 24px; border-inline-end: 1px solid var(--app-border); }
@media (max-width: 62em) { .tb-goal-p.is-range { padding-inline-end: 0; border-inline-end: 0; padding-bottom: 12px; border-bottom: 1px solid var(--app-border); } }
.tb-goal-t { display: flex; align-items: center; gap: 8px; }
.tb-goal-t .muted { margin-inline-start: auto; }
.tb-goal-l { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--app-muted); }
.tb-goal-l .obj-bar { grid-column: 1 / -1; min-width: 0; height: 8px; }
.tb-goal-l b { color: var(--app-text); }
@media (max-width: 62em) {
  .obj-ks { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .obj-k-side { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--app-border); padding-top: 14px; }
  .obj-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 36em) {
  .obj-tools { width: 100%; }
  .obj-tools .btn.primary { margin-inline-start: auto; }
  .obj-k-v { font-size: 24px; }
  .obj-funnel li { grid-template-columns: minmax(0, 1fr) auto 3em; }
  .obj-funnel i { grid-column: 1 / -1; grid-row: 2; }
}
/* Tableau de bord: period picker (2026-11-22) */
.tb-ctl { flex-wrap: wrap; justify-content: flex-end; }
.tb-range { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tb-range button { white-space: nowrap; flex: none; }
.tb-period { margin-top: 2px; }
.tb-week-bars.is-dense { gap: 3px; }
.tb-week-bars.is-dense .tb-bars { gap: 1px; }
.tb-week-bars.is-dense .tb-bars i { width: 42%; }
.tb-week-bars.is-dense .tb-day { font-size: 10.5px; white-space: nowrap; }
@media (max-width: 36em) { .tb-ctl { justify-content: flex-start; width: 100%; } .tb-range { flex-wrap: wrap; overflow: visible; } }
.tb-cal { display: inline-flex; align-items: center; gap: 6px; }
.tb-cal svg { flex: none; opacity: .75; }

/* Date-range picker (public/daterange.js): popover with two months; a bottom sheet with one month on a phone */
.drp-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.drp-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 30, .38); opacity: 0; transition: opacity .16s ease; }
.drp-layer.is-sheet .drp-backdrop { pointer-events: auto; }
.drp-layer.is-sheet.is-in .drp-backdrop { opacity: 1; }
.drp-layer.is-out .drp-backdrop { opacity: 0; }
.drp { position: fixed; pointer-events: auto; display: grid; grid-template-columns: 158px auto; background: var(--app-surface); color: var(--app-text);
  border: 1px solid var(--app-border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; outline: none;
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top right; transition: opacity .14s ease, transform .16s cubic-bezier(.2, .8, .2, 1); }
.drp-layer.is-in .drp { opacity: 1; transform: none; }
.drp-layer.is-out .drp { opacity: 0; transform: translateY(-4px) scale(.99); }
.drp-side { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: var(--app-hover); border-inline-end: 1px solid var(--app-border); }
.drp-short { text-align: start; border: 0; background: none; color: var(--app-text); font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.drp-short:hover { background: var(--app-surface); }
.drp-short.on { background: var(--app-surface); color: var(--accent-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--app-border); }
.drp-main { position: relative; padding: 14px 16px 0; }
.drp-nav { position: absolute; inset-inline: 10px; top: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.drp-titles { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.drp-arrow { pointer-events: auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--app-text); border-radius: 9px; cursor: pointer; }
.drp-arrow:hover { background: var(--app-hover); border-color: var(--app-border); }
.drp-arrow:disabled { opacity: .3; cursor: default; background: none; border-color: transparent; }
.drp-months { display: flex; gap: 28px; }
.drp-mtitle { height: 32px; display: grid; place-items: center; font-weight: 600; font-size: 14px; text-transform: capitalize; margin-bottom: 6px; }
.drp-grid { display: grid; gap: 2px 0; }
.drp-row { display: grid; grid-template-columns: repeat(7, 38px); }
.drp-wd span { height: 26px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--app-muted); letter-spacing: .04em; }
.drp-row > span { display: grid; }
.drp-day { position: relative; height: 36px; border: 0; background: none; color: var(--app-text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums;
  border-radius: 9px; cursor: pointer; transition: background-color .08s ease; }
.drp-day:hover:not(:disabled):not(.in-range):not(.is-start):not(.is-end) { background: var(--app-hover); }
.drp-day.in-range:hover:not(.is-start):not(.is-end) { background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent) 12%); }
.drp-day:disabled { color: var(--app-muted); opacity: .38; cursor: default; }
.drp-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.drp-day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.drp-day.in-range { background: var(--accent-soft); border-radius: 0; }
.drp-day.in-range.is-preview:not(.is-start):not(.is-end) { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.drp-row > span:first-child .drp-day.in-range { border-start-start-radius: 9px; border-end-start-radius: 9px; }
.drp-row > span:last-child .drp-day.in-range { border-start-end-radius: 9px; border-end-end-radius: 9px; }
.drp-day.is-start, .drp-day.is-end { background: var(--ink, var(--indigo-7)); color: var(--on-ink, #fff); font-weight: 600; }
.drp-day.is-start { border-start-start-radius: 9px; border-end-start-radius: 9px; }
.drp-day.is-end { border-start-end-radius: 9px; border-end-end-radius: 9px; }
.drp-day.is-start.is-today::after, .drp-day.is-end.is-today::after { background: var(--on-ink, #fff); }
.drp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px -16px 0; padding: 12px 16px; border-top: 1px solid var(--app-border); }
.drp-sum { display: grid; gap: 1px; min-width: 0; }
.drp-sum b { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.drp-sum span { font-size: 12px; color: var(--app-muted); }
.drp-btns { display: flex; gap: 8px; flex: none; }
.drp-layer.is-sheet .drp { left: 0; right: 0; bottom: 0; top: auto; grid-template-columns: minmax(0, 1fr); border-radius: 18px 18px 0 0; border-bottom: 0;
  max-height: 92vh; overflow-y: auto; transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); opacity: 1; padding-bottom: env(safe-area-inset-bottom); }
.drp-layer.is-sheet.is-in .drp { transform: none; }
.drp-layer.is-sheet.is-out .drp { transform: translateY(100%); }
.drp-layer.is-sheet .drp::before { content: ""; justify-self: center; width: 38px; height: 4px; border-radius: 4px; background: var(--app-border-strong); margin-top: 8px; }
.drp-layer.is-sheet .drp-side { flex-direction: row; overflow-x: auto; scrollbar-width: none; border: 0; background: none; padding: 10px 16px 2px; gap: 6px; }
.drp-layer.is-sheet .drp-short { border: 1px solid var(--app-border); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.drp-layer.is-sheet .drp-nav { top: 14px; inset-inline: 14px; }
.drp-layer.is-sheet .drp-main { padding-top: 18px; }
.drp-layer.is-sheet .drp-months { display: block; }
.drp-layer.is-sheet .drp-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.drp-layer.is-sheet .drp-day { height: 42px; font-size: 14px; }
.drp-layer.is-sheet .drp-foot { flex-wrap: wrap; }
.drp-layer.is-sheet .drp-sum { flex: 1 1 100%; }
.drp-layer.is-sheet .drp-btns { flex: 1 1 100%; }
.drp-layer.is-sheet .drp-btns .btn { flex: 1; justify-content: center; height: 42px; }
@media (prefers-reduced-motion: reduce) { .drp, .drp-backdrop, .drp-layer.is-sheet .drp { transition: none; } }

/* Tableau de bord: Facebook Ads spend and Odoo sales day by day */
#tb-adsales { margin-top: 16px; }
.tb-adsales-tw { max-height: 420px; overflow: auto; }
.tb-adsales thead th { position: sticky; top: 0; background: var(--app-surface); z-index: 1; }
.tb-adsales-tot td { border-bottom: 2px solid var(--app-border); }
.tb-dcell { position: relative; display: inline-flex; justify-content: flex-end; min-width: 120px; padding: 2px 4px; }
.tb-dcell > span { position: relative; }
.tb-dbar { position: absolute; right: 0; top: 2px; bottom: 2px; border-radius: 3px; opacity: .22; }
.tb-dbar.is-spend { background: var(--ch-other, #8b5cf6); }
.tb-dbar.is-sales { background: var(--ch-won, #16a34a); }

/* ---------------------------------------------------------------- Phone and installed app (PWA), 2026-11-22 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, [role="tab"], label { -webkit-tap-highlight-color: transparent; }
.rsn-s { display: none; }
/* the client list's column is narrow everywhere: its rows say the short reason (the time is on the right) */
.cv-meta .rsn-l { display: none; } .cv-meta .rsn-s { display: inline; } .cv-meta .rsn { flex: none; }
/* notch and rounded corners (viewport-fit=cover): nothing under the status bar, the home bar or the sides */
:root { --topbar-h: calc(52px + env(safe-area-inset-top)); } /* every height computed from the top bar includes the status bar */
.app-topbar { padding-top: env(safe-area-inset-top); }
.login { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.app-sidebar { padding-top: env(safe-area-inset-top); }
.tb-push { margin-bottom: 16px; }
.tb-push-in { display: flex; align-items: center; gap: 12px; }
.tb-push-in > div:nth-child(2) { flex: 1; min-width: 0; }
.tb-push-act { display: flex; gap: 6px; flex: none; }
@media (max-width: 991px) {
  .app-content { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .bottom-nav { padding-inline: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right)); }
  /* iPhone zooms the whole app when a field under 16 px gets the focus */
  input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=url], input[type=date],
  input[type=datetime-local], select, textarea { font-size: 16px !important; }
  /* operator banner: one compact line */
  .op-banner { padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); font-size: 12px; gap: 6px 10px; flex-wrap: nowrap; }
  .op-banner span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .op-banner a { white-space: nowrap; }
  /* Tableau de bord: periods on one swipeable row, then "Voir pour" + an icon refresh */
  .tb-head { gap: 12px; margin-bottom: 14px; }
  .tb-ctl { width: 100%; display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 10px !important; }
  .tb-ctl .tb-range { grid-column: 1 / -1; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tb-ctl .tb-range button { scroll-snap-align: start; min-height: 40px; }
  .tb-for { min-width: 0; }
  .tb-for select { flex: 1; min-width: 0; max-width: none; height: 40px; }
  .tb-ctl > .tb-for:only-of-type { width: 100%; }
  #tb-refresh { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .tb-refresh-l { display: none; }
  .tb-push-in { flex-wrap: wrap; }
  .tb-push-act { width: 100%; justify-content: flex-end; }
  /* Clients: search and Filtres on one row, the tabs under them */
  .cv-tools { display: flex; flex-wrap: wrap; align-items: center; }
  .cv-titlebar { order: 2; flex: none; }
  .cv-titlebar .btn span:not(.cv-filt-n) { display: none; }
  .cv-titlebar .btn { min-height: 40px; min-width: 40px; justify-content: center; }
  .ib-search { order: 1; flex: 1 1 0; min-width: 0; }
  .cv-tabs, .cv-hint { order: 3; flex-basis: 100%; }
  .cv-sort { order: 4; flex-basis: 100%; margin-top: 0; }
  .cv-sort .seg button { height: 34px; }
  /* rows: the short reason (the time is already on the right) */
  .rsn-l { display: none; }
  .rsn-s { display: inline; }
  .cv-meta .rsn, .ib-meta .rsn { flex: none; }
}
@media (max-width: 420px) { .app-topbar [data-theme] { display: none; } } /* the phone's own light / dark setting applies */
/* the installed app: no browser bar, so the content may use the full height; no text selection on the navigation */
@media (display-mode: standalone) {
  .bottom-nav, .app-topbar, .sb-nav { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  body { overscroll-behavior-y: none; }
}

/* Résultats › Par numéro (2026-11-25) */
.bn section.card { margin-bottom: 16px; }
.bn .bn-p { margin: 0 20px 10px; }
.bn .bn-t tbody th { text-align: left; font-weight: 500; min-width: 210px; padding-left: 20px; }
.bn .bn-t th:first-child { position: sticky; left: 0; z-index: 1; background: var(--app-surface); }
.bn .bn-t tbody th .small { font-weight: 400; max-width: 380px; white-space: normal; }
.bn .bn-t thead th { white-space: nowrap; }
.bn .bn-days summary { cursor: pointer; padding: 4px 0; }
@media (max-width: 600px) { .bn .bn-t tbody th { min-width: 150px; padding-left: 14px; } .bn .bn-p { margin: 0 14px 10px; } }

/* Clients follow-up view vs full conversation (2026-11-26, D2): #/inbox/<id> hides the chat, #/conversation/<id> shows it */
.cv.cv-follow .ib-scroll, .cv.cv-follow .ib-compose, .cv.cv-follow [data-approvals], .cv.cv-follow .cv-ai { display: none; }
.cv:not(.cv-follow) .cv-followbox, .cv.cv-follow .cv-conv-back { display: none; }
.cv-followbox { flex: 1; overflow-y: auto; padding: 16px; display: grid; align-content: start; gap: 12px; background: var(--app-surface); }
.cv-fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-fb-msgs { background: var(--chat-bg); border: 1px solid var(--app-border); border-radius: 10px; padding: 8px; }
.cv-conv-back { flex: none; }
.tb-basis { display: inline-block; margin-inline-start: 6px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--app-muted); background: var(--app-hover); vertical-align: 1px; text-transform: none; cursor: help; }

/* ---------------------------------------------------------------- UX pass 1 (2026-11-27): visual fixes found on every page
   (screenshots of all 58 pages at 1440 px and 390 px). Kept last on purpose: these win over the older layers above. */

/* tiles: the basis mark (mesuré, Odoo, Meta…) sits in the corner instead of wrapping under the title */
.tb-tile { position: relative; }
.tb-tile-k:has(.tb-basis) { padding-inline-end: 64px; }
.tb-tile-k .tb-basis { position: absolute; top: 14px; inset-inline-end: 14px; margin: 0; }
@media (max-width: 36em) { .tb-tile-k:has(.tb-basis) { padding-inline-end: 0; padding-top: 18px; } .tb-tile-k .tb-basis { top: 8px; inset-inline-end: 10px; } }

/* Clients: the four tabs stay on one line (Perdus was wrapping alone under the others) */
.cv-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.cv-tabs button { flex: none; white-space: nowrap; }

/* a switch whose text has bold parts: one block of text, not columns */
.switch .sw-txt { flex: 1; min-width: 0; width: auto; height: auto; background: none; border-radius: 0; position: static; transition: none; line-height: 1.45; }
.switch .sw-txt::before, .switch .sw-txt::after { content: none; }
.switch:has(.sw-txt) { align-items: flex-start; }

/* period pickers: on phones they scroll sideways cleanly instead of being cut at the edge */
@media (max-width: 36em) {
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; white-space: nowrap; }
}

/* phones: touch targets of at least 36 px (chips, small buttons, filter links) */
@media (max-width: 36em) {
  .chip { height: auto; min-height: 36px; }
  .btn.sm { min-height: 36px; }
  .seg button { height: 34px; }
}

/* selects never show cut words ("Tous les commerc…"): they take the width they need on a row of filters */
.tb-head select, .ph-actions select, .page-head select { max-width: 100%; text-overflow: ellipsis; }

/* long labels in tables and lists break instead of overflowing on phones */
@media (max-width: 36em) {
  .tw td, .tw th { word-break: normal; overflow-wrap: anywhere; }
  .card { overflow-wrap: anywhere; }
}

/* client card: "Plus d'infos" on one line, its hint after it (was squeezed into two columns) */
.cv-plus > summary { flex-wrap: wrap; white-space: nowrap; }
.cv-plus > summary .muted { white-space: normal; font-weight: 400; }

/* ---------------------------------------------------------------- UX pass 2 (2026-11-27)
   readable text: nothing a person has to read under 11.5 px (times, sources, chips, table heads); avatars and counters keep their size */
.msg time, .msg-meta time { font-size: 11.5px; }
.src, .ib-chip, .opt-tag, .who-ai, .tr-size, .sb-sublabel, .vp-rate { font-size: 11.5px; }
.ib-chip { height: 22px; }
.trow2-head { font-size: 11.5px; }
.tb-week-bars.is-dense .tb-day { font-size: 11px; }
.ib-row .sp-ini { font-size: 10px; }
svg.chart text { font-size: 11.5px; }
@media (max-width: 36em) { .trow2-head { font-size: 11.5px; } }
@media (max-width: 36em) { .linkbtn { min-height: 32px; } }

/* Réglages: the cards flow in two columns without holes under short cards (masonry by CSS columns) */
.setup-hub { display: block; columns: 2; column-gap: 16px; }
.setup-hub > .setup-g { break-inside: avoid; margin: 0 0 16px; width: 100%; display: inline-block; }
@media (max-width: 62em) { .setup-hub { columns: 1; } }

/* conversation header: the phone · WhatsApp · origin line may take two lines instead of ending in "· …" */
.ib-head-main > .small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }

/* Résultats filters on phones: each select takes a full row instead of cutting "Tous les commerciaux" */
@media (max-width: 36em) { .page-header .filters { grid-template-columns: minmax(0, 1fr); } .page-header .filters select { width: 100%; } }

/* ======================= UX pass 3 (2026-11-27): app-styled menus and form controls ======================= */
/* select menu (public/ui.js selectMenus) */
.zsel-pop { position: fixed; z-index: 1050; display: flex; flex-direction: column; overflow: hidden; background: var(--app-surface);
  border: 1px solid var(--app-border); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--app-text);
  animation: zsel-in .12s ease-out; transform-origin: top center; }
.zsel-pop.is-up { transform-origin: bottom center; }
@keyframes zsel-in { from { opacity: 0; transform: translateY(-3px) scale(.985); } }
.zsel-pop.is-up { animation-name: zsel-in-up; }
@keyframes zsel-in-up { from { opacity: 0; transform: translateY(3px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .zsel-pop { animation: none; } }
.zsel-search { padding: 6px; border-bottom: 1px solid var(--app-border); flex: none; }
.zsel-search input { width: 100%; height: 32px; font-size: 13px; border-radius: 7px; }
.zsel-list { overflow-y: auto; padding: 4px; outline: none; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.zsel-opt { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 6px 8px 6px 10px; border-radius: 6px; cursor: pointer; line-height: 1.35; }
.zsel-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.zsel-opt.is-active { background: var(--app-hover); }
.zsel-opt.is-sel { color: var(--accent-ink); font-weight: 600; }
.zsel-opt.is-sel.is-active { background: var(--app-sel); }
.zsel-chk { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.zsel-opt.is-sel .zsel-chk { visibility: visible; }
.zsel-opt[aria-disabled="true"] { color: var(--app-faint); cursor: default; font-weight: 400; }
.zsel-opt[aria-disabled="true"].is-active { background: none; }
.zsel-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--app-faint); text-transform: uppercase; letter-spacing: .04em; }
.zsel-group:not(:first-child) { border-top: 1px solid var(--app-border); margin-top: 4px; padding-top: 10px; }
.zsel-none { padding: 14px 12px; color: var(--app-muted); font-size: 13px; text-align: center; }
select[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--focus-ring); }

/* checkboxes and radios: drawn in the app's colours (one blue for "on"), same size everywhere */
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; display: inline-grid; place-content: center;
  border: 1.5px solid var(--app-border-strong); border-radius: 4.5px; background: var(--app-surface); cursor: pointer; vertical-align: -3px;
  transition: background-color .12s, border-color .12s, box-shadow .12s; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::before { content: ""; width: 10px; height: 10px; background: var(--app-surface); transform: scale(0); transition: transform .1s ease-out;
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 22%, 84% 7%, 39% 66%); }
input[type=radio]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--app-surface); transform: scale(0); transition: transform .1s ease-out; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--accent); }
input[type=checkbox]:checked, input[type=radio]:checked,
input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::before, input[type=radio]:checked::before { transform: scale(1); }
input[type=checkbox]:indeterminate::before { transform: scale(1); clip-path: none; height: 2px; border-radius: 1px; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .45; cursor: not-allowed; }
.selrow input[type=checkbox], .selrow input[type=radio] { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { input[type=checkbox]::before, input[type=radio]::before { transition: none; } }

/* file pickers: the button looks like the app's buttons */
input[type=file] { font-size: 13px; color: var(--app-muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; height: 34px; padding: 0 12px; margin-inline-end: 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--app-border-strong); background: var(--app-surface); color: var(--app-text); cursor: pointer; transition: background-color .12s; }
input[type=file]::file-selector-button:hover { background: var(--app-hover); }

/* number fields: no tiny spin arrows (keyboard arrows still work), figures aligned */
input[type=number] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* date fields: calendar icon in the field's muted colour */
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; border-radius: 4px; padding: 2px; }
input[type=date]::-webkit-calendar-picker-indicator:hover, input[type=datetime-local]::-webkit-calendar-picker-indicator:hover { opacity: .9; background: var(--app-hover); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* scrollbars: thin and in the app's greys (light and dark) */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--app-border-strong) 85%, var(--app-muted)) transparent; }
}
.zmodal .role-opt input[type=radio], .zmodal .role-opt input[type=checkbox], .zmodal .chk input[type=checkbox], .zmodal .akm-prov input[type=radio], .zmodal .akm-prov input[type=checkbox] { width: 16px; }
.switch input[type=checkbox] { width: 1px; height: 1px; border: 0; }
.sync-log-row { overflow-wrap: anywhere; padding: 2px 0; }
select.cv-owner { background-color: var(--app-surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 12px; padding-inline-end: 28px; }
[dir="rtl"] select.cv-owner { background-position: left 9px center; }
/* Odoo page: salesperson → Odoo user pick-list (2026-11-27) */
.odoo-um { display: grid; gap: 8px; margin-top: 4px; }
.odoo-um-head { display: grid; gap: 2px; }
.odoo-um-head > b { font-size: 13px; font-weight: 500; }
.odoo-um-row { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 300px); gap: 10px; align-items: center; }
.odoo-um-row select, .odoo-um-row input { width: 100%; }
.odoo-um-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 36em) { .odoo-um-row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
