@import url("/css/pages/default.css");
@import url("/css/pages/classes.css");

.students-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: clip;
}

.students-header {
  gap: 49px;
}

.students-search input {
  height: 42px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.students-main {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  gap: 24px;
  padding: 32px 32px 38px;
}

.students-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.students-page-head__title {
  max-width: 560px;
}

.students-page-head__title p {
  margin: 4px 0 0;
  color: #41484c;
  font-size: 16px;
  line-height: 24px;
}

.students-filters {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 24px;
  width: 100%;
}

.students-filter,
.students-status-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.students-filter > span,
.students-status-filter > span {
  padding: 0 4px;
  color: #41484c;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.students-filter--search {
  flex: 1 1 auto;
  min-width: 220px;
  max-width: none;
}

.students-filter--class {
  flex: 0 0 auto;
}

.students-name-filter-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #f3f3f5;
  color: #191c1d;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  padding: 8px 16px;
}

.students-name-filter-input::placeholder {
  color: #8b949e;
  font-weight: 400;
}

.students-name-filter-input:focus {
  outline: none;
  border-color: #00658f;
  background: #fff;
}

.students-filter .custom-select {
  width: 200px;
}

.students-filter .custom-select__menu {
  z-index: 50;
}

.students-status-filter {
  width: auto;
}

.students-status-filter div {
  display: flex;
  height: 42px;
  gap: 0;
  padding: 4px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #f3f3f5;
}

.students-status-filter button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 20px;
  padding: 6px 16px;
}

.students-status-filter button.is-active {
  background: #00658f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: #ffffff;
}

.students-add {
  display: inline-flex;
  min-width: 151px;
  height: 42px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #00658f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  padding: 0 20px;
  white-space: nowrap;
}

.students-add svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.students-table-card {
  overflow: hidden;
  border: 1px solid #c0c7cc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.05);
}

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

.students-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.students-table thead {
  background: #edeeef;
}

.students-table th,
.students-table td {
  border-bottom: 1px solid #c0c7cc;
  color: #41484c;
  font-size: 16px;
  line-height: 24px;
  padding: 16px 24px;
  text-align: left;
  vertical-align: middle;
}

