@font-face {
  font-family: "Dana";
  src: url("font/ttf/Dana-FaNum-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dana";
  src: url("font/ttf/Dana-FaNum-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dana";
  src: url("font/ttf/Dana-FaNum-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dana";
  src: url("font/ttf/Dana-FaNum-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dana";
  src: url("font/ttf/Dana-FaNum-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --accent-400: #facc15;
  --accent-500: #eab308;
  --accent-600: #ca8a04;
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --gold: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  --gold-text: linear-gradient(135deg, #fbbf24, #f59e0b);
  --bg-main: #f5f5f7;
  --bg-soft: #fafafb;
  --surface: #ffffff;
  --text-primary: #111111;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-light: #e5e7eb;
  --border-soft: #eceef2;
  --gold-primary: #c9a227;
  --gold-light: #e5c76b;
  --gold-deep: #a8831f;
  --action-primary: #0f172a;
  --action-primary-hover: #111827;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --radius-input: 16px;
  --radius-button: 18px;
  --radius-card: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --font-fa: "Dana", IRANSans, "Segoe UI", Tahoma, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--neutral-50);
  color: var(--neutral-800);
  font-family: var(--font-fa);
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  background: linear-gradient(135deg, var(--neutral-900) 0%, #0c1a3a 50%, var(--primary-900) 100%);
  color: #fff;
  padding: 48px 24px 64px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(250, 204, 21, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(250, 204, 21, 0.4);
  border-radius: 50%;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10%,
  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent-400);
  border: 1px solid rgba(250, 204, 21, 0.3);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
  animation: fade-in-down 0.6s ease-out;
}

.hero__eyebrow svg {
  width: 16px;
  height: 16px;
}

.hero h1,
.admin-topbar h1,
.login-card h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1 {
  color: #fff;
  margin-bottom: 12px;
  animation: fade-in-down 0.6s ease-out 0.1s both;
}

.gold-text {
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  margin: 0 0 40px;
  max-width: none;
  color: var(--neutral-300);
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 400;
  animation: fade-in-down 0.6s ease-out 0.2s both;
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid,
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stats-grid {
  max-width: 900px;
  margin: 0 auto;
  animation: fade-in-down 0.6s ease-out 0.3s both;
}

.admin-kpis {
  margin-top: 24px;
}

.stat-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.hero .stat-card {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: none;
  transition: transform 0.3s, background 0.3s;
}

.hero .stat-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

.stat-card strong {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.1;
  font-weight: 900;
}

.hero .stat-card:nth-child(1) strong {
  color: var(--accent-400);
}

.hero .stat-card:nth-child(2) strong {
  color: #60a5fa;
}

.hero .stat-card:nth-child(3) strong {
  color: #34d399;
}

.hero .stat-card:nth-child(4) strong {
  color: #f472b6;
}

.admin-kpis .stat-card strong {
  color: var(--action-primary);
}

.stat-card span {
  color: var(--neutral-400);
  font-size: 13px;
  font-weight: 600;
}

.admin-kpis .stat-card span {
  color: var(--text-secondary);
}

.main-content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.filter-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
}

.filter-block {
  display: grid;
  gap: 10px;
}

.filter-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 40px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.pill:hover,
.pill.is-active {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: #fff;
}

.pill:active {
  transform: scale(0.98);
}

.results-toolbar {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.results-toolbar p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.results-toolbar strong {
  color: var(--action-primary);
}

.search-box {
  display: block;
}

.search-box input,
.form-grid input,
.form-grid select,
.filters-form input,
.filters-form select,
.row-edit input,
.embed-code {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text-primary);
  padding: 10px 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-box input:focus,
.form-grid input:focus,
.form-grid select:focus,
.filters-form input:focus,
.filters-form select:focus,
.row-edit input:focus,
.embed-code:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.12);
}

.year-section {
  margin-top: 24px;
}

.year-header {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.year-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.year-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.badge--gold {
  background: #fbf6e3;
  color: var(--gold-deep);
}

.badge--navy {
  background: #eef2ff;
  color: var(--action-primary);
}

.badge--green {
  background: #ecfdf5;
  color: #047857;
}

.students-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.student-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.student-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--border-light);
}

.student-card--single::before {
  background: var(--gold-primary);
}

.student-card--double::before {
  background: var(--action-primary);
}

.student-card--triple::before {
  background: var(--success);
}

.rank-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  border-radius: 16px;
  background: var(--action-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.student-card--single .rank-mark {
  background: #fbf6e3;
  color: var(--gold-deep);
}

.student-card--triple .rank-mark {
  background: #ecfdf5;
  color: #047857;
}

.student-body {
  min-width: 0;
}

.student-body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-body p,
.rank-text span {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.rank-text {
  text-align: left;
}

.rank-text strong {
  display: block;
  color: var(--action-primary);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: var(--accent-400);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  animation: fade-in-down 0.6s ease-out;
}

.hero-badge svg {
  width: 16px;
  height: 16px;
}

.hero-subtitle {
  font-size: clamp(16px, 3vw, 22px);
  color: var(--neutral-300);
  font-weight: 400;
  margin: 0 0 40px;
  animation: fade-in-down 0.6s ease-out 0.2s both;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  animation: fade-in-down 0.6s ease-out 0.3s both;
}

.stats-bar .stat-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.3s, background 0.3s;
  min-height: auto;
}

.stats-bar .stat-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

.stat-number {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stats-bar .stat-card:nth-child(1) .stat-number {
  color: var(--accent-400);
}

.stats-bar .stat-card:nth-child(2) .stat-number {
  color: #60a5fa;
}

.stats-bar .stat-card:nth-child(3) .stat-number {
  color: #34d399;
}

.stats-bar .stat-card:nth-child(4) .stat-number {
  color: #f472b6;
}

.stat-label {
  font-size: 13px;
  color: var(--neutral-400);
  font-weight: 500;
}

.main-content {
  max-width: 1200px;
  width: auto;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.admissions-section {
  margin: 0 0 34px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.admissions-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--neutral-100);
}

.admissions-header h2 {
  margin: 0;
  color: var(--neutral-800);
  font-size: 24px;
  line-height: 1.4;
  font-weight: 900;
}

.section-kicker {
  color: var(--gold-deep);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 900;
}

.admissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.admission-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 112px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 55%);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.admission-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--gold-primary);
}

.admission-mark {
  flex: 0 0 auto;
  min-width: 64px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--action-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.admission-body {
  min-width: 0;
}

.admission-body h3 {
  margin: 0;
  color: var(--neutral-800);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admission-body p {
  margin: 2px 0 0;
  color: var(--neutral-600);
  font-size: 13px;
  line-height: 1.8;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admission-body span {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-50);
  color: var(--gold-deep);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 800;
}

.filters-section {
  margin-bottom: 32px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-600);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label svg {
  width: 16px;
  height: 16px;
  color: var(--primary-500);
}

.year-pills,
.rank-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.year-pill {
  padding: 10px 20px;
  border-radius: 100px;
  border: 2px solid var(--neutral-200);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-600);
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}

.year-pill:hover {
  border-color: var(--primary-300);
  color: var(--primary-700);
  background: var(--primary-50);
}

.year-pill.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.year-pill-count {
  color: currentColor;
  font-size: 12px;
  opacity: 0.62;
}

.rank-pill {
  padding: 8px 16px;
  border-radius: 100px;
  border: 2px solid var(--neutral-200);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-600);
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}

.rank-pill:hover {
  border-color: var(--accent-500);
  color: var(--accent-600);
  background: var(--warning-50);
}

.rank-pill.active {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: var(--neutral-900);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.rank-pill .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  padding: 0 6px;
}

.rank-pill.active .count {
  background: rgba(0, 0, 0, 0.15);
}

.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.results-count {
  font-size: 15px;
  color: var(--neutral-500);
}

.results-count strong {
  color: var(--primary-600);
  font-weight: 700;
}

.search-box {
  position: relative;
}

.search-box input {
  padding: 10px 40px 10px 16px;
  border: 2px solid var(--neutral-200);
  border-radius: 100px;
  font-size: 14px;
  width: 220px;
  transition: all 0.25s;
  background: #fff;
  color: var(--neutral-800);
  min-height: auto;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  width: 260px;
}

.search-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--neutral-400);
  z-index: 1;
  pointer-events: none;
}

.year-section {
  margin: 0 0 40px;
  animation: fade-in 0.4s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.year-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--neutral-200);
}

