/* ============================================================
   myDYCAST – Design System « Éditorial Mono »
   Repris du site vitrine dycast.fr : canvas crème, encre quasi
   noire, filets 14 %, pilules, cartes blanches à élévation douce.
   Sobre, monochrome, pensé workflow. Les couleurs restent
   réservées aux statuts (badges, alertes, indicateurs).
   ============================================================ */

/* ── Polices auto-hébergées (fichiers exacts du site vitrine) ── */
@font-face{
  font-family:'Geist Sans';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('../fonts/geist-sans-variable.woff2') format('woff2');
}
@font-face{
  font-family:'Instrument Sans';
  font-style:normal;
  font-weight:400 700;
  font-display:swap;
  src:url('../fonts/instrument-sans-variable.woff2') format('woff2');
}
@font-face{
  font-family:'Geist Mono';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('../fonts/geist-mono-variable.woff2') format('woff2');
}
/* Compat : quelques styles de page référencent encore JetBrains Mono */
@font-face{
  font-family:'JetBrains Mono';
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:url('../fonts/jetbrainsmono-400-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'JetBrains Mono';
  font-style:normal;
  font-weight:500;
  font-display:swap;
  src:url('../fonts/jetbrainsmono-500-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 1. Tokens & thèmes ─────────────────────────────────── */
:root {
  /* Piles typographiques */
  --font-sans:    'Geist Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Sans', 'Geist Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;

  /* Échelle monochrome chaude (alignée sur dycast.fr) */
  --ink-0:   #ffffff;
  --ink-50:  #fafaf8;
  --ink-100: #f4f4f1;
  --ink-150: #eeeeea;
  --ink-200: #e6e6e2;
  --ink-300: #d4d4cf;
  --ink-400: #a3a39a;
  --ink-500: #73736b;
  --ink-600: #55554e;
  --ink-700: #3f3f3a;
  --ink-800: #292926;
  --ink-850: #1d1d1b;
  --ink-900: #161615;
  --ink-950: #0c0c0b;

  /* Statuts (réservés aux badges/alerts/indicateurs) */
  --success:    #1a8043;
  --success-bg: rgba(26,128,67,.10);
  --warning:    #b96d0a;
  --warning-bg: rgba(185,109,10,.10);
  --danger:     #c93030;
  --danger-bg:  rgba(201,48,48,.10);
  --info:       #3061c9;
  --info-bg:    rgba(48,97,201,.10);
  --violet:     #6f52c4;
  --violet-bg:  rgba(111,82,196,.10);
  --teal:       #12857a;
  --teal-bg:    rgba(18,133,122,.10);
  --rose:       #c33a63;
  --rose-bg:    rgba(195,58,99,.10);

  /* Rayons (échelle du site vitrine : card 20px, panel 24px) */
  --r-xs: 8px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Animations */
  --ease: cubic-bezier(.22,1,.36,1);
  --t-fast: .15s var(--ease);
  --t:      .3s var(--ease);
  --t-slow: .5s var(--ease);

  /* Layout */
  --rail-w-open:   252px;   /* rail toujours déployé */
  --rail-panel-w:  196px;   /* colonne des sous-menus, à droite du rail */
  --rail-panel-gap: 8px;
  --topbar-h:      62px;
  --bottom-nav-h:  62px;
  --shell-pad:     16px;
}

/* ── Thème clair (par défaut) ─────────────────────────── */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg:           #fafaf8;   /* canvas vitrine */
  --bg-deep:      #f2f2ef;
  --surface:      #ffffff;
  --surface-2:    #fafaf8;
  --surface-3:    #f4f4f1;
  --text:         var(--ink-950);
  --text-muted:   var(--ink-600);
  --text-soft:    #8f8f86;
  --badge-warning-text: #94600c;
  --border:       rgba(12,12,11,.14);   /* la « line » vitrine : encre à 14 % */
  --border-strong:rgba(12,12,11,.28);
  --primary:      var(--ink-950);
  --on-primary:   var(--ink-50);

  /* Ombres (élévation douce vitrine) */
  --shadow-card:  0 1px 2px rgba(12,12,11,.04);
  --shadow-lift:  0 18px 50px rgba(0,0,0,.10);
  --shadow-pop:   0 24px 70px -18px rgba(12,12,11,.28);

  /* Compat « glass » : surfaces désormais planes */
  --glass-bg:        var(--surface);
  --glass-bg-strong: var(--surface);
  --glass-bg-subtle: var(--surface);
  --glass-border:    var(--border);
  --glass-highlight: transparent;
  --glass-blur:      0px;
  --glass-saturate:  100%;
  --glass-shadow:    var(--shadow-card);

  /* Orbes d'ambiance supprimées (design sobre) */
  --orb-1: transparent;
  --orb-2: transparent;
  --orb-3: transparent;

  --hover-bg:  rgba(12,12,11,.05);
  --active-bg: rgba(12,12,11,.08);

  /* Voile translucide de la topbar (header vitrine : canvas 80 % + blur) */
  --veil: rgba(250,250,248,.8);
}

/* ── Thème sombre (même ADN, encre inversée) ──────────── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:           #0c0c0b;
  --bg-deep:      #080807;
  --surface:      #161615;
  --surface-2:    #1b1b19;
  --surface-3:    #232321;
  --text:         var(--ink-50);
  --text-muted:   var(--ink-400);
  --text-soft:    var(--ink-500);
  --badge-warning-text: #d79b3e;
  --border:       rgba(250,250,248,.13);
  --border-strong:rgba(250,250,248,.26);
  --primary:      var(--ink-50);
  --on-primary:   var(--ink-950);

  --shadow-card:  0 1px 2px rgba(0,0,0,.3);
  --shadow-lift:  0 18px 50px rgba(0,0,0,.45);
  --shadow-pop:   0 24px 70px -18px rgba(0,0,0,.7);

  --glass-bg:        var(--surface);
  --glass-bg-strong: var(--surface);
  --glass-bg-subtle: var(--surface);
  --glass-border:    var(--border);
  --glass-highlight: transparent;
  --glass-shadow:    var(--shadow-card);

  --orb-1: transparent;
  --orb-2: transparent;
  --orb-3: transparent;

  --hover-bg:  rgba(250,250,248,.06);
  --active-bg: rgba(250,250,248,.1);

  --veil: rgba(12,12,11,.8);
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; }

a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }

img, svg { max-width: 100%; display: block; }
video, iframe, canvas, embed, object { max-width: 100%; }
pre { overflow-x: auto; max-width: 100%; }
button { font-family: inherit; }

/* Tactile : supprime le délai/zoom du double-tap sur les contrôles */
a, button, input, select, textarea, label { touch-action: manipulation; }

/* ── Zoom désactivé sur écran tactile (application installable) ──
   Trois verrous complémentaires, aucun ne suffisant seul :
   • la méta viewport (admin_header.php) porte maximum-scale/user-scalable ;
   • « touch-action: manipulation » sur toute la page neutralise la double tape,
     y compris hors des contrôles listés ci-dessus ;
   • les champs sont ramenés à 16 px : en deçà, iOS zoome à la prise de focus
     quoi qu'affirme la méta viewport, et ne dézoome jamais complètement ensuite.
   Le pincement à deux doigts, lui, est annulé en JS (iOS ignore user-scalable). */
@media (pointer: coarse) {
  body { touch-action: manipulation; }

  input, select, textarea,
  .form-control, .form-select {
    font-size: 16px;
  }
}

/* Coupure propre des chaînes longues (e-mails, URL, clés) */
.break-any { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

/* ── Focus visible (accessibilité clavier) ─────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ── 2. Fond d'ambiance (canvas uni, orbes neutralisées) ─ */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}
.ambient-bg::before,
.ambient-bg::after,
.ambient-bg > .orb { display: none; }

/* ── 3. Surfaces (ex-primitives glass, désormais planes) ── */
.glass,
.glass-strong,
.glass-subtle {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.glass-card-interactive {
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.glass-card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}

/* ── 4. Layout shell ──────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Rail / Sidebar — panneau blanc à filet, comme une carte vitrine.
   Toujours déployé sur poste de travail : pas de repli au survol, la
   navigation reste lisible en permanence. */
.rail {
  position: fixed;
  top: var(--shell-pad);
  bottom: var(--shell-pad);
  left: var(--shell-pad);
  width: var(--rail-w-open);
  z-index: 80;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
}

.rail-header {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  flex-shrink: 0;
}

/* Plaque de marque : le wordmark DYCAST entier, blanc sur fond noir.
   Le PNG source est blanc sur transparent — c'est la plaque noire qui le rend
   lisible, et il s'affiche à l'identique dans les deux thèmes. */
.rail-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: #000;
  box-shadow: 0 8px 22px -10px rgba(0,0,0,.55);
}

.rail-logo img {
  display: block;
  width: 100%;
  max-width: 146px;
  height: auto;
}

.rail-brand {
  text-align: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
  white-space: nowrap;
}
.rail-brand small { display: block; font-family: var(--font-sans); font-size: 10px; font-weight: 500; color: var(--text-muted); letter-spacing: .14em; text-transform: uppercase; }

.rail-pin {
  margin-left: auto;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  cursor: pointer;
  display: none;   /* rail toujours déployé : l'épinglage n'a plus d'objet */
  place-items: center;
}

.rail-nav {
  padding: 6px 10px 16px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.rail-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 16px 12px 6px;
  white-space: nowrap;
}

/* Items de nav en pilule (nav du site vitrine) */
.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 2px 0;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.rail-item:hover { background: var(--hover-bg); color: var(--text); }

.rail-item.active {
  background: var(--active-bg);
  color: var(--text);
  font-weight: 600;
}

.rail-item .icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  stroke-width: 1.7;
}

.rail-badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Pastille de la nav : le rail étant toujours déployé, le badge chiffré suffit. */
.rail-item .dot { display: none; }

button.rail-item {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
}
.rail-item .label { flex: 1; min-width: 0; }
.rail-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: .55;
}

/* Colonne des sous-menus : à droite du rail, même hauteur, même verre. */
.rail-panel {
  position: fixed;
  top: var(--shell-pad);
  bottom: var(--shell-pad);
  left: calc(var(--shell-pad) + var(--rail-w-open) + var(--rail-panel-gap));
  width: var(--rail-panel-w);
  /* Sous la barre du haut (70) : quand la colonne se déploie par-dessus le
     contenu — fenêtre étroite, tiroir mobile — c'est la barre qui reste
     au premier plan, jamais le sous-menu. */
  z-index: 69;
  display: none;
  flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
}
.rail-panel.is-visible { display: flex; }
.rail-panel-head {
  flex-shrink: 0;
  padding: 16px 16px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.rail-panel-nav {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
}
.rail-panel-nav.is-active { display: flex; flex-direction: column; }
.rail-panel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  min-width: 0;
}
.rail-panel-item:hover { background: var(--hover-bg); color: var(--text); }
.rail-panel-item.active {
  background: var(--active-bg);
  color: var(--text);
  font-weight: 600;
}
.rail-panel-item .rail-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 6px;
  min-width: 16px;
}
.rail-panel-item .rail-sub-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.layout.has-rail-panel .main-content {
  margin-left: calc(var(--rail-w-open) + var(--rail-panel-w) + var(--rail-panel-gap) + var(--shell-pad) * 2);
}

.rail-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-footer .avatar { flex-shrink: 0; }
.rail-footer-meta {
  flex: 1;
  min-width: 0;
}

.rail-footer-meta .name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-footer-meta .role {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-footer-logout {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--t-fast);
}
.rail-footer-logout:hover { background: var(--hover-bg); color: var(--danger); }

/* Main content area */
.main-content {
  margin-left: calc(var(--rail-w-open) + var(--shell-pad) * 2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Sans cela, un contenu large (tableau Kanban, table) impose sa largeur
     minimale au conteneur : c'est la PAGE entière qui défile latéralement,
     emportant la barre supérieure hors de l'écran. */
  min-width: 0;
}


/* ── 5. Topbar — voile translucide + blur (header vitrine) ─ */
.topbar {
  height: var(--topbar-h);
  margin: var(--shell-pad) var(--shell-pad) 0 0;
  padding: 0 16px;
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: var(--shell-pad);
  z-index: 70;
  background: var(--veil);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: none;
}

.topbar-mobile-menu {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--r-pill);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.topbar-mobile-menu:hover { background: var(--hover-bg); }

.topbar-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
  margin: 0 auto;
}
.topbar-search:hover { border-color: var(--border-strong); color: var(--text); }
.topbar-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar-search .placeholder { flex: 1; text-align: left; }
.topbar-search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.icon-btn {
  width: 38px; height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--hover-bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.7; }

.icon-btn .pip {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 9.5px;
  font-weight: 700;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  font-variant-numeric: tabular-nums;
}

