/* Panel — thème Discord-like (jaune #FEE75C, gris sombre, blurple) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --font-sans: "Plus Jakarta Sans", "gg sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  /* Fonds type Discord (gris très sombre) */
  --bg-deep: #0b0c0f;
  --bg-main: #111214;
  --mesh-1: rgba(254, 231, 92, 0.11);
  --mesh-2: rgba(88, 101, 242, 0.12);
  --mesh-3: rgba(235, 69, 158, 0.06);
  --bg-elevated: rgba(30, 31, 34, 0.85);
  --bg-card: rgba(43, 45, 49, 0.72);
  --bg-card-solid: #2b2d31;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(254, 231, 92, 0.35);
  --text-main: #f2f3f5;
  --text-muted: #b5bac1;
  /* Jaune Discord + blurple secondaire */
  --accent: #fee75c;
  --accent-2: #5865f2;
  --accent-3: #eb459e;
  --accent-warm: #faa61a;
  --accent-soft: rgba(254, 231, 92, 0.12);
  --success: #23a559;
  --danger: #f23f43;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 56px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(254, 231, 92, 0.15), 0 20px 48px rgba(0, 0, 0, 0.4);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 272px;
  --chart-muted: rgba(181, 186, 193, 0.9);
  --chart-accent: #fee75c;
  --chart-accent-2: #5865f2;
  --chart-accent-3: #eb459e;
  --chart-line-fill: rgba(254, 231, 92, 0.16);
  --chart-bar-fill: rgba(88, 101, 242, 0.45);
  --chart-staff-fill: rgba(235, 69, 158, 0.14);
  --chart-donut-1: rgba(254, 231, 92, 0.9);
  --chart-donut-2: rgba(88, 101, 242, 0.88);
  --chart-donut-3: rgba(235, 69, 158, 0.88);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 100% 90% at 10% -30%, var(--mesh-1), transparent 55%),
    radial-gradient(ellipse 80% 70% at 95% 10%, var(--mesh-2), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 110%, var(--mesh-3), transparent 45%),
    linear-gradient(165deg, #121316 0%, var(--bg-deep) 42%, #0a0b0d 100%);
  background-attachment: fixed;
  color: var(--text-main);
}

body {
  display: flex;
}

code,
.code-inline {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.45em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
}

.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(17, 18, 20, 0.92);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 28px;
  z-index: 20;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 6px;
}

.sidebar__brand-logo {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(254, 231, 92, 0.22), rgba(88, 101, 242, 0.12));
  border: 1px solid rgba(254, 231, 92, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 24px rgba(254, 231, 92, 0.08);
}

.sidebar__brand-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--text-main);
}

.sidebar__brand-title small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar__nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 20px 10px 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
}

.sidebar__nav-item:hover {
  background: rgba(254, 231, 92, 0.06);
  color: var(--text-main);
  transform: translateX(3px);
}

.sidebar__nav-item.is-active {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(254, 231, 92, 0.14), rgba(88, 101, 242, 0.1));
  border-color: rgba(254, 231, 92, 0.28);
  box-shadow: 0 0 28px rgba(254, 231, 92, 0.07);
}

.sidebar__nav-item--sub {
  margin-left: 12px;
  padding-left: 22px;
  font-size: 13px;
  opacity: 0.92;
}

.sidebar__nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  opacity: 0.95;
}

.sidebar__nav-text {
  flex: 1;
}

/* ——— Main ——— */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  background: rgba(17, 18, 20, 0.82);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bouton menu mobile (activé sous 1024px) */
.topbar__menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.topbar__menu-btn:hover {
  background: rgba(254, 231, 92, 0.1);
  border-color: rgba(254, 231, 92, 0.35);
}

.topbar__menu-icon {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-main);
  box-shadow: 0 -6px 0 var(--text-main), 0 6px 0 var(--text-main);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar__logout-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.topbar__logout {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.topbar__logout:hover {
  color: #fecaca;
  background: rgba(242, 63, 67, 0.15);
  border-color: rgba(242, 63, 67, 0.4);
}

.panel-alert {
  margin: 0 28px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border-subtle);
}

