/* ═══════════════════════════════════════════════════════
   LimssShield Admin Panel, Premium Dark Theme
   ═══════════════════════════════════════════════════════ */

:root {
  /* Noir / zinc, sans lueur colorée */
  --bg-0: #030303;
  --bg-1: #09090b;
  --bg-2: #0c0c0e;
  --bg-3: #18181b;
  --bg-4: #27272a;

  --brand-hi: #fafafa;
  --brand-mid: #d4d4d8;
  --brand-lo: #a1a1aa;

  --surface: rgba(14, 14, 16, 0.88);
  --surface-hover: rgba(24, 24, 27, 0.92);
  --glass: rgba(12, 12, 14, 0.72);
  --glass-border: rgba(255, 255, 255, 0.06);

  --border: rgba(255, 255, 255, 0.07);
  --border-hi: rgba(255, 255, 255, 0.14);
  --border-glow: rgba(255, 255, 255, 0.06);

  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --accent: #e4e4e7;
  --accent-dim: rgba(255, 255, 255, 0.07);
  --accent-glow: rgba(255, 255, 255, 0.08);
  --accent-2: #a1a1aa;

  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --amber: #eab308;
  --amber-bg: rgba(234, 179, 8, 0.12);
  --blue: #71717a;
  --blue-bg: rgba(113, 113, 122, 0.12);
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.1);
  --discord: #5865f2;

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', 'Roboto Mono', Consolas, monospace;
  --sidebar-w: 268px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --cfg-blue: #d4d4d8;
  --cfg-blue-dim: rgba(255, 255, 255, 0.08);
  --shadow-panel: 0 4px 32px rgba(0, 0, 0, 0.35);
  --shadow-panel-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-0);
  background-image: radial-gradient(ellipse 90% 70% at 50% -15%, rgba(255, 255, 255, 0.035), transparent 50%);
  color: var(--text);
  line-height: 1.58;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.hidden {
  display: none !important;
}
.view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}
.view.active {
  display: block;
  animation: viewIn 0.4s var(--ease) forwards;
}
.t2 {
  color: var(--text-2);
  font-size: 0.88rem;
}
.t3 {
  color: var(--text-3);
  font-size: 0.8rem;
}
.req {
  color: var(--red);
}

@keyframes viewIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ══════════════════ LOGIN ══════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(0, 0, 0, 0.35);
  animation: slideUp 0.6s var(--ease) both;
}

.login-brand {
  margin: 0 auto 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-img {
  width: min(120px, 42vw);
  height: auto;
  max-height: 140px;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
}
.brand-wordmark {
  display: inline;
  font-weight: 900;
  letter-spacing: -0.06em;
  white-space: nowrap;
}
.brand-limss {
  color: var(--text);
  font-weight: 900;
}
.brand-shield {
  font-weight: 900;
  background: linear-gradient(118deg, var(--brand-hi) 0%, var(--brand-mid) 45%, var(--brand-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem 0.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}
.login-wordmark {
  font-size: 1em;
}
.login-fivem {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.45em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
.login-tagline {
  font-family: var(--mono);
  font-size: 0.78rem !important;
  letter-spacing: 0.06em;
  color: var(--text-3) !important;
}
.login-card .t2 {
  margin-bottom: 1.75rem;
}
.login-hint {
  margin-top: 1.75rem;
  font-size: 0.78rem;
}
.login-err {
  color: var(--red);
  margin-top: 1rem;
  font-size: 0.85rem;
  background: var(--red-bg);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  background: var(--discord);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s var(--ease);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(88, 101, 242, 0.25);
}
.btn-discord:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.35);
}
.btn-discord:active {
  transform: translateY(0);
}

.login-back {
  margin-top: 1.25rem;
  font-size: 0.82rem;
}
.login-back a {
  color: var(--text-3);
  transition: color 0.15s;
}
.login-back a:hover {
  color: var(--accent);
}

/* ══════════════════ APP LAYOUT ══════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ══════════════════ SIDEBAR ══════════════════ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  /* Semi-transparent pour laisser voir les particules derrière */
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.9) 0%, rgba(5, 5, 6, 0.84) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.35), inset -1px 0 0 rgba(255, 255, 255, 0.03);
  z-index: 100;
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 0.75rem;
}
.sb-logo-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s;
}
.sb-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  /* Atténue un fond noir sur le PNG sur fond sombre */
  mix-blend-mode: screen;
}
.sb-brand:hover .sb-logo-wrap {
  border-color: rgba(255, 255, 255, 0.16);
}
.sb-wordmark {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.sb-wordmark .brand-wordmark {
  font-size: 1em;
}
.sb-fivem {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
}
.sb-brand .t3 {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.sb-home {
  display: block;
  margin: 0.25rem 1rem 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-3);
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
}
.sb-home:hover {
  background: var(--bg-2);
  color: var(--accent);
  border-color: var(--border);
}

.sb-section-label {
  padding: 0.6rem 1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  opacity: 0.7;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.58rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  text-align: left;
  position: relative;
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.sb-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  color: var(--accent);
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 58%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #e4e4e7, #71717a);
  box-shadow: 0 0 14px var(--accent-glow);
}
.sb-item .sb-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  line-height: 1;
}
.sb-item .sb-badge.live {
  background: var(--green-bg);
  color: var(--green);
}

