/* ─────────────────────────────────────────────────────────────────────────────
   task/assets/style.css — Panel de tâches TheFrontHub
   Design system repris du site (Inter, accent #FF6B00, thème clair + sombre)
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #FFFFFF;
  --bg-subtle: #FAFAFA;
  --bg-muted: #F4F4F5;
  --fg: #18181B;
  --fg-secondary: #3F3F46;
  --fg-muted: #71717A;
  --fg-subtle: #A1A1AA;
  --border: #E4E4E7;
  --border-subtle: #F0F0F1;
  --border-strong: #D4D4D8;
  --accent: #FF6B00;
  --accent-hover: #E55A00;
  --accent-subtle: #FFF4ED;
  --accent-border: #FFD4B8;
  --green: #10B981;
  --green-subtle: #ECFDF5;
  --red: #EF4444;
  --red-subtle: #FEF2F2;
  --card: #FFFFFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, .08), 0 16px 40px rgba(0, 0, 0, .14);
  --discord: #5865F2;
  --discord-hover: #4752C4;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0F0F11;
  --bg-subtle: #1A1A1E;
  --bg-muted: #242428;
  --fg: #F4F4F5;
  --fg-secondary: #D4D4D8;
  --fg-muted: #9CA3AF;
  --fg-subtle: #71717A;
  --border: #2A2A2E;
  --border-subtle: #1F1F23;
  --border-strong: #3F3F46;
  --accent: #FF6B00;
  --accent-hover: #FF8533;
  --accent-subtle: #2A1A0A;
  --accent-border: #4A3020;
  --green-subtle: #0C2A22;
  --red-subtle: #2A1212;
  --card: #1A1A1E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }

code { font-family: var(--mono); font-size: 12.5px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .06s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

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

.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-moon { display: block; }
[data-theme="dark"] .ico-sun { display: none; }

/* ── Barre du haut ───────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.brand-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me img {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  object-fit: cover;
}
.me span {
  font-weight: 600; font-size: 13.5px;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Zone principale ─────────────────────────────────────────────────────── */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.counts { font-size: 13px; color: var(--fg-muted); font-weight: 600; }
.counts b { color: var(--fg); font-weight: 700; }
.counts .dot { margin: 0 7px; color: var(--fg-subtle); }

.toolbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Tableau (board) ─────────────────────────────────────────────────────── */

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.board-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--fg-muted);
  padding: 60px 0;
  font-size: 14px;
}

.col {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
}
.col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg-subtle); flex: none; }
.col[data-status="in_progress"] .col-dot { background: var(--accent); }
.col[data-status="done"] .col-dot { background: var(--green); }
.col-title { font-weight: 700; font-size: 13.5px; }
.col-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--bg-muted);
  border-radius: 999px;
  padding: 1px 8px;
}

.col-empty {
  color: var(--fg-subtle);
  font-size: 13px;
  text-align: center;
  padding: 26px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}

.col-body { display: flex; flex-direction: column; gap: 10px; }

/* ── Carte tâche ─────────────────────────────────────────────────────────── */

.task {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-top { display: flex; align-items: center; gap: 8px; }

.prio {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-muted);
}
.prio.prio-high { color: var(--red); border-color: var(--red); background: var(--red-subtle); }
.prio.prio-low { color: var(--fg-subtle); background: transparent; }

.task-num { font-family: var(--mono); font-size: 11px; color: var(--fg-subtle); margin-left: auto; }

.task-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.task[data-status="done"] .task-title { color: var(--fg-muted); text-decoration: line-through; text-decoration-color: var(--fg-subtle); }

.task-desc {
  margin: 0;
  font-size: 13px;
  color: var(--fg-secondary);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.task-assignee { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fg-secondary); }
