/* EKA — interface : thème clair, calme, rythme de 8 px. */
:root {
  /* Marque EKA (site eka.fr, relevé le 31/10/2026) : bleu #283595, turquoise #59C5C3, Rethink Sans, Baskervville en italique.
     Style « feuille dans un cadre » : le menu sur un cadre teinté du bleu EKA, le travail sur une feuille blanche. */
  --accent: #283595;
  --accent-hover: #1f2a78;
  --accent-soft: #eef0f8;
  --accent-line: #cdd2ea;
  --accent-ink: #1f2a78;
  --brand-2: #59c5c3;          /* turquoise EKA : marques et repères, jamais du texte (2:1 sur blanc) */
  --brand-2-ink: #178280;      /* le même turquoise assombri pour 4.5:1 : focus, petits textes */
  --ink: #23263a;
  --ink-2: #444a5e;
  --muted: #5d6273;
  --line: #e8e9ef;
  --line-strong: #d1d4de;
  --bg: #f3f4f8;               /* le cadre : un pas de bleu EKA très peu saturé */
  --surface: #fff;
  --surface-2: #f8f9fb;
  --hover: #f1f2f7;
  --danger: #b4231b;
  --danger-soft: #fcecea;
  --danger-line: #f2c6c2;
  --warning: #855700;
  --warning-soft: #fdf3dc;
  --warning-row: #fff9ee;
  --success: #17703f;
  --success-soft: #e5f4eb;
  --success-line: #bfe2cd;
  --info: #1d5c9b;
  --info-soft: #e8f0fa;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-sheet: 16px;
  --pill: 999px;
  --shadow: none;
  --shadow-lg: 0 18px 48px rgba(20, 24, 45, .16), 0 2px 6px rgba(20, 24, 45, .06);
  --ring: 0 0 0 3px rgba(40, 53, 149, .18);
  --font: "Rethink Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Baskervville", Georgia, "Times New Roman", serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --banner-h: 36px;
  --sidebar-w: 232px;
  color-scheme: light;
}

