:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --red: #dc2626;
  --green: #16a34a;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 900;
  font-size: 20px;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.year-select {
  display: flex;
  gap: 8px;
  align-items: center;
}

.container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 26px;
}

.grid {
  display: grid;
  gap: 18px;
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 16px 45px rgba(15,23,42,.06);
}

.hero {
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat strong {
  font-size: 34px;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.success { background: #dcfce7; color: var(--green); }
.danger-badge { background: #fee2e2; color: var(--red); }

input, select, textarea, button {
  font: inherit;
  border-radius: 13px;
  padding: 11px 12px;
}

input, select, textarea {
  border: 1px solid #cbd5e1;
  width: 100%;
  background: white;
}

button, .btn {
  border: 0;
  background: var(--blue);
  color: white;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 11px 14px;
}

.btn-light {
  background: #eef2ff;
  color: #3730a3;
}

.btn-danger {
  background: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.lesson-content {
  max-width: 520px;
  white-space: pre-wrap;
}

pre {
  background: #f1f5f9;
  border-radius: 16px;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 390px;
}

@media (max-width: 850px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
  }
}