.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.035);
}
.data-table { min-width: 900px; font-size: 0.86rem; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F9FAFC;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #FAFCFA; }
.sticky-col { position: sticky; left: 0; z-index: 3; background: inherit; }
.sticky-col-2 { position: sticky; left: 92px; z-index: 3; background: inherit; }
.sticky-col-3 { position: sticky; left: 245px; z-index: 3; background: inherit; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.pagination button { border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 8px; min-width: 34px; height: 34px; font-weight: 700; }
.pagination button.active { background: var(--green); border-color: var(--green); color: #fff; }
.empty-state { padding: 38px; text-align: center; color: var(--muted); }
.status-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 850;
}
.status-circle.p { background: var(--light-green); color: var(--green); }
.status-circle.a { background: var(--light-red); color: var(--error); }
.status-circle.l { background: var(--light-orange); color: #9a5b00; }
.status-circle.lv { background: var(--light-purple); color: #6931a3; }
.mark-input { width: 92px; min-height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.student-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.student-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--light-green);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}
.class-results-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 0.76rem;
}
.class-results-table th,
.class-results-table td {
  padding: 8px 6px;
  white-space: normal;
  line-height: 1.18;
}
.class-results-table th { font-size: 0.68rem; }
.class-results-table .sticky-col,
.class-results-table .sticky-col-2,
.class-results-table .sticky-col-3 {
  position: static;
}
.class-results-table th:nth-child(1),
.class-results-table td:nth-child(1) { width: 38px; }
.class-results-table th:nth-child(2),
.class-results-table td:nth-child(2) { width: 70px; }
.class-results-table th:nth-child(3),
.class-results-table td:nth-child(3) { width: 132px; }
.class-results-table th:nth-child(4),
.class-results-table td:nth-child(4) { width: 118px; }
.class-results-table th:nth-child(n+5):nth-child(-n+13),
.class-results-table td:nth-child(n+5):nth-child(-n+13) { width: 72px; text-align: center; }
.class-results-table th:nth-child(n+14),
.class-results-table td:nth-child(n+14) { width: 62px; text-align: center; }
.class-results-table th:last-child,
.class-results-table td:last-child { width: 74px; text-align: left; }
.class-results-table th:nth-last-child(3),
.class-results-table td:nth-last-child(3) { width: 74px; }
.students-page {
  display: grid;
  gap: 18px;
}
.students-filter-card .students-filters {
  align-items: end;
}
.students-filter-card .student-search-field {
  flex: 1.4 1 260px;
}
.student-summary-strip {
  min-height: 50px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.035);
  padding: 8px 14px;
}
.student-summary-strip span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0 18px;
  border-left: 1px solid var(--border);
}
.student-summary-strip span:first-child {
  border-left: 0;
  padding-left: 0;
}
.student-summary-strip strong {
  color: var(--text);
  font-size: 0.95rem;
}
.students-list-card .card-header {
  align-items: flex-start;
}
.students-table-wrap {
  max-height: calc(100vh - 360px);
  min-height: 420px;
}
.students-table {
  min-width: 1320px;
}
.students-table th,
.students-table td {
  vertical-align: middle;
}
.students-table th:nth-child(4),
.students-table td:nth-child(4),
.students-table th:nth-child(7),
.students-table td:nth-child(7) {
  color: var(--muted);
}
.table-sort {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-transform: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0;
}
.table-sort i {
  color: #9AA3B7;
  font-size: 0.72rem;
}
.student-profile-link {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}
.student-profile-link:hover strong,
.student-profile-link:focus-visible strong {
  color: var(--green);
  text-decoration: underline;
}
.student-row-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.student-row-actions .icon-btn {
  width: 34px;
  height: 34px;
}
.student-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: 190px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}
.student-actions-menu.open {
  display: grid;
}
.student-actions-menu button,
.student-actions-menu a {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.student-actions-menu button:hover,
.student-actions-menu a:hover {
  background: var(--light-green);
  color: var(--green);
}
.students-pagination {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.students-pagination .pagination {
  margin-top: 0;
}
.rows-field label {
  font-size: 0.68rem;
}
.pagination-ellipsis {
  color: var(--muted);
  padding: 0 4px;
}
.student-profile-modal {
  width: min(820px, 100%);
}
.student-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.student-profile-photo {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--light-green);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.4rem;
  flex: 0 0 auto;
}
.student-profile-head h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.student-profile-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}
.student-form-modal {
  width: min(980px, 100%);
}
.student-form {
  display: grid;
  gap: 22px;
}
.student-form section h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.student-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}
.student-status-photo {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.field-error {
  min-height: 16px;
  margin-top: 4px;
  color: var(--error);
  font-size: 0.72rem;
  font-weight: 800;
}
[aria-invalid="true"] {
  border-color: var(--error) !important;
  background: #FFF7F7 !important;
}
.student-photo-control {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.student-photo-preview {
  width: 92px;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--light-green);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 900;
  overflow: hidden;
}
.student-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.student-photo-control small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}
.student-form-modal footer {
  align-items: center;
}
.student-form-status {
  margin-right: auto;
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 850;
}
.discard-confirm {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 74px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(229, 72, 77, 0.24);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px;
}
.discard-confirm div {
  margin-right: auto;
}
.discard-confirm strong,
.discard-confirm span {
  display: block;
}
.discard-confirm span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}