.ni {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sb-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.sb-avatar {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--purple-bg));
  border: 1px solid var(--glass-border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sb-uname {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.sb-footer .t3 {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.sb-logout {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.sb-logout svg {
  width: 16px;
  height: 16px;
}
.sb-logout:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--red-bg);
}

/* ══════════════════ MAIN CONTENT ══════════════════ */
.main-scroll {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3.5vw, 2.5rem) 4rem;
  overflow-y: auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  /* Fond léger + transparence pour que le canvas particules reste visible */
  background:
    radial-gradient(ellipse 100% 55% at 50% -10%, rgba(255, 255, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 70% 40% at 100% 30%, rgba(90, 90, 120, 0.04), transparent 45%),
    rgba(3, 3, 3, 0.46);
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
}

.panel-inner {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 0 0 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 72%);
  border-radius: var(--radius-sm);
}
.page-head h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.15rem 0 0.15rem;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.25rem;
}

.breadcrumb {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.bc-sep {
  opacity: 0.4;
}

/* ══════════════════ STAT CARDS ══════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  box-shadow: var(--inset-highlight), 0 4px 24px rgba(0, 0, 0, 0.15);
}
.stat-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: var(--inset-highlight), 0 12px 40px rgba(0, 0, 0, 0.28);
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

.stat-card.cyan::before {
  background: var(--accent);
}
.stat-card.cyan::after {
  background: var(--accent);
}
.stat-card.red::before {
  background: var(--red);
}
.stat-card.red::after {
  background: var(--red);
}
.stat-card.green::before {
  background: var(--green);
}
.stat-card.green::after {
  background: var(--green);
}
.stat-card.purple::before {
  background: var(--purple);
}
.stat-card.purple::after {
  background: var(--purple);
}
.stat-card.amber::before {
  background: var(--amber);
}
.stat-card.amber::after {
  background: var(--amber);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.stat-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.stat-icon svg {
  width: 18px;
  height: 18px;
}
.stat-card.cyan .stat-icon {
  background: var(--accent-dim);
  color: var(--accent);
}
.stat-card.red .stat-icon {
  background: var(--red-bg);
  color: var(--red);
}
.stat-card.green .stat-icon {
  background: var(--green-bg);
  color: var(--green);
}
.stat-card.purple .stat-icon {
  background: var(--purple-bg);
  color: var(--purple);
}
.stat-card.amber .stat-icon {
  background: var(--amber-bg);
  color: var(--amber);
}

.stat-num {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.stat-card.cyan .stat-num {
  color: var(--accent);
}
.stat-card.red .stat-num {
  color: var(--red);
}
.stat-card.green .stat-num {
  color: var(--green);
}
.stat-card.purple .stat-num {
  color: var(--purple);
}
.stat-card.amber .stat-num {
  color: var(--amber);
}
.stat-lbl {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 0.2rem;
  font-weight: 500;
}

/* ══════════════════ CARDS ══════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  transition:
    border-color 0.2s,
    box-shadow 0.25s var(--ease);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}
.card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}
.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-head {
  margin-bottom: 0.75rem;
}
.card-head .t3 {
  margin-top: 0.15rem;
}
.card code {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
}

.filter-card {
  margin-bottom: 0.85rem;
}
.table-card {
  padding: 0;
  overflow: hidden;
}
.table-card .table-wrap {
  border: none;
  border-radius: 0;
}

/* ══════════════════ SEARCH ══════════════════ */
.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease);
}
.search-input::placeholder {
  color: var(--text-3);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.inline-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-row .search-input {
  flex: 1;
  min-width: 200px;
}

/* ══════════════════ TABLES ══════════════════ */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
th,
td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-2);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.98), rgba(8, 8, 10, 0.92));
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
tbody tr {
  transition: all 0.15s;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
tbody tr:last-child td {
  border-bottom: none;
}
td code {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-2);
}

