:root {
  --bg: #edf3ee;
  --bg-strong: #ffffff;
  --surface: #fbfcfb;
  --surface-2: #f0f5f1;
  --primary: #326a4b;
  --primary-soft: #e4eee6;
  --primary-dark: #315943;
  --text: #203127;
  --muted: #65756a;
  --border: rgba(37, 67, 48, 0.14);
  --shadow: 0 10px 26px rgba(30, 55, 39, 0.08);
}

html,
body {
  min-height: 100%;
  background: linear-gradient(135deg, #e5eee7 0%, #f3f6f3 54%, #dce8df 100%);
  color: var(--text);
}

.app-shell {
  width: min(100%, 1500px);
  max-width: 1500px;
  padding: 26px 30px 38px;
  color: var(--text);
}

.header {
  position: relative;
  isolation: isolate;
  min-height: 100px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  border-radius: 10px;
  background: linear-gradient(115deg, #172b24 0%, #263c32 100%);
  color: #e7eee9;
  box-shadow: 0 14px 32px rgba(24, 49, 35, 0.13);
}

.header::after {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 35%;
  content: '';
  background: repeating-linear-gradient(135deg, transparent 0 36px, rgba(172, 207, 183, 0.08) 37px 38px);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.header-left,
.header-actions {
  position: relative;
  z-index: 1;
}

.header-title-row {
  gap: 14px;
}

.header-mark {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(24, 49, 38, 0.12);
  border-radius: 8px;
  background: #f5faf6;
  color: #2e6448;
  font-size: 0.82rem;
}

.header-left h2 {
  color: #f0f5f1;
  font-size: 1.55rem;
}

.header-left p {
  margin: 5px 0 0 60px;
  color: #bdcfc2;
  font-size: 0.84rem;
}

.header-actions {
  gap: 10px;
}

.user-pill {
  padding: 9px 12px;
  border-color: rgba(218, 234, 224, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #e0ebe2;
  font-size: 0.82rem;
}

#logoutBtn {
  border: 1px solid rgba(255, 214, 214, 0.28);
  border-radius: 6px;
  background: rgba(239, 146, 149, 0.12);
  color: #ffd1d2;
}

.workspace {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  top: 18px;
  height: calc(100vh - 146px);
  min-height: 460px;
  padding: 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: linear-gradient(160deg, #1d5147 0%, #163e37 72%, #193a34 100%);
  box-shadow: 0 14px 30px rgba(27, 55, 43, 0.13);
}

.sidebar-brand {
  gap: 12px;
  padding: 5px 6px 18px;
}

.sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #f5faf6;
  color: #2e6448;
}

.sidebar-caption {
  color: rgba(237, 245, 240, 0.7);
}

.sidebar-nav {
  gap: 5px;
}

.sidebar-nav .nav-btn {
  min-height: 43px;
  border-radius: 6px;
  color: rgba(237, 245, 240, 0.8);
}

.sidebar-nav .nav-btn.active {
  background: #f5faf6;
  color: #244b37;
}

.sidebar-nav .nav-btn.active .nav-icon {
  background: #326a4b;
  color: #fff;
}

.workspace-main {
  min-width: 0;
}

.student-nav {
  margin-bottom: 20px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fbf9;
  box-shadow: var(--shadow);
}

.student-nav .nav-btn {
  width: auto;
  min-height: 42px;
  border-radius: 6px;
  color: #52665a;
}

.student-nav .nav-btn.active {
  background: #254c38;
  color: #fff;
}

.student-nav .nav-btn.active .nav-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.stats-grid {
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.exam-card,
.question-card,
.result-card,
.exam-viewport {
  border: 1px solid #d7e1d9;
  border-radius: 8px;
  background: #fbfcfb;
  color: #203127;
  box-shadow: 0 8px 20px rgba(30, 55, 39, 0.06);
}

.stat-card {
  padding: 18px 20px;
}

.stat-card .label {
  color: #65756a;
}

.stat-card .value {
  color: #254c38;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel h3 {
  color: #263c30;
}

.exam-card,
.question-card,
.result-card {
  border-color: #e1e9e2;
  background: #f6f9f6;
  box-shadow: none;
}

.exam-meta,
.result-meta {
  color: #64746a;
}

.table-wrap {
  border-radius: 6px;
}

thead {
  background: #edf3ee;
}

th {
  color: #516557;
}

td {
  color: #26372c;
}

.field label {
  color: #46574b;
}

.field input,
.field select,
.field textarea,
.confirm-form input {
  border-color: #d3ded5;
  border-radius: 6px;
  background: #fff;
  color: #26352b;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.confirm-form input:focus {
  border-color: #59836a;
  box-shadow: 0 0 0 3px rgba(89, 131, 106, 0.14);
}

.primary-btn {
  border-radius: 6px;
  background: linear-gradient(135deg, #244c38 0%, #397455 100%);
  box-shadow: 0 6px 14px rgba(35, 77, 55, 0.12);
}

.secondary-btn,
.small-btn {
  border: 1px solid #d1dfd4;
  border-radius: 6px;
  background: #e7f0e9;
  color: #315943;
}

.danger-btn {
  border-radius: 6px;
  background: #fff0ef;
  color: #a64c53;
}

.badge {
  border-radius: 6px;
  background: #e5f0e7;
  color: #315943;
}

.pill {
  border-radius: 5px;
  background: #e5f0e7;
  color: #315943;
}

.pill.success {
  background: #e6f4e8;
  color: #356f42;
}

.pill.warning {
  background: #fff2d9;
  color: #845f20;
}

.student-card {
  border-color: #d7e1d9;
  background: linear-gradient(135deg, #f8fbf8, #e6efe8);
  color: #203127;
}

.option {
  border-color: #d7e1d9;
  background: #f6f9f6;
  color: #26372c;
}

.option:hover {
  border-color: #84aa8d;
}

.timer-box {
  border: 1px solid #d1dfd4;
  border-radius: 6px;
  background: #e7f0e9;
  color: #315943;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #1b3429;
  box-shadow: 0 12px 24px rgba(27, 48, 44, 0.16);
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    padding: 10px;
  }

  .sidebar-brand,
  .sidebar-caption,
  .sidebar-footer {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-nav .nav-btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 14px 12px 26px;
  }

  .header {
    padding: 16px;
  }

  .header-left h2 {
    font-size: 1.35rem;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-pill {
    max-width: 100%;
    white-space: normal;
  }

  .student-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .student-nav .nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .panel {
    padding: 16px;
  }
}

.app-shell .form-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.app-shell .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  min-width: 0;
}

.app-shell .field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.app-shell .field label {
  display: block;
  margin: 0;
  color: #46574b;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.app-shell .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.app-shell .field select,
.app-shell .field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #d3ded5;
  border-radius: 6px;
  background: #fff;
  color: #26352b;
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(30, 55, 39, 0.035);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.app-shell .field textarea {
  min-height: 110px;
  resize: vertical;
}

.app-shell .field input[type="file"] {
  min-height: 46px;
  padding: 7px;
}

.app-shell .field input[type="checkbox"],
.app-shell .field input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #326a4b;
}

.app-shell .field input::placeholder,
.app-shell .field textarea::placeholder {
  color: #89978d;
  opacity: 1;
}

.app-shell .field input:focus,
.app-shell .field select:focus,
.app-shell .field textarea:focus {
  outline: none;
  border-color: #59836a;
  box-shadow: 0 0 0 3px rgba(89, 131, 106, 0.14);
}

.app-shell .field input:disabled,
.app-shell .field select:disabled,
.app-shell .field textarea:disabled {
  background: #edf2ee;
  color: #76847a;
  cursor: not-allowed;
}

.app-shell [hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .app-shell .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

:root {
  --bg: #eaf5ff;
  --bg-strong: #ffffff;
  --surface: #fafdff;
  --surface-2: #edf7ff;
  --primary: #3184c5;
  --primary-soft: #dcedfb;
  --primary-dark: #245c88;
  --text: #1d3448;
  --muted: #60798f;
  --border: rgba(48, 107, 151, 0.18);
  --shadow: 0 10px 26px rgba(37, 91, 132, 0.09);
}

html,
body {
  background: linear-gradient(135deg, #e6f4ff 0%, #f7fbff 54%, #d9edff 100%);
  color: var(--text);
}

.auth-screen {
  background: linear-gradient(135deg, #e6f4ff 0%, #f7fbff 48%, #d8edff 100%);
}

.auth-banner,
.header {
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(115deg, #286f9f 0%, #174e78 100%);
  color: #f5fbff;
  box-shadow: 0 14px 32px rgba(34, 91, 133, 0.16);
}

.auth-screen .auth-banner {
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(115deg, #286f9f 0%, #174e78 100%);
  color: #f5fbff;
}

.auth-screen .auth-banner::after {
  background: repeating-linear-gradient(135deg, transparent 0 34px, rgba(201, 230, 250, 0.12) 35px 36px);
}

.auth-banner-copy h1,
.header-left h2 {
  color: #f5fbff;
}

.auth-banner-copy > p:last-child,
.header-left p {
  color: #c9e6fa;
}

.auth-eyebrow,
.auth-identity-top,
.auth-identity-bottom {
  color: #c7e6fb;
}

.auth-screen .auth-eyebrow {
  color: #c7e6fb;
}

.auth-banner-levels span,
.auth-side-mark {
  border-color: rgba(225, 243, 255, 0.32);
  color: #e5f4ff;
}

.auth-identity-panel {
  background: linear-gradient(145deg, #1d527a 0%, #123a5d 100%);
  color: #f1f8ff;
}

.auth-identity-main h2 span {
  color: #b6ddfa;
}

.auth-identity-rule {
  background: #8bc8f1;
}

.auth-role-list span {
  border: 1px solid rgba(201, 230, 250, 0.28);
  background: rgba(225, 243, 255, 0.1);
  color: #e9f6ff;
}

.sidebar {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, #347eaf 0%, #22648f 72%, #1a527a 100%);
  box-shadow: 0 14px 30px rgba(37, 91, 132, 0.15);
}

.sidebar-brand-mark,
.header-mark {
  background: #e9f6ff;
  color: #245c88;
}

.sidebar-nav .nav-btn.active,
.nav-btn.active {
  background: #e7f4ff;
  color: #245c88;
}

.sidebar-nav .nav-btn.active .nav-icon,
.nav-btn.active .nav-icon {
  background: #3184c5;
  color: #fff;
}

.stat-card,
.panel,
.exam-card,
.question-card,
.result-card,
.exam-viewport {
  border-color: #cfe4f5;
  background: #fbfdff;
  color: #1d3448;
  box-shadow: 0 8px 20px rgba(37, 91, 132, 0.06);
}

.exam-card,
.question-card,
.result-card,
.option {
  border-color: #d6e9f8;
  background: #f3f9ff;
  color: #263f54;
}

.stat-card .label,
.exam-meta,
.result-meta,
th {
  color: #60798f;
}

.stat-card .value,
.panel h3,
td {
  color: #1d3448;
}

thead {
  background: #eaf5ff;
}

.student-nav {
  background: #fafdff;
}

.student-nav .nav-btn {
  color: #526f87;
}

.student-nav .nav-btn.active {
  background: #dcedfb;
  color: #245c88;
}

.field label,
.app-shell .field label {
  color: #405d75;
}

.field input,
.field select,
.field textarea,
.confirm-form input,
.app-shell .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.app-shell .field select,
.app-shell .field textarea {
  border-color: #c8deef;
  background: #fff;
  color: #1d3448;
  box-shadow: inset 0 1px 2px rgba(37, 91, 132, 0.035);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.confirm-form input:focus,
.app-shell .field input:focus,
.app-shell .field select:focus,
.app-shell .field textarea:focus {
  border-color: #4a9bd2;
  box-shadow: 0 0 0 3px rgba(74, 155, 210, 0.16);
}

.app-shell .field input[type="checkbox"],
.app-shell .field input[type="radio"] {
  accent-color: #3184c5;
}

.primary-btn,
.auth-login-panel .primary-btn,
.auth-screen .auth-login-panel .auth-form .primary-btn {
  background: linear-gradient(135deg, #3184c5 0%, #236da7 100%);
  box-shadow: 0 6px 14px rgba(35, 109, 167, 0.16);
}

.secondary-btn,
.small-btn {
  border-color: #c5dff2;
  background: #e7f4ff;
  color: #245c88;
}

.secondary-btn:hover,
.small-btn:hover {
  background: #d5ebfb;
}

.badge,
.pill,
.timer-box {
  border-color: #c5dff2;
  background: #e5f3ff;
  color: #245c88;
}

.student-card {
  border-color: #cfe4f5;
  background: linear-gradient(135deg, #f8fcff, #e7f4ff);
  color: #1d3448;
}

.option:hover {
  border-color: #76b7e3;
}

.toast {
  border-color: rgba(255, 255, 255, 0.18);
  background: #174e78;
  color: #f5fbff;
  box-shadow: 0 12px 24px rgba(23, 78, 120, 0.18);
}

.exam-completion-notice {
  color: #236da7;
}

.class-summary-trigger {
  color: #236da7;
}

.class-summary-trigger:hover {
  color: #174e78;
}

.auth-login-panel {
  background: #fbfdff;
  color: #1d3448;
}

.auth-login-heading .auth-eyebrow {
  color: #3184c5;
}

.auth-login-panel .field label {
  color: #405d75;
}

.auth-login-panel .field input,
.auth-login-panel .field select {
  border-color: #c8deef;
  color: #1d3448;
}

.auth-screen .auth-login-panel .auth-form .field input:focus,
.auth-screen .auth-login-panel .auth-form .field select:focus {
  border-color: #4a9bd2;
  box-shadow: 0 0 0 3px rgba(74, 155, 210, 0.16);
}

.admin-school-theme .school-admin-dashboard-stats > .stat-card {
  background-size: 200% 200%;
  animation: school-admin-stat-color-shift 14s ease-in-out infinite alternate;
}

.admin-school-theme .school-admin-dashboard-stats > .stat-card:nth-child(1) {
  animation-delay: 0s;
}

.admin-school-theme .school-admin-dashboard-stats > .stat-card:nth-child(2) {
  animation-delay: -3.5s;
}

.admin-school-theme .school-admin-dashboard-stats > .stat-card:nth-child(3) {
  animation-delay: -7s;
}

.admin-school-theme .school-admin-dashboard-stats > .stat-card:nth-child(4) {
  animation-delay: -10.5s;
}

@keyframes school-admin-stat-color-shift {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

.admin-school-theme button:not(.nav-btn):not(#logoutBtn) {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(188, 211, 231, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, #287db8 0%, #3c9bce 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(36, 117, 171, 0.2);
}

.admin-school-theme button:not(.nav-btn):not(#logoutBtn):hover,
.admin-school-theme button:not(.nav-btn):not(#logoutBtn):focus-visible {
  background: linear-gradient(135deg, #246fa5 0%, #3185b3 100%);
}

.admin-school-theme button:not(.nav-btn):not(#logoutBtn):disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  .admin-school-theme .school-admin-dashboard-stats > .stat-card {
    animation: none;
  }
}

@media (max-width: 600px) {
  .app-shell .sidebar {
    position: fixed;
    z-index: 100;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  .app-shell .sidebar-nav {
    position: fixed;
    z-index: 100;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    background: #fafdff;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
  }

  .app-shell .sidebar-nav::-webkit-scrollbar {
    display: none;
  }
}

.mobile-menu-toggle,
.mobile-nav {
  display: none;
}

.teacher-welcome {
  margin: 0 0 18px;
  padding: 18px 22px;
  border: 1px solid rgba(50, 106, 75, 0.14);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: linear-gradient(110deg, #fff 0%, #edf5ef 100%);
  box-shadow: var(--shadow);
}

.teacher-welcome h2 {
  margin: 0;
  color: #244b34;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  line-height: 1.3;
}

.unregistered-key-card {
  display: grid;
  gap: 12px;
}

.unregistered-key-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.unregistered-key-value code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.super-admin-account-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(88dvh, 680px);
  padding: clamp(20px, 4vw, 30px);
  border-color: #d3e2d6;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(24, 55, 37, 0.22);
}

.super-admin-account-dialog .question-dialog-header {
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

.super-admin-account-dialog .question-dialog-header h2 {
  margin: 0;
  color: #244b34;
  font-size: 1.3rem;
  line-height: 1.3;
}

.super-admin-account-dialog .question-dialog-header p {
  margin: 6px 0 0;
  color: #64746a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.super-admin-account-dialog .question-dialog-header .secondary-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
}

.super-admin-account-dialog #superAdminAccountForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.super-admin-account-dialog #superAdminAccountForm .field {
  min-width: 0;
  gap: 8px;
}

.super-admin-account-dialog #superAdminAccountForm .field label {
  color: #294c35;
  font-size: 0.88rem;
  font-weight: 750;
}

.super-admin-account-dialog #superAdminAccountForm .field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #cbd9ce;
  border-radius: 8px;
  background: #fff;
  color: #203127;
  font: inherit;
  line-height: 1.4;
}

.super-admin-account-dialog #superAdminAccountForm .field input:focus {
  outline: none;
  border-color: #59836a;
  box-shadow: 0 0 0 3px rgba(89, 131, 106, 0.16);
}

.super-admin-account-dialog #superAdminAccountForm .super-admin-password-note,
.super-admin-account-dialog #superAdminAccountStatus,
.super-admin-account-dialog #superAdminAccountForm .compact-actions {
  grid-column: 1 / -1;
}

.super-admin-account-dialog #superAdminAccountForm .super-admin-password-note {
  margin: -4px 0 0;
  color: #64746a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.super-admin-account-dialog #superAdminAccountForm .compact-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.super-admin-account-dialog #saveSuperAdminAccount {
  min-width: 180px;
  min-height: 46px;
}

.school-settings-account-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(110deg, #fff 0%, #edf5ef 100%);
}

.school-settings-account-action > div {
  display: grid;
  gap: 4px;
}

.school-settings-account-action > div strong {
  color: #244b34;
}

.school-settings-account-action > div span {
  color: #64746a;
  font-size: 0.84rem;
}

.school-admin-password-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(88dvh, 680px);
  padding: clamp(20px, 4vw, 30px);
  border-color: #d3e2d6;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(24, 55, 37, 0.22);
}

.school-admin-password-dialog .question-dialog-header {
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

.school-admin-password-dialog .question-dialog-header h2 {
  margin: 0;
  color: #244b34;
  font-size: 1.25rem;
  line-height: 1.3;
}

.school-admin-password-dialog .question-dialog-header p {
  margin: 6px 0 0;
  color: #64746a;
  font-size: 0.86rem;
  line-height: 1.45;
}

.school-admin-password-dialog #schoolAdminPasswordForm {
  gap: 16px;
}

.school-admin-password-dialog #schoolAdminPasswordForm .field {
  gap: 8px;
}

.school-admin-password-dialog #schoolAdminPasswordForm .field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #cbd9ce;
  border-radius: 8px;
  background: #fff;
  color: #203127;
  font: inherit;
}

.school-admin-password-dialog #schoolAdminPasswordForm .field input:focus {
  outline: none;
  border-color: #59836a;
  box-shadow: 0 0 0 3px rgba(89, 131, 106, 0.16);
}

.school-admin-password-dialog #schoolAdminPasswordForm .compact-actions {
  display: flex;
  justify-content: flex-end;
}

.school-admin-password-dialog #saveSchoolAdminPassword {
  min-width: 190px;
  min-height: 46px;
}

@media (max-width: 1050px) {
  .app-shell {
    position: relative;
  }

  .header {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: visible;
  }

  .header-left {
    min-width: 0;
  }

  .mobile-menu-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    place-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .mobile-menu-open .mobile-menu-toggle span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-open .mobile-menu-toggle span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }

  .mobile-nav {
    position: absolute;
    z-index: 40;
    top: calc(100% - 8px);
    right: 0;
    left: 0;
    display: none;
    gap: 4px;
    max-height: min(70vh, 560px);
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .mobile-menu-open .mobile-nav {
    display: grid;
  }

  .mobile-nav .nav-btn {
    min-height: 46px;
    padding: 8px 10px;
    color: var(--text);
    white-space: normal;
  }

  .mobile-nav .nav-btn.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
  }

  .mobile-nav .nav-icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
  }

  .app-shell .sidebar,
  .app-shell .student-nav {
    display: none !important;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .header {
    flex-direction: initial;
    align-items: center;
  }

  .header-actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding-bottom: 26px;
  }

  .header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-actions {
    flex-direction: row;
    align-items: center;
  }

  .unregistered-key-value {
    align-items: stretch;
    flex-direction: column;
  }

  .school-settings-account-action {
    align-items: stretch;
    flex-direction: column;
  }

  .school-admin-password-dialog #saveSchoolAdminPassword {
    width: 100%;
  }

  .super-admin-account-dialog #superAdminAccountForm .field,
  .super-admin-account-dialog #superAdminAccountForm .super-admin-password-note,
  .super-admin-account-dialog #superAdminAccountStatus,
  .super-admin-account-dialog #superAdminAccountForm .compact-actions {
    grid-column: 1;
  }

  .super-admin-account-dialog #superAdminAccountForm {
    grid-template-columns: minmax(0, 1fr);
  }
}

.language-control {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 1200;
}

.sidebar-footer-copy .language-control {
  position: static;
  margin-top: 10px;
}

.access-page > .language-control {
  position: static;
  width: fit-content;
  margin: 12px auto 0;
}

.language-trigger {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 999px;
  background: #fff;
  color: #17324f;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.language-trigger:hover,
.language-trigger:focus-visible {
  border-color: #168b74;
  outline: 3px solid rgba(22, 139, 116, 0.18);
}

.language-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
}

.language-dialog .question-dialog-header {
  justify-content: space-between;
}

.language-dialog .question-dialog-header p {
  margin: 6px 0 0;
  color: #64748b;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.language-choice[aria-pressed="true"] {
  border-color: #168b74;
  background: #e8f7f2;
  color: #126653;
}

@media (max-width: 1050px) {
  .sidebar-footer-copy .language-control {
    position: fixed;
    right: 16px;
    bottom: 14px;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .language-control {
    right: 12px;
    bottom: 12px;
  }

  .language-trigger {
    min-height: 38px;
    padding: 8px 12px;
  }

  .language-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .super-admin-account-dialog #saveSuperAdminAccount {
    width: 100%;
  }
}
