/* Signature Transfert — feuille de style de l'application.
   Charte : noir, or, blanc. Contenu sur fond clair pour la lisibilité des tableaux et formulaires. */

@font-face { font-family: "Josefin Sans"; font-weight: 400; font-display: swap; src: url("../fonts/josefin-sans-latin-400-normal.05110e0dbae5.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 600; font-display: swap; src: url("../fonts/josefin-sans-latin-600-normal.fbceb2bfb07b.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 700; font-display: swap; src: url("../fonts/josefin-sans-latin-700-normal.52bf3753e844.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.bab398e040a4.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.8befd6f435e5.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.63a951688119.woff2") format("woff2"); }

:root {
  --ink: #17171a;
  --muted: #5b574f;
  --line: #e2ded5;
  --line-strong: #cfc9bd;
  --field-border: #918a7c;  /* bord des champs de saisie : contraste ≥ 3:1 (WCAG 1.4.11) */
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --black: #0b0b0b;
  --gold: #836124;          /* or sur fond clair : contraste ≥ 4,5:1 sur tous les fonds clairs (texte AA) */
  --gold-bright: #d2ab62;   /* or sur fond noir */
  --gold-soft: #f4ead6;
  --ok: #1f7a4d; --ok-soft: #e3f3ea;
  --warn: #9a5b00; --warn-soft: #fbf0dc;
  --danger: #a12d2d; --danger-soft: #f8e3e1;
  --info: #23527f; --info-soft: #e2ebf5;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(23,23,26,.06), 0 4px 16px rgba(23,23,26,.05);
  --f-display: "Josefin Sans", "Futura", "Century Gothic", system-ui, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sidebar :focus-visible, .topbar :focus-visible, .public-head :focus-visible, .auth-card .brand :focus-visible { outline-color: var(--gold-bright); }
/* Liens dans un texte courant : soulignés, pour ne pas dépendre de la seule couleur. */
.alert a, .sub a, p a:not(.btn), .help a { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: .01em; margin: 0; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--black); color: #e9e5dc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; padding: 18px 16px 14px; border-bottom: 1px solid #26241f; }
.brand img { width: 100%; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; }
.nav-title { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: #8d877b; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: #e9e5dc; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: #1c1b18; text-decoration: none; }
.nav a.active { background: #22201b; color: var(--gold-bright); box-shadow: inset 3px 0 0 var(--gold-bright); }
.nav svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav .soon { margin-left: auto; font-size: 10.5px; color: #8d877b; font-weight: 400; }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid #26241f; font-size: 13px; color: #b8b2a6; display: grid; gap: 8px; }
.sidebar-foot form { margin: 0; }
.sidebar-foot .link-btn { padding: 6px 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-bright); font: inherit; cursor: pointer; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 26px 32px 48px; max-width: 1280px; width: 100%; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stack { display: grid; gap: 14px; align-content: start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px var(--f-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn-primary { background: var(--black); color: #fff; border-color: var(--black); }
.btn-primary:hover { background: #2a2824; border-color: #2a2824; }
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: #6b4f1d; border-color: #6b4f1d; }
.btn-danger { color: var(--danger); border-color: #e5bcb8; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge-client { background: var(--ok-soft); color: var(--ok); border-color: #bfe1cd; }
.badge-prospect { background: var(--info-soft); color: var(--info); border-color: #c4d6ea; }
.badge-archived { background: #ecebe7; color: var(--muted); }
.badge-demo { background: var(--warn-soft); color: var(--warn); border-color: #efd5a8; }
.badge-won { background: var(--ok-soft); color: var(--ok); }
.badge-lost { background: var(--danger-soft); color: var(--danger); }
.badge-open { background: var(--gold-soft); color: var(--gold); }
.badge-late { background: var(--danger-soft); color: var(--danger); }

.alert { padding: 11px 14px; border-radius: 6px; border: 1px solid; font-size: 14px; }
.alert-success { background: var(--ok-soft); border-color: #bfe1cd; color: #135437; }
.alert-error { background: var(--danger-soft); border-color: #ecc3bf; color: #7d1f1f; }
.alert-info, .alert-warning { background: var(--warn-soft); border-color: #efd5a8; color: #6d4100; }
.messages { display: grid; gap: 8px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-family: var(--f-display); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); }
.table tbody tr:hover { background: #fcfbf8; }
.table td a.row-link { color: var(--ink); font-weight: 600; }
/* Colonnes numériques : « right » doit l'emporter sur l'alignement à gauche par défaut des tableaux. */
.table th.right, .table td.right { text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }

/* Filtres */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 160px; }
.filters .field.grow { flex: 1 1 260px; }

/* Formulaires */
.form { display: grid; gap: 16px; align-content: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; align-content: start; }
.field label, .field .label-like { font-weight: 600; font-size: 13.5px; }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check label { font-weight: 600; }
/* Case à cocher : toute la largeur, aide et erreur sous l'intitulé (et non serrées à côté). */
.form-grid .field.check { grid-column: 1 / -1; }
.field.check { flex-wrap: wrap; }
.field.check .help, .field.check .error { flex-basis: 100%; padding-left: 26px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--field-border); border-radius: 6px; background: #fff; font: 15px var(--f-body); color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(131,97,36,.2); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--gold); }
/* Boutons radio : intitulé cliquable sur une ligne de 32 px (cible tactile). */
.field label:has(> input[type=radio]) { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 400; cursor: pointer; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.non-field-errors { background: var(--danger-soft); color: #7d1f1f; border: 1px solid #ecc3bf; padding: 10px 12px; border-radius: 6px; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs .count { font-size: 12px; color: var(--muted); margin-left: 4px; }

/* Fiche entreprise */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; font-size: 14.5px; margin: 0; }
.kv dt:first-child { margin-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list-items { display: grid; }
.list-items > * { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.list-items > *:last-child { border-bottom: 0; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.addr-kind { font-family: var(--f-display); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 700; }
.timeline .when { font-size: 12.5px; color: var(--muted); }

/* Statistiques */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--f-display); font-size: 28px; font-weight: 600; margin-top: 4px; }

/* Pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.column { background: #efede8; border-radius: var(--radius); padding: 10px; display: grid; gap: 10px; align-content: start; min-height: 200px; }
.column-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 4px; }
.column-head h2, .column-head h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.column.won .column-head :is(h2, h3) { color: var(--ok); }
.column.lost .column-head :is(h2, h3) { color: var(--danger); }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.opp .title { font-weight: 700; color: var(--ink); }
.opp .meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.opp form { display: flex; gap: 6px; }
.opp select { min-height: 30px; font-size: 13px; padding: 3px 6px; }

/* Tâches */
.task-row { display: flex; align-items: center; gap: 10px; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.check-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--field-border); background: #fff; cursor: pointer; padding: 0; flex: 0 0 auto; display: grid; place-items: center; position: relative; }
.check-btn::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }  /* zone de clic de 40 px */
.check-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 3; }

/* Pagination */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; font-size: 14px; color: var(--muted); }

/* Authentification */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--black); padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.auth-card .brand { background: var(--black); border-bottom: 3px solid var(--gold-bright); padding: 22px 28px; }
.auth-card .body { padding: 24px 28px 28px; display: grid; gap: 16px; }
.qr { width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); padding: 8px; border-radius: 6px; }
code.secret { font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* Responsive */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--black); padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar img { height: 34px; width: auto; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .topbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
  .content { padding: 18px 16px 40px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.sidebar-foot .user-link { color: #e9e5dc; font-weight: 600; }
/* Empêche les tableaux larges d'élargir la page : ils défilent dans leur cadre. */
.content > *, .card, .grid-2 > *, .grid-3 > *, .stack > * { min-width: 0; }
.main { overflow-x: hidden; }
/* Les cadres défilants contiennent leurs éléments positionnés (libellés masqués…) : sans cela,
   la page entière défilait en largeur (pipeline). */
.board, .table-wrap, .tabs, .chart-scroll, .cgv-text { position: relative; }

/* ---------- Lot 2 : catalogue et devis ---------- */
.badge-q-brouillon { background: #ecebe7; color: var(--muted); }
.badge-q-envoye { background: var(--info-soft); color: var(--info); border-color: #c4d6ea; }
.badge-q-accepte { background: var(--ok-soft); color: var(--ok); border-color: #bfe1cd; }
.badge-q-refuse { background: var(--danger-soft); color: var(--danger); }
.badge-q-expire { background: var(--warn-soft); color: var(--warn); }
.badge-q-remplace { background: #ecebe7; color: var(--muted); text-decoration: line-through; }
.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
/* Deux colonnes seulement à partir de 1 280 px : en dessous, le tableau des lignes manquerait de place
   et la colonne « Total HT » serait coupée ; la colonne latérale passe alors sous le contenu. */
@media (max-width: 1279px) { .quote-layout { grid-template-columns: minmax(0, 1fr); } }
.section-title-form { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.section-title-form input { flex: 1; min-width: 0; font: 600 16px var(--f-display); border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: 6px; }
.section-title-form input:hover, .section-title-form input:focus { border-color: var(--line-strong); background: var(--surface); }
.table.lines td { vertical-align: top; }
.table.lines tr.is-option td { background: var(--surface-2); color: var(--muted); }
.nowrap { white-space: nowrap; }
.nowrap .btn { margin-left: 2px; }
.line-form { border: 1px solid var(--gold); background: var(--surface-2); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.line-form h3 { margin: 0 0 10px; font: 600 15px var(--f-display); }
.line-form .form-actions { margin-top: 10px; }
table.totals { width: 100%; max-width: 440px; margin-left: auto; border-collapse: collapse; }
table.totals th { text-align: left; font-weight: 400; padding: 6px 8px; color: var(--muted); }
table.totals td { text-align: right; padding: 6px 8px; white-space: nowrap; }
table.totals tr.strong th, table.totals tr.strong td { color: var(--ink); font-weight: 600; border-top: 1px solid var(--line); }
table.totals tr.grand th, table.totals tr.grand td { background: var(--black); color: #fff; font-weight: 700; font-size: 17px; }
table.totals tr.grand td { color: var(--gold-bright); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.table.lines td:first-child { min-width: 240px; }
.table.lines .nowrap { width: 1%; }
.table.lines th { white-space: nowrap; }
/* Tableaux de lignes plus compacts : sept colonnes tiennent à côté de la colonne latérale dès 1 280 px. */
@media (min-width: 641px) {  /* en dessous, les lignes s'affichent en cartes */
  .table.lines th, .table.lines td { padding-left: 9px; padding-right: 9px; }
  .table.lines th:first-child, .table.lines td:first-child { padding-left: 14px; }
  .table.lines th:last-child, .table.lines td:last-child { padding-right: 14px; }
  .table.lines th { letter-spacing: .05em; }
}
.line-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.line-actions .btn { min-height: 26px; padding: 2px 8px; font-size: 12.5px; }

/* ---------- Lot 3 : facturation ---------- */
.badge-pay-a_payer { background: var(--info-soft); color: var(--info); }
.badge-pay-partielle { background: var(--gold-soft); color: var(--gold); }
.badge-pay-payee { background: var(--ok-soft); color: var(--ok); }
.badge-pay-en_retard { background: var(--danger-soft); color: var(--danger); }
.badge-pay-annulee { background: #ecebe7; color: var(--muted); }
.badge-sim { background: var(--danger-soft); color: var(--danger); border-color: #ecc3bf; }
.section-row td { background: var(--surface-2); font-family: var(--f-display); }
details > summary { list-style: none; cursor: pointer; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 12px; }
/* Devis : nouvelle adresse de chargement ou de livraison saisie dans l'en-tête */
.address-slot { display: grid; gap: 10px; }
.new-address-body { display: grid; gap: 12px; border-left: 3px solid var(--line-strong); padding-left: 14px; }
.new-address-body .sub-title { font-weight: 600; font-size: 13.5px; color: var(--muted); }
form.inline { display: inline; }
.link-btn.danger { color: var(--danger); }
button[disabled] { opacity: .45; cursor: not-allowed; }
.stat-alert .value { color: var(--danger); }

/* ---------- Lot 4 : tableau de bord ---------- */
:root { --series-1: #b07d22; --series-2: #3f3b34; }  /* or et anthracite, distincts aussi en niveaux de gris */
.section-label { font: 600 13px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart-card { margin: 18px 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { font: 12px var(--f-body); fill: var(--muted); }
.chart .s1, .hbar .s1, .swatch.s1 { fill: var(--series-1); background: var(--series-1); }
.chart .s2, .swatch.s2 { fill: var(--series-2); background: var(--series-2); }
.chart .hit { fill: transparent; }
.chart .bar:hover path { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.table-view { margin-top: 10px; }
.hbar-row { display: grid; gap: 6px; }
.hbar { width: 100%; height: 6px; display: block; }
.hbar .track { fill: var(--surface-2); stroke: var(--line); stroke-width: .3; }
.filters .field.check { align-self: end; padding-bottom: 8px; }
[hidden] { display: none !important; }
.chart-scroll { overflow-x: auto; }
.chart-scroll .chart { min-width: 640px; }
@media (max-width: 600px) { .stat .value { font-size: 22px; } }

/* Recherche globale (lot 5) */
.nav-search { padding: 12px 12px 0; }
.nav-search input { width: 100%; background: #1c1b18; border: 1px solid #34312a; color: #e9e5dc; border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.nav-search input::placeholder { color: #8d877b; }
.nav-search input:focus { border-color: var(--gold-bright); box-shadow: none; }
.topbar-search { margin-left: auto; color: #fff; display: inline-flex; padding: 6px; }
.search-row { display: flex; gap: 10px; align-items: center; }
.search-row input { flex: 1; min-width: 0; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { padding: 12px 18px; border-top: 1px solid var(--line); }
.result-list li:first-child { border-top: 0; }
@media (max-width: 600px) { .search-row { flex-direction: column; align-items: stretch; } }

/* Listes en cartes sur téléphone (lot 5) : chaque ligne devient un bloc, chaque cellule
   affiche son intitulé (attribut data-label). */
@media (max-width: 640px) {
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.cards td { border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  .table.cards td.right { text-align: left; }
  .table.cards td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: 12.5px; font-weight: 600; }
  .table.cards td.card-title { font-size: 15.5px; font-weight: 700; padding-bottom: 4px; }
  .table.cards td.card-title .small, .table.cards td.card-title .muted { font-weight: 400; }
  .table.cards td.card-actions { padding-top: 8px; }
  .table.cards td.card-badges:empty { display: none; }
  .table.cards td.empty { padding: 4px 0; }
  .table-wrap:has(.table.cards) { overflow-x: visible; }
}

/* ---------- Pages publiques du client : devis en ligne (lot 5) ---------- */
body.public { min-height: 100vh; }
.public-wrap { width: min(920px, calc(100% - 32px)); margin-inline: auto; }
.public-head { background: var(--black); border-bottom: 3px solid var(--gold-bright); padding: 12px 0; }
.public-head img { height: 54px; width: auto; display: block; }
.public-main { display: grid; gap: 18px; padding: 26px 0 36px; }
.public-main > * { min-width: 0; }
.public-title h1 { font-size: 28px; margin: 4px 0 6px; }
.public-title .sub { color: var(--muted); margin: 0; }
.eyebrow { font: 600 12px var(--f-display); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); }
.public-summary { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.public-total .amount { font: 700 30px var(--f-display); margin: 2px 0; }
.public-total .btn { width: 100%; }
.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: start; padding: 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); }
.consent input[type=checkbox] { margin-top: 2px; width: 20px; height: 20px; }
.consent label { font-weight: 600; }
.consent .error { grid-column: 1 / -1; color: var(--danger); font-weight: 600; font-size: 13px; }
.consent.has-error { border-color: var(--danger); }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 16px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.cgv-text { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 14px; background: var(--surface-2); font-size: 14px; }
code.hash { font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.answer-done { border-left: 4px solid var(--ok); }
.public-foot { display: grid; gap: 4px; padding: 0 0 32px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
  .public-summary, .public .form-grid { grid-template-columns: minmax(0, 1fr); }
  .public .kv { grid-template-columns: 1fr; gap: 2px; }
  .public .kv dt { margin-top: 8px; }
  .public-title h1 { font-size: 23px; }
  .public .form-actions .btn { width: 100%; }
}
@media print {
  .public-head { background: none; border-bottom-color: var(--ink); }
  .public .btn, .public details.refuse, .public #reponse { display: none !important; }
  .public .card { box-shadow: none; break-inside: avoid; }
}
/* Lien à copier (fiche devis, côté équipe) */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
@media (max-width: 600px) { .copy-row { flex-direction: column; } }
/* Colonne latérale du devis (300 px) : intitulés plus étroits ; carte « Intervention » empilée. */
.quote-layout aside .kv { grid-template-columns: 112px minmax(0, 1fr); }
.kv.kv-stack, .quote-layout aside .kv.kv-stack { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.kv.kv-stack dt { margin-top: 10px; font-size: 13px; }
.kv.kv-stack dt:first-child { margin-top: 0; }

/* ---------- Passe de design (22/10/2026) ---------- */
/* Documents liés (factures d'un devis…) : intitulé puis badges, sur deux lignes. */
.doc-item { display: grid; gap: 6px; }
.doc-item .badges { display: flex; flex-wrap: wrap; gap: 4px; }
/* Montant et bouton de suppression alignés (encaissements). */
.item-head > .num:has(form) { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 600px) {
  /* Actions d'en-tête : pleine largeur, action principale en premier. */
  .page-head > .actions { width: 100%; }
  .page-head > .actions > .btn, .page-head > .actions > form { flex: 1 1 auto; }
  .page-head > .actions > form > .btn { width: 100%; }
  .page-head > .actions > .btn-primary, .page-head > .actions > form:has(.btn-primary) { order: -1; }
}
@media (max-width: 640px) {
  /* Pipeline : une colonne et l'amorce de la suivante, défilement colonne par colonne. */
  .board { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
}
