:root {
  /* ---- Identité GCBTP — couleurs du logo ----
     Primaire = bleu marine du logo (boutons d'action, send, bulles miennes…)
     Accent   = doré du logo      (focus, badges, hover, états actifs)
     Note : les anciens tokens --orange* sont conservés en alias pour
     éviter de casser tous les sélecteurs existants — ils pointent
     maintenant vers le doré. */
  --blue:        #1f4e8b;       /* bleu marine vif (logo) */
  --blue-dark:   #0f2c52;       /* bleu profond (logo) */
  --blue-darker: #0a1d36;
  --blue-bright: #2196f3;       /* bleu lumineux des barres du logo */
  --blue-soft:   #e8eff8;
  --gold:        #f0b441;       /* doré du logo (chaleureux) */
  --gold-dark:   #c89020;
  --gold-soft:   #fff5dc;

  /* Aliases legacy : --orange* = --gold* pour ne pas casser les ~120 usages */
  --orange:      var(--gold);
  --orange-dark: var(--gold-dark);
  --orange-soft: var(--gold-soft);

  --gray-50:  #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #868e96;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-900: #212529;
  --green:      #2f9e44;
  --green-soft: #e6f7ea;
  --yellow:     #f59f00;
  --yellow-soft:#fff8e6;
  --red:        #e03131;
  --red-soft:   #ffe8e8;

  /* ---- Typographie ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  14px;
  --text-md:    15px;
  --text-lg:    17px;
  --text-xl:    20px;
  --text-2xl:   24px;
  --text-3xl:   30px;
  --fw-normal:    400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --leading-tight: 1.25;
  --leading-snug:  1.4;
  --leading-base:  1.55;

  /* ---- Espacement (échelle 4px) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* ---- Rayons ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;
  --radius: var(--r-md);  /* legacy */

  /* ---- Ombres (plus douces, multi-layer) ---- */
  --shadow-xs: 0 1px 2px rgba(15, 37, 66, .04);
  --shadow-sm: 0 2px 4px rgba(15, 37, 66, .05), 0 1px 2px rgba(15, 37, 66, .03);
  --shadow:    0 4px 12px rgba(15, 37, 66, .08), 0 2px 4px rgba(15, 37, 66, .04);
  --shadow-md: 0 8px 20px rgba(15, 37, 66, .10), 0 3px 6px rgba(15, 37, 66, .05);
  --shadow-lg: 0 16px 40px rgba(15, 37, 66, .14), 0 6px 12px rgba(15, 37, 66, .06);
  --shadow-blue:   0 4px 14px rgba(31, 78, 139, .32);
  --shadow-gold:   0 4px 14px rgba(240, 180, 65, .42);
  --shadow-orange: var(--shadow-blue); /* alias legacy → bleu marine */

  /* ---- Transitions ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 280ms;

  /* ---- Focus ring (accessibilité) — doré pour visibilité haute ---- */
  --ring: 0 0 0 3px rgba(240, 180, 65, .55);
  --ring-offset: 2px;
}

/* Focus visible global — ne s'affiche qu'au clavier */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* Respect du choix utilisateur "moins de mouvement" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Respecter l'attribut HTML [hidden] même sur les éléments avec display: flex */
[hidden] { display: none !important; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: var(--text-base); }

/* ---- Icônes Lucide : taille + alignement consistants ---- */
[data-lucide] { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
button [data-lucide], a [data-lucide] { display: inline-block; vertical-align: middle; }

/* ---- Status dots (remplacent les emojis 🟢/🔴) ---- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  vertical-align: middle;
  margin-right: 4px;
}
.status-dot-on  { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 158, 68, .18); }
.status-dot-off { background: var(--red);   box-shadow: 0 0 0 3px rgba(224, 49, 49, .18); }

/* ---- Icônes de type de fichier (Lucide colorés selon catégorie) ---- */
.file-type-icon { width: 28px; height: 28px; stroke-width: 1.75; }
.fi-pdf { color: #d6336c; }
.fi-doc { color: #1971c2; }
.fi-xls { color: var(--green); }
.fi-ppt { color: #f76707; }
.fi-zip { color: var(--gray-700); }
.fi-vid { color: #7048e8; }
.fi-aud { color: #1098ad; }

/* =========================================================
   AUTH (login page)
   ========================================================= */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.auth-back {
  position: absolute;
  top: 16px; left: 20px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 14px;
}
.auth-back:hover { color: var(--orange); }
.auth-logo {
  display: block;
  height: 64px;
  margin: 0 auto 16px;
}
.auth-card h1 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--blue-dark);
}
.auth-sub {
  text-align: center;
  color: var(--gray-500);
  margin: 0 0 24px;
  font-size: 14px;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray-700); }
.auth-form input {
  padding: 11px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color .15s;
}
.auth-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 180, 65, .25); }
.auth-form button {
  margin-top: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: var(--text-md);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-blue);
  transition: filter var(--t-fast), box-shadow var(--t-fast);
}
.auth-form button:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 6px 18px rgba(31, 78, 139, .42); }
.auth-form button:disabled { opacity: .6; cursor: wait; }
.auth-error {
  color: var(--red);
  font-size: 14px;
  margin: 0;
  padding: 10px 12px;
  background: #fff5f5;
  border-radius: 6px;
}
.auth-hint {
  text-align: center;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}

/* =========================================================
   APP (dashboard)
   ========================================================= */
.app-body { background: var(--gray-100); min-height: 100vh; }

.app-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--s-3) var(--s-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
}
.brand img { height: 36px; }
.app-user { display: flex; align-items: center; gap: var(--s-3); font-size: var(--text-sm); color: var(--gray-700); }
.header-avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
  box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(255, 255, 255, .9);
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-avatar:hover { transform: translateY(-1px) scale(1.05); box-shadow: var(--shadow-md), inset 0 0 0 2px rgba(255, 255, 255, .9); }

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: #fff;
  border-radius: var(--r-md);
  padding: var(--s-5) var(--s-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  border-left: 4px solid var(--gray-300);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card.stat-todo     { border-left-color: var(--gray-500); }
.stat-card.stat-progress { border-left-color: var(--yellow); }
.stat-card.stat-done     { border-left-color: var(--green); }
.stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: var(--fw-semibold);
}
.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -.02em;
}

/* Panels */
.panel {
  background: #fff;
  border-radius: var(--r-md);
  padding: var(--s-6) var(--s-6);
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0 0 var(--s-4);
  font-size: var(--text-lg);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.select {
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-sm);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 10px center;
  background-size: 14px;
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.select:hover { border-color: var(--gray-400); }
.select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 119, 34, .18); }

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  background: #fff;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input::placeholder { color: var(--gray-500); }
.search-input:hover { border-color: var(--gray-400); }
.search-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, .18);
}

/* Buttons — refonte 2026-04-28 : transitions douces, focus rings, micro-press */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  border: 1px solid var(--blue-dark);
  padding: 10px 18px;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(31, 78, 139, .42);
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 9px 14px;
}
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-900); }
.btn-ghost:active { transform: scale(.97); }
.btn-danger { color: var(--red); border-color: #ffc9c9; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.progress-row { display: flex; flex-direction: column; gap: 6px; }
.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.progress-name { font-weight: 500; color: var(--gray-900); text-decoration: none; }
a.progress-name:hover { text-decoration: underline; }
.progress-count { color: var(--gray-500); }
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  border-radius: 4px;
  transition: width .3s;
}