.task-assignee img { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.task-assignee .as-label { color: var(--fg-subtle); font-size: 11.5px; }

.task-meta { font-size: 11.5px; color: var(--fg-subtle); }
.task-doneby { font-size: 11.5px; color: var(--green); font-weight: 600; }

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.tbtn:hover { background: var(--bg-muted); border-color: var(--border-strong); color: var(--fg); }
.tbtn.go { color: var(--accent); border-color: var(--accent-border); }
.tbtn.go:hover { background: var(--accent-subtle); }
.tbtn.done { color: var(--green); border-color: var(--green); }
.tbtn.done:hover { background: var(--green-subtle); }
.tbtn.danger { color: var(--red); border-color: transparent; margin-left: auto; }
.tbtn.danger:hover { background: var(--red-subtle); border-color: var(--red); }
.tbtn svg { flex: none; }

/* ── Écrans auth (connexion / refusé) ────────────────────────────────────── */

.auth-body { background: var(--bg); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 30px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-card-denied { border-color: var(--red); }

.auth-logo { width: 56px; height: 56px; object-fit: contain; }
.auth-avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }

.auth-title { margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { margin: 0; color: var(--fg-muted); font-size: 14px; }

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  margin-top: 8px;
  border-radius: 10px;
  background: var(--discord);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid var(--discord);
  transition: background .15s ease, transform .06s ease;
}
.btn-discord:hover { background: var(--discord-hover); }
.btn-discord:active { transform: translateY(1px); }

.auth-note { margin: 6px 0 0; font-size: 12.5px; color: var(--fg-subtle); line-height: 1.55; }

.auth-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }

.denied-id {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.denied-id-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); }

.copy-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.copy-row code {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  word-break: break-all;
  text-align: left;
}

.alert {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
}
.alert-error { background: var(--red-subtle); border-color: var(--red); color: var(--red); }

/* ── Dialogues ───────────────────────────────────────────────────────────── */

.dlg {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--fg);
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  box-shadow: var(--shadow-pop);
}
.dlg::backdrop { background: rgba(0, 0, 0, .55); }

.dlg-body { padding: 20px 20px 6px; }
.dlg h2 { margin: 0 0 6px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }

.dlg-hint { margin: 0 0 14px; font-size: 12.5px; color: var(--fg-muted); line-height: 1.55; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--fg-secondary); }
.field-label em { color: var(--red); font-style: normal; }

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select,
.add-row input {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--fg);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus, .add-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.field textarea { resize: vertical; min-height: 88px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-error {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  background: var(--red-subtle);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 8px 10px;
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
}

.add-row { display: flex; gap: 10px; margin: 4px 0 6px; }
.add-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

.admins-list {
  list-style: none;
  margin: 10px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--bg-subtle);
}
.admin-row img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; background: var(--bg-muted); }
.admin-info { min-width: 0; flex: 1; }
.admin-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-name.pending { color: var(--fg-subtle); font-weight: 600; font-style: italic; }
.admin-id { font-family: var(--mono); font-size: 11px; color: var(--fg-subtle); word-break: break-all; }

.admin-chip {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-muted);
  flex: none;
}
.admin-chip.owner { color: var(--accent); border-color: var(--accent-border); background: var(--accent-subtle); }
.admin-chip.site { color: var(--fg-secondary); }

.admin-remove {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.admin-remove:hover { color: var(--red); background: var(--red-subtle); border-color: var(--red); }

/* ── Toasts ──────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  animation: toast-in .18s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .col { min-height: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .brand-chip { display: none; }
  .me span { display: none; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  #btn-new { flex: 1 1 100%; justify-content: center; }
  .toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .dlg-actions { flex-wrap: wrap; }
  .add-row { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════════════════════
   v4 — Recherche/filtres, stats, badges d'échéance, étiquettes, épinglage,
   détail + commentaires, activité, réglages webhook, drag & drop, compact
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Toolbar : recherche + filtres ────────────────────────────────────────── */

.toolbar { align-items: flex-start; }

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 420px;
  min-width: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 11px;
  height: 38px;
  flex: 1 1 180px;
  min-width: 150px;
  max-width: 300px;
  color: var(--fg-subtle);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  color: var(--fg-secondary);
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-size: 13.5px;
  width: 100%;
  min-width: 0;
}
.search-box input::placeholder { color: var(--fg-subtle); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.toolbar-left select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 10px;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  cursor: pointer;
  max-width: 170px;
  transition: border-color .15s ease;
}
.toolbar-left select:hover { border-color: var(--accent); }
.toolbar-left select:focus { outline: none; border-color: var(--accent); }