/* Chrono dans la topbar */
.timer-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.timer-chip:hover { border-color: var(--border-strong); background: var(--hover-bg); }

.timer-chip .timer-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
  flex-shrink: 0;
}
.timer-chip.running { color: var(--danger); border-color: rgba(201,48,48,.35); }
.timer-chip.running .timer-dot {
  background: var(--danger);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }

.timer-chip svg { width: 13px; height: 13px; }

/* Composeur d’appel, à côté du chrono */
.voip-compose-panel {
  width: 280px;
  min-width: 280px;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 400;
}
.dropdown.voip-compose-panel.open { display: flex; }
.voip-compose-panel__titre {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.voip-compose-panel .form-control { font-size: 16px; letter-spacing: .02em; }
.voip-compose-panel .btn { width: 100%; justify-content: center; }

/* User menu */
.user-menu { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  transition: background var(--t-fast);
}
.user-btn:hover { background: var(--hover-bg); }
.user-btn .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-btn .chevron { width: 12px; height: 12px; color: var(--text-muted); transition: transform var(--t-fast); }
.user-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ── 6. Page content ──────────────────────────────────── */
.page-content {
  padding: 26px var(--shell-pad) calc(var(--shell-pad) + var(--bottom-nav-h));
  flex: 1;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-header-left { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.1;
}

.page-header .breadcrumb {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-soft); }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Micro-label éditorial (« eyebrow » vitrine) */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── 7. Dropdown ──────────────────────────────────────── */
.dropdown {
  position: absolute;
  right: 0; top: calc(100% + 10px);
  min-width: 220px;
  border-radius: var(--r);
  padding: 6px;
  z-index: 200;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.dropdown.open { display: block; animation: popIn .16s var(--ease); }

@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--hover-bg); color: var(--text); }
/* Variante bouton (actions sans navigation, ex. installation de l'application) */
button.dropdown-item { width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 13px; }
button.dropdown-item[hidden] { display: none; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; border: none; }

.dropdown-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Sélecteur de thème inline */
.theme-toggle {
  display: flex;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.theme-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.theme-toggle button svg { width: 13px; height: 13px; }

/* ── 8. Cartes & tuiles de métriques ──────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.tk-section { margin: 8px 0 32px; }
.tk-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.tk-count {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  min-width: 22px;
  text-align: center;
}
.tk-empty {
  margin: 0;
  padding: 22px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.tk-table tbody td { padding: 16px 18px; }
.tk-num {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.tk-subject {
  display: block;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  line-height: 1.35;
}
.tk-subject:hover { color: var(--text); }
.tk-meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.tk-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-when {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

/* Tuile de métrique */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  position: relative;
  overflow: hidden;
}
.metric-tile:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
.metric-tile.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.metric-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-tile-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.metric-tile-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.metric-tile-icon svg { width: 16px; height: 16px; }

.metric-tile-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.1;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.metric-tile-value small { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }

.metric-tile-trend {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.metric-tile-trend.up { color: var(--success); }
.metric-tile-trend.down { color: var(--danger); }

/* ── Cartes de service (portail client) ────────────────── */
.svc-section { display:flex; justify-content:space-between; align-items:baseline; gap:12px;
  flex-wrap:wrap; margin:4px 0 12px; }
.svc-section h2 { margin:0; font-size:1.05rem; letter-spacing:-.03em; }
.svc-group { margin:0 0 22px; }
.svc-group-title { display:flex; align-items:baseline; gap:8px; margin:0 0 10px;
  font-family:var(--font-display); font-size:13px; font-weight:600; letter-spacing:-.01em; }
.svc-group-title span { font-size:12px; font-weight:500; color:var(--text-muted); }

.svc-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; }
.svc-card { display:flex; flex-direction:column; border:1px solid var(--border); border-radius:16px;
  background:var(--surface); box-shadow:var(--shadow-card); overflow:hidden; position:relative;
  transition:border-color var(--t), box-shadow var(--t), transform var(--t); }
.svc-card:hover { border-color:var(--border-strong); box-shadow:var(--shadow-lift); transform:translateY(-2px); }
.svc-card-hit { position:absolute; inset:0; z-index:1; }
.svc-links { margin-top:auto; padding:10px 12px 12px; display:flex; flex-wrap:wrap; gap:6px;
  position:relative; z-index:2; }

.svc-stage { position:relative; isolation:isolate; }
.svc-stage-web { padding:8px 8px 0; background:var(--surface-3); }
.svc-stage-app { display:flex; align-items:flex-end; justify-content:center; min-height:148px;
  padding:14px 10px 0; background:var(--surface-3); }

.svc-browser { display:block; border:1px solid var(--border); border-bottom:0; border-radius:10px 10px 0 0;
  overflow:hidden; background:var(--surface); color:inherit; text-decoration:none; }
.svc-browser-bar { display:flex; align-items:center; gap:6px; height:22px; padding:0 8px;
  background:var(--surface-2); border-bottom:1px solid var(--border); }
