/* ========================================================================
   SENTINEL APP — Stylesheet v2
   Aligné sur le Brand Book ImmoSentinel v1.0
   ========================================================================
   Tokens :
   - Palette N/B + vert signal #34D399 + bleu Paul #229ED9
   - Geist (display) / Inter (body) / Geist Mono (data)
   - Border-radius ≤ 4 px partout, sauf signal-dots et badges pilule
   - Status colors réservés au cycle de vie : gris/orange/vert/rouge
   ========================================================================
*/

:root {
  /* Surfaces */
  --color-bg:               #0A0A0A;
  --color-surface:          #111111;
  --color-surface-2:        #161616;
  --color-surface-3:        #1B1B1B;
  --color-surface-elev:     #1F1F1F;

  /* Borders */
  --color-border:           #1A1A1A;
  --color-border-strong:    #2A2A2A;
  --color-border-active:    #FFFFFF;

  /* Text */
  --color-text:             #FFFFFF;
  --color-text-muted:       #888888;
  --color-text-dim:         #555555;
  --color-text-faint:       #333333;

  /* Data signal */
  --color-success:          #34D399;
  --color-info:             #229ED9;
  --color-warning:          #F0A44A;
  --color-danger:           #FF5252;

  --accent:                 var(--color-success);

  /* Fonts */
  --font-display:           'Geist', sans-serif;
  --font-body:              'Inter', sans-serif;
  --font-mono:              'Geist Mono', ui-monospace, monospace;

  /* Type scale */
  --fs-display-l:           clamp(28px, 2.8vw, 40px);
  --fs-display-m:           clamp(22px, 2vw, 28px);
  --fs-title:               18px;
  --fs-body:                14px;
  --fs-sm:                  13px;
  --fs-xs:                  12px;
  --fs-mono:                11px;
  --fs-mono-sm:             10px;

  /* Spacing */
  --sp-1:                   4px;
  --sp-2:                   8px;
  --sp-3:                   12px;
  --sp-4:                   16px;
  --sp-5:                   20px;
  --sp-6:                   24px;
  --sp-8:                   32px;
  --sp-10:                  40px;
  --sp-12:                  48px;
  --sp-16:                  64px;

  --radius:                 4px;
  --radius-sm:              2px;

  /* Layout */
  --nav-w:                  240px;
  --content-pad:            32px;

  /* Easings */
  --ease-out:               cubic-bezier(.22, .61, .36, 1);
  --ease-out-expo:          cubic-bezier(.16, 1, .3, 1);
}

/* Light mode (toggle .light on body) */
body.light {
  --color-bg:               #FAFAFA;
  --color-surface:          #FFFFFF;
  --color-surface-2:        #F4F4F4;
  --color-surface-3:        #EDEDED;
  --color-surface-elev:     #FFFFFF;
  --color-border:           #E5E5E5;
  --color-border-strong:    #D4D4D4;
  --color-border-active:    #0A0A0A;
  --color-text:             #0A0A0A;
  --color-text-muted:       #525252;
  --color-text-dim:         #888888;
  --color-text-faint:       #BBBBBB;
  /* Chantier 08 : le vert #34D399 ne passe pas sur blanc (2,1:1). La spec
     propose #0F9D6B en l'annoncant a 4,6:1, mais il mesure 3,5:1 (WCAG) :
     #0A7C56 passe AA sur blanc (5,2:1), sur #F4F4F4 (4,7:1) et en texte
     de badge (#FAFAFA sur vert : 5,0:1). Meme traitement pour l'orange
     (#F0A44A = 2,0:1 -> #B45309 = 5,0:1) et le rouge (#FF5252 = 3,1:1 ->
     #D32F2F = 5,0:1). --accent doit etre REDEFINI ici : resolu sur :root,
     il garderait la valeur sombre. */
  --color-success:          #0A7C56;
  --color-warning:          #B45309;
  --color-danger:           #D32F2F;
  --accent:                 var(--color-success);
}

/* ============================================================ */
/* RESET                                                          */
/* ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--color-bg); color-scheme: dark; }
body.light { color-scheme: light; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow: hidden;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--accent); color: #000; }

/* Numbers everywhere */
[data-num], .num, td.num, .metric__value, .kpi__value,
.timeline__time, .mono, .stat__value {
  font-variant-numeric: tabular-nums;
}

/* ============================================================ */
/* APP SHELL                                                      */
/* ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  height: 100vh;
  height: 100dvh; /* mobile : exclut la barre d'outils Safari (fallback 100vh au-dessus) */
  overflow: hidden;
}
.app__main {
  position: relative;
  overflow-y: auto;
  background: var(--color-bg);
}

/* ============================================================ */
/* SIDEBAR — chantier 01 : 4 groupes nommes, items Inter 12.5 px,  */
/* pied = ligne utilisateur (avatar, nom, pack) + menu              */
/* ============================================================ */
.nav {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  position: relative;
}

/* Brand block */
.nav__brand { padding: 18px 10px 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav__toggle {
  width: 24px; height: 24px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 3px;
  color: var(--color-text-dim);
  transition: color .12s, background .12s;
}
.nav__toggle:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav__toggle svg { width: 14px; height: 14px; transition: transform .22s var(--ease-out); }
.nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav__mark {
  width: 16px; height: 16px;
  border: 1.5px solid currentColor;
  position: relative;
  flex-shrink: 0;
}
.nav__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  transform-origin: center;
  animation: markHeartbeat 1.6s var(--ease-out) infinite;
}
@keyframes markHeartbeat {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in oklch, var(--accent) 65%, transparent); }
  18%  { transform: scale(1.18); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 25%, transparent); }
  30%  { transform: scale(.92);  box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 0%,  transparent); }
  44%  { transform: scale(1.14); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }
  58%  { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in oklch, var(--accent) 0%,  transparent); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in oklch, var(--accent) 0%,  transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .nav__mark::after { animation: none !important; }
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--color-text-dim);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  padding: 1px 5px;
  background: var(--color-bg);
}

/* Section list : aucune scrollbar visible, overflow-x interdit */
.nav__sections {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 8px 10px;
  scrollbar-width: none;
}
.nav__sections::-webkit-scrollbar { display: none; }
.nav__group + .nav__group { margin-top: 2px; }
.nav-g {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding: 14px 10px 6px;
}

.nav__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color .12s, background .12s, box-shadow .12s;
}
.nav__item:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav__item.is-active {
  color: var(--color-text);
  background: var(--color-surface-2);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav__item-glyph { width: 12px; height: 12px; flex-shrink: 0; opacity: .5; display: inline-flex; }
.nav__item-glyph svg { width: 12px; height: 12px; }
.nav__item.is-active .nav__item-glyph { opacity: 1; color: var(--accent); }
.nav__item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__item.is-locked { opacity: .55; }
.nav__item-lock { margin-left: auto; display: inline-flex; color: var(--color-text-dim); }
.nav__item-lock svg { width: 11px; height: 11px; }
.nav__item-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  background: var(--accent);
  color: var(--color-bg);
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: .04em;
}
.nav__item-badge--sa {
  background: transparent;
  color: var(--color-warning);
  border: 1px solid color-mix(in oklch, var(--color-warning) 40%, transparent);
}

/* Footer : ligne utilisateur + menu */
.nav__footer { border-top: 1px solid var(--color-border); padding: 8px; position: relative; }
.user {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 3px;
  text-align: left;
  transition: background .12s;
}
.user:hover, .user.is-open { background: var(--color-surface-2); }
.user__avatar {
  width: 28px; height: 28px;
  border-radius: 2px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.user__body { display: grid; gap: 1px; min-width: 0; flex: 1; }
.user__name { font-size: 12px; font-weight: 500; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user__chev { color: var(--color-text-dim); display: inline-flex; transform: rotate(-90deg); }
.user__chev svg { width: 12px; height: 12px; }

.user-menu {
  position: absolute;
  left: 8px; right: 8px;
  bottom: calc(100% + 4px);
  background: var(--color-surface-elev);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  padding: 6px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  z-index: 60;
  display: grid;
  gap: 2px;
  animation: modalIn .16s var(--ease-out-expo);
}
.user-menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  transition: background .12s;
}
.user-menu__item:hover { background: var(--color-surface-2); }
.user-menu__item--danger { color: var(--color-danger); }
.user-menu__row { display: grid; gap: 6px; padding: 6px 10px 8px; }
.user-menu__row .user-menu__seg { justify-self: start; }
.user-menu__label { font-size: 12.5px; font-weight: 500; }
.user-menu__seg {
  display: inline-flex;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  padding: 2px; gap: 2px;
  background: var(--color-surface-2);
}
.user-menu__seg button { height: 22px; padding: 0 8px; border-radius: 2px; font-size: 11px; font-weight: 500; color: var(--color-text-muted); }
.user-menu__seg button.on { background: var(--color-text); color: var(--color-bg); }
.user-menu__sep { height: 1px; background: var(--color-border); margin: 4px 0; }
.user-menu__foot {
  padding: 4px 10px 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================ */
/* PAGE                                                           */
/* ============================================================ */
.page {
  padding: var(--content-pad);
  max-width: 1600px;
  margin: 0 auto;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.page-header > div:first-child { min-width: 0; }
.page-header__crumb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}
.page-header__crumb a { transition: color .12s; display: inline-block; padding: 6px 2px; margin: -6px -2px; }
.page-header__crumb a:hover { color: var(--color-text); }
.page-header__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.page-header__sub {
  color: var(--color-text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.page-header__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
  flex-shrink: 0;
}
.page-header__dot[data-state="pending"] { background: var(--color-text-dim); }
.page-header__dot[data-state="warning"] { background: var(--color-warning); }
.page-header__actions {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================ */
/* CARDS                                                          */
/* ============================================================ */
.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
body.light .card::before {
  background: linear-gradient(to right, transparent, rgba(0,0,0,.06), transparent);
}
.card--hoverable:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}
.card--padded { padding: 24px; }
.card--flush { padding: 0; }

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.card__title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.card__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

/* ============================================================ */
/* BUTTONS — chantier 02 : Inter 13 px sentence case, 36 px (30 compact) */
/* ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  border: 1px solid var(--color-border-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--color-text);
  transition: background .15s, border-color .15s, color .15s, transform .12s;
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-dim);
}
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.btn--primary:hover {
  background: color-mix(in oklch, var(--color-text) 86%, var(--color-bg));
  border-color: color-mix(in oklch, var(--color-text) 86%, var(--color-bg));
  color: var(--color-bg);
}
/* Chantier 08 : fond vert -> texte blanc en clair, noir en sombre */
.btn--accent { color: var(--color-bg); }
.btn--accent:hover { color: var(--color-bg); }

.btn--accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn--accent:hover {
  background: color-mix(in oklch, var(--accent) 88%, white);
  border-color: color-mix(in oklch, var(--accent) 88%, white);
  color: #000;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}
.btn--ghost:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
  border-color: transparent;
}

.btn--danger {
  color: var(--color-danger);
  border-color: color-mix(in oklch, var(--color-danger) 35%, var(--color-border-strong));
}
.btn--danger:hover {
  background: color-mix(in oklch, var(--color-danger) 10%, transparent);
  border-color: var(--color-danger);
}

.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--icon { padding: 0 10px; }
.btn--sm.btn--icon { padding: 0 8px; }

/* ============================================================ */
/* PILLS / BADGES                                                 */
/* ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
  border: 1px solid var(--color-border-strong);
  border-radius: 2px;
  color: var(--color-text-muted);
  background: transparent;
}
.pill--success { color: var(--color-success); border-color: color-mix(in oklch, var(--color-success) 40%, transparent); background: color-mix(in oklch, var(--color-success) 8%, transparent); }
.pill--info    { color: var(--color-info);    border-color: color-mix(in oklch, var(--color-info) 40%, transparent);    background: color-mix(in oklch, var(--color-info) 8%, transparent); }
.pill--warning { color: var(--color-warning); border-color: color-mix(in oklch, var(--color-warning) 40%, transparent); background: color-mix(in oklch, var(--color-warning) 8%, transparent); }
.pill--danger  { color: var(--color-danger);  border-color: color-mix(in oklch, var(--color-danger) 40%, transparent);  background: color-mix(in oklch, var(--color-danger) 8%, transparent); }
.pill--neutral { color: var(--color-text-muted); }

.pill__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill--success.pill--pulse .pill__dot,
.pill--warning.pill--pulse .pill__dot {
  animation: dotPulse 1.6s var(--ease-out) infinite;
  box-shadow: 0 0 0 2px color-mix(in oklch, currentColor 25%, transparent);
}

/* ============================================================ */
/* FORM CONTROLS                                                  */
/* ============================================================ */
.field {
  display: grid;
  gap: 6px;
}
.field__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.field__hint {
  font-size: 11px;
  color: var(--color-text-dim);
  line-height: 1.4;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
  transition: border-color .12s, background .12s;
}
.input::placeholder { color: var(--color-text-dim); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--color-text);
}
.textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
                    linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  /* Un <option> tres long ne doit jamais elargir le select au-dela de son
     conteneur (mobile : debordement horizontal de toute la page). */
  max-width: 100%;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 4px 4px 4px 12px;
}
.input-row:focus-within { border-color: var(--color-text); }
.input-row input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  padding: 4px 0;
  color: var(--color-text);
  font-size: 13px;
}
.input-row input::placeholder { color: var(--color-text-dim); }
/* Barres d'outils (chantier 03/04) : controles compacts 30 px */
.input-row--sm { height: 30px; padding: 0 4px 0 10px; border-radius: 3px; }
.input-row--sm input { padding: 0; font-size: 12.5px; }
.input-row--sm svg { width: 12px; height: 12px; color: var(--color-text-dim); }
.select--sm { height: 30px; padding: 0 28px 0 10px; font-size: 12.5px; border-radius: 3px; background-position: calc(100% - 12px) 12px, calc(100% - 7px) 12px; }

