/* =========================================================
   pages/students.css
   ---------------------------------------------------------
   Students list page, student cards/table and mobile students layout.
   ========================================================= */

/* =========================================================
   13) STUDENTS PAGE
   --------------------------------------------------------- */
   
.nn-students-page {
  display: grid;
  gap: 12px;
}

.nn-students-page__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.nn-students-page__title {
  margin: 0 0 3px;
  line-height: 1.05;
}

.nn-students-page__intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.25;
}

.nn-students-page__add {
  white-space: nowrap;
  background: #0F9FA8;
  border-color: #0F9FA8;
  color: #fff;
  min-height: 38px;
  padding: 8px 12px;
}

.nn-students-page__add:hover {
  background: #0c8a92;
  border-color: #0c8a92;
  color: #fff;
}

.nn-students-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.nn-students-filters__search {
  position: relative;
}

.nn-students-filters__search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.nn-students-filters__search input,
.nn-students-filters__select select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.nn-students-filters__search input {
  padding: 0 12px 0 36px;
}

.nn-students-filters__select select {
  padding: 0 12px;
}

.nn-school-groups {
  display: grid;
  gap: 12px;
}

.nn-school-card {
  padding-top: 12px;
  padding-bottom: 8px;
}

.nn-school-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.nn-school-card__titleWrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nn-school-card__logo,
.nn-school-card__logoFallback {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 34px;
}

.nn-school-card__logoFallback {
  background: rgba(0,0,0,0.06);
}

.nn-school-card__title {
  margin: 0 0 1px;
  font-size: 1.2rem;
  line-height: 1.05;
}

.nn-school-card__count {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.15;
}

.nn-school-card__tableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* desktop / mobile tables */
.nn-students-table,
.nn-students-table-mobile {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.nn-students-table th,
.nn-students-table td,
.nn-students-table-mobile th,
.nn-students-table-mobile td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.2;
}

.nn-students-table th,
.nn-students-table-mobile th {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.1;
  padding-top: 5px;
  padding-bottom: 6px;
  white-space: nowrap;
}

.nn-students-table tbody tr:last-child td,
.nn-students-table-mobile tbody tr:last-child td {
  border-bottom: 0;
}

.nn-students-table__name {
  font-weight: 700;
  text-decoration: none;
  line-height: 1.15;
}

.nn-students-table__name:hover {
  text-decoration: underline;
}

.nn-students-table__profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 159, 168, 0.12);
  color: #0F9FA8;
  text-decoration: none;
  font-size: 0.82rem;
}

.nn-students-table__profile:hover {
  background: rgba(15, 159, 168, 0.2);
  color: #0c8a92;
}

.nn-school-card__empty {
  padding: 8px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nn-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.1;
}

.nn-sort-btn:hover {
  opacity: 0.75;
}

.nn-sort-indicator {
  font-size: 10px;
  line-height: 1;
  min-width: 9px;
}

.nn-students-table-mobile {
  display: none;
}

.nn-students-table__kit {
  text-align: center;
  white-space: nowrap;
}

.nn-students-table__kit .nn-kit-badge {
  margin-left: 0;
}

/* Parent access mini display */
.nn-students-table__parents {
  white-space: nowrap;
}

.nn-parent-mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  background: #e8f6ee;
  color: #116b37;
  white-space: nowrap;
}

.nn-parent-mini-badge--empty {
  background: #fff3cd;
  color: #7a5200;
}

