:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #dbe4ff;
  --accent: #2458d3;
  --accent-dark: #173b8f;
  --ok: #14763f;
  --warn: #a15c00;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

html,
body,
#teacher-app {
  max-width: 100%;
  overflow-x: hidden;
}

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

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

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

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

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

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

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

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

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

.web-login-title {
  margin: 0;
  color: #2e2f35;
  font-size: 27px;
  line-height: 1.17;
  font-weight: 800;
  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 {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 3px;
  border-radius: 999px;
  background: #2373d8;
}

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

.web-login-icon-button {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

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

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

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

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

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

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

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

.teacher-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 24px;
}

.teacher-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.teacher-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #b9c8ff;
  border-radius: 10px;
  background: #eef3ff;
  color: var(--accent-dark);
  font-weight: 900;
}

.teacher-brand h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.teacher-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.teacher-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.teacher-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cdd8ff;
  border-radius: 10px;
  background: #ffffff;
  color: #24324b;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.teacher-button:hover {
  border-color: #9db2ff;
}

.teacher-button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.teacher-button--primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.teacher-button[disabled] {
  cursor: default;
  opacity: 0.52;
}

.teacher-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.teacher-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  background: #ffffff;
  color: #445066;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.teacher-pill--ok {
  border-color: #98efbc;
  background: #edfdf3;
  color: var(--ok);
}

.teacher-pill--warn {
  border-color: #ffdca8;
  background: #fff7e8;
  color: var(--warn);
}

.teacher-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.teacher-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(19, 32, 67, 0.08);
  overflow: hidden;
}

.teacher-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf1ff;
}

.teacher-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

.teacher-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.teacher-panel-body {
  padding: 20px 22px 22px;
}

.teacher-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.teacher-kpi {
  min-height: 92px;
  border: 1px solid #e2e8ff;
  border-radius: 10px;
  background: #fbfcff;
  padding: 14px;
}

.teacher-kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.teacher-kpi strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.teacher-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.teacher-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #edf1ff;
  border-radius: 10px;
  padding: 12px 14px;
}

.teacher-list strong {
  font-size: 15px;
  line-height: 1.25;
}

.teacher-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: right;
}

.teacher-profile {
  display: grid;
  gap: 10px;
}

.teacher-profile-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid #edf1ff;
  padding-bottom: 10px;
}

.teacher-profile-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.teacher-profile-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.teacher-profile-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.teacher-login {
  display: grid;
  gap: 12px;
}

.teacher-alert {
  border: 1px solid #ffdca8;
  border-radius: 10px;
  background: #fff8ec;
  color: #6b4200;
  padding: 12px 14px;
  font-weight: 750;
}

.teacher-error {
  border: 1px solid #ffc7c7;
  background: #fff1f1;
  color: #9f1d1d;
}

.teacher-muted {
  color: var(--muted);
}

@media (max-width: 820px) {
  .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 {
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
  }

  .teacher-shell {
    width: min(100%, calc(100vw - 22px));
    padding-top: 14px;
  }

  .teacher-topbar,
  .teacher-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-actions {
    justify-content: flex-start;
  }

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

  .teacher-profile-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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

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