.year-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--neutral-800);
  margin: 0;
}

.year-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

.year-badge.single {
  background: #fef3c7;
  color: #92400e;
}

.year-badge.double {
  background: #dbeafe;
  color: #1e40af;
}

.year-badge.triple {
  background: #d1fae5;
  color: #065f46;
}

.year-badge.other {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.year-stats {
  display: flex;
  gap: 16px;
  margin-right: auto;
  font-size: 13px;
  color: var(--neutral-500);
}

.year-stats span strong {
  color: var(--neutral-700);
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.student-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.25s;
  cursor: default;
  position: relative;
  overflow: hidden;
  min-height: auto;
  box-shadow: none;
}

.student-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 4px;
  height: 100%;
  border-radius: 0 12px 12px 0;
  transition: width 0.25s;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.student-card:hover::before {
  width: 6px;
}

.student-card.rank-single::before {
  background: var(--gold);
}

.student-card.rank-double::before {
  background: var(--primary-500);
}

.student-card.rank-triple::before {
  background: var(--success-500);
}

.student-card.rank-other::before {
  background: var(--neutral-300);
}

.student-card.rank-single {
  background: linear-gradient(135deg, #fffbeb 0%, #fff 40%);
  border-color: #fde68a;
}

.student-card.rank-double {
  background: linear-gradient(135deg, #eff6ff 0%, #fff 40%);
  border-color: #bfdbfe;
}

.student-card.rank-triple {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 40%);
  border-color: #bbf7d0;
}

.rank-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  position: relative;
}

.rank-single .rank-badge {
  background: var(--gold);
  color: #78350f;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.rank-double .rank-badge {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.rank-triple .rank-badge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.rank-other .rank-badge {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--neutral-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-field {
  font-size: 12px;
  color: var(--neutral-500);
  font-weight: 500;
  margin-top: 2px;
}

.student-rank-text {
  text-align: left;
  flex-shrink: 0;
}

.student-rank-text .rank-num {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.rank-single .rank-num {
  color: #b45309;
}

.rank-double .rank-num {
  color: var(--primary-700);
}

.rank-triple .rank-num {
  color: var(--success-700);
}

.rank-other .rank-num {
  color: var(--neutral-500);
}

.student-rank-text .rank-label {
  font-size: 10px;
  color: var(--neutral-400);
  font-weight: 600;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  color: var(--text-secondary);
}

.empty-state strong {
  color: var(--text-primary);
  font-size: 17px;
}

.empty-state--compact {
  padding: 24px 16px;
}

.content-view[hidden] {
  display: none;
}

.mode-pending-choice .content-view {
  display: none;
}

.is-refreshing .content-view {
  opacity: 0.58;
  pointer-events: none;
}

.entry-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.entry-modal.is-open {
  display: flex;
}

.entry-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
}

.entry-modal__panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
  text-align: right;
  animation: modal-in 220ms ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.entry-modal__kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #fbf6e3;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 900;
}

