/* Polices auto-hébergées (paquets @fontsource-variable) ; repli sur les polices système si absentes. */
@import url("/vendor/fonts/outfit/index.css");
@import url("/vendor/fonts/figtree/index.css");
@import url("/vendor/fonts/inter/index.css");
@import url("/vendor/fonts/jetbrains-mono/index.css");

/* ── Jetons de design — charte style.md v1.4 : moderne, sombre, bleu & blanc, doux (clair en option) ── */
:root {
  color-scheme: dark;
  --page: #060a15;
  --page-glow-1: rgba(59, 130, 246, 0.16);
  --page-glow-2: rgba(56, 189, 248, 0.08);
  --surface-1: rgba(16, 26, 52, 0.6);
  --surface-solid: #0e1627;
  --surface-2: rgba(148, 163, 184, 0.06);
  --surface-3: rgba(148, 163, 184, 0.12);
  --input: rgba(2, 6, 23, 0.55);
  --topbar: rgba(6, 10, 20, 0.72);
  --border: rgba(110, 160, 255, 0.14);
  --border-strong: rgba(110, 160, 255, 0.28);
  --glow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, 0.6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #7b8aa3;
  --axis-text: #64748b;
  --grid: rgba(148, 163, 184, 0.07);
  --axis: rgba(148, 163, 184, 0.16);
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-contrast: #ffffff;
  --badge-text: #bfdbfe;
  --positive: #34d399;
  --negative: #fb7185;
  --chart-primary: #3b82f6;
  --chart-positive: #34d399;
  --chart-negative: #fb7185;
  --chart-mean: #fbbf24;
  --chart-median: #22d3ee;
  --good: #34d399;
  --critical: #fb7185;
  --good-soft: rgba(52, 211, 153, 0.12);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --critical-soft: rgba(251, 113, 133, 0.1);
  --focus: #60a5fa;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Figtree Variable", "Figtree", "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit Variable", "Outfit", "Figtree Variable", "Figtree", system-ui, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f7fc;
  --page-glow-1: rgba(59, 130, 246, 0.1);
  --page-glow-2: rgba(56, 189, 248, 0.07);
  --surface-1: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(15, 23, 42, 0.04);
  --surface-3: rgba(15, 23, 42, 0.07);
  --input: #ffffff;
  --topbar: rgba(244, 247, 252, 0.82);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.17);
  --glow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 28px -18px rgba(15, 23, 42, 0.25);
  --shadow-pop: 0 18px 44px -14px rgba(15, 23, 42, 0.28);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --axis-text: #64748b;
  --grid: rgba(15, 23, 42, 0.06);
  --axis: rgba(15, 23, 42, 0.14);
  --accent: #2563eb;
  --accent-2: #3b82f6;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-glow: rgba(37, 99, 235, 0.25);
  --badge-text: #1e40af;
  --positive: #059669;
  --negative: #e11d48;
  --chart-primary: #2563eb;
  --chart-positive: #059669;
  --chart-negative: #e11d48;
  --chart-mean: #d97706;
  --chart-median: #0891b2;
  --good: #059669;
  --critical: #e11d48;
  --good-soft: rgba(5, 150, 105, 0.1);
  --warn-soft: rgba(217, 119, 6, 0.1);
  --critical-soft: rgba(225, 29, 72, 0.07);
  --focus: #2563eb;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 8% -12%, var(--page-glow-1), transparent 60%),
    radial-gradient(900px 520px at 100% -8%, var(--page-glow-2), transparent 60%),
    var(--page);
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-2);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* Barres de défilement fines et discrètes, accordées au thème. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: padding-box;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
}