.svc-browser-dots { display:flex; gap:4px; flex:0 0 auto; }
.svc-browser-dots i { width:5px; height:5px; border-radius:50%; background:var(--border-strong); display:block; }
.svc-browser-url { flex:1; min-width:0; font-size:10px; color:var(--text-muted); background:var(--surface-3);
  border-radius:4px; padding:1px 7px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.svc-browser-view { position:relative; aspect-ratio:16/9; overflow:hidden; background:var(--surface-3); }
.svc-browser-view img { width:100%; height:100%; object-fit:cover; object-position:top center; display:block;
  transition:transform .4s var(--ease); }
.svc-card:hover .svc-browser-view img { transform:scale(1.03); }

.svc-phones { display:flex; gap:10px; overflow-x:auto; max-width:100%; padding:0 2px 6px;
  scroll-snap-type:x mandatory; scrollbar-width:none; }
.svc-phones::-webkit-scrollbar { display:none; }
.svc-iphone { position:relative; flex:0 0 auto; width:72px; aspect-ratio:9/19.5; border-radius:14px;
  background:#111; padding:4px; scroll-snap-align:center; text-decoration:none; color:inherit;
  box-shadow:0 0 0 1px rgba(255,255,255,.1), 0 12px 24px -12px rgba(0,0,0,.5); }
.svc-iphone::before { content:""; position:absolute; z-index:2; top:7px; left:50%; width:34%; height:7px;
  transform:translateX(-50%); border-radius:999px; background:#000; }
.svc-iphone-screen { width:100%; height:100%; border-radius:11px; overflow:hidden; background:#1c1c1c; }
.svc-iphone-screen img { width:100%; height:100%; object-fit:cover; object-position:top center; display:block; }
.svc-iphone.is-empty { box-shadow:0 0 0 1px var(--border); background:var(--surface); }
.svc-iphone.is-empty::before { background:var(--ink-800); }
[data-theme="light"] .svc-iphone.is-empty::before { background:var(--ink-300); }

.svc-shot-empty { display:grid; place-items:center; place-content:center; height:100%; color:var(--text-soft);
  gap:4px; text-align:center; padding:8px; }
.svc-shot-empty svg { width:18px; height:18px; stroke-width:1.5; }
.svc-shot-empty span { font-size:10.5px; line-height:1.3; }

.svc-body { padding:10px 12px 2px; display:flex; align-items:flex-start; gap:8px; }
.svc-head-main { flex:1; min-width:0; }
.svc-name { font-family:var(--font-display); font-weight:600; font-size:13.5px; line-height:1.25; margin:0;
  display:flex; align-items:center; gap:7px; letter-spacing:-.02em; }
.svc-name span.n { overflow-wrap:anywhere; min-width:0; }
.svc-cat { font-size:11px; color:var(--text-muted); margin-top:2px; display:block; }
.svc-badges { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex:0 0 auto; }

.svc-specs { padding:8px 12px 0; display:grid; grid-template-columns:repeat(auto-fit, minmax(110px, 1fr)); gap:6px 10px; }
.svc-spec { min-width:0; }
.svc-spec-label { font-size:9.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-soft); }
.svc-spec-val { font-size:11.5px; color:var(--text); font-weight:500; overflow-wrap:anywhere; margin-top:1px; }
.svc-spec-val a { color:var(--text); text-decoration:underline; text-underline-offset:2px;
  text-decoration-color:color-mix(in oklab, currentColor 40%, transparent); }
.svc-dom-warn { color:var(--badge-warning-text); font-weight:600; }
.svc-dom-exp { color:var(--danger); font-weight:700; }

.svc-pill { display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border-radius:var(--r-pill);
  border:1px solid var(--border); font-size:11px; font-weight:500; color:var(--text); text-decoration:none;
  background:var(--surface-2); transition:border-color .15s, background .15s; }
.svc-pill:hover { border-color:var(--border-strong); background:var(--hover-bg); color:var(--text); }
.svc-pill.is-primary { background:var(--primary); color:var(--on-primary); border-color:transparent; }
.svc-pill.is-primary:hover { filter:brightness(1.08); color:var(--on-primary); }
.svc-pill svg { width:12px; height:12px; }
.svc-tickets-flag { display:inline-flex; align-items:center; gap:4px; color:var(--badge-warning-text);
  font-weight:600; font-size:11px; text-decoration:none; }
@media (max-width:520px){ .svc-grid { grid-template-columns:1fr; } }

/* ── Fiche d'un service (client/service.php) ───────────────
   Refaite le 2026-09-20. L'aperçu du site n'est plus une
   vignette de 40 % dans un en-tête : c'est la pièce
   maîtresse, à côté d'une colonne qui répond aux quatre
   questions du client — est-ce en ligne, où est-ce hébergé,
   sur quoi, et qu'est-ce que j'ouvre. Le reste passe en
   cartes sous les onglets. */

.svcx-vue { display:grid; gap:16px; margin:0 0 22px; }
@media (min-width:1000px){ .svcx-vue { grid-template-columns:minmax(0,1.55fr) minmax(290px,1fr); align-items:start; } }

.svcx-apercu { margin:0; display:flex; flex-direction:column; gap:9px; min-width:0; }
.svcx-chrome { border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--surface);
  box-shadow:var(--shadow-card); }
.svcx-chrome__barre { display:flex; align-items:center; gap:9px; height:36px; padding:0 12px;
  background:var(--surface-2); border-bottom:1px solid var(--border); }
.svcx-chrome__dots { display:flex; gap:5px; flex:0 0 auto; }
.svcx-chrome__dots i { width:8px; height:8px; border-radius:50%; background:var(--border-strong); display:block; }
.svcx-chrome__url { flex:1; min-width:0; font-family:var(--font-mono, ui-monospace, monospace); font-size:11.5px;
  color:var(--text-muted); background:var(--surface); border:1px solid var(--border); border-radius:var(--r-pill);
  padding:3px 11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.svcx-chrome__lien { flex:0 0 auto; display:inline-flex; color:var(--text-muted); }
.svcx-chrome__lien:hover { color:var(--text); }
.svcx-chrome__lien svg { width:14px; height:14px; }
.svcx-chrome__vue { display:block; position:relative; aspect-ratio:16/10; overflow:hidden; background:var(--surface-3); }
.svcx-chrome__vue img { width:100%; height:100%; object-fit:cover; object-position:top center; display:block;
  transition:transform .6s cubic-bezier(.2,.7,.3,1); }
.svcx-chrome__vue:hover img { transform:scale(1.025); }
.svcx-chrome .svc-stage-app { min-height:300px; aspect-ratio:auto; padding:22px 12px 18px; }
.svcx-chrome .svc-iphone { width:146px; }
.svcx-legende { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:center; font-size:11.5px; color:var(--text-muted); }
.svcx-legende .sep { opacity:.5; }

.svcx-resume { border:1px solid var(--border); border-radius:16px; background:var(--surface);
  padding:16px 18px 18px; display:flex; flex-direction:column; gap:15px; min-width:0; }
.svcx-etat { display:flex; align-items:center; gap:11px; padding:11px 13px; border-radius:13px; background:var(--surface-2); }
.svcx-etat > i { width:10px; height:10px; border-radius:50%; flex:0 0 auto; background:var(--text-soft); }
.svcx-etat.is-up > i { background:var(--success); animation:svc-pulse 1.8s ease-out infinite;
  box-shadow:0 0 0 0 rgba(26,128,67,.55); }
.svcx-etat.is-down > i { background:var(--danger); }
.svcx-etat.is-pause > i { background:var(--badge-warning-text, #b45309); }
.svcx-etat b { display:block; font-size:14px; font-weight:650; line-height:1.3; }
.svcx-etat small { display:block; font-size:11.5px; color:var(--text-muted); }
.svcx-faits { margin:0; display:grid; gap:11px; }
.svcx-faits > div { display:grid; grid-template-columns:86px minmax(0,1fr); gap:10px; align-items:baseline; }
.svcx-faits dt { font-size:9.5px; text-transform:uppercase; letter-spacing:.09em; color:var(--text-soft); line-height:1.6; }
.svcx-faits dd { margin:0; font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
.svcx-faits dd a { color:var(--text); text-decoration:underline; text-underline-offset:2px;
  text-decoration-color:var(--border-strong); }
.svcx-faits dd a:hover { text-decoration-color:currentColor; }
.svcx-faits .tech-chips { gap:5px; }
.svcx-boutons { display:flex; flex-wrap:wrap; gap:8px; padding-top:2px; }

.svcx-cartes { display:grid; gap:16px; }
@media (min-width:1120px){ .svcx-cartes.-paire { grid-template-columns:repeat(2, minmax(0,1fr)); align-items:start; } }
.svcx-carte { border:1px solid var(--border); border-radius:16px; background:var(--surface);
  padding:18px 20px 20px; display:flex; flex-direction:column; gap:15px; min-width:0; }
.svcx-carte__hd { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:baseline; justify-content:space-between; }
.svcx-carte__hd h3 { margin:0; font-family:var(--font-display); font-size:15.5px; letter-spacing:-.02em; }
.svcx-carte__k { font-size:11.5px; color:var(--text-muted); }
.svcx-carte__chapo { margin:-8px 0 0; font-size:13px; line-height:1.55; color:var(--text-muted); }

.svcx-sla { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.svcx-sla__col { display:flex; flex-direction:column; gap:6px; min-width:0; }
.svcx-sla__k { font-size:9.5px; text-transform:uppercase; letter-spacing:.09em; color:var(--text-soft); }
.svcx-sla__v { font-family:var(--font-display); font-size:21px; font-weight:600; letter-spacing:-.03em;
  font-variant-numeric:tabular-nums; line-height:1.1; }
.svcx-sla__v.is-good { color:var(--success); }
.svcx-sla__v.is-ok { color:var(--badge-warning-text, #b45309); }
.svcx-sla__v.is-bad { color:var(--danger); }

.svcx-liste { display:flex; flex-direction:column; gap:8px; }
.svcx-ligne { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap;
  padding:11px 13px; border:1px solid var(--border); border-radius:13px; background:var(--surface-2); }
.svcx-ligne__t { font-size:13.5px; font-weight:600; }
.svcx-ligne__d { font-size:12px; color:var(--text-muted); margin-top:2px; }
.svcx-vide { padding:18px 4px; font-size:13px; color:var(--text-muted); }

.svcx-maj { list-style:none; margin:0; padding:0; display:grid; gap:7px; }
.svcx-maj li { display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; font-size:13px; }
.svcx-maj .d { min-width:92px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.svcx-maj .v { color:var(--text-muted); }

/* `.tabs` est déclaré plus bas dans cette feuille : à spécificité égale il
   l'emporterait, d'où le sélecteur qualifié. */
nav.tabs.svcx-tabs { margin-bottom:20px; }
.svcx-outils { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between;
  margin:0 0 14px; }
.svcx-outils p { margin:0; }
.svcx-outils__actions { display:flex; flex-wrap:wrap; gap:8px; }

.svc-live { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:650; padding:4px 10px;
  border-radius:var(--r-pill); border:1px solid var(--border); background:var(--surface-2); }
.svc-live i { width:8px; height:8px; border-radius:50%; background:currentColor; }
.svc-live.is-up { color:var(--success); background:var(--success-bg); border-color:transparent; }
.svc-live.is-down { color:var(--danger); background:var(--danger-bg); border-color:transparent; }
.svc-live.is-up i { box-shadow:0 0 0 0 rgba(26,128,67,.55); animation:svc-pulse 1.8s ease-out infinite; }
@keyframes svc-pulse { 70% { box-shadow:0 0 0 8px transparent; } 100% { box-shadow:0 0 0 0 transparent; } }

.dns-name { font-weight:600; overflow-wrap:anywhere; }
.dns-content { font-family:var(--font-mono, ui-monospace, monospace); font-size:12.5px; overflow-wrap:anywhere; }
.dns-note { font-size:12px; color:var(--text-muted); margin-top:3px; }
.dns-lock { display:inline-flex; gap:6px; align-items:center; font-size:12.5px; color:var(--text-muted); }

.svc-uptime-track { height:7px; border-radius:99px; background:var(--surface-2, #e5e7eb); overflow:hidden; }
.svc-uptime-fill { display:block; height:100%; border-radius:inherit; background:var(--text-soft); }
.svc-uptime-fill.is-good { background:var(--success, #16a34a); }
.svc-uptime-fill.is-ok { background:var(--badge-warning-text, #d97706); }
.svc-uptime-fill.is-bad { background:var(--danger, #dc2626); }

/* ── 9. Boutons — pilules vitrine ─────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t), transform var(--t);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  font-family: inherit;
  position: relative;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; stroke-width: 1.8; }

/* Formulaire déjà soumis (anti double-clic, voir app.js) : le bouton reste dans
   le DOM avec son name/value, mais n'est plus cliquable. */
.is-submitting {
  opacity: .6;
  pointer-events: none;
  cursor: progress;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary);
  color: var(--on-primary);
  opacity: .85;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--hover-bg); color: var(--text); }

.btn-glass {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-glass:hover { border-color: var(--border-strong); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; opacity: .85; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; opacity: .85; }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; opacity: .85; }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 12px 26px; font-size: 14.5px; }
.btn-icon { padding: 0; width: 36px; height: 36px; }

/* Segmented control (switch de vues) */
.segmented {
  display: inline-flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.segmented button,
.segmented a {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color var(--t-fast);
  font-family: inherit;
}
.segmented button:hover,
.segmented a:hover { color: var(--text); }
.segmented .active,
.segmented [aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.segmented svg { width: 13px; height: 13px; }

/* ── 10. Badges & chips ────────────────────────────────── */

/* Priorité en « barres de signal » : rendu de la liste des tickets, partagé
   avec le hub « Mon travail ». Le niveau est porté par data-prio et le
   remplissage se fait ici — changer la priorité côté client ne réécrit donc
   que cet attribut. Les tâches (« Urgente »/« Basse ») partagent les niveaux
   des tickets (« Critique »/« Faible »), comme pour les libellés. */
.prio-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.prio-bars i { display: block; width: 4px; border-radius: 1px; background: var(--border); }
.prio-bars i:nth-child(1) { height: 7px; }
.prio-bars i:nth-child(2) { height: 10px; }
.prio-bars i:nth-child(3) { height: 13px; }
.prio-bars i:nth-child(4) { height: 16px; }
.prio-bars[data-prio="Faible"]   i:nth-child(-n+1),
.prio-bars[data-prio="Basse"]    i:nth-child(-n+1) { background: var(--text-soft); }
.prio-bars[data-prio="Normale"]  i:nth-child(-n+2) { background: var(--info); }
.prio-bars[data-prio="Haute"]    i:nth-child(-n+3) { background: var(--warning); }
.prio-bars[data-prio="Critique"] i,
.prio-bars[data-prio="Urgente"]  i { background: var(--danger); }

/* Priorité modifiable sur place (priorityPicker) : un <select> natif rendu
   transparent et étiré par-dessus les barres. Le rendu reste celui de la liste,
   mais toute la zone ouvre le menu — le natif est aussi ce qui marche le mieux
   au doigt. Partagé par la liste des tickets et le hub « Mon travail ». */
.prio-pick-wrap { position: relative; display: inline-flex; align-items: center; }
.prio-pick {
  position: absolute; inset: -4px -6px; width: auto; height: auto;
  opacity: 0; cursor: pointer; font: inherit; border: 0; padding: 0;
}
.prio-pick:focus-visible + .prio-bars,
.prio-pick-wrap:has(.prio-pick:focus-visible) { outline: 2px solid var(--info); outline-offset: 3px; border-radius: 2px; }
.prio-pick-wrap:hover .prio-bars i { opacity: .75; }
.prio-pick:disabled { cursor: progress; }
@media (max-width: 900px) { .prio-pick { max-width: 88px; } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.3;
}

.badge-blue   { background: var(--info-bg);    color: var(--info);    border-color: rgba(48,97,201,.16); }
.badge-green  { background: var(--success-bg); color: var(--success); border-color: rgba(26,128,67,.16); }
.badge-red    { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(201,48,48,.16); }
.badge-yellow { background: var(--warning-bg); color: var(--badge-warning-text); border-color: rgba(185,109,10,.16); }
.badge-orange { background: var(--warning-bg); color: var(--badge-warning-text); border-color: rgba(185,109,10,.16); }
.badge-purple { background: var(--violet-bg);  color: var(--violet);  border-color: rgba(111,82,196,.16); }
.badge-indigo { background: var(--info-bg);    color: var(--info);    border-color: rgba(48,97,201,.16); }
.badge-teal   { background: var(--teal-bg);    color: var(--teal);    border-color: rgba(18,133,122,.16); }
.badge-slate,
.badge-gray   { background: var(--surface-3);  color: var(--text-muted); border-color: var(--border); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.chip svg { width: 11px; height: 11px; stroke-width: 2.2; }

.chip-task    { background: var(--info-bg);    color: var(--info);    border-color: rgba(48,97,201,.18); }
.chip-ticket  { background: var(--rose-bg);    color: var(--rose);    border-color: rgba(195,58,99,.18); }
.chip-activity{ background: var(--teal-bg);    color: var(--teal);    border-color: rgba(18,133,122,.18); }
.chip-project { background: var(--violet-bg);  color: var(--violet);  border-color: rgba(111,82,196,.18); }
.chip-client  { background: var(--warning-bg); color: var(--badge-warning-text); border-color: rgba(185,109,10,.18); }
.chip-warning { background: var(--warning-bg); color: var(--badge-warning-text); border-color: rgba(185,109,10,.2); }
.chip-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(48,97,201,.2); }

/* ── 11. Formulaires ──────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none;
  appearance: none;
}
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--hover-bg);
}
.form-control::placeholder { color: var(--text-soft); }
.form-control:disabled { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.55; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2373736b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ── 12. Alertes ──────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
  background: var(--surface);
}
.alert-icon { font-size: 15px; flex-shrink: 0; line-height: 1.3; }

.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(26,128,67,.22); }
.alert-error,
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(201,48,48,.22); }
.alert-warning { background: var(--warning-bg); color: var(--badge-warning-text); border-color: rgba(185,109,10,.22); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(48,97,201,.22); }

/* ── 13. Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--hover-bg); }
tbody tr.row-link { cursor: pointer; }

tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.table-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

/* Tables -> cartes en mobile */
@media (max-width: 720px) {
  .table-cards table,
  .table-cards thead,
  .table-cards tbody,
  .table-cards th,
  .table-cards td,
  .table-cards tr { display: block; }

  .table-cards thead { display: none; }

  .table-cards tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  .table-cards tbody tr:hover { background: var(--surface); }

  .table-cards tbody td {
    border: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }
  .table-cards tbody td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .table-cards tbody td:first-child {
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    padding-bottom: 8px;
  }
  .table-cards tbody td:first-child::before { display: none; }
  .tk-table tbody td:first-child {
    display: block;
    font-weight: inherit;
  }
}

/* ── 14. Modales ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,12,11,.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t), visibility 0s linear var(--t);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity var(--t);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform var(--t);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }

.modal-header {
  padding: 22px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; color: var(--text); letter-spacing: -.015em; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--surface-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-size: 16px;
}
.modal-close:hover { background: var(--active-bg); color: var(--text); }

.modal-body { padding: 4px 24px 22px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── 15. Avatar ───────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  letter-spacing: -.02em;
}

/* ── 16. Progression ──────────────────────────────────── */
.progress-bar-wrap {
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--text);
  transition: width .6s var(--ease);
}
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger  { background: var(--danger); }

/* ── 17. État vide ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 56px; height: 56px;
  color: var(--text-soft);
  margin: 0 auto 16px;
  stroke-width: 1.3;
}
.empty-state h3 { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── 18. Recherche & filtres ──────────────────────────── */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-input svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-soft);
  pointer-events: none;
}
.search-input input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast);
}
.search-input input:focus { border-color: var(--text); }

/* ── 19. Onglets ──────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }

/* ── 20. Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.pagination a, .pagination span {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--t-fast);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.pagination a:hover { background: var(--hover-bg); color: var(--text); }
.pagination .current { background: var(--primary); color: var(--on-primary); }

/* ── 21. Fil de ticket (style messagerie) ─────────────── */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.message.admin-msg { flex-direction: row-reverse; }

.message-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.message .message-bubble { border-top-left-radius: 4px; }
.message.admin-msg .message-bubble {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}
/* Note interne : jamais confondue avec une réponse au client, y compris côté
   admin où `.message.admin-msg .message-bubble` a une spécificité supérieure. */
.message-bubble.internal,
.message.admin-msg .message-bubble.internal {
  background: var(--warning-bg);
  border: 1px dashed rgba(185,109,10,.45);
  color: var(--text);
}

.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}
/* Bulle admin alignée à droite (margin-left: auto) : le repère nom/date
   doit suivre, sinon il reste collé à gauche du conteneur large. */
.message.admin-msg .message-meta { justify-content: flex-end; }

a.metric-tile {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Liens détectés dans un message (URL, e-mail, téléphone) */
.msg-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklab, currentColor 45%, transparent);
}
.msg-link:hover { color: inherit; text-decoration-color: currentColor; }

/* ─── Éditeur de texte enrichi (WYSIWYG) ─────────────────────────────────
   Socle partagé par le composeur de tickets et celui des campagnes. Les
   particularités de chaque composeur (formule de politesse, note interne)
   restent dans la page qui les utilise. */
.rte { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px; align-items: center;
  padding: 5px 6px; border-bottom: 1px solid var(--border); background: var(--bg, transparent);
}
.rte-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); cursor: pointer;
  font-size: 14px; line-height: 1; transition: background .12s ease, border-color .12s ease;
}
.rte-btn:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.rte-btn:active { background: var(--surface-3, rgba(127,127,127,.2)); }
.rte-btn.is-active { background: var(--primary-soft, rgba(99,102,241,.16)); border-color: var(--primary, #6366f1); color: var(--primary, #6366f1); }
.rte-btn.is-disabled, .rte-btn:disabled { opacity: .38; cursor: default; }
.rte-btn.is-disabled:hover, .rte-btn:disabled:hover { background: transparent; }
.rte-btn svg { width: 16px; height: 16px; }
.rte-sep { width: 1px; align-self: stretch; margin: 4px 3px; background: var(--border); }
.rte-editor {
  min-height: 96px; max-height: 340px; overflow-y: auto;
  padding: 11px 13px; font-size: 14px; line-height: 1.55; color: var(--text);
  outline: none; word-break: break-word;
}
.rte-editor:empty:before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rte-editor p { margin: 0 0 8px; }
.rte-editor p:last-child { margin-bottom: 0; }
.rte-editor ul, .rte-editor ol { margin: 4px 0 8px; padding-left: 22px; }
.rte-editor h2, .rte-editor h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0 0 8px; }

/* ─── Archive des e-mails (espace client et back-office) ─────────────────── */

/* Encart d'avertissement anti-usurpation : il doit accrocher l'œil sans virer
   à l'alarme, la page est consultée en temps normal, pas en situation de crise. */
.email-warning {
  border-color: rgba(185, 109, 10, .28);
  background: var(--warning-bg);
}

/* Référence d'envoi : c'est le repère que le client recopie depuis le pied d'un
   e-mail reçu. Chasse fixe et lettres espacées pour se relire sans erreur. */
.email-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface-2);
}

/* Lien neutralisé à l'archivage : signalé comme une absence volontaire, pas
   comme une erreur d'affichage. */
.email-redacted {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed var(--border);
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--warning-bg);
}

/* En-tête du message : libellés à gauche, valeurs à droite, repliés en pile
   sur mobile où deux colonnes ne tiennent plus. */
.email-meta {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13.5px;
}
.email-meta dt { color: var(--text-muted); font-weight: 600; }
.email-meta dd { margin: 0; min-width: 0; }

/* Corps archivé : le gabarit d'origine (logo, mentions légales) n'est pas
   rejoué, seul le contenu métier l'est — d'où ces marges de lecture. */
.email-body { font-size: 14.5px; line-height: 1.65; }
.email-body h1,
.email-body h2,
.email-body h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.email-body p { margin: 0 0 12px; }
.email-body p:last-child { margin-bottom: 0; }
.email-body ul, .email-body ol { margin: 8px 0 12px; padding-left: 22px; }
.email-body li { margin: 3px 0; }
.email-body hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.email-body table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.email-body td, .email-body th { padding: 6px 8px; text-align: left; vertical-align: top; }

@media (max-width: 560px) {
  .email-meta { grid-template-columns: 1fr; gap: 2px; }
  .email-meta dd { margin-bottom: 8px; }
}

/* ── Éditeur de newsletter (assets/js/email-editor.js) ─────────────────────
   Palette / canevas / inspecteur. Le canevas imite le rendu de l'e-mail sans
   prétendre s'y substituer : le rendu de vérité est produit par le serveur et
   consultable par le bouton « Aperçu ». */
.ne {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 240px;
  gap: 14px;
  align-items: start;
}
.ne-palette, .ne-inspector {
  position: sticky; top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 12px;
}
.ne-side-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.ne-side-hint { font-size: 12px; line-height: 1.5; color: var(--text-muted); margin: 10px 0 0; }

.ne-chip {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 9px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--surface);
  cursor: grab; user-select: none;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.ne-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.ne-chip:active { cursor: grabbing; }
.ne-chip-icon {
  flex: 0 0 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); background: var(--surface-2);
  font-size: 13px; color: var(--text-muted);
}
.ne-chip-body { min-width: 0; }
.ne-chip-body strong { display: block; font-size: 12.5px; font-weight: 600; }
.ne-chip-body small { display: block; font-size: 11px; line-height: 1.4; color: var(--text-muted); }

.ne-main { min-width: 0; }
.ne-toolbar { border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.ne-canvas {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: #ffffff;
  color: #1E293B;
}
.ne-empty, .ne-placeholder {
  padding: 30px 16px; text-align: center;
  font-size: 13px; line-height: 1.6; color: #94A3B8;
  border: 1px dashed #CBD5E1; border-radius: var(--r-sm);
}

.ne-block { position: relative; border: 1px solid transparent; border-radius: var(--r-xs); margin-bottom: 2px; }
.ne-block:hover { border-color: #E2E8F0; }
.ne-block.is-selected { border-color: #94A3B8; }
.ne-block.is-dragging { opacity: .4; }
.ne-bar {
  display: none;
  position: absolute; top: -11px; right: 6px; z-index: 2;
  align-items: center; gap: 4px;
  padding: 2px 4px;
  border: 1px solid #E2E8F0; border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
}
.ne-block:hover .ne-bar, .ne-block.is-selected .ne-bar { display: flex; }
.ne-grip { cursor: grab; padding: 0 3px; font-size: 12px; color: #94A3B8; line-height: 1; }
.ne-grip:active { cursor: grabbing; }
.ne-bar-name { font-size: 10.5px; font-weight: 600; color: #64748B; padding-right: 3px; }
.ne-bar-actions { display: flex; gap: 1px; }
.ne-bar-btn {
  width: 19px; height: 19px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent;
  font-size: 11px; color: #64748B; cursor: pointer;
}
.ne-bar-btn:hover { background: #F1F5F9; color: #0F172A; }
.ne-body { padding: 8px 10px; }

/* Zones de saisie : le contour n'apparaît qu'au survol, pour que le canevas
   ressemble au message et non à un formulaire. */
.ne-edit { outline: 0; border-radius: 4px; min-height: 20px; }
.ne-edit:hover { box-shadow: 0 0 0 1px #E2E8F0; }
.ne-edit:focus { box-shadow: 0 0 0 2px #C7D2FE; }
.ne-rich { font-size: 15px; line-height: 1.65; }
.ne-rich p { margin: 0 0 10px; }
.ne-rich p:last-child { margin-bottom: 0; }
.ne-rich ul, .ne-rich ol { margin: 6px 0 10px; padding-left: 22px; }
.ne-rich a { color: #4338CA; text-decoration: underline; }
.ne-plain { display: inline-block; min-width: 40px; }

.ne-h { font-weight: 700; color: #0F172A; line-height: 1.3; }
.ne-h-h1 { font-size: 26px; }
.ne-h-h2 { font-size: 21px; }
.ne-h-h3 { font-size: 17px; }

.ne-btn-preview {
  display: inline-block; padding: 12px 24px; border-radius: 8px;
  background: #0F172A; color: #ffffff;
  font-size: 15px; font-weight: 600; line-height: 1;
}
.ne-btn-preview.is-outline { background: #ffffff; color: #0F172A; border: 1px solid #CBD5E1; }
.ne-btn-preview .ne-edit:focus { box-shadow: none; }
.ne-warn { margin-top: 6px; font-size: 11.5px; color: #B45309; }

.ne-cols { display: flex; gap: 22px; }
.ne-cols > .ne-edit { flex: 1 1 0; min-width: 0; }

.ne-callout { border-radius: 6px; padding: 13px 16px; font-size: 14.5px; line-height: 1.6; }
.ne-tone-info    { background: #EEF2FF; border-left: 3px solid #6366F1; color: #312E81; }
.ne-tone-warning { background: #FEF3C7; border-left: 3px solid #D97706; color: #78350F; }
.ne-tone-success { background: #ECFDF5; border-left: 3px solid #059669; color: #064E3B; }

.ne-divider { border-top: 1px solid #E2E8F0; margin: 14px 0; }
.ne-spacer {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed #E2E8F0; border-radius: 4px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #CBD5E1;
}
.ne-spacer-small  { height: 12px; }
.ne-spacer-medium { height: 24px; }
.ne-spacer-large  { height: 42px; }

.ne-drop-line { height: 3px; border-radius: 2px; background: var(--primary); margin: 3px 0; }

.ne-field { margin-bottom: 12px; }
.ne-label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
.ne-hint { font-size: 11px; line-height: 1.45; color: var(--text-muted); margin-top: 4px; }
.ne-input { font-size: 12.5px; }
.ne-range { width: 100%; padding: 0; }
.ne-range-val { font-size: 11px; color: var(--text-muted); }
.ne-upload-state { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.ne-preview-frame {
  width: 100%; height: 620px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: #F1F5F9;
}

@media (max-width: 1100px) {
  .ne { grid-template-columns: 1fr; }
  .ne-palette, .ne-inspector { position: static; }
  .ne-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  .ne-palette .ne-side-title, .ne-palette .ne-side-hint { grid-column: 1 / -1; }
  .ne-chip { margin-bottom: 0; }
}
@media (max-width: 560px) {
  .ne-cols { display: block; }
  .ne-cols > .ne-edit + .ne-edit { margin-top: 12px; }
}

/* Bouton « copier » (adresses e-mail, identifiants) */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: 4px;
  padding: 0;
  vertical-align: -5px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: currentColor;
  opacity: .55;
  cursor: pointer;
  transition: opacity var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { opacity: 1; background: var(--hover-bg); border-color: var(--border); }
.copy-btn.is-done { opacity: 1; color: var(--success); }

.voip-phone { display: inline; white-space: nowrap; }
.voip-phone a[href^="tel:"] { cursor: pointer; }

.voip-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: 2px;
  padding: 0;
  vertical-align: -5px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: currentColor;
  opacity: .55;
  cursor: pointer;
  transition: opacity var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.voip-call-btn svg { width: 13px; height: 13px; }
.voip-call-btn:hover { opacity: 1; background: var(--hover-bg); border-color: var(--border); color: var(--success); }
.voip-call-btn:disabled,
.voip-call-btn[aria-busy="true"] { opacity: .4; cursor: wait; }

/* ── Appel VoIP en direct ───────────────────────────────────────────────── */
.voip-incoming {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8500;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}
.voip-incoming:not([hidden]) { pointer-events: auto; }
.voip-incoming-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid color-mix(in srgb, var(--success) 55%, var(--border));
  background: var(--surface);
  box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.18));
}
body.voip-call-ringing .voip-incoming-inner {
  animation: voipIncomingPulse 1.1s ease-in-out infinite;
}
@keyframes voipIncomingPulse {
  0%, 100% { box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.18)); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 22%, transparent); }
}
.voip-incoming-pulse {
  width: 12px; height: 12px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 22%, transparent);
  animation: voipDot 1.2s ease-in-out infinite;
}
body.voip-call-talking .voip-incoming-pulse { animation: none; }
@keyframes voipDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.7); opacity: .45; }
}
.voip-incoming-meta { flex: 1; min-width: 0; }
.voip-incoming-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--success);
}
.voip-incoming-name {
  font-size: 17px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voip-incoming-num {
  font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.voip-incoming-dismiss {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: var(--r-xs); cursor: pointer; font-size: 16px; line-height: 1;
}
.voip-incoming-dismiss:hover { background: var(--hover-bg); color: var(--text); }
@media (max-width: 720px) {
  .voip-incoming { top: auto; bottom: 72px; }
}

/* ── Écran support : demandes de connexion ─────────────────────────────── */
/* Coin bas droit, fixe, jamais fermé de lui-même (cf. app.js viewerAccessWatch).
   Les toasts partagent ce coin : --viewer-access-h, posé par le script à la
   hauteur des cartes, les fait monter au-dessus. */
.viewer-access {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  width: min(380px, calc(100vw - 24px));
}
.viewer-access[hidden] { display: none; }
#viewer-access-list { display: flex; flex-direction: column; gap: 10px; }
.viewer-access-card {
  padding: 14px 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid color-mix(in srgb, var(--info) 55%, var(--border));
  background: var(--surface);
  box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.18));
  animation: slideInRight .25s var(--ease);
}
.viewer-access-card.is-new { animation: slideInRight .25s var(--ease), viewerAccessPulse 1.1s ease-in-out 3; }
@keyframes viewerAccessPulse {
  0%, 100% { box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.18)); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 22%, transparent); }
}
.viewer-access-kicker {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--info);
}
.viewer-access-kicker::before {
  content: ''; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--info) 22%, transparent);
  animation: voipDot 1.2s ease-in-out infinite;
}
.viewer-access-code {
  font-size: 26px; font-weight: 700; letter-spacing: .14em;
  margin: 6px 0 2px; color: var(--text);
}
.viewer-access-meta { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.viewer-access-label { margin-top: 10px; font-size: 13px; padding: 7px 10px; }
.viewer-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.viewer-access-link { margin-left: auto; font-size: 12px; color: var(--text-muted); text-decoration: none; }
.viewer-access-link:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 720px) {
  .viewer-access { bottom: calc(var(--bottom-nav-h) + 16px); }
}

/* ── Coffre-fort : secret partagé sur un ticket ─────────────────────────── */
.vault-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  margin-top: 8px;
  max-width: 100%;
}
.vault-card.is-locked { border-style: solid; opacity: .65; }
.vault-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-muted);
}
.vault-icon svg { width: 15px; height: 15px; }
.vault-body { flex: 1; min-width: 0; }
.vault-label { font-size: 13px; font-weight: 600; color: var(--text); }
.vault-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.vault-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Zone d'affichage temporaire du secret */
.vault-reveal {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.vault-reveal.is-open { display: flex; }
.vault-secret {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1;
  user-select: all;
}
.vault-countdown {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Secrets préparés dans le composeur, avant envoi */
.vault-draft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px;
  max-width: 100%;
}
/* Le cadenas garde sa taille quel que soit le SVG fourni ; l'intitulé se tronque
   plutôt que de faire éclater la pastille. */
.vault-draft svg { width: 13px; height: 13px; flex-shrink: 0; }
.vault-draft .lbl {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.vault-draft .text-muted { white-space: nowrap; }
.vault-draft button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}
.vault-draft button:hover { color: var(--danger); }

/* Pièce jointe : puce cliquable (fil de discussion et récapitulatif) */
.ticket-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.ticket-attachment:hover {
  border-color: var(--border-strong);
  background: var(--hover-bg);
  color: var(--text);
}
.ticket-attachment svg { flex-shrink: 0; color: var(--text-muted); }

/* Pièces jointes d'un message : conteneur (vignettes images + puces fichiers) */
.ticket-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: flex-start; }

