/* ——— Веб-конструктор уроков, задач и слайдов (/teacher/editor) и управление преподавателями (/teacher/team) ——— */

/* Единая дизайн-система полей и кнопок внутри конструктора и команды */
#screen-teacher-editor input[type="text"],
#screen-teacher-editor input[type="number"],
#screen-teacher-editor select,
#screen-teacher-team input[type="text"],
#screen-teacher-team input[type="password"],
#screen-teacher-team select {
  height: 38px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid #CBD8EE;
  background: #FBFDFF;
  color: #173B7B;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

#screen-teacher-editor textarea,
#screen-teacher-team textarea {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid #CBD8EE;
  background: #FBFDFF;
  color: #173B7B;
  font-size: 0.9rem;
  line-height: 1.42;
  resize: vertical;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

#screen-teacher-editor input:focus,
#screen-teacher-editor select:focus,
#screen-teacher-editor textarea:focus,
#screen-teacher-team input:focus,
#screen-teacher-team select:focus,
#screen-teacher-team textarea:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #1564D9;
  box-shadow: 0 0 0 3px rgba(21, 100, 217, 0.12);
}

#screen-teacher-editor input::placeholder,
#screen-teacher-editor textarea::placeholder,
#screen-teacher-team input::placeholder {
  color: #5A6E8C;
  font-weight: 400;
}

/* Акцентные, вторичные и мягкие опасные кнопки (в едином стиле с пультом /teacher) */
#screen-teacher-editor button,
#screen-teacher-team button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
  border-radius: 9px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

#screen-teacher-editor .ed-primary-btn,
#screen-teacher-team #team-submit-btn {
  width: auto;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: #1564D9;
  color: #FFFFFF;
  border: 1px solid #1256BE;
  font-size: 0.88rem;
  box-shadow: 0 2px 6px rgba(21, 100, 217, 0.16);
}
#screen-teacher-editor .ed-primary-btn:hover:not(:disabled),
#screen-teacher-team #team-submit-btn:hover:not(:disabled) {
  background: #104FAE;
  border-color: #0D4294;
}
#screen-teacher-editor .ed-primary-btn--sm {
  height: 34px;
  padding: 0 13px;
  font-size: 0.83rem;
  border-radius: 9px;
}

#screen-teacher-editor .btn-secondary,
#screen-teacher-team .btn-secondary {
  background: #F1F5F9;
  color: #173B7B;
  border: 1px solid #CBD8EE;
}
#screen-teacher-editor .btn-secondary:hover:not(:disabled),
#screen-teacher-team .btn-secondary:hover:not(:disabled) {
  background: #E2EEFF;
  border-color: #93C5FD;
  color: #104FAE;
}

#screen-teacher-editor .btn-danger,
#screen-teacher-team .btn-danger {
  background: #FFF1F2;
  color: #BE123C;
  border: 1px solid #FECDD3;
}
#screen-teacher-editor .btn-danger:hover:not(:disabled),
#screen-teacher-team .btn-danger:hover:not(:disabled) {
  background: #FFE4E6;
  border-color: #FDA4AF;
  color: #9F1239;
}

#screen-teacher-editor button:disabled,
#screen-teacher-team button:disabled {
  opacity: 0.38;
  cursor: default;
}

.ed-bar-btn {
  width: auto !important;
  height: 38px;
  padding: 0 14px !important;
  font-size: 0.85rem;
  border-radius: 10px !important;
  flex: 0 0 auto;
}
.ed-sm-btn {
  width: auto !important;
  height: 32px;
  padding: 0 11px !important;
  font-size: 0.8rem;
  border-radius: 8px !important;
  flex: 0 0 auto;
}
.ed-icon-btn {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px;
  padding: 0 !important;
  font-size: 0.88rem;
  border-radius: 8px !important;
  flex: 0 0 auto;
}
.ed-icon-btn--xs {
  width: 26px !important;
  min-width: 26px !important;
  height: 26px;
  font-size: 0.78rem;
  border-radius: 7px !important;
}

.ed-move-pair {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.ed-move-pair--col {
  flex-direction: column;
  gap: 3px;
}

/* ——— Основная двухколоночная сетка конструктора ——— */
.editor-workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .editor-workspace {
    grid-template-columns: 1fr;
  }
}

