:root {
  --navy: #16355a;
  --navy-deep: #0f243f;
  --blue: #1e4878;
  --blue-soft: #eef3f8;
  --gold: #e8a020;
  --gold-dark: #cf8910;
  --gold-soft: #fff8ec;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ed;
  --canvas: #f5f7fa;
  --white: #ffffff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #087a55;
  --success-soft: #ecfdf3;
  --shadow-sm: 0 8px 22px rgba(22, 53, 90, 0.08);
  --shadow-lg: 0 24px 65px rgba(22, 53, 90, 0.14);
  --font-heading: "Literata", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.site-header {
  position: relative;
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid rgba(22, 53, 90, 0.1);
}

.top-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0 30%, var(--navy) 30% 100%);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.brand-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-family: var(--font-heading);
  color: var(--navy-deep);
  font-size: 15px;
  line-height: 1.2;
}

.brand-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.role-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.role-button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 10px 16px;
  color: #4b5e74;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.role-button:hover {
  color: var(--navy);
}

.role-button.active {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 5px 14px rgba(22, 53, 90, 0.22);
}

.header-back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #d5dce6;
  border-radius: 8px;
  color: var(--navy);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--blue-soft);
}

.lang-switch button {
  width: 39px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: #66758a;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.lang-switch button.active {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 4px 10px rgba(22, 53, 90, 0.2);
}

.locale-badge {
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 800;
}

.header-back-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.main {
  min-height: calc(100vh - 86px);
}

.student-landing {
  position: relative;
  overflow: hidden;
}

.student-landing::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -240px;
  right: -180px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 160, 32, 0.13), transparent 65%);
}

.landing-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.75fr);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

.landing-copy h1,
.page-title,
.result-hero h1,
.admin-title h1 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--navy-deep);
  letter-spacing: -0.035em;
}

.landing-copy h1 {
  max-width: 670px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.04;
}

.landing-copy h1 em {
  color: var(--blue);
  font-style: normal;
}

.landing-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 24px 0 0;
  color: #526176;
  font-size: 17px;
  line-height: 1.75;
}

.feature-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #3c4c61;
  font-size: 13px;
  font-weight: 700;
}

.feature-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.feature-icon svg,
.icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.intro-card,
.login-card {
  position: relative;
  padding: 34px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(22, 53, 90, 0.08);
}

.intro-card::before,
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.card-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.intro-card h2,
.login-card h2 {
  margin: 8px 0 7px;
  color: var(--navy-deep);
  font-size: 24px;
}

.intro-card > p,
.login-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #354357;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d5dce6;
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: var(--white);
  transition: border 0.2s, box-shadow 0.2s;
}

.field textarea {
  min-height: 160px;
  padding-top: 12px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(30, 72, 120, 0.1);
}

.field input.invalid,
.field select.invalid {
  border-color: var(--danger);
}

.consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin: 20px 0;
  color: #5d6a7c;
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}

.consent input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 10px 22px rgba(22, 53, 90, 0.2);
}

.btn-primary:hover {
  background: var(--navy-deep);
}

.btn-gold {
  color: #2b210f;
  background: var(--gold);
  box-shadow: 0 10px 22px rgba(232, 160, 32, 0.2);
}

.btn-gold:hover {
  background: #f0aa2d;
}

.btn-secondary {
  color: var(--navy);
  border-color: #cfd8e4;
  background: var(--white);
}

.btn-danger {
  color: var(--danger);
  border-color: #f0c8c4;
  background: var(--white);
}

.btn-block {
  width: 100%;
}

.btn svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-note {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 50px;
  padding: 17px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #ead7b3;
  background: var(--gold-soft);
  color: #694b17;
  font-size: 12px;
  line-height: 1.6;
}