/* Vignette d'aperçu d'une image jointe (clic → visionneuse plein écran) */
.ticket-thumb {
  position: relative;
  width: 136px; height: 108px;
  padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: var(--r-md, 10px);
  overflow: hidden; background: var(--surface); cursor: zoom-in; display: block;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.ticket-thumb:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ticket-thumb:focus-visible { outline: 2px solid var(--primary, #6366f1); outline-offset: 2px; }
.ticket-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticket-thumb-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; font-size: 11px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.74), rgba(0,0,0,0));
}
.ticket-thumb-cap .break-any { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-thumb-size { flex-shrink: 0; opacity: .85; }
/* Vidéo / audio joints à un message : lecteur natif + lien de téléchargement. */
.ticket-media { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
/* max-width absolue en plus du min(100%, …) : c'est elle qui borne la largeur
   intrinsèque du lecteur (une vidéo 1920 px élargirait sinon le bloc
   .message-body jusqu'à la colonne, et la vidéo flotterait loin de la bulle). */
.ticket-media video { width: min(100%, 560px); max-width: 560px; max-height: 360px; border-radius: 10px; background: #000; display: block; }
.ticket-media audio { width: min(100%, 420px); max-width: 420px; display: block; }
/* Progression de l'envoi en morceaux (fichiers jusqu'à 500 Mo). */
.upload-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: .85rem; }
.upload-progress-row { display: flex; align-items: center; gap: 10px; }
.upload-progress-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-bar { flex: 0 0 160px; height: 6px; border-radius: 3px; background: var(--border, #e5e7eb); overflow: hidden; }
.upload-progress-bar > span { display: block; height: 100%; width: 0; background: var(--primary, #6366f1); transition: width .15s linear; }
.upload-progress-pct { flex: 0 0 3.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted, #6b7280); }
.upload-progress-row.is-error .upload-progress-pct { color: #b91c1c; }
.upload-progress-row.is-error .upload-progress-bar > span { background: #b91c1c; }

/* Visionneuse plein écran (lightbox) partagée admin/client */
.att-lightbox {
  position: fixed; inset: 0; z-index: 4000;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.82);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.att-lightbox.is-open { display: flex; }
.att-lightbox-inner { display: flex; flex-direction: column; max-width: 100%; max-height: 100%; gap: 12px; }
.att-lightbox img {
  max-width: 100%; max-height: calc(100vh - 120px);
  object-fit: contain; border-radius: 8px; background: #fff;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.att-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; font-size: 13px; }
.att-lightbox-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-lightbox-actions { display: flex; gap: 8px; flex-shrink: 0; }
.att-lightbox-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  color: #fff; font-size: 13px; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast);
}
.att-lightbox-btn:hover { background: rgba(255,255,255,.24); }
.att-lightbox-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

tbody tr.row-overdue td {
  background: color-mix(in srgb, var(--warning) 7%, transparent);
}
tbody tr.row-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}

/* ── Ligne de liste cliquable en entier ──────────────────────────────────
   Le clic n'importe où sur la ligne ouvre la fiche (app.js, délégué). Les
   liens et contrôles de la ligne gardent leur propre action : on ne fait
   qu'élargir la cible, on ne remplace rien. */
tbody tr.row-link { cursor: pointer; }
tbody tr.row-link:hover td { background: var(--hover-bg); }

/* ── Chrono en cours sur un ticket ───────────────────────────────────────
   Battement « moderne » : un point plein d'où s'échappe une onde, et la
   pilule qui respire. Rien ne clignote en tout-ou-rien — la liste reste
   lisible quand on la garde ouverte toute la journée. */
.chrono-live {
  --chrono: var(--danger);
  --chrono-bg: var(--danger-bg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--chrono) 34%, transparent);
  background: var(--chrono-bg);
  color: var(--chrono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
  vertical-align: middle;
  animation: chronoBreath 2.6s ease-in-out infinite;
}
/* Portail client : bleu « information » — un chrono rouge y serait lu comme une alerte. */
.chrono-live.is-client { --chrono: var(--info); --chrono-bg: var(--info-bg); }
.chrono-live-dot {
  position: relative;
  width: 7px; height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}
.chrono-live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: chronoPing 1.9s cubic-bezier(0, 0, .2, 1) infinite;
}
.chrono-live-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
@keyframes chronoPing {
  0%        { transform: scale(1);   opacity: .8; }
  70%, 100% { transform: scale(2.7); opacity: 0; }
}
@keyframes chronoBreath {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 0 3px color-mix(in srgb, var(--chrono) 13%, transparent); }
}
/* Ligne portant un chrono : liseré à gauche, comme « retard » et « nouveau ». */
tbody tr.row-chrono td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* Mouvement réduit : l'information reste (couleur, point, compteur), le battement part. */
@media (prefers-reduced-motion: reduce) {
  .chrono-live, .chrono-live-dot::after { animation: none; }
}

/* ── Tableau de bord : carte « Tickets ouverts » = la file de /viewer/ ─────
   (ticketQueueCardHtml). Même lecture que l'écran mural : liseré de priorité,
   client en gras, « sans réponse » en rouge, attente en grand à droite (rouge
   hors délai, ambre aux trois quarts), ligne qui clignote pendant un chrono.
   Le chrono y est violet, comme sur le mur : dans cette carte le rouge dit
   déjà « sans réponse » et « hors délai », pas « quelqu'un est dessus ». */
.tq-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.tq-list { display: flex; flex-direction: column; }
.tq-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 20px 10px 17px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t-fast);
}
.tq-row:last-child { border-bottom: 0; }
.tq-row:hover { background: var(--hover-bg); }
.tq-row.p-Critique { border-left-color: var(--danger); }
.tq-row.p-Haute    { border-left-color: var(--warning); }
.tq-row.p-Normale  { border-left-color: var(--info); }
.tq-row.p-Faible   { border-left-color: var(--ink-300); }
.tq-row.is-chrono  { animation: tqChrono 1.6s ease-in-out infinite; }
@keyframes tqChrono {
  0%, 100% { background: transparent; }
  50%      { background: color-mix(in srgb, var(--violet) 14%, transparent); }
}
.tq-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tq-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--text-muted); }
.tq-num { flex: 0 0 auto; font-family: var(--font-mono); font-weight: 600; color: var(--text-soft); }
.tq-client { flex: 0 1 auto; min-width: 0; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-service { flex: 0 1 auto; min-width: 0; font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-service::before { content: "·"; margin-right: 8px; color: var(--text-soft); }
.tq-meta .chrono-live { --chrono: var(--violet); --chrono-bg: var(--violet-bg); flex: 0 0 auto; font-size: 11px; padding-block: 1px; }
.tq-tag {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--info-bg);
  color: var(--info);
}
.tq-tag.is-wait { background: var(--danger-bg); color: var(--danger); }
.tq-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.tq-age {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.tq-age.is-bad  { color: var(--danger); }
.tq-age.is-warn { color: var(--warning); }
.tq-who { font-size: 11.5px; color: var(--text-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.tq-who .is-none { color: var(--danger); }
.tq-foot {
  display: block;
  padding: 9px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
a.tq-foot:hover { color: var(--text); background: var(--hover-bg); }
@media (max-width: 640px) {
  .tq-row { padding: 10px 14px 10px 11px; gap: 10px; }
  .tq-meta { flex-wrap: wrap; row-gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  /* Plus de clignotement : le fond violet fixe garde l'information. */
  .tq-row.is-chrono { animation: none; background: var(--violet-bg); }
}

/* ── Page ticket : conversation large + colonne de gestion étroite ──────── */
.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1150px) {
  /* minmax(0, …) et non 1fr : sinon la largeur fixe des bulles de l'équipe
     (78ch) élargissait la colonne au-delà de l'écran d'un téléphone. */
  .ticket-layout { grid-template-columns: minmax(0, 1fr); }
}

/* La conversation occupe la hauteur utile : on lit le fil, on répond dessous. */
.ticket-thread {
  max-height: clamp(280px, 52vh, 620px);
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}
/* La bulle suit la colonne mais plafonne à une longueur de ligne lisible :
   sur très grand écran, un texte de 1800px de large ne se lit plus. */
.ticket-thread .message-bubble { max-width: min(100%, 78ch); }
/* Corps du message : bulle + pièces jointes + coffres. Côté équipe, le bloc
   entier se range à droite et prend la largeur de la bulle, si bien qu'une
   vignette se pose sous la bulle, calée sur son bord gauche — comme sous un
   message client. Sans lui, le conteneur des vignettes occupait toute la
   colonne (78 %) et la pièce jointe flottait au milieu de la page. */
.message-body { max-width: 100%; }
.message.admin-msg .message-body { width: fit-content; max-width: 100%; margin-left: auto; }
/* La bulle garde sa largeur d'avant (78ch, plafonnée à la colonne) et c'est
   elle qui dimensionne le bloc, pas l'inverse : une réponse courte reste aussi
   large qu'un message client. Largeur explicite et non max-width seule — un
   « min(100%, …) » est ignoré au calcul de la largeur intrinsèque du bloc
   fit-content, qui s'étalerait alors sur toute la colonne pour un texte long. */
.message.admin-msg .message-bubble { width: 78ch; max-width: 100%; margin-left: auto; }

/* Séparateur de jour dans le fil */
.thread-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.thread-day::before,
.thread-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Composeur de réponse ─────────────────────────────────────────────── */
.composer {
  border-top: 1px solid var(--border);
  padding: 14px 20px 16px;
  background: var(--surface-2);
}
.composer.is-internal { background: var(--warning-bg); }
/* Glisser-déposer de pièces jointes (equipe + client) : liseré en pointillés
   à la couleur d'accent le temps du survol, retiré au drop/dragleave. */
.composer.dragover {
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
  background: var(--hover-bg);
}

.composer-modes {
  display: inline-flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
  margin-bottom: 10px;
}
.composer.is-internal .composer-modes { background: var(--surface); }
.composer-modes button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-fast);
}
.composer-modes button svg { width: 13px; height: 13px; }
.composer-modes button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.composer textarea {
  min-height: 96px;
  resize: none;
  overflow-y: auto;
  max-height: 340px;
  line-height: 1.6;
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.composer-bar .spacer { flex: 1; }
.composer-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* À / Cc façon vrai client mail : deux puces de couleur distincte plutôt
   qu'un simple compteur, pour ne pas confondre destinataire et copie. */
.rcpt-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 1px 6px;
  border-radius: var(--r-pill, 999px);
}
.rcpt-chip.rcpt-to { background: var(--primary); color: var(--surface); }
.rcpt-chip.rcpt-cc { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); }

/* Fichiers choisis, listés sous le composeur */
.composer-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Repli discret (destinataires additionnels) */
.composer details > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 6px 0;
  list-style: none;
}
.composer details > summary::-webkit-details-marker { display: none; }
.composer details > summary::before { content: '▸ '; }
.composer details[open] > summary::before { content: '▾ '; }
.composer details > summary:hover { color: var(--text); }

/* ── Choix du statut à l'envoi (modale) ───────────────────────────────── */
.status-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.status-choice:hover { border-color: var(--border-strong); background: var(--hover-bg); }
.status-choice input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.status-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--hover-bg);
}
.status-choice > span { display: block; min-width: 0; }
.status-choice-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.status-choice-desc { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }

@media (max-width: 900px) {
  .ticket-detail-layout.grid-2 {
    grid-template-columns: 1fr;
  }
  .reports-split.grid-2 {
    grid-template-columns: 1fr;
  }
  .activity-split.grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── 22. Kanban ───────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  /* Colonnes de hauteur égale : zones de dépôt larges pour le glisser-déposer. */
  align-items: stretch;
  min-height: min(60vh, 460px);
  scroll-snap-type: x mandatory;
}

.kanban-col {
  /* Les colonnes se partagent la largeur disponible et ne repassent en
     défilement horizontal que lorsqu'elles atteignent leur largeur plancher. */
  flex: 1 1 296px;
  min-width: 280px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  scroll-snap-align: start;
}

.kanban-col-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.kanban-col[data-status="À faire"]    .kanban-col-header { border-top-color: var(--text-soft); }
.kanban-col[data-status="En cours"]   .kanban-col-header { border-top-color: var(--info); }
.kanban-col[data-status="En revue"]   .kanban-col-header { border-top-color: var(--violet); }
.kanban-col[data-status="En attente"] .kanban-col-header { border-top-color: var(--warning); }
.kanban-col[data-status="Terminée"]   .kanban-col-header { border-top-color: var(--success); }
.kanban-col[data-status="Annulée"]    .kanban-col-header { border-top-color: var(--danger); }

.kanban-col-count {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.kanban-col-body {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-col-body.drag-over { background: var(--hover-bg); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  cursor: grab;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-card);
}
.kanban-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(12,12,11,.12);
}
.kanban-card.dragging { opacity: .4; cursor: grabbing; transform: rotate(1.5deg); }

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── 23. Fil d'activité ───────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
a.activity-item { text-decoration: none; color: inherit; }
a.activity-item:hover .activity-title { color: var(--text); }
.activity-item.is-live .activity-icon {
  color: var(--primary);
  border-color: currentColor;
  animation: dy-activity-pulse 1.6s ease-in-out infinite;
}
@keyframes dy-activity-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 35%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, transparent); }
}