.mono,
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Coque : barre latérale (modules) + barre supérieure (recherche, notifications, compte) ─────────── */
body.with-side {
  padding-left: 264px;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0;
  white-space: nowrap;
}
.brand:hover {
  color: var(--text-primary);
}
.sidebar .brand {
  padding: 2px 8px 12px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  color: var(--accent-contrast);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 18px var(--accent-glow);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.side-title {
  padding: 12px 10px 4px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.side-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-link:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.side-link[aria-current="page"] {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-color: var(--border-strong);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 22px -8px var(--accent-glow);
}

/* Mascotte : un petit robot qui commente la page. */
.mascot {
  margin-top: auto;
  padding: 8px 6px 2px;
  text-align: center;
}
.mascot svg {
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 8px 14px var(--accent-glow));
  animation: mascot-float 4.2s ease-in-out infinite;
}
.mascot .mascot-eye,
.mascot-hint .mascot-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: mascot-blink 5s infinite;
}
.mascot p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}
@keyframes mascot-float {
  50% {
    translate: 0 -5px;
  }
}
@keyframes mascot-blink {
  0%,
  94%,
  100% {
    scale: 1 1;
  }
  97% {
    scale: 1 0.1;
  }
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 12px 20px 0 8px;
  padding: 0 12px 0 14px;
  background: var(--topbar);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.topbar-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 560px;
  min-width: 0;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 40px 0 36px;
  background: var(--input);
}
.topbar-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  pointer-events: none;
}
.topbar-search kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  translate: 0 -50%;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pop);
}
.search-results a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-primary);
}
.search-results a:hover,
.search-results a[aria-selected="true"] {
  background: var(--accent-soft);
}
.search-results small {
  margin-left: auto;
  overflow: hidden;
  max-width: 55%;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-spacer {
  flex: 1;
}
/* Serveur retenu pour tout le panel (0.7.4) */
.global-guild {
  flex: 0 1 220px;
  min-width: 0;
  height: 36px;
  background: var(--input);
}
/* Salons de journal d'un module : actions et configuration côte à côte (empilés sur téléphone). */
.log-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.log-channel select {
  width: 100%;
}
.log-channel small,
.dialog small.muted {
  display: block;
  margin-top: 4px;
  line-height: 1.4;
}
.version-tag {
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--badge-text);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Bouton ☰ et fond assombri : seulement sur petit écran (voir plus bas). */
.topbar .nav-toggle {
  display: none;
}
.side-backdrop {
  display: none;
}
@media (max-width: 900px) {
  body.with-side {
    padding-left: 0;
  }
  .topbar {
    margin: 8px 12px 0;
    top: 8px;
  }
  .topbar .nav-toggle {
    display: inline-flex;
  }
  .sidebar {
    translate: -110% 0;
    transition: translate 0.22s ease;
    box-shadow: var(--shadow-pop);
  }
  body.side-open .sidebar {
    translate: 0 0;
  }
  body.side-open .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
  }
  .topbar-search kbd {
    display: none;
  }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.user-chip form {
  margin: 0;
}
/* Notifications : cloche avec compteur, liste déroulante sous la barre. */
.notif {
  position: relative;
}
.notif-button {
  position: relative;
}
.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--critical);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pop);
  z-index: 30;
}
.notif-head {
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.notif-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.notif-item.unread .notif-text {
  color: var(--text-primary);
  font-weight: 600;
}
.notif-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.notif-empty {
  padding: 16px 14px;
  color: var(--text-muted);
  font-size: 13px;
}
@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: 60px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}

/* ── Contrôles ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow: 0 6px 18px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 26px -10px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text-primary);
}
.btn-ghost[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.btn-small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

input,
select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--text-primary);
  font: inherit;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
select:hover {
  border-color: var(--border-strong);
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder {
  color: var(--text-muted);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.check:hover {
  color: var(--text-primary);
}
.check input {
  height: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ── Mise en page ─────────────────────────────────────────────────────────── */
.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}
/* Pages de lecture (transcript, changelog) : colonne étroite, centrée. */
.page-narrow {
  max-width: 900px;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface-1);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.section-title {
  margin: 28px 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Tuiles statistiques (KPI) ────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  min-width: 0;
  animation: rise 0.35s ease both;
}
/* Halo bleu discret dans l'angle : relief doux sans surcharger les chiffres. */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 120px at 100% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.tile > * {
  position: relative;
}
.tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.tile-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.tile-value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.tile-sub {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ── Tableaux ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th,
table.data td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: var(--surface-2);
}
table.data th:first-child {
  border-top-left-radius: var(--radius-sm);
}
table.data th:last-child {
  border-top-right-radius: var(--radius-sm);
}
table.data td.num,
table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr {
  transition: background-color 0.12s ease;
}
table.data tbody tr:hover td {
  background: var(--surface-2);
}

