/* ==============================================================================
   GREY CORNER — PERFORMANCE SERVEURS (DESIGN SYSTEM LUXURY NOIR & OR)
   ============================================================================== */

:root {
  --bg: #07060a;
  --surface: #111118;
  --surface-2: #161622;
  --surface-3: #1f1f2e;
  --border: rgba(201, 169, 110, 0.16);
  --border-hover: rgba(201, 169, 110, 0.38);
  --gold: #C9A96E;
  --gold-light: #e6ce96;
  --gold-dim: rgba(201, 169, 110, 0.12);
  --gold-glow: rgba(201, 169, 110, 0.25);
  --silver: #cbd5e1;
  --silver-dim: rgba(203, 213, 225, 0.12);
  --bronze: #d97706;
  --bronze-dim: rgba(217, 119, 6, 0.12);
  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --text: #f8fafc;
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.38);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 12px 36px rgba(201, 169, 110, 0.15);
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse 60% 30% at 50% -10%, rgba(201, 169, 110, 0.08) 0%, transparent 80%),
    radial-gradient(ellipse 40% 40% at 85% 60%, rgba(201, 169, 110, 0.03) 0%, transparent 70%);
  background-attachment: fixed;
}

/* ── Container & Header ────────────────────────────────────────── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.month-picker-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  gap: 10px;
}

.month-picker-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.month-select {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.month-select option {
  background: var(--surface-2);
  color: var(--text);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b38f53 100%);
  color: #07060a;
  border-color: var(--gold-light);
  box-shadow: 0 4px 16px rgba(201, 169, 110, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── KPI Summary Cards ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Podium Section 🏆 ─────────────────────────────────────────── */
.section-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.podium-container {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 860px) {
  .podium-container {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.podium-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.podium-step:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

/* 1ère Place (Centre) */
.podium-first {
  order: 2;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 169, 110, 0.09) 0%, var(--surface) 80%);
  box-shadow: 0 20px 50px rgba(201, 169, 110, 0.12);
  padding: 34px 24px 30px;
}

@media (max-width: 860px) {
  .podium-first {
    order: 1;
  }
}

.podium-second {
  order: 1;
}
@media (max-width: 860px) {
  .podium-second {
    order: 2;
  }
}

.podium-third {
  order: 3;
}

.crown-badge {
  position: absolute;
  top: -16px;
  background: linear-gradient(135deg, #ffd700, #ffae00);
  color: #07060a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 14px;
  border-radius: 99px;
  box-shadow: 0 6px 16px rgba(255, 174, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.podium-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 12px;
}

.rank-gold {
  background: var(--gold);
  color: #07060a;
  box-shadow: 0 0 16px var(--gold-glow);
}

.rank-silver {
  background: var(--silver);
  color: #07060a;
}

.rank-bronze {
  background: var(--bronze);
  color: #ffffff;
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: block;
}

.podium-first .avatar-img {
  width: 116px;
  height: 116px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 28px var(--gold-glow);
}

.avatar-initials {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
}

.podium-first .avatar-initials {
  width: 116px;
  height: 116px;
  font-size: 36px;
}

.server-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.podium-first .server-name {
  font-size: 25px;
  color: var(--gold-light);
}

.server-role {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 14px;
}

.server-metric-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  width: 100%;
  margin-bottom: 10px;
}

.metric-amount {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.1;
}

.podium-first .metric-amount {
  font-size: 30px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.server-stats-mini {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Leaderboard Table & Cards ─────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13.5px;
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--surface-2);
}

.table-server-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.table-avatar-init {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.table-rank {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  width: 28px;
}

.table-amount {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
}

/* ── Progress Bar ──────────────────────────────────────────────── */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 5px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 99px;
}

/* ── Modal Détails ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 24px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--gold);
}

/* ── Drag & Drop Zone ──────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 30px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold);
  background: var(--surface-2);
}

.dropzone i {
  font-size: 32px;
  color: var(--gold);
  margin-bottom: 10px;
}