/* Checkbox */
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  cursor: pointer;
}
.checkbox input { display: none; }
.checkbox__box {
  width: 14px; height: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 2px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .12s, border-color .12s;
}
.checkbox input:checked + .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox__box svg {
  width: 10px; height: 10px;
  color: var(--color-bg);
  opacity: 0;
  transition: opacity .12s;
}
.checkbox input:checked + .checkbox__box svg { opacity: 1; }

/* ============================================================ */
/* TABLES — chantier 03 : 44 px / ligne, chiffres mono a droite,     */
/* texte qui ne casse pas, actions revelees au survol                */
/* ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  font-weight: 400;
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.4;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: var(--color-surface-2); }
.table tbody tr.is-selected td { background: color-mix(in oklch, var(--accent) 7%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table td.name { font-weight: 500; color: var(--color-text); white-space: nowrap; }
.table td.name a, .table td.name span[role="button"] { cursor: pointer; }
.ellip {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.table td.chk, .table th.chk { width: 32px; padding-right: 0; }
.tick {
  width: 14px; height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.table .actions { text-align: right; }
.rowact {
  display: flex; gap: 4px; justify-content: flex-end;
  opacity: 0;
  transition: opacity .12s;
}
tr:hover .rowact, tr:focus-within .rowact, tr.is-selected .rowact { opacity: 1; }
@media (hover: none) { .rowact { opacity: 1; } }
.rowact .btn--sm { width: 30px; padding: 0; }
/* Menu contextuel de ligne (⋯) */
.rowmenu-wrap { position: relative; display: inline-block; }
.rowmenu {
  position: absolute;
  right: 0; top: calc(100% + 4px);
  min-width: 200px;
  white-space: nowrap;
  background: var(--color-surface-elev);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  padding: 4px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  z-index: 30;
  display: grid; gap: 2px;
  text-align: left;
  animation: modalIn .14s var(--ease-out-expo);
}
.rowmenu button {
  display: block; width: 100%;
  height: 30px; padding: 0 10px;
  border-radius: 3px;
  font-size: 12.5px; font-weight: 500;
  color: var(--color-text);
  text-align: left;
}
.rowmenu button:hover { background: var(--color-surface-2); }
.rowmenu button.is-danger { color: var(--color-danger); }
body.light .rowmenu { box-shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 16px 32px -12px rgba(0, 0, 0, .12); }

/* Fraicheur du contact : point vert <= 3 j, orange <= 10 j, rouge > 10 j */
.fresh {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.fresh__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-dim); flex-shrink: 0; }
.fresh[data-tone="ok"] .fresh__dot { background: var(--color-success); }
.fresh[data-tone="warn"] .fresh__dot { background: var(--color-warning); }
.fresh[data-tone="late"] .fresh__dot { background: var(--color-danger); }
.fresh[data-tone="late"] { color: var(--color-danger); }

/* Table wrapper card : overflow visible pour laisser sortir les menus ⋯
   (les coins arrondis sont portes par thead / derniere ligne) */
.table-card { overflow: visible; }
.table-card .table thead th:first-child { border-top-left-radius: 3px; }
.table-card .table thead th:last-child { border-top-right-radius: 3px; }
.table-card .table thead th:first-child,
.table-card .table tbody td:first-child {
  padding-left: 16px;
}
.table-card .table thead th:last-child,
.table-card .table tbody td:last-child {
  padding-right: 16px;
}

/* ============================================================ */
/* KPI CARDS                                                      */
/* ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.06), transparent);
}
.kpi__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.kpi__value {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 44px;
  letter-spacing: -.035em;
  line-height: 1;
  color: var(--color-text);
}
.kpi__value small {
  font-size: .5em;
  color: var(--color-text-muted);
  margin-left: 2px;
}
.kpi__meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--color-text-dim);
}
.kpi__delta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.kpi__delta--up { color: var(--color-success); }
.kpi__delta--down { color: var(--color-danger); }
.kpi__delta--flat { color: var(--color-text-dim); }

/* Sparkline */
.spark {
  width: 100%;
  height: 28px;
  margin-top: 4px;
}
.spark path { fill: none; stroke: var(--color-text-dim); stroke-width: 1.5; }
.spark .spark__fill { fill: color-mix(in oklch, var(--accent) 10%, transparent); stroke: none; }
.spark .spark__line { stroke: var(--accent); }

/* ============================================================ */
/* METRIC ROWS                                                    */
/* ============================================================ */
.metric-list {
  display: grid;
}
.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.metric:last-child { border-bottom: 0; }
.metric__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.metric__value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -.015em;
  color: var(--color-text);
}
.metric__value small {
  font-size: .55em;
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* ============================================================ */
/* ETATS — chantier 06 : vide (emptybox), squelette (skel), zero     */
/* ============================================================ */
.emptybox {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 36px 24px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 4px;
  color: var(--color-text-muted);
}
.emptybox--compact { padding: 22px 16px; gap: 8px; }
.emptybox__icon {
  width: 36px; height: 36px;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  display: grid; place-items: center;
  color: var(--color-text-dim);
}
.emptybox__icon svg { width: 16px; height: 16px; }
.emptybox__title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}
.emptybox--compact .emptybox__title { font-size: 13.5px; }
.emptybox__desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 300px;
}
.emptybox__action { margin-top: 6px; }
/* Dans une card flush (table), la boite garde son pointille avec une marge */
.card--flush > .emptybox { margin: 16px; }
.table-scroll { overflow-x: auto; }
.table--nowrap th, .table--nowrap td { white-space: nowrap; }

/* Squelettes */
.skel { display: grid; gap: 10px; }
.skel--pad { padding: 16px; }
.skel i, .skel-page i {
  display: block;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-surface-2) 0%, var(--color-surface-3) 40%, var(--color-surface-2) 80%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s linear infinite;
}
@keyframes skelShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel i, .skel-page i { animation: none; } }
.skel__row { display: flex; gap: 12px; align-items: center; height: 24px; }
.skel__cell { height: 12px; }
.skel__cell--right { margin-left: auto; }
.skel__line { height: 12px; }
.skel--kpi { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skel__kpi { height: 108px; border-radius: 4px; }
.skel-page {
  position: absolute; top: 48px; left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--color-bg);
  padding: var(--content-pad);
  max-width: 1600px; margin: 0 auto;
  display: grid; gap: 16px; align-content: start;
}
.skel-page--full { top: 0; }
.skel-page__head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.skel__title { width: 220px; height: 26px; }
.skel__btn { width: 140px; height: 36px; border-radius: 2px; }
.skel-page__bar { display: flex; gap: 8px; }
.skel-page__bar .skel__cell { height: 30px; }
@media (max-width: 900px) { .skel--kpi { grid-template-columns: 1fr 1fr; } }

/* ============================================================ */
/* TIMELINE / ACTIVITY                                            */
/* ============================================================ */
.activity {
  display: grid;
  gap: 1px;
}
.activity__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  font-size: 13px;
}
.activity__item:last-child { border-bottom: 0; }
.activity__tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--color-border-strong);
  border-radius: 2px;
  color: var(--color-text-dim);
}
.activity__text { color: var(--color-text); line-height: 1.45; }
.activity__text strong { color: var(--color-text); font-weight: 500; }
.activity__text em { font-style: normal; color: var(--accent); }
.activity__time {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--color-text-dim);
  white-space: nowrap;
}

/* ============================================================ */
/* STATUS DOT + STATUS PILL                                       */
/* ============================================================ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.status__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-text-dim);
}
.status[data-state="pending"]  { color: var(--color-text-dim); }
.status[data-state="pending"] .status__dot { background: var(--color-text-dim); }
.status[data-state="running"]  { color: var(--color-warning); }
.status[data-state="running"] .status__dot {
  background: var(--color-warning);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-warning) 22%, transparent);
  animation: dotPulse 1.4s infinite;
}
.status[data-state="ready"]    { color: var(--color-success); }
.status[data-state="ready"] .status__dot { background: var(--color-success); }
.status[data-state="failed"]   { color: var(--color-danger); }
.status[data-state="failed"] .status__dot { background: var(--color-danger); }

/* ============================================================ */
/* GRID UTILS                                                     */
/* ============================================================ */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--detail { grid-template-columns: 2fr 1fr; gap: 24px; }
.stack { display: grid; gap: 16px; }
.stack-2 { display: grid; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }

.divider {
  height: 1px;
  background: var(--color-border);
  margin: 16px 0;
}
.hairline { border-top: 1px solid var(--color-border); }

