/* Cadence : barre latérale à gauche, en-tête clair, agenda lumineux, panneau « composer » à droite. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --sunk: #f0f2f5;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ff;
  --focus: #2563eb;
  --s-wait: #b54708; --s-wait-bg: #fef6e7;
  --s-fix: #c4320a; --s-fix-bg: #fef1ec;
  --s-ok: #067647; --s-ok-bg: #e8f7ef;
  --s-sched: #175cd3; --s-sched-bg: #eaf2ff;
  --s-idle: #475467; --s-idle-bg: #f2f4f7;
  --s-err: #b42318; --s-err-bg: #fdecea;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 48px -12px rgba(16, 24, 40, .22);
  --f-display: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161a21; --surface-2: #1a1f27; --sunk: #1f242d; --line: #2a303b; --line-strong: #3a4250;
    --ink: #eef1f5; --ink-2: #c9d0da; --muted: #8d96a5; --accent: #5b8def; --accent-soft: #1b2a45; --focus: #7aa2f7;
    --s-wait: #f3b35c; --s-wait-bg: #36290f; --s-fix: #f59a7c; --s-fix-bg: #3a2018; --s-ok: #5fd39a; --s-ok-bg: #12301f;
    --s-sched: #8ab4f8; --s-sched-bg: #18263d; --s-idle: #a5adba; --s-idle-bg: #232831; --s-err: #f7867c; --s-err-bg: #3b1b19;
    --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a21; --surface-2: #1a1f27; --sunk: #1f242d; --line: #2a303b; --line-strong: #3a4250;
  --ink: #eef1f5; --ink-2: #c9d0da; --muted: #8d96a5; --accent: #5b8def; --accent-soft: #1b2a45; --focus: #7aa2f7;
  --s-wait: #f3b35c; --s-wait-bg: #36290f; --s-fix: #f59a7c; --s-fix-bg: #3a2018; --s-ok: #5fd39a; --s-ok-bg: #12301f;
  --s-sched: #8ab4f8; --s-sched-bg: #18263d; --s-idle: #a5adba; --s-idle-bg: #232831; --s-err: #f7867c; --s-err-bg: #3b1b19;
  --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.01em; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Coquille ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; text-decoration: none; color: var(--ink); }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo b { font-family: var(--f-display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .12s, color .12s; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .badge { margin-left: auto; }
.side h4 { margin: 0 0 6px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.plist { display: flex; flex-direction: column; gap: 2px; }
.pitem { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-sm); text-align: left; color: var(--ink-2); font-weight: 500; transition: background .12s, opacity .12s; }
.pitem:hover { background: var(--sunk); }
.pitem .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--pc); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.pitem .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pitem[aria-pressed="false"] { opacity: .5; }
.pitem[aria-pressed="false"] .sw { background: transparent; box-shadow: inset 0 0 0 2px var(--pc); }
.side .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.me { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 28px; }
.ptitle-h { margin: 0; font-size: 22px; font-weight: 700; margin-right: 4px; }
.period { font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--ink-2); min-width: 0; }
.period::first-letter, .qday h3::first-letter, .dgroup h3::first-letter { text-transform: uppercase; }
.grow { flex: 1; }
.counters { display: flex; flex-wrap: wrap; gap: 6px; }
.counter { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 4px 10px 4px 8px; border: 1px solid transparent; background: var(--sbg); color: var(--sc); font-weight: 600; font-size: 12.5px; }
.counter .dotc { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.counter b { font-variant-numeric: tabular-nums; }
button.counter:hover { border-color: color-mix(in srgb, var(--sc) 40%, transparent); }
.content { padding: 22px 28px 64px; }
.iconbtn.menu-btn { display: none; }
.btn.newpost { width: 100%; padding: 9px 12px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: var(--r-sm); padding: 7px 13px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ok { background: var(--s-ok); border-color: var(--s-ok); color: #fff; }
.btn.ok.on { background: var(--s-ok-bg); color: var(--s-ok); border-color: color-mix(in srgb, var(--s-ok) 45%, transparent); }
.btn.warn { color: var(--s-fix); border-color: color-mix(in srgb, var(--s-fix) 35%, var(--line)); }
.btn.warn:hover { background: var(--s-fix-bg); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--sunk); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn.ghost { border-color: transparent; box-shadow: none; background: none; }
.iconbtn.ghost:hover { background: var(--sunk); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunk); border-radius: 10px; }
.seg button { border: 0; background: none; padding: 5px 13px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.navgrp { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Pastilles ---------- */
.spill { display: inline-flex; align-items: center; gap: 6px; background: var(--sbg); color: var(--sc); border-radius: 999px; padding: 2px 9px 2px 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.spill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sc); }
.ppill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--pc); background: color-mix(in srgb, var(--pc) 11%, var(--surface)); border-radius: 999px; padding: 2px 9px 2px 7px; white-space: nowrap; }
.ppill::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--pc); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--s-wait-bg); color: var(--s-wait); font-size: 11.5px; font-weight: 700; }
.badge.recycle { background: var(--s-ok-bg); color: var(--s-ok); }
.tag { border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); background: var(--surface); }
.hint { font-size: 12.5px; color: var(--muted); }
.icos { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.ico { display: inline-flex; width: 14px; height: 14px; flex: none; position: relative; }
.ico svg { width: 100%; height: 100%; display: block; }
.ico.md { width: 16px; height: 16px; }
.ico.lg { width: 22px; height: 22px; }
.ico.perso::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-2); }

