* {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: 'Inter', Arial, sans-serif;
	background: radial-gradient(circle at top left, #1d1d33 0%, #0f0f1a 45%, #0a0a14 100%);
	color: #e5e7eb;
	min-height: 100vh;
}

.container {
	width: min(900px, 92%);
	margin: 2rem auto;
	display: grid;
	gap: 1rem;
}

.page-header {
	text-align: center;
	margin-bottom: 0.5rem;
}

.page-header h1 {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 800;
}

.page-header p {
	margin: 0.4rem 0 0;
	color: #a5b4fc;
}

.card {
	background: rgba(24, 24, 40, 0.72);
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 14px;
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.form-card {
	padding: 1rem;
}

.student-form {
	display: grid;
	grid-template-columns: 1.8fr 1fr auto;
	gap: 0.75rem;
}

input,
button {
	font: inherit;
}

input {
	border-radius: 10px;
	border: 1px solid rgba(148, 163, 184, 0.4);
	background: rgba(15, 23, 42, 0.7);
	color: #f9fafb;
	padding: 0.72rem 0.8rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
	outline: none;
	border-color: #60a5fa;
	box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

button {
	border: none;
	border-radius: 10px;
	padding: 0.72rem 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
	transform: translateY(-1px);
}

button:active {
	transform: translateY(0);
}

#add-btn {
	background: linear-gradient(135deg, #2563eb, #7c3aed);
	color: #ffffff;
	box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.secondary-btn {
	background: transparent;
	color: #dbeafe;
	border: 1px solid rgba(148, 163, 184, 0.45);
}

.secondary-btn:hover {
	background: rgba(51, 65, 85, 0.35);
}

.action-bar {
	display: flex;
	justify-content: flex-end;
	gap: 0.6rem;
}

.form-message {
	min-height: 1.15rem;
	margin: 0.6rem 0 0;
	color: #fda4af;
	font-size: 0.9rem;
}

.stats-panel {
	padding: 0.95rem 1rem;
	backdrop-filter: blur(10px);
	background: rgba(17, 25, 40, 0.6);
}

.quicksort-panel {
	padding: 0.95rem 1rem;
	background: rgba(15, 23, 42, 0.62);
}

.quick-title {
	margin: 0;
	font-size: 0.98rem;
	color: #c7d2fe;
	font-weight: 700;
}

.quick-subtitle {
	margin: 0.25rem 0 0.75rem;
	color: #94a3b8;
	font-size: 0.85rem;
}

.quick-list {
	display: grid;
	gap: 0.55rem;
}

.quick-controls {
	display: flex;
	gap: 0.6rem;
	margin: 0.1rem 0 0.75rem;
}

.quick-nav-btn {
	background: rgba(59, 130, 246, 0.18);
	color: #dbeafe;
	border: 1px solid rgba(96, 165, 250, 0.38);
	padding: 0.45rem 0.75rem;
	border-radius: 8px;
	font-size: 0.85rem;
}

.quick-nav-btn:hover {
	background: rgba(59, 130, 246, 0.3);
}

.quick-play-btn {
	background: rgba(34, 197, 94, 0.2);
	border-color: rgba(74, 222, 128, 0.5);
	color: #dcfce7;
}

.quick-play-btn:hover {
	background: rgba(34, 197, 94, 0.32);
}

.quick-nav-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

.quick-step {
	border: 1px solid rgba(148, 163, 184, 0.18);
	border-radius: 10px;
	padding: 0.6rem;
	background: rgba(30, 41, 59, 0.34);
}

.quick-step-active {
	border-color: rgba(96, 165, 250, 0.45);
	box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2) inset;
}

.quick-step-head {
	font-size: 0.84rem;
	color: #bfdbfe;
	margin: 0 0 0.2rem;
	font-weight: 600;
}

.quick-step-body {
	font-size: 0.82rem;
	color: #d1d5db;
	line-height: 1.4;
	margin: 0;
}

.quick-empty {
	margin: 0;
	font-size: 0.88rem;
	color: #94a3b8;
	font-style: italic;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(120px, 1fr));
	gap: 0.7rem;
}

.stat-item {
	background: rgba(30, 41, 59, 0.5);
	border-radius: 10px;
	padding: 0.65rem;
	border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-label {
	display: block;
	color: #cbd5e1;
	font-size: 0.8rem;
	margin-bottom: 0.2rem;
}

.stat-value {
	font-weight: 700;
	color: #f8fafc;
}

.table-card {
	overflow: hidden;
}

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

table {
	width: 100%;
	border-collapse: collapse;
	min-width: 540px;
}

th,
td {
	text-align: left;
	padding: 0.8rem;
}

thead {
	background: rgba(51, 65, 85, 0.5);
}

tbody tr {
	border-top: 1px solid rgba(148, 163, 184, 0.18);
	animation: fadeInRow 0.35s ease;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

tbody tr:nth-child(even) {
	background: rgba(30, 41, 59, 0.3);
}

tbody tr:hover {
	background: rgba(51, 65, 85, 0.45);
	transform: translateY(-1px);
}

.grade-pill {
	display: inline-block;
	border-radius: 999px;
	padding: 0.2rem 0.55rem;
	font-weight: 700;
	font-size: 0.8rem;
	color: #0f172a;
}

.grade-1 {
	background: #22c55e;
}

.grade-2-1 {
	background: #3b82f6;
}

.grade-2-2 {
	background: #f59e0b;
}

.grade-p {
	background: #f97316;
}

.grade-f {
	background: #ef4444;
}

.delete-btn {
	background: rgba(239, 68, 68, 0.2);
	color: #fecaca;
	border: 1px solid rgba(239, 68, 68, 0.45);
	padding: 0.38rem 0.52rem;
	border-radius: 8px;
	font-size: 0.85rem;
}

.delete-btn:hover {
	background: rgba(239, 68, 68, 0.35);
}

.empty-row {
	text-align: center;
	color: #94a3b8;
	font-style: italic;
}

.page-footer {
	text-align: center;
	color: #94a3b8;
	font-size: 0.9rem;
	margin-top: 0.3rem;
}

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

@media (max-width: 760px) {
	.container {
		margin: 1.2rem auto;
	}

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

	.action-bar {
		justify-content: stretch;
	}

	.secondary-btn {
		flex: 1;
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}
}
