/* ==========================================================================
   TechServ Pro 3.0 — Système de design
   Direction : « bon d'intervention » — bleu nuit d'atelier, orange de signalisation,
   repères de schéma électrique. Un seul élément signature : le traceur « circuit ».
   ========================================================================== */

@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --ink: #0E1B3D;
  --ink-2: #172650;
  --ink-3: #24356A;
  --signal: #C84B06;          /* boutons : contraste AA avec le blanc */
  --signal-hover: #A33D05;
  --signal-bright: #F2620F;   /* repères, accents non textuels */
  --signal-soft: #FFF0E6;

  --paper: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --line: #E1E6EE;
  --line-strong: #C8D0DD;
  --text: #0E1B3D;
  --text-2: #3F4B66;
  --muted: #66718B;

  --green: #137333;  --green-bg: #E6F4EA;
  --amber: #925400;  --amber-bg: #FEF3DC;
  --red: #B3261E;    --red-bg: #FCE8E6;
  --blue: #1A56C7;   --blue-bg: #E8F0FE;
  --violet: #6236C2; --violet-bg: #F0EBFC;
  --grey: #4F5A72;   --grey-bg: #EDF0F4;

  --font-ui: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Couleurs personnalisables (Paramètres › Apparence) */
  --sidebar-bg: #0E1B3D;
  --sidebar-text: #DCE3F2;
  --nav-active-bg: rgba(255, 255, 255, .1);
  --nav-active-text: #FFFFFF;
  --nav-accent: #F2620F;
  --topbar-bg: #FFFFFF;
  --topbar-text: #0E1B3D;
  --btn-text: #FFFFFF;
  --r-control: 22px;

  --r-xs: 4px; --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --shadow-pop: 0 12px 32px -8px rgba(14, 27, 61, .22), 0 2px 6px rgba(14, 27, 61, .08);
  --focus: 0 0 0 3px rgba(242, 98, 15, .35);
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A1128; --surface: #101A36; --surface-2: #0D1630;
    --line: #22305A; --line-strong: #314476;
    --text: #E8EDF7; --text-2: #BAC4DA; --muted: #8C98B4;
    --signal-soft: #3A1E0C;
    --green: #6FD08C; --green-bg: #12301E; --amber: #F2B84B; --amber-bg: #33260A;
    --red: #FF8A80; --red-bg: #3A1513; --blue: #8AB4F8; --blue-bg: #13254A;
    --violet: #B9A3F5; --violet-bg: #251A45; --grey: #AAB4CA; --grey-bg: #1B2646;
    --topbar-bg: #0D1630; --topbar-text: #E8EDF7;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A1128; --surface: #101A36; --surface-2: #0D1630;
  --line: #22305A; --line-strong: #314476;
  --text: #E8EDF7; --text-2: #BAC4DA; --muted: #8C98B4;
  --signal-soft: #3A1E0C;
  --green: #6FD08C; --green-bg: #12301E; --amber: #F2B84B; --amber-bg: #33260A;
  --red: #FF8A80; --red-bg: #3A1513; --blue: #8AB4F8; --blue-bg: #13254A;
  --violet: #B9A3F5; --violet-bg: #251A45; --grey: #AAB4CA; --grey-bg: #1B2646;
  --topbar-bg: #0D1630; --topbar-text: #E8EDF7;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--paper);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0;
}
img, svg { display: block; max-width: 100%; }
.icon { flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); }
h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--signal); }
code { font-size: .9em; background: var(--grey-bg); padding: .1em .35em; border-radius: var(--r-xs); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
::selection { background: var(--signal-bright); color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; color: #fff; }

/* ── Boutons ──────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 20px; border-radius: var(--r-control);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font: 600 14px/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { color: var(--btn-fg); border-color: var(--text-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn--primary { --btn-bg: var(--signal); --btn-fg: var(--btn-text); --btn-bd: var(--signal); }
.btn--primary:hover { --btn-bg: var(--signal-hover); border-color: var(--signal-hover); color: var(--btn-text); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn--ink:hover { --btn-bg: var(--ink-3); color: #fff; }
.btn--ghost { --btn-bg: transparent; }
.btn--danger { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: var(--red); }
:root[data-theme="dark"] .btn--danger { --btn-fg: #2a0905; }
.btn--danger:hover { color: #fff; filter: brightness(.92); }
.btn--danger-ghost { --btn-bg: transparent; --btn-fg: var(--red); --btn-bd: transparent; }
.btn--danger-ghost:hover { background: var(--red-bg); color: var(--red); border-color: transparent; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--grey-bg); color: var(--text); }
.icon-btn--danger:hover { background: var(--red-bg); color: var(--red); }
.icon-btn--dark { color: color-mix(in srgb, var(--sidebar-text) 75%, transparent); }
.icon-btn--dark:hover { background: color-mix(in srgb, var(--sidebar-text) 12%, transparent); color: var(--sidebar-text); }
.dot-count {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--signal-bright); color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--surface);
}
.inline-form { display: inline; margin: 0; }

/* ── Formulaires ──────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.stack--sm { gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13.5px; font-weight: 650; color: var(--text); }
.field small, .hint { font-size: 12.5px; color: var(--muted); }
.req { color: var(--signal); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 16px;
  font: 500 14.5px/1.4 var(--font-ui); color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2366718B' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--text-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal-bright); box-shadow: var(--focus); }
input[type=file] { font: inherit; font-size: 13.5px; color: var(--text-2); max-width: 100%; }
input[type=file]::file-selector-button { font: 600 13px var(--font-ui); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); border-radius: var(--r-control); padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=color] { padding: 4px 6px; width: 64px; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--signal); margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 2px; }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap > input { padding-left: 44px !important; }
.input-wrap .reveal { right: 6px; border-radius: 50%; }
.input-wrap .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 18px; margin: 0; display: block; min-width: 0; }
.fieldset > * + * { margin-top: 14px; }
.fieldset > legend + * { margin-top: 0; }
.fieldset legend { font-weight: 700; font-size: 14px; padding: 0 6px; white-space: nowrap; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.strength { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s, background .25s; }

/* Choix « segmentés » (urgence, rôle…) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: grid; gap: 2px; padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  font-size: 14px; font-weight: 650; cursor: pointer; background: var(--surface); height: 100%;
}
.choice small { font-weight: 500; color: var(--muted); font-size: 12px; }
.choice input:checked + span { border-color: var(--signal-bright); box-shadow: inset 0 0 0 1px var(--signal-bright); background: var(--signal-soft); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

.choices--aide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .choices--3 { grid-template-columns: 1fr; } }
.fieldset--plain { border: 0; padding: 0; }
.fieldset--plain legend { padding: 0; margin-bottom: 8px; }

/* Grille d'icônes */
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-pick label { position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: grid; place-items: center; height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--text-2); }
.icon-pick input:checked + span { border-color: var(--signal-bright); color: var(--signal); background: var(--signal-soft); }
.icon-pick input:focus-visible + span { box-shadow: var(--focus); }

/* ── Alertes, badges ──────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert--error   { background: var(--red-bg);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert--success { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert--info    { background: var(--blue-bg);  color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert--warning { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert a { color: inherit; font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; line-height: 1.35; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--green  { background: var(--green-bg);  color: var(--green); }
.badge--amber  { background: var(--amber-bg);  color: var(--amber); }
.badge--red    { background: var(--red-bg);    color: var(--red); }
.badge--blue   { background: var(--blue-bg);   color: var(--blue); }
.badge--violet { background: var(--violet-bg); color: var(--violet); }
.badge--grey   { background: var(--grey-bg);   color: var(--grey); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); }

/* ── Signature : traceur « circuit » ──────────────────────── */
.circuit { --node: 12px; display: flex; list-style: none; margin: 0; padding: 0; align-items: center; }
.circuit__node { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.circuit__node::before {   /* le fil entre deux bornes */
  content: ""; position: absolute; top: calc(var(--node) / 2 - 1px); right: 50%; width: 100%; height: 2px;
  background: var(--line-strong);
}
.circuit__node:first-child::before { display: none; }
.circuit__node.is-done::before, .circuit__node.is-now::before { background: var(--ink); }
:root[data-theme="dark"] .circuit__node.is-done::before, :root[data-theme="dark"] .circuit__node.is-now::before { background: var(--text-2); }
.circuit__dot { position: relative; z-index: 1; width: var(--node); height: var(--node); border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.circuit__node.is-done .circuit__dot { background: var(--ink); border-color: var(--ink); }
:root[data-theme="dark"] .circuit__node.is-done .circuit__dot { background: var(--text-2); border-color: var(--text-2); }
.circuit__node.is-now .circuit__dot { background: var(--signal-bright); border-color: var(--signal-bright); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal-bright) 22%, transparent); }
.circuit__label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; }
.circuit__node.is-now .circuit__label { color: var(--text); font-weight: 750; }
.circuit__node.is-done .circuit__label { color: var(--text-2); }
.circuit--compact { --node: 9px; width: 92px; }
.circuit--compact .circuit__node { gap: 0; }
.circuit--off { opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
  .circuit:not(.circuit--compact) .circuit__node.is-now .circuit__dot { animation: live 2.4s var(--ease) infinite; }
}
@keyframes live { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal-bright) 22%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--signal-bright) 0%, transparent); } }