.task-title {
  margin: 0;
  font-size: var(--text-md);
  color: var(--gray-900);
  font-weight: var(--fw-semibold);
  letter-spacing: -.005em;
}
.task-open { cursor: pointer; transition: color var(--t-fast); }
.task-open:hover { color: var(--orange); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: var(--fw-medium);
}
.chip [data-lucide] { width: 12px; height: 12px; }
.chip-muted { color: var(--gray-500); font-style: italic; }
.chip-danger { background: #fff5f5; color: var(--red); }
.chip-warn { background: #fff8e6; color: #b07b00; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-status {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--gray-300);
  cursor: pointer;
}
.status-todo     { background: var(--gray-100); color: var(--gray-700); }
.status-progress { background: #fff9db; color: #a67c00; }
.status-done     { background: #d3f9d8; color: #2b8a3e; }

/* Badges priorité */
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.prio-low    { background: var(--gray-100); color: var(--gray-700); }
.prio-medium { background: #fff4e6; color: #d9480f; }
.prio-high   { background: #ffe3e3; color: var(--red); }

.empty {
  text-align: center;
  color: var(--gray-500);
  padding: 30px 0;
  font-size: 14px;
}

/* Modal */
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 66, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  z-index: 100;
  animation: modal-fade-in var(--t-base) var(--ease-out);
}
.modal-content {
  background: #fff;
  border-radius: var(--r-lg);
  padding: var(--s-8) var(--s-8) var(--s-6);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-pop-in var(--t-slow) var(--ease-out);
}
.modal-content h3 {
  margin: 0 0 var(--s-5);
  color: var(--blue-dark);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
}
.task-form { display: flex; flex-direction: column; gap: 14px; }
.task-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray-700); }
.task-form input, .task-form textarea, .task-form select {
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
}
.task-form input:focus, .task-form textarea:focus, .task-form select:focus {
  outline: none;
  border-color: var(--orange);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-row:has(> label:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .app-header { padding: 10px 16px; }
  .brand span { display: none; }
  .app-main { padding: 12px; gap: 12px; }
  .panel { padding: 14px; }
  .panel-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-input, .select { width: 100%; min-width: 0; }
  .task-row { flex-wrap: wrap; gap: 10px; padding: 10px; }
  .row-cover { width: 56px; height: 56px; }
  .row-main { flex: 1 1 60%; }
  .row-assignees { flex: 1 1 100%; }
  .row-chevron { display: none; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
}

/* =========================================================
   STORIES — bandeau + viewer plein écran (Phase 24)
   ========================================================= */
.stories-bar {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.stories-bar::-webkit-scrollbar { display: none; }
.stories-list { display: flex; gap: 10px; }

.story-add, .story-bubble {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 72px;
}
.story-add-circle, .story-bubble-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.story-add-circle {
  background: linear-gradient(135deg, var(--orange) 0%, #d56712 100%);
  color: #fff;
}
.story-add-circle i { width: 26px; height: 26px; }
.story-bubble-ring {
  padding: 2px;
  background: linear-gradient(135deg, #ff6a00 0%, #ee0979 50%, #b06ab3 100%);
}
.story-bubble.is-me .story-bubble-ring {
  background: linear-gradient(135deg, var(--orange) 0%, #d56712 100%);
}
.story-bubble-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #fff;
}
.story-bubble-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-label {
  font-size: 11px;
  color: var(--gray-700);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal upload */
.story-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: all .15s;
  margin-bottom: 12px;
}
.story-dropzone.is-over,
.story-dropzone:hover {
  border-color: var(--orange);
  background: #fff7ee;
}
.story-dz-icon { width: 40px !important; height: 40px !important; color: var(--orange); margin-bottom: 6px; }
.story-dropzone p { margin: 4px 0; font-size: 13px; }

.story-preview {
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 320px;
}
.story-preview img, .story-preview video {
  max-width: 100%;
  max-height: 320px;
  display: block;
}
.story-caption-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 12px;
}
.story-caption-wrap {
  position: relative;
}
.story-caption-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}
/* Picker mentions positionné sous le textarea (override le fixed du chat) */
.story-caption-wrap .mention-picker {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 110;
  max-width: none;
}
.story-mentions-list {
  font-size: 11px;
  color: var(--orange, #e87722);
  font-weight: 600;
  margin-top: 6px;
  display: block;
}
.story-mentions-list:empty { display: none; }

/* Viewer plein écran */
.story-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.story-viewer[hidden] { display: none; }
.story-viewer-progress {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: rgba(255, 255, 255, .3);
  border-radius: 2px;
  overflow: hidden;
  z-index: 3;
}
.story-viewer-progress::after {
  content: '';
  display: block;
  width: 0%;
  height: 100%;
  background: #fff;
  border-radius: 2px;
}
#storyProgressBar {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 3px;
  width: 0%;
  background: #fff;
  border-radius: 2px;
  z-index: 3;
}
.story-viewer-head {
  position: relative;
  z-index: 2;
  padding: 24px 14px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, transparent 100%);
}
.story-viewer-author { display: flex; align-items: center; gap: 10px; }
.story-viewer-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.6);
}
.story-viewer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-viewer-name { font-weight: 700; font-size: 14px; }
.story-viewer-time { font-size: 11px; opacity: .8; }
.story-viewer-actions { display: flex; gap: 6px; }
.story-viewer-actions button {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.story-viewer-actions button:hover { background: rgba(255,255,255,.3); }
.story-viewer-actions i { width: 18px; height: 18px; }

.story-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.story-viewer-body img,
.story-viewer-body video {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.story-viewer-caption {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  color: #fff;
  background: rgba(0,0,0,.5);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  z-index: 2;
}

.story-viewer-prev,
.story-viewer-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.story-viewer-prev { left: 12px; }
.story-viewer-next { right: 12px; }
.story-viewer-prev:hover, .story-viewer-next:hover { background: rgba(255,255,255,.3); }
.story-viewer-prev i, .story-viewer-next i { width: 22px; height: 22px; }

@media (max-width: 600px) {
  .story-viewer-prev, .story-viewer-next { display: none; }
}

/* =========================================================
   FAB CHAT — bouton flottant pour accéder au chat depuis partout
   ========================================================= */
.chat-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, #d56712 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(232, 119, 34, .45);
  z-index: 40;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 24px rgba(232, 119, 34, .55);
}
.chat-fab:active { transform: scale(0.96); }
.chat-fab i { width: 26px; height: 26px; }
.chat-fab .chat-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: #c62828;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
@media print { .chat-fab { display: none !important; } }

/* =========================================================
   NAV PILLS (dashboard ↔ chat)
   ========================================================= */
.app-nav { display: flex; gap: var(--s-1); }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 14px;
  border-radius: var(--r-full);
  text-decoration: none;
  color: var(--gray-700);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  position: relative;
}
.nav-pill:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-pill-active {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.nav-pill-active:hover { filter: brightness(1.08); color: #fff; }

/* =========================================================
   CHAT
   ========================================================= */
.chat-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  height: calc(100vh - 70px);
  display: flex;
  gap: 16px;
  position: relative;
}
.conv-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conv-sidebar-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.conv-sidebar-head h3 { margin: 0; color: var(--blue-dark); font-size: 15px; }
.conv-sidebar-head .btn-ghost { padding: 4px 8px; font-size: 14px; }
.conv-list { flex: 1; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.conv-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3);
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.conv-item:hover { background: var(--gray-100); }
.conv-item:active { transform: scale(.98); }
.conv-item-active { background: var(--orange-soft) !important; }
.conv-item-active .conv-name { color: var(--orange); }
.conv-item-active .conv-avatar { box-shadow: 0 0 0 2px var(--orange); }
.conv-avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast) var(--ease-out);
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-avatar-channel {
  background: linear-gradient(135deg, var(--blue-bright) 0%, var(--blue) 100%);
}
.conv-avatar-channel [data-lucide] { width: 20px; height: 20px; }
.conv-body { flex: 1; min-width: 0; }
.conv-name {
  font-weight: 600; font-size: 14px; color: var(--gray-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-sub {
  font-size: 12px; color: var(--gray-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-back-btn { display: none; }

/* Badge appels manqués (pastille rouge sur la conv) */
.conv-item { position: relative; }
.conv-missed-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(198, 40, 40, .35);
}
.conv-missed-badge i { width: 11px; height: 11px; }

/* Badge messages non lus (style WhatsApp, vert) */
.conv-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: #25D366;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  box-shadow: 0 2px 4px rgba(37, 211, 102, .35);
  flex-shrink: 0;
  margin-left: 4px;
}
.conv-item-unread .conv-name {
  font-weight: 700;
  color: var(--gray-900);
}
.conv-item-unread .conv-sub {
  color: var(--gray-700);
  font-weight: 500;
}

.chat-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1; min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modal nouvelle conversation : liste des membres */
.new-conv-members {
  margin-top: 10px;
  max-height: 50vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.new-conv-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.new-conv-member:hover { background: var(--gray-100); }
.new-conv-member .conv-avatar { width: 34px; height: 34px; }
.new-conv-member .conv-name { font-size: 14px; }
.new-conv-member .conv-sub { font-size: 12px; }

/* ----- Messages épinglés ----- */
.pinned-bar {
  background: #fff8e6;
  border-bottom: 1px solid #f5d680;
  flex-shrink: 0;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
}
.pinned-bar[hidden] { display: none; }
.pinned-bar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  font-size: 12px;
  color: #8a6d1f;
  font-weight: 600;
  border-bottom: 1px solid rgba(245, 214, 128, .5);
}
.pinned-toggle {
  width: 24px; height: 24px;
  border-radius: 4px;
  font-size: 12px;
  color: #8a6d1f;
  transition: transform .15s;
}
.pinned-bar.collapsed .pinned-toggle { transform: rotate(-90deg); }
.pinned-bar.collapsed .pinned-list { display: none; }
.pinned-list {
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pinned-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid rgba(232, 119, 34, .25);
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.pinned-item:hover { background: #fff4e6; }
.pinned-item-body { flex: 1; min-width: 0; font-size: 13px; }
.pinned-item-author {
  font-weight: 600;
  color: var(--blue-dark);
  font-size: 12px;
  margin-bottom: 2px;
}
.pinned-item-text {
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.pinned-item-unpin {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.pinned-item-unpin:hover { background: #fff5f5; color: var(--red, #e03131); }
/* Indicateur "Épinglé" sur un message dans la liste */
.msg-pinned-flag {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--orange);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 2px 8px;
  border-radius: var(--r-full);
  pointer-events: none;
  display: inline-flex; align-items: center; gap: 3px;
  box-shadow: var(--shadow-sm);
}
.msg-pinned-flag [data-lucide] { width: 11px; height: 11px; }
.msg-mine .msg-pinned-flag { right: auto; left: 8px; }
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-header h2 { margin: 0 0 2px; color: var(--blue-dark); font-size: 17px; }
.chat-sub { margin: 0; font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-sub-sep { opacity: .5; }
.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--green, #2f9e44);
  cursor: help;
}
.online-indicator.online-empty { color: var(--gray-500); }
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green, #2f9e44);
  box-shadow: 0 0 0 0 rgba(47, 158, 68, .6);
  animation: online-pulse 2s ease-out infinite;
}
.online-empty .online-dot { background: var(--gray-500); animation: none; }
@keyframes online-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 158, 68, .6); }
  70%  { box-shadow: 0 0 0 6px rgba(47, 158, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0); }
}

/* Barre de recherche */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  background: var(--gray-100);
  border-radius: 22px;
  padding: 4px 8px 4px 14px;
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.search-count {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Séparateur de date */
.msg-day-sep {
  display: flex;
  justify-content: center;
  margin: 14px 0 6px;
}
.msg-day-sep span {
  background: rgba(0, 0, 0, .08);
  color: var(--gray-700, #555);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: capitalize;
}

/* ----- Card d'appel dans le fil (style WhatsApp) ----- */
.msg-call {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}
.msg-call-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  max-width: 90%;
}
.msg-call-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.msg-call-icon i { width: 16px; height: 16px; }
.msg-call-icon.outgoing { background: #e8f5e9; color: #2e7d32; }
.msg-call-icon.incoming { background: #e3f2fd; color: #1565c0; }
.msg-call-icon.missed   { background: #ffebee; color: #c62828; }
.msg-call-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.msg-call-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800, #222);
}
.msg-call-icon.missed + .msg-call-meta .msg-call-title { color: #c62828; }
.msg-call-sub {
  font-size: 11px;
  color: var(--gray-600, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-call-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--orange, #e87722);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-base, .15s) ease, transform var(--t-base, .15s) ease;
}
.msg-call-back:hover { background: #d56712; transform: scale(1.05); }
.msg-call-back i { width: 16px; height: 16px; }

/* Surlignage recherche */
.msg-content mark {
  background: #fff59d;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* Indicateur "X écrit…" */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px 8px;
  font-size: 13px;
  color: var(--gray-600, #666);
  font-style: italic;
  background: var(--gray-50);
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--gray-500, #888);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ----- Citation (réponse à un message) ----- */
.msg-quote {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, .05);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .15s;
}
.msg-quote:hover { background: rgba(0, 0, 0, .1); }
.msg-mine .msg-quote { background: rgba(255, 255, 255, .25); }
.msg-mine .msg-quote:hover { background: rgba(255, 255, 255, .4); }
.msg-quote-bar { width: 3px; background: var(--orange, #e87722); border-radius: 2px; flex-shrink: 0; }
.msg-quote-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg-quote-author { font-size: 12px; font-weight: 600; color: var(--orange, #e87722); }
.msg-mine .msg-quote-author { color: rgba(255, 255, 255, .9); }
.msg-quote-text { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-quote-missing { font-size: 12px; opacity: .6; padding: 4px 8px; }

/* Aperçu réponse (au-dessus de l'input) */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff4e6;
  border-top: 1px solid var(--gray-200);
}
.reply-preview .reply-bar { width: 3px; height: 28px; background: var(--orange, #e87722); border-radius: 2px; }
.reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reply-author { font-size: 12px; font-weight: 600; color: var(--orange, #e87722); }
.reply-text { font-size: 12px; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Surligner un message ciblé par "sauter à" */
@keyframes msg-flash {
  0% { background: transparent; }
  30% { background: rgba(232, 119, 34, .25); }
  100% { background: transparent; }
}
.msg-flash .msg-bubble { animation: msg-flash 1.2s ease-out; }

/* ----- Actions (répondre / réagir / supprimer) ----- */
.msg-bubble { position: relative; }
.msg-actions {
  position: absolute;
  top: -14px;
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-full);
  padding: 3px;
  box-shadow: var(--shadow-md);
}
.msg:not(.msg-mine) .msg-actions { right: 8px; }
.msg-mine .msg-actions { left: 8px; }
.msg:hover .msg-actions, .msg-bubble:focus-within .msg-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.msg-act {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.msg-act [data-lucide] { width: 14px; height: 14px; }
.msg-act:hover { background: var(--gray-100); color: var(--gray-900); }
.msg-act:active { transform: scale(.9); }
.msg-act.msg-act-pin[data-pinned="1"] { color: var(--orange); }
.msg-act.msg-delete:hover { background: var(--red-soft); color: var(--red); }

/* ----- Picker emoji ----- */
.reaction-picker {
  position: fixed;
  z-index: 1500;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  border: 1px solid var(--gray-200);
}
.reaction-picker[hidden] { display: none; }
.reaction-picker button {
  width: 36px; height: 36px;
  border: none; background: transparent;
  font-size: 22px; cursor: pointer;
  border-radius: 50%;
  transition: background .1s, transform .1s;
}
.reaction-picker button:hover { background: var(--gray-100); transform: scale(1.15); }

/* ----- Réactions sur les messages ----- */
.msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.msg-rx {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--gray-300);
  background: #fff;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.msg-rx:hover { background: var(--gray-100); }
.msg-rx.rx-mine { background: #fff4e6; border-color: var(--orange); }
.rx-count { font-weight: 500; color: var(--gray-700); font-size: 11px; }

/* ----- Accusés de lecture (✓ envoyé / ✓✓ lu) ----- */
.msg-ticks {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  color: rgba(255, 255, 255, .65);
}
.msg-ticks [data-lucide] { width: 14px; height: 14px; }
.msg-ticks.msg-ticks-read { color: #4fc3f7; }
.msg:not(.msg-mine) .msg-ticks { color: var(--gray-500); }

/* ----- Mentions ----- */
.mention {
  background: rgba(232, 119, 34, .15);
  color: var(--orange, #e87722);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
  cursor: default;
}
.msg-mine .mention { background: rgba(255, 255, 255, .3); color: #fff; }
.mention.mention-me { background: var(--orange); color: #fff; }

/* ----- Picker mentions ----- */
.mention-picker {
  position: fixed;
  z-index: 1500;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
  border: 1px solid var(--gray-200);
  min-width: 200px;
  max-width: 280px;
  overflow: hidden;
}
.mention-picker[hidden] { display: none; }
.mention-picker button {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.mention-picker button:last-child { border-bottom: none; }
.mention-picker button:hover { background: var(--gray-100); }
.mp-name { font-weight: 500; color: var(--gray-900); }
.mp-handle { font-size: 11px; color: var(--orange); }

/* Tuile document */
.msg-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 6px 0 4px;
  background: rgba(0, 0, 0, .05);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  max-width: 320px;
  cursor: pointer;
  transition: background .15s;
}
.msg-doc:hover { background: rgba(0, 0, 0, .1); }
.msg-mine .msg-doc { background: rgba(255, 255, 255, .25); }
.msg-mine .msg-doc:hover { background: rgba(255, 255, 255, .4); }
.msg-doc-icon { display: inline-flex; flex-shrink: 0; }
.msg-doc-icon [data-lucide] { width: 28px; height: 28px; }
.msg-doc-dl { display: inline-flex; }
.msg-doc-dl [data-lucide] { width: 20px; height: 20px; opacity: .65; }
.msg-doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-doc-name {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-doc-meta { font-size: 11px; opacity: .7; }
.msg-doc-dl { font-size: 18px; opacity: .6; flex-shrink: 0; }

.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--gray-50);
}
.msg { display: flex; }
.msg-mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 72%;
  background: #fff;
  border: 1px solid var(--gray-200);
  padding: 10px 14px;
  border-radius: var(--r-lg);
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-fast) var(--ease-out);
}
.msg:not(.msg-mine) .msg-bubble { border-bottom-left-radius: var(--r-sm); }
.msg-mine .msg-bubble {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  border-color: transparent;
  border-bottom-right-radius: var(--r-sm);
  box-shadow: var(--shadow-blue);
}
.msg-bubble:hover { box-shadow: var(--shadow-sm); }
.msg-mine .msg-bubble:hover { box-shadow: 0 6px 18px rgba(31, 78, 139, .45); }

.msg-head {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
  margin-bottom: 2px;
  font-size: var(--text-xs);
}
.msg-author {
  font-weight: var(--fw-semibold);
  color: var(--blue-dark);
  text-decoration: none;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: opacity var(--t-fast);
}
.msg-author:hover { opacity: .75; }
.msg-mine .msg-author { color: #fff; }
.msg-time { color: var(--gray-500); font-size: var(--text-xs); }
.msg-mine .msg-time { color: rgba(255, 255, 255, .85); }
.msg-content { font-size: var(--text-base); line-height: 1.45; }
.msg-content a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ===== Modals d'appel (style WhatsApp) ===== */
.call-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 66, .94);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.call-modal[hidden] { display: none; }

.call-modal-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  animation: callPop .25s var(--ease-out);
}
@keyframes callPop {
  from { opacity: 0; transform: scale(.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.call-modal-pulse {
  position: absolute;
  top: 32px; left: 50%;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--orange);
  transform: translateX(-50%);
  opacity: .35;
  animation: callPulse 1.6s ease-out infinite;
  z-index: 0;
}
.call-modal-incoming .call-modal-pulse { background: #16a34a; }
@keyframes callPulse {
  0%   { transform: translateX(-50%) scale(.85); opacity: .55; }
  70%  { transform: translateX(-50%) scale(1.6);  opacity: 0; }
  100% { transform: translateX(-50%) scale(1.6);  opacity: 0; }
}

.call-modal-avatar {
  position: relative;
  z-index: 1;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  font-weight: var(--fw-semibold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.call-modal-incoming .call-modal-avatar {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.call-modal-name {
  font-size: 22px;
  font-weight: var(--fw-semibold);
  color: var(--gray-900);
  margin-bottom: 6px;
}
.call-modal-sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
}

.call-modal-actions {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.call-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  transition: transform .15s, box-shadow .15s;
}
.call-btn:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.call-btn:active { transform: scale(.95); }
.call-btn [data-lucide] { width: 28px; height: 28px; }
.call-btn-accept { background: #16a34a; }
.call-btn-accept:hover { background: #15803d; }
.call-btn-decline { background: #dc2626; }
.call-btn-decline:hover { background: #b91c1c; }
.call-modal-incoming .call-btn-accept { animation: callShake 1.2s ease-in-out infinite; }
@keyframes callShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}

/* Picker "Inviter dans l'appel" */
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 12px 0;
}
.invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: var(--gray-50, #f9fafb);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: var(--gray-900);
  transition: background var(--t-fast);
}
.invite-item:hover { background: var(--gray-100, #f3f4f6); }
.invite-item:disabled { opacity: .6; cursor: default; }
.invite-item-sent { background: #d1fae5 !important; color: #065f46; }
.invite-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}

/* Modal Jitsi plein écran */
.jitsi-modal {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.jitsi-modal[hidden] { display: none; }
.jitsi-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0f2c52;
  color: #fff;
}
.jitsi-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: var(--fw-semibold);
}
.jitsi-modal-title [data-lucide] { width: 18px; height: 18px; }
.jitsi-modal-bar .btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}
.jitsi-modal-bar .btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.jitsi-modal-frame {
  flex: 1;
  width: 100%;
  min-height: 0;          /* permet à flex:1 de réellement rétrécir/grandir */
  border: 0;
  background: #1a1a1a;
  display: flex;          /* pour que l'iframe enfant puisse remplir 100% */
}
/* L'iframe Whereby injectée dans le container : prend tout l'espace */
.jitsi-modal-frame > iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
@keyframes msg-pop {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-new .msg-bubble { animation: msg-pop var(--t-slow) var(--ease-out); }

/* ----- Barre de saisie style WhatsApp (raffinée) ----- */
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-full);
  padding: 4px 6px;
  min-height: 46px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.chat-input-wrap:hover { border-color: var(--gray-300); }
.chat-input-wrap:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, .18);
}
.chat-form textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 10px;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  resize: none;
  max-height: 140px;
  min-height: 24px;
  font-family: inherit;
  color: var(--gray-900);
}
.chat-form textarea:focus { outline: none; }
.chat-form textarea::placeholder { color: var(--gray-500); }

.btn-inline {
  background: transparent;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-inline [data-lucide] { width: 20px; height: 20px; }
.btn-inline:hover { background: var(--gray-100); color: var(--orange); }
.btn-inline:active { transform: scale(.92); }
.btn-inline:disabled { opacity: .4; cursor: not-allowed; }

.btn-icon-bubble {
  background: #fff;
  border: 1px solid var(--gray-300);
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-xs);
}
.btn-icon-bubble [data-lucide] { width: 20px; height: 20px; }
.btn-icon-bubble:hover {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: var(--shadow-sm);
}
.btn-icon-bubble:active { transform: scale(.94); }

.btn-send {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  border: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              filter var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-send [data-lucide] { width: 20px; height: 20px; }
.btn-send:hover { filter: brightness(1.12); box-shadow: 0 6px 18px rgba(31, 78, 139, .5); }
.btn-send:active { transform: scale(.92); }

/* =========================================================
   TASK DETAIL + COMMENTS
   ========================================================= */
.modal-wide { max-width: 680px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-500);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  line-height: 1;
  padding: 0;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.detail-head h3 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  padding-right: 30px;
}
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.detail-desc {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-left: 3px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-700);
}

.comments-section { margin-top: 20px; border-top: 1px solid var(--gray-200); padding-top: 18px; }
.comments-section h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--blue-dark);
}
.comments-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 4px;
}
.comment {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 10px 12px;
  position: relative;
}
.comment-mine { background: #fff4e6; }
.comment-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
}
.comment-author { font-weight: 600; color: var(--blue-dark); text-decoration: none; }
a.comment-author:hover { text-decoration: underline; }
.comment-time { color: var(--gray-500); }
.comment-delete {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.comment-delete:hover { color: var(--red); }
.comment-content { font-size: 14px; line-height: 1.4; color: var(--gray-900); }
@keyframes comment-pop {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.comment-new { animation: comment-pop .25s ease-out; }

.comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.comment-form textarea {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 44px;
  max-height: 150px;
  font-family: inherit;
  line-height: 1.4;
}
.comment-form textarea:focus { outline: none; border-color: var(--orange); }

/* Responsive chat */
@media (max-width: 720px) {
  .chat-main {
    padding: 0;
    height: 100dvh;
    height: calc(100dvh - 0px);
    max-width: none;
    gap: 0;
  }
  /* Mobile : sidebar en plein écran, masquée quand une conv est ouverte */
  .conv-sidebar {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .chat-main.with-conv .conv-sidebar { display: none; }
  .chat-main:not(.with-conv) .chat-panel { display: none; }
  .chat-main.with-conv .conv-back-btn { display: inline-flex; }
  .chat-panel { border-radius: 0; box-shadow: none; height: 100%; }
  .chat-header { padding: 12px 16px; }
  .chat-header h2 { font-size: 16px; }
  .chat-sub { font-size: 12px; }
  .messages-list { padding: 12px; }
  .msg-bubble { max-width: 88%; padding: 8px 12px; }
  .msg-content { font-size: 14px; }
  .msg-head { font-size: 11px; }

  .chat-form { padding: 8px; gap: 6px; flex-wrap: nowrap; }
  .chat-form textarea { padding: 8px 6px; font-size: 15px; min-height: 24px; }
  .chat-input-wrap { min-height: 40px; padding: 3px 4px; }
  .btn-inline { width: 34px; height: 34px; font-size: 17px; }
  .btn-send { width: 44px; height: 44px; font-size: 18px; }
  .btn-icon-bubble { width: 40px; height: 40px; font-size: 16px; }

  /* Nav : scroll horizontal sur mobile (style WhatsApp/Telegram) */
  .app-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-top: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;            /* Firefox */
    -ms-overflow-style: none;         /* IE/Edge legacy */
    padding: 0 4px 6px;
    gap: 4px;
    /* Fade visuel sur les bords pour suggérer qu'on peut scroller */
    mask-image: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
  }
  .app-nav::-webkit-scrollbar { display: none; }  /* Chrome/Safari */
  .app-header { flex-wrap: wrap; padding: 8px 12px; gap: 6px; }
  .app-user { gap: 6px; font-size: 13px; }
  .app-user #userName { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-avatar { width: 30px; height: 30px; font-size: 11px; }
  .nav-pill {
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;                   /* empêche d'écraser les pills */
    white-space: nowrap;              /* empêche le wrap interne */
  }
}

/* Très petits écrans (<= 480px) */
@media (max-width: 480px) {
  .brand img { height: 28px; }
  .brand span { display: none; }            /* gagne de la place dans le header */
  .app-user #userName { max-width: 80px; font-size: 12px; }
  .btn-ghost, #logoutBtn { padding: 6px 10px; font-size: 12px; }
  .nav-pill { padding: 5px 10px; font-size: 12px; gap: 4px; }
  .nav-pill i { width: 14px; height: 14px; }
  .chat-form { gap: 4px; }
  .msg-bubble { max-width: 92%; }
}

/* =========================================================
   FILES (phase 3)
   ========================================================= */
.files-main { max-width: 1400px; margin: 0 auto; padding: 20px; }

.files-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.server-status {
  padding: 6px 12px;
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: var(--shadow);
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}
.files-sidebar {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.files-sidebar h3 { margin: 0 0 12px; font-size: 14px; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .5px; }
.folder-tree ul { list-style: none; padding-left: 14px; margin: 0; }
.folder-tree > ul { padding-left: 0; }
.tree-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--gray-700);
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.tree-item:hover { background: var(--gray-100); color: var(--gray-900); }
.tree-active { background: var(--orange-soft); color: var(--orange-dark) !important; font-weight: var(--fw-medium); }
.tree-active .tree-icon [data-lucide] { color: var(--orange); }
.tree-icon [data-lucide] { width: 16px; height: 16px; color: var(--gray-500); }
.tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.files-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 400px;
}
.folder-head { margin-bottom: 16px; }
.breadcrumb { font-size: 13px; margin-bottom: 8px; }
.breadcrumb a { color: var(--gray-700); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }
.folder-head h2 { margin: 0 0 10px; color: var(--blue-dark); }
.folder-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.folder-actions label { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--gray-700); }

.dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  background: var(--gray-50);
  margin-bottom: 16px;
  transition: all .15s;
}
.dropzone-active {
  border-color: var(--orange);
  background: #fff4e6;
  transform: scale(1.005);
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone-icon { font-size: 32px; }
.dropzone p { margin: 0; color: var(--gray-700); font-size: 14px; }
.dropzone-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.dropzone-actions .btn-ghost { padding: 8px 14px; font-size: 13px; }

.upload-progress {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-banner {
  background: #fff4e6;
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 70px;
  z-index: 5;
}
.upload-banner-text { font-weight: 600; font-size: 14px; color: var(--orange-dark, #c05e15); }
.upload-banner-bar {
  height: 6px;
  background: rgba(232, 119, 34, .15);
  border-radius: 3px;
  overflow: hidden;
}
.upload-banner-fill {
  height: 100%;
  width: 0%;
  background: var(--orange);
  border-radius: 3px;
  transition: width .25s ease;
}
.upload-recap {
  font-weight: 600;
  background: var(--gray-100);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 4px;
}
.upload-size { color: var(--gray-500); font-size: 11px; font-style: normal; margin-left: 4px; }
.upload-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 6px;
}
.upload-status.ok { color: var(--green); }
.upload-status.err { color: var(--red); }

.folder-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}
.item:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.item-folder { cursor: pointer; }
.item-folder:hover { border-color: var(--orange); }
.item-folder .item-icon [data-lucide] { color: var(--orange); }
.item[draggable="true"] { cursor: grab; }
.item[draggable="true"]:active { cursor: grabbing; }
.item-dragging { opacity: 0.4; }

/* Cibles de drop : dossier dans la grille, breadcrumb, tree */
.drop-target {
  outline: 2px dashed var(--orange) !important;
  outline-offset: 2px;
  background: #fff4e6 !important;
  position: relative;
}
.item-folder.drop-target::after {
  content: '↩ Déposer ici';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--orange);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
#breadcrumb a.drop-target,
.tree-item.drop-target {
  outline-offset: 0;
  border-radius: 4px;
}
.item-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  border-radius: var(--r-md);
  color: var(--gray-700);
}
.item-icon [data-lucide] { width: 22px; height: 22px; }
.item-folder .item-icon { background: var(--orange-soft); }
.item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-200);
  cursor: pointer;
  transition: transform .15s;
}
.item-image .item-thumb:hover { transform: scale(1.05); }
.files-controls {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
  align-items: center;
}
.files-controls .search-input { flex: 1; min-width: 200px; }
.item-body { flex: 1; min-width: 0; }
.item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.item-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  vertical-align: middle;
}
.item-proof-badge [data-lucide] { width: 11px; height: 11px; }
.item-download, .item-delete, .item-preview, .item-share {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 16px;
  color: var(--gray-500);
}
.item-download:hover { background: var(--gray-100); color: var(--orange); }
.item-preview:hover { background: var(--gray-100); color: var(--blue); }
.item-share:hover { background: var(--gray-100); color: var(--orange); }
.item-delete:hover { background: #fff5f5; color: var(--red); }

/* ----- Modal Partage : structure card + head + body ----- */
#shareModal .modal-card {
  background: #fff;
  border-radius: var(--r-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-pop-in var(--t-slow) var(--ease-out);
}
#shareModal .modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
}
#shareModal .modal-head h3 {
  margin: 0;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-dark);
}
#shareModal .modal-head h3 i { width: 18px; height: 18px; color: var(--orange, #e87722); }
#shareModal .modal-close {
  background: transparent; border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--gray-600);
}
#shareModal .modal-close:hover { background: var(--gray-100); }
#shareModal .modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.share-url-box {
  display: flex; gap: 8px;
  margin: 12px 0;
}
.share-url-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
  font-family: monospace;
  background: var(--gray-50);
}
.share-url-box .btn-primary {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--orange, #e87722);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.share-url-box .btn-primary:hover { background: #d56712; }
.share-url-box .btn-primary i { width: 14px; height: 14px; }

.field {
  display: flex; flex-direction: column;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--gray-700);
  gap: 4px;
}
.field span { font-weight: 600; }
.field input, .field select {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--orange, #e87722);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, .15);
}
.hint {
  font-size: 12px;
  color: var(--gray-600);
  margin: 0 0 10px;
}

/* ----- Modal "Mes liens partagés" ----- */
#myLinksModal .modal-card {
  background: #fff;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
#myLinksModal .modal-large { max-width: 720px; }
#myLinksModal .modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
}
#myLinksModal .modal-head h3 {
  margin: 0; font-size: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--blue-dark);
}
#myLinksModal .modal-close {
  background: transparent; border: none;
  cursor: pointer; padding: 6px; border-radius: 6px;
  color: var(--gray-600);
}
#myLinksModal .modal-close:hover { background: var(--gray-100); }
#myLinksModal .modal-body {
  padding: 12px 18px 16px;
  overflow-y: auto;
}

.my-links-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.my-links-search {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
}
#myLinksFilter {
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.my-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.my-link-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
  transition: background .15s;
}
.my-link-item:hover { background: #fff; box-shadow: var(--shadow-sm); }
.my-link-revoked  { opacity: .55; background: #f5f5f5; }
.my-link-expired  { opacity: .65; background: #fefcf2; }

.my-link-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.my-link-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--orange, #e87722);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.my-link-icon i { width: 18px; height: 18px; }
.my-link-info { flex: 1; min-width: 0; }
.my-link-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-link-meta {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 2px;
}
.my-link-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.my-link-status-active   { background: #e8f5e9; color: #2e7d32; }
.my-link-status-revoked  { background: #ffebee; color: #c62828; }
.my-link-status-expired  { background: #fff3e0; color: #ef6c00; }

.my-link-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0;
  font-size: 11px;
  color: var(--gray-700);
}
.my-link-stats span {
  display: inline-flex; align-items: center; gap: 4px;
}
.my-link-stats i { width: 12px; height: 12px; color: var(--gray-500); }

.my-link-url {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}
.my-link-url input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 11px;
  font-family: monospace;
  background: #fff;
  min-width: 0;
}
.my-link-url .btn-soft, .my-link-url .btn-danger {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: var(--gray-700);
  background: var(--gray-100);
}
.my-link-url .btn-soft:hover { background: var(--gray-200); }
.my-link-url .btn-soft i,
.my-link-url .btn-danger i { width: 13px; height: 13px; }
.my-link-url .btn-danger {
  background: #fff5f5;
  color: #c62828;
  border-color: #ffcdd2;
}
.my-link-url .btn-danger:hover { background: #ffebee; }

/* ----- Aperçu plein écran (PDF + image) ----- */
.file-preview {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 100;
  display: flex; flex-direction: column;
  animation: lightbox-in .15s ease-out;
}
.file-preview[hidden] { display: none; }
.file-preview-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  flex-shrink: 0;
}
.file-preview-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px;
}
.file-preview-bar .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .08);
}
.file-preview-bar .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.file-preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #525659;
}
.file-preview-frame { width: 100%; height: 100%; border: 0; }
.file-preview-img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ----- Cropper d'avatar ----- */
.crop-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.crop-modal[hidden] { display: none; }
.crop-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 380px; width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.crop-content h3 { margin: 0 0 16px; color: var(--blue-dark); text-align: center; }
.crop-stage {
  position: relative;
  width: 280px; height: 280px;
  margin: 0 auto;
  overflow: hidden;
  background: #1a1a1a;
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.crop-stage:active { cursor: grabbing; }
#cropImage {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  pointer-events: none;
  max-width: none;
}
.crop-mask {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
}
.crop-controls { margin-top: 16px; }
.crop-zoom-label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray-700); }
.crop-zoom-label input[type=range] { flex: 1; }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 900px) {
  .files-layout { grid-template-columns: 1fr; }
  .files-sidebar { max-height: 240px; }
}

/* =========================================================
   PHASE 4 — Task cards enrichies + modal
   ========================================================= */
.chip-folder {
  background: #fff4e6;
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.chip-folder:hover { background: #ffe8cc; }

.detail-cover {
  margin: -28px -28px 16px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  max-height: 220px;
}
.detail-cover img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* Liste de checkboxes dans le formulaire tâche */
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.cb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-direction: row !important;
}
.cb-item:hover { background: #fff; }
.cb-item input[type="checkbox"] { accent-color: var(--orange); }

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.form-hint-warn { color: var(--red); }

/* =========================================================
   PHASE 5 — Vue liste compacte des tâches + modal détail
   ========================================================= */

.task-row {
  display: grid;
  grid-template-columns: 64px 1fr auto 24px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.task-row:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 12px rgba(232, 119, 34, .12);
  transform: translateY(-1px);
}

.row-cover {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.row-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-cover-icon { color: var(--gray-500); display: inline-flex; }
.row-cover-icon [data-lucide] { width: 24px; height: 24px; }
.row-cover-empty .row-cover-icon { display: inline; }

.row-main { min-width: 0; }
.row-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.row-meta .chip { font-size: 11px; padding: 2px 7px; }

.status-pill {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
button.status-pill {
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
button.status-pill:hover { filter: brightness(.95); }
button.status-pill:active { transform: scale(.96); }
button.status-pill:disabled { opacity: .5; cursor: wait; }

.row-assignees {
  display: flex;
  gap: -4px;
  align-items: center;
}
.row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid #fff;
  margin-left: -8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.row-avatar:first-child { margin-left: 0; }
.row-avatar-more {
  background: var(--gray-300);
  color: var(--gray-700);
}
.row-assignee-empty {
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
}

.row-chevron {
  color: var(--gray-300);
  font-size: 22px;
  font-weight: 300;
  transition: color .15s, transform .15s;
}
.task-row:hover .row-chevron {
  color: var(--orange);
  transform: translateX(3px);
}

@media (max-width: 720px) {
  .task-row { grid-template-columns: 50px 1fr auto; padding: 8px 12px; gap: 10px; }
  .row-cover { width: 50px; height: 50px; }
  .row-chevron { display: none; }
}

/* =========================================================
   Modal détail de tâche enrichie
   ========================================================= */
.detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
}
.detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
}

.progress-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.progress-bar-lg {
  height: 12px;
  flex: 1;
  background: var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}
.progress-bar-lg .progress-fill { border-radius: 6px; }
.progress-pct { font-weight: 600; color: var(--gray-700); font-size: 14px; min-width: 40px; text-align: right; }

.status-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.status-btn {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.status-btn:hover { background: var(--gray-50); border-color: var(--orange); }
.status-btn-active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.status-btn-active:hover { background: var(--orange-dark); }

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--gray-700);
  position: relative;
  padding-left: 4px;
}
.tl-icon { font-size: 14px; flex-shrink: 0; line-height: 1.4; }
.tl-text { line-height: 1.4; }
.tl-overdue { color: var(--red); font-weight: 600; }

.detail-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* =========================================================
   PHASE 5 — Page profil + avatars
   ========================================================= */

/* Avatars contiennent désormais soit du texte (initiales) soit une <img> */
.row-avatar { overflow: hidden; }
.row-avatar img,
.assignee-avatar img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.assignee-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--gray-100);
  border-radius: 18px;
  font-size: 13px;
}
.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.assignee-pill small { color: var(--gray-500); font-style: italic; }

/* Page profil */
.profil-main { max-width: 900px; margin: 0 auto; padding: 24px; }

.profil-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.profil-card h2 { margin: 0 0 4px; color: var(--blue-dark); }
.profil-sub { margin: 0 0 24px; color: var(--gray-500); font-size: 14px; }

.profil-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
}

.profil-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.avatar-preview {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.avatar-preview-link {
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.avatar-preview-link:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(30, 58, 95, .25);
}
.avatar-initials-lg {
  color: #fff;
  font-size: 64px;
  font-weight: 600;
}
.avatar-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profil-form { display: flex; flex-direction: column; gap: 16px; }
.profil-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray-700); }
.profil-form input {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color .15s;
}
.profil-form input:focus { outline: none; border-color: var(--orange); }

.profil-readonly {
  background: var(--gray-50);
  padding: 14px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profil-readonly > div { display: flex; flex-direction: column; gap: 2px; }
.profil-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: .4px;
}
.profil-readonly-value { font-size: 14px; color: var(--gray-900); font-weight: 500; }

.profil-sep { border: none; border-top: 1px solid var(--gray-200); margin: 24px 0 16px; }
.profil-password,
.profil-push { padding-top: 8px; }
.profil-password h3,
.profil-push h3 { margin: 0 0 14px; color: var(--blue-dark); font-size: 16px; }
.profil-push p.form-hint { margin: 0 0 12px; }

.profil-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.form-hint-ok { color: var(--green); }

@media (max-width: 720px) {
  .profil-layout { grid-template-columns: 1fr; gap: 20px; }
  .profil-card { padding: 20px; }
  .avatar-preview { width: 140px; height: 140px; }
  .avatar-initials-lg { font-size: 50px; }
}

/* Bouton "Installer l'app" */
.btn-install {
  background: linear-gradient(135deg, #e87722 0%, #c05e15 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
  font-weight: 600;
}
.btn-install:hover {
  background: linear-gradient(135deg, #c05e15 0%, #a04e10 100%) !important;
}
@media (max-width: 720px) {
  .btn-install { padding: 6px 10px; font-size: 12px; }
}

/* =========================================================
   PHASE 7 — Pièces jointes du chat
   ========================================================= */
.btn-icon {
  background: transparent;
  border: 1px solid var(--gray-300);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
  align-self: flex-end;
}
.btn-icon:hover { background: var(--gray-100); border-color: var(--orange); }
.btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff4e6;
  border-top: 1px solid var(--gray-200);
}
.attachment-name {
  flex: 1;
  font-size: 13px;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff5f5;
  border-top: 2px solid var(--red);
  font-size: 14px;
  color: var(--gray-900);
}
.recording-bar .rec-dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  animation: rec-pulse 1s infinite;
}
.rec-duration {
  flex: 1;
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: var(--red);
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.msg-media {
  margin: 6px 0 4px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 320px;
}
.msg-media img,
.msg-media video {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  background: var(--gray-200);
}
.msg-media-image img {
  cursor: zoom-in;
  transition: transform .15s ease;
}
.msg-media-image img:hover { transform: scale(1.01); }
.msg-media video { cursor: default; outline: none; }

.msg-media-error::before {
  content: '⚠️ Média indisponible';
  display: block;
  padding: 20px;
  background: var(--gray-100);
  color: var(--gray-500);
  text-align: center;
  font-size: 13px;
}

/* ----- Visionneuse plein écran (lightbox) ----- */
body.no-scroll { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: lightbox-in .15s ease-out;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pinch-zoom;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
  border-radius: 6px;
  -webkit-user-drag: none;
}
.lightbox-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 1;
}
.lightbox-close,
.lightbox-download {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover,
.lightbox-download:hover,
.lightbox-close:focus-visible,
.lightbox-download:focus-visible { background: rgba(255, 255, 255, .35); outline: none; }
@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ----- Lecteur audio / vocal (raffiné) ----- */
.msg-audio-player {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-1);
  padding: var(--s-2) var(--s-3);
  background: rgba(15, 37, 66, .06);
  border-radius: var(--r-full);
  max-width: 290px;
  min-width: 220px;
}
.msg-mine .msg-audio-player { background: rgba(255, 255, 255, .22); }
.msg-audio-player audio { display: none; }

.msa-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  border: none;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
}
.msa-play [data-lucide] { width: 16px; height: 16px; fill: currentColor; }
.msa-play:hover { background: var(--orange-dark); box-shadow: var(--shadow-md); }
.msa-play:active { transform: scale(.92); }
.msg-mine .msa-play { background: #fff; color: var(--orange); }
.msg-mine .msa-play:hover { background: rgba(255, 255, 255, .9); }

.msa-track {
  flex: 1;
  height: 4px;
  background: rgba(15, 37, 66, .18);
  border-radius: var(--r-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: height var(--t-fast) var(--ease-out);
}
.msg-mine .msa-track { background: rgba(255, 255, 255, .4); }
.msa-track:hover { height: 6px; }
.msa-progress {
  height: 100%;
  width: 0%;
  background: var(--orange);
  border-radius: var(--r-full);
  transition: width .1s linear;
}
.msg-mine .msa-progress { background: #fff; }

.msa-time {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-family: ui-monospace, Menlo, monospace;
  color: var(--gray-600);
  min-width: 32px;
  text-align: right;
}
.msg-mine .msa-time { color: rgba(255, 255, 255, .9); }

.msa-speed {
  flex-shrink: 0;
  border: none;
  background: rgba(15, 37, 66, .08);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  font-family: ui-monospace, Menlo, monospace;
  padding: 3px 8px;
  border-radius: var(--r-full);
  cursor: pointer;
  min-width: 36px;
  text-align: center;
  transition: background var(--t-fast);
}
.msa-speed:hover { background: rgba(15, 37, 66, .15); }
.msg-mine .msa-speed { background: rgba(255, 255, 255, .25); color: #fff; }
.msg-mine .msa-speed:hover { background: rgba(255, 255, 255, .4); }

@media (max-width: 720px) {
  .btn-icon { width: 36px; height: 36px; font-size: 15px; }
  .msg-media { max-width: 100%; }
  .msg-media img, .msg-media video { max-height: 280px; }
  .msg-audio-player { max-width: 100%; min-width: 0; padding: 6px 10px; }
  .msa-time { font-size: 10px; min-width: 28px; }
  .lightbox { padding: 8px; }
  .lightbox-toolbar { top: 8px; right: 8px; }
  .lightbox-close, .lightbox-download { width: 40px; height: 40px; font-size: 18px; }
  .recording-bar { padding: 10px 12px; gap: 8px; font-size: 13px; flex-wrap: wrap; }
  .attachment-preview { padding: 8px 12px; }
}

/* =====================================================================
   DASHBOARD — vue par membre (vague 2)
   ===================================================================== */
.app-main-compact { gap: var(--s-4); }

/* Mini-stats : 1 ligne sobre */
.mini-stats {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  color: var(--gray-700);
  flex-wrap: wrap;
}
.mini-stat strong {
  font-size: var(--text-lg);
  color: var(--blue-dark);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.mini-stat-warn strong { color: var(--red); }
.mini-stat-ok strong { color: var(--green); }
.mini-stat-sep {
  width: 4px; height: 4px;
  background: var(--gray-300);
  border-radius: var(--r-full);
}

/* Grille des membres */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}
.member-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}
.member-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}
.member-avatar {
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-card-body { min-width: 0; }
.member-name {
  font-weight: var(--fw-semibold);
  font-size: var(--text-md);
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-card-sub {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin: 2px 0 6px;
}
.member-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.member-card-progress {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: conic-gradient(var(--blue) calc(var(--p, 0) * 1%), var(--gray-200) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.member-card-progress::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: #fff;
  border-radius: var(--r-full);
}
.member-card-pct {
  position: relative;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
}
/* Note : le pct est pris depuis style="width:XX%" via JS — on lit l'attribut */
.member-card-progress[style*="width"] { /* no-op pour compat */ }

/* Vue d'un membre */
.member-view-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.member-view-id {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.member-view-id .member-avatar { width: 48px; height: 48px; font-size: var(--text-sm); }
.member-view-id h2 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
}
.member-view-id .form-hint { margin: 2px 0 0; }

/* Liste de projets dans la vue membre */
.mt-projects {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.mt-project {
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.mt-project-head {
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(180deg, var(--gray-50), #fff);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.mt-project-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.mt-project-title [data-lucide] { width: 20px; height: 20px; color: var(--gold-dark); }
.mt-project-title h3 {
  margin: 0;
  flex: 1;
  font-size: var(--text-md);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
}
.mt-project-count {
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

/* Liste des tâches d'un projet */
.mt-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mt-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--t-fast);
}
.mt-task:last-child { border-bottom: none; }
.mt-task:hover { background: var(--gray-50); }
.mt-task-done .mt-task-title { color: var(--gray-500); text-decoration: line-through; }

/* Case à cocher custom */
.mt-check-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.mt-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.mt-check-box {
  width: 22px; height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: var(--r-sm);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.mt-check-box [data-lucide] { width: 14px; height: 14px; stroke-width: 3; }
.mt-check-wrap:hover .mt-check-box { border-color: var(--blue); }
.mt-check:focus-visible + .mt-check-box { box-shadow: var(--ring); }
.mt-check:checked + .mt-check-box {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-color: var(--blue-dark);
  color: #fff;
}
.mt-check:checked + .mt-check-box {
  animation: check-pop var(--t-base) var(--ease-out);
}
.mt-check:disabled + .mt-check-box {
  opacity: .55;
  cursor: not-allowed;
}
@keyframes check-pop {
  0%   { transform: scale(.8); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.mt-task-title {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--gray-900);
  cursor: pointer;
  font-family: inherit;
  font-weight: var(--fw-medium);
}
.mt-task-title:hover { color: var(--blue); text-decoration: underline; }

.mt-task-due {
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mt-task-due-overdue { color: var(--red); font-weight: var(--fw-semibold); }

@media (max-width: 720px) {
  .members-grid { grid-template-columns: 1fr; }
  .member-card { padding: var(--s-3); }
  .mt-task { grid-template-columns: auto 1fr auto; gap: var(--s-2); padding: var(--s-2) var(--s-3); }
  .mt-task-title { font-size: var(--text-sm); }
  .member-card-progress { width: 48px; height: 48px; }
}

/* =====================================================================
   DÉTAIL PROJET (vague 5 part 2)
   ===================================================================== */
.project-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.project-hero {
  background: linear-gradient(135deg, #fff 0%, var(--blue-soft) 100%);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  position: relative;
  overflow: hidden;
}
.project-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  pointer-events: none;
}
.btn-back { align-self: flex-start; padding: 6px 12px; font-size: var(--text-xs); }
.project-hero-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.project-hero-info { flex: 1; min-width: 0; }
.project-hero-info h1 {
  margin: 0 0 var(--s-2);
  font-size: var(--text-3xl);
  color: var(--blue-dark);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.project-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--gray-700);
}
.project-hero-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.project-hero-progress {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  position: relative;
  z-index: 1;
}
.project-hero-progress .proj-gauge { flex: 1; height: 12px; }
.project-hero-progress span {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----- Onglets ----- */
.project-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
}
.project-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.project-tab:hover { color: var(--blue-dark); }
.project-tab-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: var(--fw-semibold);
}
.project-tab [data-lucide] { width: 16px; height: 16px; }
.tab-count {
  font-size: var(--text-xs);
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.project-tab-active .tab-count { background: var(--blue-soft); color: var(--blue-dark); }

.project-tab-pane {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.project-tab-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.project-tab-toolbar h3 {
  margin: 0;
  font-size: var(--text-md);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
}

.project-gantt { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.project-task-list { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-xs); overflow: hidden; }

/* Liste des tâches du projet */
.proj-task-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.proj-task {
  display: grid;
  grid-template-columns: 110px 1fr auto auto auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--t-fast);
}
.proj-task:last-child { border-bottom: none; }
.proj-task:hover { background: var(--gray-50); }
.proj-task-status {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
}
.proj-task-status-todo        { background: var(--gray-100); color: var(--gray-700); }
.proj-task-status-in_progress { background: var(--gold-soft); color: var(--gold-dark); }
.proj-task-status-done        { background: var(--green-soft); color: var(--green); }
.proj-task-status-overdue     { background: var(--red-soft); color: var(--red); }
.proj-task-title {
  font-weight: var(--fw-medium);
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-task-assignees { display: flex; }
.proj-task-due {
  font-size: var(--text-xs);
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.proj-task-actions { display: flex; gap: 2px; }
.proj-task-actions .msg-act { color: var(--gray-500); }
.proj-task-actions .proj-task-delete:hover { background: var(--red-soft); color: var(--red); }

/* ----- Onglet Fichiers ----- */
.project-file-actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.project-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s-3);
}

/* ===== Galerie médias (onglet projet) ===== */
.project-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--gray-100);
  cursor: pointer;
  display: block;
  transition: transform var(--t-fast) var(--ease-out);
}
.media-tile:hover { transform: scale(1.03); z-index: 1; box-shadow: var(--shadow-md); }
.media-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.media-tile-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  pointer-events: none;
}
.media-tile-play [data-lucide] { width: 36px; height: 36px; fill: currentColor; }
.media-tile-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  background: #d1fae5;
  color: #065f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}
.media-tile-badge [data-lucide] { width: 12px; height: 12px; }

/* Lightbox plein écran */
.media-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.media-lightbox[hidden] { display: none; }
.media-lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.media-lightbox-close:hover { background: rgba(255, 255, 255, .28); }
.media-lightbox-close [data-lucide] { width: 20px; height: 20px; }
.media-lightbox-body {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 20px;
  min-height: 0;
}
.media-lightbox-body img,
.media-lightbox-body video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
}
.media-lightbox-caption {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  padding: 8px 20px 16px;
  text-align: center;
  max-width: 80vw;
  word-break: break-word;
}
.media-lightbox-counter {
  display: block;
  font-size: 12px;
  opacity: .65;
  margin-bottom: 4px;
}
.media-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background var(--t-base);
}
.media-lightbox-nav:hover { background: rgba(255, 255, 255, .28); }
.media-lightbox-nav[hidden] { display: none; }
.media-lightbox-nav [data-lucide] { width: 24px; height: 24px; }
.media-lightbox-prev { left: 16px; }
.media-lightbox-next { right: 16px; }
@media (max-width: 600px) {
  /* Sur mobile : pas de boutons, on utilise le swipe */
  .media-lightbox-nav { display: none !important; }
}
.proj-file-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.proj-file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.proj-file-card img {
  width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--gray-100);
}
.proj-file-icon {
  width: 100%; aspect-ratio: 4 / 3;
  background: var(--gray-100);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
}
.proj-file-icon[data-lucide] { width: auto; height: auto; }
.proj-file-icon { padding: var(--s-4); }
.proj-file-card .proj-file-icon [data-lucide], .proj-file-card > .proj-file-icon { width: 36px; height: 36px; }
.proj-file-info {
  padding: var(--s-2) var(--s-3);
  border-top: 1px solid var(--gray-100);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proj-file-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-file-meta { font-size: var(--text-xs); color: var(--gray-500); }

/* ----- Onglet Équipe ----- */
.project-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.proj-team-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.proj-team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--blue); }
.proj-team-card .member-avatar { width: 44px; height: 44px; }
.proj-team-info { flex: 1; min-width: 0; }
.proj-team-name {
  font-weight: var(--fw-semibold);
  color: var(--gray-900);
  font-size: var(--text-sm);
}
.proj-team-sub { font-size: var(--text-xs); color: var(--gray-500); }

/* ----- Onglet Infos ----- */
.project-info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.project-info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--gray-100);
  gap: var(--s-3);
}
.project-info-row:last-child { border-bottom: none; }
.project-info-row dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  font-weight: var(--fw-semibold);
  align-self: center;
}
.project-info-row dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--gray-900);
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .project-main { padding: var(--s-3); gap: var(--s-3); }
  .project-hero { padding: var(--s-4); }
  .project-hero-info h1 { font-size: var(--text-xl); }
  .proj-task { grid-template-columns: 1fr auto; gap: var(--s-2); padding: var(--s-3); }
  .proj-task-status, .proj-task-assignees, .proj-task-due { display: none; }
  .project-info-row { grid-template-columns: 1fr; }
  .project-info-row dt { padding-bottom: 0; }
}

