/* ============================================================
   Système de design « medina »
   Back-office syndic de copropriété — Maroc
   ============================================================ */

:root {
  --primary:      #1a8a80;   /* teal */
  --primary-2:    #157a70;   /* teal foncé (dégradé) */
  --primary-soft: #e6f1ef;   /* teal très clair (fonds) */
  --accent:       #d2562b;   /* terracotta — PARCIMONIE */
  --accent-soft:  #fbe9e2;

  --base-100:     #fefdfb;   /* surfaces, sidebar */
  --base-200:     #f7f6f2;   /* fond de page */
  --base-300:     #e8e4db;   /* contours fins */
  --base-content: #1d2a2e;   /* texte */
  --muted:        #6b787c;   /* texte secondaire */
  --muted-2:      #94a0a3;   /* texte tertiaire */

  --success:      #2e9e6b;
  --success-soft: #e4f3ec;
  --warning:      #e0920f;
  --warning-soft: #fbf0db;
  --error:        #dd4a3f;
  --error-soft:   #fbe6e4;

  --r-card: 1.1rem;
  --r-btn:  0.7rem;

  --shadow-soft:  0 1px 2px rgba(29,42,46,.04), 0 7px 22px -10px rgba(29,42,46,.12);
  --shadow-card:  0 1px 2px rgba(29,42,46,.035), 0 10px 28px -16px rgba(29,42,46,.14);
  --shadow-lift:  0 14px 40px -14px rgba(29,42,46,.20);
  --shadow-teal:  0 8px 20px -8px rgba(26,138,128,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--base-200);
  color: var(--base-content);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono, .num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.text-muted   { color: var(--muted); }
.text-muted-2 { color: var(--muted-2); }

/* ---------- Layout shell ---------- */
.app-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 256px;
  height: 100vh;
  background: var(--base-100);
  display: flex;
  flex-direction: column;
  /* Colonne flex 100vh à 3 zones (COP-111) : marque + sélecteur figés en tête,
     nav défilante au milieu, Configuration épinglée en bas. La sidebar elle-même ne
     défile jamais (les 3 zones se partagent 100vh) ; overflow VISIBLE pour que les
     surfaces flottantes (dropdown copro, popover Configuration, info-bulles rail)
     puissent déborder du rail 64px sans être tronquées. */
  overflow: visible;
  padding: 18px 14px 16px;
  z-index: 30;
  /* Transition douce plein ⇄ rail (COP-112). La largeur anime ; en ≤980px le bloc
     mobile remplace cette transition par celle du transform (tiroir off-canvas). */
  transition: width .22s cubic-bezier(.2,.7,.2,1), padding .22s cubic-bezier(.2,.7,.2,1);
}
/* Zone haute : marque + sélecteur copro, jamais comprimée ni défilante. */
.app-sidebar-top { flex: 0 0 auto; }
/* Zone basse : Paramètres (et future Configuration), épinglée, toujours visible. */
.app-sidebar-footer {
  flex: 0 0 auto;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--base-300);
}
.app-main {
  margin-inline-start: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Suit la largeur du rail (COP-112), synchronisé avec la transition de la sidebar. */
  transition: margin-inline-start .22s cubic-bezier(.2,.7,.2,1);
}
.app-content {
  padding: 26px 34px 60px;
  max-width: 1240px;
  width: 100%;
}

/* ---------- Sidebar brand + sélecteur ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 16px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-teal);
  flex: none;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name {
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: 16.5px;
}
/* Micro-textes INFORMATIFS en --muted (contraste AA) ; --muted-2 (~2.7:1) est
   réservé à l'ornement pur (placeholders, chevrons, pictos secondaires). */
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }

.copro-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--base-300);
  border-radius: var(--r-btn);
  background: var(--base-100);
  text-align: start;
  transition: border-color .15s, background .15s;
  margin-bottom: 18px;
}
/* Curseur + hover réservés à la variante interactive (<button>, sélecteur ≥2 copros) :
   la pastille mono-copro figée (div aria-disabled) ne promet aucune interaction. */