.info-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.test-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.test-sidebar {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.student-mini {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.student-mini-label,
.progress-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.student-mini strong {
  display: block;
  margin-top: 5px;
  color: var(--navy-deep);
  font-size: 14px;
}

.student-mini span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.progress-numbers {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.progress-numbers strong {
  color: var(--navy);
  font-size: 27px;
}

.progress-numbers span {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 7px;
  margin: 11px 0 20px;
  overflow: hidden;
  border-radius: 20px;
  background: #e9edf3;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.3s ease;
}

.question-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.question-dot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: #7a8798;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.question-dot.answered {
  border-color: var(--navy);
  color: var(--white);
  background: var(--navy);
}

.question-dot.current {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.test-main {
  min-width: 0;
}

.test-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.test-heading .eyebrow {
  margin-bottom: 9px;
}

.page-title {
  font-size: clamp(27px, 4vw, 39px);
}

.scale-help {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.question-card {
  margin-bottom: 14px;
  padding: 25px 26px;
  border: 1px solid var(--line);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.question-card:focus-within {
  border-color: rgba(30, 72, 120, 0.5);
  box-shadow: var(--shadow-sm);
}

.question-card.unanswered {
  border-color: #efb9b4;
  animation: nudge 0.3s ease;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

.question-top {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.question-number {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.question-text {
  margin: 3px 0 0;
  color: #24344a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.answer-scale {
  margin: 20px 0 0 49px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.answer-option {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  transition: 0.18s ease;
}

.answer-option:hover {
  border-color: #9aabc0;
  background: var(--blue-soft);
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer-option:has(input:checked) {
  border-color: var(--navy);
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 7px 16px rgba(22, 53, 90, 0.16);
}

.answer-value {
  font-size: 15px;
  font-weight: 800;
}

.answer-label {
  max-width: 72px;
  color: #657386;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
}

.answer-option:has(input:checked) .answer-label {
  color: rgba(255, 255, 255, 0.78);
}

.test-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.test-actions-right {
  display: flex;
  gap: 10px;
}

.result-wrap {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 72px;
}

.result-hero {
  padding: 46px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.result-check {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--gold);
}

.result-check svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

.result-hero .eyebrow {
  color: var(--gold);
}

.result-hero h1 {
  color: var(--white);
  font-size: clamp(31px, 5vw, 48px);
}

.result-hero > p {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
}

.result-meta {
  margin-top: 28px;
  padding-top: 22px;
  display: flex;
  gap: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.result-meta span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-meta strong {
  font-size: 13px;
}

.support-card {
  margin-top: 18px;
  padding: 23px 25px;
  display: flex;
  gap: 15px;
  border: 1px solid #f1d0cc;
  background: var(--danger-soft);
  color: #76251d;
}

.support-card .icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fecdca;
}

.support-card strong {
  display: block;
  margin-bottom: 4px;
}

.support-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.section-heading {
  margin: 38px 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--font-heading);
  font-size: 25px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.score-card {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--white);
}

.score-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.score-card h3 {
  margin: 0;
  color: #33455b;
  font-size: 13px;
}

.score-number {
  color: var(--navy);
  font-weight: 800;
}

.score-bar {
  height: 6px;
  margin-top: 15px;
  border-radius: 10px;
  background: #e9eef4;
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.score-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.result-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.admin-login {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: 45px 20px;
  background:
    linear-gradient(rgba(15, 36, 63, 0.9), rgba(15, 36, 63, 0.94)),
    radial-gradient(circle at 75% 20%, rgba(232, 160, 32, 0.35), transparent 30%),
    var(--navy);
}

.login-card {
  width: min(420px, 100%);
}

.login-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--blue-soft);
}

.login-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.login-card .field {
  margin-bottom: 15px;
}

.login-error {
  min-height: 18px;
  margin: -4px 0 10px;
  color: var(--danger);
  font-size: 12px;
}

.demo-hint {
  margin: 18px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.demo-hint code {
  color: var(--navy);
  font-weight: 800;
}

.admin-shell {
  background: #f3f6f9;
}

.admin-layout {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 30px 18px;
  background: var(--navy-deep);
  color: var(--white);
}

.admin-nav-title {
  margin: 0 12px 16px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 5px;
}

.admin-nav button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-nav button:hover,
.admin-nav button.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.admin-nav button.active {
  box-shadow: inset 3px 0 var(--gold);
}

.admin-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.admin-sidebar-footer {
  margin-top: 34px;
  padding: 22px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-footer button {
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-content {
  min-width: 0;
  padding: 38px clamp(24px, 4vw, 56px) 60px;
}

.admin-title-row {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-title h1 {
  font-size: 34px;
}

.admin-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  min-height: 130px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(22, 53, 90, 0.045);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--blue-soft);
}

.stat-icon.warn {
  color: #8a5700;
  background: #fff3d6;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.stat-value {
  display: block;
  margin-top: 13px;
  color: var(--navy-deep);
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1;
}

.panel {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(22, 53, 90, 0.045);
}

.panel-head {
  min-height: 76px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 16px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-box {
  position: relative;
  width: min(260px, 34vw);
}

.search-box input {
  min-height: 40px;
  padding-left: 37px;
  font-size: 12px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: #8491a2;
  stroke-width: 2;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #788697;
  background: #fafbfc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #fafcfe;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.person-name {
  color: #26384f;
  font-weight: 800;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 30px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 800;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.warning {
  color: var(--danger);
  background: var(--danger-soft);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-action {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #748195;
  background: transparent;
  cursor: pointer;
}

.row-action:hover {
  color: var(--navy);
  background: var(--blue-soft);
}

.row-action.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.row-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.empty-state {
  padding: 62px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--blue-soft);
}

.empty-state-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: #43536a;
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.6;
}

.tests-list {
  display: grid;
  gap: 12px;
}

.test-admin-card {
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(22, 53, 90, 0.045);
}

.test-admin-card h3 {
  margin: 0 0 7px;
  color: var(--navy-deep);
  font-size: 16px;
}

.test-admin-card p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.test-card-meta {
  margin-top: 14px;
  display: flex;
  gap: 18px;
  color: #657387;
  font-size: 11px;
  font-weight: 700;
}

.test-admin-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-toggle {
  min-width: 83px;
  height: 36px;
  border: 1px solid #d3dce6;
  border-radius: 30px;
  color: #6d798a;
  background: var(--white);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.status-toggle.active {
  border-color: #9ed8c3;
  color: var(--success);
  background: var(--success-soft);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 24, 48, 0.62);
  backdrop-filter: blur(3px);
  animation: fade-in 0.18s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.27);
}

.modal.wide {
  width: min(860px, 100%);
}

.modal-head {
  min-height: 76px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: var(--font-heading);
  font-size: 23px;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #758196;
  background: #f1f4f7;
  cursor: pointer;
}

.modal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  padding: 16px 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.modal-note {
  margin: 0 0 20px;
  padding: 13px 15px;
  border-left: 3px solid var(--gold);
  color: #615239;
  background: var(--gold-soft);
  font-size: 11px;
  line-height: 1.55;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-item {
  padding: 14px;
  background: #f6f8fa;
}

.detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-item strong {
  font-size: 12px;
}

.detail-scores {
  margin-top: 22px;
}

.detail-scores h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.detail-score-row {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 1fr 130px 52px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #edf0f4;
  color: #526176;
  font-size: 11px;
}

.detail-score-row .score-bar {
  margin: 0;
}

.detail-score-row strong {
  color: var(--navy);
  text-align: right;
}

.answer-details {
  margin-top: 24px;
}

.answer-details h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.answer-detail-row {
  display: grid;
  grid-template-columns: 30px 1fr 34px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.answer-detail-row p {
  margin: 0;
  color: #526176;
  font-size: 12px;
  line-height: 1.45;
}

.answer-detail-number,
.answer-detail-row strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.answer-detail-row strong {
  background: var(--gold);
}

.confirm-copy {
  margin: 0;
  color: #536175;
  font-size: 13px;
  line-height: 1.7;
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 9px;
}

.toast {
  width: min(360px, calc(100vw - 32px));
  min-height: 76px;
  padding: 14px 18px 14px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--gold);
  color: var(--white);
  background: var(--navy-deep);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  animation: toast-in 0.25s ease;
}

.toast-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 50%;
  background: var(--white);
  object-fit: contain;
  box-shadow: 0 0 0 2px rgba(232, 160, 32, 0.72);
}

.toast span {
  min-width: 0;
}

@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
}

@media (max-width: 900px) {
  .landing-grid {
    grid-template-columns: 1fr;
    padding-top: 44px;
  }

  .landing-copy h1 {
    max-width: 740px;
  }

  .intro-card {
    max-width: 640px;
  }

  .test-layout {
    grid-template-columns: 1fr;
  }

  .test-sidebar {
    position: static;
  }

  .question-map {
    grid-template-columns: repeat(10, 1fr);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    padding: 10px 20px;
  }

  .admin-nav-title,
  .admin-sidebar-footer {
    display: none;
  }

  .admin-nav {
    display: flex;
  }

  .admin-nav button {
    width: auto;
  }
}

@media (max-width: 680px) {
  .toast-root {
    right: 12px;
    bottom: 12px;
  }

  .toast {
    width: calc(100vw - 24px);
  }

  .header-inner,
  .landing-grid,
  .info-note,
  .test-layout,
  .result-wrap {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    width: calc(100% - 20px);
    min-height: 68px;
    gap: 10px;
  }

  .brand-copy span {
    display: none;
  }

  .brand-copy strong {
    max-width: 145px;
    font-family: var(--font-body);
    font-size: 10px;
    line-height: 1.25;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .role-button {
    padding: 9px 11px;
    font-size: 11px;
  }

  .header-back-link {
    padding: 0 10px;
    font-size: 10px;
  }

  .header-actions {
    gap: 5px;
  }

  .lang-switch button {
    width: 32px;
    height: 31px;
  }

  .landing-grid {
    width: 100%;
    padding: 0 12px 30px;
    gap: 16px;
  }

  .landing-copy {
    position: relative;
    overflow: hidden;
    margin-top: 12px;
    padding: 30px 22px 25px;
    color: var(--white);
    background:
      radial-gradient(circle at 100% 0, rgba(232, 160, 32, 0.22), transparent 38%),
      linear-gradient(145deg, var(--navy-deep), var(--navy));
    box-shadow: 0 18px 36px rgba(15, 36, 63, 0.2);
  }

  .landing-copy::after {
    content: "";
    position: absolute;
    right: -54px;
    bottom: -62px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
  }

  .landing-copy .eyebrow {
    margin-bottom: 15px;
    color: var(--gold);
    font-size: 9px;
    line-height: 1.45;
  }

  .landing-copy h1 {
    max-width: 285px;
    color: var(--white);
    font-size: clamp(30px, 10vw, 37px);
    line-height: 1.1;
  }

  .landing-copy h1 em {
    color: #f4b640;
  }

  .landing-copy > p:not(.eyebrow) {
    margin-top: 17px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.7;
  }

  .feature-row {
    position: relative;
    z-index: 1;
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feature {
    min-height: 42px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.07);
    font-size: 10px;
  }

  .feature:last-child {
    grid-column: 1 / -1;
  }

  .feature-icon {
    width: 25px;
    height: 25px;
    color: var(--navy);
    background: var(--gold);
    box-shadow: none;
  }

  .intro-card,
  .login-card {
    width: 100%;
    padding: 26px 20px;
    box-shadow: 0 14px 32px rgba(22, 53, 90, 0.11);
  }

  .intro-card h2,
  .login-card h2 {
    font-size: 23px;
  }

  .intro-card > p,
  .login-card > p {
    margin-bottom: 20px;
  }

  .field input,
  .field select {
    min-height: 52px;
    font-size: 14px;
  }

  .consent {
    margin: 18px 0;
  }

  .intro-card .btn-block {
    min-height: 52px;
  }

  .info-note {
    width: calc(100% - 24px);
    margin-bottom: 28px;
    padding: 15px;
    font-size: 10px;
  }

  .form-grid,
  .score-grid,
  .stats-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .test-layout {
    padding-top: 14px;
    gap: 16px;
  }

  .test-sidebar {
    padding: 18px;
  }

  .student-mini {
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .progress-track {
    margin-bottom: 0;
  }

  .question-map {
    display: none;
  }

  .test-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .scale-help {
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--blue-soft);
    white-space: normal;
  }

  .question-card {
    padding: 20px 16px;
  }

  .page-title {
    font-size: 29px;
  }

  .question-top {
    gap: 11px;
  }

  .question-number {
    width: 31px;
    height: 31px;
  }

  .question-text {
    font-size: 14px;
  }

  .answer-scale {
    margin-left: 0;
    grid-template-columns: repeat(5, 1fr);
  }

  .answer-option {
    min-height: 53px;
    flex-direction: column;
    gap: 2px;
  }

  .answer-label {
    display: none;
  }

  .test-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .test-actions-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-wrap {
    padding-top: 26px;
  }

  .result-hero {
    padding: 30px 24px;
  }

  .result-meta {
    flex-direction: column;
    gap: 13px;
  }

  .admin-content {
    padding: 28px 14px 48px;
  }

  .admin-title-row,
  .panel-head,
  .test-admin-card {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-title-row {
    display: flex;
  }

  .panel-head {
    display: flex;
  }

  .panel-tools,
  .search-box {
    width: 100%;
  }

  .test-admin-card {
    display: flex;
  }

  .test-admin-actions {
    flex-wrap: wrap;
  }

  .detail-score-row {
    grid-template-columns: 1fr 74px;
  }

  .detail-score-row .score-bar {
    display: none;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
