/* Atelia · « Retour de l'équipe » (03/11/2026) : bouton de la barre du haut de la console, tiroir et calque de sélection de la capture
   (js/retour-equipe.js). Jetons existants seulement (ceux de css/tokens.css et ceux de .nc, css/nouvelle-console.css : le tiroir
   et le calque sont posés dans un conteneur .nc). À ne pas confondre avec css/retours.css (« Laisser un commentaire » des clients). */

/* Bouton : sur la rangée du haut, calé tout à droite (même place que .tb-retour de l'Espace Réseau, qui n'existe jamais dans la
   console). Texte « Retour » visible à partir de 600 px ; en dessous, l'icône seule en 40 × 40 (nom accessible gardé). */
.topbar .tb-retour-equipe { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; white-space: nowrap; }
.topbar .tb-pf:not([hidden]) + .tb-retour-equipe, .topbar .tb-retour + .tb-retour-equipe { margin-left: 8px; }
.topbar .tb-retour-equipe svg { width: 16px; height: 16px; flex: none; }
/* À 1 800 px et plus, la barre tient sur une seule rangée : le bouton passe après les contrôles, tout à droite (après la cloche). */
@media (min-width: 1800px) { .topbar .tb-retour-equipe { order: 1; margin-left: 0; } }
@media (max-width: 599px) {
  .topbar .tb-retour-equipe { order: 0; width: 40px; min-width: 40px; height: 40px; min-height: 40px; justify-content: center; padding-left: 8px; padding-right: 8px; }
  .topbar .tb-retour-equipe .tb-retour-equipe-txt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* Tiroir (App.NC.tiroir, z-index 901 : au-dessus de la fenêtre de l'aperçu d'un client). Caché pendant la capture, jamais fermé.
   Sa racine (le conteneur .nc posé sur <body>) couvre la fenêtre sans rien intercepter : elle a une vraie boîte (visible ou caché se
   lit dessus), et seuls le voile et le tiroir, ses enfants, reçoivent les clics. */
.re-tiroir { position: fixed; inset: 0; z-index: 901; pointer-events: none; }
.re-tiroir > * { pointer-events: auto; }
.re-tiroir[hidden], .re-selection [hidden] { display: none !important; }
.re-form { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.re-lbl { display: block; margin-top: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--c-gris); }
.re-lbl:first-child { margin-top: 0; }
.re-champ { display: block; width: 100%; box-sizing: border-box; border: 1.5px solid #CBD3E0; background: var(--c-carte); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--c-encre); }
.re-champ:focus { outline: none; border-color: #9DB5E8; box-shadow: 0 0 0 3px var(--c-bleu-doux); }
.re-texte { min-height: 120px; resize: vertical; line-height: 1.45; }
.re-compteur { font-size: 11.5px; color: var(--c-gris); text-align: right; }
.re-compteur.plein { color: var(--c-rouge-texte); font-weight: 700; }
.re-contexte { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 9px 10px; background: var(--c-zone); border: 1px solid var(--c-ligne); border-radius: 12px; overflow-wrap: anywhere; }
.re-contexte .re-lbl { margin-top: 0; }
.re-ctx-ligne { font-weight: 700; }
.re-ctx-detail { font-size: 12px; color: var(--c-encre2); }
.re-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.re-capture-zone:empty { display: none; }
.re-etat { margin: 0; color: var(--c-bleu-fonce); font-weight: 600; }
/* Captures jointes (cinq au plus), dans l'ordre : une seule prend toute la largeur, comme avant ; plusieurs se rangent en grille,
   vignettes plus basses. */
.re-captures { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.re-captures.plusieurs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.re-captures.plusieurs .re-capture img { max-height: 120px; }
.re-ajout-carte { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; color: var(--c-encre); overflow-wrap: anywhere; }
.re-note { margin: 0; font-size: 12px; color: var(--c-encre2); overflow-wrap: anywhere; }
/* Vignette de la capture : un damier clair derrière, pour qu'un extérieur transparent (sélection libre) se voie. */
.re-capture { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; background: var(--c-zone); border: 1px solid var(--c-ligne); border-radius: 12px; }
.re-capture img {
  display: block; max-width: 100%; max-height: 220px; margin: 0 auto; object-fit: contain; border: 1px solid var(--c-ligne); border-radius: 8px; background-color: #fff;
  background-image: linear-gradient(45deg, #E8ECF2 25%, transparent 25%, transparent 75%, #E8ECF2 75%), linear-gradient(45deg, #E8ECF2 25%, transparent 25%, transparent 75%, #E8ECF2 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.re-capture-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--c-encre2); overflow-wrap: anywhere; }
/* Message d'erreur : dans le pied du tiroir, toujours en vue, au-dessus du bouton. */
.re-erreur { flex: 1 0 100%; margin: 0; color: var(--c-rouge-texte); font-weight: 600; overflow-wrap: anywhere; }

/* Calque de sélection : l'image figée en plein écran, au-dessus de tout (même du tiroir caché). Le tracé (SVG) se dit en pixels de
   l'image et se met à l'échelle de l'affichage avec elle. */
.re-selection { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: rgba(10, 15, 26, .94); color: #fff; -webkit-user-select: none; user-select: none; }
.re-sel-barre { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: #16243F; box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.re-sel-aide { min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.re-sel-scene { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; touch-action: none; }
.re-sel-cadre { position: relative; display: block; max-width: 100%; line-height: 0; box-shadow: 0 8px 32px rgba(0, 0, 0, .5); }
.re-selection canvas { display: block; width: auto; height: auto; max-width: calc(100vw - 24px); max-height: calc(100vh - 110px); background: #fff; cursor: crosshair; }
.re-selection[data-re-mode="ecran"] canvas { cursor: default; }
.re-sel-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.re-sel-ombre { fill: rgba(8, 12, 22, .55); fill-rule: evenodd; }
.re-sel-forme { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 7 5; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .9)); }
/* Calque d'annotation (08/11) : la barre (outils, couleurs, actions), puis trois toiles superposées de même taille : l'image, dont le script
   fixe la taille d'affichage, les formes gardées et la forme en cours. Seule la dernière reçoit le pointeur. */
.re-capture-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.re-ann-barre { gap: 6px 8px; }
.re-ann-groupe { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Préfixe .re-annotation : sans lui, .nc-btn.nc-g (même poids, chargé après) reprendrait le fond et le texte deviendrait blanc sur blanc. */
.re-annotation .re-ann-outil[aria-pressed="true"] { background: #16243F; color: #fff; border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.re-ann-couleur { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); cursor: pointer; }
.re-ann-couleur[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.re-annotation .re-ann-couleur:focus-visible, .re-annotation .re-ann-outil:focus-visible { outline: 2px solid #FFD400; outline-offset: 2px; }
.re-ann-couleur[data-re-ann-couleur="rouge"] { background: #E11D2E; }
.re-ann-couleur[data-re-ann-couleur="jaune"] { background: #FFD400; }
.re-ann-couleur[data-re-ann-couleur="bleu"] { background: #1D6BF3; }
.re-ann-couleur[data-re-ann-couleur="vert"] { background: #16A34A; }
.re-selection.re-annotation canvas { max-width: none; max-height: none; }
.re-annotation .re-ann-calque { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: transparent; pointer-events: none; }
.re-annotation .re-ann-vif { pointer-events: auto; cursor: crosshair; touch-action: none; }
/* Outil « Texte » (12/11) : la taille choisie entre « A− » et « A+ » ; les couleurs grisées (le texte n'en a qu'une) ; la zone de saisie posée
   sur l'image, sans bord ni marge qui la décaleraient du texte tracé (police, taille, hauteur de ligne et couleur : posées par le script). */
.re-ann-taille { min-width: 44px; text-align: center; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.re-ann-couleur:disabled { opacity: .35; cursor: not-allowed; }
.re-annotation[data-re-ann-outil-choisi="texte"] .re-ann-vif { cursor: text; }
.re-annotation .re-ann-texte { position: absolute; z-index: 1; box-sizing: content-box; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  outline: 2px dashed #1D6BF3; outline-offset: 2px; resize: none; overflow: hidden; white-space: pre; min-width: 1px; letter-spacing: normal; text-transform: none; caret-color: currentColor; }
@media (max-width: 640px) {
  .re-selection canvas { max-height: calc(100vh - 170px); }
  .re-sel-barre { padding: 8px 12px; }
}

/* Dialogue « Abandonner la saisie ? » : posé DANS le tiroir (fiche comprise), donc au-dessus de lui ; le reste du tiroir est rendu inerte
   par le script (js/retour-equipe.js, garderFermeture). */
.nc-tiroir-d > .re-confirm { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(22, 36, 63, .45); }
.re-confirm-carte { display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%); box-sizing: border-box; padding: 16px; background: var(--c-carte); border: 1px solid var(--c-ligne); border-radius: 14px; box-shadow: 0 12px 36px rgba(22, 36, 63, .35); }
.re-confirm-titre { font-size: 15px; color: var(--c-encre); }
.re-confirm-texte { margin: 0; color: var(--c-encre2); line-height: 1.4; overflow-wrap: anywhere; }
.re-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 370 px et téléphones : champs à 16 px (Safari sur iPhone zoome la page au-dessous), boutons de 38 px de haut au toucher, comme la fiche
   (css/retours-equipe.css). Le tiroir de saisie, son dialogue et le calque de sélection n'ont que des classes .re-. */
@media (max-width: 600px) {
  .re-tiroir .re-champ { font-size: 16px; }
  .re-tiroir .nc-btn, .re-selection .nc-btn { min-height: 38px; }
  .re-ann-couleur { width: 38px; height: 38px; }
  .re-tiroir .re-capture-info .nc-btn { padding-left: 12px; padding-right: 12px; }
}