.activity-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.activity-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.activity-title-row .activity-title { flex: 1; min-width: 0; }
a.activity-title { text-decoration: none; color: inherit; }
a.activity-title:hover { text-decoration: underline; }
/* Réécoute d'un appel enregistré : le bouton n'existe que s'il y a un fichier. */
.voip-listen {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  border: 1px solid var(--primary);
  background: var(--surface-3);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}
.voip-listen svg { width: 11px; height: 11px; }
.voip-listen .voip-listen__play { margin-left: 2px; }
.voip-listen .voip-listen__pause,
.voip-listen.is-playing .voip-listen__play { display: none; }
.voip-listen.is-playing .voip-listen__pause { display: block; }
.voip-listen:hover, .voip-listen.is-playing { background: var(--primary); color: var(--on-primary); }
.voip-listen:disabled { opacity: .5; cursor: wait; }
.voip-call-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.voip-listen-host { white-space: nowrap; }
.voip-analyse { position: relative; }
.voip-analyse svg { width: 12px; height: 12px; display: block; }
.voip-analyse.is-done { border-color: var(--text-soft); color: var(--text); }
.voip-analyse.is-alerte {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-bg);
}
.voip-analyse__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.voip-supprimer {
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--surface);
}
.voip-supprimer:hover, .voip-supprimer:hover.voip-listen {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}
.voip-associer {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.voip-associer:hover, .voip-associer:hover.voip-listen {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.activity-item.is-suite {
  background: var(--warning-bg);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  box-shadow: inset 3px 0 0 var(--warning);
}
.activity-item.is-analyse {
  background: var(--surface-2);
}
.voip-suite {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.voip-suite[hidden] { display: none; }
.voip-suite-pill {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
}
.voip-suite-pill.is-ticket {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(201,48,48,.16);
}
.voip-suite-pill.is-taches {
  background: var(--warning-bg);
  color: var(--badge-warning-text, var(--warning));
  border-color: rgba(185,109,10,.16);
}
.voip-suite-pill.is-analyse {
  background: var(--surface-3);
  color: var(--text-muted);
}
.voip-suite-pill.is-erreur {
  background: var(--danger-bg);
  color: var(--danger);
}
.voip-suite-pill:hover { filter: brightness(0.97); }
.voip-analyse-alerte {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--warning-bg);
  color: var(--badge-warning-text, var(--warning));
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.voip-analyse-alerte[hidden] { display: none; }
dialog.dy-associer {
  max-width: 460px;
  width: calc(100% - 32px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
}
.voip-analyse.is-open, .voip-analyse.is-busy {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.voip-audio {
  display: block;
  width: 100%;
  min-width: 220px;
  height: 32px;
  margin-top: 8px;
}
tr.voip-audio-row td,
tr.voip-analyse-row td {
  background: var(--surface-2);
  padding-top: 4px;
  padding-bottom: 14px;
}
.voip-analyse-panel {
  margin-top: 10px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  display: grid;
  gap: 12px;
}
.voip-analyse-panel.is-attente .voip-analyse-corps,
.voip-analyse-panel.is-erreur .voip-analyse-corps { display: none; }
.voip-analyse-etape {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.voip-analyse-etape[hidden] { display: none; }
.voip-analyse-erreur {
  font-size: 13px;
  color: var(--danger);
  margin: 0;
}
.voip-analyse-erreur[hidden],
.voip-analyse-panel > [data-retry][hidden] { display: none; }
.voip-analyse-panel > [data-retry] { justify-self: start; }
.voip-analyse-kicker {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.voip-analyse-resume {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0;
}
.voip-analyse-transcript {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.voip-analyse-transcript summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  list-style: none;
}
.voip-analyse-transcript summary::-webkit-details-marker { display: none; }
.voip-analyse-transcript summary:hover { color: var(--text); }
.voip-analyse-transcript pre {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--text);
}
.voip-analyse-taches { display: grid; gap: 8px; }
.voip-analyse-tache {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.voip-analyse-tache.is-faite { opacity: .72; }
.voip-analyse-tache input { margin-top: 3px; }
.voip-analyse-tache strong { font-size: 13.5px; font-weight: 600; }
.voip-analyse-tache p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.voip-analyse-tache .badge { margin-left: 6px; vertical-align: middle; }
.voip-analyse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.voip-analyse-actions select.form-control {
  width: auto;
  min-width: 180px;
  max-width: 280px;
}
.voip-analyse-relancer {
  margin-left: auto;
  font-size: 12.5px;
}
.voip-analyse-vide { font-size: 13.5px; color: var(--text-muted); margin: 0; }
.activity-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── 24. Éléments de travail (hub unifié) ─────────────── */
.work-list { display: flex; flex-direction: column; gap: 8px; }

.work-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.work-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(12,12,11,.1);
}

.work-item-marker {
  width: 4px;
  align-self: stretch;
  border-radius: var(--r-pill);
  background: var(--text-soft);
  flex-shrink: 0;
}
.work-item[data-priority="Urgente"] .work-item-marker,
.work-item[data-priority="Critique"] .work-item-marker { background: var(--danger); }
.work-item[data-priority="Haute"] .work-item-marker { background: var(--warning); }
.work-item[data-priority="Normale"] .work-item-marker { background: var(--info); }

.work-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.work-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.work-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.work-item-meta .dot { width: 3px; height: 3px; background: var(--text-soft); border-radius: 50%; }

.work-item-aside {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.work-item-due {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.work-item-due.late { color: var(--danger); }
.work-item-due.today { color: var(--badge-warning-text); }
.work-item-due.soon { color: var(--info); }

.work-item-check {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  align-self: stretch;
  cursor: pointer;
}
.work-item-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.work-item-check span {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  display: block;
}
.work-item-check:hover span { border-color: var(--text); }
.work-item-check input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.work-item-check input:checked + span {
  background: var(--success, #3f9a5c);
  border-color: var(--success, #3f9a5c);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'><path d='M20 6 9 17l-5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.dy-tasks-sec {
  margin: 14px 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dy-tasks-sec:first-child { margin-top: 2px; }
.dy-tasks-sec--late { color: var(--danger); }

/* ── 25. Étoiles (notation) ───────────────────────────── */
.stars,
.stars-preview {
  display: inline-flex;
  gap: 3px;
  font-size: 16px;
  line-height: 1;
  color: var(--warning);
}
.star { font-size: 18px; color: var(--text-soft); transition: color var(--t-fast); }
.star.filled { color: var(--warning); }

.stars-rate {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 4px;
}
.stars-rate .star-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  padding: 2px;
  color: var(--text-soft);
  transition: color var(--t-fast), transform var(--t-fast);
}
.stars-rate .star-btn svg {
  width: 30px; height: 30px;
  fill: currentColor;
  stroke: none;
}
.stars-rate .star-btn:hover,
.stars-rate .star-btn:hover ~ .star-btn { color: var(--warning); }
.stars-rate .star-btn:hover { transform: scale(1.15); }
.stars-rate .star-btn.filled { color: var(--warning); }

/* ── 26. Toast ────────────────────────────────────────── */
#toast-container {
  position: fixed;
  /* --viewer-access-h : hauteur des demandes de connexion de l'écran support
     (app.js), pour que les toasts montent au-dessus au lieu de les couvrir. */
  bottom: calc(16px + var(--viewer-access-h, 0px));
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13px;
  box-shadow: var(--shadow-lift);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight .25s var(--ease);
  cursor: pointer;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error,
.toast.danger  { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Surbrillance d'ancre (#entry-N, #task-N) ─────────── */
[id^="entry-"]:target,
[id^="task-"]:target,
.activity-highlight {
  animation: targetHighlight 2.4s var(--ease);
  border-radius: var(--r-sm);
  scroll-margin-top: calc(var(--topbar-h) + var(--shell-pad) * 2);
}
@keyframes targetHighlight {
  0%   { background: var(--info-bg); box-shadow: 0 0 0 2px var(--info) inset; }
  70%  { background: var(--info-bg); box-shadow: 0 0 0 2px var(--info) inset; }
  100% { background: transparent;    box-shadow: 0 0 0 0 transparent inset; }
}
@media (prefers-reduced-motion: reduce) {
  [id^="entry-"]:target,
  [id^="task-"]:target,
  .activity-highlight { animation: none; box-shadow: 0 0 0 2px var(--info) inset; }
}

/* ── 27. Panneau de notifications ─────────────────────── */
.notif-panel {
  position: absolute;
  right: 0; top: calc(100% + 12px);
  width: 380px;
  max-width: calc(100vw - 24px);
  border-radius: var(--r-lg);
  z-index: 300;
  display: none;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.notif-panel.open { display: flex; flex-direction: column; animation: popIn .16s var(--ease); }

.notif-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
}

.notif-list { max-height: 420px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--primary); }
.notif-item.unread:hover { background: var(--hover-bg); }

.notif-item-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.notif-item-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item-time { font-size: 11px; color: var(--text-soft); margin-top: 3px; }

.notif-panel-footer {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

/* Réglage des notifications push, en pied du panneau de notifications.
   Reste masqué (attribut hidden) tant que pwa.js n'a pas établi l'état du poste. */
.push-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.push-toggle-row[hidden] { display: none; }
.push-toggle-text { min-width: 0; }
.push-toggle-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.push-toggle-hint  { display: block; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin-top: 2px; }
.push-toggle-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.push-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.push-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.push-switch-track {
  width: 36px; height: 21px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  position: relative;
  transition: background .15s var(--ease);
}
.push-switch-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .15s var(--ease);
}
.push-switch input:checked + .push-switch-track { background: var(--success); }
.push-switch input:checked + .push-switch-track::after { transform: translateX(15px); }
.push-switch input:focus-visible + .push-switch-track { outline: 2px solid var(--text); outline-offset: 2px; }
.push-switch input:disabled + .push-switch-track { opacity: .45; }
.push-switch:has(input:disabled) { cursor: not-allowed; }

/* Libellé réservé aux lecteurs d'écran. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── 28. Palette de commandes ─────────────────────────── */
.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,12,11,.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t), visibility 0s linear var(--t);
}
.cp-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity var(--t);
}

.command-palette {
  width: 100%;
  max-width: 640px;
  margin: 0 16px;
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  transform: translateY(-12px) scale(.98);
  transition: transform var(--t);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  background: transparent;
  border: none;
  box-shadow: none;
}
.command-palette-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
}
.command-palette-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.cp-overlay.open .command-palette { transform: translateY(0) scale(1); }

.cp-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cp-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cp-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
}
.cp-search input[type="search"]::-webkit-search-decoration,
.cp-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.cp-search input::placeholder { color: var(--text-soft); }
.cp-search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.cp-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.cp-section {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.cp-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background var(--t-fast);
}
.cp-result:hover,
.cp-result.is-active { background: var(--hover-bg); }
.cp-result.is-active { background: var(--active-bg); }

.cp-result-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cp-result-icon svg { width: 15px; height: 15px; }

.cp-result-body { flex: 1; min-width: 0; }
.cp-result-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.cp-result-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.cp-result-title, .cp-result-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Pastille d'état à droite d'un résultat (statut du ticket, du projet…). */
.cp-result-badge {
  flex: 0 0 auto;
  max-width: 40%;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-3);
  color: var(--text-muted);
}
.cp-result-badge[data-tone="ok"]   { background: var(--success-bg); color: var(--success); }
.cp-result-badge[data-tone="info"] { background: var(--info-bg);    color: var(--info); }
.cp-result-badge[data-tone="warn"] { background: var(--warning-bg); color: var(--badge-warning-text); }
.cp-result-badge[data-tone="bad"]  { background: var(--danger-bg);  color: var(--danger); }

.cp-empty {
  padding: 30px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.cp-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}
.cp-footer span { display: flex; align-items: center; gap: 5px; }

/* ── 29. FAB (menu d'actions rapides) ─────────────────── */
.fab-menu {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 84px);
  right: 18px;
  z-index: 800;
  display: none;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.fab-menu.open { display: flex; animation: popIn .15s var(--ease); }

.fab-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
}
.fab-action:hover { border-color: var(--border-strong); transform: translateX(-2px); }
.fab-action-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.fab-action-icon svg { width: 14px; height: 14px; }

/* ── 30. Navigation basse (mobile) ────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  right: 10px;
  height: var(--bottom-nav-h);
  z-index: 900;
  border-radius: var(--r-xl);
  padding: 6px;
  background: var(--veil);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--r);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 500;
  transition: color var(--t-fast), background var(--t-fast);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.bottom-nav-item svg { width: 20px; height: 20px; stroke-width: 1.7; }
.bottom-nav-item.active { color: var(--text); background: var(--hover-bg); }
.bottom-nav-item:hover { color: var(--text); }

/* ── 31. Pages d'authentification ─────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Conservé pour compat markup : simple couche de surface */
.auth-card-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--surface);
  pointer-events: none;
}

.auth-card-inner {
  position: relative;
  z-index: 1;
  padding: 40px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
}

/* Logo complet (PNG blanc) sur plaque noire : lisible dans les deux thèmes */
.auth-logo-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 30px;
  background: #000;
  border-radius: 18px;
  margin: 0 auto 16px;
  box-shadow: 0 10px 28px -6px rgba(0,0,0,.3);
}
.auth-logo-img img { display: block; height: 38px; width: auto; }