.ed-sidebar {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 104px);
  display: flex;
  flex-direction: column;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(23, 59, 123, 0.04);
}
@media (max-width: 980px) {
  .ed-sidebar {
    position: static;
    max-height: 340px;
  }
}
.ed-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ed-sidebar-head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: #173B7B;
}
.ed-lessons-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}
.ed-new-lesson-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #F0F7FF;
  border: 1.5px solid #BFDBFE;
  margin-bottom: 12px;
}
.ed-new-lesson-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-new-lesson-btns .ed-primary-btn {
  flex: 1 1 auto;
}
.ed-new-lesson-btns .ed-bar-btn {
  height: 34px;
}

.ed-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.ed-lesson-row:hover {
  border-color: #93C5FD;
  background: #F8FBFF;
}
.ed-lesson-row.is-active {
  border-color: #1564D9;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FBFF 100%);
  box-shadow: 0 3px 10px rgba(21, 100, 217, 0.08);
}
.ed-lesson-row-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ed-lesson-row-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #173B7B;
  line-height: 1.28;
}
.ed-lesson-row-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.ed-lesson-meta-text {
  font-size: 0.75rem;
  color: #475569;
}
.ed-cls-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #DBEAFE;
  color: #1D4ED8;
}
.ed-sheet-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #DCFCE7;
  color: #15803D;
}

/* ——— Правая рабочая область урока ——— */
.ed-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ed-lesson-props-card {
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(23, 59, 123, 0.04);
}
.ed-lesson-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #E8EFF9;
}
.ed-lesson-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ed-lesson-card-title-group h3 {
  margin: 0;
  font-size: 1.04rem;
  color: #173B7B;
}
.ed-id-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EEF4FF;
  border: 1px solid #D5E3FA;
  color: #35558A;
  font-size: 0.75rem;
  font-weight: 700;
}
.ed-lesson-props-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ed-lesson-props-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(200px, 1fr);
  gap: 12px;
  align-items: end;
}
@media (max-width: 720px) {
  .ed-lesson-props-grid {
    grid-template-columns: 1fr;
  }
}

.ed-field-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.ed-label {
  display: block;
  font-size: 0.81rem;
  font-weight: 800;
  color: #2B4B80;
  margin: 0;
  line-height: 1.25;
}
.ed-label-muted {
  font-weight: 500;
  color: #475569;
}

/* Горизонтальная панель финального листа задач */
.ed-sheet-bar {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #F8FAFE;
  border: 1px solid #DCE7F7;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ed-sheet-bar-label {
  font-size: 0.81rem;
  font-weight: 800;
  color: #2B4B80;
  margin: 0;
}
.ed-inline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ed-bar-inp {
  flex: 1 1 140px;
  min-width: 110px;
  width: auto !important;
}
#ed-task-dropzone .ed-inline-bar {
  flex-wrap: nowrap;
}
#ed-task-dropzone .ed-bar-btn {
  padding: 0 11px !important;
  font-size: 0.82rem;
}
@media (max-width: 520px) {
  #ed-task-dropzone .ed-inline-bar {
    flex-wrap: wrap;
  }
}
.ed-bar-inp--title {
  flex: 0 1 230px;
}
.ed-sheet-open-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1px solid #93C5FD;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1564D9;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease;
}
.ed-sheet-open-link:hover {
  background: #DBEAFE;
  color: #104FAE;
  text-decoration: none;
}

#editor-status-msg:empty,
#team-status-msg:empty {
  display: none;
  margin: 0;
  min-height: 0;
}
#editor-status-msg,
#team-status-msg {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  background: #FEF2F2;
  border: 1px solid #FECACA;
}
#editor-status-msg.ok,
#team-status-msg.ok {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

/* ——— Сегментированные вкладки Задачи / Слайды ——— */
.ed-subtabs-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ed-subtabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #DCE9FC;
}
#screen-teacher-editor .ed-subtab-btn {
  width: auto;
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 800;
  background: transparent;
  color: #173B7B;
  border: none;
}
#screen-teacher-editor .ed-subtab-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.55);
}
#screen-teacher-editor .ed-subtab-btn.is-active {
  background: #FFFFFF;
  color: #104FAE;
  box-shadow: 0 2px 6px rgba(23, 59, 123, 0.1);
}
.ed-tab-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(21, 100, 217, 0.12);
  color: #1564D9;
}

/* ——— Вкладка Задачи ——— */
.ed-tasks-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1140px) {
  .ed-tasks-grid {
    grid-template-columns: 1fr;
  }
}

.ed-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 10px;
}
.ed-section-head h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #173B7B;
}