@media (max-width: 1024px) {
  .nn-students-page {
    gap: 10px;
  }

  .nn-students-page__head,
  .nn-students-filters,
  .nn-school-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nn-students-table th,
  .nn-students-table td,
  .nn-students-table-mobile th,
  .nn-students-table-mobile td {
    padding: 6px 7px;
    font-size: 0.84rem;
  }

  .nn-students-table th,
  .nn-students-table-mobile th {
    font-size: 0.72rem;
  }

  .nn-school-card__logo,
  .nn-school-card__logoFallback {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .nn-school-card__title {
    font-size: 1.08rem;
  }

  .nn-parent-mini-badge {
    font-size: 0.68rem;
    padding: 3px 6px;
  }
}

@media (max-width: 820px) {
  .nn-students-page__head {
    flex-direction: column;
    align-items: stretch;
  }

  .nn-students-page__add {
    width: 100%;
    justify-content: center;
  }

  .nn-students-filters {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MOBILE – STUDENTS PAGE
   --------------------------------------------------------- */

@media (max-width: 767px) {

  .nn-students-page {
    padding-left: 4px;
    padding-right: 4px;
    gap: 10px;
  }

  .nn-students-page .card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .nn-students-page__head {
    gap: 8px;
  }

  .nn-students-page__title {
    margin-bottom: 3px;
  }

  .nn-students-page__intro {
    font-size: 13px;
    line-height: 1.25;
  }

  .nn-students-page__add {
    width: 100%;
    justify-content: center;
    min-height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .nn-students-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nn-students-filters__search,
  .nn-students-filters__select {
    width: 100%;
  }

  .nn-students-filters__search input,
  .nn-students-filters__select select {
    width: 100%;
    min-height: 36px;
    font-size: 13px;
  }

  .nn-school-card {
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .nn-school-card__head {
    margin-bottom: 6px;
  }

  .nn-school-card__titleWrap {
    align-items: center;
    gap: 8px;
  }

  .nn-school-card__logo,
  .nn-school-card__logoFallback {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 6px;
  }

  .nn-school-card__title {
    font-size: 1.1rem;
    line-height: 1.05;
    margin: 0;
  }

  .nn-school-card__count {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.15;
  }

  .nn-school-card__tableWrap {
    overflow-x: visible;
  }

  .nn-students-table--desktop {
    display: none !important;
  }

  .nn-students-table-mobile {
    display: table !important;
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
  }

  .nn-students-table-mobile thead {
    display: table-header-group;
  }

  .nn-students-table-mobile tbody {
    display: table-row-group;
  }

  .nn-students-table-mobile tr {
    display: table-row;
  }

  .nn-students-table-mobile th,
  .nn-students-table-mobile td {
    display: table-cell;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    line-height: 1.15;
  }

  .nn-students-table-mobile th {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .nn-students-table-mobile td {
    font-size: 13px;
  }

  .nn-students-table-mobile th:nth-child(1),
  .nn-students-table-mobile td:nth-child(1) {
    width: auto;
  }

  .nn-students-table-mobile th:nth-child(2),
  .nn-students-table-mobile td:nth-child(2),
  .nn-students-table-mobile th:nth-child(3),
  .nn-students-table-mobile td:nth-child(3),
  .nn-students-table-mobile th:nth-child(4),
  .nn-students-table-mobile td:nth-child(4),
  .nn-students-table-mobile th:nth-child(5),
  .nn-students-table-mobile td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
  }

  .nn-students-table-mobile .nn-students-table__name {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .nn-students-table-mobile .nn-sort-btn {
    gap: 3px;
    font-size: 11px;
    line-height: 1.1;
  }

  .nn-students-table-mobile .nn-sort-indicator {
    font-size: 9px;
  }

  .nn-students-table-mobile .nn-parent-mini-badge {
    font-size: 10px;
    padding: 2px 5px;
  }

  .nn-students-table-mobile .nn-kit-badge {
    transform: scale(0.9);
    transform-origin: center;
  }
}


/* =========================================================
   Students V2 table refresh
   ---------------------------------------------------------
   Modern sortable table layout. Keeps the admin usefulness of
   columns/sorting while making rows feel more like app records.
   ========================================================= */

.nn-school-card {
  padding-top: 14px;
  padding-bottom: 10px;
  overflow: hidden;
}

.nn-school-card__head {
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.nn-school-card__logo,
.nn-school-card__logoFallback {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f5;
  padding: 4px;
}

.nn-school-card__title {
  font-size: 1.3rem;
  font-weight: 700;
}

.nn-school-card__count {
  font-size: 0.92rem;
}

.nn-school-card__tableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nn-students-table {
  min-width: 840px;
}

.nn-students-table th,
.nn-students-table td,
.nn-students-table-mobile th,
.nn-students-table-mobile td {
  padding: 9px 12px;
  font-size: 0.94rem;
  border-bottom: 1px solid #e7edf2;
}

.nn-students-table th,
.nn-students-table-mobile th {
  padding-top: 8px;
  padding-bottom: 8px;
  color: #475467;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nn-students-row {
  cursor: pointer;
  transition: background 0.16s ease;
}

.nn-students-row:hover {
  background: rgba(15, 159, 168, 0.045);
}

.nn-students-row:focus-visible {
  outline: 2px solid rgba(15, 159, 168, 0.45);
  outline-offset: -2px;
}

.nn-students-table__studentCell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 270px;
}

.nn-student-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: rgba(15, 159, 168, 0.13);
  color: #087982;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.nn-student-avatar:hover {
  background: rgba(15, 159, 168, 0.22);
  color: #075f66;
  text-decoration: none;
}

.nn-students-table__studentText {
  min-width: 0;
}

.nn-students-table__name {
  display: inline-block;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2;
}

.nn-students-table__name:hover {
  color: #0F9FA8;
  text-decoration: none;
}

.nn-students-table__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.nn-students-table__meta span + span::before {
  content: "•";
  margin-right: 5px;
  color: #a8b3bd;
}

.nn-attendance-meter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.nn-attendance-meter__bar {
  position: relative;
  display: inline-block;
  width: 94px;
  height: 8px;
  border-radius: 999px;
  background: #d8dde3;
  overflow: hidden;
}

.nn-attendance-meter__bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--nn-attendance-width, 0%);
  border-radius: inherit;
  background: #16a34a;
}

.nn-attendance-meter--mid .nn-attendance-meter__bar::before {
  background: #f59e0b;
}

.nn-attendance-meter--low .nn-attendance-meter__bar::before {
  background: #ef4444;
}

.nn-attendance-meter--empty .nn-attendance-meter__bar::before {
  background: transparent;
}

.nn-attendance-meter__label {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 38px;
}

.nn-students-table__features {
  width: 1%;
  white-space: nowrap;
}

.nn-feature-statuses {
  display: inline-flex;
  align-items: center;
  gap: var(--nn-space-2);
}

.nn-feature-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--nn-radius-control);
  color: var(--nn-color-text-muted);
  line-height: 1;
}

.nn-feature-status.is-enabled {
  color: var(--nn-color-accent);
}

.nn-feature-status.is-disabled {
  opacity: 0.38;
}

.nn-parent-mini-badge {
  padding: 5px 9px;
  font-size: 0.73rem;
  font-weight: 800;
  background: #e8f6ee;
  color: #116b37;
}

.nn-parent-mini-badge--empty {
  background: #fff1c7;
  color: #7a5200;
}

.nn-sort-btn {
  color: #475467;
  font-weight: 800;
}

.nn-sort-btn:hover {
  color: #0F9FA8;
  opacity: 1;
}

@media (max-width: 1024px) {
  .nn-students-table {
    min-width: 760px;
  }

  .nn-students-table th,
  .nn-students-table td,
  .nn-students-table-mobile th,
  .nn-students-table-mobile td {
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  .nn-students-table__studentCell {
    gap: 8px;
    min-width: 230px;
  }

  .nn-student-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 0.78rem;
  }

  .nn-attendance-meter {
    min-width: 128px;
    gap: 8px;
  }

  .nn-attendance-meter__bar {
    width: 74px;
  }
}

@media (max-width: 767px) {
  .nn-students-table-mobile .nn-students-table__studentCell {
    min-width: 160px;
    gap: 8px;
  }

  .nn-students-table-mobile .nn-student-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 0.72rem;
  }

  .nn-students-table-mobile .nn-students-table__name {
    font-size: 13px;
    font-weight: 500;
  }

  .nn-students-table-mobile .nn-students-table__meta {
    display: none;
  }
}