.person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-primary);
}
a.person:hover {
  color: var(--accent);
}
.person img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
}
.person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--text-secondary);
}

.error-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--critical);
  border-radius: var(--radius);
  background: var(--critical-soft);
  color: var(--text-primary);
  animation: rise 0.25s ease both;
}
.error-banner::before {
  content: "⚠ ";
  color: var(--critical);
  font-weight: 700;
}

/* ── Composants partagés des panels de modules ───────────────────────────────
   (auparavant recopiés dans chaque feuille de module, avec de petits écarts) */
.status-line {
  color: var(--text-secondary);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 14px;
}
.filters .field input,
.filters .field select {
  min-width: 200px;
}
.filters textarea {
  min-width: 260px;
}
.filters input[inputmode="numeric"] {
  min-width: 220px;
  font-family: var(--font-mono);
}
.filters input[type="number"] {
  min-width: 110px;
}
.filters .field-grow {
  flex: 1 1 260px;
}
.filters .field-grow input,
.filters .field-grow textarea {
  width: 100%;
  min-width: 0;
}

textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--text-primary);
  font: inherit;
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea:hover {
  border-color: var(--border-strong);
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea::placeholder {
  color: var(--text-muted);
}
input[type="color"] {
  padding: 2px;
  width: 56px;
}

main.is-loading .card {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.section-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 14px 14px;
}

/* Pagination sous un tableau (historiques) */
.hist-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.btn-danger {
  background: var(--critical);
  border-color: var(--critical);
  color: #fff;
}
.btn-danger:hover {
  background: var(--critical);
  border-color: var(--critical);
  color: #fff;
  filter: brightness(1.1);
}

.danger-zone {
  padding: 16px;
  margin-top: 8px;
  border-color: var(--critical);
}
.danger-zone h2,
.danger-zone h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}
.badge-status.on {
  border-color: transparent;
  background: var(--good-soft);
  color: var(--good);
}
.badge-status.warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--chart-mean);
}
.badge-off {
  opacity: 0.55;
}

/* Onglets : un seul style pour tout le dashboard (barre segmentée). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  overflow-x: auto;
}
.tab-btn {
  flex: 1 1 auto;
  white-space: nowrap;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.tab-btn.active,
.tab-btn[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  box-shadow: 0 6px 18px -10px var(--accent-glow);
}
.tab-btn .count {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px;
}
.tab-btn.active .count,
.tab-btn[aria-selected="true"] .count {
  background: rgba(255, 255, 255, 0.22);
}

/* Sélecteur de rôles avec recherche (Core.rolePicker) */
.role-picker {
  padding: 10px 0;
}
.role-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--badge-text);
  font-size: 12px;
}
.role-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}
.role-chip button:hover {
  opacity: 1;
}
.role-picker-search {
  width: 100%;
  margin-bottom: 6px;
}
.role-picker-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.role-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.role-picker-row:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.role-picker-row input {
  height: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* Cartes repliables (panels, types, menus) des modules Tickets, Support et RôleMenu. */
.panel-block {
  margin-bottom: 14px;
}
.panel-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 14px 0;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  cursor: pointer;
  user-select: none;
  flex: 1 1 auto;
  min-width: 0;
}
.panel-head h3 {
  font-size: 15px;
}
.type-card {
  margin: 12px 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.type-head h4 {
  font-size: 14px;
}
.type-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Corps d'une carte repliable (panels Tickets / Support…) : marges intérieures et espacement réguliers. */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  min-width: 0;
}
/* Formulaire empilé (éditeur d'embed, plage horaire…) : un champ par ligne, espacés. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
/* Leurs enfants n'ajoutent pas leur propre retrait (déjà donné par le conteneur). */
.card-body > .filters,
.stack > .filters,
.card-body > .section-actions {
  padding: 0;
}
.card-body > .type-card {
  margin: 0;
}
.card-body > p,
.stack > p {
  margin: 0;
}
.card-body > .section-title,
.stack > .section-title {
  margin: 10px 0 0;
}
.stack textarea,
.card-body textarea {
  width: 100%;
  max-width: 100%;
}
/* Deux cartes qui se suivent sans titre entre elles (formulaire puis liste…) ne se touchent plus. */
#content > .card + .card,
#content > .card + [hidden] + .card,
.tab-panel > .card + .card,
.subtab-panel > .card + .card,
.tab-panel > .card + [hidden] + .card {
  margin-top: 14px;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  padding-top: 4px;
}

