:root {
  color-scheme: light;
  --teacher-bg: #f4f7fb;
  --teacher-surface: #ffffff;
  --teacher-ink: #151c2b;
  --teacher-muted: #657084;
  --teacher-line: #dfe6f2;
  --teacher-accent: #3268d7;
  --teacher-accent-soft: #edf3ff;
  --teacher-success: #237945;
  --teacher-danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body,
#teacher-app {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--teacher-ink);
  background: var(--teacher-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.teacher-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.teacher-shell--web-login,
.teacher-shell--boot {
  width: 100%;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
}

.teacher-shell--web-login {
  background: #ffffff;
}

.web-login {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #ffffff;
}

.web-login-photo {
  flex: 0 0 auto;
  width: auto;
  height: 100vh;
  overflow: hidden;
  background: #edf1ec;
}

.web-login-photo img {
  display: block;
  width: auto;
  height: 100vh;
  object-fit: cover;
}

.web-login-main {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100vh;
  padding: 56px 48px;
}

.web-login-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 360px);
  text-align: center;
}

.web-login-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 20px;
  object-fit: contain;
}

.web-login-title {
  margin: 0;
  color: #2e2f35;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.17;
  letter-spacing: 0.1em;
}

.web-login-tab {
  position: relative;
  margin-top: 32px;
  color: #2373d8;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.web-login-tab::after {
  position: absolute;
  right: 0;
  bottom: -12px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: #2373d8;
  content: "";
}

.web-login-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 56px;
}

.web-login-icon-button {
  width: 74px;
  height: 74px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.web-login-icon-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.web-login-icon-button:not(:disabled):hover {
  filter: drop-shadow(0 10px 16px rgba(37, 99, 235, 0.18));
  transform: translateY(-2px);
}

.web-login-icon-button:active {
  transform: scale(0.98);
}

.web-login-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.web-login-error,
.web-login-message {
  width: min(100%, 340px);
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.web-login-error {
  color: var(--teacher-danger);
}

.web-login-message {
  color: #344054;
}

.web-login-footer {
  position: absolute;
  right: 28px;
  bottom: 22px;
  color: #747782;
  font-size: 13px;
  line-height: 1;
}

.teacher-application {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--teacher-bg);
}

.teacher-rail {
  display: flex;
  position: sticky;
  top: 0;
  flex-direction: column;
  align-self: start;
  min-height: 100vh;
  padding: 28px 16px 20px;
  border-right: 1px solid var(--teacher-line);
  background: #ffffff;
}

.teacher-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 26px;
}

.teacher-identity img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.teacher-identity strong,
.teacher-identity span,
.teacher-rail-account strong,
.teacher-rail-account span {
  display: block;
}

.teacher-identity strong {
  font-size: 18px;
  line-height: 1.15;
}

.teacher-identity span,
.teacher-rail-account span {
  margin-top: 4px;
  color: var(--teacher-muted);
  font-size: 12px;
  line-height: 1.25;
}

.teacher-navigation {
  display: grid;
  gap: 4px;
}

.teacher-nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #475267;
  padding: 10px 12px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.teacher-nav-item:hover {
  background: #f3f6fb;
  color: var(--teacher-ink);
}

.teacher-nav-item--active {
  border-color: #d8e4ff;
  background: var(--teacher-accent-soft);
  color: #224ca7;
}

.teacher-rail-account {
  margin-top: auto;
  padding: 16px 10px 2px;
  border-top: 1px solid var(--teacher-line);
}

.teacher-rail-account strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-workspace {
  min-width: 0;
}

.teacher-workspace-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 74px;
  padding: 16px 42px;
  border-bottom: 1px solid var(--teacher-line);
  background: rgba(255, 255, 255, 0.84);
}

.teacher-workspace-mobile-brand {
  display: none;
}

.teacher-workspace-actions {
  display: flex;
  gap: 8px;
}

