/* ═══════════════════════════════════════════════════════════════════════
   ANTIOCHE MARINE SERVICES — feuille de style
   Outil de terrain, mobile d'abord : lisible en cale moteur, au doigt,
   en plein soleil. Sobre, marine. L'état (conforme / anomalie / non
   contrôlé) se lit à la couleur ET à la forme (bande, pastille). SPEC §65–67.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Marque : bleu marine AMS */
  --navy:        #0e3a5f;
  --navy-deep:   #0a2c48;
  --navy-tint:   #e8eef3;

  /* Neutres — gris légèrement bleutés (choisis, pas hérités) */
  --ground:      #eaf1fa;
  --surface:     #ffffff;
  --surface-2:   #f6f8fa;
  --field:       #ffffff;
  --ink:         #12212c;
  --muted:       #566470;
  --line:        #d6dee4;
  --line-strong: #b9c5cd;

  /* Sémantique d'état — distincte de la couleur de marque */
  --ok:    #1f7a44;   --ok-bg:   #e7f4ec;
  --warn:  #a76a00;   --warn-bg: #fbf0dc;
  --bad:   #c02c26;   --bad-bg:  #fbe6e4;
  --nc:    #64737f;   --nc-bg:   #eef1f3;
  --info:  #1f6feb;   --info-bg: #e6effc;

  --accent:      var(--navy);
  --accent-ink:  #ffffff;

  /* Chrome de marque : reste bleu marine profond dans les deux thèmes */
  --topbar-bg:   #0e3a5f;
  --topbar-ink:  #ffffff;
  --topbar-line: #0a2c48;

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;
  --shadow:      0 1px 2px rgba(14, 58, 95, .05), 0 4px 14px rgba(14, 58, 95, .06);
  --shadow-lift: 0 3px 8px rgba(14, 58, 95, .08), 0 12px 28px rgba(14, 58, 95, .1);
  --shadow-accent: 0 6px 16px rgba(14, 58, 95, .22);
  --ease: cubic-bezier(.2, .7, .3, 1);

  --font:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy:        #4d9fd6;
    --navy-deep:   #3d8ac0;
    --navy-tint:   #16303f;
    --ground:      #0c161e;
    --surface:     #12222e;
    --surface-2:   #172a37;
    --field:       #0c1a24;
    --ink:         #e5edf2;
    --muted:       #9aabb6;
    --line:        #263a48;
    --line-strong: #354c5c;
    --ok:   #4cb377;  --ok-bg:   #10281b;
    --warn: #d29a3f;  --warn-bg: #2c220e;
    --bad:  #e2645c;  --bad-bg:  #2f1512;
    --nc:   #8b9aa5;  --nc-bg:   #1c2a34;
    --info: #5b9bf0;  --info-bg: #12263c;
    --accent-ink: #06121b;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 6px 20px rgba(0, 0, 0, .5);
    --shadow-accent: 0 6px 16px rgba(77, 159, 214, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #4d9fd6; --navy-deep: #3d8ac0; --navy-tint: #16303f;
  --ground: #0c161e; --surface: #12222e; --surface-2: #172a37; --field: #0c1a24;
  --ink: #e5edf2; --muted: #9aabb6; --line: #263a48; --line-strong: #354c5c;
  --ok: #4cb377; --ok-bg: #10281b; --warn: #d29a3f; --warn-bg: #2c220e;
  --bad: #e2645c; --bad-bg: #2f1512; --nc: #8b9aa5; --nc-bg: #1c2a34;
  --info: #5b9bf0; --info-bg: #12263c; --accent-ink: #06121b;
  --shadow-accent: 0 6px 16px rgba(77, 159, 214, .28);
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lift: 0 6px 20px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ─────────────────────────── Base ─────────────────────────── */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 15px/1.55 var(--font);
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 3px; }

main { width: 100%; max-width: 74rem; margin: 0 auto; padding: 1.4rem 1.4rem 4rem; }
body.bare { display: flex; }

h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; margin: .1rem 0 .1rem; text-wrap: balance; letter-spacing: -.02em; }
h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.8rem 0 .7rem;
  padding-left: .65rem;
  border-left: 3px solid var(--navy);
  letter-spacing: -.005em;
}
h4 { font-size: .92rem; margin: .9rem 0 .3rem; color: var(--muted); }

p { margin: .5rem 0; }
.muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .92em; }

/* Références, n° de série, OT : traités comme des identifiants */
.ref {
  font-family: var(--mono);
  font-size: .82em;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .01em;
}

/* ─────────────────────────── Shell : sidebar + barre haute ─────────────────────────── */