.panel-alert code {
  font-size: 0.92em;
}

.panel-alert--warn {
  background: rgba(254, 231, 92, 0.1);
  border-color: rgba(254, 231, 92, 0.4);
  color: #fee75c;
}

@media (max-width: 1024px) {
  .panel-alert {
    margin: 0 16px 12px;
  }
}

/* Overlay + tiroir : la case à cocher est un frère direct de .app-shell dans base.php */
.sidebar-scrim {
  display: none;
}

.main__content {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.app-footer {
  margin-top: auto;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.app-footer__meta {
  opacity: 0.9;
}

.app-footer__sep {
  opacity: 0.45;
}

.app-footer__link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.app-footer__link:hover {
  color: var(--accent);
}

@media (max-width: 1024px) {
  .app-footer {
    padding: 14px 16px 20px;
  }
}

/* ——— Page connexion (Discord-like) ——— */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 72% at 10% -20%, rgba(254, 231, 92, 0.18), transparent 58%),
    radial-gradient(ellipse 70% 62% at 100% 20%, rgba(88, 101, 242, 0.17), transparent 52%),
    radial-gradient(ellipse 55% 45% at 50% 110%, rgba(235, 69, 158, 0.1), transparent 48%);
  animation: authBgShift 16s ease-in-out infinite alternate;
}

.auth-backdrop::before,
.auth-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.22;
}

.auth-backdrop::before {
  width: 240px;
  height: 240px;
  left: 8%;
  top: 18%;
  background: radial-gradient(circle at 30% 30%, rgba(254, 231, 92, 0.7), transparent 68%);
  animation: floatOrb 12s ease-in-out infinite;
}

.auth-backdrop::after {
  width: 260px;
  height: 260px;
  right: 8%;
  bottom: 14%;
  background: radial-gradient(circle at 30% 30%, rgba(88, 101, 242, 0.75), transparent 68%);
  animation: floatOrb 15s ease-in-out infinite reverse;
}

.auth-page .auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 34px;
  border-radius: 22px;
  background: linear-gradient(158deg, rgba(43, 45, 49, 0.72) 0%, rgba(30, 31, 34, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(254, 231, 92, 0.08),
    0 0 100px rgba(254, 231, 92, 0.09);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 2px;
}

.auth-brand__mark {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(254, 231, 92, 0.35), rgba(88, 101, 242, 0.2));
  border: 1px solid rgba(254, 231, 92, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.44);
}

.auth-brand__text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(88, 101, 242, 0.38);
  background: rgba(88, 101, 242, 0.12);
  color: #cfd5ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-title {
  margin: 2px 0 0;
  font-size: clamp(1.75rem, 2.5vw, 2.1rem);
  font-weight: 800;
  text-align: left;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-lead {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: left;
}

.auth-input-mock {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 16, 19, 0.52);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.auth-input-mock:hover {
  border-color: rgba(254, 231, 92, 0.32);
  box-shadow: 0 0 0 3px rgba(254, 231, 92, 0.08);
}

.auth-input-mock__icon {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  opacity: 0.9;
}

.auth-input-mock__text {
  color: #e5e7eb;
  font-size: 13px;
  flex: 1;
}

.auth-input-mock__toggle {
  border: 0;
  background: transparent;
  color: #c9ced9;
  cursor: pointer;
  font-size: 16px;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.auth-input-mock__toggle:hover {
  color: #fff;
  transform: scale(1.07);
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-remember input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 16, 19, 0.72);
  position: relative;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-remember input[type="checkbox"]:checked {
  border-color: rgba(254, 231, 92, 0.78);
  background: linear-gradient(140deg, #fee75c, #e7b92f);
  box-shadow: 0 0 0 3px rgba(254, 231, 92, 0.2);
}

.auth-remember input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #111214;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: #111214;
  background: linear-gradient(135deg, #fee75c 0%, #f5d547 45%, #e5bc2e 100%);
  border: none;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.15),
    0 16px 40px rgba(254, 231, 92, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.auth-discord-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.12),
    0 22px 50px rgba(254, 231, 92, 0.35);
}

.auth-discord-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 8px 24px rgba(254, 231, 92, 0.2);
}

