/* ================================================================
   students.css — Student Management page styles only
   ================================================================ */

/* ── SUMMARY STRIP ─────────────────────────────────────────── */
.student-summary-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--s4) 0;
}
.summary-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s7);
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.summary-num  {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.summary-label { font-size: .78rem; color: var(--navy-300); font-weight: 500; }
.summary-divider { width: 1px; height: 38px; background: var(--border); }
@media (max-width: 560px) { .summary-divider { display: none; } }

/* ── PAGE LAYOUT ───────────────────────────────────────────── */
.students-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: var(--s6);
  align-items: start;
}
@media (max-width: 960px) { .students-layout { grid-template-columns: 1fr; } }

/* ── FILTERS PANEL ─────────────────────────────────────────── */
.filters-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  position: sticky;
  top: calc(var(--header-h) + var(--s4));
}
@media (max-width: 960px) { .filters-panel { position: static; } }

.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filters-panel-header h3 {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  color: var(--navy);
}
.filter-group { display: flex; flex-direction: column; gap: var(--s2); }
.filter-group-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy-500);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-divider { height: 1px; background: var(--border); }

.filter-stats { display: flex; flex-direction: column; gap: var(--s2); }
.filter-stat-row { display: flex; justify-content: space-between; font-size: .82rem; }
.filter-stat-label { color: var(--navy-500); }
.filter-stat-val   { font-weight: 600; color: var(--navy); }

/* ── TOOLBAR ───────────────────────────────────────────────── */
.students-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.toolbar-search { flex: 1; min-width: 200px; }
.toolbar-right  { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.results-count  { font-size: .84rem; color: var(--navy-300); white-space: nowrap; }
.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.view-btn {
  padding: .4rem .7rem;
  font-size: .95rem;
  color: var(--navy-300);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--fast);
}
.view-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-xs); }
.view-btn:hover:not(.active) { color: var(--navy); }

/* ── STUDENTS GRID ─────────────────────────────────────────── */
.students-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}
@media (max-width: 1200px) { .students-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .students-grid { grid-template-columns: 1fr; } }

/* ── STUDENT CARD ──────────────────────────────────────────── */
.student-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  cursor: pointer;
  transition: all var(--mid);
}
.student-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(26,107,74,.3);
}

.student-card-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.student-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  flex-shrink: 0;
}
.student-name {
  font-family: var(--font-display);
  font-size: .97rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}
.student-id { font-size: .78rem; color: var(--navy-300); margin-top: 2px; font-family: monospace; }

.student-card-meta { display: flex; flex-direction: column; gap: var(--s2); }
.student-meta-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: .82rem;
  color: var(--navy-500);
}

.student-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s3);
  border-top: 1px solid var(--surface);
  margin-top: auto;
}

/* ── TABLE VIEW ────────────────────────────────────────────── */
.students-table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
}
.students-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.students-table th {
  padding: var(--s3) var(--s4);
  text-align: left;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--navy-300);
  background: var(--page-bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.students-table td {
  padding: var(--s3) var(--s4);
  color: var(--navy);
  border-bottom: 1px solid var(--surface);
  vertical-align: middle;
}
.students-table tr:last-child td { border-bottom: none; }
.students-table tr:hover td { background: var(--page-bg); }
.td-name { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.table-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.td-mono { font-family: monospace; font-size: .84rem; color: var(--navy-500); }
.td-school { color: var(--navy-500); font-size: .84rem; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── SKELETON ──────────────────────────────────────────────── */
.student-skeleton { height: 195px; border-radius: var(--r-lg); }
#skeleton-grid { display: none; }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--s10) var(--s5);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}
.empty-state.visible { display: flex; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.3rem; color: var(--navy); }
.empty-state p  { color: var(--navy-300); }
/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,27,46,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(12,27,46,.22);
  animation: modalIn .28s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--navy-300);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--fast);
  border: none;
}
.modal-close:hover { background: var(--red-pale); color: var(--red); }
.modal-body { padding: var(--s5) var(--s6); }

/* Profile inside modal */
.student-profile-header {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-bottom: var(--s5);
}
.student-profile-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.student-profile-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.student-profile-id   { font-size: .84rem; color: var(--navy-300); font-family: monospace; margin-top: 3px; }

/* Tabs inside modal */
.modal-tabs {
  display: flex;
  gap: var(--s1);
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.modal-tab {
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--navy-300);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: all var(--fast);
  margin-bottom: -1px;
}
.modal-tab:hover { color: var(--navy); }
.modal-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }

/* Profile fields grid */
.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3) var(--s5);
}
@media (max-width: 480px) { .profile-fields { grid-template-columns: 1fr; } }
.profile-field-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--navy-300); margin-bottom: 2px; }
.profile-field-value { font-size: .9rem; color: var(--navy); font-weight: 500; }

/* Results preview inside modal */
.results-preview { display: flex; flex-direction: column; gap: var(--s3); }
.result-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 70px;
  gap: var(--s3);
  align-items: center;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--surface);
  font-size: .875rem;
}
.result-row:last-child { border-bottom: none; }
.result-subject { color: var(--navy); font-weight: 500; }
.result-score   { text-align: center; font-weight: 600; color: var(--navy); }
.result-grade   { text-align: center; }
.result-headers { color: var(--navy-300); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }

/* Enrolment form */
.enrol-form { display: flex; flex-direction: column; gap: var(--s4); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 480px) { .form-row-2 { grid-template-columns: 1fr; } }
.field-error { font-size: .8rem; color: var(--red); margin-top: 2px; display: block; }
.input-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(192,57,43,.12) !important; }
.modal-actions { display: flex; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); flex-wrap: wrap; }