/* 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; }
/* Choix à options (Ventes › Export comptable) ; Réglages : sous-formulaires, mention obligatoire, pied de page en aperçu. */
.field-radio { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.field-radio input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.field-radio small { display: block; color: var(--muted); font-size: 13px; }
.stack > .subform { min-width: 0; }
.reglages .subform + .subform { margin-top: 16px; }
.reglages .field-help { margin: 0; }
.reg-oblig { color: var(--danger); text-decoration: none; border: 0; cursor: help; }
.reg-apercu p { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.reg-numeros .mono { white-space: nowrap; }
.reg-aide-numero { margin-top: 12px; }
.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; }
.aide-references { margin-top: 10px; }
.refs-card .card-head { margin-bottom: 8px; }
.refs { margin: 0; }
.refs > div { padding: 6px 0; }
.refs > div + div { border-top: 1px solid var(--line); }
.refs dt { font-size: 12.5px; color: var(--muted); }
.refs dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.refs-multi { white-space: pre-line; }
.refs-card .small { margin-top: 6px; }

/* ---------- 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-warning .toast-icon { color: #f2c46d; }
.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; }
/* Client à droite ; adresse de livraison à sa gauche quand la pièce en a une. */
.ps-parties { display: flex; justify-content: flex-end; gap: 4%; margin-bottom: 20pt; break-inside: avoid; }
.ps-client { width: 48%; padding: 10pt 12pt; border: 1px solid #c9cfcd; border-radius: 4pt; }
.ps-client p { margin: 0; }
.ps-objet { margin: 0 0 12pt; white-space: pre-line; }
.ps-desig { white-space: pre-line; }
.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; }
.ps-foot p + p { margin-top: 2pt; }
.ps-legal { margin-top: 6pt !important; color: #444; }
/* Contact commercial et références client (comme sur les pièces Dailybiz), slogan d'EKA en bas à droite. */
.ps-refs { margin: 0 0 14pt; break-inside: avoid; }
.ps-refs > div { display: flex; gap: 6pt; }
.ps-refs > div + div { margin-top: 2pt; }
.ps-refs dt { flex: none; font-weight: 700; }
.ps-refs dd { margin: 0; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ps-slogan { margin-top: 8pt !important; text-align: right; color: #283595; font-size: 10pt; font-weight: 600; font-style: italic; }

@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(9, 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; }
}

.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; }
}

/* ---------- Documents (dossiers) : rubriques, recherche dans le texte, dates de fin, accès ---------- */
.dos-actions { align-items: center; }
.dos-voir { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 3px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 560; white-space: nowrap; }
.dos-voir .icon { width: 16px; height: 16px; color: var(--muted); }
.dos-voir select { width: auto; min-width: 0; max-width: 240px; height: 28px; padding: 0 28px 0 10px; border: 0; border-radius: var(--pill); background-color: var(--surface-2); background-position: right 8px center; font-size: 13.5px; font-weight: 620; color: var(--ink); }
.dos-vue { margin-bottom: 16px; }
.dos-toolbar .dos-recherche { max-width: 560px; }
.dos-filtre { position: relative; flex: 0 1 300px; min-width: 0; }
.dos-filtre > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.dos-filtre select { height: 40px; padding-left: 36px; text-overflow: ellipsis; }

.dos-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 16px; align-items: start; }
.dos-rubriques { position: sticky; top: calc(var(--banner-h) + 16px); min-width: 0; }
.dos-rub-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dos-rub-ligne { display: flex; align-items: center; gap: 2px; min-width: 0; }
.dos-rub { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid transparent; border-radius: 18px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 520; text-align: left; cursor: pointer; }
.dos-rub:hover { background: var(--hover); color: var(--ink); }
.dos-rub[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.dos-rub .icon { width: 17px; height: 17px; color: var(--muted); }
.dos-rub[aria-pressed="true"] .icon { color: var(--accent); }
.dos-rub-nom { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.dos-rub .count { flex-shrink: 0; }
.dos-rub.is-cachee, .dos-rub.is-cachee:hover { cursor: default; background: transparent; color: var(--muted); }
.dos-renommer { width: 30px; height: 30px; flex-shrink: 0; }
.dos-renommer .icon { width: 16px; height: 16px; }
.dos-nouvelle { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0 6px; padding: 6px 8px; }
.dos-nouvelle .icon { width: 15px; height: 15px; }

.dos-liste-head { border-bottom: 1px solid var(--line); }
.dos-liste-head h2 { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.dos-items { list-style: none; margin: 0; padding: 0; }
.dos-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dos-item:last-child { border-bottom: 0; }
.dos-item:hover { background: #f8f9fb; }
.dos-type { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.dos-type .icon { width: 18px; height: 18px; }
.dos-corps { flex: 1; min-width: 0; }
.dos-nom { display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font-size: 14.5px; font-weight: 620; line-height: 1.4; text-align: left; overflow-wrap: anywhere; cursor: pointer; border-radius: 4px; }
.dos-nom:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dos-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-top: 2px; color: var(--muted); font-size: 13px; min-width: 0; }
.dos-meta > span { min-width: 0; overflow-wrap: anywhere; }
.dos-lien { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 560; }
.dos-lien .icon { width: 14px; height: 14px; color: var(--muted); }
.dos-lien:hover { color: var(--accent); }
.dos-extrait { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
mark { padding: 0 1px; border-radius: 2px; background: #fcefb4; color: inherit; }
.dos-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex-shrink: 0; max-width: 45%; padding-top: 2px; }
.badge-ic { gap: 4px; }
.badge-ic .icon { width: 13px; height: 13px; }

.dos-envoi { display: grid; gap: 10px; margin-bottom: 16px; padding: 14px 20px; }
.dos-envoi-ligne { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dos-envoi-ligne strong { flex-shrink: 0; font-weight: 620; }
.dos-envoi-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dos-spin { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: dos-tourne .8s linear infinite; }
@keyframes dos-tourne { to { transform: rotate(360deg); } }
.dos-envoi-barre { display: block; height: 6px; overflow: hidden; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.dos-envoi-barre > span { display: block; height: 100%; border-radius: var(--pill); background: var(--brand-2); transition: width .2s; }

.dos-proposes { margin-bottom: 16px; padding: 16px 20px 4px; border-color: var(--accent-line); }
.dos-proposes .card-head { align-items: center; margin-bottom: 8px; }
.dos-prop-liste { list-style: none; margin: 0; padding: 0; }
.dos-prop { display: flex; align-items: flex-start; gap: 12px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.dos-prop-main { flex: 1; min-width: 0; }
.dos-prop-nom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dos-prop-nom strong { min-width: 0; font-weight: 620; overflow-wrap: anywhere; }
.dos-prop-nom .icon { color: var(--muted); }
.dos-prop-rangement { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dos-prop-rangement > span { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 580; overflow-wrap: anywhere; }
.dos-prop-rangement .icon { width: 14px; height: 14px; }
.dos-raisons { display: grid; gap: 2px; margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.dos-prop-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Fenêtre d'un document : l'aperçu à gauche (ordinateur, PDF et images), le rangement à droite. */
.dialog-xl { width: min(1100px, calc(100vw - 32px)); }
.dos-fenetre .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.dos-detail.has-apercu { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.dos-apercu { height: min(66vh, 760px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.dos-apercu iframe { display: block; width: 100%; height: 100%; border: 0; }
.dos-apercu img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dos-detail-corps { display: grid; gap: 16px; min-width: 0; }
.dos-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 13.5px; }
.dos-suppr { color: var(--danger); }
.dos-suppr:hover { background: var(--danger-soft); }
.dos-pourquoi { margin: 0; }
.dos-pourquoi .dos-raisons { color: var(--info); }
.dos-aide { grid-column: 1 / -1; }
.dos-relie { margin-top: 4px; }
.dos-relie .form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.dos-texte summary { width: fit-content; color: var(--accent); font-size: 13.5px; font-weight: 560; cursor: pointer; border-radius: 4px; }
.dos-texte p { max-height: 180px; margin-top: 8px; padding: 10px 12px; overflow-y: auto; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

.dos-acces + .dos-acces { margin-top: 12px; }
.dos-acces-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.dos-case { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 14px; cursor: pointer; }
.dos-case input { width: 18px; height: 18px; flex-shrink: 0; }

/* Glisser-déposer : un voile sur toute la page, qui laisse passer les événements. */
.dos-depot { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(40, 53, 149, .12); pointer-events: none; }
.dos-depot[hidden] { display: none; }
.dos-depot > div { display: grid; justify-items: center; gap: 6px; max-width: 420px; padding: 32px 40px; border: 2px dashed var(--accent); border-radius: var(--radius-sheet); background: var(--surface); text-align: center; box-shadow: var(--shadow-lg); }
.dos-depot .icon { width: 32px; height: 32px; color: var(--accent); }
.dos-depot strong { font-size: 18px; }
.dos-depot span { color: var(--muted); }

/* Ailleurs : fiche client, produits, tableau de bord */
.doc-chip { display: inline-flex; align-items: center; gap: 3px; height: 20px; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; vertical-align: 1px; }
.doc-chip .icon { width: 12px; height: 12px; }
.doc-chip:hover { border-color: var(--accent-line); color: var(--accent); text-decoration: none; }
.list-center .badge { flex-shrink: 0; }
.fic-list .list-center .list-main { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dash-sous { display: flex; align-items: center; gap: 6px; margin: 0; padding: 12px 20px 4px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-sous .icon { width: 14px; height: 14px; }
.dash-sous .count { margin-left: 2px; }
/* Avec les documents à renouveler, la carte des relances s'allonge : elle couvre trois cartes de la colonne de droite au lieu de deux. */
@media (min-width: 1041px) { .dash-grid.has-echeances > :first-child { grid-row: span 3; } }

@media (max-width: 1040px) {
  .dos-layout { grid-template-columns: minmax(0, 1fr); }
  .dos-rubriques { position: static; }
  .dos-rub-liste { display: flex; flex-wrap: wrap; gap: 6px; }
  .dos-rub-ligne { flex: 0 1 auto; max-width: 100%; }
  .dos-rub { gap: 6px; padding: 5px 12px; border-color: var(--line-strong); font-size: 13.5px; }
  .dos-rub[aria-pressed="true"] { border-color: var(--accent-line); }
  .dos-rub:not(.is-cachee) .icon { display: none; }
  .dos-rub.is-cachee { border-style: dashed; }
  .dos-rub.is-cachee .icon { width: 14px; height: 14px; }
  .dos-nouvelle { margin: 8px 0 0; }
}
@media (max-width: 760px) {
  .dos-actions { display: flex; flex-wrap: wrap; }
  .dos-voir { flex: 1 1 100%; justify-content: space-between; }
  .dos-voir > span { margin-right: auto; }
  .dos-voir select { max-width: 62%; }
  .dos-actions > .btn { flex: 1 1 0; }
  .dos-toolbar { gap: 8px; }
  .dos-toolbar .dos-recherche, .dos-filtre { flex: 1 1 100%; max-width: none; }
  .dos-item { flex-wrap: wrap; padding: 12px 16px; }
  .dos-badges { order: 3; flex-basis: 100%; max-width: none; justify-content: flex-start; padding: 0 0 0 46px; }
  .dos-proposes { padding: 14px 16px 2px; }
  .dos-prop { flex-direction: column; }
  .dos-prop-actions { width: 100%; }
  .dos-prop-actions .btn { flex: 1 1 0; }
  .dos-acces-grille { grid-template-columns: minmax(0, 1fr); }
  .dos-envoi { padding: 12px 16px; }
  .dash-sous { padding: 12px 16px 4px; }
}
/* Menu du bas : 9 onglets ; sous 400 px, les mots passent à 10 px pour que « Données » tienne dans sa case. */
@media (max-width: 400px) {
  .sidebar { padding-inline: 2px; }
  .nav a { font-size: 10px; letter-spacing: -.015em; }
}

/* Données sensibles reprises de Dailybiz (Mes données › Données sensibles, encart de la fiche client). */
.notice-warning { background: var(--warning-soft); border-color: #efd8a3; color: var(--ink); }
.notice-warning > .icon { color: var(--warning); }
.notice-warning p + p { margin-top: 6px; }
.sens-carte > p, .sens-encart > p { max-width: 680px; margin-bottom: 14px; color: var(--ink-2); font-size: 14px; }
.sens-carte, .sens-nature { margin-bottom: 16px; }
.sens-nature h2 { display: inline-flex; align-items: center; gap: 8px; }
.sens-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 0 20px 16px; }
.sens-intro p { flex: 1 1 320px; max-width: 680px; color: var(--ink-2); font-size: 14px; }
.sens-efface { display: flex; align-items: center; gap: 6px; padding: 0 20px 14px; }
.sens-efface .icon { width: 16px; height: 16px; color: var(--success); }
.sens-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sens-fiche { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.sens-fiche:last-child { border-bottom: 0; }
.sens-nom { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-weight: 600; overflow-wrap: anywhere; }
.sens-nom .cell-sub { display: inline; margin: 0; }
.sens-valeur { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.sens-champ { flex: 0 0 160px; color: var(--muted); font-size: 13px; }
.sens-code { flex: 1 1 160px; min-width: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 13px; letter-spacing: .08em; overflow-wrap: anywhere; }
.sens-code.visible { letter-spacing: 0; color: var(--ink); }
.sens-actions { display: flex; gap: 6px; }
.sens-effacer { color: var(--danger); }
.sens-effacer:hover { background: var(--danger-soft); }
.sens-filtre { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 16px; color: var(--ink-2); }
.sens-filtre .icon { width: 16px; height: 16px; color: var(--muted); }
.sens-pied { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.sens-pied .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
@media (max-width: 760px) {
  .sens-champ { flex-basis: 100%; }
  .sens-intro, .sens-efface, .sens-fiche { padding-inline: 16px; }
  .sens-intro .btn { width: 100%; justify-content: center; }
}

/* ---------- Tableau de bord modulable (19/11) ---------- */
/* Chacun organise le sien : grille de 12 colonnes sur ordinateur (GridStack), widgets empilés sur téléphone.
   Couleurs des graphiques : palette validée (dataviz, 19/11) ; l'an dernier en bleu clair ; « autres » en gris. */
:root {
  --viz-4: #d5578a;            /* rose */
  --viz-5: #7a5bd0;            /* violet */
  --viz-autres: #b4b8c5;       /* « Autres » : toujours gris */
  --viz-comp: #c5cae8;         /* la même période l'an dernier */
}
.tb-page [hidden], .g-bulle[hidden] { display: none !important; }
.tb-barre { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: -8px 0 8px; }
.tb-aide { flex: 1 1 320px; color: var(--muted); font-size: 13px; }
.tb-etat { font-size: 12.5px; color: var(--muted); }
.tb-etat:empty { display: none; }
.tb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tb-page .a-valider { margin-bottom: 16px; }
/* « Préparé par l'IA » : hauteur limitée, la liste défile dedans et ne pousse plus les widgets. */
.a-valider-liste { max-height: min(45vh, 320px); max-height: min(45svh, 320px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tb-grille { margin: 0 -8px; }
.tb-pile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
/* Empilés (tablette, téléphone) : une carte ne dépasse pas 60 % de l'écran, son contenu défile dedans. */
.tb-pile .w { height: auto; max-height: 60vh; max-height: 60svh; }
.tb-pile .w[data-forme="barres"] .w-corps, .tb-pile .w[data-forme="courbe"] .w-corps { height: 230px; }
.tb-pile .w-note .w-corps { height: 160px; }
/* Réglages : le voile reste léger, le widget qui change se voit derrière la fenêtre. */
.tb-reglages::backdrop { background: rgba(20, 32, 30, .14); }

/* Un widget : une carte de la feuille, titre en haut, contenu qui défile si besoin. */
.w { height: 100%; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; container-type: inline-size; }
.grid-stack > .grid-stack-item > .grid-stack-item-content { overflow: visible; }
.w-head { display: flex; align-items: flex-start; gap: 4px; padding: 10px 8px 4px 12px; }
.tb-grille .w-head { cursor: grab; -webkit-user-select: none; user-select: none; }
.w-grip { display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 26px; margin: 0 0 0 -6px; border-radius: 6px; color: var(--muted); opacity: .5; cursor: grab; touch-action: none; }
.w-grip .icon { width: 16px; height: 16px; stroke-width: 2.8; pointer-events: none; }
.w:hover .w-grip, .w-grip:is(:hover, :focus-visible) { opacity: 1; background: var(--hover); }
.w:has(.w-grip:focus-visible) { outline: 2px solid var(--brand-2-ink); outline-offset: 2px; }
.w-titres { flex: 1; min-width: 0; }
.w-titre { display: flex; align-items: center; gap: 6px; min-width: 0; padding-top: 3px; font-size: 14.5px; font-weight: 620; line-height: 1.3; }
.w-titre-texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-titre .count { flex-shrink: 0; }
@container (max-width: 240px) { .w-titre { font-size: 13.5px; } .w-head { padding-right: 4px; } }
.w-meta { margin-top: 1px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-reglages { flex-shrink: 0; width: 30px; height: 30px; margin-top: -2px; }
.w-reglages .icon { width: 17px; height: 17px; }
.w-corps { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 14px 12px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.w.is-chargement .w-corps { opacity: .45; transition: opacity .2s; }
/* Contenu plus long que sa zone : il défile dedans ; un dégradé en bas tant qu'il en reste (dashboard.js, majDefilement). */
.defile-cadre { position: relative; display: flex; flex-direction: column; min-height: 0; }
.defile-cadre::after { content: ""; position: absolute; left: 0; right: 10px; bottom: 0; height: 36px; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--surface) 80%, transparent)); box-shadow: inset 0 -9px 8px -8px rgba(20, 24, 45, .14); pointer-events: none; opacity: 0; transition: opacity .15s; }
.defile-cadre.is-suite::after { opacity: 1; }
[data-defile]:focus-visible { outline: 2px solid var(--brand-2-ink); outline-offset: -2px; }
.w-cadre { flex: 1; }
/* Pied fixe sous la partie qui défile : « Tout voir (N) » ou le lien vers la liste. */
.w-bas { flex: none; padding: 6px 14px 10px; }
.w-bas .w-pied { margin: 0; padding: 0; }
.w.is-nouveau { animation: w-nouveau 1.8s ease-out; }
@keyframes w-nouveau { from { box-shadow: 0 0 0 3px var(--brand-2); } to { box-shadow: 0 0 0 3px transparent; } }

/* Glisser, redimensionner : la carte se soulève, la place d'arrivée est en pointillés, le coin sert de poignée. */
.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content,
.grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content { opacity: 1; box-shadow: none; }
.ui-draggable-dragging .w, .ui-resizable-resizing .w { box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.grid-stack > .grid-stack-placeholder > .placeholder-content { background: var(--accent-soft); border: 2px dashed var(--accent-line); border-radius: var(--radius-lg); }
.grid-stack-item > .ui-resizable-se { width: 22px; height: 22px; background: none; transform: none; cursor: nwse-resize; }
/* Le coin de redimensionnement : deux traits en équerre (pas une bordure de carte). */
.grid-stack-item > .ui-resizable-se::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-right: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); border-bottom-right-radius: 3px; }
.grid-stack-item:hover > .ui-resizable-se::after, .grid-stack-item > .ui-resizable-se:hover::after { border-color: var(--accent); }
body.tb-glisse, body.tb-glisse * { cursor: grabbing !important; }

/* Contenus */
.w-liste { margin: 0 -14px; }
.w-liste .list-item, .w-liste .list-link { padding: 8px 14px; gap: 10px; }
.w-liste .list-item:has(> .list-link) { padding: 0; }
.w-liste .list-title { font-size: 14px; }
.w-liste .cell-sub.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-liste .list-center .list-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-sous { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.w-sous:first-child { margin-top: 0; }
.w-sous .icon { width: 14px; height: 14px; }
.w-pied { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 560; }
.w-pied .icon { width: 14px; height: 14px; }
.w-pied-liens { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.w-chargement { display: grid; gap: 10px; padding: 8px 0; }
.w-chargement .skel { height: 14px; }
.w-chargement .skel + .skel { width: 70%; }
.w-erreur { color: var(--danger); display: flex; gap: 6px; align-items: center; justify-content: center; }
.g-vide { margin: auto; padding: 12px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* Chiffre */
.w-chiffre { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.g-chiffre { width: fit-content; max-width: 100%; font-size: clamp(19px, 10.5cqi, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
a.g-chiffre:hover { color: var(--accent); text-decoration: none; }
.w-note { color: var(--muted); font-size: 12.5px; }
.g-comp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 4px; font-size: 12.5px; }
.g-comp a { color: var(--ink-2); }
.g-comp strong { color: var(--ink); }
.g-ecart { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-ecart .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.g-comp.hausse .g-ecart { color: var(--success); }
.g-comp.baisse .g-ecart { color: var(--danger); }
a.g-comp-lien { color: var(--muted); }
.w-details { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.w-details a { color: var(--ink-2); }
.w-details strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Part de chaque élément (en retard / à venir) et légendes */
.g-partage { display: flex; gap: 2px; height: 8px; margin-top: 6px; }
.g-partage > span { min-width: 6px; border-radius: var(--pill); }
.g-legende { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 14px; color: var(--muted); font-size: 12.5px; }
.g-legende i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.g-legende a { color: var(--ink-2); }
.g-legende strong { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }
.g-cle-comp { background: var(--viz-comp); }
.g-legende-series { margin-top: 8px; }

/* Barres par mois */
.g-mois-cadre { position: relative; flex: 1; min-height: 110px; display: flex; flex-direction: column; padding-top: 16px; }
.g-axe-max { position: absolute; top: 0; left: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.g-mois { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; border-top: 1px dashed var(--line); }
.g-mois-col { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.g-mois-barres { min-height: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line-strong); }
.g-barre { display: block; flex: 1 1 0; max-width: 30px; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--viz-1); }
.g-barre-comp { background: var(--viz-comp); }
.g-barre:hover, .g-barre:focus-visible { filter: brightness(.82); }
.g-mois-col.is-now .g-mois-lbl { color: var(--ink); font-weight: 650; }
.g-mois-lbl { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.lbl-court { display: none; }
@container (max-width: 560px) { .g-mois-lbl .lbl-long { display: none; } .g-mois-lbl .lbl-court { display: inline; } }

/* Courbe */
.g-courbe-cadre { position: relative; flex: 1; min-height: 110px; display: flex; flex-direction: column; padding: 16px 8px 0; }
.g-courbe { position: relative; flex: 1; min-height: 0; border-bottom: 1px solid var(--line-strong); }
.g-courbe svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g-ligne { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-ligne-comp { fill: none; stroke: var(--viz-comp); stroke-width: 2; stroke-dasharray: 5 4; }
.g-zero { stroke: var(--line); stroke-width: 1; }
.g-point { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--viz-1); }
.g-point::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.g-point-comp { background: var(--viz-comp); }
.g-point:hover, .g-point:focus-visible { transform: scale(1.35); }
.g-courbe-lbl { position: relative; list-style: none; margin: 0; padding: 0; height: 18px; }
.g-courbe-lbl li { position: absolute; top: 4px; transform: translateX(-50%); color: var(--muted); font-size: 11px; white-space: nowrap; }
.g-courbe-lbl li:first-child { transform: none; }
.g-courbe-lbl li:last-child { transform: translateX(-100%); }
.g-courbe-lbl li:only-child { transform: translateX(-50%); }
.g-lbl-cache { display: none; }

/* Barres couchées, classées */
.g-rang { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.g-rang-lien { display: grid; gap: 3px; padding: 1px 0; color: var(--ink); border-radius: 6px; }
.g-rang-lien:hover { text-decoration: none; }
.g-rang-lien:hover .g-rang-nom { color: var(--accent); }
.g-rang-tete { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13px; }
.g-rang-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rang-val { font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-rang-barre { display: block; height: 8px; border-radius: var(--pill); background: var(--surface-2); }
.g-rang-barre > span { display: block; height: 100%; min-width: 2px; border-radius: var(--pill); background: var(--viz-1); }
.g-rang-comp { height: 4px; }
.g-rang-comp > span { background: var(--viz-comp); }
.g-rang-sous { color: var(--muted); font-size: 12px; }

/* Camembert (anneau) et sa légende */
.g-camembert { flex: 1; min-height: 0; display: flex; align-items: center; gap: 16px; }
.g-anneau { position: relative; flex: 0 0 auto; width: clamp(84px, 36cqi, 150px); aspect-ratio: 1; }
.g-anneau svg { display: block; width: 100%; height: 100%; }
.g-anneau path { stroke: var(--surface); stroke-width: .025; }
.g-anneau-centre { position: absolute; inset: 0; display: grid; place-items: center; padding: 24%; font-size: 12.5px; font-weight: 650; line-height: 1.15; text-align: center; font-variant-numeric: tabular-nums; }
.g-legende-parts { flex: 1; min-width: 0; margin: 0; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.g-legende-parts a, .g-part-sans-lien { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 0 4px; color: var(--ink-2); font-size: 12.5px; }
.g-legende-parts i { margin-right: 4px; }
.g-part-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-part-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-part-val small { color: var(--muted); font-size: 11.5px; }
/* Widget étroit : petit anneau, légende sur deux lignes (le nom, puis le montant). */
@container (max-width: 360px) {
  .g-camembert { gap: 10px; }
  .g-anneau { width: 76px; }
  .g-anneau-centre { padding: 20%; font-size: 11px; }
  .g-legende-parts { gap: 2px; }
  .g-legende-parts a, .g-part-sans-lien { grid-template-columns: auto minmax(0, 1fr); line-height: 1.25; font-size: 12px; }
  .g-part-val { grid-column: 2; }
  .g-part-val small { display: none; }
}

/* Tableau */
.g-table-cadre { margin: 0 -14px; overflow: auto; }
.g-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-table th, .g-table td { padding: 6px 14px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.g-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.g-table tbody th { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.g-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-table a { color: var(--ink); }
.g-table a:hover { color: var(--accent); }
.g-table tfoot th, .g-table tfoot td { border-bottom: 0; background: var(--surface-2); font-weight: 650; }
.g-table .hausse { color: var(--success); }
@container (max-width: 460px) { .g-table .col-comp { display: none; } }
.g-table .baisse { color: var(--danger); }

/* Raccourcis, note libre */
.w-raccourcis { flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 6px; }
.w-raccourcis .btn { flex: 1 1 150px; justify-content: flex-start; height: 32px; padding: 0 12px; font-size: 13.5px; }
.w-note-texte { flex: 1; width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface-2); resize: none; line-height: 1.45; }
.w-note-texte:hover { border-color: var(--line); }

/* Infobulle : une seule, au-dessus de tout */
.g-bulle { position: fixed; z-index: 300; max-width: 300px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow-lg); }

/* Fenêtre des réglages d'un widget */
.dialog:modal { overscroll-behavior: contain; }
.dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
.tbr { display: grid; gap: 16px; }
.tbr-aide { color: var(--muted); font-size: 13px; }
.tbr-choix { min-width: 0; margin: 0; padding: 0; border: 0; }
.tbr-choix legend { margin-bottom: 6px; padding: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.tbr-pilules { display: flex; flex-wrap: wrap; gap: 6px; }
.tbr-pilule { position: relative; }
.tbr-pilule input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tbr-pilule span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--pill); color: var(--ink-2); font-size: 13.5px; font-weight: 560; }
.tbr-pilule span .icon { width: 16px; height: 16px; }
.tbr-pilule input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.tbr-pilule input:focus-visible + span { outline: 2px solid var(--brand-2-ink); outline-offset: 2px; }
.tbr-pilule:hover span { background: var(--hover); }
.tbr-periode { display: grid; gap: 10px; }
.tbr-dates, .tbr-filtre, .tbr-taille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tbr-check { height: auto; align-self: start; }
.tbr-client { grid-column: 1 / -1; }
.tbr-client-choisi { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.tbr-resultats { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
.tbr-resultat { width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 14px; cursor: pointer; }
.tbr-resultat:hover { background: var(--hover); }
.tbr-resultat small { color: var(--muted); }
.tbr-pied { justify-content: space-between; }
.tbr-retirer { color: var(--danger); }
.tbr-retirer:hover { background: var(--danger-soft); }

/* Catalogue « Ajouter un widget » */
.cat-grille { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat-item { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cat-apercu { height: 132px; padding: 8px; overflow: hidden; border-radius: 8px; background: var(--surface-2); pointer-events: none; }
.cat-apercu > .w { height: 100%; border: 0; background: transparent; zoom: .8; }
.cat-apercu .w-corps { padding: 0; overflow: hidden; }
.cat-apercu .w-liste, .cat-apercu .g-table-cadre { margin: 0; }
.cat-texte h3 { font-size: 14.5px; font-weight: 620; }
.cat-texte p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.cat-item .btn { align-self: flex-start; margin-top: auto; }

/* Téléphone : les widgets empilés, pleine largeur, sans redimensionnement */
@media (max-width: 760px) {
  .tb-barre { margin: 0 0 8px; }
  .tb-actions { width: 100%; margin-left: 0; }
  .tb-actions .btn { flex: 1 1 0; }
  .tb-pile { grid-template-columns: minmax(0, 1fr); }
  .w-reglages { width: 40px; height: 40px; margin: -6px -4px -6px 0; }
  .tbr-dates, .tbr-filtre, .tbr-taille { grid-template-columns: minmax(0, 1fr); }
  .cat-grille { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Pièces de vente (20/11) : couleur des devis, options, recherche d'article, lien du devis, cloche, page publique ---------- */
/* Couleur d'un devis : un point et son mot (jamais la couleur seule). */
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; color: var(--ink-2); white-space: nowrap; }
.pastille-point { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #d18a00; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .08); }
.pastille-vert .pastille-point, .chaleur-vert .pastille-point { background: #1f8a4c; }
.pastille-orange .pastille-point, .chaleur-orange .pastille-point { background: #d18a00; }
.pastille-rouge .pastille-point, .chaleur-rouge .pastille-point { background: #c0392b; }
.chaleur-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.chaleur-titre { font-size: 13px; color: var(--muted); margin-right: 2px; }
.chaleur-bouton {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--pill);
  background: var(--surface); color: var(--ink-2); font: 500 13px/1 var(--font); cursor: pointer;
}
.chaleur-bouton:hover { background: var(--hover); }
.chaleur-bouton[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.chaleur-bouton:focus-visible { outline: none; box-shadow: var(--ring); }

/* Éditeur de lignes : recherche d'article (liste posée par-dessus la page), lignes « option ». */
.art-cherche { position: relative; }
.art-cherche .art-liste { position: fixed; top: 0; left: 0; right: auto; z-index: 70; max-height: 300px; }
.art-liste .art-libre { display: block; }
.art-cherche .art-liste li { grid-template-columns: auto minmax(0, 1fr) auto; }
.art-cherche .art-liste .code { white-space: nowrap; }
.opt-cases { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.opt-case { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.opt-case input { width: 16px; height: 16px; }
.lines-edit tr.is-option td { background: #fafbfe; }
.lines-edit tr.is-hors-total .c-tot, .lines-view tr.is-hors-total td { color: var(--muted); }
.lines-view tr.is-hors-total td:first-child { font-style: italic; }
.ps-options { margin-top: 14px; break-inside: avoid; }
.ps-options .ps-lines { margin-top: 4px; }
.ps-consignes { white-space: pre-wrap; }

/* Écran d'une pièce : prévision de facture, lien en ligne, destinataire et livraison. */
.notice-info { background: var(--info-soft); border-color: #c9dbf0; color: var(--info); }
.notice-warning { background: var(--warning-soft); border-color: #f0dca8; color: var(--warning); }
.notice.prevision { align-items: center; flex-wrap: wrap; }
.notice.prevision > div { flex: 1 1 260px; }
.lien-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lien-liste li { display: grid; gap: 4px; justify-items: start; }
.lien-champ { font-size: 13px; }
.avoir-lignes input { width: 88px; height: 36px; text-align: right; }

/* Fiche client : adresses de livraison, annuaire des entreprises. */
.adresses { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.adresses li { padding-bottom: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.adresses li:last-child { border-bottom: 0; padding-bottom: 0; }
.adresses .cell-sub { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; }
.adresses .cell-sub .icon { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.annuaire-recherche { display: flex; align-items: flex-end; gap: 8px; }
.annuaire-recherche .field { flex: 1 1 auto; min-width: 0; }
.annuaire-recherche .btn { height: 38px; }
.annuaire-liste { margin: 10px 0 0; padding: 0; border: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.annuaire-choix { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; overflow-wrap: anywhere; }
.annuaire-choix:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.annuaire-choix input { margin-top: 3px; flex: none; }

/* Tableau de bord : factures à émettre (au-dessus des widgets, comme les pièces à valider). */
.a-emettre { margin-bottom: 16px; }
.a-emettre .defile-cadre { max-height: min(320px, 45vh); }

/* Cloche des alertes : dans le menu (ordinateur), en haut de la page à côté de la loupe (téléphone). */
.cloche { position: relative; margin: 0 4px 8px; }
.cloche-bouton {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: var(--pill); background: none;
  color: var(--ink-2); font: 500 14.5px/1.5 var(--font); cursor: pointer; text-align: left;
}
.cloche-bouton:hover, .cloche-bouton[aria-expanded="true"] { background: #eaecf3; color: var(--ink); }
.cloche-bouton .icon { width: 18px; height: 18px; color: var(--muted); }
.cloche-bouton:focus-visible { outline: none; box-shadow: var(--ring); }
.cloche-compte { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.cloche-panneau {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 340px; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.cloche-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px 16px; position: sticky; top: 0; background: var(--surface); }
.cloche-liste { list-style: none; margin: 0; padding: 4px 8px 8px; display: grid; gap: 2px; }
.cloche-alerte { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 8px; border-radius: var(--radius); }
.cloche-alerte:hover { background: var(--hover); }
.cloche-alerte a { color: var(--ink); overflow-wrap: anywhere; }
.cloche-alerte a:hover { text-decoration: none; }
.cloche-alerte a strong { display: block; font-weight: 620; }
.cloche-vide { padding: 12px 8px; font-size: 14px; }
/* Le menu (sticky) forme sa propre pile : panneau ouvert, il passe au-dessus du contenu de la page. */
.sidebar:has(.cloche-bouton[aria-expanded="true"]) { z-index: 70; }

/* Page publique du devis (lien privé du client) : aux couleurs d'EKA, lisible sur téléphone. */
.porte.porte-devis { place-items: start center; }
.dc-page {
  width: 100%; max-width: 720px; background: var(--surface); border: 1px solid #e6e7ee; border-radius: var(--radius-sheet); padding: 28px 28px 24px;
  overflow-wrap: anywhere;
}
.dc-page.dc-court { max-width: 460px; }
.dc-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 3px solid var(--brand-2); }
.dc-logo { display: block; width: 112px; height: auto; }
.dc-page h1 { margin: 20px 0 0; font-size: 24px; }
.dc-page h2 { font-size: 16px; margin-bottom: 8px; }
.dc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 20px; font-size: 14px; }
.dc-label { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.dc-muted { color: var(--muted); margin-top: 4px; }
.dc-refs { margin-top: 14px; font-size: 14px; }
.dc-bloc { margin-top: 22px; }
.dc-lignes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dc-lignes > li { border-bottom: 1px solid var(--line); }
.dc-lignes > li, .dc-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 10px 0; }
.dc-options > li { padding: 0; display: block; }
.dc-option { grid-template-columns: auto minmax(0, 1fr) auto; cursor: pointer; padding: 10px 4px; }
.dc-option input { width: 20px; height: 20px; margin-top: 2px; grid-row: span 2; }
.dc-option:has(input:checked) { background: var(--accent-soft); }
.dc-desig { font-weight: 560; }
.dc-detail { grid-column: 1; color: var(--muted); font-size: 13.5px; }
.dc-option .dc-detail { grid-column: 2; }
.dc-montant { grid-row: 1; grid-column: -2; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-aide { color: var(--muted); font-size: 13.5px; margin: 4px 0 8px; }
.dc-totaux { display: grid; gap: 4px; margin-left: auto; max-width: 320px; font-variant-numeric: tabular-nums; }
.dc-totaux > div { display: flex; justify-content: space-between; gap: 24px; }
.dc-totaux span { color: var(--muted); }
.dc-ttc { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 18px; }
.dc-ttc span { color: var(--ink); font-weight: 650; }
.dc-notes { white-space: pre-wrap; }
.dc-mentions { margin-top: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 2px; }
.dc-accord { padding: 18px; border: 1px solid var(--accent-line); border-radius: var(--radius-lg); background: #fbfbfe; display: grid; gap: 10px; }
.dc-accord h2 { margin: 0; }
.dc-bouton { justify-self: stretch; justify-content: center; min-height: 46px; height: auto; white-space: normal; font-size: 15.5px; }
.dc-pied { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.dc-merci { display: grid; place-items: center; width: 56px; height: 56px; margin-top: 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.dc-merci .icon { width: 28px; height: 28px; }
@media (max-width: 760px) {
  .dc-page { padding: 20px 16px; border-radius: var(--radius-lg); }
  .dc-page h1 { font-size: 21px; }
  .dc-totaux { max-width: none; }
  .annuaire-recherche { flex-direction: column; align-items: stretch; }
  .chaleur-bouton { height: 34px; }
  /* Cloche sur téléphone : un bouton rond à gauche de la loupe ; la liste en travers de l'écran. */
  .layout > .cloche { position: absolute; z-index: 5; top: 12px; right: 60px; margin: 0; }
  .layout > .cloche .cloche-bouton { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); }
  .layout > .cloche .cloche-texte { display: none; }
  .layout > .cloche .cloche-compte { position: absolute; top: -4px; right: -4px; margin: 0; min-width: 20px; height: 20px; line-height: 20px; font-size: 11px; }
  .layout > .cloche .cloche-panneau { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .page-head > :first-child { padding-right: 100px; }
}
@media print { .cloche, .chaleur-choix { display: none !important; } }
/* ---------- Dictée (20/11) : bouton micro flottant et son panneau (public/js/dictee.js) ---------- */
.dictee { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.dictee[popover] { inset: auto 24px 24px auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
.dictee[popover]:not(:popover-open) { display: none; }
.dictee > * { pointer-events: auto; }
.dictee-bouton {
  display: inline-grid; place-items: center; width: 52px; height: 52px; padding: 0;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--pill); cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 24, 45, .22), 0 1px 3px rgba(20, 24, 45, .12); transition: background .12s, transform .12s;
}
.dictee-bouton .icon { width: 24px; height: 24px; stroke-width: 2; }
.dictee-bouton:hover { background: var(--accent-hover); }
.dictee-bouton:active { transform: scale(.96); }
.dictee-bouton:focus-visible { outline: 3px solid var(--brand-2-ink); outline-offset: 3px; }
.dictee-bouton.is-enregistre { background: var(--danger); animation: dictee-pouls 1.4s ease-out infinite; }
.dictee-bouton.is-enregistre:hover { background: #971d16; }
.dictee-bouton.is-occupe { background: var(--muted); cursor: progress; }
@keyframes dictee-pouls { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 27, .45); } 100% { box-shadow: 0 0 0 14px rgba(180, 35, 27, 0); } }
.dictee-panneau {
  width: min(360px, calc(100vw - 48px)); padding: 12px 14px; display: grid; gap: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-size: 14px; overflow-wrap: anywhere;
}
.dictee-panneau.is-erreur { border-color: var(--danger-line); }
.dictee-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dictee-tete > p { padding-top: 6px; }
.dictee-fermer { flex-shrink: 0; margin: -2px -6px 0 0; }
.dictee-titre { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-weight: 650; }
.dictee-titre .icon { width: 18px; height: 18px; }
.dictee-detail { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.dictee-ok, .dictee-erreur { flex-wrap: nowrap; align-items: flex-start; }
.dictee-ok .icon, .dictee-erreur .icon { margin-top: 1px; }
.dictee-ok .icon { color: var(--success); }
.dictee-erreur .icon { color: var(--danger); }
.dictee-temps { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dictee-point { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s ease-in-out infinite; }
.dictee-roue { width: 16px; height: 16px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: dos-tourne .8s linear infinite; }
.dictee-texte { width: 100%; min-height: 84px; max-height: 40vh; padding: 8px 10px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; }
.dictee-actions { display: flex; justify-content: flex-end; }
/* Les notifications passent au-dessus du bouton ; le bas des pages reste lisible derrière lui. */
body.dictee-active .toasts[popover], body.dictee-active .toasts { bottom: 92px; }
body.dictee-active .main { padding-bottom: 96px; }
body.print-preview .dictee { display: none !important; }
@media print { .dictee { display: none !important; } }
@media (max-width: 760px) {
  .dictee, .dictee[popover] { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .dictee[popover] { inset: auto 12px calc(76px + env(safe-area-inset-bottom)) auto; }
  .dictee-bouton { width: 48px; height: 48px; }
  .dictee-panneau { width: calc(100vw - 24px); }
  body.dictee-active .toasts[popover], body.dictee-active .toasts { bottom: calc(136px + env(safe-area-inset-bottom)); }
  body.dictee-active .main { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
}

/* ---------- Relevés (20/11) : relevés bancaires, rapprochement des virements, acomptes, bloc Gmail de Réglages ---------- */
.rel-gmail { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 16px; }
.rel-gmail .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }
.rel-liste { list-style: none; margin: 0; padding: 0; }
.rel-liste li + li { border-top: 1px solid var(--line); }
.rel-releve { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 14px 20px; color: var(--ink); }
.rel-releve:hover { background: var(--hover); text-decoration: none; }
.rel-releve-titre { min-width: 0; overflow-wrap: anywhere; }
.rel-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.rel-chiffres > div { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.rel-chiffres dt { color: var(--muted); font-size: 13px; }
.rel-chiffres dd { margin: 2px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rel-note { margin: -8px 0 12px; }
.rel-ops { display: grid; gap: 12px; }
.rel-op { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px; min-width: 0; }
.rel-op-a_rapprocher { border-left: 3px solid var(--warning); }
.rel-op-rapprochee { border-left: 3px solid var(--success); }
.rel-op-tete { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: baseline; }
.rel-op-date { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rel-op-libelle { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.rel-op-montant { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rel-credit { color: var(--success); }
.rel-zone { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.rel-zone p { overflow-wrap: anywhere; }
.rel-zone-ok > p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.rel-zone-ok .icon { width: 16px; height: 16px; color: var(--success); align-self: center; }
.rel-prop-tete { display: flex; align-items: center; gap: 8px; font-weight: 620; }
.rel-prop-pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rel-prop-pieces li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.rel-prop-pieces a { font-weight: 620; }
.rel-prop-pieces .cell-sub { flex-basis: 100%; margin-top: 0; }
.rel-num { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rel-total { margin: 8px 0 12px; }
.rel-trop { color: var(--danger); font-weight: 620; }
.rel-recherche { max-width: none; margin-bottom: 8px; }
.rel-choisies { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rel-choisies li { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); }
.rel-choix-nom { min-width: 0; overflow-wrap: anywhere; }
.rel-resultats { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.rel-resultat { width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 14px; cursor: pointer; overflow-wrap: anywhere; }
.rel-resultat:hover, .rel-resultat:focus-visible { background: var(--hover); }
.rel-aucun { padding: 8px 10px; }
.page > [data-gmail]:not(:empty) { margin-top: 16px; }
.rel-reglages .row-gap { margin-top: 12px; }
.rel-connecte { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; overflow-wrap: anywhere; }
.rel-connecte .icon { width: 16px; height: 16px; color: var(--success); align-self: center; }
.rel-requete { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.rel-requete .field-help .mono { overflow-wrap: anywhere; }
.rel-ecartes { margin-top: 16px; }
.rel-ecartes > p { margin: 4px 0 8px; }
.rel-mails { list-style: none; margin: 0; padding: 0; }
.rel-mails li { padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.rel-mails li p { margin: 4px 0 0; font-size: 13.5px; }
.doc-side > [data-reglements]:empty { display: none; }
.regl-card h2 { margin-bottom: 4px; }
.regl-card .card-head { margin-bottom: 8px; }
.regl-liste { list-style: none; margin: 8px 0 12px; padding: 0; }
.regl-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.regl-quoi { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.regl-montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.regl-actions { display: flex; gap: 2px; margin-left: auto; }
.regl-supprimer { color: var(--danger); }
.rel-court { display: none; }
@media (max-width: 760px) {
  .rel-chiffres { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 16px; }
  .rel-chiffres > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 14px; border: 0; border-radius: 0; background: none; }
  .rel-chiffres > div + div { border-top: 1px solid var(--line); }
  .rel-chiffres dd { font-size: 15px; text-align: right; }
  .rel-chiffres .cell-sub { display: inline; margin-left: 6px; }
  .rel-long { display: none; }
  .rel-court { display: inline; }
  .rel-op { padding: 12px 14px; }
  .rel-op-tete { grid-template-columns: minmax(0, 1fr) auto; }
  .rel-op-libelle { grid-column: 1 / -1; grid-row: 2; }
  .rel-op-statut { grid-column: 1 / -1; }
  .rel-releve { padding: 12px 16px; }
  .rel-choisies li { grid-template-columns: minmax(0, 1fr) auto; }
  .rel-choix-montant { grid-column: 1; grid-row: 2; }
  .rel-zone .row-gap .btn { flex: 1 1 auto; }
}

/* ---------- Stock et achats (20/11) : commandes fournisseurs, réception, inventaire, approvisionnement, prix par quantité, archivage ---------- */
.cf-titre { font-size: 16px; margin: 4px 0 12px; display: flex; gap: 8px; align-items: baseline; }
.cf-liste { display: grid; gap: 16px; margin-bottom: 24px; }
.cf-carte.is-surligne, tr.is-surligne td { box-shadow: inset 3px 0 0 var(--accent, #283595); }
.cf-carte .card-head { margin-bottom: 8px; }
.cf-carte h2 { flex-wrap: wrap; }
.cf-table tr.is-fait td { color: var(--muted); }
.cf-receptions { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cf-receptions .icon { width: 15px; height: 15px; }
.cf-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.cf-recues { margin-bottom: 24px; }
.cf-recep { margin: 16px 0 12px; }
.cf-qte { width: 110px; text-align: right; }
.cf-surplus { height: auto; align-self: start; }
.cf-lignes { display: grid; gap: 10px; margin: 16px 0 10px; }
.cf-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 110px 140px 36px; gap: 10px; align-items: end; }
.cf-ligne select { min-width: 0; }
.cf-l-retirer { margin-bottom: 1px; }
.cf-notes { margin-top: 14px; }
/* Inventaire en masse : un lieu, une saisie par ligne ; la barre d'enregistrement reste visible (au-dessus du menu sur téléphone). */
.inv-entete { margin-bottom: 16px; }
.inv-reglages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.inv-cadre { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.inv-table td { padding-block: 8px; }
.inv-table tr.is-ecart td { background: var(--warning-soft); }
.inv-qte { width: 110px; height: 40px; text-align: right; font-size: 16px; }
.inv-barre { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 76px 0 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 -4px 16px rgba(20, 24, 45, .06); }
/* (marge à droite : le bouton micro de la dictée, toujours visible en bas à droite) */
.print-sheet .ps-ref { white-space: nowrap; }
/* Approvisionnement d'une commande ou d'un devis vert (colonne de droite de la pièce) */
.appro-card h2 { margin-bottom: 0; }
.appro-cf { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.appro-cf li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.appro-cf li::before { content: 'Approvisionnement :'; color: var(--ink-2); font-weight: 560; }
.appro-table td, .appro-table th { padding-inline: 8px; }
.appro-table tr.is-manque td { background: #fdf6f5; }
.appro-bouton { margin-top: 12px; width: 100%; justify-content: center; }
.appro-lignes { display: grid; gap: 12px; }
.appro-ligne { display: grid; grid-template-columns: 110px minmax(0, 1fr) 140px; gap: 10px; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.appro-ligne legend { padding: 0 4px; font-size: 14px; font-weight: 560; }
/* Prix par quantité d'un article */
.prod-actions { display: inline-flex; gap: 2px; }
.tq-lignes { display: grid; gap: 10px; margin: 14px 0 10px; }
.tq-ligne { display: grid; grid-template-columns: 1fr 1fr 1fr 36px; gap: 10px; align-items: end; }
.tq-note { grid-column: 1 / -1; margin: 0; }
.tq-autres { margin-top: 12px; }
/* Archivage des articles */
.arch-intro { margin: -4px 0 16px; max-width: 80ch; }
.arch-coche { width: 44px; }
.arch-coche input { width: 18px; height: 18px; }
.arch-pied { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
@media (max-width: 760px) {
  .inv-reglages { grid-template-columns: minmax(0, 1fr); }
  .inv-barre { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); margin-right: 64px; padding: 10px 12px; gap: 8px; }
  .inv-barre .row-gap { width: 100%; flex-wrap: nowrap; }
  .inv-barre .btn { flex: 1 1 0; padding-inline: 8px; }
  .inv-long { display: none; }
  .inv-table th, .inv-table td { padding-inline: 8px; }
  .inv-table th:first-child, .inv-table td:first-child { white-space: normal; }
  .inv-table th:nth-child(4), .inv-table td:nth-child(4) { display: none; } /* l'écart passe sous la saisie */
  .inv-qte { width: 84px; }
  .cf-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .cf-l-article { grid-column: 1 / -1; }
  .cf-col-prix { display: none; }
  .cf-qte { width: 80px; }
  .appro-ligne { grid-template-columns: minmax(0, 1fr); }
  .tq-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .tq-ligne .field:nth-child(3) { grid-column: 1 / 3; }
}

/* ---------- Tableau de bord, lot 2 (22/11) : commandes, achats, stock, suivi commercial, transport, personnalisation ---------- */
/* Pastille d'une marge : rouge (faible), jaune (moyenne), verte (bonne), avec son taux. */
.w2-pastille { display: inline-flex; align-items: center; gap: 6px; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w2-point { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(0, 0, 0, .08); }
.w2-rouge .w2-point { background: #c0392b; }
.w2-jaune .w2-point { background: #d18a00; }
.w2-vert .w2-point { background: #1f8a4c; }
.w2-taux { font-size: clamp(22px, 9cqi, 32px); line-height: 1.1; }
.w2-taux .w2-point { width: 14px; height: 14px; }
.w2-taux.w2-rouge { color: var(--danger); }
.w2-taux.w2-jaune { color: var(--warning); }
.w2-taux.w2-vert { color: var(--success); }
/* Achats par mois : barres empilées (une colonne = un lien vers les achats du mois) ; les 5 plus gros en ambre léger. */
.w2-empile .g-mois-barres { justify-content: stretch; }
.w2-pile { display: flex; flex-direction: column-reverse; width: 100%; max-width: 30px; margin: 0 auto; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--surface-2); }
.w2-pile > span { display: block; min-height: 1px; }
.w2-pile:hover, .w2-pile:focus-visible { filter: brightness(.85); }
.g-table .w2-top th, .g-table .w2-top td { background: color-mix(in srgb, var(--viz-3) 13%, transparent); }
.w2-source { margin-top: 6px; }
.w2-sans-lien { cursor: default; }
@container (max-width: 380px) { .g-table .w2-part { display: none; } }
/* Suivi commercial : le détail des échanges sur un widget large, leur total sur un widget étroit. */
.w2-suivi thead .icon { width: 15px; height: 15px; vertical-align: -3px; }
.w2-suivi .g-table th, .w2-suivi .g-table td { padding-inline: 7px; }
.w2-suivi .g-table th:first-child { padding-left: 14px; }
.w2-suivi .g-table tr > :last-child { padding-right: 14px; }
.w2-suivi .g-table tbody th, .w2-suivi .g-table tfoot th { min-width: 6.5em; }
.w2-devis { display: inline-flex; gap: 5px; justify-content: flex-end; }
.w2-devis .pastille { gap: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.w2-retard { color: var(--danger); font-weight: 650; }
.g-table .w2-resume { display: none; }
@container (max-width: 520px) { .g-table .w2-detail { display: none; } .g-table .w2-resume { display: table-cell; } }
@container (max-width: 330px) { .g-table .w2-transf { display: none; } } /* très étroit : les devis transformés sont dans la liste des devis */
/* Ventes personnalisées : coûts et marge sous le chiffre. */
.w2-couts { margin-top: 8px; }
.w2-couts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.w2-couts .w2-marge { margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.w2-couts .w2-marge strong { margin-left: auto; }
.w2-alerte { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--warning); }
.w2-alerte .icon { width: 14px; height: 14px; flex: none; }
/* Marge sur transport par mois : port facturé et coût réel côte à côte, un lien par mois. */
.w2-mois-lien { display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; height: 100%; }
.w2-mois-lien:hover .g-barre, .w2-mois-lien:focus-visible .g-barre { filter: brightness(.82); }
@container (max-width: 380px) { .g-table .w2-cout { display: none; } } /* téléphone : facturé et marge, le coût est au survol du mois */
/* Commandes en cours et commandes fournisseurs : retards, état. */
.w-retard a { color: var(--danger); }
.w-retard .icon { width: 14px; height: 14px; vertical-align: -2px; }
.w-cmd-cote { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.w-cmd-cote .badge { font-size: 11.5px; }
/* Stock par article et par lieu : tableau croisé ; widget étroit : une carte par article, les lieux en étiquettes. */
.w-croise .g-table thead th { text-align: right; }
.w-croise .g-table thead th:first-child { position: sticky; left: 0; z-index: 2; text-align: left; }
.w-croise .g-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 9em; background: var(--surface); }
.w-croise-famille th { padding-top: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; }
.w-sous-seuil { color: var(--warning); font-weight: 650; }
.w-croise-cartes { display: none; list-style: none; margin: 0 -14px; padding: 0; }
.w-croise-cartes li { border-bottom: 1px solid var(--line); }
.w-croise-cartes a { display: grid; gap: 4px; padding: 8px 14px; color: var(--ink); }
.w-croise-cartes a:hover { text-decoration: none; background: var(--hover); }
.w-croise-tete { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13.5px; }
.w-croise-tete .list-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-croise-lieux { display: flex; flex-wrap: wrap; gap: 4px; }
.w-etiquette { display: inline-flex; gap: 4px; padding: 1px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 440px) { .w-croise { display: none; } .w-croise-cartes { display: block; } }
/* Écran d'une pièce : encadré « Coûts internes » (personnalisation des lignes, transport d'un bon). */
.couts-card .card-head { align-items: baseline; }
.couts-bloc + .couts-bloc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.couts-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.couts-tete h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 620; }
.couts-tete h3 .icon { width: 16px; height: 16px; color: var(--muted); }
.couts-kv > div { padding: 3px 0; }
.couts-kv dd { text-align: right; }
.couts-lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.couts-lignes li { display: grid; gap: 1px; }
.couts-l-nom { overflow-wrap: anywhere; }
.couts-total { margin: 8px 0 0; color: var(--ink-2); }
.couts-table td { vertical-align: middle; }
.couts-table .cell-sub { display: block; }
.couts-coche { justify-content: center; }
.couts-coche input { width: 18px; height: 18px; }
.couts-cout { width: 96px; }
/* Achats (Stock › Achats) */
.achats-regle { display: flex; align-items: flex-start; gap: 6px; max-width: 90ch; margin: -4px 0 12px; }
.achats-regle .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; }
@media (max-width: 760px) {
  .couts-cout { width: 78px; }
}

/* ---------- Tableau de bord, lot 1 (22/11) : ventes et marges (public/js/tableau/widgets-lot1.js) ---------- */
/* Couleurs de la marge : rouge sous le seuil, jaune entre, vert à partir du seuil (Réglages › Tableau de bord). Les 3 premières
   lignes d'un tableau en ambre léger (son orange), pour ne pas confondre avec le vert « bonne marge ». */
.m-pastille { display: inline-block; padding: 1px 7px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 640; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-pastille.m-rouge { background: var(--danger-soft); color: var(--danger); }
.m-pastille.m-jaune { background: var(--warning-soft); color: var(--warning); }
.m-pastille.m-vert { background: var(--success-soft); color: var(--success); }
.m-taux::before { content: ""; display: inline-block; width: .42em; height: .42em; margin-right: .22em; border-radius: 50%; background: currentColor; vertical-align: .18em; }
.m-texte-rouge { color: var(--danger); }
.m-texte-jaune { color: var(--warning); }
.m-texte-vert { color: var(--success); }
a.g-chiffre.m-taux:hover { color: var(--accent); }
.m-barre-rouge { background: var(--danger) !important; }
.m-barre-jaune { background: var(--viz-3) !important; }
.m-barre-vert { background: var(--success) !important; }
.m-barre-vide { background: var(--viz-autres) !important; }
.m-seuils { position: absolute; top: 0; right: 0; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.m-seuils i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
@container (max-width: 300px) { .m-seuils { display: none; } }
.w-taux_marge .g-mois-cadre { min-height: 84px; }
.m-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.m-note a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.m-chiffre .m-note { margin-top: 2px; }
.m-zero { color: var(--line-strong); }

/* Tableaux : cases plus serrées ; première colonne fixe quand les colonnes défilent. */
.m-table th, .m-table td { padding: 6px 8px; }
.m-table th:first-child, .m-table td:first-child { padding-left: 14px; }
.m-table th:last-child, .m-table td:last-child { padding-right: 14px; }
.m-table .m-part { color: var(--muted); font-size: 12px; }
.m-table tr.is-avoir td { color: var(--muted); }
.m-collant { width: max-content; min-width: 100%; }
.m-collant tbody th { width: auto; min-width: 7.5em; max-width: 15em; }
.m-collant th:first-child, .m-collant td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 6px 0 6px -6px rgba(20, 24, 45, .2); }
.m-collant thead th:first-child { z-index: 2; background: var(--surface-2); }
.m-collant tfoot th:first-child { background: var(--surface-2); }
.m-top th, .m-top td, .m-collant .m-top th:first-child { background: color-mix(in srgb, var(--viz-3) 13%, var(--surface)); }
.m-en-cours, .m-en-cours a { font-weight: 650; }
.m-sous { display: none; }

/* Mois par mois (12 mois, trimestres, total, part) et croisement des familles (carte de chaleur). */
.m-croise .m-trim { background: var(--surface-2); }
.m-croise thead .m-trim { color: var(--ink-2); }
.m-croise .m-total, .m-croise .m-partcol { background: var(--surface); }
.m-croise thead .m-total, .m-croise thead .m-partcol, .m-croise tfoot .m-total, .m-croise tfoot .m-partcol { background: var(--surface-2); }
.m-croise .m-top .m-total, .m-croise .m-top .m-partcol { background: color-mix(in srgb, var(--viz-3) 13%, var(--surface)); }
.m-chaleur { background: color-mix(in srgb, var(--viz-1) calc(var(--m-part, 0%) * .32), var(--surface)); }
.m-chaleur.m-fort { background: var(--success-soft); box-shadow: inset 0 0 0 1px var(--success-line); }
.m-chaleur.m-fort a { color: var(--success); font-weight: 650; }
.m-fort-cle { display: inline-block; width: 10px; height: 10px; margin-right: 2px; border-radius: 2px; background: var(--success-soft); border: 1px solid var(--success-line); vertical-align: -1px; }
.m-rang-croise { margin: 6px 0 4px; }
/* Noms des familles de clients en colonnes : sur deux lignes au plus plutôt que coupés. */
.g-table.m-entetes thead th { white-space: normal; min-width: 4.5em; max-width: 7.5em; line-height: 1.2; vertical-align: bottom; overflow-wrap: anywhere; }
.g-table.m-entetes thead th:first-child { max-width: none; }

/* Ventes d'une famille de clients : textes coupés proprement (le détail est au survol). */
.m-ventes { width: max-content; min-width: 100%; }
.m-ventes td, .m-ventes th { white-space: nowrap; }
.m-ventes .m-texte { max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.m-ventes .cell-sub { display: block; color: var(--muted); font-size: 11.5px; }

/* Courbe sur plusieurs années : l'année de référence en bleu épais, l'année d'avant en bleu clair, les plus anciennes en gris,
   la moyenne en pointillés. */
.m-ligne { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.m-ligne.m-an-ref { stroke: var(--viz-1); stroke-width: 2.6; }
.m-ligne.m-an-1 { stroke: var(--viz-comp); stroke-width: 2; }
.m-ligne.m-an-ancien { stroke: var(--viz-autres); stroke-width: 1.2; }
.m-ligne.m-moy { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.g-legende .m-cle { width: 14px; height: 3px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }
.m-cle.m-an-ref { background: var(--viz-1); height: 4px; }
.m-cle.m-an-1 { background: var(--viz-comp); }
.m-cle.m-an-ancien { background: var(--viz-autres); }
.m-cle.m-moy { background: repeating-linear-gradient(90deg, var(--ink-2) 0 4px, transparent 4px 7px); }
.m-legende-annees { gap: 2px 12px; }
.m-mois td, .m-mois th { white-space: nowrap; }
.m-barre-moy { pointer-events: auto; }

/* Cartes (widget étroit, téléphone) : une ligne par famille, un appui montre le reste. */
.m-cartes, .m-cartes-ventes { display: none; }
.m-cartes { list-style: none; margin: 0 -14px; padding: 0; }
.m-cartes > li { border-bottom: 1px solid var(--line); }
.m-cartes > li.m-top { background: color-mix(in srgb, var(--viz-3) 13%, var(--surface)); }
.m-cartes summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 8px; padding: 8px 14px; cursor: pointer; list-style: none; font-size: 13.5px; }
.m-cartes summary::-webkit-details-marker { display: none; }
.m-cartes summary::before { content: "›"; grid-row: 1; position: absolute; margin-left: -10px; color: var(--muted); transition: transform .15s; }
.m-cartes details[open] summary::before { transform: rotate(90deg); }
.m-carte-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.m-carte-val { font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-cartes details > :not(summary) { margin-left: 14px; margin-right: 14px; }
.m-carte-details { display: grid; gap: 2px; margin: 0 0 6px; font-size: 12.5px; }
.m-carte-details > div { display: flex; justify-content: space-between; gap: 8px; }
.m-carte-details dt { color: var(--muted); }
.m-carte-details dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.m-carte-lien { display: inline-block; margin-bottom: 8px; font-size: 12.5px; font-weight: 560; }
@container (max-width: 519px) {
  .m-large { display: none; }
  .m-cartes, .m-cartes-ventes { display: block; }
}
/* Meilleurs clients, articles : sur un widget étroit, la marge passe sous le montant. */
@container (max-width: 459px) {
  .m-col-marge, .m-col-cout { display: none; }
  .m-sous { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
  .m-sous .m-pastille { padding: 0 5px; font-size: 11px; }
  /* Plusieurs années : seulement l'année de référence, l'année d'avant et la moyenne. */
  .m-ligne.m-an-ancien, .m-an-ancien-cle { display: none; }
}
/* Mois par mois : le total et la part restent visibles à droite, les mois défilent entre (12 mois et 4 trimestres ne tiennent
   pas toujours, même sur toute la largeur). */
.m-croise th, .m-croise td { padding-inline: 6px; }
.m-croise .m-partcol { position: sticky; right: 0; z-index: 1; box-sizing: border-box; width: 58px; min-width: 58px; max-width: 58px; }
.m-croise .m-total { position: sticky; right: 58px; z-index: 1; box-shadow: -6px 0 6px -6px rgba(20, 24, 45, .2); }
.m-croise:not(:has(.m-partcol)) .m-total { right: 0; }
/* Ventes par famille sur un widget moyen : les colonnes secondaires (parts des quantités et des achats, an dernier) s'effacent. */
@container (max-width: 699px) { .m-moyen { display: none; } .m-ventes .m-texte { max-width: 8.5em; } }

/* ---------- Tableau de bord, lot 3 (22/11) ---------- */
/* Objectif de l'année, seuil de rentabilité (widgets), Réglages › Tableau de bord. Couleurs : réalisé en bleu (--viz-1),
   en cours en bleu clair (--viz-comp) empilé dessus, objectif en trait foncé ; écart en vert ou en rouge ; marge en rouge /
   jaune / vert selon les seuils réglés (rouge sous 35 %, vert à partir de 45 % par défaut). */
.o-jauge-ligne { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 5px 0 1px; }
.o-jauge-ligne .o-jauge { flex: 1; min-width: 40px; margin: 0; }
.o-part { flex-shrink: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.o-jauge { position: relative; display: block; flex-shrink: 0; height: 10px; margin: 8px 0 2px; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.o-jauge-fait { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--pill); background: var(--viz-1); }
.o-jauge.is-atteint .o-jauge-fait { background: var(--success); }
.o-jauge-cours { position: absolute; top: 0; bottom: 0; border-radius: 0 var(--pill) var(--pill) 0; background: var(--viz-comp); }
.o-jauge-repere { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.o-details { margin-top: 2px; gap: 1px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.o-details .hausse strong, .o-details strong.hausse, .o-point-mort.hausse { color: var(--success); }
.o-details .baisse strong { color: var(--danger); }
.o-nowrap { white-space: nowrap; }
.o-a-saisir { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 4px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.o-a-saisir .icon { flex-shrink: 0; width: 14px; height: 14px; margin-top: 1px; color: var(--warning); }
.w-chiffre.o-objectif, .w-chiffre.o-seuil { gap: 0; } /* 3 × 3 : tout tient sans défiler */
.o-seuil .o-jauge { margin: 6px 0 2px; }
.o-point-mort { display: flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--ink-2); font-size: 12.5px; font-weight: 560; }
.o-point-mort .icon { flex-shrink: 0; width: 14px; height: 14px; }
.o-seuil .o-point-mort + .w-note { margin-top: 2px; }
.o-pastille { display: inline-block; padding: 0 6px; border-radius: var(--pill); font-weight: 650; font-variant-numeric: tabular-nums; }
.o-rouge { background: var(--danger-soft); color: var(--danger); }
.o-jaune { background: var(--warning-soft); color: var(--warning); }
.o-vert { background: var(--success-soft); color: var(--success); }
/* Barres par mois : la barre du réalisé, l'en cours empilé, l'objectif du mois en trait. */
.o-mois .g-mois-barres { align-items: stretch; }
.o-col { position: relative; flex: 1 1 0; max-width: 30px; }
.o-barre { position: absolute; left: 0; right: 0; bottom: 0; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--viz-1); }
.o-barre:hover, .o-barre:focus-visible { filter: brightness(.82); }
.o-barre-cours { position: absolute; left: 0; right: 0; border-radius: 4px 4px 0 0; background: var(--viz-comp); }
.o-trait { position: absolute; left: -3px; right: -3px; height: 2px; margin-bottom: -1px; border-radius: 1px; background: var(--ink); }
.is-avenir .o-trait { background: var(--ink-2); opacity: .55; }
.g-mois-col.is-avenir .g-mois-lbl { opacity: .7; }
.o-cle-trait { height: 2px !important; margin-bottom: 3px; background: var(--ink); }
.o-cle-cours { background: var(--viz-comp); }
/* Tableaux */
.o-table tr.is-now th, .o-table tr.is-now td { background: var(--accent-soft); }
.o-table .lbl-court { display: none; }
@container (max-width: 520px) {
  .o-table th, .o-table td { padding-inline: 8px; }
  .o-table th:first-child, .o-table td:first-child { padding-left: 14px; }
  .o-table .lbl-long { display: none; }
  .o-table .lbl-court { display: inline; }
}
.o-table tr.is-avenir td { color: var(--muted); }
.o-table-seuil tbody th { white-space: normal; max-width: none; width: auto; font-weight: 500; color: var(--ink-2); }
.o-sous-table { margin-top: 8px; }
.o-sous-table a, .o-details a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }

/* Réglages › Tableau de bord */
.rt .subform + .subform { margin-top: 16px; }
.rt-euros, .rt-pct { position: relative; display: flex; }
.rt-euros input, .rt-pct input { padding-right: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.rt-pct input { padding-right: 30px; }
.rt-euros > span, .rt-pct > span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13.5px; }
.rt-mois-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.rt-mois-tete > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rt-mois-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-mois { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.rt-mois .field > span:first-child { font-weight: 560; font-size: 12.5px; }
.rt-mois input { padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.rt-total { margin-top: 8px; }
.rt-total.is-ecart { color: var(--warning); }
.rt-seuils { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.rt-seuils + .rt-seuils { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rt-seuils-titre { grid-column: 1 / -1; font-size: 13.5px; font-weight: 620; }
.rt-apercu { grid-column: 1 / -1; display: flex; height: 22px; overflow: hidden; border-radius: 6px; font-size: 11.5px; font-weight: 650; }
.rt-apercu > span { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap; border-radius: 0; padding: 0 4px; }
.rt-seuils .field-help { grid-column: 1 / -1; }
.rt-lignes { display: grid; gap: 10px; }
.rt-ligne { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.rt-ligne-tete { display: flex; align-items: flex-end; gap: 8px; }
.rt-ligne-tete .field { flex: 1; }
.rt-puces { gap: 6px; }
.rt-puces .chip { height: auto; min-height: 30px; font-size: 13px; }
.rt-puces .chip.is-ailleurs { opacity: .6; }
.rt-puces .chip small { color: var(--muted); font-weight: 500; }
.rt-ajouter { justify-self: start; margin-top: 10px; }
.rt-vide { color: var(--muted); font-size: 13px; }
.rt-puces .chip.is-double { border-color: var(--danger); color: var(--danger); }
/* Comptes › Modifier : « Tableau de bord de Marina » (disposition posée à la main) */
.compte-disposition { display: grid; gap: 6px; padding-top: 4px; }
.compte-disposition .btn { justify-self: start; }
@media (max-width: 760px) {
  .rt-mois { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rt-mois-tete { align-items: flex-start; flex-direction: column; }
}