@font-face { font-family: "Rethink Sans"; src: url("/fonts/rethink-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Baskervville"; src: url("/fonts/baskervville-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd, samp { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--brand-2-ink); outline-offset: 2px; }
::selection { background: #d9ddf2; color: var(--ink); }
html { accent-color: var(--accent); caret-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--surface); padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--line-strong); }
.skip-link:focus { left: 16px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bandeau de démo ---------- */
.demo-banner {
  position: sticky; top: 0; z-index: 30;
  height: var(--banner-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #f4efe3; border-bottom: 1px solid #e7dcc4; color: #5a4a24;
  font-size: 13px;
}
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #d39b2a; }
.demo-reset {
  margin-left: 8px; height: 24px; padding: 0 10px;
  background: transparent; border: 1px solid #d7c8a4; border-radius: var(--pill);
  color: #5a4a24; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.demo-reset:hover { background: #ebe2cc; }
.demo-reset { white-space: nowrap; }

/* ---------- Mise en page ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--banner-h)); }
.sidebar {
  position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h));
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 12px; background: var(--bg);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 8px 24px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 128px; height: auto; }
.brand-text { display: flex; flex-direction: column; font-size: 18px; font-weight: 750; letter-spacing: .02em; line-height: 1.15; }
.brand-text small { font-size: 12px; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--pill);
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
}
.nav a:hover { background: #eaecf3; color: var(--ink); text-decoration: none; }
.nav a.active { background: #e4e6ef; color: var(--ink); font-weight: 600; }
.nav .icon { width: 18px; height: 18px; color: var(--muted); }
.nav a.active .icon { color: var(--accent); }
.nav-short { display: none; }

/* La feuille : blanche, posée dans le cadre à 8 px du bord droit et du bas, 1 px de bord, coins de 16 px, sans ombre. */
.main {
  min-width: 0; outline: none; padding: 32px 40px 64px; margin: 8px 8px 8px 0;
  background: var(--surface); border: 1px solid #e6e7ee; border-radius: var(--radius-sheet);
  min-height: calc(100vh - var(--banner-h) - 16px);
}
.page { max-width: 1240px; margin: 0 auto; }
.page > .card + .card, .page > .card + section, .stack > * + * { margin-top: 16px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; letter-spacing: -.01em; }
.sub { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.sub a { color: var(--ink-2); font-weight: 600; }
.cap::first-letter { text-transform: uppercase; }
/* Seconde police, un seul usage : la date du tableau de bord, en Baskervville italique comme les mots mis en valeur sur eka.fr. */
.sub-serif { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); font-size: 13.5px; font-weight: 550; }
.back .icon { width: 16px; height: 16px; }
.back:hover { color: var(--accent); }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill);
  color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: none; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eceef4; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #971d16; }
.btn-sm { height: 30px; padding: 0 10px; gap: 6px; font-size: 13px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  background: transparent; border: 0; border-radius: var(--pill); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: #eceef4; color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.link-btn { background: none; border: 0; padding: 2px 4px; color: var(--accent); font-size: 13px; font-weight: 550; cursor: pointer; border-radius: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; }
.card-flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card h2 .icon { color: var(--muted); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head.pad { padding: 16px 20px; margin: 0; align-items: center; }
.pad { padding: 16px 20px; }
.pad-x { padding: 0 20px 12px; margin-top: -8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 620; }
.mono { font-family: var(--mono); font-size: .93em; }
.late-text { color: var(--danger); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 620; white-space: nowrap; vertical-align: middle; }
.badge-neutral { background: #eef0f5; color: var(--ink-2); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tableaux ---------- */
/* position: relative : les textes pour lecteurs d'écran (.sr-only, en position absolue) restent dans le cadre qui défile, sinon ils élargissent la page. */
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact td { padding: 10px 16px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f6f7fa; }
.row-link a { color: var(--ink); }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.cell-clip { max-width: 340px; }
.clip { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table-hint { padding: 10px 16px; border-top: 1px solid var(--line); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
:where(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 14.5px; transition: border-color .12s, box-shadow .12s;
}
:where(textarea) { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
:where(select) {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7673' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
[aria-invalid=true] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(180, 35, 27, .15) !important; }
input::placeholder, textarea::placeholder { color: #9aa4a1; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.input-suffix { position: relative; display: flex; }
.input-suffix input { padding-right: 30px; text-align: right; }
.input-suffix > span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.field-help { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.field-check { flex-direction: row; align-items: center; gap: 8px; align-self: end; height: 38px; }
.field-check input { width: 18px; height: 18px; }
.field-check span { font-size: 14px; font-weight: 500; color: var(--ink); }
.subform { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 16px; margin: 0; }
.subform legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.form-actions [data-etat] { margin-right: auto; color: var(--warning); }

.toolbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 280px; max-width: 480px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { height: 40px; padding-left: 38px; border-radius: 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switch input { width: 16px; height: 16px; }

/* ---------- Onglets et filtres ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 560; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 650; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: 13.5px; font-weight: 550;
}
.filter span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filter:hover { text-decoration: none; background: var(--hover); }
.filter.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

/* ---------- États ---------- */
.empty { padding: 24px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty p + * { margin-top: 12px; }
.error-card { max-width: 560px; margin: 40px auto; }
.error-card h1 { font-size: 20px; margin-bottom: 8px; }
.error-card p { color: var(--ink-2); margin-bottom: 16px; }
.skeleton { max-width: 1240px; margin: 0 auto; }
.skel { background: #e8eceb; border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
.skel-title { height: 28px; width: 240px; margin-bottom: 10px; }
.skel-sub { height: 14px; width: 320px; margin-bottom: 32px; }
.skel-card { display: grid; gap: 16px; }
.skel-line { height: 14px; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--ink);
}
.kpi-link:hover { border-color: var(--accent-line); text-decoration: none; background: #fbfbfd; }
.kpi-label { font-size: 13px; font-weight: 560; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value.kpi-small { font-size: 20px; }
.kpi-value.late { color: var(--danger); }
.kpi-note { font-size: 12.5px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-grid > :first-child { grid-row: span 2; }
.dash-card { padding: 0; overflow: hidden; }
.dash-head { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dash-head h2 { font-size: 15px; }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #eef0f5; color: var(--ink-2); font-size: 12px; font-weight: 650; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.has-late .count { background: var(--danger-soft); color: var(--danger); }
.dash-more { margin-left: auto; font-size: 13px; font-weight: 560; display: inline-flex; align-items: center; gap: 4px; }
.dash-more .icon { width: 15px; height: 15px; }
.dash-total { padding: 12px 20px 4px; font-size: 13.5px; color: var(--muted); }
.dash-total strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); transition: opacity .18s, transform .18s; }
.list-item:last-child { border-bottom: 0; }
.list-item:has(> .list-link) { padding: 0; }
.list-item.is-late { background: #fdf6f5; }
.list-item.leaving { opacity: 0; transform: translateX(8px); }
.list-link { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; padding: 12px 20px; color: inherit; }
.list-link:hover { background: #f6f7fa; text-decoration: none; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 620; color: var(--ink); }
a.list-title:hover { color: var(--accent); }
.list-text { margin-top: 2px; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; flex-shrink: 0; }
.when { font-size: 12.5px; font-weight: 620; color: var(--ink-2); white-space: nowrap; }
.when.late { color: var(--danger); }
.when.today { color: var(--accent); }
.amount { font-variant-numeric: tabular-nums; font-weight: 620; white-space: nowrap; }
.amount.warn { color: var(--warning); }

.obs-dot { width: 20px; height: 20px; margin-top: 2px; display: inline-grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.obs-dot .icon { width: 18px; height: 18px; }

/* ---------- Fiche client ---------- */
.client-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; margin: 0; }
.info-grid dt { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.info-grid dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.span-all { grid-column: 1 / -1; }
.mini-kpis { display: grid; gap: 16px; }
.mini-kpis .kpi { padding: 16px 20px; }
.mini-kpis .kpi-value { font-size: 24px; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.client-side { display: grid; gap: 16px; }

.quick-add { display: grid; gap: 12px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: 13.5px; font-weight: 550; color: var(--ink-2); cursor: pointer;
}
.chip .icon { width: 16px; height: 16px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:hover { background: var(--hover); }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick-row { display: flex; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap; }
.quick-row .field { width: 200px; }
.quick-dates { display: flex; gap: 2px; flex-wrap: wrap; padding-bottom: 8px; }
.quick-row [type=submit] { margin-left: auto; }

.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 12px 0; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 15.5px; top: 46px; bottom: -10px; width: 1px; background: var(--line); }
.tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.tl-meta { font-size: 13px; color: var(--muted); }
.tl-meta strong { color: var(--ink-2); font-weight: 620; }
.tl-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-relance { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 4px 4px 4px 10px; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning); font-size: 13px; font-weight: 560; }
.tl-relance .icon { width: 15px; height: 15px; }
.tl-relance.late { background: var(--danger-soft); color: var(--danger); }
.tl-relance.done { background: var(--success-soft); color: var(--success); padding-right: 10px; }

.contacts { list-style: none; margin: 0; padding: 0; }
.contacts > li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.contacts > li:first-child { border-top: 0; padding-top: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 680; display: grid; place-items: center; flex-shrink: 0; }
.contact-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.contact-lines li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.contact-lines .icon { width: 15px; height: 15px; color: var(--muted); }
.contact-lines a { overflow-wrap: anywhere; }

/* ---------- Documents ---------- */
.chain-slot { min-height: 46px; margin-bottom: 20px; }
.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.chain-step {
  display: inline-flex; flex-direction: column; padding: 5px 12px; line-height: 1.3;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font-size: 12px; color: var(--muted);
}
.chain-step strong { font-size: 13.5px; color: var(--ink); font-weight: 620; }
a.chain-step:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.chain-step.current { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.chain-step.current strong { color: var(--accent-ink); }
.chain-step.todo { border-style: dashed; background: transparent; }
.chain-step.todo strong { color: var(--muted); font-weight: 500; }
.chain-arrow { color: var(--line-strong); display: inline-flex; }
.chain-arrow .icon { width: 16px; height: 16px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.notice > .icon { width: 20px; height: 20px; margin-top: 1px; }
.notice p { margin-top: 2px; }
.notice-success { background: var(--success-soft); border-color: var(--success-line); color: #145a34; }

.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.doc-side { display: grid; gap: 16px; }
.totals-row { display: flex; justify-content: flex-end; margin: 16px 0; }
.totals { min-width: 280px; margin: 0; font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; gap: 32px; padding: 5px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 560; }
.totals .totals-ttc { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.totals .totals-ttc dt { color: var(--ink); font-weight: 650; }
.totals .totals-ttc dd { font-size: 19px; font-weight: 700; }
.doc-notes { border-top: 1px solid var(--line); padding-top: 16px; }
.doc-notes h3 { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.doc-notes p { white-space: pre-wrap; }

.lines-edit { min-width: 660px; }
.lines-edit th, .lines-edit td { padding: 8px 8px; }
.lines-edit th:first-child, .lines-edit td:first-child { padding-left: 12px; }
.lines-edit td { vertical-align: top; }
.lines-edit tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.art-stack { display: grid; gap: 6px; min-width: 220px; }
.lines-edit .c-qte { width: 88px; }
.lines-edit .c-pu { width: 120px; }
.lines-edit .c-rem { width: 88px; }
.lines-edit .c-tot { width: 112px; }
.lines-edit td.c-tot { padding-top: 17px; font-weight: 620; }
.lines-edit .c-del { width: 40px; }
.lines-edit td.c-del { padding-top: 10px; }
.lines-edit input, .lines-edit select { height: 36px; font-size: 14px; }
.lines-edit input[type=number] { text-align: right; -moz-appearance: textfield; appearance: textfield; }
.lines-edit input[type=number]::-webkit-inner-spin-button, .lines-edit input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.add-line { margin-top: 8px; }
.lines-view td:first-child { min-width: 220px; }

.pay-card h2 { margin-bottom: 12px; }
.kv { margin: 0; font-variant-numeric: tabular-nums; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.due { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; }
.due strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.due-late { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.due-ok { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.client-card h2 { margin-bottom: 12px; }
.client-name { display: block; font-size: 16px; font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.client-card address { font-style: normal; color: var(--ink-2); margin-bottom: 8px; }
.client-card .small { margin-top: 8px; }

/* ---------- Stock ---------- */
.stock-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stock-table th { white-space: normal; vertical-align: bottom; min-width: 92px; }
.stock-table th:first-child { min-width: 220px; }
.stock-table tr.is-low td { background: var(--warning-row); }

.stock-table tr.is-selected td { background: var(--accent-soft); }

.stock-table tr:focus-visible { outline-offset: -2px; }
.history { position: sticky; top: calc(var(--banner-h) + 16px); max-height: calc(100vh - var(--banner-h) - 32px); overflow-y: auto; }
.history .card-head h2 { font-size: 15px; }
.moves { list-style: none; margin: 0; padding: 0; }
.move { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.move-qty { min-width: 64px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.move-qty.plus { color: var(--success); }
.move-qty.minus { color: var(--danger); }
.move-body { min-width: 0; flex: 1; }
.move-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; font-weight: 560; }
.move-prod { margin-top: 4px; font-size: 13px; font-weight: 560; }
.move-why { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.move-meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------- Produits ---------- */
tr.is-off td { color: var(--muted); }

/* ---------- Mes données ---------- */
.hero { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.hero-icon { display: grid; place-items: center; flex-shrink: 0; margin-top: 4px; color: var(--muted); }
.hero-icon .icon { width: 22px; height: 22px; }
.hero h1 { font-size: 24px; letter-spacing: -.01em; color: var(--ink); margin-bottom: 6px; }
.hero p { max-width: 700px; color: var(--ink-2); font-size: 15.5px; }
.export-main { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.export-main p { max-width: 440px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.export-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.export-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.export-item:hover { border-color: var(--accent-line); background: var(--surface-2); text-decoration: none; }
.export-item strong { font-weight: 620; font-size: 14px; }
.export-icon { display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.export-dl { margin-left: auto; color: var(--muted); display: inline-flex; }
.export-item:hover .export-dl { color: var(--accent); }
.lead { max-width: 760px; color: var(--ink-2); margin-bottom: 24px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: etape; display: grid; gap: 24px; }
.steps > li { position: relative; min-width: 0; padding-left: 32px; counter-increment: etape; }
.steps > li::before {
  content: counter(etape); position: absolute; left: 0; top: -2px;
  width: 20px; color: var(--accent); font-weight: 600; font-size: 15px; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 15px; margin-bottom: 4px; }
.code-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.code-line code, .code-block pre {
  font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.code-line code { flex: 1 1 320px; min-width: 0; padding: 8px 12px; overflow-x: auto; white-space: nowrap; }
.code-block { margin-top: 8px; display: grid; gap: 8px; justify-items: start; }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; max-width: 100%; width: 100%; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 560; width: fit-content; border-radius: 4px; }
.examples { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.examples li { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }

/* ---------- Notifications ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toasts[popover] { inset: auto 24px 24px auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
.toasts[popover]:not(:popover-open) { display: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 14px;
  background: #23263a; color: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 14px; animation: toast-in .18s ease-out; transition: opacity .18s, transform .18s;
}
.toast-text { flex: 1; padding-top: 5px; }
.toast-icon { display: inline-grid; place-items: center; height: 30px; }
.toast-success .toast-icon { color: #7dd8a8; }
.toast-error { background: #fff; color: var(--ink); border: 1px solid var(--danger-line); box-shadow: var(--shadow-lg); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: #9fcfc8; }
.toast-close { color: rgba(255, 255, 255, .7); }
.toast-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.toast-error .toast-close { color: var(--muted); }
.toast-error .toast-close:hover { background: var(--hover); color: var(--ink); }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Fenêtres ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface); }
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(20, 32, 30, .38); }
.dialog[open] { animation: dialog-in .16s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 0 24px; }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 16px 24px 20px; max-height: calc(100vh - 200px); overflow-y: auto; }
.dialog-text { color: var(--ink-2); margin-bottom: 16px; }
.dialog-body > .dialog-text:last-child { margin-bottom: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }

/* ---------- Feuille imprimable (cachée à l'écran) ---------- */
.print-sheet { display: none; color: #111; font-size: 10.5pt; line-height: 1.45; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24pt; padding-bottom: 12pt; margin-bottom: 18pt; border-bottom: 2px solid #283595; }
.ps-logo { display: block; width: 46mm; height: auto; margin-bottom: 4pt; }
.ps-from p { margin-top: 6pt; color: #444; font-size: 9.5pt; }
.ps-doc { text-align: right; }
.ps-doc h1 { font-size: 17pt; text-transform: uppercase; letter-spacing: .04em; color: #283595; margin-bottom: 4pt; }
.ps-doc p { margin: 1pt 0; }
.ps-client { margin: 0 0 20pt auto; width: 48%; padding: 10pt 12pt; border: 1px solid #c9cfcd; border-radius: 4pt; }
.ps-client p { margin: 0; }
.ps-label { font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; color: #666; margin-bottom: 4pt !important; }
.ps-name { font-weight: 700; font-size: 12pt; }
.ps-muted { color: #666; font-size: 9pt; }
.ps-lines { width: 100%; border-collapse: collapse; }
.ps-lines th { background: #eceefa; text-align: left; font-size: 9pt; font-weight: 700; padding: 6pt 8pt; border-bottom: 1.5px solid #283595; }
.ps-lines td { padding: 6pt 8pt; border-bottom: 1px solid #dde2e0; vertical-align: top; }
.ps-lines tr { break-inside: avoid; }
.print-sheet .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-totals { margin: 12pt 0 0 auto; min-width: 46%; border-collapse: collapse; font-variant-numeric: tabular-nums; break-inside: avoid; }
.ps-totals th { text-align: left; font-weight: 500; color: #444; padding: 3pt 8pt; }
.ps-totals td { text-align: right; padding: 3pt 8pt; }
.ps-totals .ps-ttc th, .ps-totals .ps-ttc td { font-weight: 700; color: #111; font-size: 11.5pt; border-top: 1px solid #111; padding-top: 5pt; }
.ps-notes { margin-top: 18pt; white-space: pre-wrap; break-inside: avoid; }
.ps-sign { margin-top: 24pt; break-inside: avoid; }
.ps-sign div { height: 64pt; width: 55%; border: 1px dashed #aaa; border-radius: 4pt; }
.ps-foot { margin-top: 28pt; padding-top: 8pt; border-top: 1px solid #dde2e0; font-size: 8.5pt; color: #666; }

@page { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  body { background: #fff; }
  .demo-banner, .sidebar, .toasts, .skip-link, .screen-only, .dialog { display: none !important; }
  .layout { display: block; min-height: 0; }
  .main { padding: 0; }
  .page { max-width: none; }
  .print-sheet { display: block; }
}
/* Aperçu à l'écran des mêmes règles (vérification sans ouvrir la boîte d'impression). */
body.print-preview { background: #e4e8e7; }
body.print-preview .demo-banner, body.print-preview .sidebar, body.print-preview .toasts, body.print-preview .screen-only { display: none !important; }
body.print-preview .layout { display: block; }
body.print-preview .print-sheet { display: block; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm; background: #fff; box-shadow: var(--shadow-lg); }

/* ---------- Écrans moyens ---------- */
/* Devis en brouillon : l'éditeur de lignes prend toute la largeur tant que l'écran est étroit. */
@media (max-width: 1399px) {
  .doc-grid-edit { grid-template-columns: minmax(0, 1fr); }
  .doc-grid-edit .doc-side { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 1599px) {
  .stock-layout { grid-template-columns: minmax(0, 1fr); }
  .history { position: static; max-height: none; scroll-margin-top: calc(var(--banner-h) + 16px); }
}
@media (max-width: 1040px) {
  .main { padding: 24px 24px 56px; }
  .doc-grid, .client-grid, .client-top { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > :first-child { grid-row: auto; }
  .mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Téléphone : menu en bas ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .demo-banner { font-size: 12.5px; gap: 6px; padding: 0 12px; }
  .demo-sub { display: none; }
  .demo-reset { height: 30px; margin-left: 0; padding-inline: 10px; }
  .layout { display: block; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40; height: auto;
    padding: 4px 12px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(20, 24, 45, .06);
  }
  .brand { display: none; }
  .nav { grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; gap: 2px; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; justify-content: center; text-align: center; }
  .nav .icon { width: 22px; height: 22px; }
  .nav-label { display: none; }
  .nav-short { display: block; }
  .main { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); margin: 0; border: 0; border-radius: 0; min-height: 0; }
  .page-head { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 16px; }
  .card-flush, .dash-card { padding: 0; }
  .card-head.pad, .pad { padding: 14px 16px; }
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 16px; }
  .kpi { padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
  .kpi-value { font-size: 20px; grid-row: span 2; text-align: right; }
  .mini-kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mini-kpis .kpi-value { font-size: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .list-item, .list-link { padding: 12px 16px; }
  .dash-head { padding: 12px 16px; }
  .quick-row .field { width: 100%; }
  .quick-row [type=submit] { width: 100%; margin-left: 0; }
  .toasts, .toasts[popover] { inset: auto 16px calc(80px + env(safe-area-inset-bottom)) 16px; max-width: none; }
  .hero { padding: 0; }
  .hero-icon { display: none; }
  .hero h1 { font-size: 22px; }
  .totals { min-width: 0; width: 100%; }
  .doc-page .page-actions .btn { flex: 1 1 auto; }
  .move { padding: 12px 16px; }
  .lines-view td:first-child { min-width: 160px; }
  /* Stock : la colonne produit reste visible pendant le défilement horizontal. */
  .stock-table th:first-child, .stock-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 150px; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .stock-table th:first-child, .stock-table tfoot td:first-child { background: var(--surface-2); }
  .stock-table tr.is-low td:first-child { background: var(--warning-row); }
  .stock-table tr.is-selected td:first-child { background: var(--accent-soft); }
  .dialog-body { padding: 16px; }
  .dialog-head { padding: 16px 16px 0; }
  .dialog-foot { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Dictée d'un devis */
.dictee { display: grid; gap: 14px; }
.dictee-micro { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-weight: 650; cursor: pointer; }
.dictee-micro .icon { width: 22px; height: 22px; }
.dictee-micro.is-on { background: var(--accent); color: #fff; animation: dictee-pulse 1.4s ease-in-out infinite; }
@keyframes dictee-pulse { 50% { box-shadow: 0 0 0 8px rgba(40, 53, 149, .15); } }
@media (prefers-reduced-motion: reduce) { .dictee-micro.is-on { animation: none; } }
.dictee-apercu { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.dictee-lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dictee-lignes li { display: flex; justify-content: space-between; gap: 12px; }
.dictee-total { text-align: right; }
.dictee-micro[hidden] { display: none; }
.reappro { margin-bottom: 16px; }
.reappro .card-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.reappro-titre { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.reappro .list-side.row-gap { flex-direction: row; align-items: center; }

/* Tarifs */
.prix-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.prix-carte { display: flex; flex-direction: column; gap: 8px; }
.prix-carte h2 { font-size: 20px; }
.prix-tag { color: var(--muted); font-size: 14px; }
.prix-montant { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 4px; }
.prix-montant strong { font-size: 34px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.prix-montant span { color: var(--ink-2); }
.prix-aussi { color: var(--muted); font-size: 14px; }
.prix-points { list-style: none; margin: 8px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.prix-points li, .prix-inclus li { display: flex; gap: 8px; align-items: flex-start; }
.prix-points .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--success); }
.prix-puis { margin-top: auto; padding-top: 12px; color: var(--ink-2); font-size: 14px; }
.prix-inclus { margin-bottom: 16px; }
.prix-inclus ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.prix-inclus .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }
.prix-suite { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; color: var(--ink-2); }
.prix-suite .icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
@media (max-width: 860px) { .prix-grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .prix-inclus ul { grid-template-columns: minmax(0, 1fr); } }

/* Comparatif des logiciels (page Tarifs) : une carte par logiciel (prix, jauge des besoins couverts), puis le détail en signes. */
.prix-comparatif .card-head { margin-bottom: 14px; }
.cmp-cartes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cmp-carte { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cmp-carte-eka { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cmp-carte h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.cmp-carte h3 span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cmp-prix { display: grid; gap: 2px; margin: 0; }
.cmp-prix strong { font-size: 17px; color: var(--ink); }
.cmp-prix span { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.cmp-jauge { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; margin-top: auto; }
.cmp-jauge i { height: 8px; border-radius: 2px; }
.cmp-jauge .cmp-o { background: var(--success); }
.cmp-jauge .cmp-p { background: #e0a62e; }
.cmp-jauge .cmp-n, .cmp-jauge .cmp-i { background: var(--line-strong); }
.cmp-score { margin: 0; font-size: 13px; color: var(--ink-2); }
.cmp-score strong { font-size: 15px; color: var(--ink); }
.cmp-manque { display: none; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.cmp-detail { margin-top: 16px; }
.cmp-table th, .cmp-table td { vertical-align: middle; }
.cmp-table thead th { text-align: center; }
.cmp-table thead th:first-child, .cmp-table tbody th[scope="row"] { text-align: left; }
.cmp-table tbody th[scope="row"] { font-weight: 500; color: var(--ink); }
.cmp-table td { text-align: center; }
.cmp-table .cmp-eka { background: var(--accent-soft); }
.cmp-table thead .cmp-eka { color: var(--accent-ink); }
.cmp-etat .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.cmp-etat { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 800; line-height: 1; vertical-align: middle; cursor: help; }
.cmp-o { background: var(--success-soft); color: var(--success); }
.cmp-p { background: var(--warning-soft); color: var(--warning); }
.cmp-n { background: var(--danger-soft); color: var(--danger); }
.cmp-i { background: var(--hover); color: var(--muted); }
.cmp-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; color: var(--ink-2); }
.cmp-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legende .cmp-etat { width: 20px; height: 20px; cursor: default; }
.cmp-pourquoi { margin: 14px 0 6px; color: var(--ink-2); }
@media (max-width: 1100px) { .cmp-cartes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cmp-cartes { grid-template-columns: minmax(0, 1fr); }
  .cmp-detail, .cmp-legende { display: none; }
  .cmp-manque { display: block; }
}
.cell-sub .late-text { font-family: var(--font); }
.notice-info { background: var(--info-soft); border-color: #c9dbf0; color: var(--info); }
.ia-titre { font-size: 16px; margin: 4px 0 2px; }
.ia-card > .muted.small { margin-bottom: 16px; }
.ia-autres { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.ia-autres > p { margin-top: 12px; }

/* ---------- Visuels (01/11) : chiffres, barres, jauges ; le détail au survol ---------- */
:root {
  --viz-1: #4655c4;            /* bleu (Rennes, stock correct) — palette validée (dataviz, 01/11) */
  --viz-2: #1fa8a5;            /* turquoise (atelier) */
  --viz-3: #dd8f2c;            /* ambre (injecteur, stock bas) */
}
.kpi-note .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; margin-top: 10px; }
.bar-col { position: relative; display: grid; grid-template-rows: 40px auto; }
.bar { align-self: end; display: block; border-radius: 4px 4px 0 0; background: var(--accent-line); transition: background .15s; }
.bar-col.is-now .bar { background: var(--accent); }
.bar-col:not(.is-future):hover .bar { background: var(--viz-1); }
.bar-col.is-future::before { content: ""; position: absolute; left: 0; right: 0; top: 38px; height: 2px; border-radius: 2px; background: var(--line); }
.bar-lbl { margin-top: 4px; font-size: 10.5px; line-height: 1; color: var(--muted); text-align: center; text-transform: uppercase; }
.bar-col[data-tip]:not([data-tip=""]):hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  padding: 4px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none;
}
.bar-col:first-child[data-tip]:hover::after { left: 0; transform: none; }
.bar-col:last-child[data-tip]:hover::after, .bar-col:nth-last-child(2)[data-tip]:hover::after { left: auto; right: 0; transform: none; }

.list-text.one-line { -webkit-line-clamp: 1; }
.list-side-row { flex-direction: row; align-items: center; gap: 10px; }
.btn-round { width: 32px; height: 32px; padding: 0; flex-shrink: 0; }
.btn-round .icon { width: 16px; height: 16px; }
.list-center { align-items: center; }
.list-center .list-main, .list-row .list-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-center .obs-dot { margin-top: 0; }
.list-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.list-row { display: flex; align-items: baseline; gap: 12px; }
.qty { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; color: var(--ink); }
.qty small { margin-left: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.qty.warn { color: var(--warning); }
.when .icon { width: 14px; height: 14px; vertical-align: -2px; }

.jauge { position: relative; display: block; height: 8px; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.jauge-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--pill); background: var(--viz-1); }
.jauge.is-low .jauge-fill { background: var(--viz-3); }
.jauge-seuil { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }

.dash-total { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.big-amount { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.split { grid-column: 1 / -1; display: flex; gap: 2px; height: 8px; margin-top: 10px; }
.split > span { min-width: 6px; border-radius: var(--pill); }
.split-late, .key-late { background: var(--danger); }
.split-soon, .key-soon { background: var(--accent-line); }
.split-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.key { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }

/* Clients : cartes */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cl-card { display: grid; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); min-width: 0; }
.cl-card:hover { border-color: var(--accent-line); background: #fbfbfd; text-decoration: none; }
.cl-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.cl-name { flex: 1; min-width: 0; }
.cl-name strong { display: block; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-name .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-chip { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); }
.rel-chip.late { background: var(--danger-soft); }
.rel-chip.today { background: var(--accent-soft); }
.cl-ca { display: flex; align-items: center; gap: 12px; }
.ca-bar { flex: 1; height: 8px; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.ca-bar > span { display: block; height: 100%; border-radius: var(--pill); background: var(--viz-1); }
.cl-last { display: flex; align-items: center; gap: 6px; }
.cl-last .icon, .kpi-label .icon { width: 14px; height: 14px; vertical-align: -2px; }

/* Fiche client : coordonnées en icônes */
.client-top { grid-template-columns: minmax(0, 1fr) 460px; }
.client-top .mini-kpis { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.client-top .info-card { align-self: stretch; }
.info-icons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; }
.info-icons li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.info-icons li > .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); flex-shrink: 0; }
.info-icons .span-all { grid-column: 1 / -1; }
.field-icon { flex-direction: row; align-items: center; gap: 8px; }
.field-icon > .icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.quick-row .field-icon { width: auto; }
.quick-dates { padding-bottom: 6px; }
.tl-relance .btn-round { width: 26px; height: 26px; }
.doc-cell { display: flex; align-items: center; gap: 8px; }
.doc-cell .obs-dot { margin-top: 0; }

/* Ventes : la chaîne des ventes, qui sert de filtre */
.pipeline { display: flex; align-items: stretch; gap: 4px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.pipeline::-webkit-scrollbar { display: none; }
.pipe { flex: 1 1 0; min-width: 118px; display: grid; gap: 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); }
.pipe:hover { border-color: var(--accent-line); background: #fbfbfd; text-decoration: none; }
.pipe.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pipe-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; color: var(--muted); }
.pipe-head .icon { width: 16px; height: 16px; }
.pipe.active .pipe-head { color: var(--accent-ink); }
.pipe-count { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pipe-amount { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pipe-arrow { display: grid; place-items: center; color: var(--line-strong); flex-shrink: 0; }
.pipe-arrow .icon { width: 16px; height: 16px; }
.filter .icon { width: 14px; height: 14px; }
.badges { display: inline-flex; align-items: center; gap: 4px; }
.badges .badge .icon { width: 13px; height: 13px; }
.table tr.is-late td { background: #fdf6f5; }

/* Stock : barres empilées par lieu */
.stock-sum { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 24px; margin-bottom: 16px; padding: 16px 20px; }
.stock-sum-total { display: inline-flex; align-items: baseline; gap: 6px; grid-row: span 2; }
.stock-sum-total strong { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stock-sum-total .badge { align-self: center; margin-left: 4px; }
.stock-sum-total .badge .icon { width: 13px; height: 13px; margin-right: 3px; }
.lieux-bar { position: relative; display: block; height: 10px; border-radius: var(--pill); background: var(--surface-2); }
.stack-fill { display: flex; gap: 2px; height: 100%; }
.stack-fill > span { min-width: 3px; height: 100%; }
.stack-fill > span:first-child { border-radius: var(--pill) 0 0 var(--pill); }
.stack-fill > span:last-child { border-radius: 0 var(--pill) var(--pill) 0; }
.stack-fill > span:only-child { border-radius: var(--pill); }
.lieux-bar .jauge-seuil { top: -4px; bottom: -4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.legend strong { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }
.stock-table .stock-bar-col { width: 46%; min-width: 160px; }
.stock-table td.num .icon { width: 14px; height: 14px; vertical-align: -2px; }
.en-commande { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; color: var(--success); font-family: var(--font); }
.en-commande .icon { width: 13px; height: 13px; }
.reappro-titre .icon { width: 14px; height: 14px; vertical-align: -2px; }
.histo-lieux { margin-top: -4px; }
.move { align-items: baseline; }
.move-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.move-meta .key { margin-right: 2px; }

/* Produits : pastille de couleur, jauge de stock */
.prod-cell { display: flex; align-items: center; gap: 12px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(20, 24, 45, .18); }
.swatch.is-clear { background: repeating-conic-gradient(#e6e8ef 0 25%, #fff 0 50%) 50% / 8px 8px; }
.swatch.is-custom { background: conic-gradient(#4655c4, #1fa8a5, #e8c22e, #dd8f2c, #c62f2f, #4655c4); }
.prod-stock { display: grid; grid-template-columns: minmax(60px, 1fr) 56px; align-items: center; gap: 12px; }
.prod-stock .qty { text-align: right; }

/* Mes données : promesses en icônes, chemin ChatGPT en étapes */
.promesses { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.promesses li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 560; }
.promesses .icon { width: 16px; height: 16px; color: var(--accent); }
.ia-promesses { margin: 0 0 20px; }
.ia-promesses li { background: var(--surface-2); }
.export-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.chemin { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 8px; color: var(--ink-2); }
.chemin > span { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.chemin .icon { width: 12px; height: 12px; color: var(--muted); }

.show-sm { display: none; }
.doc-id { min-width: 0; }
.doc-id .mono { white-space: nowrap; }
.btn-primary .count { background: rgba(255, 255, 255, .2); color: #fff; }
/* Tarifs : le marché seul (sans EKA), avant les formules */
.marche { margin-bottom: 16px; }
.marche-suite { justify-content: flex-end; }
.marche-liste { list-style: none; margin: 0; padding: 0; }
.marche-ligne { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.2fr) minmax(180px, 1.6fr) minmax(200px, 1.7fr); align-items: center; gap: 8px 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.marche-entete { padding: 0 0 8px; border-top: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.marche-ligne.is-actuel { margin: 0 -12px; padding-inline: 12px; border-radius: var(--radius); background: var(--accent-soft); border-top-color: transparent; }
.marche-ligne.is-actuel + .marche-ligne { border-top-color: transparent; }
.marche-nom strong, .marche-mois strong { display: block; font-weight: 650; color: var(--ink); }
.marche-nom span, .marche-mois span { display: block; font-size: 12.5px; color: var(--muted); }
.marche-mois strong { font-variant-numeric: tabular-nums; }
.marche-3ans { display: grid; gap: 4px; }
.marche-barre { display: flex; gap: 2px; height: 8px; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.marche-barre > span { height: 100%; }
.mb-min { background: var(--viz-1); border-radius: var(--pill) 0 0 var(--pill); }
.mb-min:last-child { border-radius: var(--pill); }
.mb-max { background: var(--accent-line); border-radius: 0 var(--pill) var(--pill) 0; }
.mb-plus { width: 18px; border-radius: 0 var(--pill) var(--pill) 0; background: repeating-linear-gradient(90deg, var(--viz-1) 0 3px, transparent 3px 6px); opacity: .55; }
.marche-total { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.marche-manque { display: flex; flex-wrap: wrap; gap: 6px; }
.manque { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: var(--pill); background: var(--danger-soft); color: var(--danger); font-size: 12.5px; font-weight: 560; }
.manque .icon { width: 12px; height: 12px; }
.marche-note { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; color: var(--ink-2); font-size: 13.5px; }
.marche-note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--success); flex-shrink: 0; }
.marche-note strong { color: var(--ink); }
.marche-conclusion { margin: 16px 0 8px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); }
.marche-conclusion strong { color: var(--ink); }

/* Le marché : une ligne qui s'ouvre sur le détail de l'offre */
.marche-liste > li { list-style: none; }
.marche-item > summary { list-style: none; cursor: pointer; }
.marche-item > summary::-webkit-details-marker { display: none; }
.marche-item > summary:hover { background: #fbfbfd; }
.marche-item > summary:focus-visible { outline: 2px solid var(--brand-2-ink); outline-offset: 2px; border-radius: var(--radius); }
.marche-ligne { grid-template-columns: minmax(120px, .9fr) minmax(170px, 1.3fr) minmax(170px, 1.4fr) minmax(190px, 1.6fr) 20px; }
.marche-ouvrir { color: var(--muted); transition: transform .15s; }
.marche-ouvrir .icon { width: 16px; height: 16px; }
.marche-item[open] .marche-ouvrir { transform: rotate(90deg); }
.marche-mois .marche-offre { color: var(--ink-2); font-weight: 560; }
.marche-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; padding: 4px 0 16px; }
.md-col h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.md-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.md-col li { display: flex; gap: 6px; align-items: flex-start; }
.md-col li .icon { width: 14px; height: 14px; margin-top: 3px; flex-shrink: 0; }
.md-ok .icon { color: var(--success); }
.md-plus .icon { color: var(--warning); }
.md-non .icon { color: var(--danger); }
.marche-item.is-actuel > summary { margin: 0 -12px; padding-inline: 12px; border-radius: var(--radius); background: var(--accent-soft); border-top-color: transparent; }
.marche-liste > li:first-child .marche-ligne { border-top-color: transparent; }
.marche-item[open] > .marche-detail { border-top: 1px dashed var(--line); padding-top: 12px; }
@media (max-width: 1040px) {
  .client-top { grid-template-columns: minmax(0, 1fr); }
  .marche-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .marche-entete, .marche-ouvrir { display: none; }
  .marche-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { padding-inline: 4px; }
  .nav { gap: 0; }
  .nav a { padding-inline: 0; font-size: 10.5px; letter-spacing: -.01em; }
  .marche-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-areas: "nom mois" "ans ans" "manque manque"; gap: 8px 12px; }
  .marche-nom { grid-area: nom; } .marche-mois { grid-area: mois; text-align: right; } .marche-3ans { grid-area: ans; } .marche-manque { grid-area: manque; }
  .show-sm { display: block; }
  .prod-stock { grid-template-columns: 72px; gap: 6px; }
  .prod-stock .qty { order: -1; }
  .cell-sub .show-sm { font-family: var(--font); }
  .stock-bar-sm { margin-top: 8px; }
  .stock-table th:first-child, .stock-table td:first-child { min-width: 200px; }
  .stock-sum { grid-template-columns: minmax(0, 1fr); }
  .stock-sum-total { grid-row: auto; }
  .stock-table .stock-bar-col { min-width: 120px; }
  .pipe { min-width: 104px; padding: 10px 12px; }
  .pipe-count { font-size: 20px; }
  .pipe-arrow { display: none; }
  .client-top .mini-kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi-chart .bars { grid-column: 1 / -1; }
  .dash-total { padding: 14px 16px 12px; }
}