button.copro-pill { cursor: pointer; }
button.copro-pill:hover { background: var(--base-200); border-color: #d9d4c8; }
.copro-ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex: none;
}
.copro-ico svg { width: 16px; height: 16px; }
.copro-name { font-weight: 600; font-size: 13.5px; line-height: 1.15; letter-spacing: -.01em; }
.copro-meta { font-size: 11px; color: var(--muted); }

/* ---------- Navigation ---------- */
/* Seule zone défilante de la sidebar : prend l'espace restant et défile en interne
   (min-height:0 lève la taille-contenu minimale du flex pour autoriser l'overflow). */
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  /* Filet de sécurité seulement : la densité + le popover Configuration (hors flux)
     font tenir la nav sans défiler sur les hauteurs d'écran courantes (≥ ~700px).
     Quand il se déclenche, l'ascenseur reste discret. */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--base-300) transparent;
}
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted-2);
  font-weight: 600;
  padding: 10px 12px 5px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--r-btn);
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--base-200); color: var(--base-content); }
.nav-item.active {
  background: var(--base-200);
  color: var(--base-content);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 3px;
  /* Teal, PAS terracotta : « vous êtes ici » n'est pas une alerte — la terracotta
     reste réservée aux signaux critiques (badges alerte, pastille), parcimonie oblige. */
  background: var(--primary);
}
.nav-item.active svg { color: var(--primary); opacity: 1; }
/* Bascule rail (COP-112) : un <button> rendu comme un nav-item (reset du chrome natif). */
.rail-toggle { width: 100%; border: 0; background: none; font: inherit; text-align: start; }
.nav-badge {
  margin-inline-start: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 7px;
  font-family: "JetBrains Mono", monospace;
}
/* Deux natures de badge (COP-114), jetons Medina existants — aucune nouvelle couleur.
   Compteur teal = une file qui attend une action ; pastille terracotta = un signal
   critique/temporel (pas un chiffre). Le seuil de visibilité vit dans le fragment. */
.nav-badge--count { background: var(--primary-soft); color: var(--primary); }
.nav-badge--alert {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: inherit;   /* le pictogramme ▲, pas des chiffres monospace */
  line-height: 1;
  padding: 1px 6px;
}
/* Groupe « Configuration » du footer (COP-113). Ouverture au clic dans un POPOVER flottant
   au-dessus du bouton (même patron que le dropdown copro) : hors flux, donc aucun décalage
   de mise en page et aucune pression sur la hauteur de la nav. Chevron pivoté quand ouvert. */
.config-group { display: flex; flex-direction: column; }
.config-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 40;
}
.dropdown .dropdown-item.active { background: var(--base-200); font-weight: 600; }
.dropdown .dropdown-item.active svg { color: var(--primary); }
.config-chevron { margin-inline-start: auto; transition: transform .15s; opacity: .7; }
.config-toggle { width: 100%; border: 0; background: none; font: inherit; text-align: start; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 34px;
  background: color-mix(in srgb, var(--base-200) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.crumbs svg { width: 14px; height: 14px; color: var(--muted-2); }
/* Le segment home + copro est un vrai lien (retour tableau de bord). */
.crumbs a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--base-content); }
.crumbs .cur { color: var(--base-content); font-weight: 600; }
.topbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 230px;
  padding: 8px 12px;
  background: var(--base-100);
  border: 1px solid var(--base-300);
  border-radius: var(--r-btn);
  color: var(--muted-2);
  transition: border-color .15s, box-shadow .15s, width .2s;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); width: 270px; }
.search svg { width: 16px; height: 16px; flex: none; }
.search input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13.5px; color: var(--base-content); width: 100%;
}
.search input::placeholder { color: var(--muted-2); }
.search kbd {
  font-family: "JetBrains Mono", monospace; font-size: 10.5px;
  background: var(--base-200); border: 1px solid var(--base-300);
  border-radius: 5px; padding: 1px 5px; color: var(--muted-2);
  /* Jamais compressé ni replié : « Ctrl K » (espace sécable) wrapperait sur 2 lignes
     et grandirait la topbar. */
  flex: none; white-space: nowrap;
}

