:root {
  --bg: #f3f8ff;
  --bg-soft: #e8f2ff;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(72, 120, 183, 0.22);
  --text: #193252;
  --text-soft: #4d688d;
  --brand: #2f7dff;
  --brand-2: #25b6d2;
  --ok: #0f9f66;
  --danger: #d63f59;
  --warn: #d08b14;
  --shadow: 0 18px 40px rgba(26, 72, 138, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
  background:
    radial-gradient(circle at 10% 8%, rgba(106, 169, 255, 0.35), transparent 38%),
    radial-gradient(circle at 90% 0%, rgba(123, 225, 247, 0.34), transparent 32%),
    linear-gradient(145deg, #f5f9ff 0%, #e8f2ff 44%, #eef6ff 100%);
  background-attachment: fixed;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(246, 251, 255, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1240px, calc(100% - 34px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-title {
  margin: 0;
  font-size: 1.16rem;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 12px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(40, 128, 255, 0.28);
}

.site-nav .nav-admin {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(120deg, #1c4ea2, #256fd6);
  border-color: transparent;
}

.container {
  width: min(1240px, calc(100% - 34px));
  margin: 22px auto 34px;
}

.hero {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.8), rgba(238, 247, 255, 0.68));
  backdrop-filter: blur(20px);
  padding: clamp(18px, 4vw, 34px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s ease;
}

.hero::after {
  content: "";
  position: absolute;
  top: -85px;
  right: -70px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 125, 255, 0.23), rgba(47, 125, 255, 0));
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.58rem, 3.2vw, 2.16rem);
}

.hero p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.75;
  max-width: 880px;
}

.grid-cards {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel,
.stat-card,
.chart-card,
.status-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.card h3 {
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.card-link {
  display: inline-block;
  margin-top: 12px;
  color: #1a5dcc;
  font-weight: 700;
  text-decoration: none;
}

.card-link:hover {
  color: #14499f;
}

.panel .panel-title {
  margin: 0;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.module-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 14px;
}

.dept-nav {
  padding: 10px;
  display: grid;
  gap: 6px;
  max-height: 72vh;
  overflow: auto;
}

.dept-nav a {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-soft);
  padding: 10px 11px;
}

.dept-nav a:hover,
.dept-nav a.active {
  color: #154f9f;
  background: #e7f2ff;
  border-color: rgba(52, 114, 191, 0.25);
}

.dept-content {
  padding: 14px;
  display: grid;
  gap: 12px;
}

details.dept-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-strong);
  overflow: hidden;
}

details.dept-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

details.dept-item summary::-webkit-details-marker {
  display: none;
}

.dept-item-content {
  padding: 12px 14px 14px;
  white-space: pre-line;
  line-height: 1.76;
  color: var(--text-soft);
}

.toolbar,
.filters,
.form-grid {
  display: grid;
  gap: 10px;
}

