.student-entry-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
}

.student-entry-panel label,
.student-session-label,
.save-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.student-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.student-entry-row.session-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-session {
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.compact-session label {
  font-size: 12px;
}

.compact-session .student-entry-row {
  gap: 7px;
}

.compact-session .student-entry-row input {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
}

.compact-session .teacher-link {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
}

.compact-session p {
  font-size: 11px;
}

.student-entry-row input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #cdd9ea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.student-entry-row input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 87, 166, 0.16);
}

.teacher-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border: 2px solid rgba(21, 154, 143, 0.25);
  border-radius: 8px;
  background: #f2fbfa;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.logout-button {
  font: inherit;
}

.login-subtle {
  margin: 2px 0 0;
  color: rgba(105, 115, 134, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.login-subtle.warning {
  color: var(--red);
}

.login-subtle.ready {
  color: rgba(31, 157, 98, 0.82);
}

.header-logout-button,
.header-account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: 40px;
  border: 0;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}

.header-logout-button:hover,
.header-account-button:hover {
  background: #31405a;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-page .app-header {
  flex-wrap: wrap;
}

.dashboard-page .app-header > div:first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.dashboard-page .admin-header-actions {
  flex: 0 0 auto;
  gap: 6px;
}

.dashboard-page .admin-header-actions .teacher-link {
  min-height: 34px;
  padding: 6px 9px;
  border-width: 1px;
  font-size: 12px;
  line-height: 1;
}

.auth-page {
  overflow: visible;
}

.auth-page .app-header {
  gap: 10px;
}

.auth-page .app-header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-page .app-header h1 {
  white-space: nowrap;
}

.auth-page .app-header .teacher-link {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
  border-width: 1px;
  font-size: 12px;
  line-height: 1;
}

.auth-screen {
  padding: 28px 24px 30px;
}

.auth-form {
  display: grid;
  gap: 14px;
  width: min(100%, 500px);
  margin: 0 auto;
  text-align: left;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #cdd9ea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 87, 166, 0.16);
}

.form-field input[readonly] {
  background: #f5f8fc;
  color: var(--muted);
}

.form-field input.invalid {
  border-color: var(--red);
  background: #fff8f8;
}

.form-help,
.form-warning,
.auth-message {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

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

.form-warning,
.auth-message.error {
  color: var(--red);
}

.auth-message.success {
  color: var(--green);
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.auth-actions .primary-button,
.auth-actions .secondary-button {
  min-width: 160px;
}

.account-summary {
  display: grid;
  gap: 4px;
  width: min(100%, 500px);
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  text-align: left;
}

.account-summary strong {
  color: var(--blue);
  font-size: 20px;
}

.account-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.account-settings-grid {
  display: grid;
  gap: 14px;
  width: min(100%, 560px);
  margin: 0 auto;
}

.settings-card {
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.settings-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.date-select-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.issued-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(31, 157, 98, 0.28);
  border-radius: 8px;
  background: #f4fbf6;
  color: var(--ink);
}

.issued-box strong {
  color: var(--green);
  font-size: 15px;
}

.issued-box span {
  font-weight: 900;
}

.student-entry-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-entry-panel p.warning,
.save-status.warning {
  color: var(--red);
}

.student-entry-panel p.ready,
.save-status.saved {
  color: var(--green);
}

.student-session-label {
  margin: -2px auto 10px;
}

.save-status {
  width: min(100%, 420px);
  margin: -6px auto 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.data-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.quiet-admin-link {
  display: inline-flex;
  margin: 0 0 14px 16px;
  color: rgba(105, 115, 134, 0.72);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.quiet-admin-link:hover {
  color: var(--teal);
  text-decoration: underline;
}

.dashboard-page {
  text-align: left;
}

.dashboard-shell {
  width: min(100%, 1120px);
}

.dashboard-page.quiz-panel {
  overflow: visible;
}

.dashboard-page .dashboard-screen {
  overflow-x: visible;
}

.dashboard-page .app-header a {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-card {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  text-align: center;
}

.admin-card span,
.admin-panel h2,
.admin-panel th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-card strong {
  color: var(--blue);
  font-size: 26px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.admin-panel {
  min-width: 0;
  padding: 14px;
}

.admin-panel h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
}

.admin-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.admin-panel-head h2 {
  margin: 0;
}

.admin-filter {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-filter select {
  min-height: 34px;
  padding: 6px 28px 6px 9px;
  border: 1px solid #cdd9ea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

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

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

.student-summary-table {
  min-width: 1280px;
}

.student-manager-table {
  min-width: 1160px;
}

.admin-table th,
.admin-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.admin-table td:last-child,
.admin-table th:last-child {
  text-align: right;
}

.sortable-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.sortable-button::after {
  content: "";
  width: 0;
  height: 0;
  opacity: 0.45;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.sortable-button.active[data-direction="asc"]::after {
  border-top: 0;
  border-bottom: 5px solid currentColor;
}

.sortable-button.active {
  color: var(--blue);
}

.student-manager-row input,
.student-manager-row select {
  width: 100%;
  min-width: 92px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #cdd9ea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.student-manager-row input[data-field="school_name"] {
  min-width: 150px;
}

.row-actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.mini-button {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(36, 87, 166, 0.18);
  border-radius: 8px;
  background: #f4f9ff;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.mini-button.reset-button {
  border-color: rgba(21, 154, 143, 0.22);
  background: #f2fbfa;
  color: var(--teal);
}

.mini-button.danger-button {
  border-color: rgba(199, 72, 72, 0.24);
  background: #fff7f7;
  color: var(--red);
}

.weak-list,
.bar-chart {
  display: grid;
  gap: 8px;
}

.weak-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.weak-item strong {
  color: var(--ink);
}

.weak-item span {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px 1fr 44px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.dashboard-message {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

@media (max-width: 720px) {
  .dashboard-shell {
    width: min(100%, 760px);
  }

  .dashboard-page.quiz-panel {
    overflow: hidden;
  }

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

  .student-entry-row.session-row {
    grid-template-columns: 1fr;
  }

  .compact-session .student-entry-row.session-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .teacher-link {
    width: 100%;
  }

  .auth-page .app-header {
    align-items: center;
  }

  .auth-page .app-header .teacher-link {
    width: auto;
    max-width: 112px;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .compact-session .teacher-link {
    width: auto;
  }

  .admin-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-header-actions a,
  .admin-header-actions button {
    flex: 1 1 120px;
  }

  .dashboard-page .admin-header-actions {
    width: auto;
    justify-content: flex-end;
  }

  .dashboard-page .admin-header-actions a,
  .dashboard-page .admin-header-actions button {
    flex: 0 0 auto;
  }

  .auth-actions .primary-button,
  .auth-actions .secondary-button {
    width: 100%;
  }

  .quiet-admin-link {
    margin-left: 14px;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }
}