/* Recherche personne ⌘K (COP-117) — dropdown de suggestions sous le champ. RTL via inset-inline. */
.search-box { position: relative; }
.search-results-wrap {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0;
  width: 320px; max-width: 80vw; z-index: 50;
}
.search-results {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lift);
}
.search-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; text-decoration: none; color: var(--base-content);
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result:focus { background: var(--primary-soft); }
.search-result .sr-nom { font-weight: 600; font-size: 13.5px; }
.search-result .sr-lots { font-size: 11.5px; color: var(--muted); }
.search-empty {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lift);
  padding: 14px; font-size: 12.5px; color: var(--muted);
}
.search-empty svg { width: 16px; height: 16px; flex: none; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--r-btn);
  background: var(--base-100);
  border: 1px solid var(--base-300);
  display: grid; place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--base-200); color: var(--base-content); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.wa { color: var(--primary); }
.icon-btn.wa:hover { background: var(--primary-soft); }
.notif-dot {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--base-200);
}

/* Pastille d'alerte « envois en échec » (COP-160) — un compteur terracotta (alerte, jamais « ici »)
   sur l'icône WhatsApp : un reçu/accusé FAILED n'est plus silencieux. Masquée quand tout est parti. */
.wa-alert-count {
  position: absolute; top: 1px; inset-inline-end: 1px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
  font-family: "JetBrains Mono", monospace;
  box-shadow: 0 0 0 2px var(--base-200);
}
/* Bandeau + lignes du suivi des envois en échec dans le hub WhatsApp (COP-160). */
.wa-outbound-banner { margin: 4px 10px 8px; padding: 9px 11px; font-size: 12.5px; }
.wa-outbound-banner svg { width: 15px; height: 15px; }
.wa-outbound-item { padding-inline-end: 8px; }
.wa-renvoyer { flex: none; align-self: center; gap: 5px; }
.wa-renvoyer svg { width: 13px; height: 13px; }

/* Feed WhatsApp inbound (COP-118) — dropdown lecture seule sous l'icône topbar. RTL-ready
   (propriétés logiques, hérite de .dropdown / .dropdown-item). Liste compacte de message_entrant. */
.wa-feed-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.wa-feed-item { gap: 10px; }
.wa-feed-item svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.wa-feed-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-feed-sender {
  font-size: 12.5px; font-weight: 600; color: var(--base-content);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-feed-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; align-items: baseline; }
.wa-feed-empty {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 16px 12px; font-size: 12.5px; color: var(--muted);
}
.wa-feed-empty svg { width: 16px; height: 16px; flex: none; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 9px 5px 6px;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background .15s;
}
.user-chip:hover { background: var(--base-100); }
.user-meta { line-height: 1.1; }
.user-name { font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; }
.user-role { font-size: 11px; color: var(--muted); }
.user-chip > svg { width: 16px; height: 16px; color: var(--muted-2); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #2aa094, #167b72);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(.5px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-teal);
}
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(26,138,128,.6); }
.btn-secondary {
  background: var(--base-100);
  border-color: var(--base-300);
  color: var(--base-content);
  box-shadow: var(--shadow-soft);
}
.btn-secondary:hover { background: var(--base-200); border-color: #d9d4c8; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--base-200); color: var(--base-content); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn-danger {
  background: var(--base-100); border-color: var(--base-300); color: var(--error);
}
.btn-danger:hover { background: var(--error-soft); border-color: var(--error); }

