:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --text: #1d1b19;
  --muted: #6b655e;
  --border: #e4dfd8;
  --accent: #d9480f;
  --accent-hover: #b93d0c;
  --accent-soft: #fdeee6;
  --ok: #2b8a3e;
  --ok-soft: #e6f4ea;
  --danger: #c92a2a;
  --danger-soft: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #211e1b;
    --text: #f1ece6;
    --muted: #a39b92;
    --border: #36312c;
    --accent: #ff7a3d;
    --accent-hover: #ff935f;
    --accent-soft: #3a2418;
    --ok: #69db7c;
    --ok-soft: #1d3324;
    --danger: #ff8787;
    --danger-soft: #3b1f1f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 64px; }

header.site { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.brand { font-weight: 800; letter-spacing: .02em; font-size: 1.25rem; }
.brand span { color: var(--accent); }
header.site a { color: var(--muted); font-size: .9rem; }

h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 16px; }

/* Étapes */
.steps { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: "›"; margin-right: 2px; }
.steps li.current { color: var(--text); font-weight: 600; }

/* Choix d'une personne */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.staff-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; font: inherit; transition: border-color .15s, transform .15s;
}
.staff-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.staff-btn small { display: block; color: var(--muted); }

/* Semaine */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.week-nav strong { text-align: center; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day h3 { font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; text-align: center; }
.day .slots { display: flex; flex-direction: column; gap: 6px; }
.day .none { color: var(--muted); font-size: .8rem; text-align: center; opacity: .6; }
.slot {
  font: inherit; font-size: .9rem; padding: 8px 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600;
}
.slot:hover { background: var(--accent); color: #fff; }
@media (max-width: 680px) {
  .days { grid-template-columns: 1fr; }
  .day { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
  .day h3 { text-align: left; font-size: .9rem; }
  .day .slots { flex-direction: row; flex-wrap: wrap; }
  .slot { padding: 8px 14px; }
  .day .none { text-align: left; }
}

/* Formulaires */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
label .opt { font-weight: 400; color: var(--muted); }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
a.btn { text-decoration: none; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--text); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }

.summary { background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; }
.summary strong { display: block; }

.alert { border-radius: 10px; padding: 12px 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.loading { color: var(--muted); padding: 24px 0; text-align: center; }

.big-check { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 28px; margin: 0 auto 12px; }

/* Espace équipe */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { font: inherit; background: none; border: none; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.appt-list { list-style: none; margin: 0; padding: 0; }
.appt-day { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.appt { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.appt .time { font-weight: 700; min-width: 96px; font-variant-numeric: tabular-nums; }
.appt .info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.appt .info a { color: inherit; }
.appt.cancelled { opacity: .5; }
.appt.cancelled .time { text-decoration: line-through; }
.badge { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-left: 6px; }
@media (max-width: 560px) { .appt { flex-wrap: wrap; } .appt .time { min-width: 0; width: 100%; } }

.avail-day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.avail-day > strong { padding-top: 8px; }
.ranges { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.range { display: flex; align-items: center; gap: 8px; }
.range input { width: 120px; }
.icon-btn { font: inherit; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
.link-btn { font: inherit; background: none; border: none; color: var(--accent); cursor: pointer; padding: 6px 0; font-weight: 600; }
@media (max-width: 560px) { .avail-day { grid-template-columns: 1fr; gap: 4px; } .avail-day > strong { padding-top: 0; } }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar select { width: auto; }
.inline-field { display: flex; align-items: center; gap: 10px; }
.inline-field label { margin: 0; }
.inline-field select { width: auto; }

/* Demandes de prix */
.tabs { overflow-x: auto; }
.tab { white-space: nowrap; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 700; padding: 0 6px; }
.small { font-size: .85rem; }
.with-mic { display: flex; gap: 6px; align-items: flex-start; }
.with-mic > input, .with-mic > textarea, .with-mic > select { flex: 1; min-width: 0; }
.mic {
  flex: none; width: 44px; height: 44px; border-radius: 8px; cursor: pointer; font-size: 1.1rem;
  border: 1px solid var(--border); background: var(--surface);
}
.mic:hover { border-color: var(--accent); }
.mic.listening { background: var(--danger); border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 42, 42, .45); } 50% { box-shadow: 0 0 0 8px rgba(201, 42, 42, 0); } }
@media (prefers-reduced-motion: reduce) { .mic.listening { animation: none; } }
.quote-row {
  display: flex; gap: 14px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: none; border: none; border-top: 1px solid var(--border); padding: 14px 4px;
}
.quote-row:hover { background: var(--bg); }
.quote-row .info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quote-items { margin-top: 4px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quote-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.status-devis_envoye { background: #e7f0fd; color: #1c5fc4; }
.badge.status-acceptee { background: var(--ok-soft); color: var(--ok); }
.badge.status-refusee { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) { .badge.status-devis_envoye { background: #1b2a40; color: #8ab4f8; } }

/* Agenda */
.badge.kind-sortie { background: #e7f0fd; color: #1c5fc4; margin-left: 0; }
.badge.kind-retour { background: #f3e8fd; color: #7b3fc4; margin-left: 0; }
@media (prefers-color-scheme: dark) {
  .badge.kind-sortie { background: #1b2a40; color: #8ab4f8; }
  .badge.kind-retour { background: #2d1f40; color: #c9a6f8; }
}
.agenda-event .info > * + * { margin-top: 2px; }
.agenda-event .info a { text-decoration: none; }
.agenda-event.done .info strong { text-decoration: line-through; }
.agenda-event.done { opacity: .65; }
.event-actions { flex: none; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) { .event-actions { flex-direction: row; flex-wrap: wrap; width: 100%; } }

/* Formulaire client de livraison / retrait (charte de la fiche papier) */
:root { --gold: #a07c00; --gold-soft: #fdf3c9; }
@media (prefers-color-scheme: dark) { :root { --gold: #e3bd3c; --gold-soft: #3a3115; } }
.notice { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px 16px; }
.notice p { margin: 4px 0 0; font-size: .9rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 4px 0 6px; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }
.choice input { width: auto; }
.suppl { color: var(--gold); font-size: .8rem; font-weight: 600; }
.alert.warn { background: var(--gold-soft); color: var(--text); border: 1px solid var(--gold); }
.badge.kind-suppl { background: var(--gold-soft); color: var(--gold); }

/* Dictée : ligne d'état */
.voice-status { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--bg); }
.voice-status.listening { color: var(--danger); font-weight: 600; }
.voice-status.warn { background: #fff4e0; color: #8a5300; }
.voice-status.error { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) { .voice-status.warn { background: #3a2a10; color: #f0c070; } }

/* Photos / captures jointes */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-grid:empty { display: none; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.photo.waiting { opacity: .8; border-style: dashed; }
.photo-open { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.1rem; line-height: 1;
}

/* Clients déjà connus */
.suggestions { display: flex; flex-direction: column; gap: 6px; }
.suggestions:empty { display: none; }
.suggestion {
  text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 10px 12px; min-height: 44px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere;
}
.suggestion:hover { border-color: var(--accent); }
details.small summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* Catalogue du matériel */
.catalogue-bar { display: flex; gap: 6px; }
.catalogue-bar .qty { width: 72px; flex: none; text-align: center; }
.catalogue-bar input[type=search] { flex: 1; min-width: 0; }
.catalogue-results { display: flex; flex-direction: column; gap: 6px; }
.catalogue-results:empty { display: none; }

/* États des lieux */
.edl-line { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.edl-line.bad { border-color: #e8a33d; background: #fffaf0; }
@media (prefers-color-scheme: dark) { .edl-line.bad { background: #2c2416; } }
.edl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; overflow-wrap: anywhere; }
.edl-head input { flex: 1; }
.edl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.edl-row .qty { width: 80px; flex: none; text-align: center; }
.edl-row > input:not(.qty) { flex: 1; min-width: 160px; }
.segs { display: flex; flex: 1; min-width: 220px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg { flex: 1; min-height: 44px; border: none; border-left: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: .85rem; cursor: pointer; padding: 0 4px; }
.seg:first-child { border-left: none; }
.seg[aria-pressed="true"] { background: var(--ok); color: #fff; font-weight: 700; }
.seg-abime[aria-pressed="true"], .seg-sale[aria-pressed="true"] { background: #d9822b; }
.seg-manquant[aria-pressed="true"] { background: var(--danger); }

/* Préparation */
.progress { height: 10px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--ok); transition: width .2s; }
.prep-lines { gap: 8px; }
.prep-line {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; text-align: left;
  font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.prep-line.done { background: var(--ok-soft); border-color: var(--ok); }
.prep-line.done .prep-text > span:first-child { text-decoration: line-through; opacity: .75; }
.prep-box { flex: none; width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 700; color: #fff; }
.prep-line.done .prep-box { background: var(--ok); border-color: var(--ok); }
.prep-text { display: flex; flex-direction: column; overflow-wrap: anywhere; }

/* Pastille de l'onglet « À facturer » */
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; }

/* Prospection */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; user-select: none; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.prospect-map { height: 380px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; z-index: 0; }
@media (max-width: 560px) { .prospect-map { height: 300px; } }
.prospect-result { cursor: pointer; }
.prospect-result.active { border-color: var(--accent); background: var(--accent-soft); }
.edl-row a { color: var(--accent); font-weight: 600; text-decoration: none; }
.edl-row a.btn { color: #fff; }
.edl-row a.btn.ghost { color: var(--text); }
.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.pr-stat { font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pr-stat:hover { border-color: var(--accent); }
.pr-stat strong { display: block; font-size: 1.4rem; line-height: 1.2; }
.pr-stat span { color: var(--muted); font-size: .8rem; }
.pr-stat.urgent strong { color: var(--accent); }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 12px; }
.pr-grid label { font-weight: 500; color: var(--muted); }
.pr-grid input { padding: 8px 10px; color: var(--text); margin-top: 2px; }
.pr-statut { width: auto; flex: none; font-weight: 600; padding: 6px 10px; }
.s-a-appeler { background: #eef2ff; } .s-a-rappeler { background: #fff4e5; } .s-interesse { background: #e7f6ec; }
.s-devis { background: #e6f4f8; } .s-client { background: #d3f0dc; } .s-pas-interesse { background: #f1f1f1; }
@media (prefers-color-scheme: dark) {
  .s-a-appeler { background: #1f2440; } .s-a-rappeler { background: #3a2a10; } .s-interesse { background: #1d3324; }
  .s-devis { background: #16303a; } .s-client { background: #1d3a26; } .s-pas-interesse { background: #2a2826; }
}
.pr-call { background: var(--bg); border-radius: 10px; padding: 12px; }
.pr-call label { font-weight: 500; color: var(--muted); }
.pr-call-btn { background: var(--ok); border-color: var(--ok); }
.pr-call-btn:hover { background: var(--ok); border-color: var(--ok); filter: brightness(.92); }
.pr-history { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--border); font-size: .85rem; }
.pr-history li { padding: 6px 0; border-bottom: 1px dashed var(--border); overflow-wrap: anywhere; }
.leaflet-container a { color: var(--accent); }

/* Bugs et idées : bouton flottant 🐞 + formulaire */
.fb-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 900;
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 1.5rem; cursor: pointer; display: grid; place-items: center;
}
.fb-fab:hover { border-color: var(--accent); }
.fb-fab:disabled { cursor: wait; }
.fb-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--surface); color: var(--text); }
.fb-dialog::backdrop { background: rgba(0,0,0,.45); }
.wrap { padding-bottom: 96px; }
.badge.fb-nouveau { background: var(--accent-soft); color: var(--accent); }
.badge.fb-en_cours { background: #e7f0fd; color: #1c5fc4; }
.badge.fb-fait { background: var(--ok-soft); color: var(--ok); }
.badge.fb-refuse { background: var(--border); color: var(--muted); }
@media (prefers-color-scheme: dark) { .badge.fb-en_cours { background: #1b2a40; color: #8ab4f8; } }
.badge.kind-rdv { background: var(--ok-soft); color: var(--ok); margin-left: 0; }
.pr-rdv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ok-soft); border-radius: 8px; padding: 8px 12px; }
/* ---- CRM : clients, devis, tâches, tableau de bord ---- */
.section { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.section + .section, .kpis + .section, .section + details.section, details.section { margin-top: 0; }
details.section > summary { cursor: pointer; }
details.section[open] > summary { margin-bottom: 12px; }
.client-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; }
.client-row:hover { border-color: var(--text); }
.client-main { display: flex; flex-direction: column; min-width: 0; }
.client-main strong, .client-main span { overflow-wrap: anywhere; }
.client-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.client-side .badge { margin-left: 0; }
.badge.kind-particulier { background: #eef1f4; color: #4b5a61; margin-left: 0; }
.badge.kind-professionnel { background: #fbf1c9; color: #7a5c00; margin-left: 0; }
.badge.devis-brouillon { background: #eef1f4; color: #4b5a61; }
.badge.devis-envoye { background: #e7f0fd; color: #1c5fc4; }
.badge.devis-accepte { background: var(--ok-soft); color: var(--ok); }
.badge.devis-refuse, .badge.devis-annule { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) {
  .badge.kind-particulier, .badge.devis-brouillon { background: #2a2f33; color: #c3ccd0; }
  .badge.kind-professionnel { background: #2f2805; color: #e8c64a; }
  .badge.devis-envoye { background: #1b2a40; color: #8ab4f8; }
}
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); min-width: 0; }
.kpi strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi.bad strong { color: var(--danger); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { border-left: 3px solid var(--border); padding-left: 10px; }
.task { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.task.late { border-color: var(--danger); }
.task-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-main .badge { margin-left: 0; }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
@media (max-width: 520px) { .task { flex-wrap: wrap; } .task-actions { width: 100%; justify-content: flex-end; } }
.table-scroll { overflow-x: auto; }
table.mini, table.devis-edit { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.mini th, table.mini td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.mini .num, table.devis-edit .num { text-align: right; font-variant-numeric: tabular-nums; }
table.devis-edit th { text-align: left; font-size: .8rem; color: var(--muted); padding: 4px; }
table.devis-edit td { padding: 4px; vertical-align: top; }
table.devis-edit td:first-child { min-width: 220px; }
table.devis-edit td:first-child textarea { margin-top: 4px; min-height: 0; font-size: .85rem; }
table.devis-edit input.num { width: 90px; }
table.devis-edit select { min-width: 100px; }
table.devis-edit td.num { white-space: nowrap; padding-top: 12px; }
table.devis-edit tr.todo input:first-child { border-color: var(--danger); }
.devis-edit-totals { display: flex; flex-direction: column; gap: 4px; max-width: 340px; margin-left: auto; width: 100%; font-variant-numeric: tabular-nums; }
.devis-edit-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.devis-edit-totals .grand { border-top: 1px solid var(--border); padding-top: 6px; font-size: 1.1rem; }
.devis-preview { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px; overflow-x: auto; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 180px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar { width: 100%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .7rem; }
.bar-lab { font-size: .7rem; }

/* ---- Document de devis (page client + aperçu), aux couleurs ZALOC : noir, or #D5AD04 ---- */
.devis-doc { background: #fff; color: #111; border-radius: 12px; padding: 32px; box-shadow: var(--shadow); font-size: .92rem; line-height: 1.45; }
.devis-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 3px solid #D5AD04; padding-bottom: 16px; }
.devis-logo { font-weight: 800; font-size: 1.9rem; letter-spacing: .04em; color: #000; }
.devis-logo span { color: #D5AD04; }
.devis-client { border: 1px solid #d5d8da; border-radius: 8px; padding: 10px 14px; min-width: 220px; }
.devis-label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #4b5a61; font-weight: 700; }
.devis-muted { color: #4b5a61; }
.devis-small { font-size: .82rem; }
.devis-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 8px; }
.devis-title h1 { margin: 0; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; }
.devis-stamp { border: 2px solid; border-radius: 6px; padding: 2px 10px; font-weight: 800; text-transform: uppercase; font-size: .8rem; }
.devis-stamp.ok { color: #1f7a45; } .devis-stamp.bad { color: #b4323a; }
.devis-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; margin: 0 0 18px; }
.devis-meta dt { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #4b5a61; font-weight: 700; }
.devis-meta dd { margin: 0; }
.devis-table { width: 100%; border-collapse: collapse; }
.devis-table th { background: #000; color: #fff; text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; padding: 8px; }
.devis-table td { border-bottom: 1px solid #e4e6e7; padding: 8px; vertical-align: top; }
.devis-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.devis-table tr.remise td { color: #b4323a; }
.devis-totals { margin: 14px 0 0 auto; max-width: 320px; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.devis-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.devis-totals .grand { border-top: 2px solid #000; padding-top: 6px; font-weight: 800; font-size: 1.15rem; }
.devis-notes { margin-top: 18px; background: #faf6e6; border-left: 3px solid #D5AD04; padding: 10px 14px; border-radius: 4px; }
.devis-terms { margin-top: 18px; color: #333; }
.devis-terms ul { margin: 6px 0 8px; padding-left: 18px; }
.devis-accepted { margin-top: 14px; border: 2px solid #1f7a45; color: #1f7a45; border-radius: 8px; padding: 10px 14px; font-weight: 600; }
.devis-foot { margin-top: 22px; border-top: 1px solid #d5d8da; padding-top: 10px; font-size: .72rem; color: #4b5a61; text-align: center; }
.devis-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.devis-accept { margin-top: 16px; }
.devis-page .wrap { padding-top: 16px; }
@media (max-width: 560px) { .devis-doc { padding: 18px; } .devis-table th:nth-child(3), .devis-table td:nth-child(3) { display: none; } }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .no-print, header.site, .tabs { display: none !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .devis-doc { box-shadow: none; padding: 0; border-radius: 0; }
  .devis-table tr { break-inside: avoid; }
}
.card > .section, .card > .kpis, .card > .grid2, .card > .edl-row, .card > .alert { margin-top: 12px; }
.grid2 > .section { margin-top: 0; }
.city-chip { gap: 6px; background: var(--accent-soft); border-color: var(--accent); color: var(--accent); cursor: default; }
.chip-x { font: inherit; border: none; background: none; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.city-list { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-height: 320px; overflow-y: auto; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; margin-top: 6px; }
