:root {
  --bg-0: #060912;
  --bg-1: #0b1120;
  --glass: rgba(18, 24, 42, 0.62);
  --glass-2: rgba(26, 33, 56, 0.7);
  --glass-hi: rgba(255, 255, 255, 0.08);
  --border: rgba(120, 160, 255, 0.14);
  --text: #eaf0ff;
  --text-dim: #aab6d4;
  --text-muted: #6b769a;
  --elec: #5fa8ff;
  --elec-2: #8b5cf6;
  --cyan: #38e0ff;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 14px;
  --accent-grad: linear-gradient(135deg, #4f9dff 0%, #8b5cf6 100%);
  --glow: 0 0 0 1px var(--border), 0 8px 30px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'gg sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 50% -10%, #16203c 0%, rgba(11, 17, 32, 0) 60%),
    radial-gradient(900px 600px at 85% 110%, #1a1338 0%, rgba(11, 17, 32, 0) 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
}

/* Éclairs (canvas) + voile d'ambiance */
#lightning {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.storm-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
}
#app,
#toasts {
  position: relative;
  z-index: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(120, 150, 220, 0.25);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 150, 220, 0.4);
}

.loader {
  display: grid;
  place-items: center;
  height: 100vh;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
}

/* ───────── Login ───────── */
.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px 40px;
  width: 100%;
  max-width: 390px;
  text-align: center;
  box-shadow:
    var(--glow),
    inset 0 1px 0 var(--glass-hi),
    0 0 60px rgba(79, 157, 255, 0.12);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.login-card .logo {
  font-size: 50px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 14px rgba(95, 168, 255, 0.8));
  animation: flicker 4.5s infinite;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #cfe3ff, #9db8ff 45%, #b79bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 26px;
  letter-spacing: 0.04em;
}

/* ───────── Layout ───────── */
.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.bot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 6px;
}
.bot-card img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(95, 168, 255, 0.5);
}
.bot-card .name {
  font-weight: 700;
  font-size: 15px;
}
.bot-card .sub {
  color: var(--text-muted);
  font-size: 12px;
}
.sidebar h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 10px 8px 4px;
}
.guild-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.guild-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 11px;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.guild-item:hover {
  background: var(--glass-2);
  color: var(--text);
  border-color: var(--border);
}
.guild-item.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 110, 255, 0.4);
}
.guild-item img,
.guild-item .ph {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.guild-item .ph {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 700;
  font-size: 13px;
}
.guild-item .meta {
  overflow: hidden;
}
.guild-item .gname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.guild-item .gcount {
  font-size: 11px;
  opacity: 0.75;
}

/* Marque + navigation SaaS */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
}
.brand-logo {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(95, 168, 255, 0.8));
}
.brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #cfe3ff, #b79bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--glass-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 110, 255, 0.35);
}

/* Badges de palier */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.tier-badge.t-FREE {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.tier-badge.t-PREMIUM {
  background: rgba(95, 168, 255, 0.18);
  color: #a9c8ff;
  border-color: rgba(95, 168, 255, 0.4);
}
.tier-badge.t-PRO {
  background: rgba(251, 191, 36, 0.16);
  color: var(--yellow);
  border-color: rgba(251, 191, 36, 0.4);
}
.tier-badge.t-LIFETIME {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.5);
}
.guild-item .tier-badge {
  margin-left: auto;
}

.head-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Accueil : grille de serveurs */
.home-guilds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.home-guild {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, transform 0.12s;
}
.home-guild:hover {
  border-color: rgba(95, 168, 255, 0.4);
  transform: translateY(-1px);
}
.home-guild img,
.home-guild .ph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.home-guild .ph {
  display: grid;
  place-items: center;
  background: var(--bg-4);
  font-weight: 600;
}
.home-guild .meta {
  overflow: hidden;
}
.home-guild .tier-badge {
  margin-left: auto;
}

/* Tableau des licences */
.lic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}
.lic-key {
  font-family: monospace;
  font-size: 12.5px;
}
.lic-status {
  margin-left: auto;
  color: var(--text-dim);
}
.lic-detail {
  color: var(--text-dim);
  flex: 1;
}
.lic-when {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.lic-expired {
  opacity: 0.6;
}

/* Badges de rôle (équipe) */
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.role-badge.r-viewer {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.role-badge.r-editor {
  background: rgba(95, 168, 255, 0.18);
  color: #a9c8ff;
  border-color: rgba(95, 168, 255, 0.4);
}
.role-badge.r-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.5);
}