/* ---------- Cartes ---------- */
.card {
  background: var(--base-100);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
}
.card-pad-0 { padding: 0; }
.card-title { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

/* Page title */
.page-title { font-weight: 600; font-size: 25px; letter-spacing: -.025em; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-top: 2px; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.kpi-value .unit { font-size: 14px; color: var(--muted-2); font-weight: 500; margin-inline-start: 3px; }
.kpi-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
}
.delta svg { width: 12px; height: 12px; }
.delta-up   { background: var(--success-soft); color: var(--success); }
.delta-down { background: var(--error-soft); color: var(--error); }
.delta-flat { background: var(--base-200); color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #b9770b; }
.badge-error   { background: var(--error-soft); color: var(--error); }
.badge-neutral { background: var(--base-200); color: var(--muted); }
.badge-info    { background: var(--primary-soft); color: var(--primary); }
.badge-mre {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }

/* ---------- Tableaux ---------- */
.table-medina { width: 100%; border-collapse: collapse; }
.table-medina thead th {
  text-align: start;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2);
  padding: 0 16px 12px;
}
.table-medina tbody tr {
  transition: background .12s;
}
.table-medina tbody tr:hover { background: var(--base-200); }
.table-medina tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--base-300);
  vertical-align: middle;
  font-size: 14px;
}
.table-medina tbody tr:first-child td { border-top: 0; }
.row-name { font-weight: 600; letter-spacing: -.01em; }
.row-sub { font-size: 12px; color: var(--muted-2); }
.lot-tag {
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; font-weight: 600;
  background: var(--base-200); color: var(--base-content);
  padding: 2px 8px; border-radius: 7px;
}

/* ---------- Prescription ---------- */
.presc { display: flex; flex-direction: column; gap: 4px; }
.presc-row { display: flex; align-items: center; gap: 7px; }
.presc-date { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 600; }
.presc-label { font-size: 11px; color: var(--muted-2); }
.presc-bar { height: 4px; border-radius: 999px; background: var(--base-300); overflow: hidden; width: 110px; }
.presc-bar > span { display: block; height: 100%; border-radius: 999px; }
.presc-ok    .presc-bar > span { background: var(--success); }
.presc-warn  .presc-bar > span { background: var(--warning); }
.presc-crit  .presc-bar > span { background: var(--error); }
.presc-ok   .dot { background: var(--success); }
.presc-warn .dot { background: var(--warning); }
.presc-crit .dot { background: var(--error); }
.presc-crit .presc-date { color: var(--error); }