.auth-discord-btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(17, 18, 20, 0.3);
  border-top-color: rgba(17, 18, 20, 0.95);
  display: none;
  animation: spin 0.85s linear infinite;
}

.auth-discord-btn.is-loading .auth-discord-btn__spinner {
  display: inline-block;
}

.auth-discord-btn.is-loading .auth-discord-btn__icon {
  display: none;
}

.auth-discord-btn.is-loading .auth-discord-btn__text {
  opacity: 0.9;
}

.auth-discord-btn__icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.auth-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(181, 186, 193, 0.88);
  line-height: 1.5;
}

.auth-flash {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
}

.auth-flash--error {
  background: rgba(242, 63, 67, 0.12);
  color: #fda4a4;
  border: 1px solid rgba(242, 63, 67, 0.4);
}

.auth-flash--success {
  background: rgba(35, 165, 89, 0.14);
  color: #a8e5c0;
  border: 1px solid rgba(35, 165, 89, 0.4);
}

@media (max-width: 640px) {
  .auth-page {
    padding: 14px;
  }
  .auth-page .auth-card {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .auth-title {
    font-size: 1.62rem;
  }
  .auth-lead {
    font-size: 13px;
  }
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authBgShift {
  from {
    transform: scale(1) translateY(0);
  }
  to {
    transform: scale(1.04) translateY(-8px);
  }
}

@keyframes floatOrb {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -14px, 0);
  }
  100% {
    transform: translate3d(8px, 0, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ——— Page ——— */
.page-head {
  margin-bottom: 28px;
}

.page-head__title {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #fee75c 55%, #b5bac1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-head__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 62ch;
}

/* ——— Stat cards ——— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(254, 231, 92, 0.18);
}

.stat-card--glow {
  border-color: rgba(254, 231, 92, 0.28);
  box-shadow: var(--shadow-soft), 0 0 48px rgba(254, 231, 92, 0.08);
}

.stat-card--accent {
  border-color: rgba(88, 101, 242, 0.35);
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.12), var(--bg-card));
}

.stat-card__icon {
  font-size: 22px;
  line-height: 1;
  opacity: 0.9;
}

.stat-card__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card__value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.stat-card__hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.85;
}

/* ——— Charts ——— */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.chart-card--donut {
  grid-column: span 2;
}

.chart-canvas-wrap {
  position: relative;
  height: 240px;
  margin-top: 8px;
}

.chart-canvas-wrap--donut {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  height: 260px;
}

@media (max-width: 1024px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .chart-card--donut {
    grid-column: span 1;
  }
}

/* ——— Cards (legacy + new) ——— */
.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, var(--bg-card) 45%, rgba(0, 0, 0, 0.15) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.card--pad {
  padding: 22px 24px;
}

.card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
}

.card__value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.card__trend {
  margin-top: 6px;
  font-size: 12px;
  color: var(--success);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card-grid--points-leaders {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .card-grid--points-leaders {
    grid-template-columns: 1fr;
  }
}

.points-leader-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.points-leader-card__body {
  margin-top: 10px;
  font-size: 13px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.points-leader-card__scroll {
  flex: 1;
  min-height: 0;
  max-height: min(440px, 58vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.points-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .points-forms-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Split / leader ——— */
.split-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
}

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

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

@media (max-width: 900px) {
  .leader-grid {
    grid-template-columns: 1fr;
  }
}

.leader-block__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 13px;
}

.leader-row__rank {
  color: var(--text-muted);
  width: 22px;
}

.leader-row__id {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row__pts {
  font-weight: 600;
  color: var(--text-main);
}

.member-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.member-inline--tight {
  max-width: 100%;
}

.member-inline__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.member-inline__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.member-inline__id {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-gap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.log-item__meta {
  font-size: 11px;
  color: var(--text-muted);
}

.log-item__action {
  font-size: 13px;
  margin-top: 2px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.pill--on {
  border-color: rgba(35, 165, 89, 0.5);
  background: rgba(35, 165, 89, 0.15);
  color: #a8e5c0;
}

/* ——— Forms & tables ——— */
.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 12px;
}

.text-accent {
  color: var(--accent);
}

.text-strong {
  font-weight: 600;
}

.mt-xs {
  margin-top: 6px;
}
.mt-sm {
  margin-top: 10px;
}
.mt-md {
  margin-top: 16px;
}
.mt-lg {
  margin-top: 22px;
}
.mb-md {
  margin-bottom: 16px;
}
.mb-lg {
  margin-bottom: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.flex-1 {
  flex: 1;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: rgba(254, 231, 92, 0.5);
  box-shadow: 0 0 0 3px rgba(254, 231, 92, 0.12);
}

.input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, #fee75c 0%, #e8c84a 50%, #d4a826 100%);
  color: #111214;
  box-shadow: 0 10px 32px rgba(254, 231, 92, 0.22);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(254, 231, 92, 0.32);
  filter: brightness(1.05);
}

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

.btn--ghost:hover {
  color: var(--text-main);
  border-color: rgba(254, 231, 92, 0.25);
  background: rgba(254, 231, 92, 0.05);
}

.btn--self-end {
  align-self: flex-end;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.data-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

.data-table tbody tr:hover {
  background: rgba(254, 231, 92, 0.05);
}

.link-accent {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.link-accent:hover {
  text-decoration: underline;
  color: #fff4b8;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert--success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.alert--error {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.alert--warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.text-danger {
  color: var(--danger);
}

.text-xs {
  font-size: 11px;
}

.code-break {
  word-break: break-all;
  white-space: pre-wrap;
}

.btn--sm {
  padding: 7px 12px;
  font-size: 13px;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.debug-dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
}

.debug-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.debug-dl dd {
  margin: 0;
}

.debug-pre {
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  margin: 0;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  line-height: 1.45;
}

.data-table--compact th,
.data-table--compact td {
  padding: 8px 10px;
  font-size: 12px;
}

.ig-raw-details summary {
  list-style: none;
}

.ig-raw-details summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 640px) {
  .debug-dl {
    grid-template-columns: 1fr;
  }
}

/* ——— Responsive shell ——— */
@media (max-width: 1024px) {
  .topbar__menu-btn {
    display: flex;
  }

  .app-shell {
    position: relative;
  }

  .sidebar-scrim {
    display: none;
  }

  #nav-drawer:checked ~ .app-shell .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(var(--sidebar-width), 88vw);
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 100;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }

  #nav-drawer:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }

  .main {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main__content {
    padding: 20px 16px 32px;
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 10px 16px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Podium HoF (prévisualisation panel) ——— */
.cursor-pointer {
  cursor: pointer;
}

.form-grid-podium {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field__label {
  font-size: 12px;
  color: var(--text-muted);
}

.podium-preview-ui__frame {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  aspect-ratio: 2048 / 1365;
  border-radius: var(--radius-md);
  /* Si l'image podium est présente côté panel, on l'utilise comme fond. */
  background:
    url("../podium-hall-of-fame.png") center/cover no-repeat,
    linear-gradient(165deg, rgba(43, 46, 53, 0.92) 0%, rgba(20, 21, 24, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.podium-preview-ui__avatar {
  position: absolute;
  left: calc(var(--cx) * 100%);
  top: calc(var(--cy) * 100%);
  width: calc(var(--cs) * 100%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), rgba(88, 101, 242, 0.2));
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(254, 231, 92, 0.12);
  cursor: move;
  user-select: none;
}

.podium-preview-ui__avatar--live {
  cursor: default;
}

.podium-preview-ui__avatar--live img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.podium-preview-ui__name {
  position: absolute;
  left: calc(var(--cx) * 100%);
  top: calc(var(--ny) * 100%);
  transform: translateX(-50%);
  max-width: calc(var(--mw) * 100%);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: move;
  user-select: none;
}

.podium-preview-ui__name--live {
  cursor: default;
}

.podium-preview-ui__avatar.is-selected,
.podium-preview-ui__name.is-selected {
  outline: 2px dashed rgba(254, 231, 92, 0.95);
  outline-offset: 2px;
}

.podium-preview-ui__handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.7);
  background: #fee75c;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.podium-preview-ui__avatar .podium-preview-ui__handle[data-handle="avatar-size"] {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.podium-preview-ui__name .podium-preview-ui__handle[data-handle="name-width"] {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.code-block {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow: auto;
  max-height: 280px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.live-podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.live-podium-card {
  border: 1px solid var(--border-subtle);
  background: linear-gradient(155deg, rgba(43,45,49,.85), rgba(24,25,28,.94));
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.live-podium-card__rank {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.live-podium-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(254, 231, 92, 0.55);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

.live-podium-card__name {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-podium-card__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.live-embed-preview__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 900px) {
  .live-podium-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 2026 Dashboard Refresh (hors login) =====
   Objectif: conserver l'identité jaune et moderniser toute l'UI panel. */
.app-shell {
  background:
    radial-gradient(1100px 650px at 10% -10%, rgba(255, 213, 79, 0.09), transparent 55%),
    radial-gradient(900px 620px at 100% 0%, rgba(255, 193, 7, 0.08), transparent 50%),
    linear-gradient(180deg, #0d0e11 0%, #0b0c0f 100%);
}

.sidebar {
  background: linear-gradient(180deg, rgba(17, 18, 20, 0.95), rgba(14, 15, 18, 0.96));
  border-right-color: rgba(255, 255, 255, 0.07);
}

.sidebar__brand-logo {
  background: linear-gradient(145deg, rgba(255, 213, 79, 0.22), rgba(255, 193, 7, 0.08));
  border-color: rgba(255, 213, 79, 0.36);
}

.sidebar__nav-item {
  border-radius: 13px;
}

.sidebar__nav-item:hover {
  background: rgba(255, 213, 79, 0.08);
  border-color: rgba(255, 213, 79, 0.18);
}

.sidebar__nav-item.is-active {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.17), rgba(255, 193, 7, 0.08));
  border-color: rgba(255, 213, 79, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.08), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.topbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 15, 18, 0.82), rgba(14, 15, 18, 0.72));
}

.topbar::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.46), rgba(255, 213, 79, 0.03) 45%, rgba(255, 213, 79, 0.22));
  pointer-events: none;
}

.topbar__login-link {
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 10px;
  transition: all var(--transition-fast);
}

.topbar__login-link:hover {
  border-color: rgba(255, 213, 79, 0.36);
  color: #fff4c4;
  background: rgba(255, 213, 79, 0.08);
}

.main__content {
  padding-top: 30px;
  padding-bottom: 44px;
}

.card,
.stat-card,
.chart-card,
.leader-block,
.live-podium-card {
  border-radius: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.card:hover,
.stat-card:hover,
.chart-card:hover {
  border-color: rgba(255, 213, 79, 0.22);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.btn--primary,
.auth-button {
  background: linear-gradient(135deg, #ffd54f 0%, #ffc107 45%, #ffb300 100%);
  color: #111214;
}

.btn--primary:hover,
.auth-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  border-radius: 12px;
}

.input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 213, 79, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.14);
}

.table-wrap {
  border-radius: 14px;
}

.data-table th {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.data-table tbody tr:hover {
  background: rgba(255, 213, 79, 0.06);
}

.member-inline__avatar {
  width: 24px;
  height: 24px;
  border-color: rgba(255, 213, 79, 0.32);
}

.member-inline__name {
  max-width: none;
  flex: 1;
  min-width: 0;
}

.pill--on {
  border-color: rgba(255, 213, 79, 0.45);
  background: rgba(255, 213, 79, 0.14);
  color: #ffeaa2;
}

.alert--success,
.alert--warn,
.alert--error {
  border-radius: 12px;
}

@media (max-width: 1024px) {
  .topbar::after {
    left: 16px;
    right: 16px;
  }
}