/* Tracking-only student badge */
.nn-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nn-badge--tracking {
  border: 1px solid #d0d5dd;
  background: #f2f4f7;
  color: #475467;
}

.nn-students-table__studentText .nn-badge--tracking {
  margin-top: 5px;
}

/* =========================================================
   STUDENT ARCHIVING
   ========================================================= */

.nn-students-notice {
  padding: 11px 14px;
  border: 1px solid #b7dfc6;
  border-radius: 10px;
  background: #f3fbf6;
  color: #166534;
  font-size: 0.82rem;
  font-weight: 750;
}

.nn-archived-students {
  overflow: hidden;
  padding: 0;
  border: 1px solid #dce3e9;
  background: #fafbfc;
  box-shadow: none;
}

.nn-archived-students__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.nn-archived-students__summary::-webkit-details-marker {
  display: none;
}

.nn-archived-students__summary::marker {
  content: "";
}

.nn-archived-students__title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nn-archived-students__title > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eef1f4;
  color: #64748b;
}

.nn-archived-students__title > span {
  display: grid;
  gap: 2px;
}

.nn-archived-students__title strong {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 850;
}

.nn-archived-students__title small {
  color: #94a3b8;
  font-size: 0.72rem;
}

.nn-archived-students__chevron {
  color: #94a3b8;
  font-size: 0.68rem;
  transition: transform 0.18s ease;
}