.counts { padding-top: 9px; }
.counts b.late { color: var(--red); }

.icon-btn.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.btn.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

/* ── Carte : épinglage + drag & drop ──────────────────────────────────────── */

.task.dragging { opacity: .45; }
.col.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
  background: var(--accent-subtle);
}

.pin-ico { color: var(--accent); flex: none; }

.task-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
}
.task:hover .task-pin-btn, .task-pin-btn:focus-visible { opacity: 1; }
.task.pinned .task-pin-btn { opacity: 1; color: var(--accent); }
.task-pin-btn:hover { color: var(--accent); background: var(--accent-subtle); }
@media (hover: none) {
  .task-pin-btn { opacity: 1; }
}

/* ── Carte : badges d'échéance + étiquettes ───────────────────────────────── */

.task-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.due.overdue { color: var(--red); border-color: var(--red); background: var(--red-subtle); }
.due.today { color: var(--accent); border-color: var(--accent-border); background: var(--accent-subtle); }
.due.cm { color: var(--fg-muted); }
.due.arch { color: var(--fg-muted); font-style: italic; }
.due.inline { background: var(--bg-muted); }

.label-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.lchip {
  --lc: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--lc);
  background: color-mix(in srgb, var(--lc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--lc) 35%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.lchip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lc);
  flex: none;
}

.field-hint { color: var(--fg-subtle); font-weight: 600; }

.label-picks { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.lchip-pick {
  --lc: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.lchip-pick .lchip-dot { background: var(--lc); width: 8px; height: 8px; }
.lchip-pick:hover { border-color: var(--lc); }
.lchip-pick.on {
  color: var(--lc);
  background: color-mix(in srgb, var(--lc) 12%, transparent);
  border-color: var(--lc);
}

/* ── Vue compacte ─────────────────────────────────────────────────────────── */

.board.compact .task { padding: 8px 10px 7px; gap: 5px; }
.board.compact .task-desc { display: none; }
.board.compact .task-meta, .board.compact .task-doneby { display: none; }
.board.compact .col-body { gap: 7px; }

/* ── Détail d'une tâche ───────────────────────────────────────────────────── */

.dlg-wide { width: min(640px, calc(100vw - 32px)); }

.detail-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.detail-status {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-muted);
}
.detail-status.st-in_progress { color: var(--accent); border-color: var(--accent-border); background: var(--accent-subtle); }
.detail-status.st-done { color: var(--green); border-color: var(--green); background: var(--green-subtle); }
.detail-status.st-archived { font-style: italic; }

.dlg h2 { word-break: break-word; }

.detail-desc {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--fg-secondary);
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.6;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}
.detail-desc a { color: var(--accent); font-weight: 600; }

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.meta-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.meta-label {
  flex: none;
  width: 92px;
  color: var(--fg-subtle);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.meta-value { color: var(--fg-secondary); font-weight: 600; min-width: 0; }
.meta-person { display: inline-flex; align-items: center; gap: 6px; }
.meta-person img { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }

.detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.detail-comments { margin-top: 16px; }
.dc-title { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; }
.dc-count { color: var(--fg-subtle); font-weight: 700; }

.dc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.dc-item { display: flex; gap: 9px; }
.dc-item > img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  object-fit: cover;
  flex: none;
}
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 8px; }
.dc-name { font-weight: 700; font-size: 12.5px; }
.dc-time { font-size: 11px; color: var(--fg-subtle); }
.dc-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}
.dc-item:hover .dc-del, .dc-del:focus-visible { opacity: 1; }
.dc-del:hover { color: var(--red); }
@media (hover: none) { .dc-del { opacity: .7; } }

.dc-text {
  font-size: 13px;
  color: var(--fg-secondary);
  white-space: pre-line;
  word-break: break-word;
  margin-top: 2px;
}
.dc-text a { color: var(--accent); font-weight: 600; }
.dc-empty { font-size: 12.5px; color: var(--fg-subtle); font-style: italic; }

