/* Служебный слой: админка образовательного контента и мелкие состояния JS.
   Публичный дизайн живёт в school-* классах из edu.css. */

.e-admin {
  width: min(1240px, calc(100% - 40px));
  margin: 32px auto 72px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
}

.e-admin__side,
.e-admin__main,
.e-auth-card,
.e-empty,
.e-card,
.e-builder-item,
.e-note,
.e-stat,
.e-list-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(11,31,82,.08);
}

.e-admin__side {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 18px;
}

.e-admin__side h2 {
  margin: 12px 10px 8px;
  color: var(--pale);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.e-admin__side a {
  display: block;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  font-weight: 800;
}

.e-admin__side a:hover,
.e-admin__side a.is-active {
  background: var(--soft);
  color: var(--blue-2);
}

.e-admin__main { padding: 24px; }

.e-admin__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.e-admin__bar h1,
.e-m0 { margin: 0; }

.e-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.e-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.e-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.e-field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.e-field small,
.e-muted,
.e-sm {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.e-textarea { min-height: 120px; resize: vertical; }
.e-textarea--tall { min-height: 260px; }

.e-btn,
.e-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 99px;
  padding: 11px 18px;
  font-weight: 900;
  cursor: pointer;
}

.e-btn--primary { background: var(--blue); color: #fff; }
.e-btn--ghost { border: 1px solid var(--line-2); background: #fff; color: var(--blue-2); }
.e-btn--soft { background: var(--soft); color: var(--blue-2); }
.e-btn--block { width: 100%; }
.e-btn--sm,
.e-mini { padding: 8px 12px; font-size: 12.5px; }
.e-mini--danger { background: var(--red-bg); color: var(--red); }

.e-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.e-check--inline { white-space: nowrap; font-size: 12px; }

.e-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.e-table th,
.e-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

.e-table th {
  color: var(--pale);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.e-nowrap { white-space: nowrap; }
.e-inline { display: inline; }

.e-statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.e-stat { padding: 18px; }
.e-stat strong { display: block; font-family: "Unbounded", sans-serif; font-size: 26px; }
.e-stat span { color: var(--muted); }

.e-grid { display: grid; gap: 14px; }
.e-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.e-mt-16 { margin-top: 16px; }
.e-mt-20 { margin-top: 20px; }
.e-mb-18 { margin-bottom: 18px; }

.e-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.e-card { padding: 18px; }
.e-go,
.e-link { color: var(--blue); font-weight: 900; }

.e-note { padding: 14px 16px; color: var(--text); }
.e-note--soft { background: var(--soft); box-shadow: none; }
.e-err { color: var(--red); }

.e-auth-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.e-auth-card {
  width: min(420px, 100%);
  padding: 28px;
  text-align: center;
}

.e-brand__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), #16307A);
  color: #fff;
}

.e-attach-admin {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.e-attach-admin__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 84px auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}

.e-attach-admin__ext {
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.e-attach-admin__order { text-align: center; }

[data-qbuilder] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.e-qbuilder-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.e-builder-item {
  padding: 16px;
}

.e-builder-item__head,
.e-opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.e-builder-item__head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.e-opt-row {
  margin: 8px 0;
}

.e-opt-row .e-input { flex: 1; }
.e-select--inline { width: auto; }

.is-loading { opacity: .65; pointer-events: none; }

@media (max-width: 900px) {
  .e-admin { grid-template-columns: 1fr; width: min(100% - 28px, 1240px); }
  .e-admin__side { position: static; }
  .e-row,
  .e-grid--2,
  .e-attach-admin__row { grid-template-columns: 1fr; }
}
