:root {
  --primary: #E11D2E;
  --primary-dark: #B91C2B;
  --primary-light: #FEE2E2;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --border: #E2E8F0;
  --green: #16A34A;
  --amber: #D97706;
  --red: #D97706;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Navigation */

nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

nav > a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

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

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { background: var(--primary-light); color: var(--primary-dark); }

.nav-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

.nav-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.lang-switcher { display: flex; gap: 2px; background: var(--bg); border-radius: 999px; padding: 3px; }
.lang-switcher button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switcher button.active { background: var(--primary); color: #fff; }
.lang-switcher button:not(.active):hover { color: var(--primary); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-user-info { font-size: 13px; color: var(--text); line-height: 1.3; }
.nav-user-info .role { color: var(--muted); font-weight: 400; }

/* Layout */

.container {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 16px;
}

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

a.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-hover); }

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

.grid .card { margin-bottom: 0; }

/* Hero / stat block */

.hero {
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
}

.hero .hero-label { font-size: 13px; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.hero .hero-value { font-size: 52px; font-weight: 800; line-height: 1; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

.btn:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-secondary:hover { background: var(--bg); border-color: var(--muted); }

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  width: auto;
  margin: 0;
}

/* Tables */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

/* Badges */

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-graded { background: #DCFCE7; color: var(--green); }
.badge-submitted { background: #FEF3C7; color: var(--amber); }
.badge-none { background: #F1F5F9; color: var(--muted); }

/* Messages / alerts */

.messages { list-style: none; padding: 0; }
.messages li {
  background: #DCFCE7;
  color: #15803D;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 500;
}

/* Forms */

input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

label { font-weight: 600; font-size: 13px; color: var(--text); }

.errorlist { color: var(--red); list-style: none; padding: 0; margin: -8px 0 12px; font-size: 13px; }

/* Empty state */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

/* Responsive */

@media (max-width: 720px) {
  nav { padding: 12px 16px; }
  .nav-links { order: 3; width: 100%; justify-content: flex-start; gap: 2px; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .container { margin: 20px auto; }
  h1 { font-size: 22px; }
  .hero .hero-value { font-size: 40px; }
}