/* ---------- Filtres / segmented ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--base-200); border-radius: var(--r-btn); padding: 3px; gap: 2px; }
.seg button {
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 13px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; transition: background .14s, color .14s;
}
.seg button.active { background: var(--base-100); color: var(--base-content); font-weight: 600; box-shadow: var(--shadow-soft); }
.chip-filter {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 8px 13px; border-radius: var(--r-btn);
  border: 1px solid var(--base-300); background: var(--base-100);
  cursor: pointer; transition: background .14s, border-color .14s, color .14s;
}
.chip-filter:hover { background: var(--base-200); }
.chip-filter.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.chip-filter svg { width: 15px; height: 15px; }

/* ---------- Prochaine action ---------- */
.next-action {
  position: relative;
  border-radius: var(--r-card);
  padding: 22px 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.next-action .na-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px;
}
.next-action .na-tag svg { width: 13px; height: 13px; }
.next-action h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 6px; }
.next-action p { color: rgba(255,255,255,.8); font-size: 13.5px; max-width: 52ch; margin: 0; }
.btn-on-teal {
  background: #fff; color: var(--primary-2);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,.35);
}
.btn-on-teal:hover { background: #fff; box-shadow: 0 10px 22px -8px rgba(0,0,0,.45); }

/* ---------- Graphe en barres CSS ---------- */
.chart { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 100%; width: 100%; justify-content: center; }
.chart-bar { width: 16px; border-radius: 6px 6px 3px 3px; transition: height .5s cubic-bezier(.2,.7,.3,1); position: relative; }
.chart-bar.appele   { background: var(--primary-soft); }
.chart-bar.encaisse { background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%); }
.chart-x { font-size: 11.5px; color: var(--muted-2); font-weight: 500; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-sw { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Activité / listes ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: flex-start; gap: 13px; padding: 13px 0; border-top: 1px solid var(--base-300); }
.feed-item:first-child { border-top: 0; }
.feed-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.feed-ico svg { width: 16px; height: 16px; }
.fi-teal   { background: var(--primary-soft); color: var(--primary); }
.fi-green  { background: var(--success-soft); color: var(--success); }
.fi-amber  { background: var(--warning-soft); color: #b9770b; }
.fi-terra  { background: var(--accent-soft); color: var(--accent); }
.feed-main { flex: 1; }
.feed-title { font-size: 13.5px; font-weight: 500; }
.feed-title b { font-weight: 600; }
.feed-time { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

/* ---------- Onglets (fiche) ---------- */
.tabs { display: flex; gap: 4px; }
.tab {
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 10px 4px; margin-inline-end: 18px;
  border: 0; background: transparent; cursor: pointer; position: relative;
  transition: color .14s;
}
.tab:hover { color: var(--base-content); }
.tab.active { color: var(--base-content); font-weight: 600; }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  border-radius: 3px; background: var(--primary);
}
.tab-bar { display: flex; border-bottom: 1px solid var(--base-300); margin-bottom: 22px; }

/* ---------- Timeline relances ---------- */
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before {
  content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--base-300);
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; inset-inline-start: -26px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--base-100); border: 2px solid var(--base-300);
  display: grid; place-items: center;
}
.tl-dot svg { width: 9px; height: 9px; }
.tl-dot.tl-teal  { border-color: var(--primary); color: var(--primary); }
.tl-dot.tl-amber { border-color: var(--warning); color: var(--warning); }
.tl-dot.tl-terra { border-color: var(--accent); color: var(--accent); background: var(--accent); }
.tl-dot.tl-terra svg { color: #fff; }
.tl-date { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--muted-2); }
.tl-title { font-weight: 600; font-size: 14px; margin-top: 1px; }
.tl-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Paliers de relance ---------- */
.palier {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 16px; border-radius: var(--r-btn);
  border: 1px solid var(--base-300); background: var(--base-100);
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.palier:hover { border-color: var(--primary); background: var(--primary-soft); }
.palier.is-current { border-color: var(--accent); background: var(--accent-soft); }
.palier.is-done { opacity: .55; }
.palier-step {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  background: var(--base-200); color: var(--muted);
}
.palier.is-current .palier-step { background: var(--accent); color: #fff; }
.palier-title { font-weight: 600; font-size: 14.5px; }
.palier-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Modale ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20,30,33,.42);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
}
.modal {
  width: 100%; max-width: 520px;
  background: var(--base-100);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.modal.wide { max-width: 600px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 0; }
.modal-title { font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-close {
  width: 32px; height: 32px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--base-200); color: var(--muted); display: grid; place-items: center;
}
.modal-close:hover { background: var(--base-300); }
.modal-close svg { width: 16px; height: 16px; }

/* Champs de formulaire */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .select {
  font-family: inherit; font-size: 14px; color: var(--base-content);
  padding: 10px 12px; border: 1px solid var(--base-300); border-radius: var(--r-btn);
  background: var(--base-100); outline: 0; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.mono { font-family: "JetBrains Mono", monospace; font-weight: 600; }

/* Bloc IA pré-rempli */
.ai-prefill {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: var(--r-btn);
  background: var(--primary-soft);
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent);
}
.ai-prefill svg { width: 16px; height: 16px; color: var(--primary); flex: none; margin-top: 1px; }
.ai-prefill .ai-txt { font-size: 12.5px; color: var(--primary-2); }
.ai-prefill .ai-txt b { font-weight: 600; }

/* Preuve à valider */
.proof {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border: 1px solid var(--base-300); border-radius: var(--r-btn);
  background: var(--base-100);
}
.proof-thumb {
  width: 42px; height: 42px; border-radius: 9px; flex: none;
  background: var(--base-200); color: var(--muted-2);
  display: grid; place-items: center;
}
.proof-thumb svg { width: 18px; height: 18px; }
.proof-main { flex: 1; min-width: 0; }
.proof-name { font-weight: 600; font-size: 13.5px; }
.proof-meta { font-size: 12px; color: var(--muted-2); }
.proof.is-validated { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; inset-block-end: 26px; inset-inline-end: 26px; z-index: 60; }
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--base-content); color: #fff;
  padding: 13px 18px; border-radius: var(--r-btn);
  box-shadow: var(--shadow-lift); font-size: 14px; font-weight: 500;
}
.toast svg { width: 18px; height: 18px; color: #6ee7b7; }
/* COP-128 — inline action link inside a toast (« … — Reçu n° X · Imprimer ») */
.toast-action {
  color: #fff; font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; white-space: nowrap;
}
.toast-action::before { content: '·'; margin-inline-end: 8px; text-decoration: none; display: inline-block; }
.toast-action:hover { opacity: .85; }

/* ---------- Dropdown ---------- */
.dropdown {
  background: var(--base-100);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lift);
  padding: 7px;
  min-width: 200px;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; font-size: 13.5px; color: var(--base-content);
  cursor: pointer; text-decoration: none;
}
.dropdown-item:hover { background: var(--base-200); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown-sep { height: 1px; background: var(--base-300); margin: 6px 4px; }

/* ---------- Divers ---------- */
.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.stat-line { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--base-300); }
.stat-line:first-child { border-top: 0; }
.hr-soft { height: 1px; background: var(--base-300); border: 0; margin: 0; }