body.shell { display: grid; grid-template-columns: 5.5rem 1fr; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.ico { flex: none; }

.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; align-items: stretch; gap: .3rem;
  padding: .9rem .55rem;
  background: var(--topbar-bg);
  color: rgba(255, 255, 255, .72);
  overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.side .brand {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  margin-bottom: .8rem; padding: .3rem 0;
  color: #fff; text-decoration: none; font-size: 1.5rem; line-height: 1;
}
.side .brand span { font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.side nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.side nav a, .side .side-foot {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .6rem .2rem .5rem;
  border-radius: var(--radius);
  color: inherit; text-decoration: none;
  font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.side nav a .ico, .side .side-foot .ico {
  width: 2.5rem; height: 2.5rem; padding: .6rem;
  border-radius: 12px; background: rgba(255, 255, 255, .08);
  transition: background-color .14s var(--ease), transform .14s var(--ease);
}
.side nav a:hover, .side .side-foot:hover { color: #fff; }
.side nav a:hover .ico, .side .side-foot:hover .ico { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.side nav a.active { color: #fff; }
.side nav a.active .ico { background: #fff; color: var(--navy-deep); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
:root[data-theme="dark"] .side nav a.active .ico { color: #06121b; }

.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: .6rem;
  padding: .65rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar .who { display: flex; align-items: center; gap: .65rem; margin-right: auto; }
.who-txt { display: flex; flex-direction: column; line-height: 1.2; }
.who-txt small { color: var(--muted); font-size: .74rem; }
.appbar .logout {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--muted); font-size: .84rem; text-decoration: none; padding: .4rem .5rem;
}
.appbar .logout:hover { color: var(--ink); }
.appbar .logout .ico { width: 1.1rem; height: 1.1rem; }
.btn.sm, button.sm { min-height: 2.25rem; padding: .4rem .9rem; font-size: .88rem; border-radius: 999px; }
.btn.sm .ico { width: 1rem; height: 1rem; }
.btn.ghost.sm { border-color: var(--line-strong); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: color-mix(in srgb, var(--navy) 16%, var(--surface));
  color: var(--navy); font-weight: 800; font-size: .85rem; letter-spacing: .02em;
}
.avatar.sm { width: 2.4rem; height: 2.4rem; border-radius: 14px; font-size: .78rem; }

/* ─────────────────────────── Flash ─────────────────────────── */

.flash {
  width: calc(100% - 2.8rem);
  max-width: 74rem;
  margin: .8rem auto 0;
  padding: .65rem 1rem;
  background: var(--info-bg);
  border: 1px solid color-mix(in srgb, var(--info) 35%, transparent);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  font-size: .92rem;
}

/* ─────────────────────────── En-tête de page ─────────────────────────── */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin: .3rem 0 1.1rem;
}
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ─────────────────────────── Boutons ─────────────────────────── */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .55rem 1.1rem;
  font: 600 .94rem/1 var(--font);
  color: var(--accent-ink);
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(14, 58, 95, .12);
  transition: background-color .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease), transform .1s var(--ease);
}
button:hover, .btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); box-shadow: var(--shadow-accent); }
button:active, .btn:active { transform: translateY(1px) scale(.99); box-shadow: 0 1px 2px rgba(14, 58, 95, .12); }

button.ghost, .btn.ghost {
  background: var(--surface);
  color: var(--navy);
  box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover { background: var(--navy-tint); box-shadow: none; }

button.link, .btn.link {
  min-height: 0;
  border: none;
  background: none;
  color: var(--navy);
  padding: .1rem .25rem;
  font-weight: 500;
  text-decoration: underline;
}
button.link:hover { background: none; }
/* Spécificité volontairement > `button.danger` (ci-dessous) : sans ce fond
   explicite, un bouton `link danger` hérite du fond plein rouge des boutons
   `.danger` (même sélecteur de classe) et affiche du texte rouge sur fond rouge. */
button.link.danger, .btn.link.danger { color: var(--bad); background: none; }
button.link.danger:hover, .btn.link.danger:hover { background: var(--bad-bg); }

.danger-zone {
  margin-top: 2rem;
  padding: .9rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--bad-bg);
}
.danger-zone h3 { margin-top: 0; color: var(--bad); }
.danger-zone button, button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.danger-zone button:hover, button.danger:hover { background: color-mix(in srgb, var(--bad) 82%, #000); border-color: color-mix(in srgb, var(--bad) 82%, #000); }

.inline { display: inline; }

/* ─────────────────────────── Formulaires ─────────────────────────── */

label {
  display: block;
  margin: .7rem 0 0;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .005em;
}
input, select, textarea {
  width: 100%;
  margin-top: .25rem;
  padding: .55rem .6rem;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-height: 2.5rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin-top: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }

fieldset { border: none; padding: 0; margin: .6rem 0 0; }
.radio, .check {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: .3rem .9rem .3rem 0;
  font-weight: 500;
  color: var(--ink);
}

.row { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.row .grow, .row .grow input { flex: 1 1 12rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.1rem; }
.grid2 .full { grid-column: 1 / -1; }

.filters {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  margin: .9rem 0;
}
.filters input[type=search] { flex: 1 1 16rem; margin-top: 0; }
.filters button { min-height: 2.5rem; }

/* ─────────────────────────── Cartes ─────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin: 1rem 0;
}
.card.login { max-width: 23rem; margin: 4rem auto; box-shadow: var(--shadow-lift); }
.card.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-bg); }

details.card > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  list-style-position: inside;
}
details.card[open] > summary { margin-bottom: .6rem; }

.muted-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .88rem;
  color: var(--muted);
}
.notice {
  padding: .7rem 1rem;
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.readonly-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .55rem .9rem;
  margin: .7rem 0;
  background: var(--nc-bg);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--nc);
  border-radius: var(--radius-sm);
  font-size: .88rem;
}
.error { color: var(--bad); }
.stack > * + * { margin-top: .6rem; }

/* ─────────────────────────── Tables ─────────────────────────── */

table.list, table.kv { width: 100%; border-collapse: collapse; }
table.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: .92rem;
}
table.list th, table.list td {
  text-align: left;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: middle;
}
table.list thead th {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
}
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr { transition: background-color .12s var(--ease); }
table.list tbody tr:hover { background: var(--surface-2); }
tr.inactive { opacity: .5; }
.nowrap { white-space: nowrap; }
td .ref, td a { font-variant-numeric: tabular-nums; }

table.kv td, table.kv th {
  padding: .35rem .5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.kv th, table.kv td:first-child { width: 34%; font-weight: 600; color: var(--muted); }

/* ─────────────────────────── Pastilles / tags ─────────────────────────── */

.pill, .tag, .badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  background: var(--nc-bg);
  color: var(--nc);
  border: 1px solid transparent;
}
.pill.ok   { background: var(--ok-bg);   color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.tag { background: var(--navy-tint); color: var(--navy); font-weight: 600; text-transform: none; }

/* états legacy chantier */
.s-brouillon { background: var(--nc-bg); color: var(--nc); }
.s-en_cours  { background: var(--info-bg); color: var(--info); }
.s-cloture   { background: var(--ok-bg); color: var(--ok); }
.h-soumis    { background: var(--warn-bg); color: var(--warn); }
.h-valide    { background: var(--ok-bg); color: var(--ok); }
.h-refuse    { background: var(--bad-bg); color: var(--bad); }

/* ─────────────────────────── Onglets ─────────────────────────── */

.tabs {
  display: flex;
  gap: .1rem;
  border-bottom: 1px solid var(--line-strong);
  margin: 1.1rem 0 0;
}
.tabs.scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs.scroll::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto;
  padding: .6rem .9rem;
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .12s var(--ease), background-color .12s var(--ease), border-color .12s var(--ease);
}
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a.active { color: var(--navy); border-color: var(--navy); }

.tabpane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.3rem;
}
.tabpane .card:first-child { margin-top: .2rem; }

/* ─────────────────────────── Tuiles (accueil) ─────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .7rem;
  margin: 1.1rem 0 1.4rem;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow .16s var(--ease), transform .16s var(--ease);
}
.tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.tile:active { transform: translateY(-1px) scale(.99); }
.tile .n { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.tile .l { font-size: .82rem; color: var(--muted); font-weight: 600; }
.tile.primary { background: var(--navy); border-color: var(--navy); color: var(--accent-ink); box-shadow: var(--shadow-accent); }
.tile.primary .n, .tile.primary .l { color: var(--accent-ink); }
.tile.primary:hover { box-shadow: 0 8px 22px rgba(14, 58, 95, .32); }

/* ─────────────────────────── Grosses cartes (catégories) ─────────────────────────── */

.bigcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: .55rem;
  margin: .8rem 0;
}
.bigcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1rem .8rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.bigcard input { position: absolute; opacity: 0; pointer-events: none; }
.bigcard .ico { font-size: 1.5rem; line-height: 1; }
.bigcard.sel, .bigcard:has(input:checked) {
  border-color: var(--navy);
  background: var(--navy-tint);
  box-shadow: inset 0 0 0 1px var(--navy);
}

/* ─────────────────────────── Grille de modules ─────────────────────────── */

.modgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: .6rem;
  margin: 1rem 0;
}
.modcard {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .85rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow .12s, transform .12s;
}
.modcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.modcard .ico { font-size: 1.35rem; line-height: 1; }
.modcard strong { font-size: .92rem; line-height: 1.2; }
.modcard .muted { font-size: .78rem; }
.modcard .st { font-size: .76rem; font-weight: 800; letter-spacing: .02em; margin-top: .1rem; }
.modcard.s-ok       { border-left-color: var(--ok); }
.modcard.s-anomalie { border-left-color: var(--bad); background: var(--bad-bg); }
.modcard.s-nc       { border-left-color: var(--nc); }
.modcard.s-ind      { border-left-color: var(--warn); }
.modcard.s-vide     { border-left-color: var(--line-strong); }
.modcard.s-ok .st       { color: var(--ok); }
.modcard.s-anomalie .st { color: var(--bad); }
.modcard.s-nc .st       { color: var(--nc); }
.modcard.s-ind .st      { color: var(--warn); }
.modcard.s-vide .st     { color: var(--muted); }

/* ─────────────────────────── Progression (§67) ─────────────────────────── */

.progress {
  height: .4rem;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: .35rem 0;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--navy);
  border-radius: 999px;
  transition: width .25s ease;
}

