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

:root {
  --bg: #f8f9fc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255,255,255,0.85);
  --text: #1a1a2e;
  --text-light: #6b7280;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #f59e0b;
  --accent2: #10b981;
  --accent3: #ef4444;
  --accent4: #3b82f6;
  --gradient1: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --gradient2: linear-gradient(135deg, #f59e0b, #f97316);
  --gradient3: linear-gradient(135deg, #10b981, #34d399);
  --gradient4: linear-gradient(135deg, #ef4444, #f97316);
  --shadow: 0 4px 24px rgba(99,102,241,0.12);
  --shadow-lg: 0 8px 40px rgba(99,102,241,0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #ede9fe 0%, #fef3c7 25%, #d1fae5 50%, #dbeafe 75%, #fce7f3 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === ANIMATED BG ORBS === */
.bg-decoration {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bg-decoration .orb {
  position: absolute; border-radius: 50%; filter: blur(100px); animation: float 20s infinite ease-in-out;
}
.bg-decoration .orb:nth-child(1) { width: 600px; height: 600px; background: #6366f1; opacity: 0.12; top: -15%; right: -10%; }
.bg-decoration .orb:nth-child(2) { width: 500px; height: 500px; background: #f59e0b; opacity: 0.10; bottom: -15%; left: -8%; animation-delay: -7s; }
.bg-decoration .orb:nth-child(3) { width: 450px; height: 450px; background: #10b981; opacity: 0.10; top: 40%; left: 40%; animation-delay: -14s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -50px) scale(1.08); }
  66% { transform: translate(-30px, 30px) scale(0.92); }
}

/* === LOGIN PAGE === */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px; position: relative; z-index: 1;
}
.login-box {
  background: rgba(255,255,255,0.75); backdrop-filter: blur(24px);
  border-radius: var(--radius); padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,0.08);
  animation: slideUp 0.6s ease;
}
.login-box .logo { text-align: center; margin-bottom: 32px; }
.login-box .logo h1 {
  font-size: 2.4rem; font-weight: 900;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}
.login-box .logo p { color: var(--text-light); font-size: 0.95rem; margin-top: 4px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 2px solid #e5e7eb; font-size: 0.95rem; font-family: inherit;
  transition: border 0.3s, box-shadow 0.3s; background: rgba(255,255,255,0.8);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; font-family: inherit;
  cursor: pointer; border: none; transition: all 0.3s;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient1); color: white; width: 100%;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.4); }
.btn-secondary { background: rgba(255,255,255,0.7); color: var(--text); border: 2px solid rgba(99,102,241,0.15); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.05); }
.btn-danger { background: var(--gradient4); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

.toggle-link { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-light); }
.toggle-link a { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none; }
.toggle-link a:hover { text-decoration: underline; }

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

/* Sidebar */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(237,233,254,0.8) 100%);
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(99,102,241,0.1);
  padding: 24px 16px; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
  transition: transform 0.3s;
}
.sidebar .brand {
  font-size: 1.5rem; font-weight: 900; text-align: center; padding: 8px 0 24px;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.95rem; color: var(--text);
  text-decoration: none; transition: all 0.2s;
}
.sidebar nav a:hover { background: rgba(99,102,241,0.08); color: var(--primary); }
.sidebar nav a.active {
  background: var(--gradient1); color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.sidebar nav a .nav-icon { font-size: 1.2rem; width: 28px; text-align: center; }
.sidebar .user-info {
  padding: 16px; border-top: 1px solid rgba(99,102,241,0.1);
  display: flex; align-items: center; gap: 12px; margin-top: auto;
}
.sidebar .user-info .user-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gradient1);
  display: flex; align-items: center; justify-content: center; color: white;
  font-weight: 700; font-size: 1rem; overflow: hidden;
}
.sidebar .user-info .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .user-info .user-name { font-weight: 600; font-size: 0.9rem; }
.sidebar .user-info .logout-btn {
  margin-left: auto; cursor: pointer; color: var(--text-light);
  font-size: 1.2rem; transition: color 0.2s;
}
.sidebar .user-info .logout-btn:hover { color: var(--accent3); }