.dc-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.dc-form textarea {
  flex: 1;
  min-width: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--fg);
  resize: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dc-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ── Discussion de tâche (style Discord) ─────────────────────────────────── */

.detail-chat {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  position: relative;
}
.detail-chat.dragging::after {
  content: 'Dépose les fichiers pour les envoyer';
  position: absolute;
  inset: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  background: color-mix(in srgb, var(--accent-subtle) 86%, transparent);
  color: var(--accent);
  font-weight: 800;
  font-size: 13.5px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  pointer-events: none;
  z-index: 3;
}
.chat-hint {
  margin: -2px 0 8px;
  font-size: 11.5px;
  color: var(--fg-subtle);
}
.chat-scroll {
  overflow-y: auto;
  max-height: 330px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  padding: 6px 2px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-subtle);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-loading, .chat-empty {
  margin: auto;
  padding: 22px 12px;
  text-align: center;
  color: var(--fg-subtle);
}
.chat-empty-title { font-weight: 700; font-size: 13.5px; color: var(--fg-muted); }
.chat-empty-sub { font-size: 12px; margin-top: 3px; }

.chat-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 6px 4px;
  color: var(--fg-subtle);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.chat-day::before, .chat-day::after {
  content: '';
  height: 1px;
  background: var(--border);
  flex: 1;
}

.chat-msg {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 4px 8px 2px;
  border-radius: 8px;
}
.chat-msg:hover { background: var(--bg-muted); }
.chat-msg.grouped { padding-top: 1px; }
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  margin-top: 2px;
  object-fit: cover;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}
.chat-msg.grouped .chat-avatar { visibility: hidden; height: 1px; margin-top: 0; }
.chat-main { min-width: 0; flex: 1; }
.chat-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chat-name { font-weight: 800; font-size: 13.5px; }
.chat-time { color: var(--fg-subtle); font-size: 10.5px; }
.chat-edited { color: var(--fg-subtle); font-size: 10.5px; font-style: italic; }
.chat-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--fg);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.chat-text .md-p { margin: 1px 0; }
.chat-deleted { color: var(--fg-subtle); font-style: italic; }
.chat-msg.deleted .chat-text { opacity: .75; }

/* Actions rapides */
.chat-tools {
  position: absolute;
  top: -13px;
  right: 8px;
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 2;
}
.chat-msg:hover .chat-tools, .chat-tools:focus-within { opacity: 1; }
@media (hover: none) { .chat-msg:hover .chat-tools { opacity: 1; } }
.chat-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.chat-tool:hover { background: var(--bg-muted); color: var(--fg); }
.chat-tool.danger:hover { background: var(--red-subtle); color: var(--red); }

/* Pièces jointes */
.chat-atts { margin-top: 5px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chat-imglink { display: inline-block; max-width: min(360px, 100%); }
.chat-att-img {
  display: block;
  max-width: 100%;
  max-height: 250px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--bg-muted);
}
.chat-att-video {
  width: min(360px, 100%);
  max-height: 280px;
  border-radius: 10px;
  background: #000;
  border: 1px solid var(--border);
}
.chat-att-audio { width: min(360px, 100%); }
.chat-filecard {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 12px;
  max-width: min(400px, 100%);
  text-decoration: none;
  color: var(--fg);
  transition: border-color .15s ease, transform .1s ease;
}
.chat-filecard:hover { border-color: var(--accent); transform: translateY(-1px); }
.chat-filecard.expired { opacity: .65; }
.chat-filecard.expired:hover { border-color: var(--border-strong); transform: none; }
.chat-fc-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
}
.chat-fc-meta { min-width: 0; display: flex; flex-direction: column; }
.chat-fc-name {
  font-weight: 700;
  font-size: 12.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-fc-size { font-size: 11px; color: var(--fg-subtle); }
.chat-fc-dl { margin-left: auto; color: var(--fg-muted); flex: none; }

/* Édition en place */
.chat-editform { margin: 2px 0 4px; }
.chat-edit {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--fg);
  resize: vertical;
  min-height: 38px;
}
.chat-edit:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-subtle); }
.chat-editrow { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* Composeur */
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px 8px;
  margin-top: 10px;
}
.chat-composer:focus-within { border-color: var(--accent); }
.chat-composer textarea {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 7px 2px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--fg);
  max-height: 132px;
}
.chat-composer textarea::placeholder { color: var(--fg-subtle); }
.chat-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.chat-ico:hover { background: var(--bg-subtle); color: var(--fg); }
.chat-ico.send { color: var(--accent); }
.chat-ico.send:hover { background: var(--accent-subtle); color: var(--accent-hover); }
.chat-ico:disabled { opacity: .5; cursor: not-allowed; }