[x-cloak] { display: none !important; }

/* ============================================================
   Couche d'INTERACTION (revue UX) — drawer, file de validation,
   états (vide / chargement / erreur), autocomplétion.
   Tokens Medina uniquement, aucune couleur / police nouvelle.
   Logique inline (inset-inline / margin-inline) => RTL-ready.
   ============================================================ */

/* ---------- Drawer (saisie : jamais en demi-page) ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20,30,33,.42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 51;
  width: 430px; max-width: 92vw;
  background: var(--base-100);
  box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
/* Tiroir plein écran sur mobile : une bande étroite à droite n'a pas de sens. */
@media (max-width: 560px) { .drawer { width: 100%; max-width: 100%; } }
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--base-300);
}
.drawer-title { font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.drawer-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.drawer-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 15px; overflow: auto; flex: 1; }
/* Pied = barre d'action figée (le corps défile au-dessus) : légère élévation pour
   qu'il se lise comme une barre, pas comme la suite du formulaire. */
.drawer-foot {
  padding: 16px 24px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--base-300); background: var(--base-100);
  box-shadow: 0 -8px 18px -14px rgba(20,30,33,.5);
}

/* ---------- File de validation (étend .proof) ---------- */
.qh-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.qh-ico svg { width: 18px; height: 18px; }
.queue-count {
  font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 13px;
  background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 9px;
}
.queue { display: flex; flex-direction: column; gap: 10px; }
.proof.is-error { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
/* Brouillon non attribué (COP-54) : teinte d'alerte douce — l'argent n'est pas validable tel quel. */
.proof.tofix-row { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.proof-thumb.tofix { background: var(--warning-soft); color: #b9770b; }
.proof-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--base-300); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- États vide ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 13px; padding: 48px 24px;
}
.empty-ico {
  width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.empty-ico svg { width: 26px; height: 26px; }
.empty-ico.sane { background: var(--success-soft); color: var(--success); }
.empty-title { font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; }
.empty-text { font-size: 13.5px; color: var(--muted); max-width: 44ch; }

/* ---------- Chargement (indicateur HTMX) ---------- */
/* htmx ajoute .htmx-request sur l'élément en vol : on bascule le spinner. */
.hx-spin { display: none; }
.htmx-request .hx-spin { display: inline-grid; }
.htmx-request .hx-idle { display: none; }
.proof.htmx-request { opacity: .6; }

/* COP-77 — bouton occupé pour une soumission NON-HTMX (socle data-loading, app.js) :
   label masqué, anneau dans la couleur du bouton (marche sur primaire ET secondaire). */
.btn.is-loading { position: relative; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; top: calc(50% - 8px); left: calc(50% - 8px);
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .65;
  animation: spin .7s linear infinite;
}

/* ---------- Erreur inline (champ) + bandeau ---------- */
.field-error { font-size: 12px; color: var(--error); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.field-error svg { width: 13px; height: 13px; }
.input.has-error, .select.has-error { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }
.banner-error {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r-btn);
  background: var(--error-soft); color: var(--error); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--error) 25%, transparent);
}
.banner-error svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.banner-success {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r-btn);
  background: var(--success-soft); color: var(--success); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--success) 25%, transparent);
}
.banner-success svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.banner-info {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r-btn);
  background: var(--primary-soft); color: var(--primary); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}