.auth-logo h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -.025em; }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Compat : ancien markup .login-page / .login-card */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.login-logo h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -.025em; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── 32. Grilles ──────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── 33. Utilitaires ──────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 13.5px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--badge-warning-text); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.rounded { border-radius: var(--r-sm); }
.rounded-full { border-radius: 50%; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Raccourcis clavier */
.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── 34. Responsive ───────────────────────────────────── */

/* Anti-zoom iOS : Safari zoome au focus de tout champ < 16px.
   Sur écran tactile, aucun champ texte ne descend sous 16px. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --shell-pad: 10px; }

  /* Mobile : le rail redevient un panneau coulissant hors écran. */
  .rail {
    transform: translateX(-110%);
    transition: transform var(--t);
    width: 280px;
  }
  .rail.is-open { transform: translateX(0); }

  .rail-panel {
    left: calc(var(--shell-pad) + 280px + var(--rail-panel-gap));
    transform: translateX(-220%);
    transition: transform var(--t);
  }
  .rail-panel.is-visible { display: flex; }
  .rail-panel.is-visible.is-open { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .layout.has-rail-panel .main-content { margin-left: 0; }

  .topbar {
    margin: var(--shell-pad);
    padding: 0 12px;
  }
  .topbar-mobile-menu { display: flex; }
  .topbar-search { display: none; }
  .topbar-search-btn { display: flex; }

  .topbar .timer-chip,
  .topbar .user-btn .name { display: none; }

  .hide-mobile { display: none !important; }

  .topbar .user-btn { padding: 4px; }

  #toast-container { bottom: calc(var(--bottom-nav-h) + 16px + var(--viewer-access-h, 0px)); }

  .page-content { padding: 14px var(--shell-pad) calc(var(--bottom-nav-h) + 90px); }
  .page-header h1 { font-size: 23px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .kanban-board { gap: 10px; padding-bottom: 12px; }
  .kanban-col { flex: 0 0 88vw; min-width: 88vw; }

  .bottom-nav { display: flex; }

  .modal { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; align-self: flex-end; transform: translateY(100%); }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay.open .modal { transform: translateY(0); }

  .command-palette { max-height: 92vh; margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .cp-overlay { align-items: flex-end; padding-top: 0; }
  .cp-overlay.open .command-palette { transform: translateY(0); }

  .filters-bar { padding: 10px; }
  .search-input { max-width: 100%; }

  .work-item { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .work-item-aside { flex-basis: 100%; justify-content: flex-end; gap: 6px; }

  .metric-tile-value { font-size: 24px; }

  /* Densité adaptée au pouce */
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; }
  .card-footer { padding: 12px 16px; }
  .modal-header { padding: 18px 18px 12px; }
  .modal-body { padding: 4px 18px 18px; }
  .modal-footer { padding: 12px 18px; flex-wrap: wrap; }
  .form-actions { flex-wrap: wrap; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .metric-tile { padding: 14px 16px; }
  thead th { padding: 9px 12px; }
  tbody td { padding: 11px 12px; }
  .message-bubble { max-width: 92%; }
}

/* Très petits écrans (≤ 380px) */
@media (max-width: 380px) {
  .page-content { padding-left: 8px; padding-right: 8px; }
  .page-header h1 { font-size: 21px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-tile-value { font-size: 21px; }
  .btn-lg { padding: 11px 18px; font-size: 14px; }
  /* Les libellés longs passent à la ligne plutôt que de déborder de la pilule */
  .btn { white-space: normal; text-align: center; line-height: 1.35; }
}

/* Masqué par défaut hors mobile */
.topbar-search-btn { display: none; }

@media (min-width: 721px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 720px) {
  .desktop-only { display: none !important; }
}

/* ── Print ────────────────────────────────────────────── */
@media print {
  .rail, .rail-panel, .topbar, .bottom-nav, .fab, .fab-menu, .ambient-bg { display: none !important; }
  .main-content { margin: 0 !important; }
  .glass, .glass-card, .card, .metric-tile { background: #fff !important; box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff !important; }
}

/* ── Verrouillage PIN (bureau) ────────────────────────── */
.pin-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12,12,11,.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.pin-lock-overlay.open { display: flex; }
.pin-lock-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pin-lock-card {
  width: 100%;
  max-width: 420px;
}
/* Plaque de marque du verrouillage : wordmark DYCAST entier, blanc sur noir. */
.pin-lock-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: #000;
  margin-bottom: 14px;
}
.pin-lock-brand img { display: block; width: 124px; height: auto; }
.pin-lock-card h1,
.pin-lock-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.pin-lock-input {
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: .35em;
  font-size: 1.25rem;
  text-align: center;
}
.pin-lock-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 12px;
}

/* ── Infrastructure : onglets du module ──────────────────── */
.infra-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 18px;
}
.infra-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
}
.infra-nav a:hover { color: var(--text); background: var(--hover-bg); }
.infra-nav a.active {
  color: var(--text);
  border-color: var(--text);
  background: var(--active-bg);
  font-weight: 600;
}
.infra-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -10px 0 20px;
}
.infra-sub a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
}
.infra-sub a:hover { color: var(--text); background: var(--hover-bg); }
.infra-sub a.active {
  color: var(--text);
  background: var(--active-bg);
  font-weight: 600;
}
.infra-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.infra-list { list-style: none; margin: 0; padding: 0; }
.infra-list li + li { border-top: 1px solid var(--border); }
.infra-list a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  color: inherit;
  text-decoration: none;
}
.infra-list a:hover { background: var(--hover-bg); }
.infra-list-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.infra-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--text-muted);
}
.infra-dot.danger { background: var(--danger); }
.infra-dot.warning { background: var(--warning); }
.infra-goto {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.infra-goto a {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.infra-goto a:hover { background: var(--hover-bg); }
.infra-ops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 20px;
}
.infra-ops-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.infra-ops-item .k { font-size: 12px; color: var(--text-muted); }
.infra-ops-item .v { font-size: 13.5px; overflow-wrap: anywhere; }

/* ── Hébergement d'un service ─────────────────────────────
   Une carte par machine : ce qu'elle est pour ce site, où elle se trouve,
   ce qu'elle consomme, et ce qui y tourne. */
.host-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.host-node {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Le rôle se lit au filet de gauche avant même d'être lu en toutes lettres. */
.host-node.-principal  { border-left: 3px solid var(--success); }
.host-node.-secours    { border-left: 3px solid var(--info); }
.host-node.-secondaire { border-left: 3px solid var(--warning); }

.host-node-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.host-node-name {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.host-node-name:hover { text-decoration: underline; }
.host-node-meta {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.host-node-meta .pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.host-node-meta svg { width: 12px; height: 12px; opacity: .75; }

.host-node-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 13px; }

/* Jauges : le stockage d'abord, c'est ce qu'on vient chercher. */
.host-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}
.host-gauge .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.host-gauge .v { font-size: 15px; font-weight: 600; margin-top: 1px; }
.host-gauge .v.warn { color: var(--warning); }
.host-gauge .v.bad  { color: var(--danger); }
.host-gauge .d { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.host-bar {
  height: 4px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 5px;
}
.host-bar > i { display: block; height: 100%; background: var(--success); border-radius: 3px; }
.host-bar > i.warn { background: var(--warning); }
.host-bar > i.bad  { background: var(--danger); }
.host-bar > i.muted { background: var(--text-muted); opacity: .4; }

/* Services portés par la machine pour ce site. */
.host-svc { display: flex; flex-direction: column; gap: 2px; }
.host-svc-t {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.host-svc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  min-width: 0;
}
.host-svc-row:first-of-type { border-top: 0; }
.host-svc-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--success);
}
.host-svc-row .dot.off { background: var(--danger); }
.host-svc-row .lbl { font-weight: 500; white-space: nowrap; }
.host-svc-row .sub {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.host-svc-row .num {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
}
.host-svc-row.-partage .lbl { font-weight: 400; color: var(--text-muted); }

/* Volets de réplication, pour la machine de secours. */
.host-rep { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.host-rep-row { display: flex; align-items: baseline; gap: 8px; }
.host-rep-row .ok  { color: var(--success); font-weight: 600; }
.host-rep-row .ko  { color: var(--danger);  font-weight: 600; }
.host-rep-row .det { color: var(--text-muted); font-size: 11.5px; }

.host-note {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
}

/* ── Technologies ─────────────────────────────────────────
   Chaque marque garde sa couleur : c'est ce qui rend la liste lisible d'un
   coup d'œil, plus vite qu'une énumération de mots. */
.tech-wrap { display: flex; flex-direction: column; gap: 11px; }
/* Le libellé de famille tient sa colonne : sans grille, une famille de six
   marques renverrait les suivantes sous l'intitulé, qui ne les couvre plus. */
.tech-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: start;
  gap: 4px 14px;
}
.tech-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tech-fam {
  font-size: 10.5px;
  line-height: 1.5;
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
}
.tech-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--tc, currentColor);
}
[data-theme="dark"] .tech-chip-icon { color: var(--tcd, var(--tc, currentColor)); }
.tech-chip-icon svg { display: block; }
.tech-chip-initial {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: 4px;
}
.tech-chip-name { font-weight: 500; color: var(--text); }