/* Fichiers en attente d'envoi */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 12px;
  max-width: 100%;
}
.chat-chip-name { font-weight: 700; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip-size { color: var(--fg-subtle); font-size: 11px; }
.chat-chip-rm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.chat-chip-rm:hover { background: var(--red-subtle); color: var(--red); }

/* Pastille « nouveaux messages » */
.chat-newpill {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  border: 1px solid var(--accent-border);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
}
.chat-newpill:hover { background: var(--accent-hover); }

@media (max-width: 560px) {
  .chat-scroll { max-height: 260px; }
  .chat-avatar { width: 28px; height: 28px; }
  .chat-tools { top: -15px; right: 4px; }
  .chat-fc-name { max-width: 150px; }
  .chat-newpill { bottom: 86px; }
}

/* ── Historique d'activité ─────────────────────────────────────────────────── */

.act-list {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}

.act-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
}
.act-row:hover { background: var(--bg-subtle); }

.act-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--fg-secondary);
}
.act-ico.a-create { color: var(--green); background: var(--green-subtle); }
.act-ico.a-del { color: var(--red); background: var(--red-subtle); }
.act-ico.a-status { color: var(--accent); background: var(--accent-subtle); }
.act-ico.a-pin { color: var(--accent); background: var(--accent-subtle); }
.act-ico.a-comment { color: var(--fg-secondary); }

.act-body { min-width: 0; flex: 1; font-size: 13px; }
.act-line { color: var(--fg-secondary); word-break: break-word; }
.act-line b { color: var(--fg); }
.act-detail {
  font-size: 12px;
  color: var(--fg-subtle);
  margin-top: 1px;
  word-break: break-word;
}
.act-time { flex: none; font-size: 11px; color: var(--fg-subtle); padding-top: 2px; }
.act-empty { font-size: 13px; color: var(--fg-subtle); font-style: italic; padding: 12px 4px; }

/* ── Réglages (webhook) ────────────────────────────────────────────────────── */

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 4px;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-card:hover { border-color: var(--accent-border); }
.mode-card.on {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.mode-card:focus-within {
  outline: none;
  border-color: var(--accent);
}
.mc-title { font-size: 13.5px; font-weight: 700; color: var(--fg); }
.mc-desc { font-size: 11.5px; color: var(--fg-muted); line-height: 1.4; }

.field-help {
  font-size: 11.5px;
  color: var(--fg-muted);
  line-height: 1.45;
  font-weight: 500;
}
.field-help strong { color: var(--fg-secondary); }

.check-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 12px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  cursor: pointer;
  user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.set-test-row { margin: 2px 0 8px; }

.field input[type="date"],
.field input[type="url"],
.field input[type="search"] {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--fg);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input[type="date"]:focus,
.field input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ── Responsive des nouveaux éléments ──────────────────────────────────────── */

@media (max-width: 640px) {
  .toolbar-left { flex: 1 1 100%; }
  .search-box { flex: 1 1 100%; max-width: none; }
  .toolbar-left select { flex: 1 1 30%; max-width: none; min-width: 0; }
  .counts { padding-top: 0; }
  .toolbar-actions { gap: 8px; }
  .detail-actions .tbtn { flex: 1 1 auto; justify-content: center; }
  .dc-form { flex-direction: column; align-items: stretch; }
  .meta-label { width: 84px; }
  .act-time { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   v6 — versions/jalons, checklists, vue liste, Markdown, patch notes
   ───────────────────────────────────────────────────────────────────────────── */

[hidden] { display: none !important; }

.counts b.urgent { color: var(--red); }

/* Chip version / jalon */
.mchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  background: var(--bg-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* Badge checklist sur les cartes */
.due.ck.full { color: var(--green); border-color: var(--green); background: var(--green-subtle); }

/* Checklist (détail de tâche) */
.detail-checklist { margin-top: 18px; }

.ck-progress {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
  margin: 8px 0 10px;
}
.ck-progress.mini { height: 4px; margin: 4px 0 0; width: 72px; }
.ck-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width .25s ease;
}

.ck-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ck-empty { color: var(--fg-subtle); font-size: 13px; padding: 4px 2px; }
.ck-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-subtle);
}
.ck-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; flex: none; }
.ck-body { flex: 1; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.ck-item.done .ck-body { color: var(--fg-subtle); text-decoration: line-through; }
.ck-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  flex: none;
}
.ck-del:hover { color: var(--red); background: var(--red-subtle); }