.ban-sel {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}

.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
  max-width: 42rem;
  margin: 0 auto;
}
.empty-state .t2 {
  font-size: 0.92rem;
}
.empty-state .t3 {
  margin-top: 0.35rem;
}
.empty-state code {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--accent-dim);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.skeleton-row td {
  vertical-align: middle;
}
.skeleton-line {
  display: block;
  height: 10px;
  border-radius: 5px;
  max-width: 100%;
  background: linear-gradient(90deg, var(--bg-3), var(--bg-4), var(--bg-3));
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.stats-loading .stat-num {
  opacity: 0.45;
  animation: pulse 1s ease-in-out infinite;
}
.stats-loading #stat-health {
  opacity: 0.5;
}

.table-foot {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}
.pill-active {
  background: var(--green-bg);
  color: var(--green);
}
.pill-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-3);
}
.pill-danger {
  background: var(--red-bg);
  color: var(--red);
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ══════════════════ BUTTONS ══════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  border-color: var(--border-hi);
  background: var(--bg-3);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #3f3f46, #52525b);
  border-color: transparent;
  color: #fafafa;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #52525b, #71717a);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  border-color: transparent;
}

.btn-danger {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(1.1);
  border-color: transparent;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}
.btn-mini {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
}
.btn-full {
  width: 100%;
}
.btn-x {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-x:hover {
  background: var(--bg-3);
  color: var(--text);
}

/* ══════════════════ DRAWER ══════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.35);
}
.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.drawer-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.drawer-body input,
.drawer-body select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease);
}
.drawer-body input:focus,
.drawer-body select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.fld-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.drawer-foot {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════ TOASTS ══════════════════ */
.toast-box {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  transform: translateX(120%);
  transition:
    transform 0.35s var(--ease),
    opacity 0.3s;
  opacity: 0;
  pointer-events: auto;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-success {
  border-left: 3px solid var(--green);
}
.toast-error {
  border-left: 3px solid var(--red);
}
.toast-info {
  border-left: 3px solid var(--accent);
}
.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}
.toast-success .toast-icon {
  background: var(--green-bg);
  color: var(--green);
}
.toast-error .toast-icon {
  background: var(--red-bg);
  color: var(--red);
}
.toast-info .toast-icon {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ══════════════════ CONFIGURATION ══════════════════ */
.cfg-lead {
  margin-bottom: 1rem;
}
.cfg-lead h3 {
  margin-bottom: 0.3rem;
}
.cfg-modules {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cfg-card {
  margin-bottom: 0;
  transition: border-color 0.2s;
}
.cfg-card:hover {
  border-color: var(--border-hi);
}
.cfg-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cfg-card h3 .cfg-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
}

.cfg-section-id {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem !important;
  margin: -0.1rem 0 0.5rem;
  opacity: 0.7;
  font-family: var(--mono);
}

.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.cfg-row:last-child {
  border-bottom: none;
}
.cfg-key {
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-2);
}
.cfg-val {
  color: var(--text-3);
  font-size: 0.78rem;
  font-family: var(--mono);
}

.cfg-input {
  width: 200px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: right;
  transition: all 0.2s var(--ease);
}
.cfg-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

#cfg-json {
  width: 100%;
  min-height: 350px;
  padding: 1rem;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s;
}
#cfg-json:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Toggle switch (premium) */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-rail {
  position: absolute;
  inset: 0;
  background: var(--bg-4);
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.25s var(--ease),
    box-shadow 0.25s;
  border: 1px solid var(--border);
}
.toggle-rail::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all 0.25s var(--ease);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.toggle input:checked + .toggle-rail {
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 16px var(--accent-glow);
}
.toggle input:checked + .toggle-rail::after {
  transform: translateX(20px);
  background: #fff;
}

