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

.teachers-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: clip;
  background: #f9f9fb;
}

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

.teachers-page-head p {
  margin: 4px 0 0;
}

.teachers-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 14px;
  font-weight: 600;
}

.teachers-notice[hidden] {
  display: none !important;
}

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

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

.teachers-page .students-teachers-section {
  margin-top: 0;
}

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

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

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

.teachers-modal__panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(25, 28, 29, 0.18);
}

.teachers-modal__panel--confirm {
  width: min(400px, 100%);
}

.teachers-modal--confirm .teachers-modal__backdrop {
  background: rgba(25, 28, 29, 0.52);
}

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

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

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

.teachers-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px 24px;
}

.teachers-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teachers-modal__field span {
  color: #41484c;
  font-size: 12px;
  font-weight: 600;
}

.teachers-modal__field input[readonly] {
  background: #f4f6f7;
  color: #41484c;
  cursor: default;
}

.teachers-modal .custom-select {
  position: relative;
  width: 100%;
}

.teachers-modal .custom-select.is-open {
  z-index: 5;
}

.teachers-modal .custom-select__menu {
  z-index: 10;
  max-height: 240px;
  overflow: auto;
}

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

.teachers-modal__field input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #ffffff;
  color: #191c1d;
  font-size: 14px;
}

.teachers-modal__field input:focus {
  border-color: #00658f;
  outline: none;
}

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

.teachers-modal__footer--edit {
  align-items: center;
  justify-content: space-between;
}

.teachers-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.teachers-modal__btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}

.teachers-modal__btn--danger {
  color: #ba1a1a;
}

.teachers-modal__btn--danger:hover {
  color: #93000a;
}

.teachers-modal__btn--danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.teachers-modal__error {
  margin: 0;
  color: #ba1a1a;
  font-size: 13px;
  line-height: 18px;
}

.teachers-modal__error[hidden] {
  display: none;
}

.teachers-confirm-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 28px 28px;
  text-align: center;
}

.teachers-confirm-dialog__icon {
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f0f3;
  margin-bottom: 18px;
}

.teachers-confirm-dialog__title {
  margin: 0 0 10px;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
}

.teachers-confirm-dialog__message {
  max-width: 320px;
  margin: 0 0 24px;
  color: #5a5c5c;
  font-size: 14px;
  line-height: 22px;
}

.teachers-confirm-dialog__name {
  margin: -12px 0 24px;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.teachers-confirm-dialog__error {
  width: 100%;
  margin: -8px 0 16px;
  color: #ba1a1a;
  font-size: 13px;
  line-height: 18px;
}

.teachers-confirm-dialog__error[hidden] {
  display: none;
}

.teachers-confirm-dialog__icon--danger {
  background: #ffebee;
}

.teachers-confirm-dialog__actions {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.teachers-confirm-dialog__btn {
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.teachers-confirm-dialog__btn--secondary {
  border: 1px solid #c0c7cc;
  background: #ffffff;
  color: #191c1d;
}

.teachers-confirm-dialog__btn--primary {
  border: 0;
  background: #306177;
  color: #ffffff;
}

.teachers-confirm-dialog__btn--danger {
  border: 0;
  background: #ba1a1a;
  color: #ffffff;
}

.teachers-confirm-dialog__btn--danger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

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

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

@media (max-width: 768px) {
  .teachers-main {
    padding: 20px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  }

  
  .teachers-modal .cancel-btn {
    display: none !important;
  }

  
  .teachers-page .classes-table-card .classes-table-footer.table-pagination-footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    padding: 16px 16px 28px;
    box-sizing: border-box;
  }

  .teachers-page .classes-table-footer .table-pagination-footer__meta {
    align-self: auto;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .teachers-page .classes-table-footer .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;
  }

  .teachers-page .classes-table-footer .table-pagination-footer__controls nav {
    justify-content: flex-end;
    margin-left: 0;
  }

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

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

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

  .teachers-modal__footer:not(.teachers-modal__footer--edit) {
    flex-direction: column;
  }

  .teachers-modal__footer:not(.teachers-modal__footer--edit) .save-btn {
    width: 100%;
    justify-content: center;
  }

  .teachers-confirm-dialog__actions {
    grid-template-columns: 1fr;
  }
}