.teacher-button,
.teacher-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #cad7ef;
  border-radius: 7px;
  background: #ffffff;
  color: #26364f;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.teacher-button:hover,
.teacher-text-button:hover {
  border-color: #94afe8;
  color: #173b8f;
}

.teacher-button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--teacher-muted);
}

.teacher-page {
  width: min(1180px, calc(100vw - 248px));
  margin: 0 auto;
  padding: 42px;
}

.teacher-app-error {
  width: min(1180px, calc(100vw - 248px - 84px));
  margin: 22px auto -12px;
  border: 1px solid #ffc6c2;
  border-radius: 7px;
  background: #fff3f1;
  color: var(--teacher-danger);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.teacher-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.teacher-page-heading h1,
.teacher-section-header h2,
.teacher-empty h2 {
  margin: 0;
  color: var(--teacher-ink);
  letter-spacing: 0;
}

.teacher-page-heading h1 {
  max-width: 760px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.12;
}

.teacher-page-heading > div > p:last-child,
.teacher-section-header p,
.teacher-empty p {
  margin: 8px 0 0;
  color: var(--teacher-muted);
  font-size: 15px;
  line-height: 1.45;
}

.teacher-eyebrow {
  margin: 0 0 8px;
  color: #3268d7;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.teacher-mode-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: #ffffff;
}

.teacher-mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--teacher-muted);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.teacher-mode-button--active {
  background: var(--teacher-ink);
  color: #ffffff;
}

.teacher-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.teacher-metric {
  min-height: 112px;
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 17px;
  color: var(--teacher-ink);
  text-align: left;
  cursor: pointer;
}

.teacher-metric:hover {
  border-color: #a8bfef;
  box-shadow: 0 8px 20px rgba(44, 73, 125, 0.08);
}

.teacher-metric span,
.teacher-metric strong {
  display: block;
}