/* Main content */
.main { margin-left: 260px; flex: 1; padding: 32px; min-height: 100vh; }
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }
.page-title {
  font-size: 1.8rem; font-weight: 800; margin-bottom: 8px;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-subtitle { color: var(--text-light); font-size: 0.95rem; margin-bottom: 28px; }

/* Cards — glass effect with color */
.card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,0.08);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,0.2); }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; position: relative; z-index: 1; }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* KPI Cards — with colored backgrounds */
.kpi-card {
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(12px);
}
.kpi-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-lg); }
.kpi-card:nth-child(1) { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.08)); border: 1px solid rgba(99,102,241,0.15); }
.kpi-card:nth-child(2) { background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(249,115,22,0.08)); border: 1px solid rgba(245,158,11,0.15); }
.kpi-card:nth-child(3) { background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(52,211,153,0.08)); border: 1px solid rgba(16,185,129,0.15); }
.kpi-card:nth-child(4) { background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(249,115,22,0.08)); border: 1px solid rgba(239,68,68,0.15); }
.kpi-card::before {
  content: ''; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px;
  border-radius: 50%; opacity: 0.15;
}
.kpi-card:nth-child(1)::before { background: #6366f1; }
.kpi-card:nth-child(2)::before { background: #f59e0b; }
.kpi-card:nth-child(3)::before { background: #10b981; }
.kpi-card:nth-child(4)::before { background: #ef4444; }
.kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; position: relative; z-index: 1; }
.kpi-value { font-size: 2rem; font-weight: 900; margin: 4px 0; position: relative; z-index: 1; animation: countUp 0.5s ease forwards; }
.kpi-change { font-size: 0.85rem; font-weight: 600; position: relative; z-index: 1; }
.kpi-change.positive { color: var(--accent2); }
.kpi-change.negative { color: var(--accent3); }

/* Ranking */
.ranking-podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin-bottom: 32px; padding: 20px 0; }
.podium-item {
  text-align: center; padding: 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.3s;
  min-width: 140px; backdrop-filter: blur(12px);
}
.podium-item:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.podium-item.gold { order: 0; background: linear-gradient(135deg, #fef9c3, #fde68a, #fcd34d); border: 2px solid #f59e0b; box-shadow: 0 8px 32px rgba(245,158,11,0.25); }
.podium-item.silver { order: -1; background: linear-gradient(135deg, #f9fafb, #e5e7eb, #d1d5db); border: 2px solid #9ca3af; }
.podium-item.bronze { order: 1; background: linear-gradient(135deg, #fff7ed, #fed7aa, #fdba74); border: 2px solid #f97316; }
.podium-position { font-size: 2.5rem; font-weight: 900; }
.podium-name { font-weight: 700; font-size: 1rem; margin: 8px 0; }
.podium-stat { font-size: 0.85rem; color: var(--text-light); }
.podium-avatar {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 8px;
  background: var(--gradient1); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: white; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.podium-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Table — desktop */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; padding: 12px 16px; border-bottom: 2px solid rgba(99,102,241,0.1); }
td { padding: 14px 16px; border-bottom: 1px solid rgba(99,102,241,0.05); font-size: 0.95rem; }
tr:hover { background: rgba(99,102,241,0.04); }

/* === MOBILE CARDS for tables === */
.mobile-cards { display: none; }
.mobile-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,0.08);
  animation: cardEnter 0.4s ease both;
}
.mobile-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(99,102,241,0.08);
}
.mobile-card-title { font-weight: 800; font-size: 1rem; }
.mobile-card-badge {
  padding: 4px 12px; border-radius: 99px; font-size: 0.8rem; font-weight: 700;
}
.mobile-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.mobile-card-field {
  display: flex; flex-direction: column; gap: 2px;
}
.mobile-card-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.mobile-card-value {
  font-size: 0.95rem; font-weight: 600;
}
.mobile-card-actions {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(99,102,241,0.08);
  display: flex; justify-content: flex-end;
}

/* Ranking mobile card specific */
.rank-mobile-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,0.08);
  animation: cardEnter 0.4s ease both;
}
.rank-mobile-pos {
  font-size: 1.8rem; font-weight: 900; min-width: 40px; text-align: center;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rank-mobile-info { flex: 1; min-width: 0; }
.rank-mobile-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.rank-mobile-stats {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-light);
}
.rank-mobile-stats strong { color: var(--text); }
.rank-mobile-pct {
  font-size: 1.2rem; font-weight: 900; min-width: 60px; text-align: right;
}

/* Trophy */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.trophy-item {
  text-align: center; padding: 24px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,0.08); transition: transform 0.3s, box-shadow 0.3s;
}
.trophy-item:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.trophy-icon { font-size: 2.5rem; margin-bottom: 8px; }
.trophy-name { font-weight: 700; font-size: 0.9rem; }
.trophy-desc { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }
.trophy-locked { opacity: 0.3; filter: grayscale(1); }

/* Challenge card */
.challenge-card {
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
  margin-bottom: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.challenge-card:hover { transform: translateX(4px); box-shadow: var(--shadow-lg); }
.challenge-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.challenge-meta { font-size: 0.85rem; color: var(--text-light); margin-bottom: 16px; }
.progress-bar { height: 12px; background: rgba(99,102,241,0.08); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--gradient1); transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.progress-label { font-size: 0.8rem; color: var(--text-light); }

/* Photo gallery */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.photo-item {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1;
  box-shadow: var(--shadow); position: relative; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.photo-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .photo-date {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px 12px; background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white; font-size: 0.8rem; font-weight: 600;
}
.photo-item .photo-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(239,68,68,0.9); color: white; border: none;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: none; font-size: 0.9rem; align-items: center; justify-content: center;
}
.photo-item:hover .photo-delete { display: flex; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px);
  z-index: 999; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 32px;
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99,102,241,0.1);
  animation: slideUp 0.3s ease;
}
.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; color: white;
  animation: slideIn 0.3s ease; min-width: 280px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
}
.toast.success { background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(52,211,153,0.95)); }
.toast.error { background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(249,115,22,0.95)); }
.toast.info { background: linear-gradient(135deg, rgba(99,102,241,0.95), rgba(139,92,246,0.95)); }