.students-table th {
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

.students-table th:first-child,
.students-table td:first-child {
  width: 134px;
}

.students-table th:last-child,
.students-table td:last-child {
  width: 127px;
  text-align: right;
}

.students-table td.students-table__contact {
  width: auto;
  text-align: left;
  white-space: nowrap;
}

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

.students-table td strong {
  display: block;
  color: #191c1d;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 20px;
}

.students-table td small {
  display: block;
  color: #41484c;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.student-avatar {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.student-avatar--one {
  background: linear-gradient(135deg, #d97706, #fbbf24);
}

.student-avatar--two {
  background: linear-gradient(135deg, #c2410c, #fdba74);
}

.student-avatar--three {
  background: linear-gradient(135deg, #166534, #86efac);
}

.student-avatar--four {
  background: linear-gradient(135deg, #7c3aed, #c4b5fd);
}

.student-avatar--five {
  background: linear-gradient(135deg, #0f766e, #99f6e4);
}

.student-avatar--photo {
  padding: 0;
  overflow: hidden;
  background: #eef3f6;
}

.student-avatar--photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-avatar-trigger {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  vertical-align: middle;
}

.student-avatar-trigger:hover .student-avatar,
.student-avatar-trigger:focus-visible .student-avatar {
  box-shadow: 0 0 0 2px #306177;
}

.student-avatar-trigger:focus-visible {
  outline: none;
}

.students-modal__panel--photo {
  max-width: 460px;
}

.students-photo-modal__student {
  margin: 0 0 12px;
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
}

.students-field--photo {
  gap: 8px;
}

.students-image-upload {
  display: grid;
  gap: 10px;
}

.students-image-upload__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.students-image-upload__btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #ffffff;
  color: #191c1d;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.students-image-upload__hint {
  margin: 0;
  font-size: 12px;
  color: #71787d;
}

.students-image-upload__error {
  margin: 0;
  font-size: 13px;
  color: #ba1a1a;
}

.students-image-upload__preview {
  margin-top: 2px;
}

.students-image-upload__preview-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  max-width: 360px;
  padding: 12px;
  border: 1px solid #dbe2e8;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.students-image-upload__preview-media {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 84px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #dbe2e8;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(241, 245, 247, 0.95)),
    linear-gradient(135deg, #eef3f6 0%, #e7eef2 100%);
}

.students-image-upload__preview-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.students-image-upload__preview-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8a97a3;
}

.students-image-upload__preview-fallback svg {
  width: 34px;
  height: 34px;
}

.students-image-upload__preview-media.has-image .students-image-upload__preview-fallback {
  display: none;
}

.students-image-upload__preview-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.students-image-upload__preview-label {
  color: #71787d;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.students-image-upload__preview-name {
  color: #191c1d;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.student-status i {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
}

.student-status.is-present {
  background: #dcfce7;
  color: #15803d;
}

.student-status.is-present i {
  background: #22c55e;
}

.student-status.is-away {
  background: #e2e2e4;
  color: #41484c;
}

.student-status.is-away i {
  background: #71787d;
}



.students-teachers-section {
  margin-top: 32px;
}

.students-teachers-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.students-teachers-head h2 {
  margin: 0 0 4px;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.students-teachers-head p {
  margin: 0;
  color: #41484c;
  font-size: 14px;
  line-height: 20px;
}

.students-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.students-stat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  border: 1px solid #c0c7cc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.05);
}

.students-stat-card__label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.insight-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.insight-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.insight-icon--blue {
  background: #c7e7ff;
  color: #00658f;
}

.insight-icon--purple {
  background: #dfe0ff;
  color: #4455ba;
}

.insight-icon--red {
  background: #ffdad6;
  color: #ba1a1a;
}

.insight-icon--green {
  background: #dcfce7;
  color: #15803d;
}

.students-stat-card h2 {
  margin: 0;
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.35px;
  line-height: 20px;
}

.students-stat-card strong {
  display: block;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
}

@media (max-width: 1100px) {
  .students-main {
    padding: 24px 20px;
  }

  .students-page-head {
    flex-direction: column;
    align-items: stretch;
  }


  .students-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .students-filter,
  .students-filter .custom-select,
  .students-status-filter,
  .students-filter--search,
  .students-filter--class {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .students-add {
    width: 100%;
  }

  .students-pagination {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .students-pagination .table-pagination-footer__meta {
    align-self: auto;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .students-pagination .table-pagination-footer__controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-self: auto;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    width: auto;
  }

  .students-pagination .table-pagination-footer__controls nav {
    justify-content: flex-end;
    margin-left: 0;
  }

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

.students-status {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #dcfce7;
  color: #166534;
  font-size: 14px;
  font-weight: 500;
}

.students-status.is-error {
  background: #fee2e2;
  color: #b91c1c;
}

.students-table__empty td {
  padding: 32px 16px;
  color: #71787d;
  text-align: center;
}

.students-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.students-modal[hidden] {
  display: none !important;
}

.students-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 28, 29, 0.45);
}

.students-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  flex-direction: column;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(25, 28, 29, 0.18);
}

.students-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.students-modal__header h2 {
  margin: 0;
  color: #191c1d;
  font-size: 20px;
  font-weight: 700;
}

.students-modal__header button {
  border: 0;
  background: transparent;
  color: #71787d;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.students-modal__body {
  display: flex;
  overflow: auto;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 24px;
}

.students-modal__body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.students-modal__body label span {
  color: #41484c;
  font-size: 13px;
  font-weight: 500;
}

.students-modal__body input {
  height: 44px;
  border: 1px solid #c0c7cc;
  border-radius: 10px;
  padding: 0 12px;
  color: #191c1d;
  font-size: 15px;
}

.custom-select--students-form {
  width: 100%;
}

.students-modal .custom-select--students-form .custom-select__menu {
  max-height: 240px;
}

.students-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.students-field__label {
  color: #41484c;
  font-size: 13px;
  font-weight: 500;
}

.students-modal__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 13px;
}

.students-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}


.students-modal__footer--edit {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.students-modal__footer--edit .delete-btn,
.students-modal__footer--edit .students-modal__footer-actions .save-btn {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}

.students-modal__footer--edit .students-modal__footer-actions {
  margin-left: auto;
  width: auto;
}

.students-modal__footer .cancel-btn,
.students-modal__footer button.cancel-btn {
  height: 44px;
  border-radius: 8px;
  padding: 0 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.students-modal__footer .cancel-btn,
.students-modal__footer button.cancel-btn {
  border: 1px solid #c0c7cc;
  background: #ffffff;
  color: #191c1d;
}

.students-modal__footer button[type="submit"]:not(.save-btn) {
  border: 0;
  background: #306177;
  color: #ffffff;
}

.students-parents h3 {
  margin: 8px 0 0;
  color: #191c1d;
  font-size: 16px;
}

.students-parents__empty {
  margin: 0;
  color: #71787d;
  font-size: 14px;
}

.students-parent-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e2e2e4;
  border-radius: 14px;
  background: #f9f9fb;
}

[data-student-parents-list] {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.students-parent-card h4 {
  margin: 0;
  font-size: 14px;
}

.students-parent-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.students-parent-toggle input {
  width: auto;
  height: auto;
}

@media (max-width: 768px) {
  
  .students-modal .cancel-btn {
    display: none !important;
  }

  .students-modal__footer {
    flex-direction: column;
  }

  .students-modal__footer .save-btn {
    width: 100%;
    justify-content: center;
  }
}