/* Aperçu d'embed Discord (éditeurs de panels). */
.embed-preview {
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 13px;
  max-width: 460px;
  text-align: left;
}
.embed-preview .ep-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.embed-preview .ep-desc {
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.embed-preview .ep-footer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.embed-preview img {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 8px;
}
/* Prioritaire sur `.empty` (centré, grand padding) : l'aperçu vide garde la forme d'un embed. */
.embed-preview.empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-style: italic;
  border-left-color: var(--border-strong);
}

/* ── Changelog ─────────────────────────────────────────────────────────────── */
.release {
  padding: 18px 20px;
  margin-bottom: 14px;
  animation: rise 0.35s ease both;
  scroll-margin-top: 72px;
}
.release:target {
  border-color: var(--accent);
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.release-head h2 {
  font-size: 18px;
}
.release-version {
  font-family: var(--font-mono);
  color: var(--accent);
}
.release-meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}
/* Modules concernés par une version, sous son titre. */
.release-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.release-group {
  margin-top: 16px;
}
.release-group h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.release-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.release-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 13.5px;
  line-height: 1.5;
}
.module-tag {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.module-tag:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.module-tag.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
}
.changelog-toolbar .field select {
  min-width: 220px;
}
.changelog-toolbar .status-line {
  margin-left: auto;
  padding-bottom: 8px; /* aligné sur le texte du sélecteur (barre alignée en bas) */
}

@media (max-width: 640px) {
  .changelog-toolbar .field,
  .changelog-toolbar .field select {
    width: 100%;
    min-width: 0;
  }
  .changelog-toolbar .status-line {
    margin-left: 0;
  }
}

/* ── Fenêtre de dialogue (remplace prompt()/confirm() du navigateur) ─────── */
.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--text-primary);
  box-shadow: var(--shadow-pop);
}
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.dialog form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  margin: 0;
}
.dialog h2 {
  font-size: 16px;
}
.dialog p {
  margin: 0;
  color: var(--text-secondary);
  white-space: pre-line;
}
.dialog input {
  width: 100%;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Accueil ──────────────────────────────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.module-card {
  display: block;
  padding: 18px;
  color: var(--text-primary);
  animation: rise 0.35s ease both;
}
.module-card:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.module-card h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--critical);
}
.status-dot.on {
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

/* ── Pages d'authentification ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  text-align: center;
  animation: rise 0.4s ease both;
}
.auth-card h1 {
  font-size: 22px;
  margin: 16px 0 8px;
}
.auth-card p {
  color: var(--text-secondary);
  margin: 0 0 22px;
}
.auth-card .btn {
  width: 100%;
  height: 42px;
}
.auth-card .brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  font-size: 22px;
  border-radius: 14px;
}

@media (max-width: 640px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }
  .user-chip .user-name {
    display: none;
  }
  .page {
    padding: 12px 16px;
  }
  .tile-value {
    font-size: 26px;
  }
  .filters .field input,
  .filters .field select,
  .filters .field textarea,
  .filters input[inputmode="numeric"],
  .field-row .field input,
  .field-row .field select,
  .field-row .field textarea {
    min-width: 0;
    width: 100%;
  }
  .tabs {
    gap: 6px;
  }
  .tab-btn {
    flex: 1 1 calc(50% - 6px);
    font-size: 12px;
    padding: 8px 6px;
  }
  .panel-head-row {
    flex-direction: column;
    align-items: stretch;
  }
  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .row-actions .btn {
    width: 100%;
  }
}

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

/* ── Notifications persistantes (réponses aux tickets / modmails) : en haut à droite jusqu'à action ── */
.toasts {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-pop);
  animation: rise 0.25s ease both;
}
.toast-text {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.toast-meta {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}
.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .toasts {
    top: 60px;
    right: 12px;
  }
}

