/* ============================================================================
   patient-selecteur.css — le sélecteur de patient partagé (patient-selecteur.js)
   Préfixe .psel-* : classes PROPRES à ce composant (CLAUDE.md règle 2), aucune
   classe partagée redéfinie. Pas de :has() (règle 3).
   🔴 La liste est DANS LE FLUX (pas de position:absolute) : elle pousse la suite
      de la fenêtre au lieu d'être coupée par son overflow ou posée sur ses boutons.
   🔴 Aucun rouge pour un état normal : le rouge dit une erreur.
   ============================================================================ */
.psel { font-family: var(--sans); }
.psel-q {
  width: 100%; box-sizing: border-box; font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--sans);
}
.psel-q:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-mist); }
.psel-liste {
  margin-top: 6px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(60, 40, 25, .12); max-height: 280px; overflow-y: auto;
}
.psel-liste[hidden] { display: none; }
.psel-option {
  padding: 10px 14px; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule-soft); font-size: 14px; color: var(--ink);
}
.psel-option:last-child { border-bottom: none; }
.psel-option:hover, .psel-option.psel-actif { background: var(--ivory-soft); }
.psel-nom { font-weight: 500; color: var(--ink); }
.psel-repere { color: var(--ink-mute); font-size: 12.5px; font-style: italic; }
.psel-etiquette { font-size: 11.5px; color: var(--sage-deep); background: var(--sage-mist); border-radius: 99px; padding: 1px 8px; }
.psel-vide { padding: 10px 14px; color: var(--ink-mute); font-size: 13px; }
.psel-option.psel-creer { background: var(--sage-mist); color: var(--sage-deep); font-size: 13px; }
.psel-option.psel-creer:hover, .psel-option.psel-creer.psel-actif { background: var(--sage-bg); }
.psel-option.psel-creer b { font-weight: 700; }
.psel-plus { font-weight: 700; }

.psel-carte {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 14px; border: 1px solid var(--sage); border-radius: 8px; background: var(--sage-mist);
}
.psel-carte[hidden] { display: none; }
.psel-carte-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.psel-carte-nom { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.psel-carte-repere { font-size: 12.5px; color: var(--ink-soft); }
.psel-changer, .psel-btn {
  font-family: var(--sans); font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); white-space: nowrap;
}
.psel-changer:hover, .psel-btn:hover { background: var(--ivory-soft); }
.psel-btn-principal { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.psel-btn-principal:hover { background: var(--ink-soft); }
.psel-btn:disabled { opacity: .45; cursor: not-allowed; }

.psel-creation { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; background: var(--ivory-soft, var(--paper)); }
.psel-creation[hidden] { display: none; }
.psel-creation-titre { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; color: var(--ink); }
.psel-ligne { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.psel-champ { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; }
.psel-champ label { font-size: 12px; color: var(--ink-soft); font-weight: 500; text-transform: none; letter-spacing: 0; }
.psel-champ input {
  font-family: var(--sans); font-size: 14px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper); color: var(--ink); box-sizing: border-box; width: 100%;
}
.psel-champ input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-mist); }
.psel-req { color: var(--ink-mute); }
.psel-note { font-size: 12px; color: var(--ink-mute); margin: 0 0 10px; line-height: 1.45; }
.psel-alerte { font-size: 12.5px; color: var(--ink); background: var(--terra-mist); border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; }
.psel-alerte[hidden] { display: none; }
.psel-doublon { border: 1px solid var(--sage); background: var(--sage-mist); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.psel-doublon[hidden] { display: none; }
.psel-doublon-titre { font-size: 12.5px; color: var(--ink); margin: 0 0 8px; }
.psel-doublon-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.psel-doublon-autre { margin-top: 8px; text-align: right; }
.psel-creation-actions { display: flex; justify-content: flex-end; gap: 8px; }