/* Tableau (historique premium) */
.tbl-head,
.tbl-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
}
.tbl-head {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.tbl-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.content {
  padding: 32px 40px;
  max-width: none;
  width: 100%;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
  animation: rise 0.4s ease;
}
.page-head img,
.page-head .ph {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border);
}
.page-head .ph {
  display: grid;
  place-items: center;
  background: var(--glass-2);
  font-size: 22px;
  font-weight: 800;
}
.page-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.page-head .hint {
  color: var(--text-muted);
  font-size: 13px;
}

/* ───────── Onglets ───────── */
.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 26px;
}
.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 11px 15px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  border-radius: 8px 8px 0 0;
}
.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.tab.active {
  color: #fff;
  border-image: var(--accent-grad) 1;
  border-bottom: 2px solid;
  text-shadow: 0 0 14px rgba(95, 168, 255, 0.6);
}

/* ───────── Cartes & champs ───────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--glow), inset 0 1px 0 var(--glass-hi);
  animation: rise 0.4s ease;
}
.card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.card .desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 760px;
}
/* Grille de champs (onglets de config) : remplit la largeur en colonnes lisibles. */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2px 32px;
}
.fields-grid .field {
  max-width: none;
  border-top: none;
}
.fields-grid .field.col {
  grid-column: 1 / -1;
}
.field:first-of-type {
  border-top: none;
}
.field .label {
  font-size: 14px;
}
.field .help {
  color: var(--text-muted);
  font-size: 12px;
}
.field .control {
  flex-shrink: 0;
  min-width: 230px;
  display: flex;
  justify-content: flex-end;
}
.field.col {
  flex-direction: column;
  align-items: stretch;
}
.field.col .control {
  min-width: 0;
  width: 100%;
}

input[type='text'],
input[type='password'],
input[type='number'],
textarea,
select {
  background: rgba(6, 10, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--elec);
  box-shadow: 0 0 0 3px rgba(95, 168, 255, 0.18);
}
textarea {
  resize: vertical;
  min-height: 72px;
}
select {
  cursor: pointer;
}
option {
  background: #0b1120;
}

/* Menu déroulant personnalisé (scrollable + recherche) */
.dd {
  position: relative;
  width: 240px;
  max-width: 100%;
}
.dd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(6, 10, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dd-btn:hover {
  border-color: rgba(95, 168, 255, 0.4);
}
.dd.open .dd-btn {
  border-color: var(--elec);
  box-shadow: 0 0 0 3px rgba(95, 168, 255, 0.18);
}
.dd-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd-caret {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
}
.dd-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(14, 20, 38, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--glow);
  overflow: hidden;
}
.dd.open .dd-panel {
  display: block;
}
.dd-search {
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: rgba(6, 10, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}
.dd-search:focus {
  outline: none;
  border-color: var(--elec);
}
.dd-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 6px 6px;
}
.dd-opt {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
}
.dd-opt:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.dd-opt.sel {
  background: var(--accent-grad);
  color: #fff;
}
.dd-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Switch */
.switch {
  position: relative;
  width: 46px;
  height: 25px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  transition: 0.25s;
  cursor: pointer;
  border: 1px solid var(--border);
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 19px;
  width: 19px;
  left: 3px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}
.switch input:checked + .slider {
  background: var(--accent-grad);
  box-shadow: 0 0 16px rgba(95, 168, 255, 0.55);
}
.switch input:checked + .slider::before {
  transform: translateX(21px);
}

