* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f7f5f2;
  color: #222;
  line-height: 1.4;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #2c3e50;
  color: #fff;
  flex-wrap: wrap;
  gap: .5rem;
}
header h1 { margin: 0; font-size: 1.4rem; }
.teacher-link {
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  padding: .4rem .8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
}
.teacher-link:hover { background: rgba(255,255,255,.15); }

.teacher-panel { background: #34495e; color: #fff; padding: 1rem 1.5rem; }
.teacher-panel.hidden { display: none; }
.teacher-panel input[type=password] {
  padding: .5rem; border-radius: 4px; border: none; margin-right: .5rem;
}
.teacher-panel button {
  margin: .3rem .5rem .3rem 0;
  padding: .55rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: #1abc9c;
  color: #fff;
  cursor: pointer;
  font-size: .9rem;
}
.teacher-panel button.danger { background: #e74c3c; }
.teacher-panel button:hover { opacity: .9; }
#teacherMsg { min-height: 1.2em; font-size: .9rem; }

main { max-width: 1000px; margin: 1.5rem auto; padding: 0 1rem; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.card h2 { margin-top: 0; }

form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
form input, form textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 400;
  font-family: inherit;
}
form button {
  background: #2c3e50; color: #fff; border: none;
  padding: .7rem 1.4rem; border-radius: 6px; font-size: 1rem; cursor: pointer;
}
form button:hover { background: #1a252f; }
#formMsg.success { color: #27ae60; font-weight: 600; }
#formMsg.error { color: #e74c3c; font-weight: 600; }
.hint { color: #666; font-size: .9rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: .6rem .5rem; text-align: left; border-bottom: 1px solid #eee; font-size: .9rem; vertical-align: middle; }
th { background: #f0efec; }
td a { color: #c0392b; font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

.vote-cell { white-space: nowrap; }
.vote-btn {
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  margin-right: .25rem;
  font-weight: 700;
  font-size: .95rem;
}
.vote-btn.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }
.vote-status { margin-left: .3rem; font-size: .9rem; }

.error { color: #e74c3c; font-weight: 600; }

.results-table td:first-child, .results-table th:first-child { font-weight: 700; }

footer { text-align: center; color: #999; font-size: .8rem; margin: 2rem 0; }