/* ----- Modal "Supprimer le projet" ----- */
.del-options {
  display: flex; flex-direction: column;
  gap: var(--s-3);
  margin: var(--s-4) 0;
  padding: var(--s-3);
  background: var(--gray-50);
  border-radius: var(--r-sm);
}
.del-options .checkbox-row {
  display: flex; align-items: flex-start;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
}
.del-options input[type=checkbox] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--blue);
  width: 16px; height: 16px;
}
.del-options strong { color: var(--blue-dark); }
.del-confirm-name {
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: var(--r-sm);
  padding: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
}
.del-confirm-name input { margin-top: var(--s-2); width: 100%; }
.btn-primary.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #b51a1a 100%);
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(224, 49, 49, .35);
}
.btn-primary.btn-danger:hover { filter: brightness(1.08); }
.btn-primary.btn-danger:disabled { opacity: .4; cursor: not-allowed; filter: none; box-shadow: none; }

/* =====================================================================
   PROJETS (vague 5) — liste + cards + modal nouveau projet
   ===================================================================== */
.projects-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.projects-toolbar {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
}
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-4);
}

.proj-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}
.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.proj-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.proj-card-name {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.proj-card-status {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.proj-status-active    { background: var(--blue-soft); color: var(--blue-dark); }
.proj-status-done      { background: var(--green-soft); color: var(--green); }
.proj-status-on_hold   { background: var(--gold-soft); color: var(--gold-dark); }
.proj-status-cancelled { background: var(--gray-100); color: var(--gray-600); }

.proj-card-desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--gray-700);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proj-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--text-xs);
  color: var(--gray-600);
}
.proj-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--fw-medium);
}
.proj-card-meta-item [data-lucide] { width: 13px; height: 13px; color: var(--gray-500); }

