/* ==========================================================================
   ZNAA 2026 Medal Tally & Monitoring System
   Modern Light Theme — Clean · Airy · Professional
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  /* --- Base Palette --- */
  --white:        #ffffff;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --gray-900:     #111827;

  /* --- Blue Brand --- */
  --blue-50:      #eff6ff;
  --blue-100:     #dbeafe;
  --blue-500:     #3b82f6;
  --blue-600:     #2563eb;
  --blue-700:     #1d4ed8;

  /* --- Semantic Colors --- */
  --bg-app:       #f4f6f9;
  --bg-card:      #ffffff;
  --bg-sidebar:   #ffffff;
  --border:       #e5e7eb;
  --border-light: #f3f4f6;

  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-dim:       #9ca3af;

  --brand:            #2563eb;
  --brand-hover:      #1d4ed8;
  --brand-light:      #eff6ff;
  --brand-ring:       rgba(37, 99, 235, 0.15);

  /* --- Medal Colors --- */
  --gold:         #f59e0b;
  --gold-bg:      #fffbeb;
  --gold-border:  #fde68a;
  --gold-text:    #92400e;

  --silver:       #94a3b8;
  --silver-bg:    #f8fafc;
  --silver-border:#e2e8f0;
  --silver-text:  #334155;

  --bronze:       #b45309;
  --bronze-bg:    #fff7ed;
  --bronze-border:#fed7aa;
  --bronze-text:  #9a3412;

  /* --- Cluster Colors --- */
  --c1: #2563eb; --c2: #dc2626; --c3: #059669;
  --c4: #d97706; --c5: #7c3aed; --c6: #db2777;

  /* --- Status Colors --- */
  --green-50:  #f0fdf4; --green-500: #22c55e; --green-600: #16a34a; --green-700: #15803d;
  --red-50:    #fef2f2; --red-500:   #ef4444; --red-600:   #dc2626;
  --amber-50:  #fffbeb; --amber-500: #f59e0b; --amber-600: #d97706;
  --purple-50: #faf5ff; --purple-600:#9333ea;

  /* --- Typography --- */
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- Radii --- */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs:   0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px 0 rgba(0,0,0,0.07), 0 1px 2px -1px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-card: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.05);

  /* --- Sidebar Width --- */
  --sidebar-w: 240px;
  --topbar-h:  60px;

  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ============================================
   PUBLIC LAYOUT (no sidebar)
   ============================================ */
.app-public {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   ADMIN LAYOUT (sidebar + content)
   ============================================ */
.app-admin {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.sidebar-brand-text h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Admin badge */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.25rem;
}

.sidebar-nav {
  padding: 0.75rem 0.75rem;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0.5rem 0.5rem 0.35rem;
  margin-top: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.sidebar-link .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  opacity: 0.75;
}

.sidebar-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--gray-50);
  margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-user-info .user-role {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

/* --- Admin Content Area --- */
.admin-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-main {
  flex: 1;
  padding: 2rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   PUBLIC TOP NAVIGATION
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--topbar-h);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-text p {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  background: var(--gray-100);
  padding: 3px;
  border-radius: var(--r-full);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-full);
  font-weight: 500;
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.8);
}

.nav-link.active {
  color: var(--brand);
  background: var(--white);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Main content for public pages */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-success {
  background: var(--green-600);
  color: var(--white);
  border-color: var(--green-600);
}

.btn-success:hover:not(:disabled) {
  background: var(--green-700);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--white);
  color: var(--red-600);
  border-color: rgba(220, 38, 38, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-50);
  border-color: var(--red-500);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: var(--white);
  border: none;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-header-left {}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card-padded {
  padding: 2rem;
}

.card:hover { border-color: var(--gray-300); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 0;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 0.3rem;
}

/* Icon colors */
.icon-blue  { background: var(--blue-50);   color: var(--blue-600);   }
.icon-gold  { background: var(--amber-50);  color: var(--amber-600);  }
.icon-green { background: var(--green-50);  color: var(--green-600);  }
.icon-red   { background: var(--red-50);    color: var(--red-600);    }
.icon-purple{ background: var(--purple-50); color: var(--purple-600); }

/* ============================================
   LIVE BADGE
   ============================================ */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-full);
  color: var(--green-600);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green-500);
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%   { transform: scale(0.9); opacity: 0.7; }
  50%  { transform: scale(1.4); opacity: 1; box-shadow: 0 0 6px var(--green-500); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ============================================
   PODIUM / HERO SECTION
   ============================================ */
.podium-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: flex-end;
}