.dc-form input[type="text"] {
  flex: 1;
  min-width: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dc-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Markdown riche (descriptions + commentaires) */
.md-p { margin: 0 0 4px; }
.md-p:last-child { margin-bottom: 0; }
.md-ul { margin: 2px 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.md-code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1px 5px;
}
.md-pre {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 4px 0 8px;
}
.md-pre code { background: none; border: 0; padding: 0; }
.md-imglink { display: inline-block; }
.md-img {
  max-width: 220px;
  max-height: 140px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin: 4px 0;
}

/* Vue liste (façon tableur) */
.listview { overflow-x: auto; }

.lv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lv-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-subtle);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.lv-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.lv-row { cursor: pointer; transition: background .12s ease; }
.lv-row:hover { background: var(--bg-subtle); }
.lv-row.arch { opacity: .65; }

.lv-tmain { display: flex; align-items: center; gap: 6px; min-width: 180px; }
.lv-tmain b { font-size: 13.5px; }
.lv-desc {
  color: var(--fg-muted);
  font-size: 12px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.lv-status {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.lv-labels { max-width: 170px; }
.lv-labels .lchip { margin: 1px 3px 1px 0; }
.lv-more { font-size: 11px; color: var(--fg-subtle); font-weight: 700; }
.lv-none { color: var(--fg-subtle); }
.lv-who { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lv-who img { width: 20px; height: 20px; border-radius: 50%; }
.lv-ckn { font-size: 12px; font-weight: 700; }
.lv-ckn.full { color: var(--green); }
.lv-act { white-space: nowrap; }
.lv-empty td { text-align: center; color: var(--fg-subtle); padding: 26px 10px; }

/* Patch notes / changelog */
.chg-preview {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 4px;
  max-height: 46vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .lv-desc { display: none; }
  .lv-table th:nth-child(4), .lv-table td.lv-labels { display: none; }
  .lv-table th:nth-child(5), .lv-table td.lv-ms { display: none; }
  .ck-body { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Espace admin — onglets Tâches / Chat + chat plein écran (chat.js)
   ═══════════════════════════════════════════════════════════════════════════ */

.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  margin-left: auto;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--fg-subtle);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

.view-tab:hover { color: var(--fg); background: var(--bg); }

.view-tab.is-active {
  color: var(--accent);
  background: var(--bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 0 0 1px var(--border);
}

.view-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

/* ── Vue chat plein écran ─────────────────────────────────────────────────── */

.wrap-chat {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 61px);
  padding-bottom: 14px;
}

.gchat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.gchat-head {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.gchat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.gchat-title h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--fg);
}

.gchat-hint {
  font-size: 12px;
  color: var(--fg-subtle);
  margin: 0;
}

.gchat-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 12px 18px 10px;
}

/* Avatar de repli (initiale colorée) quand l'avatar Discord est absent */
.chat-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  user-select: none;
}

/* Indication de dépôt de fichiers sur toute la zone */
.gchat.dragging::after {
  content: 'Dépose tes fichiers ici';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 2px dashed var(--accent-border);
  border-radius: 14px;
  z-index: 5;
  pointer-events: none;
}

/* Le composeur du chat général reste collé en bas de la zone visible */
.gchat .chat-composer {
  margin: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
}

.gchat .chat-chips {
  position: static;
  margin: 0 18px;
  border-radius: 0;
}

.gchat .chat-newpill {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

@media (max-width: 760px) {
  .view-tabs { order: 3; width: 100%; justify-content: stretch; margin-left: 0; }
  .view-tab { flex: 1; justify-content: center; padding: 7px 10px; }
  .wrap-chat { height: calc(100dvh - 96px); padding: 0 10px 10px; }
  .gchat-head { padding: 10px 12px 8px; gap: 8px; }
  .gchat-hint { display: none; }
  .gchat-scroll { padding: 10px 12px 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ═══ SIDEBAR + SUPPORT (2026-02) ═══
   Sidebar catégories (support.js) + vues Tickets support / Chat support.
   Uniquement des tokens → thèmes clair et sombre couverts.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --topbar-h: 57px;
  --sidebar-w: 232px;
}

/* ── Topbar : burger (mobile) ─────────────────────────────────────────────── */

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-burger { display: none; }

/* ── Sidebar catégories ───────────────────────────────────────────────────── */

.admin-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 35;
  display: flex;
  flex-direction: column;
  padding: 12px 0 10px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px; /* cible tactile ≥44px */
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--fg-secondary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.side-item svg { flex: 0 0 auto; color: var(--fg-muted); transition: color .15s ease; }
.side-item:hover { background: var(--bg-muted); color: var(--fg); }
.side-item:hover svg { color: var(--fg-secondary); }
.side-item.is-active { background: var(--accent-subtle); color: var(--accent); }
.side-item.is-active svg { color: var(--accent); }

.side-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}
.side-badge-red { background: var(--red); border-color: var(--red); color: #fff; }
.side-badge-strong { background: var(--accent); border-color: var(--accent); color: #fff; }

.side-me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 16px 4px;
  border-top: 1px solid var(--border);
}
.side-me img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  object-fit: cover;
  flex: 0 0 auto;
}
.side-me span {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-backdrop {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  z-index: 30;
  background: rgb(0 0 0 / .45);
}

/* ── Zone principale décalée par la sidebar ───────────────────────────────── */

.app-main {
  margin-left: var(--sidebar-w);
  min-width: 0;
  min-height: calc(100dvh - var(--topbar-h));
}

/* ── Panes pleine hauteur (Tickets / Chat support) ────────────────── */

.pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
  height: calc(100dvh - var(--topbar-h));
  min-height: 0;
}
.pane[hidden] { display: none; }

.pane-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.pane-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--fg-muted);
}