/* ============================================================ */
/* TOAST                                                          */
/* ============================================================ */
.toasts {
  position: fixed;
  bottom: 24px; right: 24px;
  display: grid;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 20px 40px -10px rgba(0,0,0,.7);
  pointer-events: auto;
  animation: toastIn .25s var(--ease-out-expo);
}
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-text-dim);
}
.toast--success .toast__dot { background: var(--color-success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 22%, transparent); }
.toast--error   .toast__dot { background: var(--color-danger);  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-danger) 22%, transparent); }
.toast--warning .toast__dot { background: var(--color-warning); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-warning) 22%, transparent); }
.toast__close {
  color: var(--color-text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 2px;
  transition: color .12s;
}
.toast__close:hover { color: var(--color-text); }

/* ============================================================ */
/* COMMAND PALETTE                                                */
/* ============================================================ */
.cmdk {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.cmdk__panel {
  width: min(620px, 90vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 40px 80px -20px rgba(0,0,0,.8);
}
.cmdk__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  padding: 16px 20px;
  font-size: 16px;
  color: var(--color-text);
  outline: none;
}
.cmdk__input::placeholder { color: var(--color-text-dim); }
.cmdk__list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}
.cmdk__group {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.cmdk__item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
}
.cmdk__item.is-active { background: var(--color-surface-2); }
.cmdk__item-glyph { color: var(--color-text-dim); }
.cmdk__item.is-active .cmdk__item-glyph { color: var(--accent); }
.cmdk__item-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-dim);
}
.cmdk__footer {
  padding: 8px 16px;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  display: flex; justify-content: space-between;
}
.cmdk__hint {
  display: inline-flex; gap: 6px; align-items: center;
}

/* ============================================================ */
/* MODAL                                                          */
/* ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn .18s var(--ease-out);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal__panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 40px 80px -20px rgba(0,0,0,.8);
  animation: modalIn .22s var(--ease-out-expo);
}
@keyframes modalIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -.005em;
}
.modal__body {
  padding: 24px;
  overflow-y: auto;
}
.modal__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--color-surface-2);
}
.modal__close {
  width: 28px; height: 28px;
  border-radius: 3px;
  color: var(--color-text-dim);
  display: grid; place-items: center;
  transition: color .12s, background .12s;
}
.modal__close:hover { color: var(--color-text); background: var(--color-surface-2); }

.modal__section {
  margin-bottom: 24px;
}
.modal__section:last-child { margin-bottom: 0; }
.modal__section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 12px;
}

/* ============================================================ */
/* SEGMENTS (choix de vue) + ONGLETS SOULIGNES (contenu) — ch. 02 */
/* ============================================================ */
.seg {
  display: inline-flex;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  padding: 2px;
  gap: 2px;
}
.seg__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  border-radius: 2px;
  transition: color .12s, background .12s;
  white-space: nowrap;
}
.seg__btn:hover { color: var(--color-text); }
.seg__btn.on { background: var(--color-text); color: var(--color-bg); }
.seg .cnt { font-family: var(--font-mono); font-size: 10px; opacity: .7; }

.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--color-border);
}
.tab {
  display: inline-flex; align-items: center;
  padding: 8px 0;
  margin-bottom: -1px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  border-bottom: 1px solid transparent;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.tab:hover { color: var(--color-text); }
.tab.on { color: var(--color-text); border-bottom-color: var(--color-text); }
.tab .cnt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-dim);
  margin-left: 6px;
}

/* ============================================================ */
/* DASHBOARD specific                                             */
/* ============================================================ */
.alert-strip {
  border: 1px solid var(--color-border-strong);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in oklch, var(--color-warning) 6%, transparent) 0%, transparent 60%);
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}
.alert-strip__top {
  display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px;
}
.alert-strip__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-warning);
}
.alert-strip__sub {
  font-size: 13px;
  color: var(--color-text-muted);
}
.alert-strip__main {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -.015em;
}
.alert-strip__actions { display: flex; gap: 8px; align-items: center; }

/* Chart area placeholder */
.chart-area {
  height: 240px;
  position: relative;
  padding: 20px 20px 28px 32px;
}
.chart-area__y {
  position: absolute;
  left: 8px; top: 20px; bottom: 28px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-dim);
  letter-spacing: .04em;
}
.chart-area__x {
  position: absolute;
  left: 32px; right: 20px; bottom: 8px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-dim);
  letter-spacing: .04em;
}
.chart-area svg {
  width: 100%; height: 100%;
}
.chart-area__grid line {
  stroke: var(--color-border);
  stroke-width: 1;
}
.chart-area__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.chart-area__fill {
  fill: color-mix(in oklch, var(--accent) 12%, transparent);
}
.chart-area__dot { fill: var(--color-bg); stroke: var(--accent); stroke-width: 1.5; }
.chart-area__dot--ghost { fill: var(--color-bg); stroke: var(--color-border-strong); stroke-width: 1; }

/* Bars chart */
.chart-bars {
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: 220px;
  padding: 20px 24px;
}
.chart-bar {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  justify-items: center;
}
.chart-bar__col {
  width: 60px;
  background: var(--color-text);
  border-radius: 2px 2px 0 0;
}
.chart-bar__col--accent { background: var(--accent); }
.chart-bar__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: .04em;
}

/* ============================================================ */
/* CLIENTS specific                                               */
/* ============================================================ */
.client-row__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: -.005em;
}
.client-row__email {
  font-size: 12px;
  color: var(--color-text-muted);
}
.client-row__contact {
  display: flex; align-items: center; gap: 8px;
}
.client-row__contact-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-warning);
  letter-spacing: .04em;
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.kanban__col {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 360px;
}
.kanban__col-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.kanban__col-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.kanban__col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-dim);
  background: var(--color-surface-2);
  padding: 2px 7px;
  border-radius: 2px;
}
.kanban__col-body {
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.kanban-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 12px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.kanban-card:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-3);
}
.kanban-card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: -.005em;
}
.kanban-card__meta {
  font-size: 11px;
  color: var(--color-text-muted);
}
.kanban-card__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}

.kanban__col[data-state="actif"] .kanban__col-title { color: var(--color-info); }
.kanban__col[data-state="chaud"] .kanban__col-title { color: var(--color-warning); }
.kanban__col[data-state="signe"] .kanban__col-title { color: var(--color-success); }
.kanban__col[data-state="perdu"] .kanban__col-title { color: var(--color-danger); }

/* ============================================================ */
/* ANNONCES — chantier 04 : barre unique, chips, drawer, resultats   */
/* ============================================================ */
.abar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.abar__search { width: 220px; }
.abar__spacer { flex: 1; }
.abar__sort { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--color-text-muted); white-space: nowrap; }
.select--bare { width: auto; background-color: transparent; border-color: transparent; color: var(--color-text); padding-left: 4px; }
.select--bare:hover { border-color: var(--color-border-strong); }
.badge-cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 2px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
}
.btn.is-on { border-color: var(--color-text); }

.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chips__label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-text-dim);
  margin-right: 4px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  width: auto;
  white-space: nowrap;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  background: var(--color-surface);
  font-size: 12.5px; font-weight: 500;
  color: var(--color-text-muted);
  transition: color .12s, border-color .12s;
}
.chip:hover { color: var(--color-text); border-color: var(--color-text-dim); }
.chip.on { color: var(--color-text); border-color: var(--color-text); }
.chip--add { border-style: dashed; background: transparent; padding: 0 10px; }
.chip--ghost { border-color: transparent; background: transparent; }
.chip--filter { color: var(--color-text); }
.chip__k { color: var(--color-text-dim); font-weight: 400; }
.chip__x {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 2px;
  color: var(--color-text-dim);
  font-size: 13px; line-height: 1;
}
.chip__x:hover { color: var(--color-text); background: var(--color-surface-2); }

.ann-list { overflow: visible; }
.ann-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background .12s;
}
.ann-row:last-child { border-bottom: 0; }
.ann-row:hover, .ann-row:focus-visible { background: var(--color-surface-2); outline: none; }
.ann-row:first-child:hover { border-top-left-radius: 3px; border-top-right-radius: 3px; }
.ann-row__thumb {
  width: 44px; height: 36px;
  border-radius: 2px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: block;
}
.ann-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-row__main { display: grid; gap: 2px; min-width: 0; }
.ann-row__title { font-size: 13px; font-weight: 500; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-row__loc { color: var(--color-text-muted); font-weight: 400; }
.ann-row__sub { font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-row__price {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  min-width: 96px;
}
.ann-row__score { min-width: 52px; text-align: right; }
.ann-row .rowact { min-width: 68px; }
.score-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-dim);
  font-variant-numeric: tabular-nums;
}
.score-pill[data-tier="high"] { color: var(--color-success); border-color: color-mix(in oklch, var(--color-success) 40%, transparent); background: color-mix(in oklch, var(--color-success) 8%, transparent); }
.score-pill[data-tier="mid"]  { color: var(--color-warning); border-color: color-mix(in oklch, var(--color-warning) 40%, transparent); }

/* Drawer droit (filtres) */
.drawer-veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 700; animation: fadeIn .15s var(--ease-out); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(360px, 100vw);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border-strong);
  display: grid; grid-template-rows: auto 1fr auto;
  box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .7);
  animation: drawerIn .2s var(--ease-out-expo);
}
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.drawer__title { font-size: 14px; font-weight: 500; }
.drawer__body { padding: 16px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.drawer__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
body.light .drawer-veil { background: rgba(0, 0, 0, .3); }
body.light .drawer { box-shadow: -16px 0 40px -24px rgba(0, 0, 0, .15); }

/* (ancienne grille de 7 filtres : conservee pour les autres pages) */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.filter-bar .field { gap: 4px; }
.filter-bar__actions { display: flex; gap: 8px; align-items: flex-end; }

.geo-pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; border: 1px solid; display: inline-block; }
.geo-pill--exact   { color: var(--color-success); border-color: color-mix(in oklch, var(--color-success) 40%, transparent); background: color-mix(in oklch, var(--color-success) 8%, transparent); }
.geo-pill--approx  { color: var(--color-warning); border-color: color-mix(in oklch, var(--color-warning) 40%, transparent); background: color-mix(in oklch, var(--color-warning) 8%, transparent); }
.geo-pill--none    { color: var(--color-text-dim); border-color: var(--color-border-strong); }

/* Score bar */
.score-bar {
  display: flex; align-items: center; gap: 8px;
}
.score-bar__track {
  width: 50px; height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar__fill {
  height: 100%;
  background: var(--color-text-dim);
  border-radius: 2px;
}
.score-bar__fill[data-tier="high"] { background: var(--color-success); }
.score-bar__fill[data-tier="mid"]  { background: var(--color-warning); }
.score-bar__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}

/* ============================================================ */
/* CARTE / MAP                                                    */
/* ============================================================ */
.map-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  width: 100%;
  border-top: 0;
  overflow: hidden;
}
.map-side {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.map-side__head {
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}
.map-side__title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -.005em;
}
.map-side__body {
  padding: 20px;
  display: grid;
  gap: 16px;
  overflow-y: auto;
}
.map-side__foot {
  padding: 18px 20px;
  border-top: 1px solid var(--color-border);
}
.map-legend {
  display: grid;
  gap: 8px;
}
.map-legend__row {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--color-text-muted);
}
.map-legend__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid;
}
.map-legend__dot[data-tier="exact"]  { background: var(--color-success); border-color: var(--color-success); }
.map-legend__dot[data-tier="approx"] { background: var(--color-warning); border-color: var(--color-warning); }
.map-legend__dot[data-tier="low"]    { background: var(--color-text-dim); border-color: var(--color-text-dim); }
.map-legend__dot[data-tier="none"]   { background: transparent; border-color: var(--color-text-dim); }