/* ══════════════════ CONFIGURATION (style WaveShield) ══════════════════ */
.cfg-wave-page {
  max-width: 1180px;
}

.cfg-wave-top {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cfg-wave-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0.4rem;
}
.cfg-wave-sub {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 62ch;
}

.cfg-wave-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.cfg-wave-toolbar-left,
.cfg-wave-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.btn-cfg-tool svg {
  opacity: 0.85;
}

.btn-cfg-save-wave {
  background: linear-gradient(135deg, #3f3f46, #52525b) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}
.btn-cfg-save-wave:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.cfg-wave-search-wrap {
  position: relative;
  margin-bottom: 1.1rem;
}
.cfg-wave-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.cfg-wave-search {
  width: 100%;
  padding: 0.72rem 1rem 0.72rem 2.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cfg-wave-search::placeholder {
  color: var(--text-3);
}
.cfg-wave-search:focus {
  outline: none;
  border-color: var(--cfg-blue);
  box-shadow: 0 0 0 3px var(--cfg-blue-dim);
}

.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.cfg-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.cfg-tab svg {
  flex-shrink: 0;
  opacity: 0.75;
}
.cfg-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.cfg-tab.active {
  background: var(--cfg-blue-dim);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--cfg-blue);
}
.cfg-tab.active svg {
  opacity: 1;
  color: var(--cfg-blue);
}

.cfg-visual-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

/* Onglet Principal - grille 3 colonnes façon WaveShield */
.cfg-main-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cfg-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.cfg-main-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
@media (max-width: 1100px) {
  .cfg-main-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* Ligne 1 : exécuteurs+événements | santé - ligne 2 : client pleine largeur */
  .cfg-main-col:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .cfg-main-col:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  .cfg-main-col:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 720px) {
  .cfg-main-grid {
    grid-template-columns: 1fr;
  }
  .cfg-main-col:nth-child(1),
  .cfg-main-col:nth-child(2),
  .cfg-main-col:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
  }
}

.cfg-orphan-card {
  width: 100%;
}

/* Exceptions événements (IgnoredEvents) */
.cfg-exc-editor {
  padding: 0.85rem 0.25rem 0;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(40, 55, 85, 0.35);
}
.cfg-exc-editor.cfg-row-hidden {
  display: none !important;
}
.cfg-exc-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.cfg-exc-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.cfg-exc-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.cfg-exc-inp {
  flex: 1;
  min-width: 140px;
}
.cfg-exc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cfg-exc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.76rem;
}
.cfg-exc-tag code {
  font-family: var(--mono);
  color: var(--text);
}
.cfg-exc-tag-rm {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}
.cfg-exc-tag-rm:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* Revive event (santé) */
.cfg-revive-block {
  padding: 0.85rem 0 0;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(40, 55, 85, 0.35);
}
.cfg-revive-block.cfg-row-hidden {
  display: none !important;
}
.cfg-revive-lbl {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}
.cfg-revive-input {
  width: 100%;
}