.proj-card-progress {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.proj-card-progress .proj-gauge { flex: 1; height: 8px; }
.proj-card-pct {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.proj-card-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--s-2);
  border-top: 1px dashed var(--gray-200);
}
.proj-member-stack { display: flex; }
.proj-member-avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  margin-left: -8px;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}
a.proj-member-avatar { transition: transform .15s; }
a.proj-member-avatar:hover { transform: scale(1.1); z-index: 1; }
.proj-member-stack .proj-member-avatar:first-child { margin-left: 0; }
.proj-member-more { background: var(--gray-300); color: var(--gray-700); }

.proj-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.proj-card-cta [data-lucide] { width: 14px; height: 14px; transition: transform var(--t-fast); }
.proj-card:hover .proj-card-cta [data-lucide] { transform: translateX(3px); }

@media (max-width: 720px) {
  .projects-main { padding: var(--s-3); }
  .projects-list { grid-template-columns: 1fr; }
}

/* =====================================================================
   PREUVE DE RÉALISATION (vague 3) — modal d'upload
   ===================================================================== */
.proof-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--r-md);
  padding: var(--s-6);
  text-align: center;
  margin: var(--s-4) 0;
  background: var(--gray-50);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.proof-dropzone p { margin: var(--s-2) 0; color: var(--gray-700); font-size: var(--text-sm); }