.map-canvas {
  background:
    radial-gradient(circle at 50% 50%, #141414 0%, #0a0a0a 100%);
  position: relative;
  overflow: hidden;
}
.map-canvas::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.map-tile {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 220px 220px, 220px 220px;
}
.map-marker {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 10px;
  display: grid; place-items: center;
  color: #000;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .15s var(--ease-out-expo);
}
.map-marker:hover { transform: translate(-50%, -50%) scale(1.18); }
.map-marker[data-tier="cluster"] { background: #fff; }
/* Halo lumineux facon Raven (vert pour le top, orange pour les autres). */
.map-marker[data-tier="high"]    { background: var(--color-success); box-shadow: 0 0 0 6px rgba(52,211,153,.18), 0 2px 10px rgba(0,0,0,.6); }
.map-marker[data-tier="mid"]     { background: var(--color-warning); box-shadow: 0 0 0 5px rgba(240,164,74,.15), 0 2px 10px rgba(0,0,0,.6); }
.map-marker[data-tier="low"]     { background: #999; }
.map-marker--lg { width: 28px; height: 28px; font-size: 11px; }
.map-marker--xl { width: 36px; height: 36px; font-size: 12px; }

.map-overlay {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  padding: 6px 10px;
}
.map-overlay--tl { top: 16px; left: 16px; }
.map-overlay--br { bottom: 16px; right: 16px; }

/* Controles MapLibre adaptes au theme sombre/verre (defaut = blanc opaque,
   jurait avec le fond + carre poke derriere le panneau). S'applique a toutes
   les cartes (PhotoLoc, Carte, couverture). */
.maplibregl-ctrl-group {
  background: rgba(18, 18, 18, .72) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .10) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.7) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button { background: transparent !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid rgba(255,255,255,.10) !important; }
.maplibregl-ctrl-group button:hover { background: rgba(255,255,255,.10) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.1); }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,.4) !important; backdrop-filter: blur(8px); }
.maplibregl-ctrl-attrib a { color: var(--color-text-dim) !important; }
.map-zoom {
  position: absolute;
  top: 16px; right: 16px;
  display: grid;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  overflow: hidden;
}
.map-zoom button {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--color-text-muted);
  transition: background .12s, color .12s;
}
.map-zoom button:hover { background: var(--color-surface-2); color: var(--color-text); }
.map-zoom button + button { border-top: 1px solid var(--color-border); }

/* ============================================================ */
/* TOOLS / OUTILS                                                 */
/* ============================================================ */
.tool {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 24px;
  display: grid;
  gap: 16px;
  position: relative;
}
.tool::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.06), transparent);
}
.tool__head {
  display: grid; gap: 6px;
}
.tool__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.tool__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -.02em;
}
.tool__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.tool__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}

/* Drop zone */
.dropzone {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  display: grid; gap: 8px;
  justify-items: center;
  background: color-mix(in oklch, var(--color-surface) 60%, transparent);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 4%, var(--color-surface));
}
.dropzone__icon {
  width: 28px; height: 28px;
  color: var(--color-text-muted);
}
.dropzone__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: -.005em;
}
.dropzone__desc {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

/* ============================================================ */
/* LEGAL TILES                                                    */
/* ============================================================ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.06), transparent);
}
.tile:hover {
  border-color: var(--accent);
  background: var(--color-surface-2);
}
.tile__top {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.tile__glyph {
  width: 32px; height: 32px;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  display: grid; place-items: center;
  color: var(--color-text-muted);
}
.tile:hover .tile__glyph { color: var(--accent); border-color: var(--accent); }
.tile__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-dim);
  margin-left: 8px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.tile__top { align-items: center; gap: 12px; }
.tile__top .tile__title { flex: 1; }
.tile__zero { color: var(--color-text-dim); font-style: normal; }
.tile__body {
  display: grid; gap: 4px;
}
.tile__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -.005em;
}
.tile__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.tile__cta {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.tile:hover .tile__cta { color: var(--accent); }

/* ============================================================ */
/* MANDATES / PRICING                                             */
/* ============================================================ */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pack {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 14px;
}
.pack--current {
  border-color: var(--color-border-active);
  background: linear-gradient(180deg, var(--color-surface-2) 0%, var(--color-surface) 100%);
}
.pack--current::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent);
}
.pack__current-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: var(--color-text);
  padding: 3px 8px;
  border-radius: 2px;
}
.pack__name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.pack__price {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 44px;
  letter-spacing: -.04em;
}
.pack__price small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0;
}
.pack__features {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
}
.pack__features li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 8px;
  align-items: start;
  line-height: 1.45;
}
.pack__features li::before {
  content: '';
  width: 10px; height: 1px;
  background: var(--color-text-dim);
  margin-top: .65em;
}
.pack__features li.is-incl::before { background: var(--accent); }
.pack__features li.is-excl { color: var(--color-text-dim); }

/* ============================================================ */
/* DONUT / PIE                                                    */
/* ============================================================ */
.donut {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
}
.donut__svg { width: 200px; height: 200px; }
.donut__legend { display: grid; gap: 8px; }
.donut__row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}
.donut__row:last-child { border-bottom: 0; }
.donut__chip {
  width: 10px; height: 10px;
  border-radius: 2px;
}
.donut__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--color-text-muted);
}
.donut__val { font-variant-numeric: tabular-nums; color: var(--color-text); }
.donut__pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-dim);
}

/* ============================================================ */
/* DANGER ZONE                                                    */
/* ============================================================ */
.danger-zone {
  border: 1px solid color-mix(in oklch, var(--color-danger) 35%, var(--color-border-strong));
  background: color-mix(in oklch, var(--color-danger) 3%, var(--color-surface));
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  gap: 16px;
}
.danger-zone__head {
  display: flex; align-items: center; gap: 10px;
}
.danger-zone__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-danger);
}
.danger-zone__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 64ch;
  line-height: 1.5;
}

/* ============================================================ */
/* PHOTOLOC — Raven style                                         */
/* ============================================================ */
.photoloc {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  height: 100dvh;
}
.photoloc__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 24px;
  background: var(--color-surface);
}
.photoloc__bar-left { display: flex; align-items: center; gap: 12px; }
.photoloc__sigil {
  font-family: var(--font-mono);
  color: var(--color-text-dim);
  font-size: 16px;
}
.photoloc__bar-mid {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.photoloc__bar-right { display: flex; gap: 6px; justify-content: flex-end; }

.photoloc__shell {
  overflow: hidden;
  position: relative;
  background: var(--color-bg);
}
.photoloc__shell--empty,
.photoloc__shell {
  display: grid;
  place-items: center;
}
.photoloc__shell--result {
  grid-template-columns: 1fr 400px;
  place-items: stretch;
}

/* EMPTY */
.photoloc__hero {
  text-align: center;
  display: grid;
  gap: 8px;
  max-width: 520px;
  padding: 32px 24px;
  justify-items: center;
}
.photoloc__drop {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: 40px 32px;
  display: grid;
  gap: 8px;
  justify-items: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.photoloc__drop:hover {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 4%, var(--color-surface));
}
.photoloc__drop-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.photoloc__drop-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.005em;
}
.photoloc__drop-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.photoloc__hints {
  display: flex; gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.photoloc__hints span { display: inline-flex; gap: 6px; }

/* ANALYZING */
.photoloc__analyzing {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
}
.photoloc__pulser {
  width: 120px; height: 120px;
  position: relative;
}
.photoloc__pulser span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-warning);
  border-radius: 50%;
  opacity: 0;
  animation: plPulse 2.4s ease-out infinite;
}
.photoloc__pulser span:nth-child(2) { animation-delay: .8s; }
.photoloc__pulser span:nth-child(3) { animation-delay: 1.6s; }
@keyframes plPulse {
  0%   { transform: scale(.3); opacity: 1; }
  100% { transform: scale(1);  opacity: 0; }
}

/* RESULT — MAP */
.photoloc__map {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 50%, #161616 0%, #0a0a0a 100%);
  overflow: hidden;
}
.photoloc__live-tag {
  position: absolute;
  top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  z-index: 3;
}
.photoloc__live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 25%, transparent);
  animation: dotPulse 1.6s infinite;
}

/* Result clusters */
.photoloc__cluster {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.photoloc__cluster-ring {
  display: block;
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklch, var(--color-success) 35%, transparent);
  background: color-mix(in oklch, var(--color-success) 8%, transparent);
  transition: all .2s var(--ease-out);
}
.photoloc__cluster[data-active] .photoloc__cluster-ring {
  width: 120px; height: 120px;
  border-color: var(--color-success);
  border-width: 2px;
  background: color-mix(in oklch, var(--color-success) 14%, transparent);
  box-shadow:
    0 0 0 8px color-mix(in oklch, var(--color-success) 6%, transparent),
    0 0 80px color-mix(in oklch, var(--color-success) 30%, transparent);
  margin: -22px;
}
.photoloc__cluster-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 18px;
  color: var(--color-text);
}
.photoloc__cluster[data-active] .photoloc__cluster-num { font-size: 26px; }

/* Confidence callout */
.photoloc__callout {
  position: absolute;
  top: 24px; left: 24px;
  width: 348px;
  /* Glass : fond sombre semi-transparent + flou -> la carte transparait
     derriere (look Raven). Cf. var glass plus bas. */
  background: rgba(13, 13, 13, .62);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.06);
  z-index: 3;
}
/* Theme clair (retour Karl, 8 sept 2026) : le verre restait sombre alors
   que les textes (tokens) passaient en sombre -> encadre gris illisible
   sur la carte Blanc. Verre clair, memes textes. */
body.light .photoloc__callout {
  background: rgba(255, 255, 255, .80);
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.photoloc__callout-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.photoloc__callout-close {
  color: var(--color-text-dim);
  font-size: 16px;
  line-height: 1;
  transition: color .12s;
}
.photoloc__callout-close:hover { color: var(--color-text); }

.photoloc__callout-list {
  display: grid; gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.photoloc__callout-list li {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}
.photoloc__callout-list strong { color: var(--color-text); font-weight: 500; }
.photoloc__bullet {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-border-strong);
  margin-top: 6px;
}
.photoloc__bullet--ok { background: var(--color-success); }

.photoloc__refine {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: color-mix(in oklch, var(--color-success) 8%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-success) 35%, transparent);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-success);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.photoloc__refine:hover {
  background: color-mix(in oklch, var(--color-success) 14%, transparent);
  border-color: var(--color-success);
}
.photoloc__callout-foot {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  text-align: center;
  margin-top: 8px;
}

/* Bottom strip */
.photoloc__strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px 24px;
  background: linear-gradient(to top, var(--color-bg) 0%, color-mix(in oklch, var(--color-bg) 80%, transparent) 100%);
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1fr 1.6fr;
  gap: 24px;
  align-items: end;
  border-top: 1px solid var(--color-border);
  z-index: 2;
}

/* SIDE PANEL */
.photoloc__side {
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
.photoloc__photo {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  display: grid; gap: 10px;
}
.photoloc__photo-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #1a1d1a;
}
.photoloc__feat {
  position: absolute;
  background: rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.15);
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
}
.photoloc__crop {
  position: absolute;
  bottom: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
  cursor: pointer;
  transition: background .12s;
}
.photoloc__crop:hover { background: rgba(0,0,0,.9); }
.photoloc__photo-meta {
  display: flex; justify-content: space-between; align-items: center;
}