.cfg-wave-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .cfg-wave-grid {
    grid-template-columns: 1fr;
  }
}

.cfg-wave-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.1rem;
  transition: border-color 0.2s;
}
.cfg-wave-card:hover {
  border-color: var(--border-hi);
}

.cfg-wave-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}
.cfg-wave-card-desc {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.cfg-wave-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cfg-wave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(40, 55, 85, 0.22);
  min-height: 40px;
}
.cfg-wave-row:last-child {
  border-bottom: none;
}
.cfg-wave-row.cfg-row-hidden {
  display: none !important;
}

.cfg-wave-row-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.cfg-wave-keytext {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.cfg-wave-warn {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--amber);
  white-space: nowrap;
}
.cfg-wave-info {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.cfg-wave-info:hover {
  border-color: var(--cfg-blue);
  color: var(--cfg-blue);
}

.cfg-wave-row-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.cfg-input-wave {
  width: min(220px, 36vw) !important;
  text-align: left !important;
}
select.cfg-select-enum.cfg-input-wave {
  width: min(260px, 42vw) !important;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.cfg-wave-json-hint {
  font-size: 0.76rem;
  text-align: right;
}

/* Listes config (whitelist / blacklist / exceptions) - cases à cocher */
.cfg-array-card.cfg-row-hidden,
.cfg-array-editor.cfg-row-hidden {
  display: none !important;
}
.cfg-array-item.cfg-row-hidden {
  display: none !important;
}
.cfg-array-editor {
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}
.cfg-array-editor.cfg-array-compact {
  margin-top: 0.75rem;
}
.cfg-array-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.cfg-array-tech {
  font-size: 0.72rem;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.cfg-array-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.cfg-array-add .cfg-array-inp {
  flex: 1;
  min-width: 140px;
}
.cfg-array-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.cfg-array-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
}
.cfg-array-item:last-child {
  border-bottom: none;
}
.cfg-array-cb {
  width: 16px;
  height: 16px;
  accent-color: var(--cfg-blue);
  flex-shrink: 0;
  cursor: pointer;
}
.cfg-array-val {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text-2);
}
.cfg-array-rm {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition:
    color 0.15s,
    background 0.15s;
}
.cfg-array-rm:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
.cfg-array-empty {
  margin: 0;
  padding: 0.75rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text-3);
}
.cfg-array-kind-whitelist {
  border-left: 3px solid rgba(34, 197, 94, 0.65);
}
.cfg-array-kind-blacklist {
  border-left: 3px solid rgba(239, 68, 68, 0.65);
}
.cfg-array-kind-neutral {
  border-left: 3px solid rgba(148, 163, 184, 0.45);
}

.cfg-wave-empty {
  padding: 2rem 1rem;
  text-align: center;
}

.cfg-json-details {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.4);
}
.cfg-json-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-2);
  list-style: none;
}
.cfg-json-details summary::-webkit-details-marker {
  display: none;
}
.cfg-json-details summary::after {
  content: ' ▼';
  font-size: 0.65rem;
  opacity: 0.5;
}
.cfg-json-details[open] summary::after {
  content: ' ▲';
}
.cfg-json-details #cfg-json {
  margin-top: 0.5rem;
}