.entry-modal h2 {
  margin: 14px 0 8px;
  color: var(--neutral-900);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.45;
  font-weight: 900;
}

.entry-modal p {
  margin: 0;
  color: var(--neutral-600);
  font-size: 14px;
  line-height: 2;
  font-weight: 600;
}

.entry-modal__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.entry-choice {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--neutral-200);
  border-radius: 14px;
  background: var(--neutral-50);
  color: var(--neutral-800);
  text-align: right;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.entry-choice:hover {
  transform: translateY(-2px);
  border-color: var(--primary-300);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.entry-choice--primary {
  border-color: #fde68a;
  background: #fffbeb;
}

.entry-choice strong {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 900;
}

.entry-choice span {
  color: var(--neutral-500);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 700;
}

.view-switcher {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 180;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  max-width: calc(100vw - 112px);
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--action-primary);
  color: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.26);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.view-switcher:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.3);
}

.view-switcher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 15px;
}

.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 100;
}

.scroll-top.visible,
.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  background: var(--action-primary);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.site-footer strong {
  color: var(--gold-light);
}

.admin-shell,
.login-shell {
  min-height: 100vh;
  background: var(--bg-main);
}

.admin-topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 12px;
  display: grid;
  gap: 16px;
}

.admin-topbar h1,
.login-card h1 {
  color: var(--text-primary);
  font-size: 32px;
  line-height: 1.35;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions form {
  margin: 0;
}

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 48px;
}