/* ── Coque applicative ────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar-w);
  display: flex; flex-direction: column; background: var(--sidebar-bg); color: var(--sidebar-text);
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px 18px; }
.sidebar__close { display: none; color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: inherit; }
.brand__mark { display: grid; place-items: center; flex-shrink: 0; border-radius: 9px; background: var(--signal-bright); color: #fff; }
.brand__mark .icon { fill: #fff; stroke: #fff; stroke-width: 1.2; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.sidebar .brand { color: var(--sidebar-text); }
.brand--light { color: #fff; }
.brand__logo { display: block; max-height: 40px; max-width: 170px; width: auto; object-fit: contain; }
.sidebar .brand__logo { background: #fff; padding: 4px 8px; border-radius: 10px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { padding-top: 14px; }
.nav-group__label { margin: 0 0 4px; padding: 0 10px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--sidebar-text) 55%, transparent); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0;
  border-radius: var(--r-control); color: color-mix(in srgb, var(--sidebar-text) 85%, transparent); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: color-mix(in srgb, var(--sidebar-text) 9%, transparent); color: var(--sidebar-text); }
.nav-link.is-active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-accent); }
.nav-link.is-active .icon { color: var(--nav-accent); }
.nav-link__count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--signal-bright); color: #fff; font-size: 11.5px; font-weight: 800; text-align: center; }
.nav-link--cta { margin: 6px 0 8px; border: 1px dashed rgba(242,98,15,.6); color: #fff; }
.nav-link--cta .icon { color: var(--signal-bright); }
.nav-link--cta:hover { background: rgba(242,98,15,.12); }
.sidebar__foot { display: flex; align-items: center; gap: 6px; padding: 12px 10px 12px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-control); color: var(--sidebar-text); text-decoration: none; }
.who:hover { background: rgba(255,255,255,.06); color: #fff; }
.who__text { display: grid; min-width: 0; line-height: 1.25; }
.who__text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__text small { font-size: 12px; color: color-mix(in srgb, var(--sidebar-text) 65%, transparent); }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-3); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.avatar--xl { width: 88px; height: 88px; font-size: 26px; border-radius: 18px; }
.avatar--light { background: var(--grey-bg); color: var(--text-2); }
img.avatar { background: var(--grey-bg); }

.workspace { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: var(--topbar-bg); color: var(--topbar-text);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__crumb { font-size: 14px; font-weight: 600; color: var(--topbar-text); opacity: .75; }
.topbar .icon-btn { color: var(--topbar-text); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; color: var(--text-2); text-decoration: none; }
.back-link:hover { color: var(--text); }
.topbar__tools { display: flex; align-items: center; gap: 4px; }
.topbar__search { position: relative; margin-right: 6px; }
.topbar__search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar__search input { width: 280px; min-height: 38px !important; padding-left: 38px !important; background: var(--surface) !important; }
.theme-dark { display: none; }
:root[data-theme="dark"] .theme-dark { display: inline; }
:root[data-theme="dark"] .theme-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-light { display: none; }
}

.main { flex: 1; width: 100%; max-width: 1320px; padding: 28px 28px 64px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scrim { display: none; }

/* ── Cloche de notifications ── */
.notif { position: relative; }
.notif-menu { position: absolute; right: -8px; top: calc(100% + 10px); z-index: 70; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .16s var(--ease); }
.notif-menu__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-menu__head a { font-size: 13px; font-weight: 600; }
.notif-menu__pending { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--signal-soft); color: var(--text); text-decoration: none; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.notif-menu__pending > .icon:first-child { color: var(--signal); }
.notif-menu__pending span { flex: 1; }
.notif-menu__pending:hover { color: var(--text); filter: brightness(.97); }
.notif-menu__list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.notif-menu__list li { border-bottom: 1px solid var(--line); }
.notif-menu__list li:last-child { border-bottom: 0; }
.notif-menu__list a { display: flex; gap: 10px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.notif-menu__list a:hover { background: var(--surface-2); }
.notif-menu__list .cat-icon { width: 32px; height: 32px; border-radius: 50%; }
.notif-menu__list li.is-unread a { background: color-mix(in srgb, var(--signal-bright) 6%, transparent); }
.notif-menu__list li.is-unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--signal-bright); vertical-align: middle; }
.notif-menu__text { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; }
.notif-menu__text small { font-size: 12.5px; color: var(--text-2); }
.notif-menu__text small.muted { color: var(--muted); }
.notif-menu__empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.notif-menu__foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.notif-menu__foot { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Panneaux ─────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel__head h2 { font-size: 1.02rem; }
.panel__head p { margin: 2px 0 0; font-size: 13.5px; }
.panel__body { padding: 20px; }
.panel__foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.panel--flush .panel__body { padding: 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.layout-2 > div > .panel + .panel, .layout-2 > aside > .panel + .panel { margin-top: 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.section-gap { margin-top: 18px; }

/* Bande d'indicateurs : un seul panneau segmenté plutôt que des cartes identiques */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "value value" "hint hint"; column-gap: 8px; row-gap: 6px; padding: 18px 20px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); border-top: 3px solid var(--stat-accent, var(--signal-bright)); transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: var(--text-2); border-top-color: var(--stat-accent, var(--signal-bright)); color: inherit; }
.stat__icon { grid-area: icon; color: var(--stat-accent, var(--signal-bright)); display: grid; place-items: center; }
.stat__label { grid-area: label; font-size: 13.5px; font-weight: 650; color: var(--text-2); align-self: center; }
.stat__value { grid-area: value; font-family: var(--font-display); font-size: 1.85rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__hint { grid-area: hint; font-size: 12.5px; color: var(--muted); }
.stat__hint strong { color: var(--signal); }

/* Liste de définitions */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ── Tableaux ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.table .row-link { color: var(--text); font-weight: 700; text-decoration: none; }
.table .row-link:hover { color: var(--signal); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main__text { display: grid; min-width: 0; line-height: 1.35; }
.cell-main__text small { color: var(--muted); font-size: 12.5px; }
.ref { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--text); white-space: nowrap; }
tr.is-inactive td { opacity: .55; }

/* Barre de filtres */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-size: 13.5px; font-weight: 650; }
.tabs a:hover { background: var(--grey-bg); color: var(--text); }
.tabs a.is-active { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .tabs a.is-active { background: var(--text); color: var(--ink); }
.tabs .count { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.toolbar form { display: flex; gap: 8px; }
.toolbar input[type=search] { min-height: 36px !important; width: 240px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.pager__info { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager__info strong { color: var(--text); font-weight: 600; }
.pager__per { margin: 0; }
.pager__per label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.pager__per select { width: auto !important; min-height: 34px !important; padding: 4px 32px 4px 14px !important; font-size: 13.5px !important; background-position: right 12px center; }
.pager__links { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(14,27,61,.06); }
.pager__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-weight: 650; font-size: 14px; text-decoration: none; font-variant-numeric: tabular-nums; transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .1s; }
.pager__btn--nav { padding: 0 14px; color: var(--text); background: var(--surface-2); border-color: var(--line); }
.pager__btn--edge { min-width: 38px; padding: 0; color: var(--muted); }
a.pager__btn:hover { border-color: color-mix(in srgb, var(--signal) 45%, transparent); color: var(--signal); background: var(--signal-soft); }
a.pager__btn:active { transform: translateY(1px); }
a.pager__btn:focus-visible { box-shadow: var(--focus); }
.pager__btn.is-current { background: var(--signal); border-color: var(--signal); color: var(--btn-text); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--signal) 75%, transparent); }
.pager__btn.is-disabled { opacity: .4; cursor: not-allowed; background: transparent; border-color: transparent; }
.pager__gap { min-width: 22px; text-align: center; color: var(--muted); font-weight: 700; letter-spacing: .08em; }
.pager__pages { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--grey-bg); color: var(--text-2); font-size: 12.5px; font-weight: 650; }
.panel > .pager:first-child { border-top: 0; }
.panel--pager { overflow: hidden; }
.panel--pager .pager { border-top: 0; }
@media (max-width: 720px) {
  .pager { justify-content: center; }
  .pager__info { justify-content: center; width: 100%; }
  .pager__btn--nav span { display: none; }
  .pager__btn--nav { padding: 0 10px; }
}

/* ── États vides ──────────────────────────────────────────── */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 1rem; }
.empty p { max-width: 42ch; margin: 0 0 6px; }