.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.podium-1st {
  order: 2;
  border-color: var(--gold-border);
  background: linear-gradient(160deg, var(--gold-bg) 0%, var(--white) 60%);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
  padding: 2.25rem 1.25rem;
}

.podium-2nd {
  order: 1;
  background: linear-gradient(160deg, var(--gray-50) 0%, var(--white) 60%);
}

.podium-3rd {
  order: 3;
  border-color: var(--bronze-border);
  background: linear-gradient(160deg, var(--bronze-bg) 0%, var(--white) 60%);
}

.podium-medal { font-size: 3rem; margin-bottom: 0.35rem; line-height: 1; }
.podium-rank {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.25rem;
}
.podium-1st .podium-rank { color: var(--amber-600); }
.podium-2nd .podium-rank { color: var(--gray-500); }
.podium-3rd .podium-rank { color: var(--bronze); }

.podium-cluster-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.podium-medals {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  width: 100%;
}

/* ============================================
   MEDAL BADGES
   ============================================ */
.medal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
}

.badge-gold   { background: var(--gold-bg);   color: var(--gold-text);   border: 1px solid var(--gold-border);   }
.badge-silver { background: var(--silver-bg); color: var(--silver-text); border: 1px solid var(--silver-border); }
.badge-bronze { background: var(--bronze-bg); color: var(--bronze-text); border: 1px solid var(--bronze-border); }
.badge-total  { background: var(--blue-50);   color: var(--blue-700);    border: 1px solid var(--blue-100);     }

/* Status chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip-green  { background: var(--green-50); color: var(--green-700); border: 1px solid #bbf7d0; }
.chip-gray   { background: var(--gray-100); color: var(--gray-600);  border: 1px solid var(--gray-200); }
.chip-amber  { background: var(--amber-50); color: var(--amber-600); border: 1px solid #fde68a; }
.chip-red    { background: var(--red-50);   color: var(--red-600);   border: 1px solid #fecaca; }
.chip-blue   { background: var(--blue-50);  color: var(--blue-700);  border: 1px solid var(--blue-100); }

/* ============================================
   CLUSTER PILLS
   ============================================ */
.cluster-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.82rem;
}

.cluster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   NAVIGATION TABS (inline)
   ============================================ */
.tabs-container {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 3px;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 0.55rem 1.1rem;
  border-radius: calc(var(--r-md) - 3px);
  font-weight: 500;
  font-size: 0.84rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.6); }

.tab-btn.active {
  color: var(--brand);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ============================================
   DATA TABLES
   ============================================ */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table thead th {
  background: var(--gray-50);
  padding: 0.85rem 1.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-secondary);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.rank-cell {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.rank-1 { color: var(--amber-600); }
.rank-2 { color: var(--gray-500);  }
.rank-3 { color: var(--bronze);    }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.875rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.select-filter {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-filter:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-label span.req { color: var(--red-500); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
  line-height: 1.5;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.form-control::placeholder { color: var(--text-dim); }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.form-error {
  font-size: 0.78rem;
  color: var(--red-600);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.5rem 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem 1.35rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   ALERT / FLASH TOASTS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toast-in 0.3s ease;
  min-width: 280px;
  max-width: 420px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--green-600); color: var(--white); }
.toast-error   { background: var(--red-600);   color: var(--white); }
.toast-warning { background: var(--amber-500); color: var(--white); }
.toast-info    { background: var(--blue-600);  color: var(--white); }

/* Inline alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.alert-error   { background: var(--red-50);   border: 1px solid #fecaca; color: var(--red-600);   }
.alert-success { background: var(--green-50); border: 1px solid #bbf7d0; color: var(--green-700); }
.alert-info    { background: var(--blue-50);  border: 1px solid var(--blue-100); color: var(--blue-700); }
.alert-warning { background: var(--amber-50); border: 1px solid #fde68a; color: var(--amber-600); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border-light);
  background: var(--white);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============================================
   USER MANAGEMENT SPECIFIC
   ============================================ */
.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-cell .user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.user-info-cell .user-username {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 1.25rem 0;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar-wrap {
  background: var(--gray-100);
  border-radius: var(--r-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .admin-content { margin-left: 0; }
}

@media (max-width: 768px) {
  .main-content,
  .admin-main { padding: 1.25rem 1rem; }

  .podium-container {
    grid-template-columns: 1fr;
  }
  .podium-1st { order: 1; }
  .podium-2nd { order: 2; }
  .podium-3rd { order: 3; }

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

  .nav-center { display: none; }

  .form-row { grid-template-columns: 1fr; }

  .page-title { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
.no-print { }
