/* Équipe (V24, registre §98) — partagé par le dépôt et la page du salarié. */
.team-me-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid #e3e9ef; border-radius: 50%; background: var(--p-blanc); cursor: pointer; overflow: hidden; }
.team-me-button .team-avatar { width: 100%; height: 100%; border-radius: 50%; }
.team-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--p-marine-texte); color: var(--p-blanc); font-weight: 700; font-size: 16px; }
.team-avatar-large { width: 72px; height: 72px; font-size: 24px; }
.team-dialog { box-sizing: border-box; width: calc(100vw - 16px); max-width: 560px; max-height: calc(100dvh - 16px); margin: auto; padding: 0; overflow-x: hidden; border: 0; border-radius: 18px; background: #f4f7fa; color: var(--p-encre); }
.team-dialog::backdrop { background: rgba(10, 25, 41, .55); }
.team-panel { box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; font: 16px/1.4 var(--police, system-ui, -apple-system, "Segoe UI", sans-serif); }  /* §293 : la police de l'application partout (Inter imposée ici, critique v0.286.0, D5) */
.team-head { display: flex; align-items: center; justify-content: space-between; }
.team-head h2 { margin: 0; font-size: 22px; color: var(--p-marine-texte); }
.team-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--p-2f6fb0); }
.team-close { width: 40px; height: 40px; border: 1px solid var(--p-bordure); border-radius: 50%; background: var(--p-blanc); font-size: 22px; cursor: pointer; }
.team-me { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--p-blanc); }
.team-me-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.team-me-photo { display: flex; gap: 12px; }
.team-link { padding: 0; border: 0; background: none; color: var(--p-2f6fb0); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.team-phone { display: grid; gap: 4px; font-size: 13px; color: var(--p-gris-texte-2); }
.team-phone-row { display: flex; gap: 8px; min-width: 0; }
.team-phone { min-width: 0; }
.team-phone-row input { width: 0; }
.team-save { flex: none; }
.team-phone-row input, .team-panel input[type="search"] { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--p-bordure); border-radius: 10px; background: var(--p-blanc); color: var(--p-encre); font: inherit; font-size: 16px; }
.team-save { min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--p-marine-texte); color: var(--p-blanc); font: inherit; font-weight: 700; cursor: pointer; }
.team-message { margin: 0; padding: 8px 12px; border-radius: 10px; background: #e6f4ec; color: #1d5f3a; }
/* V205 (recette sur un vrai iPhone, 25/11/2026) : une ERREUR posée dans un .team-message (« Micro refusé… », « Dites-la ou écrivez-la… ») restait verte, comme un succès : equipe.css, chargée après
   salarie.css sur les pages du livreur et du collaborateur, et seule sur celle du dépôt, ne connaissait pas .employee-error. Rouge, comme partout ailleurs. */
.team-message.employee-error { background: var(--red-soft, #fdeae8); color: var(--red, #8a1c17); font-weight: 600; }
.team-list { display: grid; gap: 8px; }
.team-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--p-blanc); }
.team-who { display: grid; min-width: 0; }
.team-who small { color: var(--p-gris-texte-2); }
.team-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.team-action { flex: 1; min-width: 80px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #c9d6e2; border-radius: 10px; color: var(--p-marine-texte); font-weight: 700; text-decoration: none; }
.team-action[href^="tel:"] { background: var(--p-marine-texte); border-color: var(--p-marine-texte); color: var(--p-blanc); }
.team-empty { margin: 0; color: var(--p-gris-texte-2); }
@media (min-width: 700px) { .team-card { grid-template-columns: auto 1fr auto; } .team-actions { grid-column: auto; flex-wrap: nowrap; } }
@media (prefers-color-scheme: dark) {
  .team-dialog { background: var(--p-0b1826); color: var(--p-brume); }
  .team-me, .team-card, .team-close, .team-phone-row input, .team-panel input[type="search"] { background: var(--p-marine-nuit); color: var(--p-brume); border-color: var(--p-ardoise); }
  .team-head h2, .team-action { color: #cfe3f5; }
  .team-who small, .team-phone, .team-empty { color: var(--p-9db0c0); }
  .team-action[href^="tel:"] { background: var(--p-2f6fb0); border-color: var(--p-2f6fb0); color: var(--p-blanc); }
  .team-eyebrow, .team-link { color: var(--p-acier-clair); }  /* v0.288.0 : 3,0 à 3,4:1 avant (bleu sur fond nuit) */
}

/* V26 — discussion d'un dossier (§100), même fenêtre que l'équipe. */
.thread-list { display: grid; gap: 8px; max-height: min(55dvh, 520px); overflow-y: auto; padding: 4px 2px; }
.thread-message { max-width: 85%; padding: 10px 12px; border-radius: 14px; background: var(--p-blanc); }
.thread-message.mine { justify-self: end; background: #dcebf8; }
.thread-message header { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.thread-message header small { color: var(--p-gris-texte-2); }
/* v0.173.1 (§169) : le titre de la discussion (le chantier) et le nom de l'auteur viennent d'ailleurs : un mot très long sans espace
   passe à la ligne au lieu d'élargir la fenêtre. Règles limitées à cette fenêtre (.thread-dialog), partagée par le dépôt, le salarié et le chauffeur. */
.thread-dialog .team-head > div { min-width: 0; }
.thread-dialog :is(.team-head h2, .thread-message header) { overflow-wrap: anywhere; }
.thread-dialog .team-close { flex: none; }  /* à côté d'un titre long, « × » garde ses 40 px (mesuré : 37 px avec un titre de 33 caractères, 27 px avec un mot très long) */
.thread-message p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-message img { display: block; margin-top: 6px; max-width: 100%; max-height: 240px; border-radius: 10px; }
.thread-preview { max-height: 120px; max-width: 160px; border-radius: 10px; }
.thread-compose { display: grid; gap: 8px; }
.thread-compose textarea { min-height: 56px; padding: 10px 12px; border: 1px solid var(--p-bordure); border-radius: 10px; font: inherit; font-size: 16px; resize: vertical; }
.thread-compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* V29 — message vocal dans les discussions (§104). */
.thread-compose-tools { display: flex; gap: 14px; align-items: center; }
.thread-message audio, .thread-voice-preview audio { display: block; width: 100%; max-width: 280px; height: 40px; margin-top: 4px; }
.thread-voice-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.thread-recording { color: var(--p-rouge-texte); font-weight: 700; }
.voice-meter { display: flex; align-items: center; gap: 10px; }  /* V30 : niveau du micro pendant l'enregistrement */
.voice-meter-track { flex: 1; height: 40px; overflow: hidden; }
/* 22/11/2026 (demande d'Eduardo) : l'onde du micro — des barres verticales qui défilent, de simples points en silence — partout où l'on enregistre. */
.voice-meter-wave { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.voice-meter-wave i { display: block; flex: 0 0 4px; width: 4px; height: 8%; min-height: 4px; border-radius: 999px; background: #1f2d3d; transition: height .1s linear; }
.voice-meter-time { font-variant-numeric: tabular-nums; font-size: 14px; color: #4a5b6c; }
.team-save:disabled { opacity: .5; cursor: not-allowed; }
.thread-recording-label { margin: 0; color: var(--p-rouge-texte); font-weight: 600; font-size: 14px; }
.thread-error { background: #fdecea; color: #a3261b; }
.thread-button { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-color-scheme: dark) {
  .thread-message { background: var(--p-marine-nuit); color: var(--p-brume); }
  .thread-message.mine { background: #1d3a57; }
  .thread-message header small { color: var(--p-9db0c0); }
  .thread-compose textarea { background: var(--p-marine-nuit); color: var(--p-brume); border-color: var(--p-ardoise); }
}
/* V52 : le petit mot sous le titre — l'annuaire n'est pas une liste de comptes, c'est l'équipe. */
.team-hello { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* V84 (§197) — la discussion façon messagerie, sur la maquette d'Eduardo : bulles avec une pointe, les miennes à droite en jaune
   pâle (celles des autres en bleu-gris), l'heure sur la ligne du nom, trois boutons à icône, plein écran sur le téléphone. */
.thread-dialog .team-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.thread-dialog .team-head > div { flex: 1; }
.thread-dialog .team-head h2 { margin: 0; }
.thread-sujet { margin: 2px 0 0; color: var(--p-gris-texte-2); font-size: 14px; overflow-wrap: anywhere; }
.thread-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thread-dialog .team-head > .thread-icon { width: 30px; height: 30px; color: var(--p-marine-texte); }
.thread-retour { display: none; font-size: 30px; line-height: 1; }
.thread-list { gap: 12px; padding: 4px 4px 8px; align-content: start; }
.thread-message { position: relative; max-width: 85%; padding: 10px 14px; border-radius: 16px; background: #e8eef5; color: var(--p-marine-texte); }
.thread-message::after { content: ""; position: absolute; bottom: -6px; left: 10px; border: 8px solid transparent; border-top-color: #e8eef5; border-bottom: 0; }
.thread-message.mine { justify-self: end; background: var(--p-ambre-clair); }
.thread-message.mine::after { left: auto; right: 10px; border-top-color: var(--p-ambre-clair); }
.thread-message header { display: flex; gap: 6px 8px; align-items: baseline; flex-wrap: wrap; }
.thread-message header strong { color: var(--p-marine-texte); }
.thread-message header small { color: var(--p-gris-texte-2); font-size: 13px; }
.thread-message header time { margin-left: auto; color: var(--p-gris-texte-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.thread-attente { display: flex; align-items: center; gap: 6px; margin: 8px 0 0 !important; padding: 4px 10px; border-radius: 999px; background: var(--p-bleu-pale); color: var(--p-acier-fonce); font-size: 13px; font-weight: 700; width: fit-content; }
.thread-attente .thread-icon { width: 16px; height: 16px; }
.thread-attente.thread-refus { background: #fdecea; color: #a3261b; }
.thread-pending { opacity: .92; }
.thread-compose { gap: 10px; }
.thread-compose textarea { min-height: 48px; resize: none; border-radius: 12px; }
.thread-compose-actions { display: flex; flex-wrap: wrap; gap: 8px; }  /* si la place manque (polices plus larges), « Envoyer » passe à la ligne au lieu de déborder */
.thread-tool, .thread-send { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.thread-tool { border: 1.5px solid #9fb3c8; background: var(--p-blanc); color: var(--p-marine-texte); }
.thread-tool.thread-recording { border-color: var(--p-rouge-texte); color: var(--p-rouge-texte); }
.thread-tool { flex: 0 0 auto; white-space: nowrap; }
.thread-send { flex: 1 0 auto; white-space: nowrap; }
.thread-tool:focus-visible, .thread-send:focus-visible { outline: 3px solid var(--p-acier-fonce); outline-offset: 2px; }
@media (max-width: 700px) {
  .thread-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) 0 var(--bas-sur, env(safe-area-inset-bottom, 0px)); }
  .thread-dialog .team-panel { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; }
  .thread-dialog .thread-list { flex: 1; max-height: none; }
  .thread-retour { display: inline; }
  .thread-fermer { display: none; }
  .thread-tool, .thread-send { padding: 0 10px; gap: 4px; font-size: 15px; white-space: nowrap; }
  .thread-tool .thread-icon, .thread-send .thread-icon { width: 20px; height: 20px; }
}
@media (prefers-color-scheme: dark) {
  .thread-message { background: #1a2f45; color: var(--p-brume); }
  .thread-message::after { border-top-color: #1a2f45; }
  .thread-message.mine { background: #4a3b12; }
  .thread-message.mine::after { border-top-color: #4a3b12; }
  .thread-message header strong { color: var(--p-brume); }
  .thread-message header time, .thread-sujet { color: var(--p-9db0c0); }
  .thread-dialog .team-head > .thread-icon { color: #cfe3f5; }
  .thread-tool { background: var(--p-marine-nuit); color: var(--p-brume); border-color: var(--p-ardoise); }
}

/* V89 (§206) : la boîte « Messages » (dépôt, livreur, salarié) et « Vu par… » sous mes messages. */
.conversations { display: grid; border: 1px solid var(--p-bordure); border-radius: 16px; background: var(--p-blanc); overflow: hidden; }
.conversation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 0; border-bottom: 1px solid #e4ebf1; background: none; color: var(--p-marine-texte); font: inherit; text-align: left; cursor: pointer; }
.conversation:last-child { border-bottom: 0; }
.conversation:hover { background: var(--p-bleu-pale); }
.conversation:focus-visible { outline: 3px solid var(--p-acier-fonce); outline-offset: -3px; }
.conv-icone { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--p-bleu-pale); color: var(--p-acier-fonce); }
.conv-texte { display: grid; gap: 2px; min-width: 0; }
.conv-texte strong { overflow-wrap: anywhere; }
.conv-texte small { color: var(--p-gris-texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation.non-lue .conv-texte strong, .conversation.non-lue .conv-texte small { color: var(--p-marine-texte); font-weight: 700; }
.conv-cote { display: grid; justify-items: end; gap: 4px; font-size: 13px; color: var(--p-gris-texte-2); }
.conv-non-lus { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--p-acier-fonce); color: var(--p-blanc); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.thread-vu { margin: 4px 0 0 !important; font-size: 12px; color: var(--p-gris-texte-2); text-align: right; }
.thread-vu.vu { color: var(--p-acier-fonce); font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .conversations { background: var(--p-marine-nuit); border-color: var(--p-ardoise); }
  .conversation { color: var(--p-brume); border-color: var(--p-ardoise); }
  .conversation:hover, .conv-icone { background: #1a2f45; }
  .conv-texte small, .conv-cote, .thread-vu { color: var(--p-9db0c0); }
  .conversation.non-lue .conv-texte strong, .conversation.non-lue .conv-texte small { color: var(--p-brume); }
  .thread-vu.vu { color: var(--p-acier-clair); }
}
/* La boîte en cartes séparées, une étiquette et une icône par genre de dossier, un liseré bleu sur ce qui n'est pas lu (proposition d'Eduardo, 12/11). */
.conversations { gap: 12px; border: 0; background: none; overflow: visible; }
.conversation { border: 1.5px solid var(--p-bordure); border-radius: 16px; background: var(--p-blanc); padding: 14px; min-height: 76px; }
.conversation:last-child { border-bottom: 1.5px solid var(--p-bordure); }
.conversation.non-lue { border-color: var(--p-acier-fonce); box-shadow: 0 0 0 1px var(--p-acier-fonce) inset; }
.conv-icone { width: 52px; height: 52px; }
.conv-icone .thread-icon { width: 28px; height: 28px; }
.conv-genre { justify-self: start; padding: 2px 10px; border-radius: 999px; background: #dbe9f6; color: var(--p-marine-texte); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.conv-texte strong { font-size: 18px; }
@media (prefers-color-scheme: dark) {
  .conversation { background: var(--p-marine-nuit); border-color: var(--p-ardoise); }
  .conversation.non-lue { border-color: var(--p-acier-clair); box-shadow: 0 0 0 1px var(--p-acier-clair) inset; }
  .conv-genre { background: #1d3a57; color: var(--p-brume); }
}

/* V134 (§277) : la boîte rangée — « À traiter », « En attente », « Terminé ». */
.conv-groupes { display: grid; gap: 22px; }
.conv-groupe { display: grid; gap: 10px; min-width: 0; }
.conv-groupe-titre { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.conv-compte { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: #dbe9f6; color: var(--p-marine-texte); font-size: 14px; font-weight: 800; display: inline-grid; place-items: center; }
.conv-a_traiter .conv-compte { background: var(--p-acier-fonce); color: var(--p-blanc); }
.conv-termine .conversation { opacity: .8; }
.conv-suite { font-size: 14px; font-weight: 700; color: var(--p-acier-fonce); overflow-wrap: anywhere; }
.conv-carte { display: grid; gap: 4px; min-width: 0; }
.conv-ranger { justify-self: end; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--p-acier-fonce); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (prefers-color-scheme: dark) {
  .conv-compte { background: #1d3a57; color: var(--p-brume); }
  .conv-suite, .conv-ranger { color: var(--p-acier-clair); }
}

/* V135 (§278) : « Faire une remarque » — la fenêtre, la pastille « Remarque » et le filtre de Messages. */
.conv-filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.conv-filtre { min-height: 44px; padding: 0 16px; border: 1px solid #b9cde0; border-radius: 999px; background: var(--p-blanc); color: var(--p-marine-texte); font: inherit; font-weight: 700; cursor: pointer; }
.conv-filtre.active { background: var(--p-acier-fonce); border-color: var(--p-acier-fonce); color: var(--p-blanc); }
.conv-remarque .conv-genre { background: #fde8c8; color: #6b3d00; }
.tache-remarque { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #fde8c8; color: #6b3d00; font-size: 13px; font-weight: 800; }
.remark-panel { display: grid; gap: 12px; }
.remark-panel textarea { width: 100%; min-height: 96px; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #b9cde0; border-radius: 10px; box-sizing: border-box; }
.remark-aide { margin: 0; }
.remark-contexte { margin: 0; padding: 10px 12px; border-radius: 10px; background: #eef4fa; color: var(--p-marine-texte); font-size: 14px; overflow-wrap: anywhere; }
.remark-photo { display: grid; gap: 4px; justify-items: start; }
.remark-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.remark-actions .team-link { min-height: 44px; }
@media (prefers-color-scheme: dark) {
  .conv-filtre { background: var(--p-marine-nuit); border-color: var(--p-ardoise); color: var(--p-brume); }
  .conv-filtre.active { background: var(--p-acier-clair); border-color: var(--p-acier-clair); color: #0b1825; }
  .conv-remarque .conv-genre { background: #5a3a10; color: #fde8c8; }
  .remark-contexte { background: #1d3a57; color: var(--p-brume); }
  .remark-panel textarea { background: var(--p-marine-nuit); color: var(--p-brume); border-color: var(--p-ardoise); }
}

/* V104 (§236, §237) : un seul en-tête LFC, pour tous les profils et toutes les tailles d'écran — le logo en couleurs sur une
   pastille blanche arrondie (choix d'Eduardo du 13/11), dans la barre latérale, la barre du haut du téléphone, l'espace
   collaborateur et le livreur. Le fichier est recadré sur le logo, sans le trait ni le carré QR de droite. */
.lfc-logo { display: block; flex: none; width: 112px; height: 65px; border-radius: 12px; background: var(--p-blanc) url("assets/logo-lfc.png") no-repeat 4px -10px / 152px auto; }
/* La barre du haut n'est marine que sur téléphone (design-system.css) : sur ordinateur, son logo reste caché (la barre latérale le porte). */
.topbar-logo.lfc-logo { display: none; }
@media (max-width: 700px) { .topbar-logo.lfc-logo { display: block; } }
.sidebar .brand { gap: 12px; align-items: center; }
.sidebar .brand-name { color: var(--p-blanc); font-size: 15px; font-weight: 600; letter-spacing: .04em; }

/* Conseil F28 (§240) : une nouvelle version attend la fin d'une saisie ; l'annonce reste en haut, avec « Charger maintenant ». */
.version-annonce { position: fixed; z-index: 60; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 12px; background: var(--p-marine-texte); color: var(--p-blanc); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-size: 15px; line-height: 1.35; }
.version-annonce span { flex: 1 1 220px; }
.version-annonce .button { flex: none; min-height: 48px; padding: 0 16px; background: var(--p-blanc); color: var(--p-marine-texte); border: 1px solid var(--p-blanc); border-radius: 10px; font-weight: 700; font-size: 15px; }
@media (pointer: coarse) { .version-annonce .button { min-height: 56px; } }
/* v0.280.2 : la note vocale dans une bulle garde la largeur de son lecteur (le bouton de lecture et la durée se voient) ; l’avis « Message envoyé » après la fermeture de la discussion. */
.thread-message audio, .thread-voice-preview audio { min-width: min(240px, 60vw); }
.fil-avis { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bas-sur, env(safe-area-inset-bottom, 0px)) + 88px); z-index: 1000; margin: 0; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px; background: var(--p-102a43); color: var(--p-blanc); font-weight: 600; box-shadow: 0 10px 30px rgba(16,42,67,.25); overflow-wrap: anywhere; }
.fil-avis[hidden] { display: none; }