/* Boutons */
.btn {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(79, 110, 255, 0.3);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(79, 110, 255, 0.45);
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  filter: none;
}
.btn.full {
  width: 100%;
}
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Modules grid — cartes riches */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 13px;
}
.module-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.module-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-muted);
  opacity: 0.5;
  transition: background 0.2s, opacity 0.2s;
}
.module-card:hover {
  border-color: rgba(95, 168, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.module-card.on::before {
  background: var(--green);
  opacity: 1;
}
.module-card.locked {
  opacity: 0.8;
}
.module-card.locked::before {
  background: var(--elec-2);
  opacity: 1;
}
.module-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.module-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.module-title {
  min-width: 0;
}
.module-card .mname {
  font-size: 15px;
  font-weight: 700;
}
.module-card .mstate {
  font-size: 12px;
  color: var(--text-muted);
}
.module-card.on .mstate {
  color: var(--green);
}
.module-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  flex: 1;
}
.module-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 11px;
}
.module-card-foot .foot-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.count-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--elec);
  background: rgba(95, 168, 255, 0.12);
  border: 1px solid rgba(95, 168, 255, 0.3);
  border-radius: 999px;
  padding: 3px 11px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 13px;
}
.stat {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.stat .num {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(120deg, #cfe3ff, #8fb3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .lbl {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Graphique d'activité temps réel */
.activity-wrap {
  width: 100%;
  height: 180px;
  margin-top: 6px;
}
.activity-canvas {
  width: 100%;
  height: 180px;
  display: block;
}
.activity-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.live-dot {
  color: var(--green);
  font-weight: 500;
  animation: livepulse 1.4s ease-in-out infinite;
}
@keyframes livepulse {
  50% {
    opacity: 0.35;
  }
}

/* Sanctions / lignes */
.sanction {
  display: grid;
  grid-template-columns: 64px 96px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  letter-spacing: 0.03em;
}
.badge.BAN,
.badge.SOFTBAN,
.badge.LIFETIME {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}
.badge.KICK,
.badge.TIMEOUT,
.badge.MUTE,
.badge.PRO {
  background: rgba(251, 191, 36, 0.16);
  color: var(--yellow);
}
.badge.WARN,
.badge.PREMIUM {
  background: rgba(95, 168, 255, 0.18);
  color: #a9c8ff;
}

/* Toasts */
#toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}
.toast {
  background: var(--glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 11px;
  padding: 13px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  animation: slide 0.22s ease;
}
.toast.error {
  border-left-color: var(--red);
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 64px 20px;
}

/* Verrouillage premium : zone grisée + sous-titre vert fluo */
.lock-note {
  color: #39ff14;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.55);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}
.locked-card .field,
.locked-card .card-actions {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.7);
  user-select: none;
}
.tab.locked {
  opacity: 0.6;
}

/* Animations */
@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}
@keyframes slide {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 1; }
  48% { opacity: 0.45; }
  49% { opacity: 1; }
  72% { opacity: 1; }
  73% { opacity: 0.55; }
  74% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .card,
  .page-head,
  .toast {
    animation: none;
  }
  .login-card .logo {
    animation: none;
  }
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .content {
    padding: 22px 18px;
  }
}

/* ───────────── Boutons danger ───────────── */
.btn.danger {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
}
.btn.danger:hover {
  filter: brightness(1.08);
}

/* ───────────── Page « Gérer l'abonnement » (SaaS) ───────────── */
.sub-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow);
}
.sub-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0.1;
  pointer-events: none;
}
.sub-hero.t-PREMIUM::after {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  opacity: 0.12;
}
.sub-hero.t-PRO::after {
  background: linear-gradient(135deg, #8b5cf6, #4f9dff);
  opacity: 0.14;
}
.sub-hero.t-LIFETIME::after {
  background: linear-gradient(135deg, #38e0ff, #8b5cf6);
  opacity: 0.16;
}
.sub-emoji {
  font-size: 52px;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.sub-hero-info {
  position: relative;
  z-index: 1;
}
.sub-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}
.sub-plan {
  font-size: 28px;
  font-weight: 800;
  margin: 2px 0 6px;
}
.sub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  align-items: center;
}
.sub-status {
  font-weight: 700;
}
.sub-status.ok {
  color: var(--green);
}
.sub-status.bad {
  color: var(--red);
}
.sub-status.neutral {
  color: var(--text-muted);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.plan-card.current {
  border-color: var(--elec);
  box-shadow: 0 0 0 1px var(--elec), 0 10px 30px rgba(95, 168, 255, 0.18);
}
.plan-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.plan-emoji {
  font-size: 24px;
}
.plan-name {
  font-size: 19px;
  font-weight: 800;
}
.plan-tag,
.plan-flag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
}
.plan-tag {
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.plan-flag {
  color: var(--elec);
  background: rgba(95, 168, 255, 0.14);
  border: 1px solid rgba(95, 168, 255, 0.4);
}
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.plan-features li {
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
}
.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}
.danger-zone {
  border-color: rgba(248, 113, 113, 0.35);
}
.danger-zone h2 {
  color: var(--red);
}

/* ═══════════════════════ Thème clair ═══════════════════════ */
:root[data-theme='light'] {
  --bg-0: #e9eefb;
  --bg-1: #f6f8ff;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-2: rgba(255, 255, 255, 0.92);
  --glass-hi: rgba(10, 30, 80, 0.05);
  --border: rgba(60, 90, 160, 0.2);
  --text: #14203c;
  --text-dim: #44547a;
  --text-muted: #7a86a6;
  --elec: #2f7ae0;
  --elec-2: #7c3aed;
  --cyan: #0891b2;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --glow: 0 0 0 1px var(--border), 0 8px 30px rgba(60, 90, 160, 0.14);
}
:root[data-theme='light'] body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #dce7ff 0%, rgba(246, 248, 255, 0) 60%),
    radial-gradient(900px 600px at 85% 110%, #ece2ff 0%, rgba(246, 248, 255, 0) 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}
:root[data-theme='light'] .storm-vignette {
  background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0) 60%, rgba(120, 140, 190, 0.12) 100%);
}
:root[data-theme='light'] #lightning {
  opacity: 0.22;
}
:root[data-theme='light'] input[type='text'],
:root[data-theme='light'] input[type='password'],
:root[data-theme='light'] input[type='number'],
:root[data-theme='light'] textarea,
:root[data-theme='light'] select,
:root[data-theme='light'] .dd-btn,
:root[data-theme='light'] .dd-search {
  background: rgba(255, 255, 255, 0.85);
}
:root[data-theme='light'] option,
:root[data-theme='light'] .dd-panel {
  background: #ffffff;
}
:root[data-theme='light'] .dd-opt:hover,
:root[data-theme='light'] .btn.ghost:hover {
  background: rgba(10, 30, 80, 0.06);
}
:root[data-theme='light'] .module-card-foot,
:root[data-theme='light'] .tbl-row {
  border-color: rgba(10, 30, 80, 0.1);
}
:root[data-theme='light'] .lock-note {
  color: #15803d;
}

