:root {
  --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.5);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-light: rgba(59, 130, 246, 0.1);
  --orange: #f97316;
  --orange-light: rgba(249, 115, 22, 0.1);
  --green: #10b981;
  --green-light: rgba(16, 185, 129, 0.1);
  --radius: 24px;
  --shadow: 0 8px 32px rgba(30, 41, 59, 0.05);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #1e293b, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.last-sync {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: var(--shadow);
}

.icon-refresh {
  width: 16px;
  height: 16px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  grid-auto-rows: auto;
}

.bento-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(30, 41, 59, 0.08);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon.blue { background: var(--primary-light); color: var(--primary); }
.card-icon.orange { background: var(--orange-light); color: var(--orange); }
.card-icon.green { background: var(--green-light); color: var(--green); }

.card-content h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.card-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.table-card {
  grid-column: span 3;
  padding: 2rem;
}

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

.card-header h2 {
  font-size: 1.5rem;
}

.search-box {
  position: relative;
  width: 300px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.3s ease;
}

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

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(0,0,0,0.05);
}

td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.95rem;
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.student-info {
  display: flex;
  flex-direction: column;
}

.student-name {
  font-weight: 600;
  color: var(--text-main);
}

.student-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.excellent { background: var(--green-light); color: var(--green); }
.badge.good { background: var(--primary-light); color: var(--primary); }
.badge.poor { background: var(--orange-light); color: var(--orange); }

.rank-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: rgba(0,0,0,0.05);
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }

.btn-export {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--primary-light);
}

.btn-export:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.btn-export i {
  width: 18px;
  height: 18px;
}

/* Animations */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .table-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .table-card {
    grid-column: span 1;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .search-box {
    width: 100%;
  }
}