/* ---------- Agenda mois ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.dow { padding: 10px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.day { min-height: 148px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .12s; position: relative; }
.day:nth-child(7n) { border-right: 0; }
.day.out { background: var(--surface-2); }
.day.out .dnum { opacity: .45; }
.day.past:not(.today) { background: color-mix(in srgb, var(--sunk) 45%, var(--surface)); }
.dnum { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 2px; }
.dnum .num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; }
.day.today .dnum .num { background: var(--accent); color: #fff; }
.day .add { opacity: 0; border: 0; background: none; color: var(--muted); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; transition: opacity .12s; }
.day:hover .add { opacity: 1; }
.day .add:hover { background: var(--sunk); color: var(--ink); }
.chip { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 7px 6px 9px; font-size: 12px; min-width: 0; position: relative; box-shadow: var(--shadow-sm); transition: box-shadow .14s, transform .14s, border-color .14s; overflow: hidden; }
.chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
.chip:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--pc) 45%, var(--line)); transform: translateY(-1px); }
.chip .mini { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; background: var(--sunk); display: block; }
.chip .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.chip .row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.chip .t { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chip .n { color: var(--ink); font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chip .sdot { margin-left: auto; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); flex: none; }
.chip.cancel, .card.cancel, .qitem.cancel { opacity: .5; }
.chip.cancel .n, .card.cancel .title, .qitem.cancel .qt { text-decoration: line-through; }
.more { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; padding: 2px 4px; }
[draggable="true"] { cursor: grab; }
[draggable="true"]:active { cursor: grabbing; }
.drop { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Agenda semaine ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.wcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 240px; border-radius: var(--r); padding: 4px; transition: background .12s; }
.whead { display: flex; align-items: baseline; gap: 8px; padding: 6px 6px 10px; border-bottom: 2px solid var(--line); }
.whead.today { border-color: var(--accent); }
.whead .wd { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.whead .wn { font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.whead.today .wn { color: var(--accent); }
.card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); overflow: hidden; padding: 0; display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); transition: box-shadow .14s, transform .14s, border-color .14s; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: color-mix(in srgb, var(--pc) 40%, var(--line)); }
.card .thumb { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; background: var(--sunk); }
.card .thumb.none { display: grid; place-items: center; color: var(--muted); aspect-ratio: auto; height: 6px; background: var(--pc); }
.card .body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 7px; }
.card .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.card .meta .t { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.card .title { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.card .foot { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.card .mstat { font-size: 11.5px; color: var(--muted); }
.empty-day { color: var(--muted); font-size: 12.5px; padding: 14px 8px; border: 1px dashed var(--line-strong); border-radius: var(--r); text-align: center; }

/* ---------- Liste par jour (téléphone) ---------- */
.dlist { display: flex; flex-direction: column; gap: 18px; }
.dgroup h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.dgroup h3 .hint { text-transform: none; font-weight: 500; }
.dgroup.today h3 { color: var(--accent); }