.cfg-wave-page .toggle input:checked + .toggle-rail {
  background: #52525b;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

/* ══════════════════ CHART ══════════════════ */
.chart-wrap {
  padding: 0.75rem 1rem 1rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.chart-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ══════════════════ FILTER ROW ══════════════════ */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.filter-row .search-input {
  flex: 1;
  min-width: 200px;
}
.ban-filter-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-weight: 500;
}
.ban-filter-check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ══════════════════ PLAYERS ══════════════════ */
.players-stale {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 500;
}
.id-cell {
  font-size: 0.72rem;
  max-width: min(480px, 42vw);
  white-space: normal;
  word-break: break-all;
  line-height: 1.35;
  color: var(--text-3);
}

/* ══════════════════ AUDIT ══════════════════ */
.audit-act {
  font-size: 0.78rem;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
}

/* ══════════════════ SCROLLBAR ══════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

::selection {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ══════════════════ RESPONSIVE ══════════════════ */
@media (max-width: 860px) {
  .sidebar {
    width: 62px;
  }
  .sb-home,
  .sb-brand div:last-child,
  .sb-section-label,
  .sb-item span:not(.ni),
  .sb-item .sb-badge,
  .sb-user div:last-child,
  .sb-footer .t3 {
    display: none;
  }
  .sb-item {
    justify-content: center;
    padding: 0.6rem;
  }
  .sb-item::before {
    display: none;
  }
  .sb-nav {
    padding: 0.5rem 0.35rem;
  }
  .sb-brand {
    justify-content: center;
    padding: 1rem 0.5rem;
  }
  .sb-footer {
    justify-content: center;
  }
  .sb-logout {
    display: none;
  }
  .main-scroll {
    margin-left: 62px;
    padding: 1rem;
  }
  .drawer {
    width: 100vw;
  }
  .page-head {
    flex-direction: column;
  }
  .page-actions {
    width: 100%;
  }
  .cfg-wave-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cfg-wave-toolbar-left,
  .cfg-wave-toolbar-right {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .stat-num {
    font-size: 1.4rem;
  }
}

/* ══════════════════ AUTO-REFRESH & DASHBOARD GRID ══════════════════ */
.auto-refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
}

.auto-refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.dash-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .dash-two-col {
    grid-template-columns: 1fr;
  }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.player-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.result-count {
  white-space: nowrap;
}

.pill-amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.pill-warn {
  background: rgba(234, 179, 8, 0.12);
  color: var(--amber);
}

/* Severity pills in table */
.pill-danger::before {
  background: var(--red);
}
.pill-amber::before {
  background: var(--amber);
}
.pill-warn::before {
  background: var(--amber);
}

/* ══════════════════ DESIGN POLISH ══════════════════ */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.sidebar::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  pointer-events: none;
  z-index: -1;
}

.login-card {
  position: relative;
}
.login-card::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
  border-radius: 1px;
}

.sb-brand {
  position: relative;
  padding-bottom: 0.85rem;
}
.sb-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.stat-card {
  background: linear-gradient(165deg, var(--surface), rgba(8, 8, 10, 0.92));
}

.stat-card::after {
  transition: opacity 0.3s var(--ease);
}
.stat-card:hover::after {
  opacity: 0.1;
}

.card {
  backdrop-filter: blur(8px);
}

tbody tr {
  transition: all 0.15s var(--ease);
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.table-wrap {
  position: relative;
}

.sb-item {
  transition: all 0.18s var(--ease);
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(2px);
}
.sb-item.active {
  transform: translateX(0);
}

.btn {
  transition: all 0.2s var(--ease);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}

.page-head h2 {
  background: linear-gradient(135deg, #fafafa 30%, #a1a1aa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.cfg-wave-title {
  background: linear-gradient(135deg, #fafafa 30%, #a1a1aa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg-0);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: left 0.2s var(--ease);
}
.skip-link:focus {
  left: 1rem;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.sb-item:focus-visible,
.cfg-tab:focus-visible,
.search-input:focus-visible,
select.cfg-select-enum:focus-visible,
#cfg-json:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}

/* ══════════ LIVE BAR (SSE détections temps réel) ══════════ */

.live-bar {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text);
  transition:
    opacity 0.3s,
    background 0.4s;
}

.live-bar.live-flash {
  background: rgba(255, 255, 255, 0.06);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
  animation: live-pulse 1.5s infinite ease-in-out;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ══════════ BADGE ALERT (notifications sidebar) ══════════ */

.sb-badge.alert {
  background: var(--red);
  color: #fff;
  animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
  }
  70% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* ══════════ BAN TEMPLATES ══════════ */

.ban-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.ban-templates .btn-outline {
  background: transparent;
  border: 1px solid var(--border-1);
  color: var(--text-2);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.ban-templates .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}