.photoloc__results {
  overflow-y: auto;
  padding: 8px 12px 16px;
}
.photoloc__results-head {
  padding: 8px 4px 12px;
}
.photoloc__result {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 9px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  margin-bottom: 7px;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.photoloc__result:hover {
  background: rgba(255, 255, 255, .05);
}
.photoloc__result[data-active] {
  background: color-mix(in oklch, var(--color-success) 9%, transparent);
  border-color: color-mix(in oklch, var(--color-success) 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--color-success) 18%, transparent);
}
.photoloc__result-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-dim);
  padding-top: 2px;
}
.photoloc__result[data-active] .photoloc__result-rank { color: var(--color-success); }
.photoloc__result-body { display: grid; gap: 6px; }
.photoloc__result-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px;
}
.photoloc__result-city {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.005em;
}
.photoloc__result-country {
  font-size: 11px;
  color: var(--color-text-muted);
}
.photoloc__result-meta {
  display: flex; align-items: center; gap: 8px;
}
.photoloc__result-coord {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.photoloc__refine--inline {
  margin-top: 6px;
}
.photoloc__result-foot {
  font-size: 10px;
  color: var(--color-info);
  margin-top: 4px;
}
.photoloc__street-link {
  font-size: 10px;
  color: var(--color-info);
  text-decoration: none;
  margin-top: 2px;
  cursor: pointer;
}
.photoloc__street-link:hover { color: var(--color-text); }

.photoloc__add-case {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border-strong);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.photoloc__add-case:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

@media (max-width: 1100px) {
  .photoloc__shell--result { grid-template-columns: 1fr; }
  .photoloc__side { max-height: 60vh; border-left: 0; border-top: 1px solid var(--color-border); }
  .photoloc__callout { right: 12px; top: 56px; width: calc(100% - 24px); max-width: 360px; }
  .photoloc__strip { grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 16px; }
}

.photoloc__zone-picker {
  width: 100%;
  max-width: 460px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
}
.photoloc__zone-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
}

/* ============================================================ */
/* POWER FEATURES — notifications, tour, ticker, skeleton…       */
/* ============================================================ */

/* Notif bell */
.notif { position: relative; }
.notif__btn {
  position: relative;
  width: 34px; height: 34px;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.notif__btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-dim);
  background: var(--color-surface-2);
}
.notif__badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: #000;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  display: grid; place-items: center;
  border: 2px solid var(--color-bg);
}
.notif__panel {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.03);
  z-index: 90;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  animation: fadeIn .15s var(--ease-out);
}
.notif__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.notif__mark {
  color: var(--color-text-dim);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color .12s;
}
.notif__mark:hover { color: var(--color-text); }
.notif__list { overflow-y: auto; }
.notif__item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background .12s;
}
.notif__item:last-child { border-bottom: 0; }
.notif__item:hover { background: var(--color-surface-2); }
.notif__item.is-unread { background: color-mix(in oklch, var(--accent) 4%, transparent); }
.notif__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-text-dim);
  margin-top: 6px;
  flex-shrink: 0;
}
.notif__dot--success { background: var(--color-success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 22%, transparent); }
.notif__dot--warning { background: var(--color-warning); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-warning) 22%, transparent); }
.notif__dot--info    { background: var(--color-info);    box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-info) 22%, transparent); }
.notif__title { font-family: var(--font-display); font-weight: 400; font-size: 13px; letter-spacing: -.005em; }
.notif__meta { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; line-height: 1.4; }
.notif__time { font-family: var(--font-mono); font-size: 9px; color: var(--color-text-dim); letter-spacing: .04em; white-space: nowrap; }
.notif__foot {
  padding: 12px 16px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.notif__foot a {
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.notif__foot a:hover { color: var(--color-text); }

/* Cheatsheet kbd grouping */
.kbd-group { display: inline-flex; gap: 4px; }

/* Tour */
.tour__veil {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  z-index: 700;
  animation: fadeIn .2s var(--ease-out);
}
.tour__spot {
  position: fixed;
  border-radius: 6px;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0,0,0,.5);
  z-index: 701;
  pointer-events: none;
  animation: tourPulse 1.8s var(--ease-out) infinite;
}
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0,0,0,.55); }
  50% { box-shadow: 0 0 0 8px color-mix(in oklch, var(--accent) 60%, transparent), 0 0 0 9999px rgba(0,0,0,.55); }
}
.tour__tip {
  position: fixed;
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  padding: 18px 20px;
  z-index: 702;
  display: grid; gap: 10px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.7);
}
.tour__count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--color-text-dim);
}
.tour__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -.005em;
}
.tour__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.tour__actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}

/* Live ticker */
.live-ticker {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--color-text-muted);
}
.live-ticker__pulse {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);
  animation: dotPulse 1.6s infinite;
  flex-shrink: 0;
}
.live-ticker__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-success);
  flex-shrink: 0;
}
.live-ticker__rail {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.live-ticker__strip {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
  width: max-content;
}
@keyframes tickerScroll {
  to { transform: translateX(-50%); }
}
.live-ticker__item::before {
  content: '·';
  margin-right: 16px;
  color: var(--color-text-faint);
}

/* AI suggestions */
.ai-card { border-color: color-mix(in oklch, var(--accent) 25%, var(--color-border-strong)); }
.ai-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}
.ai-row:last-child { border-bottom: 0; }
.ai-row__chip {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
}
.ai-row__chip--success { border-color: color-mix(in oklch, var(--color-success) 40%, transparent); background: color-mix(in oklch, var(--color-success) 8%, transparent); }
.ai-row__chip--warning { border-color: color-mix(in oklch, var(--color-warning) 40%, transparent); background: color-mix(in oklch, var(--color-warning) 8%, transparent); }
.ai-row__chip--info    { border-color: color-mix(in oklch, var(--color-info) 40%, transparent);    background: color-mix(in oklch, var(--color-info) 8%, transparent); }
.ai-row__title { font-size: 13px; color: var(--color-text); }

/* Heatmap */
.heatmap { padding: 16px 20px; display: grid; gap: 12px; overflow-x: auto; }
.heatmap__head { display: flex; justify-content: space-between; align-items: center; }
.heatmap__grid {
  display: flex;
  gap: 3px;
  width: max-content;
  max-width: 100%;
}
.heatmap__col { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; flex-shrink: 0; }
.heatmap__cell {
  width: 14px; height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: transform .12s, outline .12s;
}
.heatmap__cell:hover {
  outline: 1px solid var(--color-text);
  transform: scale(1.2);
}
.heatmap__legend {
  display: flex; align-items: center; gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Skeleton */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, var(--color-surface-2), var(--color-surface-3), var(--color-surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 2px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* Konami wireframe overlay */
.konami {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9998;
  border: 4px dashed var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
  animation: konamiPulse 1.2s var(--ease-out) infinite;
}
@keyframes konamiPulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
.konami__inner {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  font-weight: 600;
  border-radius: 3px;
}
body.wireframe * {
  outline: 1px dashed rgba(52, 211, 153, .35) !important;
  outline-offset: -1px;
}

/* Focus mode */
body.focus .nav {
  width: 56px;
}
body.focus .nav__brand,
body.focus .nav-g,
body.focus .nav__item-badge,
body.focus .nav__item-lock,
body.focus .nav__item-label,
body.focus .user__body,
body.focus .user__chev { display: none; }
body.focus .nav__item { justify-content: center; padding: 12px 8px; }
body.focus .user { justify-content: center; padding: 6px; }
body.focus .app { grid-template-columns: 56px 1fr; }
body.focus .live-ticker { display: none; }

/* ── Menu repliable (toggle utilisateur, memorise) ─────────────────────── */
/* Rail 56px pilote par un bouton visible + persiste (localStorage), sans les
   effets annexes du mode focus (live-ticker...). Confine au desktop (>900px) :
   sous 900px la nav est deja un rail responsive puis un bandeau bas en mobile. */
.app { transition: grid-template-columns .22s var(--ease-out); }

/* (bouton « Replier le menu » : deplace dans le menu utilisateur, chantier 01) */

@media (min-width: 901px) {
  /* Grille sidebar a 3 rangees (brand / sections / pied) : rien a figer. */

  body.nav-collapsed .nav__brand .nav__logo span:not(.nav__mark),
  body.nav-collapsed .nav-g,
  body.nav-collapsed .nav__item-badge,
  body.nav-collapsed .nav__item-lock,
  body.nav-collapsed .nav__item-label,
  body.nav-collapsed .user__body,
  body.nav-collapsed .user__chev { display: none; }
  body.nav-collapsed .app { grid-template-columns: 56px 1fr; }
  body.nav-collapsed .nav__brand { padding: 14px 0 8px; flex-direction: column; justify-content: center; gap: 8px; }
  body.nav-collapsed .nav__toggle svg { transform: rotate(180deg); }
  body.nav-collapsed .nav__sections { padding: 8px 4px; }
  body.nav-collapsed .nav__item { justify-content: center; padding: 12px 8px; gap: 0; }
  body.nav-collapsed .nav__footer { padding: 8px 4px; }
  body.nav-collapsed .user { justify-content: center; padding: 6px; }
  /* Rail replie : le menu sort du rail (overflow hidden) en position fixe,
     a droite de l'avatar, sinon il est coupe a 56 px. */
  body.nav-collapsed .user-menu { position: fixed; left: 62px; right: auto; bottom: 12px; width: 240px; }
}

/* ── Densite compacte (toggle utilisateur, memorise) ───────────────────── */
/* Resserre les espacements les plus consommateurs de place (en-tetes,
   cartes, lignes de tableau, KPI) pour afficher plus de contenu a l'ecran.
   Surcharges a plus forte specificite : ne changent que le padding/marge. */
body.compact .page-header { padding-bottom: 14px; margin-bottom: 14px; gap: 16px; }
body.compact .card { padding: 12px 14px; }
body.compact .card--padded { padding: 14px 16px; }
body.compact .card__head { margin-bottom: 10px; }
body.compact .table thead th { padding: 7px 12px; }
body.compact .table tbody td { padding: 8px 12px; }
body.compact .kpi { padding: 12px 16px 14px; }
body.compact .kpi-grid { gap: 10px; }

/* Client timeline */
.client-timeline {
  list-style: none;
  display: grid;
  gap: 18px;
  padding: 16px 20px 20px;
  border-left: 1px solid var(--color-border);
  margin-left: 26px;
}
.client-timeline__item {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  padding-left: 24px;
}
.client-timeline__dot {
  position: absolute;
  left: -7px; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--color-border-strong);
  border: 2px solid var(--color-bg);
}
.client-timeline__item[data-tone="success"] .client-timeline__dot { background: var(--color-success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 22%, transparent); }
.client-timeline__item[data-tone="warning"] .client-timeline__dot { background: var(--color-warning); }
.client-timeline__item[data-tone="info"] .client-timeline__dot { background: var(--color-info); }
.client-timeline__top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; margin-bottom: 3px;
}
.client-timeline__top strong { color: var(--color-text); font-weight: 500; }
.client-timeline__time { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-dim); letter-spacing: .04em; }
.client-timeline__desc { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; }
.client-timeline__cta a {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
  cursor: pointer;
}

.score-list {
  display: grid; gap: 8px;
  font-size: 12px;
}
.score-list li {
  list-style: none;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  letter-spacing: .04em;
  color: var(--color-text-muted);
}
.score-list li span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }

