:root {
  --ink: #193541;
  --muted: #617480;
  --teal: #087e80;
  --navy: #0b3843;
  --bg: #f2f6f7;
  --line: #dce6e9;
  --red: #b23b40;
  --gold: #a36a13;
  --radius: 16px;
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: var(--teal);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  line-height: 1.6;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.9;
}
.muted,
small {
  color: var(--muted);
}
.loading {
  padding: 80px;
  text-align: center;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.login-intro {
  background: linear-gradient(135deg, #0b3843, #0c6668);
  color: white;
  padding: 80px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.login-intro h1 {
  font-size: 42px;
}
.login-intro p {
  color: #d2ecec;
}
.login-box {
  max-width: 440px;
  width: 100%;
  margin: auto;
  padding: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: bold;
}
.brand-icon {
  width: 43px;
  height: 43px;
  border: 1px solid #ffffff55;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 25px;
}
.eyebrow {
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: bold;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  background: #e4f3f1;
  color: #086e68;
}
.badge.warn {
  background: #fff1d6;
  color: #8b5d11;
}
.badge.gray {
  background: #eef0f4;
  color: #65717d;
}
.badge.red {
  background: #ffe9e9;
  color: var(--red);
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 27px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.sidebar .brand {
  font-size: 16px;
  line-height: 1.7;
}
.sidebar .muted {
  color: #b8d3d7;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  color: #d3e7e9;
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 13px 14px;
  text-align: right;
}
.nav button:hover,
.nav button.active {
  background: #ffffff17;
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.9;
}
.workspace {
  min-width: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  min-height: 77px;
  padding: 16px 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.topbar .user {
  display: flex;
  align-items: center;
  gap: 13px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6f0f1;
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: bold;
}
.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 35px 38px 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-head p {
  margin-top: 6px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 3px 12px #18344104;
}
.stat .number {
  font-size: 32px;
  margin: 13px 0 5px;
  font-weight: bold;
  color: var(--navy);
}
.stat .muted {
  font-size: 13px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 17px;
}
.exam-card h3 {
  line-height: 1.8;
  margin-bottom: 10px;
}
.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  padding: 17px 0;
  margin: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
  margin-top: 5px;
}
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
.btn:hover {
  background: #edf6f6;
}
.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.btn.primary:hover {
  background: #08696b;
}
.btn.danger {
  color: var(--red);
  border-color: #e8bbbb;
}
.btn.small {
  padding: 6px 11px;
  font-size: 12px;
  min-height: 33px;
}
.btn.full {
  width: 100%;
}
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  background: #e7f4f2;
  border: 1px solid #c4e6df;
  line-height: 1.9;
  font-size: 13px;
}
.alert.warn {
  background: #fff6e5;
  border-color: #edd5a8;
  color: #805d21;
}
.alert.error {
  background: #fff0f0;
  border-color: #ecc4c4;
  color: var(--red);
}
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1;
  min-width: 200px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: right;
}
th {
  padding: 14px 16px;
  color: var(--muted);
  background: #f8fafb;
  white-space: nowrap;
  font-weight: normal;
}
td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  line-height: 1.8;
}
tbody tr:hover {
  background: #fbfdfd;
}
.empty {
  text-align: center;
  padding: 45px;
  color: var(--muted);
  line-height: 2;
}
.tabs {
  display: flex;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 25px;
  overflow: auto;
}
.tabs .btn {
  white-space: nowrap;
}
.tabs .active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
label.field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd9df;
  border-radius: 9px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  min-height: 43px;
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.9;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #087e8040;
  outline-offset: 2px;
  border-color: var(--teal);
}
input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.8;
  font-size: 13px;
  margin-bottom: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.section-title {
  margin: 22px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 23px;
}
.blueprint-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 0.65fr 0.65fr 40px;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.blueprint-row input,
.blueprint-row select {
  font-size: 12px;
}
.blueprint-head {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 9px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
.participants {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.participant {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.question {
  line-height: 2;
}
.question-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.question-text {
  font-size: 19px;
  line-height: 2;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.options {
  display: grid;
  gap: 12px;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px;
  cursor: pointer;
  line-height: 1.8;
}
.option:has(input:checked) {
  border-color: var(--teal);
  background: #eff9f7;
}
.option:hover {
  background: #f5faf9;
}
.student-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
}
.attempt-nav {
  position: sticky;
  top: 100px;
  align-self: start;
}
.question-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin: 17px 0;
}
.question-numbers button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  height: 36px;
  font-size: 12px;
}
.question-numbers button.answered {
  background: #dff3ed;
  border-color: #b7e1d2;
}
.question-numbers button.flagged {
  border: 2px solid #b1852e;
}
.question-numbers button.current {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
.exam-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
}
.timer {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  font-weight: bold;
  color: var(--navy);
}
.timer.urgent {
  color: var(--red);
}
.save-status {
  font-size: 12px;
  color: var(--teal);
}
.save-status.pending {
  color: var(--gold);
}
.reading {
  white-space: pre-wrap;
  line-height: 2;
  max-height: 500px;
  overflow: auto;
}
.grade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.answer-block {
  background: #f5f8f9;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 17px;
  white-space: pre-wrap;
  line-height: 2;
  min-height: 100px;
}
.notice {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.notice:last-child {
  border: 0;
}
dialog {
  width: min(800px, 95vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  color: var(--ink);
  box-shadow: 0 20px 80px #152b4540;
}
dialog::backdrop {
  background: #072b3b88;
}
dialog .modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 100;
  background: var(--navy);
  color: white;
  max-width: 550px;
  padding: 15px 21px;
  border-radius: 10px;
  box-shadow: 0 4px 20px #0002;
  display: none;
  line-height: 1.8;
}
#toast.visible {
  display: block;
}
#toast.error {
  background: #973a40;
}
details summary {
  cursor: pointer;
  font-weight: bold;
  padding: 13px 0;
}
pre {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  font-size: 12px;
  overflow: auto;
}
.mini {
  font-size: 12px;
}
.mt {
  margin-top: 18px;
}
.nowrap {
  white-space: nowrap;
}
.danger-text {
  color: var(--red);
}
.login-form {
  margin-top: 28px;
}
.cover-count {
  font-size: 12px;
  color: var(--muted);
}
.correct-detail {
  background: #eaf5ef;
  padding: 9px;
  border-radius: 8px;
  margin-top: 8px;
}
.hidden,
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    padding: 22px 12px;
  }
  .content {
    padding: 25px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .participants {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 35px 25px;
  }
  .login-intro h1 {
    font-size: 29px;
  }
  .login-box {
    padding: 30px 25px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    gap: 17px;
    padding: 18px;
  }
  .sidebar .brand {
    font-size: 16px;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 5px;
  }
  .nav button {
    white-space: nowrap;
    padding: 10px;
  }
  .sidebar-foot {
    display: none;
  }
  .topbar {
    padding: 12px 18px;
  }
  .topbar .badge {
    max-width: 140px;
    white-space: normal;
    line-height: 1.6;
  }
  .content {
    padding: 22px 16px;
  }
  .page-head {
    align-items: flex-start;
  }
  h1 {
    font-size: 23px;
  }
  .grid,
  .form-grid,
  .grade-grid,
  .student-layout {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .card {
    padding: 19px;
  }
  .participants {
    grid-template-columns: 1fr;
  }
  .blueprint-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .blueprint-head {
    display: none;
  }
  .attempt-nav {
    position: static;
  }
  .exam-top {
    align-items: flex-start;
  }
  .question-text {
    font-size: 17px;
  }
  .option {
    padding: 14px;
  }
  .editor-actions {
    flex-wrap: wrap;
  }
  .timer {
    font-size: 24px;
  }
  .topbar .user {
    gap: 7px;
  }
  .topbar .user .muted {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .option {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
}