/* Animations */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile */
.menu-toggle { display: none; position: fixed; top: 16px; left: 16px; z-index: 200; background: var(--gradient1); color: white; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; padding-top: 72px; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .ranking-podium { flex-direction: column; align-items: stretch; }
  .podium-item { order: unset !important; min-width: unset; }
  .login-box { padding: 32px 24px; }
  .dashboard-hero { padding: 24px 20px; }
  .hero-greeting { font-size: 1.4rem; }
  .quick-actions { gap: 8px; }
  .quick-action { padding: 8px 14px; font-size: 0.85rem; }
  .admin-user-card { flex-direction: column; text-align: center; }
  .admin-actions { justify-content: center; }
  .page-title { font-size: 1.4rem; }
  .page-subtitle { font-size: 0.85rem; margin-bottom: 16px; }

  /* Hide desktop tables, show mobile cards */
  .desktop-table { display: none !important; }
  .mobile-cards { display: block !important; }

  /* KPIs 2 columns on mobile */
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 1.4rem; }
  .kpi-label { font-size: 0.7rem; }
  .kpi-change { font-size: 0.75rem; }

  /* Charts stack */
  .chart-container { height: 220px; }

  /* Trophy grid */
  .trophy-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .trophy-item { padding: 16px 10px; }
  .trophy-icon { font-size: 2rem; }

  /* Photo grid 2 cols */
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Modal compact */
  .modal { padding: 24px 20px; }
  .modal-title { font-size: 1.1rem; }

  /* Cards less padding */
  .card { padding: 16px; }

  /* Toast smaller */
  .toast { min-width: unset; font-size: 0.85rem; padding: 12px 16px; }
  .toast-container { top: 12px; right: 12px; left: 12px; }

  /* Challenge card compact */
  .challenge-card { padding: 16px; }
}

/* Charts container */
.chart-container { position: relative; height: 300px; margin: 16px 0; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 1rem; }

/* Metric input grid */
.metric-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .metric-form-grid { grid-template-columns: 1fr; } }

/* === EPIC DASHBOARD HERO === */
.dashboard-hero {
  background: var(--gradient1);
  border-radius: var(--radius);
  padding: 32px 28px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(99,102,241,0.3);
  animation: slideUp 0.6s ease;
}
.dashboard-hero::before {
  content: '';
  position: absolute; top: -50%; right: -20%; width: 400px; height: 400px;
  background: rgba(255,255,255,0.1); border-radius: 50%;
  animation: float 15s infinite ease-in-out;
}
.dashboard-hero::after {
  content: '';
  position: absolute; bottom: -30%; left: -10%; width: 300px; height: 300px;
  background: rgba(255,255,255,0.06); border-radius: 50%;
  animation: float 20s infinite ease-in-out reverse;
}
.hero-content { position: relative; z-index: 1; }
.hero-greeting {
  font-size: 1.8rem; font-weight: 900; margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hero-motto { font-size: 1rem; font-weight: 500; opacity: 0.9; }

/* Quick actions */
.quick-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.quick-action {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 99px;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
  color: white; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s; text-decoration: none;
}
.quick-action:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Activity feed */
.activity-card {
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,0.08);
}
.activity-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(99,102,241,0.06);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.activity-icon.purple { background: rgba(99,102,241,0.15); }
.activity-icon.amber { background: rgba(245,158,11,0.15); }
.activity-icon.green { background: rgba(16,185,129,0.15); }
.activity-icon.red { background: rgba(239,68,68,0.15); }
.activity-text { font-size: 0.9rem; }
.activity-text strong { font-weight: 700; }
.activity-time { font-size: 0.8rem; color: var(--text-light); margin-top: 2px; }