/* Topbar — chantier 01 : 48 px, cabinet · recherche ⌘K · cloche · aide */
.top__brand { display: none; }
.m-only { display: none; }
.app__topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex; align-items: center; gap: 8px;
  height: 48px;
  padding: 0 var(--content-pad);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.app__topbar-spacer { flex: 1; }
.top__cab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  background: var(--color-surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text);
  max-width: 320px;
  min-width: 0;
}
.top__cab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); flex-shrink: 0; }
.top__cab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__cab-groupe { color: var(--color-text-dim); white-space: nowrap; font-weight: 400; }
.top__search {
  display: inline-flex; align-items: center; gap: 8px;
  width: 200px;
  height: 30px;
  padding: 0 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  transition: border-color .12s, background .12s, color .12s;
}
.top__search:hover { color: var(--color-text); background: var(--color-surface-3); }
.top__search svg { width: 12px; height: 12px; flex-shrink: 0; }
.top__search-label { flex: 1; text-align: left; }
.notif__btn { width: 30px; height: 30px; border-radius: 3px; }

/* Page route transitions */
.page-fade-enter { opacity: 0; transform: translateY(4px); }
.page-fade-enter-active { opacity: 1; transform: translateY(0); transition: opacity .28s var(--ease-out-expo), transform .28s var(--ease-out-expo); }

/* Tactile : iOS garde l'etat :hover apres un tap -> le bouton reste "allume"
   (fond gris) jusqu'au tap suivant. Sur appareil sans souris, on neutralise
   le survol des boutons du topbar. */
@media (hover: none) {
  .notif__btn:hover {
    color: var(--color-text-muted);
    border-color: var(--color-border-strong);
    background: var(--color-surface);
  }
}

@media (max-width: 640px) {
  .notif__panel { width: 320px; right: -8px; }
  .tour__tip { width: calc(100vw - 24px); left: 12px !important; right: 12px; }
  .ai-row { grid-template-columns: 28px 1fr; }
  .ai-row .btn { grid-column: 1 / -1; justify-content: center; margin-top: 4px; }
  .heatmap__grid, .heatmap__col { grid-template-rows: repeat(7, 11px); }
  .heatmap__cell { width: 11px; height: 11px; }
  .live-ticker { padding: 6px 12px; font-size: 10px; }
}

/* ============================================================ */
/* POWER FEATURES PART 2                                          */
/* ============================================================ */

/* Kanban DnD visual states */
.kanban-card {
  transition: transform .15s, border-color .15s, opacity .15s;
  cursor: grab;
  /* Tactile : pan-y laisse le scroll vertical normal (le drag ne demarre
     qu'a l'appui long) ; user-select/touch-callout evitent la selection de
     texte et le menu contextuel iOS pendant l'appui long. */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card[data-dragging] { opacity: .4; transform: scale(.96); }
.kanban__col[data-hover] {
  background: color-mix(in oklch, var(--accent) 5%, var(--color-surface));
  border-color: color-mix(in oklch, var(--accent) 45%, var(--color-border-strong));
}
/* Fantome qui suit le pointeur pendant le glisser (clone de la carte) */
.kanban-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  margin: 0;
  opacity: .92;
  transform: rotate(1.5deg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  border-color: var(--color-border-strong);
}

/* Bulk action bar */
.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 4px;
  animation: bulkSlide .25s var(--ease-out-expo);
}
@keyframes bulkSlide {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.bulk-bar__count {
  font-size: 12.5px;
  font-weight: 500;
  margin-right: 8px;
}
.bulk-bar__num {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  margin-right: 6px;
}
.bulk-bar .btn {
  background: transparent;
  color: var(--color-bg);
  border-color: rgba(0,0,0,.2);
}
.bulk-bar .btn:hover { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.4); }
.bulk-bar .btn--danger { color: var(--color-danger); border-color: rgba(0,0,0,.2); }
.bulk-bar .btn--danger:hover { color: var(--color-danger); background: color-mix(in oklch, var(--color-danger) 12%, transparent); }
.bulk-bar__close {
  margin-left: auto;
  color: var(--color-bg);
  font-size: 18px;
  line-height: 1;
  width: 22px; height: 22px;
  border-radius: 3px;
}
.bulk-bar__close:hover { background: rgba(0,0,0,.1); }

/* Row select checkbox */
.row-select {
  width: 14px; height: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 2px;
  display: grid; place-items: center;
  cursor: pointer;
  background: var(--color-surface-2);
  flex-shrink: 0;
}
.row-select.is-on {
  background: var(--accent);
  border-color: var(--accent);
}
.row-select.is-on::after {
  content: '✓';
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #000;
}
.table tbody tr.is-selected { background: color-mix(in oklch, var(--accent) 6%, transparent); }

/* Inline edit */
.inline-edit__display {
  display: inline-block;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 2px;
  border: 1px dashed transparent;
  cursor: text;
  transition: border-color .12s, background .12s;
}
.inline-edit__display:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}
.input.inline-edit {
  padding: 4px 6px;
  font-size: 13px;
  min-height: 0;
  width: auto;
  max-width: 220px;
}

/* Compare view */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--color-border);
}
.compare-col {
  padding: 20px 24px;
  border-right: 1px solid var(--color-border);
}
.compare-col:last-child { border-right: 0; }
.compare-col__head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}
.compare-col__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -.015em;
  margin-bottom: 16px;
  line-height: 1.2;
}
.compare-list {
  display: grid; gap: 10px;
  font-size: 13px;
}
.compare-list > div {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}
.compare-list > div:last-child { border-bottom: 0; }
.compare-list dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.compare-list dd { font-variant-numeric: tabular-nums; }

/* Saved searches chips */
.saved-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
}
.saved-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.saved-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.saved-chip:hover { color: var(--color-text); border-color: var(--color-text-dim); }
.saved-chip.is-active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.saved-chip.is-active .saved-chip__count { color: var(--color-bg); opacity: .65; }
.saved-chip__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-dim);
  padding: 0 4px;
  border-left: 1px solid currentColor;
  margin-left: 2px;
}
.saved-chip__x {
  width: 14px; height: 14px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  color: inherit;
  opacity: .55;
}
.saved-chip__x:hover { opacity: 1; background: rgba(255,255,255,.08); }
.saved-chip--add {
  background: transparent;
  border-style: dashed;
}