.proof-drop-active {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.proof-drop-icon { width: 36px; height: 36px; color: var(--blue); }

.proof-list {
  list-style: none;
  margin: 0 0 var(--s-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  max-height: 220px;
  overflow-y: auto;
}
.proof-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
}
.proof-item [data-lucide]:first-child { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.proof-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-900);
}
.proof-item-size { font-size: var(--text-xs); color: var(--gray-500); font-variant-numeric: tabular-nums; }
.proof-item-rm {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.proof-item-rm:hover { background: var(--red-soft); color: var(--red); }
.proof-item-rm [data-lucide] { width: 14px; height: 14px; }

/* Section "Preuves" dans le détail tâche (admin / consultation) */
.detail-proofs {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--gray-200);
}
.detail-proofs h4 {
  margin: 0 0 var(--s-3);
  font-size: var(--text-sm);
  color: var(--blue-dark);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.detail-proofs h4 [data-lucide] { width: 16px; height: 16px; color: var(--gold-dark); }
.proof-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-2);
}
.proof-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--gray-100);
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.proof-thumb:hover { transform: scale(1.03); box-shadow: var(--shadow-sm); z-index: 1; }
.proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proof-thumb-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-2);
  text-align: center;
}
.proof-thumb-doc [data-lucide] { width: 32px; height: 32px; color: var(--gray-500); margin-bottom: 4px; }
.proof-thumb-doc-name { font-size: 10px; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.proof-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  margin-bottom: 10px;
}
.proof-status [data-lucide] { width: 16px; height: 16px; }
.proof-status-pending { background: #fef3c7; color: #92400e; }
.proof-status-ok { background: #d1fae5; color: #065f46; }

/* =====================================================================
   AVANCEMENT (Gantt par projet) — remplace l'ancien calendrier
   ===================================================================== */
.progress-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.progress-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.proj-section {
  background: #fff;
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.proj-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.proj-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.proj-title [data-lucide] { width: 22px; height: 22px; color: var(--gold-dark); }
.proj-title h3 {
  margin: 0;
  flex: 1;
  font-size: var(--text-xl);
  color: var(--blue-dark);
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
}
.proj-count {
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.proj-gauge {
  width: 100%;
  height: 10px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.proj-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-bright) 100%);
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease-out);
  box-shadow: 0 0 8px rgba(31, 78, 139, .4);
}
.proj-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-progress { background: var(--gold-soft); color: var(--gold-dark); }
.chip-done { background: var(--green-soft); color: var(--green); }

/* ----- Gantt ----- */
.gantt {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  overflow: hidden;
}
.gantt-axis {
  position: relative;
  height: 28px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.gantt-month {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: var(--fw-medium);
  text-transform: capitalize;
  white-space: nowrap;
}
.gantt-today {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--gold);
  z-index: 5;
  pointer-events: none;
}
.gantt-today::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px;
  width: 10px; height: 10px;
  border-radius: var(--r-full);
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 65, .25);
}
.gantt-today-label {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--gold-dark);
  white-space: nowrap;
  background: var(--gold-soft);
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.gantt-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gantt-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--gray-100);
  min-height: 38px;
  position: relative;
}
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: var(--gray-50); }
.gantt-label {
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--gray-900);
  font-weight: var(--fw-medium);
  border-right: 1px solid var(--gray-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 2;
}
.gantt-track {
  position: relative;
  height: 38px;
  /* Ligne verticale "aujourd'hui" prolongée */
  background: linear-gradient(to right, var(--gray-100) 1px, transparent 1px) 0 0 / 100% 100%;
}
.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  border-radius: var(--r-sm);
  background: var(--gray-300);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  cursor: default;
}
.gantt-bar:hover {
  transform: translateY(-50%) scaleY(1.08);
  box-shadow: var(--shadow-sm);
  z-index: 3;
}
.gantt-bar-text {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-bar-todo     { background: linear-gradient(135deg, #94a3b8, #64748b); }
.gantt-bar-progress { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); }
.gantt-bar-done     { background: linear-gradient(135deg, #4ade80, var(--green)); }
.gantt-bar-overdue  { background: linear-gradient(135deg, #f87171, var(--red)); animation: gantt-pulse 2s ease-in-out infinite; }

@keyframes gantt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 49, 49, .35); }
  50%      { box-shadow: 0 0 0 6px rgba(224, 49, 49, 0); }
}

@media (max-width: 720px) {
  .progress-main { padding: var(--s-3); }
  .proj-section { padding: var(--s-4); }
  .gantt-row { grid-template-columns: 130px 1fr; min-height: 34px; }
  .gantt-label { font-size: var(--text-xs); padding: 6px 8px; }
  .gantt-bar { height: 18px; }
  .gantt-bar-text { display: none; }
}

/* =====================================================================
   PROFIL PUBLIC (Phase 13)
   ===================================================================== */
.profil-public-main { max-width: 1100px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }

/* Hero : avatar + nom + bio + liens */
.pp-hero {
  background: linear-gradient(135deg, #fff 0%, var(--blue-soft) 100%);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--s-6);
  align-items: start;
  position: relative;
  overflow: hidden;
}
.pp-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--orange-soft), transparent 70%);
  pointer-events: none;
}
.pp-avatar {
  width: 160px; height: 160px;
  border-radius: var(--r-full);
  background: var(--gray-200);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md), 0 0 0 4px var(--blue);
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pp-avatar .avatar-initials-lg { font-size: var(--text-3xl); color: var(--gray-500); font-weight: var(--fw-bold); }
.pp-hero-info h1 {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
}
.pp-title { margin: 0 0 var(--s-2); color: var(--gray-700); font-size: var(--text-md); font-weight: var(--fw-medium); }
.pp-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  color: var(--gray-700);
  font-weight: var(--fw-medium);
}
.pp-bio {
  margin: var(--s-3) 0 0;
  font-size: var(--text-md);
  color: var(--gray-700);
  line-height: var(--leading-snug);
  max-width: 60ch;
}
.pp-links {
  margin-top: var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.pp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-full);
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--gray-700);
  background: #fff;
  font-weight: var(--fw-medium);
  transition: border-color var(--t-fast), color var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
}
.pp-link:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.pp-edit-btn { align-self: flex-start; position: relative; z-index: 1; }

