body {
  font-family: Arial, sans-serif;
  background: #f8f8f8;
  margin: 0;
  padding: 0;
  font-size: 18px;
}
.container {
  max-width: 700px;
  margin: 30px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #ccc;
  padding: 24px 32px;
}
h1 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 16px;
}
form label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
}
form input, form select, form textarea {
  width: 100%;
  padding: 8px;
  font-size: 1em;
  margin-top: 4px;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-sizing: border-box;
}
form textarea {
  min-height: 48px;
}
fieldset {
  border: 2px solid #0074d9;
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 12px 16px;
}
legend {
  font-size: 1.1em;
  font-weight: bold;
  color: #0074d9;
}
button {
  font-size: 1em;
  padding: 8px 14px;
  margin-top: 14px;
  margin-right: 8px;
  background: #0074d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
button:hover {
  background: #005fa3;
}
button#viewStudentsBtn {
  background: #2ecc40;
}
button:disabled {
  background: #aaa;
  cursor: not-allowed;
}
#formMessage {
  margin-top: 18px;
  font-size: 1.1em;
  color: #d8000c;
}
.autocomplete-list {
  position: absolute;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  z-index: 10;
  max-height: 120px;
  overflow-y: auto;
  width: 96%;
}
.autocomplete-list div {
  padding: 8px;
  cursor: pointer;
}
.autocomplete-list div:hover {
  background: #e6f7ff;
}
/* Card view for mobile */
@media (max-width: 800px) {
  .container {
    max-width: 100vw;
    padding: 6px 1vw;
  }
  h1 {
    font-size: 1.1em;
  }
  form label, legend {
    font-size: 0.95em;
  }
  #studentList table {
    display: none;
  }
  .student-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px #ccc;
    margin-bottom: 16px;
    padding: 12px 10px;
    font-size: 0.98em;
  }
  .student-card .card-row {
    margin-bottom: 4px;
  }
  .student-card .card-label {
    font-weight: bold;
    color: #0074d9;
    display: inline-block;
    min-width: 120px;
  }
  .student-card .card-actions {
    margin-top: 8px;
  }
  button, .nav-sticky button {
    font-size: 0.98em;
    padding: 8px 10px;
    margin: 6px 4px 0 0;
  }
  .nav-sticky {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    box-shadow: 0 -2px 8px #ccc;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
  }
}
/* Desktop/tablet: show table, hide cards, nav at top */
@media (min-width: 801px) {
  .student-card { display: none; }
  .nav-sticky {
    position: static;
    box-shadow: none;
    background: none;
    display: flex;
    justify-content: flex-end;
    padding: 0;
    margin-bottom: 10px;
  }
  .nav-sticky button {
    margin: 0 0 0 10px;
    font-size: 1em;
    padding: 8px 14px;
  }
}