/* Chart hover tooltip */
.chart-tip {
  position: absolute;
  transform: translate(-50%, -130%);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  padding: 8px 12px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.6);
}
.chart-tip__date { color: var(--color-text-dim); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.chart-tip__val { color: var(--color-text); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ============================================================ */
/* RESPONSIVE                                                     */
/* ============================================================ */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-grid > .kpi { padding: 14px 16px 16px; }
  .kpi__value { font-size: 36px; }
}
@media (max-width: 1200px) {
  :root { --content-pad: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .grid--detail { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(3, 1fr); }
  .pack-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-wrap: wrap; align-items: flex-start; }
  .page-header__actions { justify-content: flex-start; flex-wrap: wrap; }
  .table-card, .card.card--flush { overflow-x: auto; }
  .table-card .table, .card--flush .table { min-width: 880px; }

  /* Alert strip stacks below 1200 (was only 640) */
  .alert-strip { grid-template-columns: 1fr; gap: 14px; padding: 16px 18px; }
  .alert-strip__actions { flex-wrap: wrap; }
  .alert-strip__main { font-size: 18px; flex-wrap: wrap; gap: 10px; }
}

/* Sidebar fits short viewports without clipping */
@media (max-height: 720px) {
  .nav { overflow-y: auto; }
  .nav__footer { padding: 10px 20px; gap: 6px; }
}

/* PhotoLoc top bar — between 900 and 1200 the 3-col grid was crushing left zone */
@media (max-width: 1100px) {
  .photoloc__bar { grid-template-columns: 1fr auto; gap: 16px; }
  .photoloc__bar-left { display: none; }
}
@media (max-width: 900px) {
  :root { --content-pad: 16px; --nav-w: 56px; }
  .nav__brand .nav__logo span:not(.nav__mark),
  .nav-g,
  .nav__item-badge,
  .nav__item-lock,
  .nav__item-label,
  .user__body,
  .user__chev { display: none; }
  .nav__brand { padding: 18px 0 8px; display: grid; justify-items: center; }
  .nav__sections { padding: 8px 4px; }
  .nav__item { justify-content: center; padding: 12px 8px; gap: 0; }
  .nav__item-glyph { width: 18px; height: 18px; opacity: .8; }
  .nav__item-glyph svg { width: 18px; height: 18px; }
  .nav__footer { padding: 8px 4px; }
  .user { justify-content: center; padding: 6px; }
  .user-menu { left: 4px; right: auto; width: 220px; }

  .page-header__title { font-size: 22px; }
  .page-header__sub { font-size: 12.5px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .pack-grid { grid-template-columns: 1fr; }

  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar__actions { grid-column: 1 / -1; justify-content: flex-end; }

  .table-card, .card.card--flush { overflow-x: auto; }
  .table { min-width: 720px; }

  .map-shell { grid-template-columns: 1fr; height: auto; margin: calc(-1 * var(--content-pad)); }
  .map-side { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .map-canvas { height: 420px; }

  .modal { padding: 12px; }
  .modal__panel { max-height: calc(100vh - 24px); }
  .modal__head { padding: 14px 16px; }
  .modal__body { padding: 16px; }
  .modal__foot { padding: 12px 16px; flex-wrap: wrap; }

  .kpi { padding: 14px 14px 16px; }
  .kpi__value { font-size: 32px; }
  .kpi__meta { font-size: 9px; }

  .alert-strip { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .alert-strip__actions { flex-wrap: wrap; }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }

  .cmdk { padding-top: 8vh; }
  .cmdk__panel { width: calc(100vw - 24px); }

  .donut { grid-template-columns: 1fr; }
  .donut__svg { margin: 0 auto; width: 160px; height: 160px; }
}

@media (max-width: 640px) {
  :root { --content-pad: 14px; }
  /* En-tete compact : le contenu arrive plus vite a l'ecran */
  .page-header { grid-template-columns: 1fr; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; }
  .page-header__title { font-size: 22px; }
  .page-header__sub { font-size: 12px; }
  .page-header__crumb { margin-bottom: 4px; }
  /* Actions en rangees regulieres pleine largeur (fini le zigzag : chip a
     gauche, bouton au milieu, bouton orphelin a mi-largeur en dessous) */
  .page-header__actions { gap: 8px; width: 100%; }
  .page-header__actions .btn { flex: 1 1 40%; justify-content: center; }
  .page-header__actions .status { flex: 1 1 100%; }
  .emptybox { padding: 24px 16px; }

  /* (chantier 07 : la sidebar est masquee sous 768 px, remplacee par la tab bar) */

  /* Page content */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; gap: 6px; }
  .kpi__value { font-size: 28px; }
  .kpi__label { font-size: 9px; }
  .kpi__meta { font-size: 9px; }

  /* Tables horizontal scroll */
  .table-card, .card.card--flush, .card { overflow-x: auto; }
  .table { min-width: 640px; font-size: 12px; }
  .table thead th { padding: 10px 12px; font-size: 9px; }
  .table tbody td { padding: 12px; }

  /* ── Tables en mode CARTES (listes cles : clients, annonces, matches) ──
     Sur telephone, une ligne = une carte lisible au lieu d'un tableau a
     scroll horizontal. Labels via data-l, paire titre/valeur via
     .tcard-head / .tcard-side (rangee 1 de la grille). Desktop intact :
     tout vit dans ce bloc <=640px. */
  .table--cards { display: block; min-width: 0 !important; }
  .table--cards thead { display: none; }
  .table--cards tbody { display: block; }
  .table-card .table--cards tbody { padding: 10px; }
  .table--cards tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin: 0 0 10px;
    padding: 12px 14px;
    background: var(--color-surface);
  }
  .table--cards tr:last-child { margin-bottom: 0; }
  .table--cards td {
    display: block;
    border: 0 !important;
    padding: 3px 0 !important;
    grid-column: 1 / -1;
    text-align: left !important;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .table--cards td.tcard-head { grid-column: 1; grid-row: 1; font-size: 15px; }
  .table--cards td.tcard-side { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; white-space: nowrap; }
  .table--cards td.tcard-hide, .table--cards td.chk, .table--cards th.chk { display: none; }
  .table--cards .rowact { opacity: 1; }
  .table--cards td[data-l]::before {
    content: attr(data-l);
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-text-dim);
  }
  .table--cards td.actions {
    display: flex; gap: 8px; justify-content: flex-start;
    padding-top: 10px !important;
    margin-top: 6px;
    border-top: 1px solid var(--color-border) !important;
  }
  .table--cards td:empty { display: none; }

  .abar__search { width: 100%; }
  .ann-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; }
  .ann-row__score { grid-column: 3; }
  .ann-row .rowact { display: none; }
  /* Filter bar : 2 colonnes (1 seule = ~3 ecrans de filtres avant le contenu) */
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filter-bar__actions { grid-column: 1 / -1; justify-content: flex-end; }

  /* Tabs scrollable + bigger tap. Couleur : les onglets inactifs etaient en
     text-dim (#555 sur noir), quasi invisibles au soleil sur telephone —
     Blanc/Sat/3D passaient inapercus. */
  .seg__btn { height: 30px; }
  .tab { padding: 10px 0; }

  /* Inputs anti-zoom iOS + touch */
  .input, .select, .textarea, .input-row input {
    font-size: 16px;
    min-height: 44px;
  }
  .input, .select, .textarea { padding: 12px 14px; }
  .select { padding-right: 32px; }
  /* Rangees de filtres : chaque controle prend toute la largeur et la meme
     hauteur (avant : recherche 320px/54px, select 220px/50px — en escalier).
     !important : ces largeurs viennent de styles inline. */
  .row > .input-row { flex: 1 1 100% !important; max-width: none !important; }
  .row > .input-row input { min-height: 40px; }
  .row > .select { width: 100%; max-width: none !important; }

  /* Boutons : une seule hauteur (36 / 30), cibles tactiles traitees au ch. 07 */

  /* Cards */
  .card { padding: 14px; }
  .card--padded { padding: 16px; }

  /* Alert strip */
  .alert-strip { padding: 14px; gap: 10px; }
  .alert-strip__main { font-size: 17px; flex-wrap: wrap; gap: 8px; }

  /* Modal full-screen */
  .modal { padding: 0; }
  .modal__panel {
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .modal__head { padding: 14px; }
  .modal__body { padding: 14px; overflow-x: auto; } /* tables larges scrollables dans la modale */
  .modal__foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .modal__close { width: 44px; height: 44px; }

  /* Kanban */
  .kanban { gap: 8px; }
  .kanban-card { padding: 10px; }

  /* Map : la carte d'abord (les filtres passent dessous), hauteur en dvh */
  .map-shell { margin: calc(-1 * var(--content-pad)); }
  .map-side { padding: 0 14px; order: 2; border-bottom: 0; border-top: 1px solid var(--color-border); }
  .map-side__body { padding: 14px; gap: 12px; }
  .map-canvas { order: -1; height: 52dvh; min-height: 320px; }
  .map-zoom button { width: 40px; height: 40px; }

  /* PhotoLoc : hauteur naturelle, la page scrolle (100vh clippait le bas).
     overflow-x hidden : AUCUN enfant (rangee d'onglets, select, bouton) ne
     doit faire scroller toute la page horizontalement (titres coupes,
     elements decales — vu sur iPhone). */
  .photoloc { height: auto; min-height: 100%; overflow-x: hidden; }
  .photoloc__shell { overflow: visible; }
  .photoloc__bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 14px;
  }
  .photoloc__bar-left, .photoloc__bar-mid, .photoloc__bar-right {
    justify-content: center;
    text-align: center;
    min-width: 0;
  }
  /* La rangee onglets carte + zone + bouton passe a la ligne au lieu de
     deborder de l'ecran */
  .photoloc__bar-right { gap: 6px; flex-wrap: wrap; }
  .photoloc__zone-chip { flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .photoloc__zone-chip .select { max-width: 70vw; }
  /* Onglets Dark/Blanc/Sat/2D/3D : lisibles au doigt (avant : text-dim,
     quasi invisibles sur telephone) */
  .photoloc__analyzing { padding: 0 16px; }
  .photoloc__shell--result { grid-template-columns: 1fr; }
  .photoloc__side { max-height: none; border-left: 0; border-top: 1px solid var(--color-border); }
  .photoloc__callout {
    position: static !important;
    width: auto;
    margin: 12px;
    box-shadow: none;
  }
  .photoloc__strip { grid-template-columns: 1fr 1fr; padding: 12px 14px; gap: 12px; }
  .photoloc__strip > div:nth-child(4) span:nth-child(2) { font-size: 24px; }
  .photoloc__hero { padding: 20px 14px; }
  .photoloc__zone-picker { padding: 12px; }
  .photoloc__drop { padding: 24px 16px; }
  .photoloc__hints { gap: 10px; flex-direction: column; font-size: 9px; }

  /* Pack grid + tile grid */
  .pack-grid, .tile-grid { grid-template-columns: 1fr; gap: 10px; }
  .pack, .tile { padding: 16px; }
  .pack__price { font-size: 36px; }

  /* Toasts */
  .toasts { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: none; } /* leave space for bottom nav */

  /* CmdK */
  .cmdk { padding-top: 4vh; padding-left: 10px; padding-right: 10px; }
  .cmdk__panel { width: 100%; max-width: 100%; }
  .cmdk__input { font-size: 16px; padding: 14px; }
  .cmdk__item { padding: 12px; }
  .cmdk__list { max-height: min(360px, 45dvh); } /* clavier virtuel : garder les resultats visibles */

  /* Danger zone */
  .danger-zone { padding: 14px; }

  /* Charts: keep text readable, prevent overflow */
  .chart-area { padding: 12px 8px 16px; height: auto; }
  /* .chart-bars garde une hauteur DEFINIE : les barres sont en height:% inline,
     un conteneur en auto les ecrase a 0 (graphique vide). */
  .chart-bars { padding: 12px 8px 16px; height: 170px; overflow-x: auto; }
  .chart-bar__col { width: 40px; }
  .chart-area svg, .chart-bars > * { font-size: 10px; }

  /* Composants sans regle mobile jusqu'ici */
  .compare-grid { grid-template-columns: 1fr; }
  .compare-col { border-right: 0; border-bottom: 1px solid var(--color-border); padding: 16px; }
  .compare-col:last-child { border-bottom: 0; }
  .bulk-bar { flex-wrap: wrap; padding: 10px 12px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg__btn { flex-shrink: 0; }
  .kanban__col { min-height: auto; }
  .client-timeline { margin-left: 8px; }
  .saved-chip__x { width: 22px; height: 22px; }

  /* Topbar : fond opaque (le degrade laissait le contenu transparaitre
     sous la cloche) + bouton recherche visible + cibles 40px */
  .app__topbar { height: 44px; }
  /* display:grid (pas flex) : le centrage de l'icone vient de
     .notif__btn { display:grid; place-items:center } — flex ecrasait le
     grid et laissait la loupe/le soleil colles dans le coin du carre. */
  .top__search { width: 36px; padding: 0; justify-content: center; }
  .top__search-label, .top__search .kbd { display: none; }
  .top__cab { max-width: 46vw; }
  .notif__btn { width: 36px; height: 36px; }
  .chart-bar__col { width: 36px; }
  .chart-bar__label { font-size: 8px; letter-spacing: .02em; }

  /* Activity */
  .activity__item { grid-template-columns: auto 1fr; gap: 8px; padding: 12px 0; }
  .activity__time { grid-column: 2; font-size: 9px; margin-top: 4px; }
  .activity__text { font-size: 12px; }

  /* Metric rows */
  .metric { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
  .metric__value { font-size: 16px; }
}

@media (max-width: 380px) {
  :root { --content-pad: 10px; }
  .map-shell { margin: calc(-1 * var(--content-pad)); }
  .page-header__title { font-size: 20px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi__value { font-size: 32px; }
  .alert-strip__main { font-size: 16px; }
  .pack__price { font-size: 32px; }
}

/* ============================================================ */
/* MODE CLAIR — chantier 08 : ombres 8-15 %, filets, badges        */
/* ============================================================ */
body.light .modal, body.light .cmdk { background: rgba(0, 0, 0, .32); }
body.light .modal__panel,
body.light .cmdk__panel {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 24px 48px -16px rgba(0, 0, 0, .15);
}
body.light .notif__panel,
body.light .toast,
body.light .user-menu,
body.light .tour__tip {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 16px 32px -12px rgba(0, 0, 0, .12);
}
body.light .tour__veil { background: rgba(0, 0, 0, .35); }
body.light .kpi::before,
body.light .tool::before,
body.light .tile::before {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, .05), transparent);
}
body.light .pack--current::before {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, .10), transparent);
}
/* Verre des couches flottantes : la teinte suit la surface, le blur reste */
body.glass.light .modal__panel,
body.glass.light .cmdk__panel,
body.glass.light .notif__panel {
  background: color-mix(in oklch, var(--color-surface) 78%, transparent);
}

/* ============================================================ */
/* PARAMETRES — chantier 05 : nav verticale, formulaires Inter     */
/* ============================================================ */
.settings { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings__nav { position: sticky; top: 64px; display: grid; gap: 4px; }
.settings__group + .settings__group { margin-top: 4px; }
.settings__item {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 12.5px; font-weight: 500;
  color: var(--color-text-muted);
  text-align: left;
  transition: color .12s, background .12s;
}
.settings__item:hover { color: var(--color-text); background: var(--color-surface-2); }
.settings__item.on { color: var(--color-text); background: var(--color-surface-2); }
.settings__item .cnt { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-dim); }
.settings__meta { color: var(--color-text-dim); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings__body { min-width: 0; }
/* Formulaires : labels Inter 11 px, champs 34 px, 2 colonnes, boutons a droite */
.settings .field__label {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  color: var(--color-text-muted);
}
.settings .input, .settings .select { height: 34px; padding: 0 10px; font-size: 12.5px; }
.settings .select { padding-right: 30px; background-position: calc(100% - 13px) 14px, calc(100% - 8px) 14px; }
.settings .textarea { font-size: 12.5px; }
.settings .grid--2 { gap: 12px; }
.field .seg { justify-self: start; width: max-content; }
.form__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* Abonnement */
.abo__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.abo__name { font-family: var(--font-display); font-size: 18px; font-weight: 300; letter-spacing: -.015em; }
.abo__price { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.abo__price small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.abo__quotas { display: grid; gap: 12px; margin-bottom: 16px; }
.quota__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: 12.5px; }
.quota__label { color: var(--color-text); }
.quota__val { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.quota__bar { height: 4px; background: var(--color-border); border-radius: 2px; overflow: hidden; }
.quota__fill { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s var(--ease-out); }
.quota__fill[data-full] { background: var(--color-warning); }
.abo__features { display: grid; gap: 6px; margin-bottom: 16px; }
.abo__features li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.abo__features li:last-child { border-bottom: 0; }
.abo__features li.is-later { color: var(--color-text-muted); }
.abo__tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--color-text-dim); white-space: nowrap; }
.abo__features li.is-incl .abo__tag { color: var(--color-success); }
@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr; gap: 12px; }
  .settings__nav { position: static; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: none; padding-bottom: 4px; }
  .settings__nav::-webkit-scrollbar { display: none; }
  .settings__group { display: contents; }
  .settings__nav .nav-g { display: none; }
  .settings__item { width: auto; white-space: nowrap; border: 1px solid var(--color-border-strong); height: 30px; padding: 0 10px; }
  .settings__item.on { border-color: var(--color-text); }
}