/* ---------- File d'attente ---------- */
.qtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.qtools select { width: auto; }
.queue { display: flex; flex-direction: column; gap: 22px; max-width: 980px; }
.qday h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.qday h3 .hint { font-weight: 500; }
.qrows { display: flex; flex-direction: column; gap: 8px; }
.qitem { display: grid; grid-template-columns: 64px 4px minmax(0, 1fr) auto; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 10px 12px; box-shadow: var(--shadow-sm); text-align: left; width: 100%; transition: box-shadow .14s, border-color .14s; }
.qitem:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.qitem .qtime { font-family: var(--f-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.qitem .qbar { align-self: stretch; border-radius: 4px; background: var(--pc); }
.qitem .qmain { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qitem .qthumb { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; flex: none; background: var(--sunk); }
.qitem .qtx { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qitem .qt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .qsub { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qitem.free { background: transparent; border-style: dashed; box-shadow: none; color: var(--muted); }
.qitem.free .qbar { background: color-mix(in srgb, var(--pc) 35%, transparent); }
.qitem.free .qt { font-weight: 500; color: var(--muted); }

/* ---------- Résultats ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.panel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.panel-kpis .kpi { padding: 10px 12px; box-shadow: none; background: var(--surface-2); }
.panel-kpis .kpi b { font-size: 19px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; min-width: 150px; }
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 760px; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.data th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; }
table.data th button[aria-pressed="true"] { color: var(--ink); }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.row { cursor: pointer; }
table.data tr.row:hover td { background: var(--surface-2); }
table.data .num { text-align: right; }
.tt { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tt img, .tt .ph { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; background: var(--pc); }
.tt .n { font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--pc); min-width: 2px; }

/* ---------- Pages de gestion ---------- */
.cards { display: grid; gap: 16px; max-width: 1080px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.box h2 { margin: 0; font-size: 17px; }
.box .bh { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.box .bh p { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
textarea, input[type="datetime-local"], input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="color"], select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 8px 10px; transition: border-color .12s, box-shadow .12s;
}
input[type="color"] { padding: 2px; height: 36px; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.acct:first-of-type { border-top: 0; }
.acct .an { display: flex; flex-direction: column; min-width: 0; }
.acct .an b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix { display: grid; gap: 6px; }
.mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mrow .ppill { min-width: 120px; }
.mcell { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 6px; font-size: 12.5px; background: var(--surface-2); }
.mcell.api { border-color: color-mix(in srgb, var(--s-ok) 40%, var(--line)); color: var(--s-ok); background: var(--s-ok-bg); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12.5px; font-weight: 500; }
.slot button { border: 0; background: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.slot button:hover { background: var(--s-fix-bg); color: var(--s-fix); }
.addslot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addslot select, .addslot input { width: auto; }
.journal { display: flex; flex-direction: column; }
.jrow { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr); gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.jrow:first-child { border-top: 0; }
.jrow time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.jrow .msg { overflow-wrap: anywhere; }
.jrow.erreur .msg { color: var(--s-err); }
.jrow.avertissement .msg { color: var(--s-wait); }
.notice { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 18px 20px; color: var(--muted); margin-bottom: 16px; }
.notice strong { color: var(--ink); }
.copy { display: flex; gap: 6px; align-items: center; font-family: var(--f-mono); font-size: 12.5px; background: var(--sunk); padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- Panneau « composer » ---------- */
.scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .32); z-index: 20; animation: fade .15s ease-out; }
aside.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--bg); z-index: 21; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.phead { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.phead .close { margin-left: auto; }
.pbody { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.ptitle { font-size: 21px; font-weight: 700; line-height: 1.25; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.prow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); margin-top: 8px; }
.prow .when { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar .btn { padding: 6px 10px; font-size: 13px; }
section.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.bhead { display: flex; align-items: center; gap: 10px; }
.bhead h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); margin-right: auto; }
.okmark { color: var(--s-ok); font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -2px -16px 0; padding: 0 12px; overflow-x: auto; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
.tabs button .cnt { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.banner { border-radius: var(--r); padding: 12px 14px; background: var(--sbg); color: var(--sc); font-weight: 500; display: flex; flex-direction: column; gap: 8px; border: 1px solid color-mix(in srgb, var(--sc) 20%, transparent); }
.banner .row-actions .btn { color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fixform, .confirm { display: flex; flex-direction: column; gap: 8px; background: var(--s-fix-bg); border-radius: var(--r-sm); padding: 12px; }
.fixform label, .confirm { color: var(--s-fix); font-weight: 600; font-size: 13px; }
.editor { display: flex; flex-direction: column; gap: 10px; }
.editor textarea.main { min-height: 200px; }
.counterline { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); align-items: center; }
.counterline .over { color: var(--s-err); font-weight: 700; }
.alert { font-size: 12.5px; color: var(--s-wait); background: var(--s-wait-bg); border-radius: 6px; padding: 5px 9px; }
.alert.bad { color: var(--s-err); background: var(--s-err-bg); }
.nets { display: grid; gap: 6px; }
.net { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; transition: border-color .12s, background .12s; }
.net:not(.on) { opacity: .6; }
.net.on { border-color: var(--line-strong); }
.net.done { border-color: color-mix(in srgb, var(--s-ok) 50%, var(--line)); background: var(--s-ok-bg); }
.net.err { border-color: color-mix(in srgb, var(--s-err) 50%, var(--line)); background: var(--s-err-bg); }
.net:disabled { cursor: default; }
.net .nl { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.net .nl small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.net .chk { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: #fff; flex: none; }
.net .chk svg { width: 12px; height: 12px; stroke-width: 3; }
.net.on .chk { background: var(--accent); border-color: var(--accent); }
.net.done .chk { background: var(--s-ok); border-color: var(--s-ok); }
.medias-ed { display: flex; flex-wrap: wrap; gap: 8px; }
.medias-ed .m { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--sunk); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.medias-ed .m img { width: 100%; height: 100%; object-fit: cover; }
.medias-ed .m button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(16,24,40,.7); color: #fff; display: grid; place-items: center; }
.drop-zone { border: 1.5px dashed var(--line-strong); border-radius: 8px; width: 84px; height: 84px; display: grid; place-items: center; color: var(--muted); cursor: pointer; text-align: center; font-size: 11px; }
.drop-zone:hover { border-color: var(--accent); color: var(--accent); }
.comments { display: flex; flex-direction: column; gap: 8px; }
.cmt { border-left: 3px solid var(--s-fix); background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.cmt.done { border-color: var(--s-ok); opacity: .75; }
.cmt .cm { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.cmt p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.links { display: flex; flex-direction: column; gap: 6px; }
.link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; }
.link .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.link b { font-variant-numeric: tabular-nums; }
.datefix { display: flex; gap: 8px; }
.datefix input { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }

/* ---------- Aperçus réalistes ---------- */
.preview { border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #1d2129; overflow: hidden; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
:root[data-theme="dark"] .preview { background: #1b1f24; color: #e7e9ec; border-color: #2f3540; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preview { background: #1b1f24; color: #e7e9ec; border-color: #2f3540; } }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.pv-av { width: 40px; height: 40px; border-radius: 50%; background: var(--pc); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.pv-av.sq { border-radius: 6px; }
.pv-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pv-who b { font-size: 14px; }
.pv-who span { font-size: 12px; opacity: .65; display: inline-flex; align-items: center; gap: 4px; }
.pv-who span svg { width: 12px; height: 12px; }
.pv-dots { margin-left: auto; opacity: .55; }
.pv-text { padding: 0 14px 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.pv-text .seemore { border: 0; background: none; padding: 0; font-weight: 600; opacity: .65; }
.pv-text .hl { color: #0a66c2; font-weight: 600; }
.pv-media { display: grid; gap: 2px; background: #000; }
.pv-media.n2 { grid-template-columns: 1fr 1fr; }
.pv-media.n3, .pv-media.n4 { grid-template-columns: 1fr 1fr; }
.pv-media img, .pv-media video { width: 100%; display: block; max-height: 460px; object-fit: contain; background: #f3f2ef; }
.pv-media.n2 img, .pv-media.n3 img, .pv-media.n4 img { aspect-ratio: 1; }
.pv-doc { padding: 36px 16px; text-align: center; background: #f3f2ef; color: #444; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pv-counts { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12px; opacity: .65; }
.pv-bar { display: flex; justify-content: space-around; border-top: 1px solid rgba(127,127,127,.22); padding: 4px 6px; }
.pv-bar span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13px; font-weight: 600; opacity: .7; }
.pv-bar svg { width: 18px; height: 18px; }
.preview.ig .pv-head { padding: 10px 12px; }
.preview.ig .pv-av { width: 32px; height: 32px; font-size: 13px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e1306c; }
.preview.ig .pv-media img { aspect-ratio: 4 / 5; }
.ig-bar { display: flex; gap: 14px; padding: 10px 12px 4px; }
.ig-bar svg { width: 24px; height: 24px; }
.ig-bar .sp { margin-left: auto; }
.preview.ig .pv-text { padding: 4px 12px 12px; }
.preview.ig .pv-text b { margin-right: 6px; }
.preview.tt { background: #000; color: #fff; position: relative; aspect-ratio: 9 / 14; max-height: 560px; display: flex; flex-direction: column; justify-content: flex-end; }
.preview.tt .tt-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.preview.tt .tt-over { position: relative; padding: 14px 70px 18px 14px; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); }
.preview.tt .tt-over b { display: block; margin-bottom: 4px; }
.preview.tt .tt-side { position: absolute; right: 10px; bottom: 24px; display: flex; flex-direction: column; gap: 16px; align-items: center; font-size: 11px; }
.preview.tt .tt-side svg { width: 28px; height: 28px; }

/* ---------- Divers ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; z-index: 40; font-weight: 500; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; max-width: calc(100% - 32px); }
.toast.err { background: var(--s-err); color: #fff; }
.skeleton { height: 420px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--sunk) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: no-preference) {
  aside.panel { animation: slide .2s cubic-bezier(.2,.8,.2,1); }
  @keyframes slide { from { transform: translateX(32px); opacity: .5; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .iconbtn.menu-btn { display: inline-grid; }
  .topbar-in, .content { padding-left: 16px; padding-right: 16px; }
  .acct { grid-template-columns: auto minmax(0, 1fr); }
  .acct > :nth-child(n+3) { grid-column: 1 / -1; }
  .jrow { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 720px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .ptitle-h { font-size: 19px; }
  .qitem { grid-template-columns: 52px 4px minmax(0, 1fr); }
  .qitem > :last-child:not(.qmain) { grid-column: 3; justify-self: start; }
  .counters { width: 100%; }
}

/* ---------- Statistiques ---------- */
.statpage { display: flex; flex-direction: column; gap: 16px; }
.statpage .kpis { margin-bottom: 0; }
.delta { font-size: 12px; font-weight: 600; margin-top: 4px; display: block; }
.delta.up { color: var(--s-ok); }
.delta.down { color: var(--s-err); }
.kpi .hint { display: block; margin-top: 4px; font-size: 12px; }
.chartbox { overflow-x: auto; }
svg.chart { width: 100%; min-width: 520px; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.heatwrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(34px, 1fr)); gap: 3px; min-width: 560px; }
.heat .hh { font-size: 11px; color: var(--muted); text-align: center; }
.heat .hd { font-size: 12px; font-weight: 600; color: var(--ink-2); align-self: center; }
.heat .hc { height: 30px; border-radius: 6px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--surface)); color: var(--ink); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.heat .hc.empty { background: var(--sunk); }
.sugg { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
table.data.compact { min-width: 0; }
table.data.compact td, table.data.compact th { padding: 8px 10px; }
table.data.compact .bar { margin-top: 4px; max-width: 160px; }
.plist2 { display: flex; flex-direction: column; gap: 6px; }
.prow2 { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; text-align: left; }
.prow2:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.prow2 .rank { font-weight: 700; color: var(--muted); }
.prow2 img, .prow2 .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--pc); display: block; }
.prow2 .num { display: flex; flex-direction: column; align-items: flex-end; }
.prow2 .qtx { display: flex; flex-direction: column; min-width: 0; }
.prow2 .qt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fchip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.link.btn { justify-content: stretch; display: grid; text-align: left; }
a.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.hint.over { color: var(--s-err); font-weight: 700; }
@media (max-width: 720px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