/* Recherche dans les longues listes deroulantes (Core.enhanceSelect) */
.select-search-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.select-search { width: 100%; box-sizing: border-box; font-size: 0.85em; padding: 4px 8px; }

/* ── Identité visuelle : titres en police d'affichage, chiffres et cartes plus nets ───────────────── */
.page-head h1,
.tile-value,
.release-head h2,
.module-card h2,
.auth-card h1 {
  font-family: var(--font-display);
}
.page-head h1 {
  font-size: 26px;
}
.tile-value {
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.card:hover {
  border-color: var(--border-strong);
}
.btn-primary {
  box-shadow: 0 0 20px -6px var(--accent-glow);
}
.tab-btn.active,
.tab-btn[aria-selected="true"] {
  box-shadow: 0 0 22px -8px var(--accent-glow);
}

/* Accueil : la mascotte commente l'état du bot. */
.mascot-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 16px;
}
.mascot-hint svg {
  width: 56px;
  height: 56px;
  flex: none;
  filter: drop-shadow(0 6px 12px var(--accent-glow));
}
.mascot-bubble {
  position: relative;
  max-width: 62ch;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--accent-soft);
}
.mascot-bubble::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  translate: 0 -50%;
  rotate: 45deg;
  background: var(--surface-solid);
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

/* ══ Alignement des pages de modules sur la maquette (composants partagés par tous les panels) ═════════ */

/* En-tête de page : titre + phrase qui explique le module. */
.page-title {
  min-width: 0;
}
.page-sub {
  margin: 4px 0 0;
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 14px;
}
.page-head {
  align-items: flex-end;
  margin-bottom: 20px;
}

/* Titres de section : sobres, en police d'affichage, avec un point lumineux. */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 12px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
h2.section-title::before,
h3.section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-glow);
}
h4.section-title {
  margin: 18px 0 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Boutons : teinte bleue translucide, comme la maquette. */
.btn {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}
.btn:hover {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  border-color: var(--accent-2);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: transparent;
}
.btn-primary,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
}
.btn-danger,
.btn-danger:hover {
  background: color-mix(in srgb, var(--critical) 16%, transparent);
  border-color: color-mix(in srgb, var(--critical) 50%, transparent);
  color: var(--text-primary);
  filter: none;
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--critical) 28%, transparent);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Onglets : commutateur segmenté compact (au lieu d'une barre pleine largeur). */
.tabs {
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--input);
}
.tab-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 9px;
}
.tab-btn.active,
.tab-btn[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 0 22px -8px var(--accent-glow);
}
.tab-btn.active .count,
.tab-btn[aria-selected="true"] .count {
  background: var(--accent);
  color: #fff;
}
.subtabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
}
.subtab-btn {
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.subtab-btn.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Cases à cocher des réglages → interrupteurs. */
.check {
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: translate 0.15s ease;
}
.check input[type="checkbox"]:checked {
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.check input[type="checkbox"]:checked::after {
  translate: 16px 0;
}
.check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.check input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.toggle-row {
  gap: 12px 24px;
  padding: 6px 0;
}

/* Tableaux : en-têtes discrets, séparateurs fins. */
table.data th {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--border-strong);
}
table.data td {
  border-bottom-color: var(--border);
}
table.data tbody tr:hover td {
  background: var(--accent-soft);
}

/* Pastilles d'état */
.badge,
.badge-status {
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--badge-text);
  font-size: 11.5px;
}
.badge-status.on {
  border-color: color-mix(in srgb, var(--good) 40%, transparent);
  background: var(--good-soft);
  color: var(--good);
}
.badge-status.warn {
  border-color: color-mix(in srgb, var(--chart-mean) 40%, transparent);
  background: var(--warn-soft);
  color: var(--chart-mean);
}