/* ============================================================ */
/* MOBILE — chantier 07 : tab bar, feuilles, FAB, listes 2 colonnes, */
/* carte plein ecran, kanban glissant                               */
/* ============================================================ */
@media (max-width: 767px) {
  .nav { display: none !important; }
  .app { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
  .app__main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .m-only { display: inline-block; }

  /* Topbar 44 px : marque + cabinet compact · loupe · cloche */
  .app__topbar { height: 44px; gap: 6px; padding: 0 12px; }
  .top__brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 300; font-size: 12px;
    letter-spacing: .16em; text-transform: uppercase;
    margin-right: 2px; white-space: nowrap;
  }
  .top__brand .nav__mark { width: 14px; height: 14px; }
  .top__cab { max-width: 34vw; height: 32px; font-size: 12px; padding: 0 8px; }
  .top__cab-groupe { display: none; }
  .top__search { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .top__search-label, .top__search .kbd { display: none; }
  .notif__btn { width: 36px; height: 36px; }
  .top__help { display: none; }
  .app__topbar-spacer { flex: 1; }

  /* Tab bar fixe 64 px, 5 entrees */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 600;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
  }
  .tabbar__item {
    display: grid; justify-items: center; align-content: center; gap: 4px;
    min-height: 64px;
    color: var(--color-text-muted);
    font-family: var(--font-body); font-size: 9px; font-weight: 500;
  }
  .tabbar__icon { width: 24px; height: 24px; border: 1px solid transparent; border-radius: 3px; display: grid; place-items: center; }
  .tabbar__icon svg { width: 18px; height: 18px; }
  .tabbar__item.on { color: var(--color-text); }
  .tabbar__item.on .tabbar__icon { border-color: var(--accent); }

  /* Feuilles depuis le bas, au-dessus de la tab bar */
  .m-veil { position: fixed; inset: 0; z-index: 650; background: rgba(0, 0, 0, .45); animation: fadeIn .15s var(--ease-out); }
  body.light .m-veil { background: rgba(0, 0, 0, .3); }
  .m-sheet {
    position: absolute; left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 64px - 44px);
    overflow-y: auto;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-strong);
    border-radius: 8px 8px 0 0;
    padding: 10px 16px 16px;
    animation: sheetIn .22s var(--ease-out-expo);
  }
  .m-sheet__handle { display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--color-border-strong); margin: 0 auto 12px; }
  .m-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .m-sheet__title { font-size: 15px; font-weight: 500; }
  .m-sheet__rows { display: grid; }
  .m-sheet__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
  .m-sheet__k { color: var(--color-text-muted); }
  .m-sheet__v { text-align: right; font-weight: 500; }
  .m-sheet__v.is-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .m-sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .m-sheet__actions .btn { height: 40px; }
  .m-sheet__link { display: block; width: 100%; text-align: left; padding: 12px 0 0; font-size: 12.5px; color: var(--color-text-muted); }
  .btn.is-disabled { opacity: .5; }

  /* « Plus » */
  .m-more__list { display: grid; }
  .m-more__item {
    display: flex; align-items: center; gap: 12px;
    height: 48px; padding: 0 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px; font-weight: 500;
    color: var(--color-text);
    text-align: left;
  }
  .m-more__item.on .m-more__icon { color: var(--accent); }
  .m-more__icon { width: 18px; display: inline-flex; color: var(--color-text-muted); }
  .m-more__icon svg { width: 16px; height: 16px; }
  .m-more__label { flex: 1; }
  .m-more__chev { color: var(--color-text-dim); transform: rotate(180deg); display: inline-flex; }
  .m-more__lock { color: var(--color-text-dim); display: inline-flex; }
  .m-more__user { display: flex; align-items: center; gap: 10px; padding: 14px 0 10px; flex-wrap: wrap; }
  .m-more__user .user__body { flex: 1; min-width: 120px; }
  .m-more__foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
  .m-more__logout { color: var(--color-danger); margin-left: auto; }

  /* FAB */
  .fab {
    position: fixed; right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    z-index: 590;
    width: 48px; height: 48px;
    border-radius: 3px;
    background: var(--color-text); color: var(--color-bg);
    display: grid; place-items: center;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .6);
  }
  .fab svg { width: 18px; height: 18px; }

  /* Aujourd'hui */
  .page--today .page-header__title { font-size: 22px; }
  .today__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .today__kpis .kpi { padding: 12px 14px; }
  .today__kpis .kpi__value { font-size: 28px; }
  .page--today .card { margin-bottom: 12px; }

  /* Listes 2 colonnes */
  .mlist { display: grid; }
  .mlist__row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 4px 12px;
    padding: 10px 14px; min-height: 56px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
  }
  .mlist__row:last-child { border-bottom: 0; }
  .mlist__main { display: grid; gap: 2px; min-width: 0; }
  .mlist__title { font-size: 12.5px; font-weight: 500; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mlist__sub { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mlist__side { display: grid; justify-items: end; gap: 4px; }
  .mlist__num { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .fresh__dot--inline { display: inline-block; margin-right: 6px; vertical-align: middle; }
  .fresh__dot[data-tone="ok"] { background: var(--color-success); }
  .fresh__dot[data-tone="warn"] { background: var(--color-warning); }
  .fresh__dot[data-tone="late"], .fresh__dot[data-late] { background: var(--color-danger); }

  /* Tables balisees -> listes 2 colonnes (tcard-head / tcard-sub / tcard-side) */
  .table--cards tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 14px;
    margin: 0;
    border: 0; border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    min-height: 56px;
    align-items: center;
  }
  .table-card .table--cards tbody { padding: 0; }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td.m-hide { display: none; }
  .table--cards td.tcard-head { grid-column: 1; grid-row: 1; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 !important; }
  .table--cards td.tcard-sub { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 !important; }
  .table--cards td.tcard-sub::before { display: none; }
  .table--cards td.tcard-sub .ellip { max-width: 100%; font-size: 11px !important; }
  .table--cards td.tcard-side { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: end; font-family: var(--font-mono); font-size: 12.5px; padding: 0 !important; }

  /* Annonces : prix + score empiles a droite */
  .ann-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; padding: 10px 14px; }
  .ann-row__thumb { grid-row: 1 / span 2; }
  .ann-row__main { grid-row: 1 / span 2; }
  .ann-row__price { grid-column: 3; grid-row: 1; min-width: 0; }
  .ann-row__score { grid-column: 3; grid-row: 2; min-width: 0; }
  .ann-row .rowact { display: none; }
  .abar__search { width: 100%; }

  /* Kanban : une colonne par ecran, glissement lateral, points */
  .kanban { display: flex !important; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; scrollbar-width: none; }
  .kanban::-webkit-scrollbar { display: none; }
  .kanban__col { flex: 0 0 calc(100vw - 72px); scroll-snap-align: start; }
  .kdots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; }
  .kdots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-border-strong); }
  .kdots span.on { background: var(--color-text); }

  /* Carte plein ecran : recherche + Filtres flottants, feuille de resultats */
  .map-shell { display: block; height: calc(100dvh - 64px - env(safe-area-inset-bottom)); margin: 0; position: relative; }
  .map-canvas { height: 100% !important; min-height: 0 !important; }
  .map-side {
    position: fixed; left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom)); top: auto;
    max-height: 70dvh;
    z-index: 640;
    border-right: 0; border-top: 1px solid var(--color-border-strong);
    border-radius: 8px 8px 0 0;
    grid-template-rows: auto 1fr auto;
    box-shadow: 0 -16px 40px -16px rgba(0, 0, 0, .6);
    order: 0;
  }
  .map-side__body { padding: 14px; }
  .map-float { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; gap: 8px; align-items: center; }
  .map-float .input-row { flex: 1; height: 40px; background: var(--color-surface); border-color: var(--color-border-strong); }
  .chip--float { height: 40px; background: var(--color-surface); box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6); }
  .map-sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    z-index: 500;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-strong);
    border-radius: 8px 8px 0 0;
    padding: 8px 14px 12px;
  }
  .map-sheet__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
  .map-sheet__title { font-size: 14px; font-weight: 500; }
  .map-sheet__matches { font-family: var(--font-mono); font-size: 11px; color: var(--color-success); white-space: nowrap; }
  .map-legend--inline { display: flex; gap: 12px; flex-wrap: wrap; }
  .map-legend--inline .map-legend__row { font-size: 10.5px; gap: 6px; }
  .maplibregl-ctrl-top-right { top: 64px !important; }

  /* En-tete compact (Clients) : titre + segment sur une seule rangee */
  .m-hide { display: none !important; }
  .page-header--tight { flex-wrap: nowrap; align-items: flex-end; }
  .page-header--tight .page-header__actions { width: auto; flex: 0 0 auto; }
  .page-header--tight .page-header__sub { margin: 0; }

  /* Barres d'outils : chaque controle sur toute la largeur, meme hauteur 44 */
  .toolbar > .row { flex-wrap: wrap !important; width: 100%; }
  .toolbar .input-row--sm, .abar .input-row--sm { flex: 1 1 100% !important; width: auto !important; height: 44px; padding: 0 4px 0 12px; }
  .input-row--sm input { min-height: 0; height: 100%; }
  .input-row--sm svg { width: 14px; height: 14px; }
  .toolbar .select--sm { width: 100% !important; height: 44px; min-height: 44px; padding: 0 32px 0 12px; background-position: calc(100% - 14px) 19px, calc(100% - 9px) 19px; }
  .tabs { overflow-x: auto; scrollbar-width: none; gap: 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  /* Annonces : Filtres (n) · … · Trier ⌄ · export · ⋯ sur une rangee */
  .abar { gap: 6px; }
  .abar .btn--sm { padding: 0 10px; }
  .abar__sort { font-size: 12px; gap: 2px; }
  .abar .select--bare { height: 36px; min-height: 36px; font-size: 13px; padding: 0 22px 0 4px; background-position: calc(100% - 10px) 15px, calc(100% - 5px) 15px; }

  /* Cibles tactiles */
  .btn { height: 40px; }
  .btn--sm { height: 36px; }
  .chip { height: 32px; }
  .settings__item { min-height: 40px; }
  .tab { padding: 12px 0; }
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
