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

:root {
  /* Colors */
  --bg-dark: #070913;
  --bg-card: #0f132a;
  --bg-glass: rgba(15, 19, 42, 0.65);
  --border-glass: rgba(14, 104, 176, 0.2);
  --border-active: rgba(0, 240, 255, 0.4);
  
  --primary: #0e68b0;
  --primary-glow: rgba(14, 104, 176, 0.4);
  --secondary: #4457ff;
  --secondary-glow: rgba(68, 87, 255, 0.4);
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.3);
  --purple: #9c27b0;
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.3);
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 80px;
  
  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(14, 104, 176, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(68, 87, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(14, 104, 176, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.5);
}

/* Sidebar Navigation */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-text h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.7rem;
  color: var(--cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.nav-link i {
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
}

.nav-link:hover, .nav-item.active .nav-link {
  color: var(--text-primary);
  background: rgba(14, 104, 176, 0.15);
  border-color: var(--border-glass);
}

.nav-item.active .nav-link {
  border-color: var(--primary);
  box-shadow: inset 0 0 10px rgba(14, 104, 176, 0.1);
}

.nav-item.active .nav-link i {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
}

.powered-by {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.powered-by a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Main Content Wrapper */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: calc(100% - var(--sidebar-width));
}

/* Top Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.5rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(14, 104, 176, 0.35);
  box-shadow: 0 15px 35px rgba(14, 104, 176, 0.05);
}

/* KPI Dashboard Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(14, 104, 176, 0.15);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--cyan);
  flex-shrink: 0;
}

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

.kpi-card.list-card {
  align-items: flex-start;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
}

.kpi-card.list-card::before {
  background: linear-gradient(to bottom, var(--secondary), var(--cyan));
}

.kpi-list {
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kpi-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi-list-item:last-child {
  border-bottom: none;
}

.kpi-list-item .item-name {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.kpi-list-item .item-val {
  color: var(--cyan);
  font-weight: 700;
  font-family: var(--font-display);
}

.kpi-list-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0;
  width: 100%;
  line-height: 1.6;
}

.kpi-track-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
  width: 100%;
}

.kpi-track-bar-row .track-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-track-bar-row .track-value {
  color: var(--cyan);
  font-weight: 700;
  font-family: var(--font-display);
}

.kpi-track-progress-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.4rem;
  width: 100%;
}

.kpi-track-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--secondary));
  border-radius: 10px;
  width: 0%;
  transition: width 1s ease-out;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0.1rem 0;
  background: linear-gradient(to right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-change {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.kpi-change.up { color: #10b981; }
.kpi-change.down { color: #ef4444; }

/* Grid Sections */
.analytics-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .analytics-section {
    grid-template-columns: 1fr;
  }
}

.chart-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}

.charts-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(14, 104, 176, 0.1);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.chart-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chart-tab-btn.active {
  background: var(--primary);
  color: var(--text-primary);
}

/* Secondary Analytics (Distribution Cards) */
.dist-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.dist-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dist-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

/* Custom Interactive Progress Bar */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.progress-name {
  font-weight: 600;
}