/* ── Split 2 colonnes : liste ~320px + fil ────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.split-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.split-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.split-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-loading, .split-empty {
  padding: 18px 14px;
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
}

/* Mini-filtre Ouverts / Tous / Fermés */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.seg-btn {
  min-height: 28px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg-btn:hover { color: var(--fg); }
.seg-btn.is-active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 0 0 1px var(--border);
}

/* Puces communes (catégorie, statut, badges) */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  white-space: nowrap;
}

.tstatus {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tstatus.st-open { color: var(--accent); background: var(--accent-subtle); border: 1px solid var(--accent-border); }
.tstatus.st-answered { color: var(--green); background: var(--green-subtle); border: 1px solid rgb(16 185 129 / .35); }
.tstatus.st-closed { color: var(--fg-muted); background: var(--bg-muted); border: 1px solid var(--border); }

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

/* ── Liste des tickets ────────────────────────────────────────────────────── */

.tkt {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tkt:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.tkt.is-active { background: var(--accent-subtle); border-color: var(--accent); }

.tkt-avatar, .cv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  object-fit: cover;
  flex: 0 0 auto;
}

.tkt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tkt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tkt-subject {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkt-date { font-size: 11px; color: var(--fg-subtle); white-space: nowrap; }
.tkt-mid { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tkt-user {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkt-preview {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--fg-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Liste des conversations (chat support) ───────────────────────────────── */

.cv {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.cv:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.cv.is-active { background: var(--accent-subtle); border-color: var(--accent); }

.cv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cv-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-time { font-size: 11px; color: var(--fg-subtle); white-space: nowrap; }
.cv-bottom { display: flex; align-items: center; gap: 8px; }
.cv-preview {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

/* ── Fil (tickets + chat support) ─────────────────────────────────────────── */

.split-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--fg-subtle);
  font-size: 13.5px;
  text-align: center;
}
.thread-empty svg { opacity: .55; }
.thread-empty p { margin: 0; }

.thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.thread[hidden] { display: none; }

.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.thread-back { display: none; }
.thread-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  object-fit: cover;
  flex: 0 0 auto;
}
.thread-head-main { flex: 1; min-width: 0; }
.thread-head-main h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-sub {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  color: var(--fg-subtle);
}
.thread-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-subtle);
}

/* Bulles : joueur à gauche, équipe à droite avec l'accent */
.bub {
  max-width: min(72%, 560px);
  padding: 8px 12px 9px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}
.bub-user { align-self: flex-start; border-bottom-left-radius: 4px; }
.bub-team {
  align-self: flex-end;
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  border-bottom-right-radius: 4px;
}
.bub-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.bub-user .bub-name { font-size: 12px; font-weight: 800; color: var(--fg-secondary); }
.bub-team .bub-name { font-size: 12px; font-weight: 800; color: var(--accent); }
.bub-time { font-size: 10.5px; color: var(--fg-subtle); }
.bub-body {
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bub-pending { opacity: .6; }
.bub-failed { border-color: var(--red); }

.thread-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.thread-composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 140px;
  padding: 9px 12px;
  resize: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.thread-composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.thread-composer textarea:disabled { opacity: .55; }

/* ── Mobile <900px : drawer + listes plein écran ──────────────────────────── */

@media (max-width: 899.98px) {
  .nav-burger { display: inline-flex; }

  .admin-sidebar {
    width: min(300px, 85vw);
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .admin-sidebar.open {
    transform: none;
    box-shadow: var(--shadow-pop);
  }

  .app-main { margin-left: 0; }

  .pane { padding: 12px 12px 14px; }

  .split { grid-template-columns: 1fr; }
  .split-main { display: none; }
  .pane.show-thread .split-side { display: none; }
  .pane.show-thread .split-main { display: flex; }
  .thread-back { display: inline-flex; }
  .thread-head .btn span { display: none; } /* « Fermer le ticket » → icône seule */
  .bub { max-width: 86%; }
}

/* ═════════════════════════════════════════════════════════════════════════════
   Vue « Parties récupérées » (games.js) — compteur d'ingestion auto-actualisé
   ═════════════════════════════════════════════════════════════════════════════ */

.games-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.games-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.games-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-subtle);
  animation: gamesPulse 2s ease-in-out infinite;
}

.games-live.is-busy .games-dot { animation-duration: .7s; }

@keyframes gamesPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 8px;
}

.gstat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.gstat-hero {
  background: linear-gradient(135deg, var(--accent-subtle), var(--card) 55%);
  border-color: var(--accent-border);
}

.gstat-wide { grid-column: 1 / -1; }

.gstat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-muted);
}

.gstat-note { text-transform: none; letter-spacing: 0; font-weight: 500; }

.gstat-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.gstat-hero .gstat-value { color: var(--accent); }

.gstat-sub {
  font-size: 12.5px;
  color: var(--fg-subtle);
  line-height: 1.5;
}

.gstat-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 22px; }

.gbar {
  height: 9px;
  margin-top: 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.gbar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
  transition: width .6s ease;
}

.games-grid.is-error .gstat-value { color: var(--fg-subtle); }

@media (max-width: 640px) {
  .gstat-value { font-size: 27px; }
  .gstat { padding: 13px 14px; }
}