.toolbar {
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(81, 132, 191, 0.28);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-warning,
.btn-success {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-success:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.btn-secondary {
  color: #174a94;
  background: #e8f1ff;
  border-color: rgba(78, 124, 187, 0.3);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(120deg, #d14b61, #ea6375);
}

.btn-warning {
  color: #fff;
  background: linear-gradient(120deg, #cd8a1c, #e8aa38);
}

.btn-success {
  color: #fff;
  background: linear-gradient(120deg, #0f9f66, #1eb682);
}

.stats-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 12px 14px;
}

.stat-label {
  color: var(--text-soft);
}

.stat-value {
  margin-top: 8px;
  font-size: 1.56rem;
  font-weight: 700;
}

.table-wrap {
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.86);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(78, 124, 187, 0.15);
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  background: #edf5ff;
}

.tag-plus,
.tag-minus {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 0.82rem;
}

.tag-plus {
  color: #0b6a44;
  background: #c9f6e6;
}

.tag-minus {
  color: #9f2940;
  background: #ffd7df;
}

.pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-overview {
  border: 1px solid rgba(72, 120, 183, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

.score-overview-header,
.table-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.score-overview-header h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.score-overview-header p {
  margin: 0;
}

.score-overview-actions,
.table-selection {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.student-score-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-score-card {
  display: block;
  border: 1px solid rgba(72, 120, 183, 0.16);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.student-score-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 255, 0.28);
  box-shadow: 0 12px 24px rgba(37, 92, 166, 0.12);
}

.student-score-card.selected {
  border-color: rgba(47, 125, 255, 0.45);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(226, 240, 255, 0.94));
  box-shadow: 0 14px 26px rgba(37, 92, 166, 0.14);
}

.student-score-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-score-name {
  font-weight: 700;
}

.student-score-value {
  margin-top: 12px;
  font-size: 1.46rem;
  font-weight: 800;
}

.student-score-value.plus {
  color: #0c8f5a;
}

.student-score-value.minus {
  color: #c43d57;
}

.student-score-value.neutral {
  color: var(--text);
}

.student-score-meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.student-score-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(232, 241, 255, 0.9);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.student-score-empty {
  padding: 20px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(72, 120, 183, 0.22);
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
}

.score-form-note {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

.table-tools {
  margin-top: 14px;
}

.table-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.message {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
}

.message.success {
  color: #0e7b4f;
  background: #ddf8ee;
}

.message.error {
  color: #b0324d;
  background: #ffe3e9;
}

.muted {
  color: var(--text-soft);
}

.announcement-box {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(55, 125, 205, 0.35);
  background: rgba(255, 255, 255, 0.7);
  padding: 14px;
}

.announcement-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.announcement-item {
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(74, 127, 190, 0.2);
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
}

.announcement-item h4 {
  margin: 0 0 6px;
}

.announcement-item p {
  margin: 0;
  line-height: 1.72;
  color: var(--text-soft);
}

.announcement-meta {
  margin-top: 6px;
  color: #6584ad;
  font-size: 0.85rem;
  display: flex;
  gap: 10px;
}

.chart-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.chart-title {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.chart-box {
  width: 100%;
  height: 300px;
}

.dashboard-hero-intro {
  min-height: 0;
}

.dashboard-hero-copy {
  max-width: 760px;
}

.dashboard-ai-panel {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(72, 120, 183, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(234, 244, 255, 0.8)),
    radial-gradient(circle at top right, rgba(47, 125, 255, 0.12), transparent 36%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-ai-ribbon {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: start;
}

.dashboard-ai-summary-block {
  min-width: 0;
}

.dashboard-ai-head {
  display: block;
}

.dashboard-ai-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1659bf;
  background: rgba(47, 125, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-ai-title {
  margin: 8px 0 0;
  font-size: 0.96rem;
}

.dashboard-ai-refresh {
  padding-inline: 14px;
  min-width: 74px;
}

.dashboard-ai-content {
  margin-top: 10px;
  line-height: 1.6;
  color: var(--text);
  font-size: 0.88rem;
  min-height: 54px;
  max-height: 76px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.dashboard-ai-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
}

.dashboard-ai-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.8rem;
  justify-content: flex-end;
}

.dashboard-ai-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-ai-meta span,
.dashboard-inline-message {
  padding: 6px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(72, 120, 183, 0.14);
}

.dashboard-inline-message {
  margin-top: 8px;
  display: block;
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.55;
}

.dashboard-inline-message.success {
  color: #0d7d4d;
  background: rgba(221, 248, 238, 0.92);
}

.dashboard-inline-message.warning {
  color: #9d4e0f;
  background: rgba(255, 239, 219, 0.96);
}

.status-grid {
  margin-top: 14px;
  display: grid;
  gap: 11px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-card {
  padding: 13px;
}

.status-key {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.status-value {
  margin-top: 7px;
  font-size: 1.08rem;
  font-weight: 700;
}

.footer {
  margin-top: auto;
  text-align: center;
  color: #5f7ea7;
  padding: 16px 10px 22px;
  font-size: 0.9rem;
}

.login-box {
  max-width: 520px;
  margin: 24px auto;
}

.login-shell {
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.login-stage {
  display: contents;
}

.login-box--intro,
.login-box--form {
  margin: 0;
  max-width: none;
  overflow: hidden;
}

.login-intro {
  padding: 24px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(47, 125, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(235, 245, 255, 0.88));
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 125, 255, 0.12);
  color: #1f5dc4;
  font-size: 0.84rem;
  font-weight: 700;
}

.login-intro h3 {
  margin: 14px 0 10px;
  font-size: 1.7rem;
}

.login-intro p {
  margin: 0;
  line-height: 1.8;
  color: var(--text-soft);
}

.login-feature-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.login-feature-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(72, 120, 183, 0.16);
  background: rgba(255, 255, 255, 0.74);
}

.login-feature-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.login-feature-item span {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.login-form-wrap {
  padding: 18px 18px 16px;
}

.login-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-field--full {
  grid-column: span 2;
}

.captcha-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(81, 132, 191, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.captcha-image {
  display: block;
  width: 156px;
  min-width: 156px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
}

.login-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.login-actions .btn-primary {
  min-width: 168px;
}

.login-inline-tip {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.6;
}

.totp-login-screen {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 18px 0 8px;
}

.totp-login-card {
  width: min(520px, 100%);
  padding: 34px 24px 26px;
  border-radius: 26px;
  border: 1px solid rgba(72, 120, 183, 0.16);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 36px rgba(22, 73, 141, 0.12);
  text-align: center;
}

.totp-login-head h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: #081a33;
}

.totp-login-head p {
  margin: 14px auto 0;
  max-width: 360px;
  color: #5d6f8d;
  font-size: 1.02rem;
  line-height: 1.7;
}

.totp-login-account {
  margin-top: 12px;
  color: #35527f;
  font-size: 0.94rem;
}

.totp-code-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.totp-code-input {
  width: 100%;
  height: 64px;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(49, 82, 132, 0.16);
  background: #fff;
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  color: #081a33;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.totp-code-input:focus {
  border-color: rgba(47, 125, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(47, 125, 255, 0.1);
}

.totp-login-continue {
  width: 100%;
  margin-top: 22px;
  min-height: 58px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #121212;
  color: #fff;
  font-size: 1.16rem;
  font-weight: 700;
}

.totp-login-continue:hover {
  background: #1d1d1d;
}

.totp-login-back {
  margin-top: 14px;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #081a33;
  font-size: 1rem;
  font-weight: 700;
}

.totp-login-back:hover {
  color: #1b4d9d;
  transform: none;
}

.totp-admin-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(72, 120, 183, 0.16);
}

.totp-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.totp-admin-head h4 {
  margin: 0 0 6px;
}

.totp-admin-head p {
  margin: 0;
}

.totp-admin-toolbar {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.totp-current-info {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(72, 120, 183, 0.22);
  background: rgba(255, 255, 255, 0.64);
}

.totp-setup-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(72, 120, 183, 0.18);
  background: rgba(255, 255, 255, 0.7);
}

.totp-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border-radius: 14px;
  border: 1px dashed rgba(72, 120, 183, 0.22);
  background: rgba(255, 255, 255, 0.86);
}

.totp-qr-image {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.totp-setup-content {
  display: grid;
  gap: 12px;
}

.totp-secret-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(72, 120, 183, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.totp-secret-title {
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.totp-secret-text,
.totp-account-label {
  color: var(--text);
  word-break: break-all;
  font-size: 0.95rem;
}

.totp-secret-text {
  display: block;
  font-family: "Consolas", "Courier New", monospace;
}

.totp-verify-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.totp-verify-actions {
  display: flex;
  justify-content: flex-end;
}

.totp-disable-box {
  margin-top: 12px;
  max-width: 420px;
}

.hidden {
  display: none !important;
}

body.dashboard-page .app-shell {
  height: 100vh;
  overflow: hidden;
}

body.dashboard-page .container {
  width: calc(100% - 24px);
  margin: 10px auto 10px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.dashboard-page .hero {
  padding: 14px 16px;
}

body.dashboard-page .hero h2 {
  font-size: 1.34rem;
  margin-bottom: 6px;
}

body.dashboard-page .hero p {
  font-size: 0.88rem;
  line-height: 1.65;
}

body.dashboard-page .stats-grid {
  margin-top: 8px;
  gap: 8px;
}

body.dashboard-page .stat-card {
  padding: 10px 12px;
}

body.dashboard-page .stat-value {
  font-size: 1.25rem;
}

body.dashboard-page .chart-grid {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
}

body.dashboard-page .chart-card {
  min-height: 0;
  padding: 9px 11px;
}

body.dashboard-page .chart-box {
  flex: 1;
  min-height: 0;
  height: auto;
}

body.dashboard-page .chart-title {
  margin-bottom: 6px;
  font-size: 0.92rem;
}

body.dashboard-page .dashboard-ai-panel {
  padding: 10px 12px;
}

body.dashboard-page .dashboard-ai-content {
  font-size: 0.86rem;
  line-height: 1.56;
  max-height: 72px;
}

body.dashboard-page .footer {
  display: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-layout {
    grid-template-columns: 1fr;
  }
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .totp-setup-panel {
    grid-template-columns: 1fr;
  }
  .dashboard-ai-ribbon {
    grid-template-columns: 1fr;
  }
  .dashboard-ai-side {
    justify-items: start;
  }
  .dashboard-ai-meta {
    justify-content: flex-start;
  }
  body.dashboard-page .app-shell {
    height: auto;
    overflow: visible;
  }
  body.dashboard-page .container {
    width: min(1240px, calc(100% - 24px));
    margin: 14px auto 20px;
    display: block;
  }
  body.dashboard-page .chart-box {
    height: 300px;
  }
  body.dashboard-page .footer {
    display: block;
  }
}

@media (max-width: 700px) {
  .header-inner {
    width: calc(100% - 18px);
    flex-direction: column;
    align-items: flex-start;
  }
  .container {
    width: calc(100% - 18px);
    margin: 14px auto 22px;
  }
  .grid-cards,
  .toolbar,
  .filters,
  .form-grid,
  .stats-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }
  .site-nav {
    width: 100%;
  }
  .site-nav .nav-admin {
    margin-left: 0;
  }
  .login-form-grid {
    grid-template-columns: 1fr;
  }
  .totp-code-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }
  .dashboard-ai-head,
  .dashboard-ai-side,
  .dashboard-ai-meta {
    flex-direction: column;
    align-items: stretch;
  }
  .totp-admin-head,
  .totp-admin-toolbar,
  .totp-verify-grid,
  .totp-verify-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .totp-disable-box {
    max-width: none;
  }
  .dashboard-inline-message {
    width: 100%;
  }
  .login-field--full {
    grid-column: span 1;
  }
  .captcha-card {
    flex-direction: column;
    align-items: stretch;
  }
  .score-overview-header,
  .score-overview-actions,
  .table-tools,
  .table-selection {
    flex-direction: column;
    align-items: stretch;
  }
  .student-score-grid {
    grid-template-columns: 1fr;
  }
  .captcha-image {
    width: 100%;
    min-width: 0;
    height: 56px;
  }
  .login-actions {
    justify-content: stretch;
  }
  .login-actions .btn-primary {
    width: 100%;
  }
  .totp-login-card {
    padding: 26px 16px 18px;
  }
  .totp-code-input {
    height: 56px;
    font-size: 1.45rem;
    border-radius: 14px;
  }
}