/* Cartes : survol discret, titres internes en police d'affichage. */
.card h3,
.card h4,
.panel-head h3,
.type-head h4 {
  font-family: var(--font-display);
}
.type-card {
  border-radius: 12px;
  background: var(--surface-2);
}
.type-card:hover {
  border-color: var(--border-strong);
}
.tile {
  border-radius: 14px;
}
.tile-label {
  font-size: 12.5px;
}

/* Champs : verre sombre, halo bleu au focus. */
input,
select,
textarea {
  border-radius: 10px;
  border-color: var(--border-strong);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tiles + .tabs,
.tiles + .mascot-hint {
  margin-top: 16px;
}

/* Listes déroulantes : flèche discrète, même rendu partout. */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.notif-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tiles {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.toolbar {
  width: fit-content;
  max-width: 100%;
}
.tab-btn.active,
.tab-btn[aria-selected="true"],
.subtab-btn.active {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.side-logout {
  display: flex;
  width: 100%;
  margin: 0;
}
.side-logout .side-link {
  width: 100%;
  background: none;
  font: inherit;
  cursor: pointer;
}
@media (max-width: 900px) {
  .topbar {
    gap: 6px;
    padding: 0 8px;
  }
  .topbar-search {
    flex: 1 1 80px;
  }
  .global-guild {
    flex: 0 1 130px;
  }
  .topbar .user-name,
  .topbar .user-chip form,
  .topbar .changelog-link {
    display: none;
  }
  .page {
    padding: 12px 14px;
  }
  .page-head {
    align-items: flex-start;
  }
}

/* ══ Onglets « Live » (Tickets, Candidatures) : file à gauche, conversation au centre, infos à droite ═══════════════════════ */
.live {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 290px;
  gap: 14px;
  height: max(560px, calc(100vh - 110px));
  scroll-margin-top: 84px;
}
.live > * {
  min-width: 0;
  min-height: 0;
}
.live-list,
.live-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.live-list-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.live-search {
  width: 100%;
}
.live-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.live-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.live-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.live-chip-n {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.live-items {
  flex: 1;
  overflow-y: auto;
}
.live-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.live-item:hover {
  background: var(--accent-soft);
}
.live-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 3px 0 0 var(--accent-2);
}
.live-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.live-item-top b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-id {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.live-item-top time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.live-item-sub {
  margin: 2px 0 6px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.live-prio {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
}
.live-prio.p0 { background: var(--good); }
.live-prio.p1 { background: var(--text-muted); }
.live-prio.p2 { background: var(--chart-mean); }
.live-prio.p3 { background: var(--critical); box-shadow: 0 0 10px var(--critical); }

.live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.live-head h3 {
  font-size: 16px;
}
.live-head-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
}
.live-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.live-head-actions select {
  height: 28px;
  font-size: 12px;
}
.live-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.live-msg {
  display: flex;
  gap: 10px;
  max-width: 82%;
}
.live-msg.staff {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.live-msg.bot {
  align-self: center;
  max-width: 92%;
}
.live-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
}
.live-bubble {
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px 14px 14px 14px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.live-msg.staff .live-bubble {
  border-color: var(--border-strong);
  border-radius: 14px 4px 14px 14px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.live-msg.bot .live-bubble {
  border-style: dashed;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
}
.live-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-bottom: 2px;
  font-size: 12.5px;
}
.live-meta time {
  color: var(--text-muted);
  font-size: 11px;
}
.live-text {
  white-space: pre-wrap;
}
.live-text pre,
.live-embed-desc pre {
  white-space: pre-wrap;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--input);
}
.live-text .mention,
.live-embed-desc .mention {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--badge-text);
}
.live-text img.emoji,
.live-embed-desc img.emoji {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}
.live-embed {
  margin-top: 4px;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--input);
}
.live-embed-title {
  font-weight: 600;
}
.live-embed-field {
  margin-top: 4px;
}
.live-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.live-img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 240px;
  border-radius: 8px;
}
.live-sticker {
  width: 96px;
  height: 96px;
}
.live-file {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
.live-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.live-input {
  width: 100%;
  min-height: 70px;
}
.live-composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.live-note {
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--chart-mean) 40%, transparent);
  border-radius: 10px;
  background: var(--warn-soft);
  font-size: 13px;
}
.live-error {
  color: var(--critical);
  font-size: 13px;
}
.live-empty {
  display: grid;
  place-items: center;
}
.live-empty-box {
  max-width: 40ch;
  padding: 24px;
  text-align: center;
}
.live-empty-box p {
  margin: 6px 0 0;
}