/* ─────────────────────────── Cartes questions (§66) ─────────────────────────── */

#qform { margin-top: .6rem; }

.qcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem 1rem;
  margin: .7rem 0;
}
.qcard[hidden] { display: none; }
.qcard .qlabel {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem;
  font-weight: 600;
  font-size: .98rem;
  margin-bottom: .6rem;
}
.qcard .qlabel .muted { font-weight: 400; font-size: .82rem; }

.qcard .opts { display: flex; flex-wrap: wrap; gap: .45rem; }
.qopt {
  flex: 1 1 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 2.9rem;
  padding: .5rem .6rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .1s, background .1s;
}
.qopt input { position: absolute; opacity: 0; pointer-events: none; }
.qopt:hover { border-color: var(--navy); }
.qopt.pick { border-color: var(--navy); background: var(--navy-tint); font-weight: 700; }
.qopt.etat-conforme.pick     { border-color: var(--ok);   background: var(--ok-bg);   color: var(--ok); }
.qopt.etat-anomalie.pick     { border-color: var(--bad);  background: var(--bad-bg);  color: var(--bad); }
.qopt.etat-non_controle.pick { border-color: var(--nc);   background: var(--nc-bg);   color: var(--nc); }
.qopt.etat-indetermine.pick,
.qopt.etat-non_applicable.pick { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

.qcard .extra { margin-top: .6rem; font-size: .84rem; }
.qcard .extra input { margin-top: .2rem; }
.qcard .saved {
  font-size: .74rem;
  font-weight: 700;
  color: var(--ok);
  opacity: 0;
  transition: opacity .2s;
}
.qcard .saved.show { opacity: 1; }

/* Barre d'action collée en bas — navigation entre modules au pouce */
.actionbar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  margin: 1.2rem -1rem -4rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.actionbar .btn { flex: 0 1 auto; }
@supports not (backdrop-filter: blur(1px)) { .actionbar { background: var(--ground); } }

/* ─────────────────────────── Fil / timeline ─────────────────────────── */

ul.entries { list-style: none; padding: 0; margin: .5rem 0; }
ul.entries li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
ul.entries li:last-child { border-bottom: none; }
ul.entries .meta { font-size: .8rem; color: var(--muted); }
ul.entries .body { margin: .35rem 0; }
ul.entries img { max-width: 240px; border-radius: var(--radius-sm); margin-top: .4rem; border: 1px solid var(--line); }
.entry-form { margin-top: 1rem; }

.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.thumbs img { width: 160px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.thumbs figure img { width: 100%; }
.js-lightbox { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
  cursor: default;
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox-close {
  top: 1rem; right: 1.2rem;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  font-size: 1.4rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem; height: 3rem;
  border-radius: 50%;
  font-size: 1.8rem;
}
.lightbox-nav.hidden { display: none; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-count {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: .85rem;
  opacity: .8;
}

.sigpad {
  width: 100%;
  height: 9rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  touch-action: none;
}

/* ─────────────────────────── Documents imprimés (legacy + aperçu) ─────────────────────────── */

body.print, .doc { background: #fff; color: #111; }
.doc { max-width: 48rem; margin: 1rem auto; padding: 1.5rem; }
.doc-head {
  display: flex; justify-content: space-between; gap: 2rem;
  border-bottom: 2px solid #111; padding-bottom: .8rem; margin-bottom: 1rem;
}
.doc-head h1 { font-size: 1.2rem; }
.doc-title { text-align: right; }
.doc section { margin: 1rem 0; }
.doc h3 { border-bottom: 1px solid #ccc; padding-bottom: .2rem; }
.signatures { display: flex; gap: 2rem; margin-top: 2rem; }
.signatures > div { flex: 1; }
.sigbox { height: 4rem; border: 1px solid #111; margin-top: .3rem; }

@media print {
  body.shell { display: block; }
  .no-print, .side, .appbar, .tabs, .readonly-banner { display: none !important; }
  body { background: #fff; }
  .doc { margin: 0; max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .card { border: none; padding: 0; }
}

/* ─────────────────────────── Responsive ─────────────────────────── */

@media (max-width: 560px) {
  main { padding: .9rem .75rem 4rem; }
  .grid2 { grid-template-columns: 1fr; }
  .tabpane { padding: .9rem .8rem 1rem; }
  h1 { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ─────────────────────────── Accueil : stats, fonctions, interventions ─────────────────────────── */

h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin: 1.9rem 0 .8rem; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.sec-head a { font-size: .88rem; font-weight: 600; text-decoration: none; }
.count {
  display: inline-block; margin-left: .3rem; padding: .05rem .55rem; border-radius: 999px;
  background: var(--navy-tint); color: var(--navy); font-size: .8rem; font-weight: 700; vertical-align: .12em;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin: 1rem 0 0; }
.stat {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.6rem;
  min-height: 7.5rem; padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg); color: #fff; text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.stat::after {            /* disque décoratif, comme sur la maquette */
  content: ""; position: absolute; right: -2.2rem; bottom: -3rem;
  width: 8rem; height: 8rem; border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat .l { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; }
.stat .l .ico { width: 1.25rem; height: 1.25rem; opacity: .85; }
.stat .n { font-size: 2.3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.s-navy  { background: #0e2a47; }
.s-teal  { background: #145a5a; }
.s-blue  { background: #2058b0; }
.s-red   { background: #d94c4c; }
.s-amber { background: #b8741a; }

.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .8rem; }
.fn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  min-height: 5.4rem; padding: .9rem .6rem;
  border-radius: var(--radius); color: #fff; text-decoration: none;
  font-size: .86rem; font-weight: 600; text-align: center; line-height: 1.2;
  box-shadow: var(--shadow);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}
.fn .ico { width: 1.7rem; height: 1.7rem; opacity: .9; }
.fn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); filter: brightness(1.06); }
.c1  { background: #1fa463; } .c2  { background: #1f9ec4; } .c3  { background: #4e6fd0; }
.c4  { background: #2f8f83; } .c5  { background: #7a67c7; } .c6  { background: #d98a4a; }
.c7  { background: #1e86b8; } .c8  { background: #5d9c8c; } .c9  { background: #6b7fa6; }
.c10 { background: #8a4f7a; } .c11 { background: #c9a35a; } .c12 { background: #e0605e; }

.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.job {
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1rem 1.1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.job:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.job-top { display: flex; align-items: center; gap: .7rem; }
.job-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.job-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .84rem; }
.job-meta .ico { width: 1rem; height: 1rem; }

/* ─────────────────────────── Shell : tablette / mobile ─────────────────────────── */

@media (max-width: 860px) {
  body.shell { grid-template-columns: 1fr; }
  .side {                       /* sidebar -> barre d'onglets en bas */
    position: fixed; inset: auto 0 0 0; z-index: 30; height: auto;
    flex-direction: row; padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(10, 25, 38, .22);
  }
  .side .brand, .side .side-foot { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; gap: .1rem; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a { flex: 1 0 4.3rem; padding: .3rem .1rem; }
  .side nav a .ico { width: 2.1rem; height: 2.1rem; padding: .5rem; }
  main { padding: 1rem 1rem 6.5rem; }
  .flash { width: calc(100% - 2rem); }
  .appbar { padding: .55rem 1rem; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .appbar .btn.sm { padding: .4rem .65rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stat { min-height: 6.4rem; gap: 1rem; padding: .9rem; }
  .stat .n { font-size: 1.9rem; }
  .fn-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .fn { font-size: .76rem; padding: .7rem .3rem; min-height: 4.8rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   REFONTE — habillage commun (cartes arrondies, pastilles, couleurs vives)
   Placé en fin de feuille : surcharge les styles historiques ci-dessus.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(14, 42, 71, .05), 0 6px 18px rgba(14, 42, 71, .07);
}

/* Titres : plus de filet latéral, hiérarchie par la taille */
h1 { font-size: 2rem; font-weight: 800; margin: .2rem 0 .3rem; }
h3 { font-size: 1.15rem; font-weight: 800; color: var(--ink); border: none; padding: 0; margin: 2rem 0 .8rem; }
h4 { color: var(--ink); font-weight: 700; }
.page-head { align-items: center; margin: .2rem 0 1.2rem; }

/* Boutons en pastille, plus francs */
button, .btn { border-radius: 999px; min-height: 2.6rem; padding: .55rem 1.3rem; }
button.ghost, .btn.ghost { border-color: var(--navy); background: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--navy-tint); }
button.link, .btn.link { border-radius: 4px; }

/* Champs */
input, select, textarea { border-radius: 12px; border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 22%, transparent); }
label { color: var(--ink); font-weight: 700; }

/* Cartes */
.card { border-radius: var(--radius-lg); border-color: transparent; padding: 1.2rem 1.35rem; }
.card h3:first-child, .card h4:first-child { margin-top: 0; }
details.card > summary { color: var(--ink); font-weight: 700; }

/* Tableaux : lignes aérées, en-tête teinté */
table.list { border-radius: var(--radius-lg); border-color: transparent; }
table.list thead th {
  background: var(--navy-tint); color: var(--navy);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: none; padding: .7rem .95rem;
}
table.list td { padding: .85rem .95rem; }
table.list tbody tr:hover { background: color-mix(in srgb, var(--navy) 5%, var(--surface)); }

/* Pastilles */
.pill, .tag, .badge { padding: .22rem .7rem; font-size: .76rem; }

/* Onglets : pastilles sur fond clair au lieu d'un soulignement */
.tabs { gap: .4rem; border-bottom: none; margin: 1.2rem 0 .8rem; padding-bottom: .1rem; }
.tabs a {
  padding: .5rem 1.05rem; border: none; margin: 0; border-radius: 999px;
  background: var(--surface); color: var(--muted); box-shadow: var(--shadow);
}
.tabs a:hover { background: var(--navy-tint); color: var(--navy); }
.tabs a.active { background: var(--navy); color: var(--accent-ink); }
.tabpane { border: none; border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; }

/* Catégories (cartes à cocher) */
.bigcards { gap: .8rem; }
.bigcard { border: 2px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem .8rem; }
.bigcard:hover { border-color: var(--line-strong); }
.bigcard.sel, .bigcard:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--accent-ink); box-shadow: var(--shadow-accent); }

/* Modules du questionnaire : même langage que les tuiles d'accueil */
.modgrid { gap: .9rem; }
.modcard {
  border: none; border-top: 5px solid var(--line-strong); border-left: none;
  border-radius: var(--radius); padding: 1rem 1.05rem; box-shadow: var(--shadow);
}
.modcard:hover { transform: translateY(-2px); }
.modcard.s-ok       { border-top-color: var(--ok); }
.modcard.s-anomalie { border-top-color: var(--bad); }
.modcard.s-nc       { border-top-color: var(--nc); }
.modcard.s-ind      { border-top-color: var(--warn); }
.modcard.s-vide     { border-top-color: var(--line-strong); }

/* Questions */
.qcard { border-radius: var(--radius-lg); border-color: transparent; box-shadow: var(--shadow); padding: 1.05rem 1.2rem 1.15rem; }
.progress { height: .55rem; }
.progress > span { background: linear-gradient(90deg, var(--navy), var(--info)); }

/* Page de connexion */
.card.login { border-radius: 24px; padding: 1.8rem 1.6rem; }
body.bare { background: linear-gradient(135deg, #0e2a47 0%, #1b4f86 55%, #2f7fc1 100%); }
body.bare .card.login { background: var(--surface); }

/* Barre d'état sticky sous l'en-tête : léger flou */
.appbar { backdrop-filter: saturate(1.4) blur(8px); background: color-mix(in srgb, var(--surface) 88%, transparent); }

@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .tabpane { padding: 1rem .9rem; }
}

/* Cartes d'intervention : nom + réf sur toute la largeur, statut en pied */
.job-name strong { font-size: 1.02rem; }
.job-name .ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding-top: .8rem; border-top: 1px solid var(--line); }
.job-foot .pill { white-space: normal; }

/* ═══════════════════════════════════════════════════════════════════════
   FORMULAIRES (carte blanche, champs hauts, pied d'actions) + LISTES DE DONNÉES
   ═══════════════════════════════════════════════════════════════════════ */

.page-head .sub { margin: 0; }

/* Formulaire = grande carte claire, lisible, centrée */
form.card { max-width: 52rem; padding: 1.8rem 2rem 0; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
form.card label { margin: 0 0 1.1rem; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
form.card input, form.card select, form.card textarea {
  margin-top: .4rem; min-height: 2.9rem; padding: .65rem .9rem;
  font-size: .95rem; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
form.card input::placeholder, form.card textarea::placeholder { color: var(--muted); opacity: .65; font-weight: 400; }
form.card select:not([multiple]) {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23566470' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .8rem center / 1.1rem;
}
form.card select[multiple] { padding: .4rem; }
form.card .grid2 { gap: 0 1.2rem; }
form.card h3 { font-size: 1rem; margin: 1.4rem 0 .9rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
form.card h3:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* Choix « Particulier / Professionnel » : bascule en pastilles */
form.card fieldset { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.3rem; }
form.card .radio {
  margin: 0; padding: .55rem 1.1rem; font-size: .9rem; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: background-color .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
form.card .radio:has(input:checked) { background: var(--navy-tint); border-color: var(--navy); color: var(--navy); }
form.card .radio input { position: absolute; opacity: 0; pointer-events: none; }
form.card .check { font-size: .92rem; }

/* Pied d'actions : paragraphe ne contenant que des boutons */
form.card > p:last-child, form.card > .form-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin: 1.2rem -2rem 0; padding: 1rem 2rem;
  background: var(--surface-2); border-top: 1px solid var(--line);
}
form.card > p:last-child button { min-width: 8.5rem; }

/* Barre d'outils de liste : recherche à icône */
.list-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.list-tools .search {
  position: relative; flex: 1 1 18rem; max-width: 26rem; margin: 0;
}
.list-tools .search .ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.list-tools .search input { margin: 0; padding-left: 2.6rem; border-radius: 12px; background: var(--surface); }
.list-tools button { background: var(--surface); color: var(--navy); border-color: var(--line-strong); box-shadow: none; }
.list-tools button:hover { background: var(--navy-tint); box-shadow: none; }

/* Tableau de données : style « liste de profils » */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.table-wrap table.list { border: none; box-shadow: none; border-radius: 0; min-width: 34rem; }
table.list.data thead th { background: var(--surface-2); color: var(--muted); font-size: .76rem; text-transform: none; letter-spacing: 0; font-weight: 600; border-bottom: 1px solid var(--line); }
table.list.data td { border-bottom: 1px solid var(--line); font-size: .9rem; }
table.list.data tbody tr:last-child td { border-bottom: none; }
.who-cell { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.who-cell strong { display: block; font-weight: 600; line-height: 1.25; }
.who-cell small { display: block; color: var(--muted); font-size: .78rem; }
.who-cell:hover strong { color: var(--navy); }
.tag.is-pro { background: var(--info-bg); color: var(--info); }
table.list.data .tag { border-radius: 8px; border: 1px solid color-mix(in srgb, var(--navy) 22%, transparent); background: var(--navy-tint); }

@media (max-width: 560px) {
  form.card { padding: 1.2rem 1.1rem 0; }
  form.card > p:last-child, form.card > .form-foot { margin: 1rem -1.1rem 0; padding: .9rem 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMULAIRE « ASSISTANT » : en-tête, étapes à gauche, sections, pied fixe
   ═══════════════════════════════════════════════════════════════════════ */

.wizard {
  max-width: 66rem; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-lift);
  /* pas d'overflow:hidden : il casserait le pied collant (sticky) */
}
.wz-head {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.3rem 1.6rem; border-bottom: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
}
.wz-head h1 { font-size: 1.3rem; margin: 0; letter-spacing: -.01em; }
.wz-head p { margin: .1rem 0 0; font-size: .9rem; }
.wz-close {
  display: grid; place-items: center; flex: none; width: 3rem; height: 3rem;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
  transition: background-color .14s var(--ease);
}
.wz-close:hover { background: var(--navy-tint); }
.wz-close .ico { width: 1.1rem; height: 1.1rem; }

.wz-body { display: grid; grid-template-columns: 14rem 1fr; gap: 2rem; padding: 1.6rem; background: var(--surface-2); }

/* Étapes : pastilles reliées par un trait */
.steps { position: sticky; top: 5rem; align-self: start; display: flex; flex-direction: column; gap: .35rem; padding-right: 1.4rem; border-right: 1px solid var(--line); }
.steps a { position: relative; display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 600; padding: .15rem 0; }
.steps a + a::before { content: ""; position: absolute; left: .55rem; top: -.75rem; height: 1rem; width: 2px; background: var(--line-strong); }
.steps .dot { flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); transition: border-color .14s var(--ease), box-shadow .14s var(--ease); }
.steps .step-label { display: inline-flex; align-items: center; gap: .55rem; padding: .55rem .9rem; border-radius: 999px; border: 1px solid transparent; transition: background-color .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease); }
.steps .step-label .ico { width: 1.05rem; height: 1.05rem; }
.steps a:hover { color: var(--ink); }
.steps a.active { color: var(--ink); }
.steps a.active .dot { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 22%, transparent); }
.steps a.active .step-label { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }

.wz-main { min-width: 0; display: flex; flex-direction: column; gap: 1.8rem; }
.wz-sec { scroll-margin-top: 5.5rem; }
.wz-sec h2 { margin: 0; font-size: 1.15rem; }
.wz-sec > .muted { margin: .15rem 0 .9rem; font-size: .9rem; }
.wz-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem 1.4rem .3rem; box-shadow: var(--shadow); }
.wz-hint { margin: 0 0 1rem; padding: .6rem .9rem; border-radius: 12px; background: var(--navy-tint); color: var(--navy); font-size: .88rem; }

/* Champs : mêmes réglages que les formulaires cartes */
.wizard label { margin: 0 0 1.1rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.wizard input, .wizard select, .wizard textarea {
  margin-top: .4rem; min-height: 2.9rem; padding: .65rem .9rem; font-size: .95rem; font-weight: 500;
  background: var(--field); border: 1px solid var(--line); border-radius: 12px;
}
.wizard input::placeholder, .wizard textarea::placeholder { opacity: .6; font-weight: 400; }
.wizard select:not([multiple]) {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23566470' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .8rem center / 1.1rem;
}
.wizard select[multiple] { padding: .4rem; }
.wizard .grid2 { gap: 0 1.2rem; }
.wizard fieldset.seg { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.wizard .radio { margin: 0; padding: .55rem 1.1rem; font-size: .9rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.wizard .radio:has(input:checked) { background: var(--navy-tint); border-color: var(--navy); color: var(--navy); }
.wizard .radio input { position: absolute; opacity: 0; pointer-events: none; }

/* Pied d'actions collé en bas de l'écran */
.wz-foot {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  padding: 1rem 1.6rem; background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 0 0 24px 24px;
}
.wz-foot .cancel { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; padding: .5rem .6rem; }
.wz-foot .cancel:hover { color: var(--ink); }
.wz-foot .cancel .ico { width: .9rem; height: .9rem; }
.wz-foot button { min-width: 9rem; }

@media (max-width: 860px) {
  .wz-body { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.1rem; }
  .steps { position: static; flex-direction: row; overflow-x: auto; padding: 0 0 .8rem; border-right: none; border-bottom: 1px solid var(--line); scrollbar-width: none; gap: .3rem; }
  .steps::-webkit-scrollbar { display: none; }
  .steps a + a::before, .steps .dot { display: none; }
  .steps a { flex: none; }
  .steps a.active .step-label { background: var(--navy); border-color: var(--navy); color: var(--accent-ink); }
  .wz-foot { bottom: 4.9rem; }   /* au-dessus de la barre d'onglets */
  .wz-head { padding: 1rem 1.1rem; }
}
@media (max-width: 560px) {
  .wz-card { padding: 1.1rem 1rem .2rem; }
  .wz-foot { padding: .8rem 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   FICHE INTERVENTION : même gabarit « assistant », étapes = onglets
   ═══════════════════════════════════════════════════════════════════════ */

.wizard .wz-head .grow { flex: 1; min-width: 0; }
.wizard .wz-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.wizard .wz-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }

.wz-show .steps { gap: .1rem; top: 1rem; }
.wz-show .steps a + a::before { top: -.55rem; height: .8rem; }
.wz-show .steps .step-label { padding: .42rem .8rem; font-size: .88rem; }
.wz-show .wz-main { gap: 1rem; }
.wz-show .tabpane { padding: 1.4rem 1.5rem 1.2rem; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.wz-show .tabpane .card { box-shadow: none; border: 1px solid var(--line); background: var(--surface-2); }
.wz-show .tabpane > h3:first-child, .wz-show .tabpane > p.muted:first-child { margin-top: 0; }
.wz-show .tabpane form > p:last-child { display: flex; justify-content: flex-end; margin-top: 1rem; }
.wz-show .readonly-banner { border-radius: 14px; }

@media (max-width: 860px) {
  .wz-show .steps { padding-bottom: .8rem; }
  .wz-show .wz-head { flex-wrap: wrap; }
  .wz-show .wz-head .actions { margin-left: 0; width: 100%; }
  .wz-show .tabpane { padding: 1.1rem 1rem; }
}

/* Cases et radios ne doivent pas hériter de la hauteur des champs texte */
.wizard input[type=checkbox], .wizard input[type=radio] { width: auto; min-height: 0; margin: 0; padding: 0; border-radius: 4px; }
.wizard .check, .wizard .radio { display: inline-flex; align-items: center; gap: .45rem; }
.wizard input[type=file] { padding: .55rem .7rem; }
.wizard .row label { margin-bottom: 0; }