.banner-info svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* « Rôles & accès » (COP-119) : lignes du catalogue de rôles, lecture seule. */
.role-row { padding: 11px; border-radius: var(--r-btn); border: 1px solid var(--base-300); }
.role-row.role-current { border-color: var(--success); background: var(--success-soft); }
.role-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--base-200); color: var(--muted);
}
.role-ico svg { width: 17px; height: 17px; }
.role-row.role-current .role-ico { background: var(--base-100); color: var(--success); }

/* ---------- Autocomplétion payeur (> ~15 lots => recherche) ---------- */
.ac { position: relative; }
.ac-menu {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 8;
  background: var(--base-100); border: 1px solid var(--base-300);
  border-radius: var(--r-btn); box-shadow: var(--shadow-lift);
  padding: 6px; max-height: 248px; overflow: auto;
}
.ac-opt { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.ac-opt:hover, .ac-opt.active { background: var(--base-200); }
.ac-opt .lot-tag { margin-inline-start: auto; }
.ac-empty { padding: 12px 10px; font-size: 13px; color: var(--muted-2); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .proof-spin { animation-duration: .001ms; }
  .drawer { transition-duration: .001ms; }
}

/* ---------- RTL ---------- */
[dir="rtl"] body { font-family: "Schibsted Grotesk", "Tajawal", system-ui, sans-serif; }
[dir="rtl"] .chart-bar { border-radius: 6px 6px 3px 3px; }
[dir="rtl"] .num, [dir="rtl"] .mono, [dir="rtl"] .kpi-value, [dir="rtl"] .presc-date { direction: ltr; unicode-bidi: embed; }

/* Transitions Alpine */
.fade-enter-active, .fade-leave-active { transition: opacity .18s ease; }
[x-transition] { will-change: opacity, transform; }

@media (max-width: 980px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}


/* ============================================================
   AJOUTS V2 — menu mobile (tiroir + overlay) & accessibilité
   (design desktop inchangé : ne s'active qu'en <= 980px)
   ============================================================ */
.menu-toggle { display: none; }
.sidebar-overlay { display: none; }

/* ------------------------------------------------------------
   COP-112 — Mode rail (desktop) : plein ⇄ icônes seules.
   Concept purement desktop (≥981px) ; en ≤980px la sidebar est
   un tiroir off-canvas plein écran, jamais un rail. Une seule
   classe `.rail` sur l'<aside> pilote tout (état propre pour les
   badges en rail de COP-114). RTL-ready via propriétés logiques.
   ------------------------------------------------------------ */
@media (min-width: 981px) {
  .app-sidebar.rail { width: 64px; padding-inline: 8px; }
  /* La surface principale suit le rail (l'<aside> est un frère fixe). */
  body:has(.app-sidebar.rail) .app-main { margin-inline-start: 64px; }

  /* Marque : pastille conservée, texte masqué. */
  .app-sidebar.rail .brand { justify-content: center; padding-inline: 0; }
  .app-sidebar.rail .brand > div:last-child { display: none; }

  /* Sélecteur copro : pastille icône seule — logique 0/1/≥2 (COP-92) intacte. */
  .app-sidebar.rail .copro-pill { justify-content: center; padding-inline: 0; }
  .app-sidebar.rail .copro-pill > span:not(.copro-ico),
  .app-sidebar.rail .copro-pill > svg { display: none; }

  /* Items : centrés sur l'icône ; le libellé devient une info-bulle au survol
     (réutilise le <span> existant, déjà i18n — aucune lib, CSS pur). */
  .app-sidebar.rail .nav-item { justify-content: center; padding-inline: 0; }
  .app-sidebar.rail .nav-item > span:not(.nav-badge) {
    position: absolute;
    inset-inline-start: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: var(--base-content);
    color: var(--base-100);
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: 0 6px 20px -6px rgba(20,28,30,.4);
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity .12s;
  }
  .app-sidebar.rail .nav-item:hover > span:not(.nav-badge) { opacity: 1; }

  /* En rail (≤64px), le badge perd son texte et devient un POINT coloré posé sur le coin
     de l'icône — lisible à 64px, sans chiffre (COP-114). Compteur → point teal, alerte →
     point terracotta. Le <span> reste positionné côté fin de ligne via propriété logique
     (inset-inline-end), donc correct en RTL. Halo couleur sidebar pour détacher de l'icône. */
  .app-sidebar.rail .nav-badge {
    position: absolute;
    inset-inline-end: 12px;
    top: 9px;
    margin: 0;
    padding: 0;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    font-size: 0;          /* masque le chiffre / le pictogramme */
    line-height: 0;
    border: 2px solid var(--base-100);
    box-sizing: content-box;
  }
  .app-sidebar.rail .nav-badge--count { background: var(--primary); }
  .app-sidebar.rail .nav-badge--alert { background: var(--accent); }

  /* En-tête de section → simple séparateur (texte masqué, filet horizontal). */
  .app-sidebar.rail .nav-label {
    font-size: 0;
    line-height: 0;
    padding: 0;
    height: 0;
    margin: 10px 8px 4px;
    border-top: 1px solid var(--base-300);
  }

  /* En rail, la nav ne défile pas (contenu icônes seules ≈ 500px, tient partout) :
     overflow visible pour que les info-bulles flottantes (calc(100% + 10px)) ne soient
     pas tronquées par le conteneur de défilement. */
  .app-sidebar.rail .nav { overflow: visible; }

  /* Bouton bascule : pictogramme inversé en rail (« déployer »). */
  .app-sidebar.rail .rail-toggle svg { transform: rotate(180deg); }

  /* Groupe Configuration en rail (COP-113) : icônes seules ; le chevron de pli n'a plus de
     sens (le libellé devient l'info-bulle au survol comme tout nav-item). */
  .app-sidebar.rail .config-chevron { display: none; }
}

@media (max-width: 980px) {
  .menu-toggle { display: grid; }
  /* En tiroir mobile, le rail n'a pas de sens : largeur pleine, contenu complet. */
  .rail-toggle { display: none; }
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 0 60px -8px rgba(29,42,46,.4);
  }
  [dir="rtl"] .app-sidebar { transform: translateX(100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-inline-start: 0; }
  .app-content { padding: 20px 18px 56px; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(20,28,30,.45); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  }
  /* Mobile : les crumbs cèdent la place, mais la recherche personne RESTE accessible
     (c'est le geste « un propriétaire est devant moi ») — elle s'étire sur la largeur
     disponible ; le hint clavier et les méta du user-chip n'ont plus de sens au doigt. */
  .topbar .crumbs { display: none; }
  .topbar-right { flex: 1; min-width: 0; }
  .search-box { flex: 1; min-width: 0; }
  .search { width: 100%; }
  .search:focus-within { width: 100%; }
  .search kbd { display: none; }
  .user-meta { display: none; }
  .user-chip > svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   COP-84 — « même personne ? » : autocomplétion de reconnaissance + badge de lien
   sur le champ « Propriétaire » (drawer de mutation). Aucune couleur/police hors
   socle Medina ; RTL-ready (logical properties). La proposition n'apparaît QUE
   quand un nom connu est reconnu — sinon ces blocs restent vides/cachés.
--------------------------------------------------------------------------- */
.match-list {
  margin-top: 6px; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
}
.match-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; background: transparent; cursor: pointer;
  text-align: start; font: inherit; border-bottom: 1px solid var(--border);
}
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--primary-soft); }
.match-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--primary-soft); color: var(--primary);
}
.match-ico svg { width: 15px; height: 15px; }
.match-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.match-nom { font-weight: 600; font-size: 13.5px; }
.match-hint { font-size: 11.5px; color: var(--muted); }
.match-cta {
  font-size: 11.5px; font-weight: 600; color: var(--primary); flex: none;
  white-space: nowrap;
}
.link-badge {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
}
.link-badge svg { width: 15px; height: 15px; flex: none; }
.link-badge-text { flex: 1; font-size: 12.5px; color: var(--text); min-width: 0; }
.link-badge-undo {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 11.5px; font-weight: 600; color: var(--primary);
  text-decoration: underline; flex: none;
}