.live-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.live-box {
  padding: 14px;
}
.live-box h3 {
  margin-bottom: 10px;
  font-size: 14px;
}
.live-box h4 {
  margin: 10px 0 6px;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.live-info {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.live-info:first-of-type {
  border-top: 0;
}
.live-info span:last-child {
  text-align: right;
}
.live-qa {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.live-qa b {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.live-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.live-box select {
  width: 100%;
}
.live-snippets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.live-snippet {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.live-snippet:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}
.live-snippet b {
  display: block;
  font-size: 12.5px;
}
.live-snippet span {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
}
.live-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.live-stat {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.live-stat b {
  font-family: var(--font-display);
  font-size: 22px;
}

@media (max-width: 1280px) {
  .live {
    grid-template-columns: 270px minmax(0, 1fr);
    height: auto;
  }
  .live-list,
  .live-chat {
    height: max(560px, calc(100vh - 110px));
  }
  .live-side {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }
  .live-side > * {
    flex: 1 1 260px;
  }
}
@media (max-width: 760px) {
  .live {
    grid-template-columns: minmax(0, 1fr);
  }
  .live-list {
    height: 320px;
  }
  .live-chat {
    height: 70vh;
  }
  .live-msg {
    max-width: 94%;
  }
}
/* Candidatures : progression du dossier, décision et planification de l'entretien. */
.live-steps {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
}
.live-steps span {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: var(--surface-3);
}
.live-steps span.done {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.live-steps span.current {
  background: var(--accent-2);
}
.live-steps-labels {
  display: flex;
  justify-content: space-between;
  padding: 4px 16px 0;
  color: var(--text-muted);
  font-size: 11px;
}
.live-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.live-panel .field {
  flex: 0 1 auto;
}
.btn-good,
.btn-good:hover {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  border-color: color-mix(in srgb, var(--good) 50%, transparent);
  color: var(--text-primary);
}
.btn-good:hover {
  background: color-mix(in srgb, var(--good) 28%, transparent);
}
/* Contenu posé directement dans une carte (rapports, avertissements…) : même marge intérieure que les formulaires. */
.card > .stack {
  padding: 0 16px 16px;
}
.card > .stack:first-child {
  padding-top: 16px;
}
.card > p {
  margin: 0;
  padding: 14px 16px;
}
.card > .report-list,
.card > .tiles {
  padding: 0 16px 16px;
}
/* Onglets « Live » : la conversation reprend la mise en forme de Discord (fil de la page transcription). */
.live-feed.discord-shell {
  gap: 0;
  padding: 12px 4px;
  border-radius: 0;
}
.live-feed.discord-shell .dmsg-group {
  padding: 3px 14px;
}
.live-feed.discord-shell .dmsg-group:not(.dmsg-continuation) {
  margin-top: 14px;
}
.live-feed.discord-shell .dmsg-group:first-child {
  margin-top: 0;
}
.live-feed.discord-shell .dmsg-continuation {
  padding-left: 68px;
}
.live-feed.discord-shell .empty {
  color: #949ba4;
}