.teacher-metric span {
  color: var(--teacher-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.teacher-metric strong {
  margin-top: 18px;
  font-size: 30px;
  line-height: 1;
}

.teacher-section + .teacher-section {
  margin-top: 34px;
}

.teacher-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.teacher-section-header h2,
.teacher-empty h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.teacher-text-button {
  flex: 0 0 auto;
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: #3268d7;
  padding: 6px 0;
}

.teacher-records {
  border-top: 1px solid var(--teacher-line);
  background: #ffffff;
}

.teacher-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 90px;
  border: 1px solid var(--teacher-line);
  border-top: 0;
  padding: 18px 20px;
}

.teacher-record:first-child {
  border-top: 1px solid var(--teacher-line);
  border-radius: 8px 8px 0 0;
}

.teacher-record:last-child {
  border-radius: 0 0 8px 8px;
}

.teacher-record-main {
  min-width: 0;
}

.teacher-record h3 {
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-record p {
  margin: 5px 0 0;
  color: var(--teacher-muted);
  font-size: 14px;
  line-height: 1.3;
}

.teacher-record-meta {
  display: flex;
  flex: 0 0 auto;
  gap: 24px;
  margin: 0;
}

.teacher-record-meta div {
  min-width: 70px;
}

.teacher-record-meta dt,
.teacher-record-meta dd,
.teacher-profile-grid dt,
.teacher-profile-grid dd {
  margin: 0;
}

.teacher-record-meta dt,
.teacher-profile-grid dt {
  color: var(--teacher-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.teacher-record-meta dd {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.teacher-record-meta--result div {
  min-width: 94px;
}

.teacher-empty {
  border: 1px dashed #cbd8ef;
  border-radius: 8px;
  background: #f9fbff;
  padding: 30px;
}

.teacher-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--teacher-line);
}

.teacher-profile-grid div {
  min-height: 102px;
  padding: 20px;
  border-right: 1px solid var(--teacher-line);
  border-bottom: 1px solid var(--teacher-line);
  background: #ffffff;
}

.teacher-profile-grid div:nth-child(2n) {
  border-right: 0;
}

.teacher-profile-grid div:nth-child(1),
.teacher-profile-grid div:nth-child(2) {
  border-top: 1px solid var(--teacher-line);
}

.teacher-profile-grid div:nth-child(1) {
  border-radius: 8px 0 0 0;
}

.teacher-profile-grid div:nth-child(2) {
  border-radius: 0 8px 0 0;
}

.teacher-profile-grid div:nth-last-child(2):nth-child(odd) {
  border-radius: 0 0 0 8px;
}

.teacher-profile-grid div:last-child {
  border-radius: 0 0 8px 0;
}

.teacher-profile-grid dd {
  margin-top: 11px;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

@media (max-width: 980px) {
  .teacher-page {
    padding: 30px;
  }

  .teacher-workspace-header {
    padding: 16px 30px;
  }

  .teacher-app-error {
    width: min(1180px, calc(100vw - 248px - 60px));
  }

  .teacher-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .web-login-photo {
    display: none;
  }

  .web-login-main {
    padding: 44px 24px 64px;
  }

  .web-login-center {
    width: min(100%, 330px);
  }

  .web-login-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
  }

  .web-login-title {
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: 0.08em;
  }

  .web-login-tab {
    margin-top: 28px;
    font-size: 19px;
  }

  .web-login-actions {
    gap: 20px;
    margin-top: 52px;
  }

  .web-login-icon-button {
    width: 68px;
    height: 68px;
  }

  .web-login-footer {
    right: 0;
    bottom: 18px;
    left: 0;
    text-align: center;
  }

  .teacher-application {
    display: block;
  }

  .teacher-rail {
    display: block;
    position: static;
    min-height: 0;
    padding: 15px 0 0;
    border-right: 0;
    border-bottom: 1px solid var(--teacher-line);
  }

  .teacher-identity,
  .teacher-rail-account {
    display: none;
  }

  .teacher-navigation {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 0 14px 14px;
    scrollbar-width: none;
  }

  .teacher-navigation::-webkit-scrollbar {
    display: none;
  }

  .teacher-nav-item {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .teacher-workspace-header {
    justify-content: space-between;
    min-height: 60px;
    padding: 12px 16px;
  }

  .teacher-workspace-mobile-brand {
    display: block;
    font-size: 15px;
  }

  .teacher-workspace-actions {
    gap: 3px;
  }

  .teacher-button {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .teacher-page {
    width: 100%;
    padding: 26px 16px 38px;
  }

  .teacher-app-error {
    width: calc(100% - 32px);
    margin: 16px auto -6px;
  }

  .teacher-page-heading {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }

  .teacher-page-heading h1 {
    font-size: 28px;
  }

  .teacher-metrics {
    gap: 9px;
    margin-bottom: 30px;
  }

  .teacher-metric {
    min-height: 96px;
    padding: 14px;
  }

  .teacher-metric strong {
    margin-top: 14px;
    font-size: 25px;
  }

  .teacher-section + .teacher-section {
    margin-top: 28px;
  }

  .teacher-section-header {
    align-items: flex-start;
  }

  .teacher-record {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .teacher-record-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
  }

  .teacher-record-meta--result {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .teacher-record-meta div,
  .teacher-record-meta--result div {
    min-width: 0;
  }

  .teacher-profile-grid {
    grid-template-columns: 1fr;
  }

  .teacher-profile-grid div,
  .teacher-profile-grid div:nth-child(2n) {
    min-height: 0;
    border-right: 1px solid var(--teacher-line);
    border-radius: 0;
  }

  .teacher-profile-grid div:first-child {
    border-radius: 8px 8px 0 0;
  }

  .teacher-profile-grid div:last-child {
    border-radius: 0 0 8px 8px;
  }
}

@media (max-width: 360px) {
  .web-login-actions {
    gap: 16px;
  }

  .web-login-icon-button {
    width: 60px;
    height: 60px;
  }

  .teacher-record-meta--result {
    grid-template-columns: 1fr;
  }
}