/* Signature compacte : les logos seuls, pour les emplacements étroits. */
.tech-marks { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tech-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tc, currentColor);
}
[data-theme="dark"] .tech-mark { color: var(--tcd, var(--tc, currentColor)); }
.tech-mark svg { display: block; }
.tech-mark-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.tech-chip-ver {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 2px;
}

@media (max-width: 640px) {
  .tech-row { grid-template-columns: minmax(0, 1fr); }
  .tech-fam { padding-top: 0; }
}

/* ══ Composeur des tickets : micro, pièces jointes, vocaux, IA (2026-09-18) ══
   Scripts : assets/js/composeur.js. Serveur : includes/voix.php,
   includes/chrono_annotations.php, api/voix.php, api/ai.php (stream=1). */

/* Sans micro (navigateur ancien, page non sécurisée) : pas de bouton qui échoue. */
html.sans-micro [data-dictee],
html.sans-micro [data-vocal] { display: none !important; }
.btn.is-rec { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* Barre d'enregistrement : ● 0:12 ▁▃▅▇▅▃ Annuler / Insérer */
.voix-barre {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 0; padding: 7px 7px 7px 14px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.voix-rec {
  width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%;
  background: var(--danger); animation: voixPouls 1.2s ease-in-out infinite;
}
.voix-barre-lib { font-weight: 600; font-size: 13px; white-space: nowrap; }
.voix-barre-temps { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 3.2em; }
.voix-onde { flex: 1; min-width: 40px; height: 28px; color: var(--danger); }
.voix-barre-etat { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.voix-barre-etat:empty { display: none; }
.voix-barre .btn svg { width: 13px; height: 13px; }
.voix-barre.is-fini .voix-rec { animation: none; background: var(--text-muted); }
.voix-barre.is-fini .voix-onde { color: var(--text-soft); }
.voix-barre.is-fini .voix-annuler,
.voix-barre.is-fini .voix-terminer { display: none; }
.voix-barre.is-fini .voix-barre-etat::before {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: voixTourne .8s linear infinite;
}
@keyframes voixPouls { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }
@keyframes voixTourne { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  /* Téléphone : tout tient sur une ligne, le libellé cède sa place à l'onde. */
  .voix-barre { gap: 7px; padding-left: 12px; }
  .voix-barre-lib { display: none; }
  .voix-onde { min-width: 24px; }
  .voix-barre .btn { padding-inline: 10px; }
}

/* Points de suspension animés (« Transcription… »). */
.voix-points { display: inline-flex; gap: 3px; margin-right: 5px; vertical-align: middle; }
.voix-points i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; animation: voixPoints 1.2s ease-in-out infinite; }
.voix-points i:nth-child(2) { animation-delay: .15s; }
.voix-points i:nth-child(3) { animation-delay: .3s; }
@keyframes voixPoints { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* Pièces jointes déposées : envoyées aussitôt, progression dans la puce. */
.composer { position: relative; }
.composer.is-depot::after {
  content: 'Déposez vos fichiers : ils seront joints à votre message';
  position: absolute; inset: 6px; z-index: 6; pointer-events: none;
  display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center;
  border: 2px dashed var(--primary); border-radius: var(--r);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  font-size: 15px; font-weight: 600; color: var(--text);
}
.pj-puce {
  display: flex; align-items: center; gap: 10px; flex: 0 1 290px; min-width: 0; max-width: 100%;
  padding: 6px 6px 6px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
}
.pj-apercu {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-muted);
}
.pj-apercu img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-apercu svg { width: 18px; height: 18px; }
.pj-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pj-nom { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pj-etat:empty { display: none; }
.pj-barre { display: none; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.pj-barre > span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .15s linear; }
.pj-puce.is-envoi .pj-barre { display: block; }
.pj-puce.is-erreur { border-color: color-mix(in srgb, var(--danger) 60%, var(--border)); }
.pj-puce.is-erreur .pj-etat { color: var(--danger); }
.pj-reessayer { border: 0; background: none; padding: 2px 4px; font-size: 12px; color: var(--text); text-decoration: underline; cursor: pointer; }
.pj-retirer {
  display: inline-flex; flex: 0 0 auto; padding: 5px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.pj-retirer:hover { color: var(--danger); background: var(--danger-bg); }
.pj-retirer svg { width: 14px; height: 14px; }
.pj-puce.is-vocal { flex-basis: 100%; flex-wrap: wrap; }
.pj-lire {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--surface);
}
.pj-lire svg { width: 14px; height: 14px; }
.pj-transcription { flex-basis: 100%; margin: 2px 8px 4px 50px; font-size: 13px; line-height: 1.55; color: var(--text); white-space: pre-line; }
.pj-transcription.is-attente { color: var(--text-muted); font-style: italic; }

/* ── Vocal dans le fil : la carte suit la bulle qui la porte ─────────────── */
.message-bubble { --voix-encre: var(--text); --voix-fond: var(--surface-2); }
.message.admin-msg .message-bubble { --voix-encre: var(--on-primary); --voix-fond: var(--primary); }
.message-bubble.internal,
.message.admin-msg .message-bubble.internal { --voix-encre: var(--text); --voix-fond: var(--warning-bg); }
.voix-cartes { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--voix-encre) 16%, transparent); }
.voix-cartes.is-seul { margin-top: 0; padding-top: 0; border-top: 0; }
.voix-carte { display: flex; flex-direction: column; gap: 8px; min-width: min(100%, 300px); }
.voix-entete { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; opacity: .72; }
.voix-entete svg { width: 13px; height: 13px; flex: 0 0 auto; }
/* Vocal seul dans une bulle de l'équipe : la croix de suppression du message
   occupe le coin haut droit, le lien de téléchargement se range à côté. */
.message-bubble:has(> .msg-delete) > .voix-cartes.is-seul > .voix-carte:first-child .voix-entete { padding-right: 24px; }
.voix-nom { min-width: 0; }
.voix-dl { margin-left: auto; display: inline-flex; padding: 2px; color: inherit; opacity: .8; }
.voix-dl:hover { opacity: 1; color: inherit; }
.voix-dl svg { width: 14px; height: 14px; }
.voix-lecteur {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--voix-encre) 9%, transparent);
}
.voix-lire {
  width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--voix-encre); color: var(--voix-fond);
}
.voix-lire svg { width: 14px; height: 14px; }
.voix-i-pause, .voix-carte.is-lecture .voix-i-lire { display: none; }
.voix-carte.is-lecture .voix-i-pause { display: block; }
.voix-piste {
  position: relative; flex: 1; min-width: 70px; height: 4px; border-radius: 2px; cursor: pointer;
  background: color-mix(in srgb, var(--voix-encre) 24%, transparent);
}
.voix-piste::before { content: ''; position: absolute; inset: -9px 0; }   /* cible plus haute que le trait */
.voix-piste:focus-visible { outline: 2px solid var(--voix-encre); outline-offset: 5px; }
.voix-piste-plein { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--voix-encre); }
.voix-temps { min-width: 3.2em; text-align: right; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.voix-vitesse {
  padding: 1px 7px; border: 1px solid color-mix(in srgb, var(--voix-encre) 32%, transparent); border-radius: var(--r-pill);
  background: transparent; color: inherit; font-family: var(--font-mono); font-size: 11px; font-weight: 600; cursor: pointer;
}
.voix-transcription { font-size: 13.5px; line-height: 1.6; }
.voix-transcription p { margin: 0; }
.voix-etiquette { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.voix-transcription.is-attente,
.voix-transcription.is-vide,
.voix-transcription.is-erreur { opacity: .75; font-style: italic; font-size: 12.5px; }
.voix-relancer { border: 0; background: none; padding: 0; color: inherit; font: inherit; font-style: normal; text-decoration: underline; cursor: pointer; }

/* ── L'IA écrit dans le composeur (réponse reçue au fil de l'eau) ────────── */
.ia-bandeau {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
  background: linear-gradient(90deg, var(--violet-bg), var(--surface) 70%); color: var(--text);
}
.ia-bandeau svg { width: 15px; height: 15px; color: var(--violet); flex: 0 0 auto; animation: iaEtincelle 1.6s ease-in-out infinite; }
.ia-bandeau .voix-points { color: var(--violet); }
.ia-bandeau-detail { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.ia-bandeau .ia-arreter { margin-left: auto; }
.rte.is-ia { border-color: color-mix(in srgb, var(--violet) 55%, var(--border)); }
.rte.is-ia .rte-toolbar { pointer-events: none; opacity: .45; }
.ia-curseur {
  display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: text-bottom;
  border-radius: 1px; background: var(--violet); animation: iaCurseur 1s steps(2, start) infinite;
}
.btn.is-ia { border-color: var(--violet); color: var(--violet); background: var(--violet-bg); }
@keyframes iaCurseur { to { visibility: hidden; } }
@keyframes iaEtincelle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.8); opacity: .6; } }