/* Cartes statistiques */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
}
.pp-stat-card {
  background: #fff;
  border-radius: var(--r-md);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-top: 4px solid var(--blue);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.pp-stat-card:nth-child(2n) { border-top-color: var(--gold); }
.pp-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pp-stat-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: var(--fw-semibold);
}
.pp-stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  color: var(--blue-dark);
  margin: var(--s-2) 0 2px;
  line-height: 1;
  letter-spacing: -.02em;
}
.pp-stat-sub { font-size: var(--text-xs); color: var(--gray-500); }

/* Historique */
.pp-history-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--gray-700);
  flex-wrap: wrap;
}
.pp-leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.pp-history-svg { width: 100%; height: auto; }
.pp-history-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

.pp-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-900);
  white-space: pre-wrap;
  margin: 0;
}

.pp-admin-edit {
  border-left: 4px solid var(--orange);
}

.profil-section-title {
  margin: 8px 0 4px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
}

/* Mobile */
@media (max-width: 720px) {
  .pp-hero { grid-template-columns: 1fr; text-align: center; }
  .pp-avatar { margin: 0 auto; width: 110px; height: 110px; }
  .pp-edit-btn { justify-self: center; }
  .pp-links { justify-content: center; }
  .pp-hero-info h1 { font-size: 22px; }
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
  .pp-stat-value { font-size: 26px; }
  .profil-public-main { padding: 12px; }
}

/* =========================================================
   PWA mobile : empêcher dépassement écran + pinch-zoom
   Cible uniquement mobile (≤768px) → laisse intacte la version PC
   ========================================================= */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
    touch-action: pan-y;          /* autorise scroll vertical, bloque pinch */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body, body * {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Empêche les images / vidéos de déborder */
  img, video, iframe, table, pre, code {
    max-width: 100% !important;
    height: auto;
  }
  /* Tables qui débordent → scroll horizontal interne, pas global */
  table { display: block; overflow-x: auto; }
}

/* Mode PWA standalone (app installée, pas onglet navigateur) :
   désactive le double-tap zoom et le pinch sur tous écrans tactiles */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { touch-action: manipulation; }
}

/* =========================================================
   iOS Safe Area : décale le header sous l'encoche / Dynamic Island
   et le FAB au-dessus de la barre Home indicator
   ========================================================= */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
    padding-right: calc(env(safe-area-inset-right, 0px) + 14px);
  }
  .app-body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* FAB chat : remonté au-dessus de la barre Home */
  .chat-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    right: calc(env(safe-area-inset-right, 0px) + 16px);
  }
}