/* ── Dialogues ────────────────────────────────────────────── */
.dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.dialog--sm { width: min(420px, calc(100vw - 32px)); }
.dialog--lg { width: min(860px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(8, 14, 34, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog__title { font-size: 1.1rem; }
.dialog__body { padding: 20px; display: grid; gap: 16px; }
.dialog__body > p { margin: 0; }
.dialog__actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.dialog form.dialog__body { margin: 0; }

/* ── Toasts ───────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); animation: pop .2s var(--ease); }
.toast--success .icon { color: #7FE0A0; }
.toast--error { background: #7A1912; }
.toast--info .icon { color: #9DBEFF; }
.toast.is-hiding { opacity: 0; transform: translateY(6px); transition: .25s; }

/* ── Fil de messages ──────────────────────────────────────── */
.thread { display: grid; gap: 12px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; display: grid; gap: 4px; }
.msg__bubble { padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--grey-bg); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__meta { font-size: 12px; color: var(--muted); }
.msg--me { justify-self: end; }
.msg--me .msg__bubble { background: var(--ink); color: #fff; border-radius: 14px 14px 4px 14px; }
:root[data-theme="dark"] .msg--me .msg__bubble { background: var(--ink-3); }
.msg--me .msg__meta { text-align: right; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; }
.composer textarea { min-height: 44px; height: 44px; }

/* Chronologie */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
:root[data-theme="dark"] .timeline li::before { background: var(--text-2); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li:first-child::before { background: var(--signal-bright); }
.timeline small { display: block; color: var(--muted); font-size: 12.5px; }

/* Listes simples */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__main small { color: var(--muted); font-size: 12.5px; }
.list a.list__main { color: inherit; text-decoration: none; }
.list a.list__main:hover strong { color: var(--signal); }
.list--compact > li { padding: 10px 16px; }
.unread { position: relative; }
.unread::after { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--signal-bright); }

/* Carte de catégorie / service */
.cat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; color: var(--cat, var(--blue)); background: color-mix(in srgb, var(--cat, var(--blue)) 12%, transparent); }
.cat-icon--lg { width: 48px; height: 48px; border-radius: 12px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; }
.svc { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.svc h3 { font-size: 15px; font-family: var(--font-ui); font-weight: 750; letter-spacing: 0; }
.svc p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.svc__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.svc__meta strong { color: var(--text); }
.svc.is-off { opacity: .5; }

/* Fiches techniciens */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; align-content: start; }
.person__top { display: flex; gap: 14px; align-items: center; }
.person__top h3 { font-family: var(--font-ui); font-size: 15.5px; font-weight: 750; letter-spacing: 0; }
.person__info { display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.person__info span { display: flex; align-items: center; gap: 8px; }
.person__info .icon { color: var(--muted); }
.person__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stars { display: inline-flex; gap: 1px; color: var(--line-strong); }
.stars .is-on { color: #E9A100; }
.stars .is-on .icon { fill: currentColor; }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-input input { position: absolute; opacity: 0; }
.rating-input label { cursor: pointer; color: var(--line-strong); }
.rating-input label .icon { width: 30px; height: 30px; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #E9A100; }
.rating-input input:checked ~ label .icon, .rating-input label:hover .icon, .rating-input label:hover ~ label .icon { fill: currentColor; }
.rating-input input:focus-visible + label { box-shadow: var(--focus); border-radius: 4px; }

/* Graphiques */
.chart-box { position: relative; height: 230px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13.5px; }
.bar__track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--grey-bg); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 4px; background: var(--ink); }
:root[data-theme="dark"] .bar__fill { background: var(--blue); }
.bar__fill--signal { background: var(--signal-bright) !important; }

/* Légende des diagrammes circulaires */
.legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.legend li { display: grid; grid-template-columns: auto 1fr auto 48px; align-items: center; gap: 10px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
:root[data-theme="dark"] .legend__dot { background: var(--c-dark); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .legend__dot { background: var(--c-dark); } }
.legend .muted { text-align: right; font-size: 12.5px; }
.legend--inline { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 12px; }
.legend--inline li { display: flex; gap: 8px; }
.legend--inline strong { color: var(--muted); font-weight: 500; }

/* Éditeur de lignes (cotations) */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 12.5px; color: var(--muted); font-weight: 700; text-align: left; padding: 0 6px 8px; }
.lines td { padding: 4px 6px; vertical-align: top; }
.lines input { min-height: 38px !important; }
.lines .col-qty { width: 90px; }
.lines .col-pu { width: 150px; }
.lines .col-total { width: 140px; text-align: right; font-weight: 700; padding-top: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .col-x { width: 44px; }
.totals { margin-left: auto; width: min(340px, 100%); display: grid; gap: 8px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { padding-top: 10px; border-top: 2px solid var(--text); font-size: 1.15rem; font-weight: 800; }

/* Fichiers / vignettes */
.thumb { width: 100%; max-height: 160px; object-fit: contain; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); padding: 10px; }
.thumb--cover { object-fit: cover; padding: 0; height: 160px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.swatch { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); cursor: pointer; }
.swatch input[type=color] { width: 52px; height: 52px; border-radius: 50%; padding: 3px; flex-shrink: 0; cursor: pointer; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatch span { display: grid; gap: 2px; font-size: 14px; }
.swatch small { color: var(--muted); font-size: 12.5px; }
.file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Barre d'onglets mobile (espace client) */
.tabbar { display: none; }

/* ── Pages d'authentification ─────────────────────────────── */
.auth-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 36px 48px; background: var(--ink); color: #fff;
}
.auth-aside::before, .hero::before { /* trame de plan technique */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 80%);
}
.auth-aside > * { position: relative; }
.auth-aside--cover { background: linear-gradient(180deg, rgba(8,14,34,.55) 0%, rgba(8,14,34,.35) 45%, rgba(8,14,34,.85) 100%), var(--cover) center / cover no-repeat, var(--ink); }
.auth-aside--cover::before { display: none; }
.site-nav .brand__logo, .auth-aside .brand__logo { background: #fff; padding: 4px 8px; border-radius: 10px; }
.auth-aside__ticket { display: grid; place-items: center; flex: 1; }
.auth-aside__note { color: rgba(220,227,242,.7); font-size: 14px; margin: 0; max-width: 46ch; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-card h1 { font-size: 1.75rem; }
.auth-card__lead { margin: -8px 0 0; }
.auth-card__brand { display: none; }
.auth-card .foot { text-align: center; font-size: 14px; color: var(--muted); }
.auth-card .foot a { font-weight: 700; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-size: 13px; font-weight: 650; }
.label-row label { font-size: 13.5px; font-weight: 650; color: var(--text); }

/* Le ticket d'intervention (visuel signature) */
.ticket {
  width: min(400px, 100%); background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: 20px 22px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); display: grid; gap: 12px; position: relative;
}
.ticket::before, .ticket::after { /* encoches de souche détachable */
  content: ""; position: absolute; top: 58px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink);
}
.ticket::before { left: -9px; } .ticket::after { right: -9px; }
.ticket__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1.5px dashed var(--line-strong); }
.ticket__ref { font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ticket__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 650; }
.ticket__meta { display: flex; align-items: center; gap: 6px; margin: -4px 0 6px; font-size: 13.5px; color: var(--muted); }
.ticket .circuit { margin: 6px 0 4px; }
.ticket__foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.ticket__foot span:last-child { display: grid; line-height: 1.3; font-size: 13.5px; }
.ticket__foot small { color: var(--muted); font-size: 12.5px; }

/* Écrans centrés (maintenance, installation, hors-ligne) */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.notice-card { max-width: 460px; display: grid; gap: 14px; justify-items: start; }
.install { min-height: 100vh; display: grid; place-items: start center; padding: 40px 16px; }
.install__card { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: grid; gap: 18px; }
.install__brand { display: flex; align-items: center; gap: 12px; }
.install__brand div { display: grid; line-height: 1.3; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist .is-ok .icon, .checklist li > .icon { color: var(--green); }
.checklist .is-ko { color: var(--red); }
.checklist .is-ko .icon { color: var(--red); }

/* ── Page d'accueil publique ──────────────────────────────── */
.site-nav { position: absolute; inset: 0 0 auto; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 4vw, 56px); }
.site-nav .brand { color: #fff; }
.site-nav__links { display: flex; gap: 8px; align-items: center; }
.site-nav__links a:not(.btn) { color: rgba(255,255,255,.8); text-decoration: none; font-weight: 650; font-size: 14.5px; padding: 8px 10px; }
.site-nav__links a:not(.btn):hover { color: #fff; }
.btn--on-dark { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.35); }
.btn--on-dark:hover { --btn-bg: rgba(255,255,255,.08); color: #fff; border-color: #fff; }
.hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 132px clamp(16px, 4vw, 56px) 88px; }
.hero__inner { position: relative; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.1rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; max-width: 15ch; }
.hero__lead { margin: 22px 0 30px; font-size: 1.12rem; line-height: 1.6; color: rgba(220,227,242,.82); max-width: 48ch; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__proof { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; color: rgba(220,227,242,.75); }
.hero__proof strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: #fff; font-weight: 650; }
.hero__ticket { display: grid; justify-items: center; }
.hero__ticket .ticket { transform: rotate(-2deg); }
.hero__ticket .ticket::before, .hero__ticket .ticket::after { background: var(--ink); }

.site-section { padding: 80px clamp(16px, 4vw, 56px); }
.site-section__inner { max-width: 1200px; margin: 0 auto; }
.site-section h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); letter-spacing: -.03em; max-width: 22ch; }
.site-section .lead { color: var(--text-2); font-size: 1.05rem; max-width: 56ch; margin-top: 12px; }
.catalog { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.catalog__item { padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: grid; gap: 10px; align-content: start; }
.catalog__item h3 { font-size: 1.08rem; }
.catalog__item p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.catalog__item ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.catalog__item li { display: flex; justify-content: space-between; gap: 8px; }
.catalog__item li strong { color: var(--text); font-weight: 650; white-space: nowrap; }
.steps { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; padding: 0 28px 0 0; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 800; margin-bottom: 18px; background: var(--paper); position: relative; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 19px; left: 38px; right: 0; height: 2px; background: var(--line-strong); }
.steps li:last-child::after { display: none; }
.steps li:first-child::before { background: var(--signal-bright); border-color: var(--signal-bright); color: #fff; }
.steps h3 { font-size: 1.1rem; margin-bottom: 6px; }
.steps p { color: var(--text-2); margin: 0; }
.artisan-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.artisan-band__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 48px; align-items: start; }
.artisan-band__inner > .btn { grid-column: 1; justify-self: start; }
.artisan-band__list { grid-row: span 2; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.artisan-band__list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--paper); }
.artisan-band__list .icon { color: var(--signal); margin-top: 3px; }
.artisan-band__list span { display: grid; }
.artisan-band__list small { color: var(--muted); }
@media (max-width: 860px) { .artisan-band__inner { grid-template-columns: 1fr; } .artisan-band__list { grid-row: auto; } }
.contact-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-band .site-section__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.contact-list { display: flex; gap: 28px; flex-wrap: wrap; font-weight: 650; }
.contact-list a, .contact-list span { display: inline-flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; }
.site-foot { padding: 28px clamp(16px, 4vw, 56px); color: var(--muted); font-size: 13.5px; }
.site-foot__inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .cols-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .topbar__search input { width: 200px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease), visibility .25s; visibility: hidden; }
  .sidebar.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .sidebar__close { display: inline-grid; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(8,14,34,.5); }
  .sidebar.is-open + .scrim { display: block; }
  .workspace { margin-left: 0; }
  .topbar { padding: 0 12px 0 8px; }
  .topbar__menu { display: inline-grid; }
  .main { padding: 20px 16px 48px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card__brand { display: inline-flex; }
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 108px; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3, .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .topbar__search { display: none; }
  .page-head { align-items: flex-start; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat__value { font-size: 1.5rem; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar form { width: 100%; }
  /* Tableaux → fiches empilées */
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table--stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .table--stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 650; }
  .table--stack td.cell-first { display: block; padding-bottom: 8px; }
  .table--stack td.actions-cell { justify-content: flex-end; }
  .dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .dialog[open] { animation: sheet .22s var(--ease); }
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 80px 1fr 40px; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .lines td { padding: 0; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines .col-qty, .lines .col-pu, .lines .col-total, .lines .col-x { width: auto; }
  .lines .col-total { padding-top: 10px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li::after { display: none; }
  .site-nav__links a:not(.btn) { display: none; }
  .msg { max-width: 92%; }
  /* Espace client : barre d'onglets */
  .app--client .tabbar, .app--tech .tabbar {
    position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 4px 0; font: 650 11px var(--font-ui); color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tabbar a:hover, .tabbar button:hover { color: var(--text); }
  .tabbar .tabbar__cta { justify-self: center; width: 50px; height: 50px; border-radius: 50%; background: var(--signal); color: #fff; place-items: center; margin-top: -22px; box-shadow: 0 8px 20px -6px rgba(200,75,6,.6); }
  .app--tech .tabbar { grid-template-columns: repeat(4, 1fr); }
  .app--client .main, .app--tech .main { padding-bottom: 110px; }
  .app--client .toasts, .app--tech .toasts { bottom: 86px; }
}
@media (max-width: 720px) { .hide-sm { display: none !important; } }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .topbar, .tabbar, .toasts, .page-head__actions, .no-print { display: none !important; }
  .workspace { margin: 0; }
  body { background: #fff; }
}

/* ══ v3.2 — Tableaux de bord, suivi GPS en direct, espace technicien, WhatsApp ══ */
.panel { box-shadow: 0 1px 2px rgba(14, 27, 61, .05); }
.is-dash .main .panel { border-top: 3px solid var(--panel-accent, var(--signal-bright)); box-shadow: 0 1px 2px rgba(14, 27, 61, .05), 0 10px 24px -18px rgba(14, 27, 61, .35); }
.panel--accent { border-top: 3px solid var(--panel-accent, var(--signal-bright)); }
.cols-2 > .panel, .cols-3 > .panel, .dash-grid > .panel { margin-top: 0; }
.panel__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--panel-accent, var(--signal-bright)); background: color-mix(in srgb, var(--panel-accent, var(--signal-bright)) 12%, transparent); border: 1px solid color-mix(in srgb, var(--panel-accent, var(--signal-bright)) 25%, transparent); }
.panel__head--sub { border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 10px; }
.panel__head--sub h3 { font-size: .9rem; margin: 0; color: var(--text-2); }
.panel__foot--split { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.dash-figure { font-size: 1.1rem; }
.dash-figure .small { font-weight: 500; }
.text-green { color: var(--green); }

/* Bandeau d'accueil */
.dash-hero { display: flex; justify-content: space-between; align-items: stretch; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; padding: 26px 28px; border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--signal-bright) 38%, transparent) 0%, transparent 55%), linear-gradient(135deg, var(--sidebar-bg, #0E1B3D) 0%, #1B2C5E 100%);
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 16px 40px -24px rgba(14, 27, 61, .7); }
.dash-hero h1 { color: #fff; font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 2px 0 6px; }
.dash-hero p { margin: 0; color: rgba(255,255,255,.82); }
.dash-hero p strong { color: #FFB38A; }
.dash-hero__date { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: rgba(255,255,255,.65) !important; }
.dash-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn--glass { --btn-bg: rgba(255,255,255,.08); --btn-fg: #fff; --btn-bd: rgba(255,255,255,.28); }
.btn--glass:hover { --btn-bg: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.5); }
.dash-hero__pulse { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; align-content: center; }
.dash-hero__pulse li { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.dash-hero__pulse strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: #fff; }
.dash-hero__pulse span { font-size: 12.5px; color: rgba(255,255,255,.72); }

/* Indicateurs */
.stats--6 { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
@media (min-width: 1360px) { .stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat__value small { font-size: .55em; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stat { box-shadow: 0 1px 2px rgba(14, 27, 61, .05); }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend--up { color: var(--green); background: var(--green-bg); }
.trend--down { color: var(--red); background: var(--red-bg); }
.trend--flat { color: var(--muted); background: var(--grey-bg); }
.trend__ctx { font-size: 12px; color: var(--muted); }

/* Grille du tableau de bord */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; align-items: stretch; }

/* Agenda du jour et activité */
.agenda, .feed { list-style: none; margin: 0; padding: 6px 0; }
.agenda li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 20px; }
.agenda li + li { border-top: 1px dashed var(--line); }
.agenda__time { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text-2); display: flex; justify-content: center; }
.agenda__main { display: grid; min-width: 0; text-decoration: none; color: var(--text); }
.agenda__main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.agenda__main small { color: var(--muted); font-size: 12.5px; }
.feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; padding: 7px 20px; font-size: 13.5px; }
.feed li small { grid-column: 2; color: var(--muted); font-size: 12px; }
.feed a { color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed a:hover { color: var(--signal); }
.feed__icon { grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1F9D55; box-shadow: 0 0 0 0 rgba(31,157,85,.6); animation: livepulse 1.8s infinite; vertical-align: middle; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

/* Jauges */
.meter { display: block; height: 6px; border-radius: 999px; background: var(--grey-bg); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--meter, var(--signal-bright)); min-width: 3px; }
.meter--green { --meter: var(--green); } .meter--blue { --meter: var(--blue); } .meter--red { --meter: var(--red); } .meter--grey { --meter: var(--grey); }
.funnel { display: grid; gap: 12px; }
.funnel__row { display: grid; grid-template-columns: 1fr auto; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.funnel__row .meter { grid-column: 1 / -1; height: 8px; }
.rank { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 800; background: var(--grey-bg); color: var(--text-2); }
.list--compact li:first-child .rank { background: var(--signal-soft); color: var(--signal); }

/* Cartes Leaflet */
.live__map { height: 340px; border-bottom: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.live__map--tall { height: 380px; }
.live__fallback { margin: 0; padding: 40px 20px; text-align: center; color: var(--muted); }
.live__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.live__stats > div { display: grid; gap: 2px; padding: 12px 20px; min-width: 0; }
.live__stats > div + div { border-left: 1px solid var(--line); }
.live__stats small { font-size: 12px; color: var(--muted); font-weight: 600; }
.live__stats span { font-size: 14px; font-weight: 600; }
.live__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 0; }
.live__msg { margin: 0; padding: 10px 20px 16px; font-size: 13px; color: var(--muted); }
.live__msg:empty { padding-bottom: 6px; }
.live__msg--ok { color: var(--green); } .live__msg--err { color: var(--red); }
[data-live-share].is-on { --btn-bg: var(--green); --btn-bd: var(--green); }
.live-badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; color: var(--red); background: var(--red-bg); }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.btn.is-disabled { opacity: .5; pointer-events: none; }
.leaflet-div-icon.pin { background: none; border: 0; }
.pin { position: relative; }
.pin__dot { position: absolute; inset: 0; border-radius: 50%; background: var(--pin, #E8590C); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(14,27,61,.45); }
.pin--client { --pin: #E8590C; } .pin--tech { --pin: #1A56C7; } .pin--pending { --pin: #D99000; }
.pin--urgent .pin__dot { box-shadow: 0 0 0 3px rgba(179,38,30,.55), 0 2px 8px rgba(14,27,61,.45); }
.pin--tech .pin__dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(26,86,199,.5); animation: ring 2s infinite; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.pin.is-stale .pin__dot { filter: grayscale(.6); opacity: .65; }
.pin__label { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 999px; font: 700 11px var(--font-ui); color: #fff; background: var(--pin, #0E1B3D); box-shadow: 0 2px 6px rgba(14,27,61,.3); }
.map-pop { display: grid; gap: 2px; font-family: var(--font-ui); }
.map-pop a { font-weight: 700; }
.map-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 12px 20px; font-size: 12.5px; color: var(--muted); }
.map-legend li { display: inline-flex; align-items: center; gap: 7px; }
.pin-key { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.pin-key--client { background: #E8590C; } .pin-key--tech { background: #1A56C7; } .pin-key--pending { background: #D99000; }

/* Espace technicien : missions */
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.mission { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--m, var(--blue)); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(14,27,61,.05); }
.mission--en_attente { --m: var(--amber); } .mission--en_cours { --m: var(--violet); } .mission--termine { --m: var(--green); } .mission--annule { --m: var(--grey); }
.mission__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mission__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mission__title { margin: 0; font-size: 1.05rem; }
.mission__title a { color: var(--text); text-decoration: none; }
.mission__title a:hover { color: var(--signal); }
.mission__meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.mission__meta li { display: flex; gap: 8px; align-items: flex-start; }
.mission__meta .icon { flex: none; margin-top: 2px; color: var(--muted); }
.mission__foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

/* WhatsApp et liens d'invitation */
.btn--whatsapp { --btn-bg: #0E7A43; --btn-fg: #fff; --btn-bd: #0E7A43; }
.btn--whatsapp:hover { --btn-bg: #0B6236; color: #fff; border-color: #0B6236; }
.icon-btn--wa { color: #0E7A43; }
.icon-btn--wa:hover { background: #E3F5EA; color: #0B6236; }
:root[data-theme="dark"] .icon-btn--wa { color: #4CD38A; }
.invite { padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong); }
.invite__link { width: 100%; font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace !important; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .dash-hero { padding: 20px; }
  .dash-hero__pulse { width: 100%; }
  .live__stats { grid-template-columns: 1fr; }
  .live__stats > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .live__map { height: 300px; }
  .live__actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .live-dot, .live-badge::before, .pin--tech .pin__dot::after { animation: none; } }

/* ══ v3.3 — Connexion : couverture responsive, attente après erreurs, 2 étapes, options avancées ══ */
.auth-aside--cover { background: var(--ink); isolation: isolate; }
.auth-aside__photo { position: absolute !important; inset: 0; z-index: -2; background: var(--cover) center / cover no-repeat; transform: scale(1.04); animation: coverzoom 24s ease-in-out infinite alternate; }
.auth-aside--cover::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,14,34,.62) 0%, rgba(8,14,34,.18) 38%, rgba(8,14,34,.35) 62%, rgba(8,14,34,.92) 100%),
              radial-gradient(120% 80% at 0% 100%, color-mix(in srgb, var(--signal-bright) 30%, transparent) 0%, transparent 60%); }
@keyframes coverzoom { from { transform: scale(1.04); } to { transform: scale(1.12) translate(-1%, -1%); } }
.auth-aside .brand__logo { max-height: 52px; max-width: 200px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); }
.auth-aside__headline { display: grid; gap: 8px; max-width: 52ch; }
.auth-aside__kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #FFB38A; }
.auth-aside__title { margin: 0; font-family: var(--font-display); font-size: clamp(1.15rem, 1.8vw, 1.6rem); font-weight: 700; line-height: 1.25; color: #fff; text-wrap: balance; }
.auth-aside__note { display: inline-flex; align-items: center; gap: 6px; }
.auth-card .brand__logo { max-height: 56px; max-width: 220px; }

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: var(--ink); }
  .auth-aside { display: flex; min-height: clamp(230px, 36vh, 340px); padding: calc(20px + env(safe-area-inset-top)) 20px 56px; gap: 18px; justify-content: space-between; }
  .auth-aside__ticket { display: none; }
  .auth-aside__title { font-size: clamp(1.1rem, 4.6vw, 1.45rem); }
  .auth-aside .brand__logo { max-height: 46px; }
  .auth-panel { position: relative; z-index: 1; margin-top: -32px; place-items: start center; padding: 30px 20px calc(36px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0; box-shadow: 0 -18px 40px -24px rgba(8,14,34,.6); }
  .auth-panel::before { content: ""; position: absolute; top: 10px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 99px; background: var(--line-strong); }
  .auth-card__brand { display: none !important; }
  .auth-card h1 { font-size: 1.6rem; }
}
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  .auth-aside { min-height: 150px; padding-bottom: 46px; }
  .auth-aside__title { display: none; }
}
@media (max-width: 380px) { .auth-panel { padding-left: 16px; padding-right: 16px; } }
@media (prefers-reduced-motion: reduce) { .auth-aside__photo { animation: none; } }

/* Attente après trop de tentatives */
.lockout { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--text); }
.lockout strong { display: block; color: var(--red); font-size: 14.5px; }
.lockout p { margin: 2px 0 8px; font-size: 13.5px; color: var(--text-2); }
.lockout b { font-size: 15px; color: var(--red); }
.lockout__ring { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent); }
.lockout__bar { display: block; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--red) 15%, transparent); overflow: hidden; }
.lockout__bar span { display: block; height: 100%; width: 100%; background: var(--red); border-radius: inherit; transition: width .25s linear; }
.lockout.is-done { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.lockout.is-done strong, .lockout.is-done .lockout__ring { color: var(--green); }
.lockout.is-done .lockout__bar { display: none; }

/* Code à 6 chiffres */
.otp { text-align: center; font: 700 1.6rem/1 var(--font-display) !important; letter-spacing: .5em; padding-left: .5em !important; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; text-decoration: underline; }

/* Santé du système */
.checklist { list-style: none; margin: 0; padding: 4px 0; }
.checklist li { display: grid; grid-template-columns: 28px minmax(160px, 260px) 1fr; gap: 10px; align-items: center; padding: 11px 20px; font-size: 14px; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist__icon { display: grid; place-items: center; }
.checklist .is-ok .checklist__icon { color: var(--green); }
.checklist .is-warn .checklist__icon { color: var(--amber); }
.checklist .is-bad { background: color-mix(in srgb, var(--red-bg) 60%, transparent); }
.checklist .is-bad .checklist__icon { color: var(--red); }
.checklist__label { font-weight: 650; }
.checklist__detail { color: var(--text-2); overflow-wrap: anywhere; }
.toolbar__filters { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .checklist li { grid-template-columns: 28px 1fr; } .checklist__detail { grid-column: 2; font-size: 13px; } }

/* ══ v3.4 — Cotations négociées, itinéraire, tableau de bord ══ */
.stats--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats--8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stats--8 { grid-template-columns: 1fr; } }
.stat__hint { line-height: 1.6; }
.dash-hero__pulse a { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.pill-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--signal-bright); color: #fff; font-size: 12px; font-weight: 800; }
.section-tabs { margin-bottom: 16px; }
.notif-menu__pending--cot { border-top: 1px solid var(--line); }
[data-notif-sound].is-muted { color: var(--muted); text-decoration: line-through; }

/* Historique de négociation */
.nego { list-style: none; margin: 0; padding: 0 0 0 18px; display: grid; gap: 12px; border-left: 2px solid var(--line); }
.nego__item { position: relative; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.nego__item::before { content: ""; position: absolute; left: -26px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); }
.nego__item--client::before { border-color: var(--signal-bright); }
.nego__item--client { background: color-mix(in srgb, var(--signal-soft) 70%, var(--surface)); }
.nego__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nego__head small { margin-left: auto; }
.nego__item p { margin: 6px 0 0; font-size: 14px; }
.quote { margin: 0; padding: 12px 16px; border-left: 4px solid #F5C98A; background: #FFF9F0; border-radius: 0 10px 10px 0; font-style: italic; }
.quote small { display: block; margin-top: 6px; font-style: normal; color: #66718B; font-size: 12px; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.howto li { padding-left: 4px; }
.howto strong { display: block; font-size: 14px; }
.howto span { font-size: 13px; color: var(--muted); }

/* Itinéraire détaillé */
.route-steps { margin: 4px 20px 6px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.route-steps > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; }
.route-steps > summary::-webkit-details-marker { display: none; }
.route-steps > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.route-steps[open] > summary::after { transform: rotate(180deg); }
.route-steps ol { list-style: none; margin: 0; padding: 0 6px 6px; max-height: 320px; overflow: auto; border-top: 1px solid var(--line); }
.route-steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.route-steps li:hover { background: var(--surface-2); }
.route-steps li + li { border-top: 1px dashed var(--line); }
.route-steps__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); font-weight: 800; font-size: 16px; }
.route-steps li:last-child .route-steps__icon { background: var(--signal-soft); color: var(--signal); }
.route-steps li small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.route-steps__note { margin: 0; padding: 8px 14px 12px; }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-control-layers { border-radius: 12px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px !important; font-size: 13px; }
.live__map .leaflet-tile { image-rendering: auto; }