.nn-archived-students[open] .nn-archived-students__chevron {
  transform: rotate(180deg);
}

.nn-archived-students__body {
  display: grid;
  padding: 0 16px 10px;
  border-top: 1px solid #e5eaf0;
  background: #fff;
}

.nn-archived-student {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f3;
}

.nn-archived-student:last-child {
  border-bottom: 0;
}

.nn-archived-student__main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nn-archived-student__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef1f4;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 850;
}

.nn-archived-student__name {
  display: block;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.nn-archived-student__name:hover {
  text-decoration: underline;
}

.nn-archived-student__main p {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 3px 0 0;
  color: #94a3b8;
  font-size: 0.72rem;
}

.nn-archived-student__actions {
  flex: 0 0 auto;
  margin: 0;
}

.nn-archived-student__restore {
  min-height: 34px;
  border-color: #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 0.76rem;
}

.nn-archived-student__restore:hover,
.nn-archived-student__restore:focus-visible {
  border-color: #9ca9b7 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}


/* Edit student status card */

.nn-student-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  padding: 18px 20px;
}

.nn-student-status-card__copy {
  min-width: 0;
}

.nn-student-status-card__label {
  display: block;
  margin-bottom: 7px;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nn-student-status-card__state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nn-student-status-card__state strong {
  color: #334155;
  font-size: 0.92rem;
  font-weight: 850;
}

.nn-student-status-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22a06b;
}

.nn-student-status-card__state.is-archived .nn-student-status-card__dot {
  background: #94a3b8;
}

.nn-student-status-card__copy p {
  max-width: 680px;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.nn-student-status-card__copy small {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 0.72rem;
}

.nn-student-status-card__action {
  flex: 0 0 auto;
  margin: 0;
}

.nn-student-status-card__archive {
  border-color: #101820 !important;
  background: #101820 !important;
  color: #fff !important;
}

.nn-student-status-card__archive:hover,
.nn-student-status-card__archive:focus-visible {
  border-color: #26313b !important;
  background: #26313b !important;
  color: #fff !important;
}

.nn-student-status-card__restore {
  border-color: #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
}

@media (max-width: 700px) {
  .nn-archived-student {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .nn-archived-student__actions,
  .nn-archived-student__restore {
    width: 100%;
  }

  .nn-student-status-card {
    align-items: stretch;
    flex-direction: column;
  }

  .nn-student-status-card__action,
  .nn-student-status-card__action .btn {
    width: 100%;
  }
}