.progress-val {
  color: var(--cyan);
  font-weight: 700;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Leaderboard Section controls */
.leaderboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.leaderboard-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.leaderboard-title h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.toggle-group {
  display: flex;
  background: rgba(14, 104, 176, 0.1);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-btn.active {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(14, 104, 176, 0.3);
}

/* Filter Controls bar */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(15, 19, 42, 0.3);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.filter-select {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
}

.filter-select:focus {
  border-color: var(--cyan);
}

.auto-sort-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(14, 104, 176, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.auto-sort-container input {
  display: none;
}

.checkbox-visual {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-glass);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.auto-sort-container input:checked + .checkbox-visual {
  background: var(--cyan);
  border-color: var(--cyan);
}

.auto-sort-container input:checked + .checkbox-visual::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 9px;
  color: var(--bg-dark);
}

.auto-sort-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auto-sort-container input:checked ~ .auto-sort-label {
  color: var(--text-primary);
}

.btn-export {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-export:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

/* Leaderboard Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.leaderboard-table th {
  padding: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-glass);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.leaderboard-table th:hover {
  color: var(--text-primary);
  background: rgba(14, 104, 176, 0.05);
}

.leaderboard-table th.sorted-asc::after {
  content: ' ▴';
  color: var(--cyan);
}

.leaderboard-table th.sorted-desc::after {
  content: ' ▾';
  color: var(--cyan);
}

.leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
  transition: var(--transition-smooth);
}

.leaderboard-table tbody tr {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.leaderboard-table tbody tr:hover {
  background: rgba(14, 104, 176, 0.05);
}

/* Rank column styling */
.rank-col {
  width: 70px;
  text-align: center;
}

.rank-badge-ui {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  margin: 0 auto;
}

.rank-badge-ui.gold {
  background: linear-gradient(135deg, #ffd700, #b8860b);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.rank-badge-ui.silver {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #000;
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.2);
}

.rank-badge-ui.bronze {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  color: #fff;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.2);
}

.rank-badge-ui.other {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.school-name-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.school-meta-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pill.board-cbse { background: rgba(14, 104, 176, 0.15); color: var(--cyan); border: 1px solid rgba(14, 104, 176, 0.3); }
.badge-pill.board-icse { background: rgba(156, 39, 176, 0.15); color: #e040fb; border: 1px solid rgba(156, 39, 176, 0.3); }
.badge-pill.board-state { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pill.board-matric { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.growth-indicator {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.growth-indicator.positive { color: #10b981; }
.growth-indicator.negative { color: #ef4444; }

.score-badge {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  color: var(--cyan);
  text-align: center;
}

/* Pagination UI */
.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

.page-btn {
  background: rgba(14, 104, 176, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.page-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
}

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

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* School Detail Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-glass);
  width: 90%;
  max-width: 750px;
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 240, 255, 0.1);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-title h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.modal-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.modal-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 580px) {
  .modal-stats-row {
    grid-template-columns: 1fr;
  }
}

.modal-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.modal-stat-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan);
}

.modal-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 0.25rem;
  font-weight: 600;
}

.modal-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 650px) {
  .modal-charts-grid {
    grid-template-columns: 1fr;
  }
}

.modal-chart-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-chart-box h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.modal-chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

.subjects-scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.score-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.score-bar-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 60%;
}

.score-bar-bg {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  width: 0%;
  transition: width 1s ease;
}

.score-num {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 50px;
  text-align: right;
}

/* Footer Section */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-footer-left {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-footer-right {
  display: flex;
  gap: 1.5rem;
}

.app-footer-right a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.app-footer-right a:hover {
  color: var(--cyan);
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    padding: 1.5rem 0.5rem;
    align-items: center;
  }
  
  .brand-text, .powered-by, .nav-link span {
    display: none;
  }
  
  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .nav-link {
    justify-content: center;
    padding: 0.85rem 0;
    width: 44px;
    height: 44px;
  }
  
  .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
    padding: 1rem;
  }
  
  .header-actions {
    display: none;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
  }
}

/* --- CIAC 2026 Enhanced UI Styles: Logos, Photos, and Winners --- */

/* School Logo & Student Avatar Styles in Tables */
.avatar-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.school-logo-container, .student-avatar-container {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(14, 104, 176, 0.15);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.school-logo-container img, .student-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-logo-fallback, .student-avatar-fallback {
  font-size: 1rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-weight: 700;
}

.student-avatar-fallback i {
  font-size: 0.95rem;
}

/* Winners Page Layout */
.winners-view-container {
  margin-top: 2rem;
  animation: fadeIn 0.4s ease-out;
}

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

/* Student Podium Layout */
.winners-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  min-height: 420px;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.podium-step {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: var(--transition-smooth);
  text-align: center;
}

.podium-step:hover {
  transform: translateY(-8px);
}

.podium-step.second-place {
  height: 350px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--silver);
  box-shadow: 0 4px 25px rgba(226, 232, 240, 0.1);
  order: 1;
}

.podium-step.first-place {
  height: 400px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 2px solid var(--gold);
  box-shadow: 0 8px 35px var(--gold-glow);
  order: 2;
}

.podium-step.third-place {
  height: 310px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--bronze);
  box-shadow: 0 4px 25px rgba(205, 127, 50, 0.1);
  order: 3;
}

/* responsive ordering for mobile */
@media (max-width: 680px) {
  .winners-podium {
    flex-direction: column;
    align-items: center;
    min-height: auto;
  }
  .podium-step {
    order: unset !important;
    height: auto !important;
    width: 100%;
    max-width: 320px;
  }
}

.podium-rank-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  margin-top: 1rem;
}

.first-place .podium-rank-label { color: var(--gold); }
.second-place .podium-rank-label { color: var(--silver); }
.third-place .podium-rank-label { color: var(--bronze); }

.podium-avatar-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin-top: -3.5rem;
  background: #1e293b;
  border: 4px solid #1e293b;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.first-place .podium-avatar-box { border-color: var(--gold); width: 100px; height: 100px; margin-top: -4rem; }
.second-place .podium-avatar-box { border-color: var(--silver); }
.third-place .podium-avatar-box { border-color: var(--bronze); }

.podium-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crown-icon {
  position: absolute;
  top: -6rem;
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
  animation: float 2s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.podium-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0.75rem 0 0.25rem;
  color: var(--text-primary);
}

.podium-school {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: auto;
  max-width: 90%;
}

.podium-score {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.15);
  color: var(--cyan);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  margin-top: 1rem;
  font-family: var(--font-display);
}

.podium-cash-badge {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.35rem;
}

/* Zone Winners Grid */
.winners-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.zone-winner-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.zone-winner-card:hover {
  border-color: rgba(14, 104, 176, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.zone-winner-header {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.zone-winner-header h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1rem;
}

.zone-winner-date {
  font-size: 0.7rem;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 600;
}

.zone-award-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.zone-award-row.winner {
  border-bottom: 1px dashed rgba(255,255,255,0.03);
  padding-bottom: 0.65rem;
  margin-bottom: 0.4rem;
}

.zone-award-badge {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.zone-award-info {
  display: flex;
  flex-direction: column;
}

.zone-award-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.zone-award-school {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* School Awards */
.school-awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.school-award-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  transition: var(--transition-smooth);
}

.school-award-card:hover {
  border-color: rgba(14, 104, 176, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(14, 104, 176, 0.08);
}

.school-award-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.school-award-card:nth-child(2) .school-award-icon {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--cyan);
}

.school-award-card:nth-child(3) .school-award-icon {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.school-award-card:nth-child(4) .school-award-icon {
  background: rgba(68, 87, 255, 0.1);
  border-color: rgba(68, 87, 255, 0.3);
  color: var(--secondary);
}

.school-award-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.school-award-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.school-award-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.school-award-winner {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