/* Admin cards */
.admin-user-card {
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
  border: 1px solid rgba(99,102,241,0.08);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  transition: transform 0.2s;
}
.admin-user-card:hover { transform: translateX(4px); }
.admin-user-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--gradient1); display: flex; align-items: center;
  justify-content: center; color: white; font-weight: 800; font-size: 1.2rem;
  overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-info { flex: 1; min-width: 150px; }
.admin-user-name { font-weight: 700; font-size: 1rem; }
.admin-user-meta { font-size: 0.8rem; color: var(--text-light); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* === DYNAMISM === */

/* Animated gradient hero */
.dashboard-hero {
  background: linear-gradient(270deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
  background-size: 600% 600%;
  animation: heroGradient 8s ease infinite;
}
@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Staggered card entrance */
.kpi-card { animation: cardEnter 0.5s ease both; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.12s; }
.kpi-card:nth-child(3) { animation-delay: 0.19s; }
.kpi-card:nth-child(4) { animation-delay: 0.26s; }
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cards breathe on idle */
.kpi-card { animation: cardEnter 0.5s ease both, breathe 4s ease-in-out infinite 1s; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 4px 24px rgba(99,102,241,0.12); }
  50% { box-shadow: 0 6px 28px rgba(99,102,241,0.20); }
}

/* Activity items slide in */
.activity-item { animation: slideRight 0.4s ease both; }
.activity-item:nth-child(1) { animation-delay: 0.05s; }
.activity-item:nth-child(2) { animation-delay: 0.1s; }
.activity-item:nth-child(3) { animation-delay: 0.15s; }
.activity-item:nth-child(4) { animation-delay: 0.2s; }
.activity-item:nth-child(5) { animation-delay: 0.25s; }
@keyframes slideRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* Trophy bounce on hover */
.trophy-item:hover .trophy-icon { animation: trophyBounce 0.5s ease; }
@keyframes trophyBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3) rotate(-10deg); }
  60% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Podium entrance */
.podium-item { animation: podiumRise 0.6s ease both; }
.podium-item.gold { animation-delay: 0.2s; }
.podium-item.silver { animation-delay: 0.05s; }
.podium-item.bronze { animation-delay: 0.1s; }
@keyframes podiumRise {
  from { opacity: 0; transform: translateY(50px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.podium-item.gold { animation: podiumRise 0.6s ease 0.2s both, goldGlow 3s ease-in-out infinite 1s; }
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 8px 32px rgba(245,158,11,0.25); }
  50% { box-shadow: 0 8px 40px rgba(245,158,11,0.45), 0 0 60px rgba(245,158,11,0.15); }
}

/* Challenge cards slide in from left */
.challenge-card { animation: slideRight 0.4s ease both; }

/* Quick action pills pulse */
.quick-action { animation: pillPulse 3s ease-in-out infinite; }
.quick-action:nth-child(1) { animation-delay: 0s; }
.quick-action:nth-child(2) { animation-delay: 0.5s; }
.quick-action:nth-child(3) { animation-delay: 1s; }
.quick-action:nth-child(4) { animation-delay: 1.5s; }
@keyframes pillPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

/* Floating particles canvas */
#particles-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* Photo grid entrance */
.photo-item { animation: cardEnter 0.4s ease both; }
.photo-item:nth-child(1) { animation-delay: 0.05s; }
.photo-item:nth-child(2) { animation-delay: 0.1s; }
.photo-item:nth-child(3) { animation-delay: 0.15s; }
.photo-item:nth-child(4) { animation-delay: 0.2s; }

/* Sidebar active link shimmer */
.sidebar nav a.active {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
  background-size: 300% 100%;
  animation: sidebarShimmer 3s linear infinite;
}
@keyframes sidebarShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