.ed-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ed-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #FFFFFF;
  border: 1.5px solid #E0E8F5;
  box-shadow: 0 2px 8px rgba(23, 59, 123, 0.03);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.ed-task-item:hover {
  border-color: #B6CFF4;
}
.ed-task-item.is-editing {
  border-color: #1564D9;
  background: #F4F9FF;
  box-shadow: 0 4px 14px rgba(21, 100, 217, 0.1);
}
@media (max-width: 680px) {
  .ed-task-item {
    flex-wrap: wrap;
  }
  .ed-task-item .ed-item-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px solid #EEF3FA;
  }
}

.ed-task-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 9px;
  border: 1px solid #DCE6F5;
  object-fit: contain;
  background: #F8FAFC;
  padding: 2px;
}
.ed-task-thumb--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #35558A;
  background: #EEF4FF;
}
.ed-task-meta {
  flex: 1;
  min-width: 0;
}
.ed-task-head-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: #173B7B;
}
.ed-task-snippet {
  font-size: 0.81rem;
  color: #334155;
  margin-top: 4px;
  line-height: 1.38;
}
.ed-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  line-height: 1.3;
}
.ed-pill.is-ans {
  background: #DCFCE7;
  color: #15803D;
}
.ed-pill.is-photo {
  background: #FEF3C7;
  color: #92400E;
}
.ed-pill.is-photo-opt {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.ed-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

/* Карточка формы создания / редактирования задачи */
.ed-task-form-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(23, 59, 123, 0.05);
}
@media (min-width: 1141px) {
  .ed-task-form-card {
    position: sticky;
    top: 12px;
  }
}
.ed-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ed-card-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #173B7B;
}
.ed-editing-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: #DBEAFE;
  color: #1D4ED8;
  font-size: 0.73rem;
  font-weight: 800;
}

.ed-dropzone {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px dashed #93C5FD;
  background: #F8FBFF;
}
.ed-dropzone-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #173B7B;
}
.ed-dropzone-sub {
  font-size: 0.8rem;
  color: #475569;
  margin: 3px 0 10px;
}
.ed-dropzone kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
}
.ed-img-preview-wrap {
  margin-top: 10px;
  padding: 8px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  text-align: center;
}
.ed-img-preview-wrap img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.ed-form-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
@media (max-width: 640px) {
  .ed-form-two-cols {
    grid-template-columns: 1fr;
  }
}

.ed-allow-photo-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  margin: 0;
  border-radius: 11px;
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  cursor: pointer;
}
.ed-allow-photo-row input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 2px 0 0 !important;
  flex: 0 0 auto;
  accent-color: #1564D9;
}
.ed-allow-photo-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #173B7B;
  margin-bottom: 2px;
}

.ed-form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.ed-form-footer .ed-primary-btn {
  flex: 1 1 auto;
}

.ed-empty-box {
  padding: 24px 20px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1.5px dashed #CBD5E1;
  color: #475569;
  font-size: 0.9rem;
  text-align: center;
}

/* ——— Вкладка Слайды презентации ——— */
.ed-slides-dropzone {
  margin-bottom: 14px;
}
.ed-slides-drop-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ed-slides-drop-top .ed-dropzone-sub {
  margin-bottom: 0;
}
.ed-slides-url-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #DCE8F8;
}

.ed-slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}
.ed-slide-card {
  background: #FFFFFF;
  border: 1.5px solid #E0E7F2;
  border-radius: 13px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(23, 59, 123, 0.03);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.ed-slide-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 12px rgba(21, 100, 217, 0.07);
}
.ed-slide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.ed-slide-ord-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 7px;
  background: #EEF4FF;
  color: #173B7B;
  font-size: 0.76rem;
  font-weight: 800;
}
.ed-slide-open-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1564D9;
  text-decoration: none;
}
.ed-slide-open-link:hover {
  text-decoration: underline;
}
.ed-slide-img-box {
  height: 138px;
  border-radius: 9px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
}
.ed-slide-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#screen-teacher-editor .ed-slide-title-inp {
  height: 34px;
  padding: 0 10px;
  font-size: 0.84rem;
  border-radius: 8px;
}
.ed-slide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.ed-slide-right-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ——— Управление преподавателями и ролями (/teacher/team) ——— */
.team-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}
.team-grid > .panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-teacher-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #FFFFFF;
  flex-wrap: wrap;
}
.team-teacher-card.is-editing {
  border-color: #1564D9;
  background: #EFF6FF;
}
.team-teacher-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.94rem;
}
.team-role-presets {
  margin: 4px 0 2px;
}
.team-perms-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.team-perm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.team-perm-row input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
  margin: 2px 0 0 !important;
  accent-color: #1564D9;
}