/* ── Journal de chrono dans le fil (espace pro) ─────────────────────────── */
.chrono-journal {
  padding: 10px 14px 11px; border: 1px dashed color-mix(in srgb, var(--violet) 45%, var(--border));
  border-radius: var(--r); background: color-mix(in srgb, var(--violet-bg) 55%, var(--surface)); font-size: 13px;
}
.cj-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; font-size: 12px; color: var(--text-muted); }
.cj-tete svg { width: 14px; height: 14px; color: var(--violet); flex: 0 0 auto; }
.cj-tete strong { color: var(--text); font-weight: 600; }
.cj-etat { padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-3); font-family: var(--font-mono); font-size: 11px; }
.cj-etat.is-live { background: var(--violet-bg); color: var(--violet); }
.cj-interne { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.cj-resume {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 7px; border: 1px solid color-mix(in srgb, var(--violet) 40%, var(--border));
  border-radius: var(--r-pill); background: var(--surface); color: var(--violet);
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.cj-resume svg { width: 12px; height: 12px; flex: 0 0 auto; }
.cj-resume:hover, .cj-resume:focus-visible { background: var(--violet-bg); border-color: var(--violet); }
.cj-resume:disabled { opacity: .5; cursor: wait; }
.cj-resume + .cj-interne { margin-left: 0; }
.cj-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cj-note { display: grid; grid-template-columns: 7.5em auto minmax(0, 1fr); gap: 10px; align-items: baseline; }
.cj-quand { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.cj-quand em { font-style: normal; opacity: .72; }
.cj-type { padding: 1px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.cj-note.is-en_cours .cj-type { background: var(--info-bg); color: var(--info); }
.cj-note.is-fait .cj-type { background: var(--success-bg); color: var(--success); }
.cj-note.is-question .cj-type { background: var(--warning-bg); color: var(--warning); }
.cj-texte { line-height: 1.5; color: var(--text); }
.cj-dictee { font-size: 11px; opacity: .6; }
@media (max-width: 600px) {
  .cj-note { grid-template-columns: auto minmax(0, 1fr); }
  .cj-quand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .voix-rec, .voix-points i, .ia-bandeau svg, .ia-curseur, .voix-barre.is-fini .voix-barre-etat::before { animation: none; }
}

/* ─── Connexion par fournisseur d'identité (Google, Microsoft, Apple) ─────
   Les boutons vivent sur l'écran de connexion et sur les pages « Mon profil »
   / « Mon compte ». Ils reprennent .btn-outline : même hauteur, même rayon que
   le bouton passkey juste au-dessus, logo à gauche et libellé centré. */
.sso-boutons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
}
.sso-bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  font-weight: 600;
}
.sso-bouton svg { flex: 0 0 auto; }

/* Rattachement depuis le profil : une ligne par fournisseur, état à droite. */
.sso-liaisons { display: flex; flex-direction: column; gap: 10px; }
.sso-liaison {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.sso-liaison-nom { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.sso-liaison-detail { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.sso-liaison-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) {
  .sso-liaison { flex-wrap: wrap; }
  .sso-liaison-actions { margin-left: 0; width: 100%; }
}

/* En-tête de carte « logo + titre + état », aligné à gauche : sans cela le
   justify-content: space-between de .card-header centre le titre entre le
   logo et le badge. Utilisé par Réglages → Sécurité et par Mon profil. */
.card-header.entete-marque {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.card-header.entete-marque h2 { margin: 0; flex: 0 0 auto; }
.card-header.entete-marque .badge { margin-left: auto; }
