.module-teacher-legislation {
  margin: 0.3rem 0 1.6rem;
  display: grid;
  gap: 0.8rem;
}

.teacher-page-head {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.9rem 1rem;
}

.teacher-page-head h1 {
  margin: 0;
  font-size: 1.45rem;
}

.teacher-page-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.teacher-head-stats {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.teacher-head-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: #f7edd0;
  font-size: 0.75rem;
  color: #64583e;
}

.teacher-head-stats strong {
  color: #4a3814;
}

.teacher-layout {
  min-height: 68vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0.75rem;
}

.teacher-side-card,
.teacher-main-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.75rem;
}

.teacher-side-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.teacher-side-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.teacher-side-head h2 {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8edcf;
  padding: 0.55rem 0.72rem;
  font-size: 0.96rem;
  color: #4f4124;
}

.teacher-sync-btn {
  appearance: none;
  border: 1px solid #bfd4eb;
  border-radius: 10px;
  background: #ddecff;
  color: #2d5d97;
  font-weight: 700;
  font-size: 0.82rem;
  min-height: 36px;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
}

.teacher-sync-btn:hover {
  background: #d0e4ff;
  border-color: #9ebfe6;
}

.teacher-sync-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.teacher-side-note {
  margin: 0.65rem 0 0;
  padding: 0.55rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fbf4df;
  color: #7a6f54;
  font-size: 0.77rem;
  line-height: 1.4;
}

.teacher-group-list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.42rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.teacher-group-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbf6e7;
  color: #514225;
  text-align: left;
  padding: 0.5rem 0.58rem;
  cursor: pointer;
  font: inherit;
}

.teacher-group-btn:hover {
  background: #f6ebcd;
  border-color: #d7bc74;
}

.teacher-group-btn.is-active {
  background: #fff0cf;
  border-color: #c79b31;
  box-shadow: 0 8px 18px rgba(112, 89, 35, 0.12);
}

.teacher-group-name {
  min-width: 0;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.25;
}

.teacher-group-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
  padding: 0.1rem 0.4rem;
  background: #fff;
  color: #6f6348;
  font-size: 0.74rem;
  font-weight: 700;
}

.teacher-main-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.teacher-main-head {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.68rem 0.75rem;
  background: #fdf9ee;
}

.teacher-main-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #62553b;
  text-align: center;
}

.teacher-legislation-status {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.teacher-legislation-status[data-state='error'] {
  color: #9e2b1c;
  font-weight: 700;
}

.teacher-legislation-status[data-state='success'] {
  color: #245e3f;
  font-weight: 700;
}

.teacher-doc-list {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.46rem;
  align-content: start;
  overflow: auto;
  padding-right: 0.1rem;
}

.teacher-doc-empty {
  color: #7a6f54;
  font-size: 0.84rem;
  text-align: center;
  margin-top: 0.3rem;
}

.teacher-doc-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf8;
  padding: 0.58rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.teacher-doc-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.teacher-doc-copy strong {
  color: #4f4125;
  font-size: 0.86rem;
}

.teacher-doc-meta {
  color: #7a6f54;
  font-size: 0.74rem;
}

.teacher-doc-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  flex-shrink: 0;
}

.teacher-doc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3e1b2;
  color: #735b1f;
  padding: 0.14rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.teacher-doc-badge-live {
  color: #195739;
  border-color: #88c4a4;
  background: #d7f0e3;
}

.teacher-doc-link {
  text-decoration: none;
  border: 1px solid #d7bc74;
  border-radius: 8px;
  background: #f4e3b5;
  color: #5f470d;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.32rem 0.56rem;
}

.teacher-doc-link:hover {
  background: #ecd49a;
  border-color: #c8a24e;
}

@media (max-width: 980px) {
  .teacher-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

@media (max-width: 1020px) and (min-width: 981px) {
  .teacher-layout {
    grid-template-columns: 225px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .teacher-page-head,
  .teacher-side-card,
  .teacher-main-card {
    padding: 0.66rem;
  }

  .teacher-doc-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .teacher-doc-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
