/* Back-office Livradois Automobiles */
:root {
  --ink-900: #111317; --ink-800: #1a1d23; --ink-700: #2a2e36; --ink-600: #3b404a;
  --text: #1a1d23; --muted: #5f6672; --line: #e8e4dd; --line-strong: #d6cfc2;
  --bg: #f6f4f0; --surface: #fff; --sand: #c5ab77; --sand-100: #f6f1e7; --sand-200: #eee4d0;
  --brand: #fb4c02; --brand-light: #ff8a50; --brand-btn: #d63f00; --brand-btn-hover: #b83600; --brand-50: #fff1ea; --brand-100: #ffe0d1; /* orange du logo ; boutons en orange foncé (texte blanc 4,6:1) */
  --success: #1c7c45; --success-50: #e6f5ec; --warning: #7d5c00; --warning-50: #fff7d1; /* jaune-ambre, distinct de l'orange de la marque */
  --danger: #b3203a; --danger-50: #fdecef; --info: #1d4ed8; --info-50: #e8efff; --grey-50: #eef0f3; /* rouge carmin, distinct de l'orange */
  --radius: 14px; --radius-lg: 20px;
  --shadow: 0 10px 30px -12px rgba(17, 19, 23, .2);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul { list-style: none; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
fieldset { border: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 700; color: var(--ink-700); margin-bottom: 8px; }
[hidden] { display: none !important; }
/* Application installée et ouverte comme telle : plus besoin du bouton « Télécharger » */
.is-standalone [data-install] { display: none !important; }
.install-steps { padding-left: 20px; display: grid; gap: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 15px; height: 15px; }
.rot180 { transform: rotate(180deg); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 800; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-warn { color: var(--warning); font-weight: 700; }
.is-neg { color: var(--danger); }
a.strong:hover, td a:hover, dd a:hover, .lead a:hover { text-decoration: underline; }
.stack { display: grid; gap: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.bullets { list-style: disc; padding-left: 20px; display: grid; gap: 4px; margin: 6px 0; }
.link { color: var(--brand-btn-hover); font-weight: 700; text-decoration: underline; padding: 0; }

/* Boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; background: var(--ink-900); color: #fff; border: 1.5px solid transparent; transition: background-color .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--ink-700); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--brand-btn); }
.btn--primary:hover { background: var(--brand-btn-hover); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--text); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #8f1c13; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--sm .i { width: 15px; height: 15px; }
.btn--block { width: 100%; }
label.btn { cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--ink-600); transition: background-color .15s, color .15s; vertical-align: middle; }
.icon-btn:hover { background: var(--sand-100); color: var(--ink-900); }
.icon-btn--danger:hover { background: var(--danger-50); color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-700); min-width: 0; }
.field small { font-weight: 500; color: var(--muted); }
.field--end { justify-content: flex-end; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; font-weight: 500; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.textarea { padding: 10px 12px; min-height: 90px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235f6672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; cursor: pointer; }
.select--auto { width: auto; max-width: 100%; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-900); box-shadow: 0 0 0 4px rgba(17, 19, 23, .07); }
.input:disabled, .select:disabled, .textarea:disabled { background-color: var(--bg); color: var(--muted); }
/* Listes déroulantes : ligne choisie / survolée en orange plutôt qu'en bleu système, là où le navigateur sait les personnaliser
   (Chrome, Edge…) ; ailleurs elles gardent l'apparence du système. */
.select option:checked { background-color: var(--brand-100); color: var(--ink-900); }
@supports (appearance: base-select) {
  .select, select.cell-sel, .select::picker(select), select.cell-sel::picker(select) { appearance: base-select; }   /* select.cell-sel : plus précis que « .cell-sel { appearance: none } » défini plus bas */
  .select, .cell-sel { display: inline-flex; align-items: center; }
  .cell-sel { justify-content: center; }
  .select::picker-icon, .cell-sel::picker-icon { display: none; }   /* on garde la flèche du back-office */
  .select::picker(select), .cell-sel::picker(select) { margin-top: 6px; padding: 6px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); max-height: min(340px, 60vh); }
  .select option, .cell-sel option { padding: 9px 12px; border-radius: 8px; font-weight: 500; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
  .select option::checkmark, .cell-sel option::checkmark { display: none; }
  .select option:checked, .cell-sel option:checked { background: var(--brand-100); color: var(--ink-900); font-weight: 700; }
  .select option:hover, .select option:focus-visible, .cell-sel option:hover, .cell-sel option:focus-visible { background: var(--brand-btn); color: #fff; outline: none; }
}
.input[readonly] { background: var(--bg); }
.input--code { max-width: 160px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.input--num { width: 90px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.check input, td input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-btn); flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.checks legend { width: 100%; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-700); }
.inline-field .input, .inline-field .select { width: auto; min-height: 36px; }
.inline-field--row { display: grid; grid-template-columns: 110px 1fr; }
.inline-field--row .input { width: 100%; }
.alert { padding: 10px 14px; border-radius: 10px; background: var(--danger-50); color: var(--danger); font-size: 14px; font-weight: 600; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--brand-50); color: var(--ink-800); font-size: 14px; }
.note > .i { color: var(--brand-btn); margin-top: 1px; }
.note--warn { background: var(--warning-50); color: #5c3a00; }
.note--warn > .i { color: var(--warning); }
.note--inline { display: inline-flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 8px 12px; }
.note .bullets { margin: 6px 0; }
.card .note { margin: 0; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(700px 400px at 90% 0%, rgba(251, 76, 2, .16), transparent 70%), radial-gradient(600px 400px at 0% 100%, rgba(197, 171, 119, .25), transparent 70%), var(--bg); }
.login__card { width: 100%; max-width: 420px; display: grid; gap: 18px; padding: 36px 32px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(17, 19, 23, .35); }
.login__brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; line-height: 1.15; }
.login__brand img { width: 46px; height: 46px; }
.login h1 { font-size: 24px; }
.login__note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.demo-roles { display: grid; gap: 10px; }
.demo-role { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: border-color .15s, background-color .15s; }
.demo-role:hover { border-color: var(--brand-btn); background: var(--brand-50); }
.demo-role > .i { width: 24px; height: 24px; color: var(--brand-btn); }
.demo-role strong { display: block; font-size: 15px; }
.demo-role small { display: block; font-size: 13px; color: var(--muted); }
.demo-role:disabled { opacity: .6; cursor: default; }
.demo-role.is-loading { border-color: var(--brand-btn); }

/* Structure */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 22px 14px; background: var(--ink-900); color: rgba(255, 255, 255, .72); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; font-weight: 800; font-size: 16px; line-height: 1.2; }
.side__brand img { width: 38px; height: 38px; }
.side__brand small { display: block; font-size: 12px; font-weight: 600; color: var(--sand); letter-spacing: .04em; text-transform: uppercase; }
.side__nav { display: grid; gap: 2px; }
.side__nav a, .side__foot a, .side__foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; transition: background-color .15s, color .15s; text-align: left; width: 100%; }
.side__nav a:hover, .side__foot a:hover, .side__foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side__nav a.is-active, .side__foot a.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.side__nav a.is-active .i, .side__foot a.is-active .i { color: var(--brand-light); }
.side__sep { margin: 14px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.count { margin-left: auto; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 800; text-align: center; color: #fff; }
.count:empty { display: none; }
.count--hot { background: var(--brand-btn); }
.side__foot { margin-top: auto; display: grid; gap: 2px; }
.side__user { padding: 12px 12px 0; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #fff; font-weight: 700; word-break: break-word; }
.side__user span { font-size: 12px; font-weight: 600; color: var(--sand); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 32px; background: rgba(246, 244, 240, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.search-global { position: relative; width: 300px; flex: none; }
.search-global > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-global .input { padding-left: 38px; min-height: 40px; font-size: 14px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; max-height: 70vh; overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px -20px rgba(17, 19, 23, .4); z-index: 30; }
.sr-title { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.sr-item:hover { background: var(--sand-100); }
.sr-item strong { display: block; font-size: 14px; }
.sr-item small { display: block; font-size: 12.5px; color: var(--muted); }
.sr-img { width: 56px; aspect-ratio: 3 / 2; border-radius: 6px; object-fit: cover; flex: none; }
.sr-avatar, .avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-50); color: var(--brand-btn); flex: none; }
.sr-empty { padding: 14px; color: var(--muted); font-size: 14px; text-align: center; }
.parc-filter { width: auto; min-height: 40px; font-size: 14px; font-weight: 700; flex: none; }
.view { padding: 26px 32px 64px; outline: none; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.view > .card, .view > section, .view > .grid-2, .view > .table-wrap, .view > .kpis, .view > .vhead { margin-bottom: 20px; }
.demo-banner { padding: 10px 32px; background: var(--warning-50); color: var(--warning); font-size: 13.5px; font-weight: 700; border-bottom: 1px solid #f3dfb0; }
.demo-banner a { text-decoration: underline; margin-left: 6px; }

/* Cartes & KPI */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card.is-dim { opacity: .65; }
.card__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.card__head h2 .i { color: var(--brand-btn); }
.card__body { padding: 20px; }
.card__sub { padding: 16px 20px; border-top: 1px solid var(--line); }
.card__sub h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; min-width: 0; }
a.kpi:hover { border-color: var(--ink-900); transform: translateY(-2px); }
.kpi__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.kpi__label .i { color: var(--brand-btn); }
.kpi strong { font-size: 26px; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi--hot { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.kpi--hot .kpi__label, .kpi--hot small { color: rgba(255, 255, 255, .7); }
.kpi--hot .kpi__label .i { color: var(--brand-light); }
.kpi--warn { border-color: #f0d49a; background: var(--warning-50); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2--wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-2--top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 > .stack { gap: 20px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty > .i { width: 32px; height: 32px; margin: 0 auto 10px; color: var(--sand); }
.loading { padding: 48px; text-align: center; color: var(--muted); }
.price-big { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--sand-100); color: var(--ink-700); vertical-align: middle; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill--v-disponible, .pill--r-confirme, .pill--n-envoye, .pill--m-envoye, .pill--n-livre, .pill--m-livre, .pill--d-acceptee, .pill--d-traitee, .pill--s-finalisee, .pill--c-termine { background: var(--success-50); color: var(--success); }
.pill--v-reserve, .pill--r-en_attente, .pill--n-en_attente, .pill--m-en_attente, .pill--s-reservee, .pill--c-en_cours { background: var(--warning-50); color: var(--warning); }
.pill--v-brouillon, .pill--v-retire, .pill--r-annule, .pill--n-annule, .pill--m-annule, .pill--d-refusee, .pill--s-annulee, .pill--c-non_necessaire, .pill--c-a_faire { background: var(--grey-50); color: var(--ink-600); }
.pill--v-vendu, .pill--v-livre, .pill--s-livree { background: var(--ink-900); color: #fff; }
.pill--r-termine, .pill--d-en_cours, .pill--s-en_cours, .pill--n-en_cours, .pill--m-en_cours { background: var(--info-50); color: var(--info); }
.pill--r-absent, .pill--n-echec, .pill--m-echec { background: var(--danger-50); color: var(--danger); }
.pill--d-nouvelle, .pill--n-simule, .pill--m-simule { background: var(--brand-50); color: var(--brand-btn-hover); }
.pill--role-admin { background: var(--ink-900); color: #fff; }
.pill--role-referent { background: var(--brand-50); color: var(--brand-btn-hover); }
.pill--role-secretaire { background: var(--sand-100); color: var(--ink-700); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--sand-100); color: var(--ink-700); white-space: nowrap; vertical-align: middle; }
.tag .i { width: 13px; height: 13px; }
.tag--offer { background: var(--brand-50); color: var(--brand-btn-hover); }
.tag--ok { background: var(--success-50); color: var(--success); }
.tag--warn { background: var(--warning-50); color: var(--warning); }
.tag--danger { background: var(--danger-50); color: var(--danger); }
.tag--muted { background: var(--grey-50); color: var(--muted); }
.tag--filter { background: var(--ink-900); color: #fff; cursor: pointer; }
a.tag:hover { filter: brightness(.96); text-decoration: none; }
.progress { position: relative; display: inline-block; width: 60px; height: 6px; margin-right: 42px; border-radius: 99px; background: var(--grey-50); vertical-align: middle; }
.progress span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--brand-btn); }
.progress em { position: absolute; left: 68px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.progress.is-done span { background: var(--success); }

/* Barre de filtres */
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--ink-600); }
.seg button:hover { border-color: var(--ink-600); }
.seg button[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.search { position: relative; width: min(320px, 100%); }
.search--wide { width: min(480px, 100%); }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }

/* Tableaux */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf9; }
.table--compact td, .table--compact th { padding: 8px 12px; }
.table .is-click { cursor: pointer; }
.table tr.is-cancelled td { color: var(--muted); }
.table tr.is-cancelled td:not(:last-child) { text-decoration: line-through; text-decoration-color: rgba(95, 102, 114, .5); }
.table tr.is-reversal td { background: var(--sand-100); }
.row-img { width: 72px; aspect-ratio: 3 / 2; border-radius: 8px; object-fit: cover; background: var(--sand-100); }
.noimg { display: grid; place-items: center; background: var(--sand-100); color: var(--sand); }
.status-select { min-height: 32px; font-size: 13px; font-weight: 700; padding-left: 10px; border-radius: 999px; width: auto; }
.status-select[data-statut="disponible"] { background-color: var(--success-50); border-color: transparent; color: var(--success); }
.status-select[data-statut="reserve"] { background-color: var(--warning-50); border-color: transparent; color: var(--warning); }
.status-select[data-statut="brouillon"], .status-select[data-statut="retire"] { background-color: var(--grey-50); border-color: transparent; }

/* Fiche véhicule */
.vhead { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.vhead-img { width: 132px; aspect-ratio: 3 / 2; border-radius: 10px; object-fit: cover; flex: none; }
.vhead-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.vhead-title .muted { font-size: 15px; font-weight: 600; }
.vhead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink-600); font-size: 14px; margin: 2px 0 8px; }
.vhead-meta a, .vhead-meta span { display: inline-flex; align-items: center; gap: 5px; }
.vhead-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vhead-parc { display: grid; gap: 2px; justify-items: end; text-align: right; font-size: 13px; }
.vhead-parc strong { font-size: 15px; }
.vhead-parc .btn { margin-top: 6px; }
.tabs-nav { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs-nav a { padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-nav a:hover { color: var(--ink-900); }
.tabs-nav a.is-active { color: var(--ink-900); border-color: var(--brand-btn); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { font-weight: 600; overflow-wrap: anywhere; }

/* Éditeur */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor__main { display: grid; gap: 20px; min-width: 0; }
.editor__side { position: sticky; top: 88px; display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3, .form-grid--2 .span-2 { grid-column: 1 / -1; }
.form-grid--pay { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.form-grid--log { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
.statut-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.statut-choice label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.statut-choice input { accent-color: var(--ink-900); }
.statut-choice label:has(input:checked) { border-color: var(--ink-900); background: var(--sand-100); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--sand-100); aspect-ratio: 3 / 2; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__cover { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: var(--brand-btn); color: #fff; font-size: 11px; font-weight: 800; }
.photo__tools { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.photo__tools button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .94); color: var(--ink-800); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.photo__tools button:hover { background: #fff; color: var(--brand-btn); }
.photo__tools button:disabled { opacity: .35; cursor: default; }
.photo__tools .i { width: 15px; height: 15px; }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-btn); background: var(--brand-50); color: var(--ink-800); }
.dropzone strong { color: var(--ink-900); }
.dropzone .i { width: 28px; height: 28px; color: var(--brand-btn); }
.upload-progress { font-size: 13px; font-weight: 700; color: var(--brand-btn); }
.upload-bar { margin-bottom: 16px; }
.dirty-note { font-size: 12.5px; color: var(--warning); font-weight: 700; text-align: center; }

/* Lecture de la carte grise : valeur lue (fond jaune clair), valeur douteuse (bordure orange), écart avec la fiche (sous le champ) */
.input.is-lu, .select.is-lu { background-color: var(--warning-50); }
.input.is-a-verifier:not(:focus), .select.is-a-verifier:not(:focus) { border-color: #d9650a; }
.field .cg-ecart { font-size: 12.5px; font-weight: 500; color: var(--ink-600); }
.field .cg-ecart strong { color: var(--ink-900); font-weight: 700; }
.field .cg-ecart a { margin-left: 6px; font-weight: 700; color: var(--brand-btn); text-decoration: underline; cursor: pointer; }
.cg-bilan { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border-radius: 10px; background: var(--sand-100); font-size: 13.5px; font-weight: 600; color: var(--ink-800); }

/* Préparation */
.prep-ready { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 20px; border-left: 4px solid var(--warning); }
.prep-ready > .i { width: 26px; height: 26px; color: var(--warning); }
.prep-ready strong { display: block; font-size: 15px; }
.prep-ready small { display: block; font-size: 13px; color: var(--muted); }
.prep-ready.is-ready { border-left-color: var(--success); }
.prep-ready.is-ready > .i { color: var(--success); }
.check-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.check-list li:last-child { border-bottom: 0; }
.chk--termine, .chk--non_necessaire { border-left-color: var(--success) !important; }
.chk--en_cours { border-left-color: var(--warning) !important; }
.chk--a_faire { border-left-color: var(--line-strong) !important; }
.chk-main strong { display: block; font-size: 14px; }
.chk-main small { font-size: 12.5px; }
.chk-fields { display: grid; grid-template-columns: 150px 160px 150px minmax(0, 1fr); gap: 8px; align-items: center; }
.chk-fields .input, .chk-fields .select { min-height: 36px; font-size: 13.5px; }
.matrix th { white-space: normal; min-width: 96px; vertical-align: bottom; line-height: 1.25; text-transform: none; letter-spacing: 0; font-size: 12px; }
.matrix th:first-child { min-width: 240px; }
.matrix td { white-space: nowrap; }
.matrix-veh { display: flex; align-items: center; gap: 10px; }
.matrix-veh strong { display: block; font-size: 14px; }
.matrix-veh small { display: block; font-size: 12px; color: var(--muted); }
.matrix-veh .row-img { width: 60px; }
.cell-sel { appearance: none; width: 100%; min-width: 92px; min-height: 30px; padding: 0 8px; border-radius: 8px; border: 1.5px solid transparent; font-size: 12.5px; font-weight: 700; text-align: center; cursor: pointer; }
.cell-sel--a_faire { background: var(--grey-50); color: var(--ink-600); }
.cell-sel--en_cours { background: var(--warning-50); color: var(--warning); }
.cell-sel--termine { background: var(--success-50); color: var(--success); }
.cell-sel--non_necessaire { background: var(--surface); color: var(--muted); border-color: var(--line); }
.cell-sel:focus { outline: none; border-color: var(--ink-900); }

/* Listes, chronologie */
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .grow strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .grow span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list li.is-click { cursor: pointer; }
.mini-list li.is-click:hover { background: #fcfbf9; }
.mini-time { display: grid; min-width: 54px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-time small { font-size: 12px; font-weight: 600; color: var(--muted); }
.timeline { padding: 6px 0; }
.timeline > li { display: flex; gap: 12px; padding: 10px 20px; font-size: 14px; border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.timeline > li > .i { margin-top: 2px; color: var(--brand-btn); }
.timeline p { color: var(--ink-700); margin-top: 2px; overflow-wrap: anywhere; }
.diff { display: grid; gap: 2px; margin-top: 4px; font-size: 12.5px; color: var(--muted) !important; }
.alerts li a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; border-left: 3px solid transparent; }
.alerts li:last-child a { border-bottom: 0; }
.alerts li a:hover { background: #fcfbf9; }
.alerts li a span { flex: 1; min-width: 0; }
.alert-item--danger a { border-left-color: var(--danger); }
.alert-item--danger .i:first-child { color: var(--danger); }
.alert-item--attention a { border-left-color: var(--warning); }
.alert-item--attention .i:first-child { color: var(--warning); }
.alert-item--info .i:first-child { color: var(--brand-btn); }
.pay-list li { display: grid; grid-template-columns: 90px 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pay-list li.is-cancelled { color: var(--muted); text-decoration: line-through; }
.client-pick { display: block; }
.bar { position: relative; min-width: 160px; height: 22px; border-radius: 6px; background: var(--grey-50); overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--brand-100); }
.bar em { position: relative; padding: 0 8px; font-style: normal; font-size: 12.5px; font-weight: 700; line-height: 22px; }

/* Choix (véhicule, client) */
.pick-list { display: grid; gap: 6px; margin-top: 10px; }
.pick-list:empty { display: none; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; transition: border-color .15s, background-color .15s; }
.pick:hover { border-color: var(--brand-btn); background: var(--brand-50); }
.pick > span:not(.sr-avatar):not(.pill) { flex: 1; min-width: 0; }
.pick strong { display: block; font-size: 14px; }
.pick small { display: block; font-size: 12.5px; color: var(--muted); }
.pick--sm { padding: 6px 10px; font-size: 13px; }
.pick-img { width: 64px; aspect-ratio: 3 / 2; border-radius: 8px; object-fit: cover; flex: none; }
.chosen { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--brand-50); border: 1.5px solid var(--brand-100); }
.chosen small { display: block; font-size: 13px; color: var(--muted); margin: 2px 0; }
.chosen-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.search-inline { position: relative; display: block; }
.search-inline > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-inline .input { padding-left: 38px; }

/* Prise de rendez-vous */
.rdv-form { display: grid; gap: 18px; max-width: 980px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-btn); color: #fff; font-size: 13px; font-weight: 800; }
.slots { margin: 16px 0; }
.slots-title { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; text-transform: none; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.slot { padding: 8px 4px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot:hover:not(:disabled) { border-color: var(--brand-btn); background: var(--brand-50); }
.slot.is-busy { background: var(--grey-50); color: #a0a6af; text-decoration: line-through; cursor: not-allowed; border-color: transparent; }
.slot.is-selected { background: var(--brand-btn); border-color: var(--brand-btn); color: #fff; }
.day-bookings { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.subhead { font-size: 14px; margin-bottom: 8px; }
.msg-list { display: grid; gap: 8px; font-size: 13px; }
.msg-preview { display: grid; gap: 10px; font-size: 14px; }
.msg-preview .note { margin: 0; }
.msg-body { white-space: pre-wrap; font-family: inherit; font-size: 14px; padding: 12px 14px; margin-top: 14px; border-radius: 10px; background: var(--bg); max-height: 50vh; overflow: auto; }

/* Fenêtres */
.modal { margin: auto; border: 0; border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100% - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45); background: var(--surface); color: var(--text); }
.modal[open] { display: flex; flex-direction: column; }
.modal--wide { width: min(860px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(17, 19, 23, .5); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 20px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.modal__body > p { color: var(--ink-700); }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Demandes */
.leads { display: grid; gap: 12px; }
.lead { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 18px; padding: 16px 18px; }
.lead.is-new { border-left: 4px solid var(--brand-btn); }
.lead__veh { display: grid; gap: 8px; align-content: start; font-size: 13px; }
.lead__veh small { display: block; color: var(--muted); }
.lead__img { width: 100%; aspect-ratio: 3 / 2; border-radius: 10px; object-fit: cover; }
.lead__body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.lead__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lead__who { font-size: 14.5px; overflow-wrap: anywhere; }
.lead__who a { color: var(--brand-btn-hover); font-weight: 700; }
.lead__msg { font-size: 14px; color: var(--ink-700); white-space: pre-line; background: var(--bg); border-radius: 10px; padding: 10px 12px; max-height: 140px; overflow: auto; }
.lead__client { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead__actions { display: grid; gap: 8px; align-content: start; }
.lead__actions .icon-btn { justify-self: end; }

/* Clients */
.client-head { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; }
.client-head .avatar { width: 52px; height: 52px; }
.client-head .avatar .i { width: 24px; height: 24px; }
.client-notes { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; white-space: pre-line; }

/* Administration */
.parcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.rows { display: grid; gap: 8px; }
.motif-row { display: flex; align-items: center; gap: 8px; }
.motif-row .input:first-child { flex: 1; }
.tpl { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.tpl legend { padding: 0 6px; margin: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 1000; transform: translate(-50%, 16px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px; background: var(--ink-900); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* Responsive */
@media (max-width: 1280px) {
  .kpis--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-global { width: 220px; }
  .chk-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor__side { position: static; }
  .grid-2, .grid-2--wide, .grid-2--top { grid-template-columns: minmax(0, 1fr); }
  .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead { grid-template-columns: 160px minmax(0, 1fr); }
  .lead__actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: end; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .25s; }
  .side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(17, 19, 23, .45); }
  .menu-btn { display: inline-grid; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px 10px; }
  .topbar h1 { font-size: 18px; }
  .search-global { order: 5; width: 100%; }
  .search-results { min-width: 0; }
  .view { padding: 18px 16px 56px; }
  .demo-banner { padding: 8px 16px; }
  .form-grid, .form-grid--pay { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .form-grid--log { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .vhead { flex-wrap: wrap; }
  .vhead-parc { justify-items: start; text-align: left; width: 100%; grid-template-columns: auto auto; justify-content: start; gap: 4px 10px; align-items: center; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid--2, .form-grid--pay { grid-template-columns: minmax(0, 1fr); }
  .topbar__actions .btn { padding: 0 12px; }
  .kpis, .kpis--4, .kpis--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi strong { font-size: 21px; }
  .vhead-img { width: 100%; }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead__veh { grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
  .chk-fields { grid-template-columns: minmax(0, 1fr); }
  .pay-list li { grid-template-columns: 1fr auto; }
  .card__head, .card__body, .card__sub, .mini-list li, .timeline > li, .alerts li a, .check-list li { padding-left: 14px; padding-right: 14px; }
  .client-head { flex-wrap: wrap; }
  .inline-field--row { grid-template-columns: 90px 1fr; }
  .parcs { grid-template-columns: minmax(0, 1fr); }
  .motif-row { flex-wrap: wrap; }
  .modal__body { padding: 16px; }
}

/* Ajustements après revue visuelle */
.kpis { margin-bottom: 20px; }
.row-actions--start { justify-content: flex-start; }
.filterbar--start { justify-content: flex-start; }
.row-img { max-width: none; flex: none; }
.table--veh td:nth-child(2) { min-width: 190px; }
.table--veh td:first-child { width: 88px; }
.matrix td:first-child { white-space: normal; min-width: 240px; }
.matrix td:nth-child(2) { min-width: 150px; }
.form-grid--pay { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lead { grid-template-columns: 180px minmax(0, 1fr) 190px; }
.topbar h1 { flex: 1 1 auto; min-width: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1280px) {
  .topbar__actions .btn--ghost span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar__actions .btn--ghost { padding: 0 12px; }
}
@media (max-width: 1100px) {
  .lead { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .topbar__actions .btn span { display: inline; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table--veh td:nth-child(2) { min-width: 160px; }
}
@media (max-width: 600px) {
  .mini-list li { flex-wrap: wrap; row-gap: 6px; }
  .mini-list li .grow { flex: 1 1 calc(100% - 80px); }
  .topbar h1 { flex: 1 1 0; min-width: 0; font-size: 17px; }
  .parc-filter { max-width: 140px; font-size: 13px; }
}

/* Fiche d'un rendez-vous : photo du véhicule concerné */
.rdv-veh { display: flex; align-items: center; gap: 16px; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); transition: border-color .15s, background-color .15s; }
.rdv-veh:hover { border-color: var(--brand-btn); background: var(--brand-50); }
.rdv-veh__img { width: 168px; aspect-ratio: 3 / 2; border-radius: 10px; object-fit: cover; flex: none; max-width: none; }
.rdv-veh__img.noimg .i { width: 32px; height: 32px; }
.rdv-veh__info { display: grid; gap: 2px; min-width: 0; }
.rdv-veh__info strong { font-size: 17px; letter-spacing: -.01em; }
.rdv-veh__info small { font-size: 13px; color: var(--muted); }
.rdv-veh__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.rdv-veh__link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--brand-btn-hover); }
@media (max-width: 600px) {
  .rdv-veh { flex-direction: column; align-items: stretch; }
  .rdv-veh__img { width: 100%; }
}

/* ================================================================ Planning */
/* Couleurs par statut (variables reprises par la grille, le mois, la liste et la légende) */
.ev--confirme, .lg--confirme { --c: var(--brand-btn); --bg: var(--brand-50); --fg: #7a2500; }
.ev--en_attente, .lg--en_attente { --c: #3b5bdb; --bg: #edf2ff; --fg: #1e3a8a; } /* bleu : bien distinct de l'orange « confirmé » */
.ev--termine, .lg--termine { --c: var(--success); --bg: var(--success-50); --fg: #0f4d2a; }
.ev--absent, .lg--absent { --c: var(--danger); --bg: var(--danger-50); --fg: #7a1810; }
.ev--annule, .lg--annule { --c: #9aa0aa; --bg: var(--grey-50); --fg: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.i--xs { width: 12px; height: 12px; vertical-align: -2px; }

/* Barre d'outils */
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.pl-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pl-title { position: relative; min-width: 0; }
.pl-title > button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.pl-title > button:hover { background: var(--sand-100); }
.pl-right { display: flex; align-items: center; gap: 10px; }
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 12px; background: var(--sand-100); }
.segmented button { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); transition: background-color .15s, color .15s; }
.segmented button:hover { color: var(--ink-900); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink-900); box-shadow: 0 1px 3px rgba(17, 19, 23, .14); }
.fbadge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--brand-btn); color: #fff; font-size: 12px; font-weight: 800; }
.pl-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill-remove { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: 999px; background: var(--sand-100); border: 1px solid var(--sand-200); font-size: 13px; font-weight: 700; }
.pill-remove:hover { border-color: var(--ink-600); }
.pill-remove .i { width: 14px; height: 14px; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.pl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pl-hint { margin-top: 8px; }
[data-cal] { transition: opacity .15s; }
[data-cal].is-busy { opacity: .55; }

/* Panneau de filtres (même présentation que le catalogue du site) */
.fdrawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -20px 0 60px -20px rgba(17, 19, 23, .35); border-radius: var(--radius-lg) 0 0 var(--radius-lg); transform: translateX(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s .28s; }
.fdrawer.is-open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
.fbackdrop { position: fixed; inset: 0; z-index: 55; background: rgba(17, 19, 23, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.fbackdrop.is-open { opacity: 1; pointer-events: auto; }
.fdrawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fdrawer__head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.fdrawer__head > span { display: flex; align-items: center; gap: 10px; }
.fdrawer__reset { font-size: 14px; font-weight: 700; color: var(--brand-btn); }
.fdrawer__reset:hover { text-decoration: underline; }
.fdrawer__body { flex: 1; overflow-y: auto; }
.fdrawer__foot { padding: 14px 20px; border-top: 1px solid var(--line); }
.fgroup { display: grid; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: 0; }
.fgroup__title { font-size: 15px; font-weight: 800; color: var(--ink-900); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-700); transition: border-color .15s, background-color .15s, color .15s; }
.chip:hover { border-color: var(--ink-600); }
.chip[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }

/* Grille horaire (jour, semaine) */
.tg-scroll { position: relative; overflow: auto; max-height: calc(100vh - 236px); min-height: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overscroll-behavior: contain; }
.tg { --colmin: 128px; min-width: calc(56px + var(--cols) * var(--colmin)); }
.tg--day { --colmin: 0px; }
.tg-head, .tg-body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(var(--colmin), 1fr)); }
.tg-hours { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); }
.tg-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, #f3efe8 1px, transparent 1px);
  background-size: 100% var(--px), 100% calc(var(--px) / 2); }
.tg-body > .tg-hours + .tg-col { border-left: 0; }
.tg-col.is-today { background-color: rgba(255, 241, 234, .5); }
.tg-now { position: absolute; left: 0; right: 0; z-index: 4; height: 2px; background: var(--danger); pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tg-hover { position: absolute; left: 3px; right: 3px; z-index: 1; padding: 2px 8px; border: 1.5px dashed var(--brand-btn); border-radius: 8px; background: rgba(214, 63, 0, .06); color: var(--brand-btn-hover); font-size: 12px; font-weight: 800; pointer-events: none; }
.tg-ev { position: absolute; z-index: 2; display: flex; gap: 8px; overflow: hidden; padding: 4px 7px; border-radius: 8px; border-left: 3px solid var(--c); background: var(--bg); color: var(--fg); font-size: 12px; line-height: 1.25; cursor: pointer; box-shadow: 0 1px 2px rgba(17, 19, 23, .1); user-select: none; transition: box-shadow .15s; }
.tg-ev:hover, .tg-ev:focus-visible { z-index: 3; box-shadow: 0 6px 16px -6px rgba(17, 19, 23, .35); }
.tg-ev.is-movable { cursor: grab; }
.tg-ev.is-dragging { z-index: 20; cursor: grabbing; opacity: .92; box-shadow: 0 16px 32px -10px rgba(17, 19, 23, .5); outline: 2px solid var(--c); }
.is-dragging .tg-col { cursor: grabbing; }
.tg-ev.ev--annule { text-decoration: line-through; }
.tg-ev__img { width: 64px; height: 100%; max-height: 52px; border-radius: 6px; object-fit: cover; flex: none; max-width: none; }
.tg-ev__txt { display: flex; flex-direction: column; min-width: 0; }
.tg-ev__txt > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev__time { font-size: 11.5px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.tg-ev strong { font-size: 12.5px; }
.tg-ev.is-short { padding-top: 2px; padding-bottom: 2px; }
.tg-ev__resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.tg-ev__resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .15s; }
.tg-ev:hover .tg-ev__resize::after { opacity: .45; }

/* Mois */
.mg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mg-head, .mg-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mg-head span { padding: 9px 6px; text-align: center; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.mg-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 116px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .15s; }
.mg-day:nth-child(7n) { border-right: 0; }
.mg-day:hover { background: #fcfbf9; }
.mg-day.is-out { background: var(--bg); }
.mg-day.is-out:not(.is-today) .mg-num { color: #827c73; }
.mg-num { align-self: flex-start; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.mg-day.is-today .mg-num { background: var(--brand-btn); color: #fff; }
.mg-ev { display: block; width: 100%; padding: 3px 6px; border-radius: 6px; border-left: 3px solid var(--c); background: var(--bg); color: var(--fg); font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-ev:hover { filter: brightness(.97); }
.mg-ev.ev--annule { text-decoration: line-through; }
.mg-more { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--brand-btn-hover); }

/* Liste (agenda) */
.ag { display: grid; gap: 14px; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ag-day.is-today { border-color: var(--brand-btn); box-shadow: 0 0 0 1px var(--brand-btn); }
.ag-dayhead { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ag-dayhead button { font-size: 15px; font-weight: 800; }
.ag-dayhead button:hover { text-decoration: underline; }
.ag-day.is-today .ag-dayhead button { color: var(--brand-btn-hover); }
.ag-add { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--brand-btn-hover); }
.ag-add:hover { background: var(--brand-50); }
.ag-item { display: grid; grid-template-columns: 56px 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 10px 16px; border-left: 4px solid var(--c); border-bottom: 1px solid var(--line); text-align: left; transition: background-color .15s; }
.ag-item:last-child { border-bottom: 0; }
.ag-item:hover { background: #fcfbf9; }
.ag-time { display: grid; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.ag-time small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ag-img { width: 72px; aspect-ratio: 3 / 2; border-radius: 8px; object-fit: cover; max-width: none; }
.ag-main { display: grid; min-width: 0; }
.ag-main strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-main > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ag-item.ev--annule .ag-main strong { text-decoration: line-through; }
.ag-empty { padding: 12px 16px; font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) {
  .pl-legend { margin-left: 0; }
}
@media (max-width: 700px) {
  .pl-bar { flex-direction: column; align-items: stretch; }
  .pl-nav { justify-content: space-between; }
  .pl-title > button { font-size: 16px; padding: 4px; }
  .pl-right .segmented { flex: 1; }
  .segmented button { padding: 7px 6px; font-size: 13px; }
  .pl-legend { display: none; }
  .pl-hint { display: none; }
  .tg { --colmin: 104px; }
  .tg-scroll { max-height: calc(100vh - 300px); }
  .mg-day { min-height: 64px; padding: 4px; }
  .mg-more { padding: 0; font-size: 11px; }
  .ag-item { grid-template-columns: 50px 56px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .ag-img { width: 56px; }
  .ag-tags { grid-column: 1 / -1; justify-content: flex-start; }
  .fdrawer { border-radius: 0; }
}
/* Contenu des rendez-vous selon la hauteur disponible */
.tg-ev.is-compact .tg-ev__txt { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 6px; }
.tg-ev.is-compact .tg-ev__time { overflow: visible; }
.tg-ev.is-compact .tg-ev__sub { grid-column: 1 / -1; }
.tg-ev.is-short .tg-ev__sub { display: none; }
.tg-ev strong small { font-weight: 600; opacity: .7; }
.tg--day .tg-ev { gap: 10px; }
.tg--day .tg-ev__img { max-height: none; height: auto; align-self: stretch; width: 72px; }
.tg--day .tg-ev.is-compact .tg-ev__img { width: 52px; }
@media (max-width: 700px) {
  .pl-right { width: 100%; gap: 8px; }
  .pl-right .segmented { min-width: 0; }
  .pl-right .segmented button { min-width: 0; padding: 7px 4px; }
  .pl-right .btn { flex: none; padding: 0 10px; }
  .pl-nav { gap: 4px; }
}

/* ---------------------------------------------------------------- Planning (v2 : couleurs d'origine, navigation, déplacement) */
/* En-tête des jours : fond beige et libellé « Lun. 19 » bien lisible, comme la première version */
.tg-head { position: sticky; top: 0; z-index: 6; background: var(--bg); border-bottom: 1px solid var(--line-strong); }
.tg-corner { position: sticky; left: 0; z-index: 1; background: var(--bg); }
.tg-dayhead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; padding: 6px 4px; border-left: 1px solid var(--line); line-height: 1.2; transition: background-color .15s; }
.tg-dayhead:hover { background: var(--sand-100); }
.tg-dayhead strong { padding: 3px 10px; border-radius: 8px; font-size: 14px; font-weight: 800; color: var(--ink-900); }
.tg-dayhead em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tg-dayhead.is-today strong { background: var(--brand-btn); color: #fff; }
.tg-dayhead.is-closed:not(.is-today) strong { color: var(--muted); }
.tg-body > .tg-col.is-today { background-color: rgba(255, 241, 234, .5); }

/* Rendez-vous à clôturer : couleur du statut conservée, simple pastille horloge */
.tg-ev__late { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-800); color: #fff; z-index: 1; }
.tg-ev__late .i { width: 11px; height: 11px; }
.tg-ev.is-late .tg-ev__txt { padding-right: 18px; }
.mg-ev.is-late::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--ink-800); vertical-align: 1px; }
.lg-late { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--ink-800); color: #fff; }
.lg-late .i { width: 10px; height: 10px; }
.tg-ev.is-conflict { outline: 2px solid var(--danger); background: var(--danger-50); color: var(--danger); }

/* Navigation : ‹ Aujourd'hui › */
.pl-step { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); overflow: hidden; }
.pl-step__btn { display: grid; place-items: center; width: 40px; min-height: 38px; color: var(--ink-700); transition: background-color .15s; }
.pl-step__btn:hover { background: var(--sand-100); color: var(--ink-900); }
.pl-step__btn:disabled { opacity: .35; cursor: default; background: none; }
.pl-step__today { padding: 0 14px; font-size: 13.5px; font-weight: 700; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); transition: background-color .15s; }
.pl-step__today:hover { background: var(--sand-100); }
.mv-week .pl-step__btn { border: 1.5px solid var(--line-strong); border-radius: 50%; width: 38px; height: 38px; min-height: 0; flex: none; }
.pl-week { margin-left: 2px; padding: 2px 8px; border-radius: 999px; background: var(--sand-100); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.pl-week:empty { display: none; }

/* Mini-calendrier */
.mc { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 320px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px -24px rgba(17, 19, 23, .45); }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mc-head strong { font-size: 15px; }
.mc-grid { display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)); gap: 2px; }
.mc-grid > span { display: grid; place-items: center; height: 26px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.mc-grid > .mc-wk { font-size: 10.5px; }
.mc-wnum { height: 34px; border-radius: 8px; font-size: 11.5px; font-weight: 800; color: var(--brand-btn-hover); background: var(--brand-50); }
.mc-wnum:hover, .mc-wnum.is-sel { background: var(--brand-btn); color: #fff; }
.mc-day { height: 34px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ink-800); }
.mc-day:hover { background: var(--sand-100); }
.mc-day.is-out:not(.is-today) { color: #827c73; }
.mc-day.is-closed:not(.is-today) { color: #827c73; }
.mc-day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand-btn); color: var(--brand-btn-hover); }
.mc-day.is-inweek { background: var(--brand-50); border-radius: 0; }
.mc-day.is-sel:not(.is-inweek) { background: var(--brand-btn); color: #fff; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Fenêtre « Déplacer le rendez-vous » */
.mv-sum { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.mv-img { width: 108px; aspect-ratio: 3 / 2; border-radius: 10px; object-fit: cover; flex: none; max-width: none; }
.mv-sum strong { display: block; font-size: 15px; }
.mv-sum small { display: block; font-size: 13px; color: var(--muted); }
.mv-sum small b { color: var(--ink-900); }
.mv-week { display: flex; align-items: center; gap: 8px; }
.mv-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mv-day { display: grid; justify-items: center; gap: 1px; padding: 7px 2px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); line-height: 1.15; transition: border-color .15s, background-color .15s; }
.mv-day span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.mv-day strong { font-size: 17px; font-weight: 800; }
.mv-day small { font-size: 11px; color: var(--muted); }
.mv-day:hover { border-color: var(--ink-600); }
.mv-day.is-today strong { color: var(--brand-btn-hover); }
.mv-day.is-current { border-style: dashed; border-color: var(--brand-btn); }
.mv-day.is-closed { background: var(--bg); }
.mv-day.is-closed:not(.is-today) strong { color: var(--muted); }
.mv-day.is-sel { background: var(--ink-900); border-color: var(--ink-900); }
.mv-day.is-sel span, .mv-day.is-sel small, .mv-day.is-sel strong { color: #fff; }
.mv-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.slot.is-current { border-style: dashed; border-color: var(--brand-btn); }
.slot.is-current:disabled { text-decoration: none; color: var(--brand-btn-hover); background: var(--brand-50); }

@media (max-width: 700px) {
  .pl-step__btn { width: 36px; }
  .pl-step__today { padding: 0 10px; }
  .pl-week { display: none; }
  .mc { position: fixed; top: 120px; left: 12px; right: 12px; width: auto; }
  .mv-week { gap: 4px; }
  .mv-days { gap: 3px; }
  .mv-day { padding: 6px 0; border-radius: 10px; }
  .mv-day strong { font-size: 15px; }
  .mv-day small { display: none; }
  .mv-img { width: 80px; }
}
.slot.is-selected, .slot.is-selected:hover:not(:disabled) { background: var(--brand-btn); border-color: var(--brand-btn); color: #fff; }

/* ---------------------------------------------------------------- Tableau de bord : liste « À faire » */
.count-inline { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--brand-btn); font-size: 12px; font-weight: 800; color: #fff; }
.count-inline:empty { display: none; }
.todo { transition: opacity .15s; }
.todo.is-busy { opacity: .6; }
.todo__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo__pour { min-height: 34px; font-size: 13px; max-width: 220px; }
.segmented--sm { padding: 3px; border-radius: 10px; }
.segmented--sm button { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.td-list { list-style: none; padding-bottom: 4px; }
.td-group { padding: 12px 20px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.td-row { display: flex; align-items: center; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--line); }
.td-row:hover { background: #fcfbf9; }
.td-row[data-rdv] { cursor: pointer; }
.td-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.td-body strong { font-size: 14px; }
.td-body small { font-size: 12.5px; color: var(--muted); }
.td-body small .is-warn { font-weight: 700; }
.td-time { min-width: 48px; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.td-rdv { border-left: 4px solid var(--c); padding-left: 16px; }
.td-rdv.is-past { opacity: .6; }
.td-prep { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: var(--warning-50); }
.td-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-800); cursor: pointer; }
.td-check input { width: 19px; height: 19px; accent-color: var(--success); flex: none; cursor: pointer; }
.td-check.is-done, .td-row.is-done .td-body strong { color: var(--muted); text-decoration: line-through; }
.td-row.is-done { background: #fbfaf7; }
.td-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--brand-50); color: var(--brand-btn-hover); }
.td-ico .i { width: 16px; height: 16px; }
.td-ico--warn { background: var(--warning-50); color: var(--warning); }
.td-ico--danger { background: var(--danger-50); color: var(--danger); }
.td-row > .td-check { width: 30px; justify-content: center; }
.td-go { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; color: var(--muted); }
.td-go:hover { background: var(--sand-100); color: var(--ink-900); }
.td-tel { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-btn-hover); font-weight: 700; white-space: nowrap; }
.td-row > .td-tel { flex: none; font-size: 13px; }
.td-now { display: flex; align-items: center; gap: 10px; padding: 2px 20px; font-size: 11.5px; font-weight: 800; color: var(--danger); }
.td-now::before { content: ""; width: 34px; height: 2px; background: var(--danger); }
.td-now::after { content: ""; flex: 1; height: 2px; background: var(--danger); }
.td-empty { color: var(--muted); font-size: 13.5px; }
.td-empty .i { color: var(--sand); }
.td-more a { font-size: 13px; font-weight: 700; color: var(--brand-btn-hover); }
.td-note { display: flex; align-items: center; gap: 8px; margin: 12px 20px 0; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); }
.td-toggle { display: block; width: 100%; padding: 12px; font-size: 13.5px; font-weight: 700; color: var(--brand-btn-hover); border-top: 1px solid var(--line); }
.td-toggle:hover { background: var(--brand-50); }
@media (max-width: 600px) {
  .td-row { padding: 9px 14px; gap: 10px; align-items: flex-start; }
  .td-group { padding-left: 14px; }
  .td-row > .td-tel { display: none; }
  .td-rdv .pill, .td-rdv .tag { display: none; }
  .todo__tools { width: 100%; }
  .todo__pour { flex: 1; max-width: none; }
}

/* Statuts des rendez-vous : mêmes couleurs dans les listes que dans le calendrier */
.pill--r-confirme { background: var(--brand-50); color: var(--brand-btn-hover); }
.pill--r-en_attente { background: #edf2ff; color: #1e3a8a; }
.pill--r-termine { background: var(--success-50); color: var(--success); }

/* ---------------------------------------------------------------- Diffusion multicanale */
/* Statuts des annonces : vert = en ligne, bleu = en attente de confirmation, ambre = à mettre à jour / renouveler,
   carmin = à retirer / erreur / refusée, gris = hors ligne, noir = vendu */
.pill--p-publie { background: var(--success-50); color: var(--success); }
.pill--p-non_publie, .pill--p-retire { background: var(--grey-50); color: var(--ink-600); }
.pill--p-suspendu { background: var(--grey-50); color: var(--ink-700); }
.pill--p-en_attente { background: #edf2ff; color: #1e3a8a; }
.pill--p-a_mettre_a_jour, .pill--p-expire { background: var(--warning-50); color: var(--warning); }
.pill--p-a_retirer, .pill--p-refuse { background: var(--danger-50); color: var(--danger); }
.pill--p-erreur { background: var(--danger); color: #fff; }
.pill--p-vendu { background: var(--ink-900); color: #fff; }
.pill--k-connecte { background: var(--success-50); color: var(--success); }
.pill--k-non_connecte { background: var(--grey-50); color: var(--ink-600); }
.pill--k-erreur { background: var(--danger-50); color: var(--danger); }
.pill--k-expire { background: var(--warning-50); color: var(--warning); }
button.kpi { text-align: left; font: inherit; cursor: pointer; width: 100%; }
button.kpi:hover { border-color: var(--line-strong); }
button.kpi.kpi--hot:hover { border-color: var(--ink-700); }
.dif-kpis { margin-bottom: 14px; }
.dif-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 14px; font-size: 13.5px; }
.dif-modes > span { display: inline-flex; align-items: center; gap: 6px; }
.dif-modes .link { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.dif-table tbody tr { cursor: pointer; }
.dif-table td { white-space: nowrap; }
.dif-table td:first-child { white-space: normal; min-width: 230px; }
.dif-msg { min-width: 260px; font-size: 13px; }
.filterbar > .dif-intro { flex: 1 1 280px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.pub-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.pub-card--a_retirer, .pub-card--erreur { border-color: #efb3be; }
.pub-card--a_mettre_a_jour, .pub-card--expire { border-color: #f0d49a; }
.pub-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pub-card__head strong { font-size: 15.5px; }
.pub-card__state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pub-card__meta { font-size: 13px; color: var(--muted); }
.pub-card__meta .link { display: inline-flex; align-items: center; gap: 4px; }
.pub-card__why { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pub-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.pub-miss { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-600); line-height: 1.4; }
.pub-miss .i { margin-top: 1px; color: var(--warning); }
.pub-miss--block { color: var(--danger); font-weight: 600; }
.pub-miss--block .i { color: var(--danger); }
.pub-more { position: relative; }
.pub-more summary { list-style: none; }
.pub-more summary::-webkit-details-marker { display: none; }
.pub-more > div { position: absolute; z-index: 5; right: 0; top: calc(100% + 4px); display: grid; gap: 4px; padding: 6px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.pub-more > div .btn { justify-content: flex-start; }
.pub-choice { display: grid; gap: 8px; margin-top: 12px; }
.pub-choice__row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.pub-choice__row:has(input:checked) { border-color: var(--brand-btn); background: var(--brand-50); }
.pub-choice__row input { width: 18px; height: 18px; accent-color: var(--brand-btn); flex: none; }
.pub-choice__row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.pub-choice__row small.is-warn { color: var(--warning); }
.pub-results { display: grid; gap: 8px; }
.pub-results li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.pub-results li > span { flex: 1; min-width: 0; }
.pub-results .is-ok > .i { color: var(--success); }
.pub-results .is-ko > .i { color: var(--danger); }
.pub-results .is-todo > .i { color: var(--brand-btn); }
.dif-hist { display: grid; }
.dif-hist li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.dif-hist li:last-child { border-bottom: 0; }
.dif-hist strong { display: block; font-size: 13.5px; }
.dif-hist small { display: block; color: var(--muted); font-size: 12.5px; }
.dif-hist__date { flex: none; width: 92px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.dif-hist .tag { flex: none; }
/* Kit de publication assistée */
.kit-step { padding: 14px 0; border-top: 1px solid var(--line); }
.kit-step:first-of-type { border-top: 0; padding-top: 4px; }
.kit-step h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 10px; }
.kit-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-900); color: #fff; font-size: 12.5px; font-weight: 800; flex: none; }
.kit-copy { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kit-copy__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 12px; background: var(--bg); font-size: 12.5px; font-weight: 800; color: var(--ink-700); }
.kit-copy__text { padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; font-family: inherit; }
.kit-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px; }
.kit-photos a { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--sand-100); }
.kit-photos img { width: 100%; height: 100%; object-fit: cover; }
.kit-photos span, .adapt-photo span { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(17, 19, 23, .78); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
/* Adaptation par plateforme */
.adapt { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; margin-top: 10px; }
.adapt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.adapt-photo { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; cursor: pointer; border: 2px solid transparent; }
.adapt-photo:has(input:checked) { border-color: var(--brand-btn); }
.adapt-photo input { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; accent-color: var(--brand-btn); z-index: 1; }
.adapt-photo img { width: 100%; height: 100%; object-fit: cover; }
.adapt-photo:not(:has(input:checked)) img { opacity: .4; }
.adapt-preview { position: sticky; top: 0; }
.adapt-card { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.adapt-card img, .adapt-card .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.adapt-card p { padding: 0 12px; }
.adapt-card__title { margin-top: 10px; font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.adapt-card__price { margin-top: 4px; font-weight: 800; color: var(--brand-btn-hover); }
.adapt-card__meta { font-size: 12px; color: var(--muted); }
.adapt-card__desc { margin: 8px 0 12px; font-size: 12.5px; color: var(--ink-600); white-space: pre-line; }
/* Comptes de diffusion */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 16px; }
.acc-cond { font-size: 13.5px; color: var(--ink-700); }
.acc-cond .link { display: inline-flex; align-items: center; gap: 4px; }
.acc-sub { padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; }
.acc-sub legend { padding: 0 6px; margin: 0; }
.acc-list { display: grid; gap: 6px; }
.acc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.acc-list .link { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.acc-add { padding-top: 6px; border-top: 1px solid var(--line); }
.btn.is-loading { opacity: .7; cursor: progress; }
@media (max-width: 900px) {
  .adapt { grid-template-columns: minmax(0, 1fr); }
  .adapt-preview { position: static; }
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .pub-grid { grid-template-columns: minmax(0, 1fr); }
  .dif-modes .link { margin-left: 0; }
  .dif-hist li { flex-wrap: wrap; padding: 10px 14px; }
  .dif-hist__date { width: auto; }
  .pub-more > div { right: auto; left: 0; }
}
/* Publication en 1 clic */
.cell-st { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.cell-pub { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1.5px solid var(--brand-btn); color: var(--brand-btn-hover); background: var(--surface); font-size: 12px; font-weight: 800; white-space: nowrap; }
.cell-pub:hover { background: var(--brand-btn); color: #fff; }
.cell-pub.is-locked { border-color: var(--line-strong); color: var(--ink-600); }
.cell-pub.is-locked:hover { background: var(--grey-50); color: var(--ink-900); }
.cell-pub[disabled] { opacity: .7; cursor: progress; }
.dif-modes .link.small { font-size: 12.5px; }
.pub-unclic { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-600); }
.pub-unclic .i { color: var(--muted); }
.unclic-steps { display: grid; gap: 6px; margin: 10px 0; padding: 0; counter-reset: none; }
.unclic-steps li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.unclic-steps li .i { flex: none; }
.unclic-steps li.is-done { color: var(--success); font-weight: 600; }
.unclic-steps li.is-todo { color: var(--warning); font-weight: 700; }
.acc-unclic { padding: 12px 14px; border-radius: 12px; background: var(--warning-50); color: #5c3a00; }
.acc-unclic.is-ready { background: var(--success-50); color: var(--ink-800); }
.acc-unclic__title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.acc-unclic__title .i { color: var(--warning); }
.acc-unclic.is-ready .acc-unclic__title .i { color: var(--success); }
.acc-unclic .small.muted { color: inherit; opacity: .9; }
.api-op { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: end; }
[name="apiModele"] { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.45; }
.var-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.var-chips .chip { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; padding: 3px 8px; }
.api-req { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; margin: 8px 0; }
.api-json { max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--ink-900); color: #f3f1ec; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .api-op { grid-template-columns: minmax(0, 1fr); }
  .cell-st { flex-wrap: wrap; }
}
.acc-api > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-700); list-style-position: inside; }
.acc-api:not([open]) { gap: 0; }