/* ═══════════════════════ Animations ═══════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.page-head,
.sub-hero,
.card {
  animation: fadeInUp 0.4s ease both;
}
.modules-grid .module-card,
.plans-grid .plan-card,
.stats-grid .stat {
  animation: popIn 0.34s ease both;
}
.modules-grid .module-card:nth-child(2),
.plans-grid .plan-card:nth-child(2),
.stats-grid .stat:nth-child(2) {
  animation-delay: 0.04s;
}
.modules-grid .module-card:nth-child(3),
.plans-grid .plan-card:nth-child(3),
.stats-grid .stat:nth-child(3) {
  animation-delay: 0.08s;
}
.modules-grid .module-card:nth-child(4),
.stats-grid .stat:nth-child(4) {
  animation-delay: 0.12s;
}
.modules-grid .module-card:nth-child(5),
.stats-grid .stat:nth-child(5) {
  animation-delay: 0.16s;
}
.modules-grid .module-card:nth-child(6),
.stats-grid .stat:nth-child(6) {
  animation-delay: 0.2s;
}
.modules-grid .module-card:nth-child(7) {
  animation-delay: 0.24s;
}
.modules-grid .module-card:nth-child(8) {
  animation-delay: 0.28s;
}
.modules-grid .module-card:nth-child(n + 9) {
  animation-delay: 0.32s;
}

/* Transition douce lors du changement de thème (couleurs uniquement) */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .page-head,
  .sub-hero,
  .card,
  .modules-grid .module-card,
  .plans-grid .plan-card,
  .stats-grid .stat {
    animation: none !important;
  }
}

/* ───────────── Connexion / inscription ───────────── */
.login-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.login-msg {
  font-size: 13px;
  min-height: 18px;
  color: var(--text-dim);
  text-align: center;
}
.login-msg.err {
  color: var(--red);
}
.login-msg.ok {
  color: var(--green);
}

/* ───────────── Paires clé/valeur (profil) ───────────── */
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
}
.kv:first-of-type {
  border-top: none;
}
.kv > span:first-child {
  color: var(--text-muted);
}

/* ───────────── QR code 2FA ───────────── */
.qr-box {
  display: inline-block;
  margin: 10px 0;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  line-height: 0;
}

/* ───────────── Légende des rôles (équipe) ───────────── */
.role-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 12px 14px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.role-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.role-legend-item .role-badge {
  flex-shrink: 0;
  min-width: 118px;
  text-align: center;
}

/* ───────────── Administration (comptes) ───────────── */
.acct-card {
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 11px;
}
.acct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.acct-name {
  font-size: 15px;
  font-weight: 700;
}
.acct-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.acct-detail {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}
.acct-section {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}
.acct-status {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.acct-status.s-active {
  color: var(--green);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.acct-status.s-disabled {
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.acct-status.s-banned {
  color: var(--red);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ───────────── Codes de secours 2FA ───────────── */
.codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.backup-code {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 1px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

/* ───────────── Chat de ticket en direct ───────────── */
.chat-messages {
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 4px;
  margin: 10px 0;
}
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.chat-msg.staff {
  flex-direction: row-reverse;
}
.chat-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--glass-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.chat-body {
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  max-width: 72%;
}
.chat-msg.staff .chat-body {
  background: rgba(95, 168, 255, 0.14);
  border-color: rgba(95, 168, 255, 0.35);
}
.chat-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--elec);
  margin-bottom: 2px;
}
.chat-text {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}
.chat-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  min-height: 44px;
  resize: vertical;
}
.live-dot {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
