/* Charte AAVO (aavo.be) : noir et blanc, bleu ciel en accent, vert foncé pour les codes,
   Space Grotesk en capitales pour les titres, Inter pour le texte, angles droits. */
:root {
  --ink: #000;
  --bg: #fff;
  --card: #fff;
  --text: #000;
  --muted: #666;
  --line: #d6d6d6;
  --grey: #f5f5f5;
  --accent: #13413f;
  --sky: #c7e6ff;
  --accent-soft: #c7e6ff;
  --danger: #b42318;
  --ok: #157f3b;
  --warn: #b45309;
  --bar: #000;
  --radius: 0;
  --display: "Space Grotesk Variable", "Space Grotesk", system-ui, sans-serif;
  --font: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); letter-spacing: -0.005em; }
body { padding-bottom: env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
h1 { font: 300 34px/1.05 var(--display); text-transform: uppercase; margin: 0 0 12px; }
h2 { font: 500 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }
h2.mt { margin-top: 26px; }
h3 { font: 500 12px/1.2 var(--display); margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
a { color: var(--accent); }

button, .button {
  font: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 0; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .12s, background-color .12s;
}
button:hover, .button:hover { border-color: var(--ink); }
button.primary, .button.primary {
  background: var(--ink); border-color: var(--ink); color: #fff;
  font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
}
button.primary:hover, .button.primary:hover { background: #262626; }
button.primary.big { width: 100%; min-height: 56px; margin-bottom: 18px; }
button:disabled { opacity: .5; cursor: default; }
button.icon { min-height: 34px; min-width: 34px; padding: 4px 8px; font-size: 13px; }
button.danger, .danger { color: var(--danger); }
button.link { border: none; background: none; color: var(--accent); padding: 4px 6px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button.link.danger { color: var(--danger); }
button.add {
  width: 100%; border: 1px dashed #8c8c8c; color: var(--ink); background: transparent; min-height: 46px; margin-top: 4px;
  font: 500 13px var(--display); letter-spacing: .06em; text-transform: uppercase;
}
button.add:hover { border-style: solid; border-color: var(--ink); background: var(--grey); }

input, textarea, select {
  font: inherit; font-family: var(--font); letter-spacing: normal; text-transform: none;
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 0;
  background: #fff; color: var(--text); min-height: 40px;
}
textarea { resize: vertical; overflow: hidden; line-height: 1.45; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--ink); flex: none; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sky); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
.field:not(.check) > span:first-child { font: 500 11px/1.25 var(--display); letter-spacing: .07em; text-transform: uppercase; }
.field > input, .field > textarea, .field > select { color: var(--text); font-size: 15px; }
.field.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.field.wide { grid-column: 1 / -1; }

.inline { display: flex; gap: 6px; }
.inline input { flex: 1; }
.inline.small input { width: 90px; flex: none; min-height: 34px; padding: 4px 8px; }
.inline.small button { min-height: 34px; }

/* barre du haut */
.sticky { position: sticky; top: 0; z-index: 10; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top)); min-height: 64px;
  background: var(--bar); color: #fff;
}
header.topbar { position: sticky; top: 0; z-index: 10; }
.sticky header.topbar { position: static; }
.topbar .title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.topbar .title strong { font-weight: 400; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar small {
  opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 11.5px var(--display); letter-spacing: .06em; text-transform: uppercase;
}
.topbar button { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); font: 400 13px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.topbar button:hover { border-color: #fff; }
.topbar button.primary { background: var(--sky); color: var(--ink); border-color: var(--sky); font: 500 13px var(--display); letter-spacing: .06em; }
.topbar button.primary:hover { background: #fff; border-color: #fff; }
.topbar button.back { width: 44px; height: 44px; padding: 0; font-size: 0; flex: none; }
.topbar button.back::before { content: "←"; font: 400 20px/1 var(--font); }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 34px; width: auto; display: block; }
/* Bureau sans logo clair : son nom en texte */
.brand-name { font: 500 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: #fff; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav { display: flex; gap: 22px; align-items: center; }
.topnav button { border: none; padding: 4px 0; min-height: 0; font: 400 13px var(--display); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.topnav button:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.pdf-actions { display: flex; gap: 6px; }
.sync {
  font: 400 11.5px var(--display); letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid rgba(255,255,255,.35); white-space: nowrap; cursor: pointer;
}
.sync::before { content: "● "; }
.sync.ok::before { color: #4ade80; }
.sync.busy::before { color: #fbbf24; }
.sync.off::before { color: #9ca3af; }
.sync.err::before { color: #f87171; }

.tabs {
  display: flex; gap: 28px; overflow-x: auto; padding: 0 20px; background: #fff;
  border-bottom: 1px solid var(--ink); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  white-space: nowrap; border: none; border-bottom: 3px solid transparent; background: none; padding: 16px 0 12px; min-height: 0; flex: none;
  font: 400 13px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.count { font: 500 10.5px var(--display); letter-spacing: 0; background: var(--grey); color: var(--ink); padding: 1px 6px; margin-left: 2px; }
.tabs button.active .count { background: var(--sky); }

main { max-width: 980px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 18px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.error { color: var(--danger); margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar.wrap, .toolbar.secondary { flex-wrap: wrap; }
.toolbar.secondary { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.toolbar .search { flex: 1; min-width: 160px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }

/* listes */
.list { display: flex; flex-direction: column; gap: 0; margin: 14px 0; border-top: 1px solid var(--ink); }
.list-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; width: 100%;
  background: #fff; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 12px; min-height: 60px;
}
.list-item:hover { background: var(--sky); border-color: var(--line); }
.list-item strong { font-weight: 400; font-size: 17px; }
.list-item small { color: var(--muted); }
.list-item.report { flex-direction: row; align-items: center; gap: 8px; padding: 6px 8px 6px 0; }
.list-item.report:hover { background: #fff; }
.list-item.report .grow { border: none; display: flex; flex-direction: column; align-items: flex-start; background: none; padding: 8px 12px; }
.list-item.report .grow:hover { background: var(--sky); }
.archived summary { cursor: pointer; color: var(--muted); margin-top: 18px; font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }

.badge { font: 500 11px/1.4 var(--display); letter-spacing: .04em; padding: 2px 8px; background: var(--grey); white-space: nowrap; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge[data-s="PM"] { background: var(--sky); color: var(--ink); }
.badge[data-s="En cours"] { background: #fef3c7; color: var(--warn); }
.badge[data-s="Rappel"] { background: #fee2e2; color: var(--danger); }
.badge[data-s="En ordre"] { background: #dcfce7; color: var(--ok); }
.badge.new { background: var(--ink); color: #fff; }

/* lignes */
.rows .rowcard { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid var(--line); padding: 12px; margin-bottom: -1px; }
.rowcard .fields { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; min-width: 0; }
.row-actions { display: flex; flex-direction: column; gap: 4px; }
.rows .add { margin-top: 10px; }

/* segmented & chips */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg button { min-height: 34px; padding: 4px 11px; font-size: 14px; }
.seg.small button { min-height: 30px; padding: 2px 8px; font-size: 13px; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { min-height: 32px; padding: 3px 11px; font-size: 13px; }
.chip.on { background: var(--sky); color: var(--ink); border-color: var(--ink); }

/* présences */
.presence-group { padding: 12px 0; border-top: 1px solid var(--line); }
.presence-company { font-weight: 600; margin-bottom: 8px; }
.presence-company small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.presence-people { display: flex; flex-wrap: wrap; gap: 8px; }
.presence { min-height: 44px; padding: 6px 14px 6px 6px; }
.presence .dot { width: 28px; height: 28px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font: 500 13px var(--display); }
.presence.on { background: var(--sky); border-color: var(--ink); }
.presence.on .dot { background: var(--ink); border-color: var(--ink); color: #fff; }

/* intervenants */
.person { border-left: 2px solid var(--ink); padding: 6px 0 6px 12px; margin-bottom: 12px; }
.person-flags { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 8px; }

/* observations */
.obs { padding: 0; overflow: hidden; margin-bottom: -1px; }
.obs-head { display: flex; gap: 12px; align-items: center; padding: 13px 16px; cursor: pointer; }
.obs-head .num { font: 500 14px var(--display); font-variant-numeric: tabular-nums; color: var(--accent); }
.obs-head .grow { display: flex; flex-direction: column; }
.obs-head small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs.open { border-color: var(--ink); position: relative; }
.obs.open .obs-head { background: var(--sky); }
.obs.open .obs-head .badge[data-s="PM"] { background: #fff; }
.obs-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--ink); }
.statut-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rappel-n { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--danger); }
.rappel-n input { width: 64px; min-height: 34px; padding: 2px 6px; color: var(--text); }
.badge[data-s="Rappel"] { white-space: nowrap; }
.entry { border-left: 2px solid var(--line); padding: 6px 0 6px 12px; display: flex; flex-direction: column; gap: 6px; }
.entry-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry .rc { display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--display); letter-spacing: .04em; }
.entry .rc input { width: 64px; min-height: 30px; padding: 2px 6px; }
.entry.gris textarea { color: #8a8a8a; }
.entry.barre textarea { color: #8a8a8a; text-decoration: line-through; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.photo { display: flex; flex-direction: column; gap: 6px; }
.photo-actions { display: flex; gap: 4px; justify-content: center; }
.thumb { aspect-ratio: 4 / 3; background: var(--grey); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-pick .thumb { max-width: 320px; aspect-ratio: 16 / 9; margin-bottom: 8px; }
.image-pick .thumb img { object-fit: contain; }
.image-pick .toolbar { margin: 0; }
.photo.add {
  aspect-ratio: 4 / 3; border: 1px dashed #8c8c8c; align-items: center; justify-content: center; color: var(--ink); cursor: pointer;
  font: 500 13px var(--display); letter-spacing: .06em; text-transform: uppercase;
}
.photo.add:hover { background: var(--sky); border-style: solid; border-color: var(--ink); }

/* annexes du rapport (documents à fournir) */
.annex-paste { margin-top: 18px; }
.annex-paste summary { cursor: pointer; font: 500 13px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.annex-paste textarea { width: 100%; margin: 8px 0; font-family: inherit; }

.logo-box { min-height: 60px; display: flex; align-items: center; margin-bottom: 8px; }
.logo-box img { max-height: 70px; max-width: 260px; }
.logo-box.dark { background: var(--bar); color: #fff; padding: 10px 14px; font: 500 16px/1.1 var(--display); text-transform: uppercase; }
.logo-box.dark img { max-height: 40px; }
/* couleur du bureau (Réglages) */
.accent-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.accent-pick { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.tone { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--line); font-weight: 600; }

/* connexion */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; padding: 30px; border-color: var(--ink); }
.login .login-logo { width: 190px; height: auto; margin-bottom: 18px; }
.login .login-name { font: 500 20px/1.2 var(--display); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 18px; }
.login h1 { font-size: 30px; margin-bottom: 4px; }
.login .primary { min-height: 50px; }
.splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font: 400 13px var(--display); letter-spacing: .08em; text-transform: uppercase; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; max-width: calc(100% - 32px); z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); border-left: 4px solid var(--sky);
}
.update-bar {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 49;
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  background: var(--sky); color: var(--ink); padding: 12px 12px 12px 18px; border: 1px solid var(--ink);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.update-bar span { flex: 1 1 200px; }
.update-bar button { background: var(--ink); border-color: var(--ink); color: #fff; flex: none; }
.update-bar button:hover { background: #262626; }

/* accueil */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.home .topbar { padding-left: 28px; padding-right: 28px; }
.home main { max-width: 1180px; width: 100%; padding: 0 28px; flex: 1 0 auto; }
.hero { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 52px 0 36px; }
.hero h1 { font-size: 64px; line-height: 1; margin: 12px 0 0; letter-spacing: -0.01em; }
.eyebrow { font: 400 13px var(--display); letter-spacing: .07em; text-transform: uppercase; margin: 0; }
.resume {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; max-width: 360px;
  background: var(--sky); border: 1px solid var(--sky); padding: 14px 18px; min-height: 0;
}
.resume:hover { border-color: var(--ink); }
.resume small { font: 500 11px var(--display); letter-spacing: .07em; text-transform: uppercase; }
.resume strong { font-weight: 400; font-size: 16px; }
/* Grille à filets noirs : l'écart de 1 px laisse voir le fond noir entre les tuiles. */
.tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left;
  min-height: 250px; padding: 26px; border: none; background: #fff; color: var(--ink);
  transition: background-color .15s;
}
.tile:hover { background: var(--sky); }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; }
.tile-arrow { width: 44px; height: 44px; background: var(--sky); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background-color .15s; }
.tile-arrow svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 1.6; fill: none; }
.tile:hover .tile-arrow { background: var(--ink); }
.tile:hover .tile-arrow svg { stroke: #fff; }
.tile-num { font: 300 72px/1 var(--display); letter-spacing: -0.02em; margin-top: auto; }
.tile-num small { font: 400 14px var(--font); letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.tile strong { font-weight: 400; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; margin-top: 10px; }
.tile .sub { color: var(--muted); font-size: 14px; }
.home-foot { background: var(--ink); color: #fff; margin-top: 56px; display: grid; grid-template-columns: 1fr 2fr; }
.home-foot > div { padding: 32px 28px; }
.home-foot > div + div { border-left: 1px solid rgba(255,255,255,.4); display: flex; gap: 48px; flex-wrap: wrap; align-items: flex-start; }
.home-foot img { width: 64px; height: auto; display: block; }
.home-foot img.foot-logo { width: auto; max-width: 160px; max-height: 48px; }
.home-foot .eyebrow { opacity: .65; font-size: 12px; }
.home-foot ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-foot button {
  background: none; border: none; color: #fff; padding: 2px 0; min-height: 0;
  font: 400 14px var(--display); letter-spacing: .05em; text-transform: uppercase; text-align: left;
}
.home-foot button:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-foot .mail { font-size: 14px; opacity: .65; }

/* Dernière tuile seule sur sa ligne : elle s'étire pour ne pas laisser de case noire. */
.tile:last-child:nth-child(3n+1) { grid-column: span 3; }
.tile:last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:last-child:nth-child(3n+1), .tile:last-child:nth-child(3n+2) { grid-column: auto; }
  .tile:last-child:nth-child(odd) { grid-column: span 2; }
}

/* accueil personnalisé (ordre, tuiles masquées, tuiles compactes) */
.home-edit {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 28px; align-items: start; scroll-margin-top: 90px; /* sous la barre du haut */
  background: var(--sky); border: 1px solid var(--ink); padding: 16px 18px; margin: 0 0 16px;
}
.home-edit-text p { margin: 0; font-size: 14px; }
.home-edit-text .eyebrow { margin-bottom: 6px; font-weight: 500; }
.home-edit-opts { display: flex; flex-direction: column; gap: 8px; }
.home-edit .toolbar { grid-column: 1 / -1; margin: 4px 0 0; }
.home-edit .toolbar button:not(.primary) { background: #fff; }
.home-tools { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: flex-end; padding: 10px 0 0; font-size: 13px; color: var(--muted); }
.home-tools .link { color: var(--ink); font: 400 13px var(--display); letter-spacing: .05em; text-transform: uppercase; }
.tiles.editing .tile { cursor: grab; user-select: none; -webkit-user-select: none; }
.tiles.editing .tile:hover { background: #fff; }
.tiles.editing .tile.dragging { background: var(--sky); outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; cursor: grabbing; }
.tile.masked, .tiles.editing .tile.masked:hover { background: repeating-linear-gradient(135deg, #fff 0 10px, var(--grey) 10px 20px); }
.tile.masked .tile-num, .tile.masked strong, .tile.masked .sub { opacity: .45; }
.tile-grip {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--line); background: #fff; cursor: grab; touch-action: none;
}
.tile-grip svg { width: 22px; height: 22px; fill: var(--ink); }
.tile-eye { width: 44px; height: 44px; min-height: 0; padding: 0; background: var(--sky); border-color: var(--sky); flex: none; }
.tile-eye svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 1.6; fill: none; }
.tile-eye.off { background: #fff; border-color: var(--line); }
.tile-steps { display: flex; gap: 6px; margin-top: 8px; }
.tile-steps .icon { background: #fff; }
.tile-move { transition: transform .2s ease; }
/* Passage accueil <-> personnalisation : l'ancienne tuile disparaît tout de suite (pas de doublon). */
.tile-leave-active { display: none; transition: none; }
.tile-enter-active { transition: none; }
/* Tuiles compactes : plus petites, 4 par ligne (3 sur tablette, 2 sur téléphone).
   « :nth-child(n) » remet à zéro l'étirement de la dernière tuile avec la même priorité. */
.tiles.compact { grid-template-columns: repeat(4, 1fr); }
.tiles.compact .tile { min-height: 150px; padding: 18px; gap: 4px; }
.tiles.compact .tile .sub { display: none; }
.tiles.compact .tile-num { font-size: 44px; }
.tiles.compact .tile strong { font-size: 18px; margin-top: 6px; }
.tiles.compact .tile-arrow { width: 32px; height: 32px; }
.tiles.compact .tile-arrow svg { width: 16px; height: 16px; }
.tiles.compact .tile:last-child:nth-child(n) { grid-column: auto; }
.tiles.compact .tile:last-child:nth-child(4n+1) { grid-column: span 4; }
.tiles.compact .tile:last-child:nth-child(4n+2) { grid-column: span 3; }
.tiles.compact .tile:last-child:nth-child(4n+3) { grid-column: span 2; }
@media (max-width: 1000px) {
  .tiles.compact { grid-template-columns: repeat(3, 1fr); }
  .tiles.compact .tile:last-child:nth-child(n) { grid-column: auto; }
  .tiles.compact .tile:last-child:nth-child(3n+1) { grid-column: span 3; }
  .tiles.compact .tile:last-child:nth-child(3n+2) { grid-column: span 2; }
}
@media (max-width: 760px) {
  .home-edit { grid-template-columns: 1fr; }
  .tiles.compact { grid-template-columns: repeat(2, 1fr); }
  .tiles.compact .tile:last-child:nth-child(n) { grid-column: auto; }
  .tiles.compact .tile:last-child:nth-child(odd) { grid-column: span 2; }
  .tiles.compact .tile { min-height: 124px; padding: 14px; }
  .tiles.compact .tile-num { font-size: 34px; }
  .tiles.compact .tile strong { font-size: 15px; }
  .tile-grip, .tile-eye { width: 40px; height: 40px; }
}

/* projets */
.phase-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin-bottom: 14px; }
.phase-bar button { border: none; background: #fff; min-height: 44px; padding: 6px 4px; font: 500 11px/1.15 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.phase-bar button.done { background: var(--sky); }
.phase-bar button.on { background: var(--ink); color: #fff; }
.project-item .project-line { display: flex; gap: 10px; align-items: center; width: 100%; }
.project-item .project-line strong { flex: 1; }
.late { color: var(--danger); }
.jalon { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.jalon input[type=date] { width: 170px; flex: none; }
.jalon.fait input:not([type=checkbox]) { color: #999; text-decoration: line-through; }
.jalon.late input[type=date] { border-color: var(--danger); color: var(--danger); }
.row-actions.row { flex-direction: row; }
.doc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.doc-group { margin-bottom: 0; }
.doc-group .card-head h2 { margin-bottom: 10px; }
.doc-group .card-head .link { white-space: nowrap; align-self: flex-start; }
.doc-lines { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.doc-line { width: 100%; justify-content: flex-start; gap: 10px; text-align: left; border: none; border-bottom: 1px solid var(--line); padding: 8px 4px; min-height: 0; }
.doc-line:hover { background: var(--sky); }
.doc-line small { color: var(--muted); white-space: nowrap; }
.mail-people { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; border: 1px solid var(--line); padding: 10px; }
.mail-people small { margin-left: 4px; }
.echeances { display: flex; flex-direction: column; margin: 0 0 28px; border-top: 1px solid var(--ink); }
.echeances .eyebrow { padding: 12px 0 8px; }
.ech { width: 100%; justify-content: flex-start; gap: 16px; text-align: left; border: none; border-bottom: 1px solid var(--line); padding: 10px 4px; min-height: 0; }
.ech:hover { background: var(--sky); }
.ech .grow { display: flex; flex-direction: column; }
.ech strong { font-weight: 500; }
.ech small { color: var(--muted); }
.ech-date { font: 400 15px var(--display); width: 96px; flex: none; }
.ech-j { font: 500 11px var(--display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ech.late .ech-j, .ech.late .ech-date { color: var(--danger); }
.ech:disabled { opacity: 1; cursor: default; }
.ech:disabled:hover { background: none; }

/* comptes du bureau */
.login > div.card { width: 100%; max-width: 400px; padding: 30px; border-color: var(--ink); }
.login > div.card p { margin: 0 0 14px; }
.login-alt { margin: 0; text-align: center; font-size: 14px; }
.ok-msg { margin: -8px 0 0; color: var(--ok); font-size: 13px; }
.tile-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.tile-check { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 8px 10px; cursor: pointer; font-size: 14px; }
.tile-check:hover { border-color: var(--ink); }
.tile-check.on { background: var(--sky); border-color: var(--ink); }
.member { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.card > h2 + .member, .card > .hint + .member { border-top: none; padding-top: 0; }
.member strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.member small { display: block; color: var(--muted); margin-top: 2px; }
.member small.late { color: var(--danger); }
.member.off strong, .member.off .chips { opacity: .55; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 2px 8px; background: var(--grey); border: 1px solid var(--line); }
.invite-result { margin-top: 18px; padding: 16px; background: var(--sky); border: 1px solid var(--ink); }
.invite-result p { margin: 0 0 8px; }
.invite-code { font: 500 26px/1.2 var(--display); letter-spacing: .12em; }
.invite-link { width: 100%; background: #fff; }
.profil { border-top: 1px solid var(--line); padding: 12px 0; }
.profil .inline { margin-bottom: 8px; }
.profil .inline input { flex: 1; font-weight: 500; }
@media (max-width: 760px) {
  .phase-bar { grid-template-columns: repeat(4, 1fr); }
  .jalon { flex-wrap: wrap; }
  .jalon .grow { flex-basis: calc(100% - 40px); }
  .ech-date { width: 80px; }
}

/* plateforme (super-administrateur) : bureaux, abonnements, consultation */
.badge[data-abo="ok"] { background: #dcfce7; color: var(--ok); }
.badge[data-abo="alerte"] { background: #fef3c7; color: var(--warn); }
.badge[data-abo="coupe"] { background: #fee2e2; color: var(--danger); }
.member .pf-note { font-style: italic; }
.pf-edit { padding: 4px 0 16px; }
.pf-courant { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pf-courant p { margin: 0; }
.visit-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: #b45309; color: #fff; font-size: 14px; text-align: center;
}
.visit-bar button { background: #fff; color: var(--ink); border-color: #fff; min-height: 32px; padding: 4px 12px; }
.visit-bar + * header.topbar, .visit-bar ~ * header.topbar { padding-top: 12px; }
.moved-bar { background: var(--ink); } /* ancien site : nouvelle adresse d'Arko */
.moved-bar + .visit-bar { padding-top: 8px; }

/* prestations */
.presta-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.presta-period { font: 400 16px var(--display); text-transform: uppercase; letter-spacing: .04em; min-width: 120px; text-align: center; }
.presta-nav .short-date { width: 150px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); }
.wday { flex-direction: column; gap: 1px; border: none; min-height: 72px; padding: 6px 2px; background: #fff; }
.wday small { font: 500 11px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wday b { font: 300 22px/1.1 var(--display); }
.wday span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wday.has span { color: var(--ink); font-weight: 600; }
.wday.we { background: var(--grey); }
.wday.today b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.wday:hover { background: var(--sky); }
.wday.on { background: var(--ink); }
.wday.on small, .wday.on b, .wday.on span { color: #fff; }
.week-total { margin: 8px 0 14px; font-size: 14px; color: var(--muted); }
.week-total b { color: var(--ink); }
.day .card-head h2 { margin: 0; }
.day-total { font: 300 26px var(--display); font-variant-numeric: tabular-nums; }
.day .card-head { margin-bottom: 12px; }
.presta-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; border: none; border-top: 1px solid var(--line);
  padding: 12px 4px; min-height: 0; background: #fff;
}
.presta-item:hover { background: var(--sky); }
.presta-item .grow { display: flex; flex-direction: column; gap: 2px; }
.presta-item strong { font-weight: 500; font-size: 16px; }
.presta-item small { color: var(--muted); font-size: 13px; }
.presta-item .note { color: #333; white-space: pre-wrap; }
.presta-item .chips { margin-top: 4px; }
.hp { font-style: italic; }
.presta-h { font: 400 18px var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip.warn { background: #fef3c7; color: var(--warn); border-color: #f6d58a; }
.chip.tag { display: inline-flex; align-items: center; gap: 4px; padding-right: 2px; font-size: 13px; }
.chip.tag .icon { min-height: 24px; min-width: 24px; padding: 0 4px; border: none; background: none; font-size: 11px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin-bottom: 14px; }
.cal-h { background: var(--ink); color: #fff; text-align: center; padding: 6px 0; font: 500 11px var(--display); text-transform: uppercase; letter-spacing: .06em; }
.cal-d { flex-direction: column; align-items: stretch; justify-content: space-between; border: none; min-height: 62px; padding: 5px 6px; background: #fff; gap: 2px; }
.cal-d small { text-align: left; font: 500 12px var(--display); color: var(--muted); }
.cal-d b { text-align: right; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-d.we { background: var(--grey); }
.cal-d.out { opacity: .35; }
.cal-d.has { background: #eaf5ff; }
.cal-d.today small { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cal-d:hover { background: var(--sky); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 10px; }
.kpis div { background: var(--grey); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpis div.hl { background: var(--sky); }
.kpis span { font: 500 10.5px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kpis b { font: 300 22px var(--display); font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 22px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini th { text-align: left; font: 500 10.5px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--ink); padding: 6px 4px; }
table.mini td { border-bottom: 1px solid var(--line); padding: 6px 4px; vertical-align: top; }
table.mini .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.presta-form .seg button { min-height: 38px; }
.presta-form .chips { margin: 0 0 6px; }
.presta-form .chip { min-height: 34px; font-size: 13px; cursor: pointer; }
.duree { align-items: center; }
.duree input { max-width: 180px; }
.duree .muted { white-space: nowrap; }
.link.left { align-self: flex-start; padding-left: 0; }
.frais { display: grid; grid-template-columns: 1fr 110px 1.4fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.frais-photo { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.frais-photo .thumb { width: 72px; flex: none; }
.frais-photo .button { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.frais-photo .icon { margin-left: auto; }
.taux { display: grid; grid-template-columns: 180px 120px 34px; gap: 8px; align-items: end; margin-bottom: 8px; }
.person-line { flex-direction: row; align-items: center; gap: 10px; padding: 4px 8px 4px 0; }
.person-line:hover { background: #fff; }
.person-line .grow { display: flex; flex-direction: column; align-items: flex-start; border: none; background: none; padding: 8px 12px; text-align: left; }
.person-line .grow:hover:not(:disabled) { background: var(--sky); }
.person-line .grow:disabled { opacity: 1; }
.person-line .grow strong { font-weight: 400; font-size: 17px; }
.person-line.off strong { color: var(--muted); }
.person-line > button:last-child:not(.grow) { min-height: 34px; padding: 4px 10px; }
.proj { padding: 0; margin-bottom: -1px; }
.proj.open { border-color: var(--ink); position: relative; }
.proj-head { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: none; background: none; padding: 12px 16px; }
.proj-head .grow { display: flex; flex-direction: column; gap: 2px; }
.proj-head strong { font-weight: 500; }
.proj-head small { color: var(--muted); font-size: 13px; }
.proj-head:hover, .proj.open .proj-head { background: var(--sky); }
.proj-body { padding: 14px 16px; border-top: 1px solid var(--ink); }
@media (max-width: 640px) {
  .presta-nav .seg { width: 100%; }
  .presta-nav .seg button { flex: 1; }
  .presta-period { min-width: 0; flex: 1; font-size: 14px; }
  .wday { min-height: 64px; }
  .wday b { font-size: 18px; }
  .wday span { font-size: 10.5px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis b { font-size: 19px; }
  .cal-d { min-height: 52px; padding: 4px 3px; }
  .cal-d b { font-size: 11px; }
  .frais { grid-template-columns: 1fr 96px; }
  .frais input:nth-of-type(2) { grid-column: 1 / -1; }
  .taux { grid-template-columns: 1fr 90px 34px; }
}

/* partage des projets */
.modal.share { max-width: 560px; }
.share-project { margin: -6px 0 0; font: 400 20px/1.2 var(--display); }
.share-list { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.share-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.share-row .grow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-row strong { font-weight: 500; }
.share-row.off strong { color: var(--muted); }
.share-item { flex-direction: row; align-items: center; gap: 12px; }
.share-item:hover { background: #fff; }
.share-item .grow { display: flex; flex-direction: column; gap: 3px; }
.share-item > button { flex: none; min-height: 36px; }
@media (max-width: 640px) {
  .share-item { flex-direction: column; align-items: stretch; }
}

/* import d'un rapport PDF */
.import-sum { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.import-sum dt { font: 500 11px/1.9 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.import-sum dd { margin: 0; }
.import-details { margin-top: 6px; font-size: 14px; }
.import-details p { margin: 0 0 6px; }
.import-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
@media (max-width: 640px) {
  .import-sum { grid-template-columns: 1fr; gap: 0; }
  .import-sum dd { margin-bottom: 8px; }
}

/* PV de réception */
.reserve-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.reserve-num { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: var(--sky); font: 500 15px var(--display); }
.reserve.levee { opacity: .6; }
.reserve.levee .reserve-num { background: #dcfce7; color: var(--ok); }
.short-date { width: 170px; min-height: 34px; padding: 4px 8px; }
.token { display: inline-block; font: 500 12px var(--display); background: var(--grey); padding: 1px 6px; margin: 2px 4px 2px 0; }
.card > .preview { margin-top: -4px; }
.card > .field + .field, .card > .preview + .field { margin-top: 12px; }
.clause { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.clause > input[type=checkbox] { margin-top: 9px; }
.clause textarea.off { color: #999; text-decoration: line-through; }
.clause .preview { margin: 6px 0 0; font-size: 12.5px; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.sig { display: flex; flex-direction: column; gap: 6px; }
.sig-head { display: flex; justify-content: space-between; align-items: center; font: 500 11px var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); min-height: 26px; }
.sig-box { position: relative; height: 150px; border: 1px solid var(--ink); background: #fff; touch-action: none; }
.sig-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 12px; bottom: 10px; font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #aaa; pointer-events: none; }
.sig-box::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 32px; border-bottom: 1px dashed #ccc; pointer-events: none; }

.seg .button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { margin-left: 6px; }
.chip.on .count { background: #fff; }

/* croquis */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.sk-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; text-align: left; min-height: 0; }
.sk-card:hover { border-color: var(--ink); }
.sk-thumb { aspect-ratio: 4 / 3; background: var(--grey); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; border-bottom: 1px solid var(--line); }
.sk-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sk-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.sk-meta strong { font-weight: 400; font-size: 16px; }
.sk-meta small { color: var(--muted); }
.sketch { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sketch .topbar { position: static; }
.sk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--ink); background: #fff; }
.sk-tools .grp { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sk-tools .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.sk-btn { width: 42px; height: 42px; min-height: 0; padding: 0; font-size: 18px; }
.sk-btn.zoom { width: auto; padding: 0 8px; font: 500 12px var(--display); }
.sk-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sk-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sk-btn .dot { display: block; border-radius: 50%; }
.sk-btn.on .dot { outline: 2px solid #fff; }
.sk-btn .fillbox { display: block; width: 20px; height: 14px; border: 2px solid; }
.swatch { width: 30px; height: 30px; min-height: 0; padding: 0; border: 1px solid #bbb; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.sk-stage { position: relative; flex: 1; min-height: 0; background: #e9e9e9; touch-action: none; overflow: hidden; }
.sk-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sk-text {
  position: absolute; z-index: 2; min-width: 180px; width: auto; min-height: 0; padding: 2px 6px; resize: none; overflow: hidden;
  background: rgba(255, 255, 255, .92); border: 1px dashed var(--ink); line-height: 1.25; font-weight: 500;
}
.sk-hint { position: absolute; left: 12px; bottom: 8px; margin: 0; font: 400 11px var(--display); letter-spacing: .05em; text-transform: uppercase; color: #777; pointer-events: none; }

/* estimation rapide */
.zone-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.zone-label { flex: 1; font-size: 18px; font-weight: 500; border-color: transparent; padding-left: 0; }
.zone-label:hover { border-color: var(--line); padding-left: 10px; }
.zone-label:focus { padding-left: 10px; }
.zone-total { font: 400 20px var(--display); white-space: nowrap; }
.zone-fields { display: grid; grid-template-columns: 140px auto 1fr; gap: 12px; align-items: end; margin-bottom: 12px; }
.ratio .zone-fields { grid-template-columns: 90px repeat(3, 1fr) auto; }
.seg.niveaux button { flex-direction: column; gap: 0; line-height: 1.15; min-height: 40px; }
.seg.niveaux small { font-size: 11px; opacity: .7; }
.options { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-bottom: 12px; }
.option { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.option.on { background: linear-gradient(90deg, var(--sky), transparent 60%); }
.option .field.check { font-size: 14px; }
.opt-qty { width: 110px; min-height: 34px; padding: 4px 8px; }
.opt-edit { display: grid; grid-template-columns: 1fr 110px 160px 34px; gap: 6px; margin-bottom: 6px; }
.metre.recap { min-width: 0; }
.metre.recap tfoot td:first-child { text-align: right; }
.total-band {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 32px; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: 12px 20px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.total-band div { display: flex; flex-direction: column; gap: 2px; }
.total-band span { font: 400 11px var(--display); letter-spacing: .07em; text-transform: uppercase; opacity: .7; }
.total-band b { font: 300 22px var(--display); font-variant-numeric: tabular-nums; }
.total-band .ttc { background: var(--sky); color: var(--ink); margin: -12px -20px; margin-bottom: calc(-12px - env(safe-area-inset-bottom)); padding: 12px 20px; }
.total-band .ttc span { opacity: .8; }

/* comparatif des offres */
.badge.rang { background: var(--ink); color: #fff; font-weight: 700; }
.badge.err { background: #fee2e2; color: var(--danger); }
.points { margin: 0; padding-left: 18px; font-size: 14px; color: #333; display: flex; flex-direction: column; gap: 2px; }
.metre tr.min td.num input, .metre td.cell.min { background: #dcfce7; }
.metre td.cell.max { background: #fee2e2; }
.metre tr.missing td, .metre td.cell.missing { background: #fff8e1; }
.metre tr.anormal td.num input, .metre td.cell.anormal { color: var(--danger); font-weight: 700; }
.metre tr.best td { background: var(--sky); font-weight: 600; }
.metre .errtext { color: var(--danger); }
.compare td.cell { font-variant-numeric: tabular-nums; }
.legend { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); margin-left: 8px; }
.legend i.min { background: #dcfce7; } .legend i.max { background: #fee2e2; } .legend i.missing { background: #fff8e1; }
.legend b { color: var(--danger); margin-left: 8px; }

.notice { background: var(--grey); border: none; border-left: 3px solid var(--ink); padding: 12px 16px; margin: 0 0 14px; font-size: 14px; }
.notice.warn { background: #fff8e6; border-left-color: var(--warn); }
.notice code { background: rgba(0,0,0,.06); padding: 1px 5px; }
.muted { color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }
.badge.warn { background: #fef3c7; color: var(--warn); }
main.wide { max-width: 1180px; }

/* cahier des charges */
.csc { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.csc .code { font: 500 14px var(--display); font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.csc-heading-line {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: none; background: none;
  padding: 6px 4px; min-height: 0;
}
.csc-heading-line:hover { background: var(--grey); }
.csc-heading.lvl1 .csc-heading-line {
  font: 400 22px/1.15 var(--display); text-transform: uppercase; margin-top: 18px; padding: 8px 0 12px;
  border-bottom: 1px solid var(--ink);
}
.csc-heading.lvl1 .csc-heading-line .code { font-size: 22px; font-weight: 300; }
.csc-heading.lvl2 .csc-heading-line { font: 500 14px var(--display); text-transform: uppercase; letter-spacing: .04em; margin-top: 12px; }
.csc-heading.lvl3 .csc-heading-line { font: 500 14px var(--display); padding-left: 12px; }
.csc-heading.lvl4 .csc-heading-line, .csc-heading.lvl5 .csc-heading-line, .csc-heading.lvl6 .csc-heading-line { font-size: 14px; color: #333; padding-left: 24px; }
.heading-edit { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.poste { padding: 0; overflow: hidden; margin-bottom: -1px; }
.poste-head { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: none; background: none; padding: 12px 16px; }
.poste-head:hover { background: var(--grey); }
.poste.open { border-color: var(--ink); position: relative; }
.poste.open .poste-head { background: var(--sky); }
.poste.open .poste-head .badge { background: #fff; }
.poste-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--ink); }
.add-sections { display: flex; flex-wrap: wrap; gap: 6px; }
.aide summary { cursor: pointer; color: var(--muted); font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.aide p { white-space: pre-wrap; font-size: 13px; color: #444; }

/* métré */
.metre-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--ink); }
.metre { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
.metre th, .metre td { border-bottom: 1px solid #e3e3e3; padding: 5px 6px; vertical-align: middle; text-align: left; }
.metre th {
  background: var(--ink); color: #fff; font: 500 11px var(--display); text-transform: uppercase; letter-spacing: .06em;
  position: sticky; top: 0; padding: 9px 6px;
}
.metre .num { text-align: right; white-space: nowrap; }
.metre input, .metre select { min-height: 32px; padding: 4px 6px; font-size: 14px; }
.metre td.num input { text-align: right; width: 100px; }
.metre input.short, .metre select.short { width: 70px; }
.metre .designation { min-width: 260px; min-height: 32px; padding: 5px 6px; resize: none; font-size: 14px; line-height: 1.35; }
.metre .code .link { font: 500 13px var(--display); font-variant-numeric: tabular-nums; text-decoration: none; }
.metre .m-heading td { font-weight: 600; background: var(--grey); }
.metre .m-heading.lvl1 td { background: var(--sky); color: var(--ink); font: 500 13px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.metre .qty { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.metre .qty .calc { font-variant-numeric: tabular-nums; color: var(--text); text-decoration: underline dotted; }
.metre tr.open td { background: #f8fbff; }
.metre .total { font-weight: 600; }
.metre tfoot td { font-weight: 600; text-align: right; background: var(--grey); }
.metre tfoot .grand td { background: var(--sky); font-size: 15px; }
.metre .tva { width: 60px; display: inline-block; }
.m-detail td { background: #f8fbff; }
.lines { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.line { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) 110px 34px; gap: 6px; align-items: center; }
.line .res { text-align: right; font-variant-numeric: tabular-nums; }
.line .res.err { color: var(--danger); font-size: 12px; }

/* fenêtre d'ajout de poste */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; }
.modal { background: #fff; width: 100%; max-width: 760px; max-height: 88vh; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.3); border-top: 4px solid var(--ink); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal > * { flex-shrink: 0; }
.search.big { font-size: 16px; min-height: 48px; }
.results { display: flex; flex-direction: column; gap: 0; }
.result { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: none; border-bottom: 1px solid #ececec; padding: 9px 10px; }
.result:hover { background: var(--sky); }
.result .code { font: 500 13px var(--display); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result .grow { display: flex; flex-direction: column; }
.result small { color: var(--muted); font-size: 12px; }
.free summary { cursor: pointer; color: var(--ink); margin-bottom: 10px; font: 500 13px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.free .grid { margin-bottom: 10px; }
.preview { white-space: pre-wrap; font: 13px/1.5 var(--font); background: var(--grey); padding: 12px; margin: 2px 0 8px; }

/* import */
.imports { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.import-name { font-weight: 600; font-size: 14px; }
.bar { height: 4px; background: var(--grey); overflow: hidden; margin: 4px 0; }
.bar div { height: 100%; background: var(--ink); transition: width .2s; }
.import small.error { color: var(--danger); }

/* suivi du budget */
.bar > span { display: block; height: 100%; background: var(--ink); transition: width .2s; }
.bar.over > span { background: var(--danger); }
.budget-item .bar { display: block; width: 100%; max-width: 420px; }
.kpis div.over b { color: var(--danger); }
.kpis.k1 { grid-template-columns: 1fr; }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); }
.lot-toggle { flex: none; }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
input.money.bad { border-color: var(--danger); box-shadow: 0 0 0 3px #fee2e2; }
.lot { padding: 0; }
.lot.open { border-color: var(--ink); }
.lot-head { display: flex; gap: 8px; align-items: center; padding: 14px 14px 0; }
.lot-num { width: 64px; flex: none; font: 400 18px var(--display); text-align: center; }
.lot-names { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.lot-ent { font-weight: 600; }
.lot-sum {
  width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px; border: none; background: none;
  padding: 12px 14px 14px; text-align: left; min-height: 0;
}
.lot-sum:hover { background: var(--grey); }
.lot-sum .bar { display: block; height: 6px; margin: 0; }
.lot-sum .chip { align-self: flex-start; }
.lot-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.lot-figs > span { background: #fff; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.lot-figs > span.hl { background: var(--sky); }
.lot-figs small { font: 500 10.5px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.lot-figs b { font: 400 16px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lot-body { padding: 4px 14px 6px; border-top: 1px solid var(--line); }
.lot-body h3:first-child { margin-top: 12px; }
.bl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.bl input { min-height: 36px; padding: 5px 8px; font-size: 14px; }
.bl .icon { margin-left: auto; }
.bl-h { border-bottom: 1px solid var(--ink); padding: 0 0 4px; }
.bl-h span { font: 500 10.5px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.bl-h .w-money, .bl-h .w-cumul { text-align: right; }
.bl-total { border-bottom: none; font-variant-numeric: tabular-nums; }
.bl-total b { text-align: right; padding-right: 9px; }
.w-lab { width: 84px; font-size: 14px; }
.w-num { width: 56px; flex: none; text-align: center; }
.w-date { width: 150px; flex: none; }
.w-money { width: 160px; flex: none; }
.w-cumul { width: 140px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.w-desc { flex: 1; min-width: 180px; }
.budget-recap tbody tr.clickable { cursor: pointer; }
.budget-recap tbody tr.clickable:hover td { background: var(--sky); }
.budget-recap tr.over td:nth-child(5) { color: var(--danger); font-weight: 600; }
@media (max-width: 640px) {
  .lot-head { align-items: flex-start; padding: 12px 12px 0; }
  .lot-num { width: 52px; }
  .lot-names { grid-template-columns: 1fr; }
  .lot-figs { grid-template-columns: 1fr 1fr; }
  .lot-figs b { font-size: 15px; }
  .kpis.k3 { grid-template-columns: 1fr; }
  .lot-sum, .lot-body { padding-left: 12px; padding-right: 12px; }
  .bl-h { display: none; }
  .bl input { font-size: 13px; padding: 5px 6px; }
  .w-lab { width: 100%; }
  .w-num { width: 44px; }
  .w-date { width: 128px; }
  .w-money { width: auto; flex: 1; min-width: 96px; }
  .w-desc { flex-basis: 100%; }
  .w-cumul { width: auto; }
}

/* répertoire */
.annu { flex-direction: row; align-items: center; padding: 4px 8px 4px 0; }
.annu:hover { background: #fff; }
.annu .grow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: none; background: none; padding: 8px 12px; text-align: left; min-width: 0; }
.annu .grow:hover { background: var(--sky); }
.rep-filters { margin: 0 0 12px; }
.rep-filters .chip { min-height: 32px; font-size: 13px; cursor: pointer; }
.rep-modal h3 { margin-top: 6px; }
.rep-modal .notice { margin: 12px 0 0; }
.rep-picker .field.check { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rep-picker .field.check small { margin-left: 6px; }
.rep-link { margin: -4px 0 10px; font: 500 10.5px var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.rep-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.rep-suggest .chip { min-height: 30px; cursor: pointer; background: var(--sky); border-color: var(--ink); color: var(--ink); }
.rep-changes { background: #fff8e6; border-left: 3px solid var(--warn); padding: 14px 16px; margin: 0 0 14px; }
.rep-changes .card-head h2 { margin: 0; font-size: 18px; }
.rep-changes .hint { margin: 6px 0 4px; }
.rep-change { padding: 10px 0 0; border-top: 1px solid #f1dfb0; margin-top: 10px; }
.rep-change ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.rep-change .old { color: var(--muted); text-decoration: line-through; }
.rep-change .toolbar { margin: 8px 0 0; flex-wrap: wrap; }

/* to do list (bulles rondes à cocher : seule exception aux angles droits) */
.todo-list { border-top: 1px solid var(--ink); margin: 0 0 14px; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 8px; border-bottom: 1px solid var(--line); background: #fff; }
.bubble {
  width: 30px; height: 30px; min-height: 0; padding: 0; flex: none; border: 2px solid var(--ink); border-radius: 50%;
  background: #fff; color: var(--ink);
}
.bubble svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .12s; }
.bubble:hover { border-color: var(--accent); }
.bubble:hover svg { opacity: .35; }
.bubble.on { background: var(--accent); border-color: var(--accent); color: #fff; animation: bubble-pop .28s ease-out; }
.bubble.on svg { opacity: 1; }
@keyframes bubble-pop { 0% { transform: scale(.75); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.todo-main {
  flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  border: none; background: none; text-align: left; padding: 6px 8px; min-height: 44px;
}
.todo-main:hover { background: var(--sky); }
.todo-main strong { font-weight: 400; font-size: 16px; overflow-wrap: anywhere; }
.todo-row.done .todo-main strong { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--muted); }
.todo-late { color: var(--danger); }
.todo-star { color: var(--warn); }
.todo-jour { color: var(--accent); }
.todo-sun svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.todo-sun.on { background: var(--sky); border-color: var(--ink); }
.todo-plan { min-height: 34px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.todo-progress { height: 4px; background: var(--grey); margin: 4px 0 12px; }
.todo-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.todo-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.todo-add > input { flex: 1; min-width: 200px; }
.todo-date { display: flex; align-items: center; gap: 6px; font: 500 11px var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.todo-date input { width: auto; }
.todo-bravo { color: var(--accent); font: 500 13px var(--display); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
.todo-backlog { margin: 18px 0 0; }
.todo-backlog summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; font: 400 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.todo h3 { margin-top: 26px; }
/* semaine : un jour par case, une petite bulle par tâche */
.todo-week { display: flex; align-items: center; gap: 6px; margin: 0 0 18px; }
.todo-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.todo-day { flex-direction: column; gap: 2px; padding: 6px 2px; min-height: 66px; }
.todo-day small { font: 500 10.5px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.todo-day b { font: 400 20px/1.1 var(--display); }
.todo-day.past b { color: var(--muted); }
.todo-day.today { background: var(--sky); border-color: var(--sky); }
.todo-day.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.todo-dots { display: flex; align-items: center; gap: 3px; height: 8px; }
.todo-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink); }
.todo-dots i.on { background: var(--accent); border-color: var(--accent); }
.todo-dots em { font: 600 10px/1 var(--font); font-style: normal; }
.todo-dayhead { display: flex; align-items: flex-end; gap: 12px; }
.todo-dayhead h2 { font: 300 28px/1.1 var(--display); margin: 0 0 4px; }
.todo-dayhead .hint { margin: 0; }
/* listes */
.todo-lists { margin: 0 0 14px; }
.todo-lists .chip { cursor: pointer; }
.todo-addlist { border-style: dashed; }
.todo-newlist { width: 200px; min-height: 32px; padding: 3px 10px; font-size: 13px; }
.todo-listhead { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.todo-listname { flex: 1; font: 300 26px var(--display); text-transform: uppercase; border: 1px solid transparent; padding: 2px 6px; margin-left: -6px; }
.todo-listname:hover { border-color: var(--line); }
.todo-filter { max-width: 320px; margin: 0 0 14px; }
.todo-modal .field { margin-bottom: 12px; }
.todo-modal .grid .field { margin-bottom: 0; }
.todo-modal .seg { margin-top: 4px; }
.todo-imp { margin-top: 14px; }
/* accueil : « Aujourd’hui » à côté des échéances */
.home-agenda { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 0 40px; align-items: start; }
.today-block { display: flex; flex-direction: column; margin: 0 0 28px; border-top: 1px solid var(--ink); }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 4px; }
.today-day { color: var(--muted); margin-left: 6px; }
.today-count { font: 400 15px var(--display); }
.today-block .todo-progress { margin: 4px 0 4px; }
.todo-row.compact { padding: 2px 0 2px 4px; }
.todo-row.compact .bubble { width: 24px; height: 24px; }
.todo-row.compact .bubble svg { width: 13px; height: 13px; }
.todo-row.compact .todo-main { min-height: 38px; }
.todo-row.compact .todo-main strong { font-size: 15px; font-weight: 500; }
.todo-row.compact.done .todo-main strong { font-weight: 400; }
.today-empty { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.today-empty.bravo { color: var(--accent); }
.today-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.today-add { flex: 1 1 100%; }
.today-foot .link:last-child { margin-left: auto; }
.today-add input { min-height: 36px; border-style: dashed; border-color: #8c8c8c; }
.today-add input:focus { border-style: solid; }

@media (max-width: 760px) {
  .home .topbar { padding-left: 16px; padding-right: 16px; }
  .home main { padding: 0 16px; }
  .topnav { display: none; }
  .hero { padding: 30px 0 22px; }
  .hero h1 { font-size: 40px; }
  .resume { max-width: none; width: 100%; }
  .tile { min-height: 168px; padding: 16px; }
  .tile-num { font-size: 44px; }
  .tile-num small { display: block; margin: 6px 0 0; font-size: 12px; line-height: 1.2; }
  .tile strong { font-size: 16px; }
  .tile .sub { display: none; }
  .tile-arrow { width: 32px; height: 32px; }
  .tile-arrow svg { width: 16px; height: 16px; }
  .home-foot { grid-template-columns: 1fr; margin-top: 36px; }
  .home-foot > div { padding: 24px 16px; }
  .home-foot > div + div { border-left: none; border-top: 1px solid rgba(255,255,255,.4); gap: 32px; }
}

@media (max-width: 640px) {
  .member { flex-direction: column; gap: 10px; }
  .member-actions { justify-content: flex-start; }
  .topbar { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 10px; }
  .topbar button.back { width: 40px; height: 40px; }
  .brand img { height: 28px; }
  .tabs { padding: 0 12px; gap: 22px; }
  .line { grid-template-columns: 1fr 1fr; }
  .line .res { text-align: left; }
  main { padding: 14px 12px; }
  .card { padding: 14px; }
  .pdf-actions { width: 100%; }
  .pdf-actions button { flex: 1; }
  .grid { grid-template-columns: 1fr; }
  .rows .rowcard { flex-direction: column; }
  .rows .row-actions { flex-direction: row; align-self: flex-end; }
  .csc-heading.lvl1 .csc-heading-line, .csc-heading.lvl1 .csc-heading-line .code { font-size: 18px; }
  .zone-fields, .ratio .zone-fields { grid-template-columns: 1fr 1fr; }
  .zone-fields .field:has(.niveaux) { grid-column: 1 / -1; }
  .seg.niveaux { display: grid; grid-template-columns: repeat(3, 1fr); }
  .opt-edit { grid-template-columns: 1fr 80px 34px; }
  .opt-qty { width: 64px; }
  .opt-edit input:nth-child(3) { grid-column: 1 / 3; }
  .total-band { gap: 18px; padding-left: 12px; padding-right: 12px; }
  .total-band b { font-size: 18px; }
  .total-band .ttc { margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .sk-btn { width: 38px; height: 38px; }
  .sk-hint { display: none; }
  .todo-week { gap: 3px; }
  .todo-week > .icon { min-width: 26px; padding: 0; }
  .todo-days { gap: 2px; }
  .todo-dots { gap: 2px; }
  .todo-dots i { width: 5px; height: 5px; }
  .todo-dayhead h2 { font-size: 24px; }
  .todo-listname { font-size: 21px; }
}