.admin-kpis {
  margin: 16px 0;
}

.admin-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.panel,
.login-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 16px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 900;
}

.text-link {
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 900;
}

.soft-count {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.form-grid,
.filters-form,
.row-edit {
  display: grid;
  gap: 12px;
}

.form-grid label,
.filters-form label,
.row-edit label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 900;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button--primary {
  background: var(--action-primary);
  color: #fff;
}

.button--primary:hover {
  background: var(--action-primary-hover);
}

.button--soft {
  background: var(--bg-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.button--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.button--danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}

.notice {
  padding: 12px 14px;
  border-radius: 18px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 800;
}

.notice--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #d1fae5;
}

.notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}

.embed-code {
  min-height: 92px;
  direction: ltr;
  text-align: left;
  resize: vertical;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.settings-panel {
  margin: 16px 0;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.setting-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--bg-soft);
  cursor: pointer;
  user-select: none;
}

.setting-toggle > span:first-child {
  display: grid;
  gap: 2px;
}

.setting-toggle strong {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 900;
}

.setting-toggle small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
  font-weight: 700;
}

.setting-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-control {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: var(--neutral-300);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.toggle-control::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease;
}

.setting-toggle input:checked + .toggle-control {
  background: var(--action-primary);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}

.setting-toggle input:checked + .toggle-control::after {
  transform: translateX(-24px);
}

.setting-toggle:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.12);
}

.filters-form {
  margin-bottom: 14px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
}

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

.login-shell {
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(440px, 100%);
}

@media (min-width: 680px) {
  .hero {
    padding: 48px 24px 56px;
  }

  .hero h1,
  .admin-topbar h1,
  .login-card h1 {
    font-size: 36px;
  }

  .hero__subtitle {
    font-size: 17px;
  }

  .stats-grid,
  .admin-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .results-toolbar {
    grid-template-columns: 1fr 280px;
    align-items: center;
  }

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

  .year-header {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .admin-topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

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

  .filters-form {
    grid-template-columns: 1fr 160px 160px auto auto;
    align-items: end;
  }

  .settings-form {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .admission-form {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
  }
}

@media (min-width: 980px) {
  .students-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row-edit {
    grid-template-columns: minmax(220px, 1fr) 120px 120px auto;
    align-items: end;
  }

  .row-edit--admission {
    grid-template-columns: minmax(180px, 1fr) 110px minmax(160px, 1fr) minmax(160px, 1fr) auto;
  }

  .admin-row {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 32px 16px 48px;
  }

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

  .stats-bar .stat-card {
    padding: 16px 12px;
  }

  .stat-number {
    font-size: 28px;
  }

  .main-content {
    padding: 24px 12px 60px;
  }

  .admissions-section {
    padding: 16px;
    margin-bottom: 24px;
  }

  .admissions-header {
    display: grid;
    gap: 2px;
  }

  .admissions-header h2 {
    font-size: 21px;
  }

  .students-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .student-card {
    padding: 12px 14px;
  }

  .year-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .year-stats {
    margin-right: 0;
    width: 100%;
  }

  .results-info {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .search-box input,
  .search-box input:focus {
    width: 100%;
  }

  .rank-pills {
    gap: 6px;
  }

  .rank-pill {
    padding: 6px 12px;
    font-size: 12px;
  }

  .entry-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .entry-modal__panel {
    border-radius: 16px;
  }

  .entry-modal__actions {
    grid-template-columns: 1fr;
  }

  .entry-choice {
    min-height: 86px;
  }

  .view-switcher {
    right: 12px;
    bottom: 14px;
    min-height: 48px;
    max-width: calc(100vw - 84px);
    padding: 9px 13px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

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

  .year-pill {
    padding: 8px 14px;
    font-size: 13px;
  }
}
