:root {
  --bg: #050816;
  --bg-2: #0a1022;
  --panel: rgba(12, 19, 39, 0.82);
  --panel-strong: rgba(14, 24, 46, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.04);

  --text: #eef4ff;
  --text-soft: #b8c7e6;
  --text-muted: #7e92b8;

  --accent: #2f80ff;
  --accent-2: #5d5fff;
  --accent-light: #79b1ff;
  --accent-glow: rgba(47, 128, 255, 0.35);

  --success: #19c37d;
  --danger: #ff5f7d;
  --warning: #ffbc42;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(47, 128, 255, 0.24);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.28);

  --container: 920px;
  --sidebar-width: 230px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
  max-width: 400px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(255, 95, 125, 0.15);
}

.toast.success {
  border-color: var(--success);
  background: rgba(25, 195, 125, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(47, 128, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(93, 95, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom center, rgba(47, 128, 255, 0.09), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  z-index: 0;
}

.bg-orb-1 {
  width: 260px;
  height: 260px;
  top: 40px;
  left: -70px;
  background: rgba(47, 128, 255, 0.22);
}

.bg-orb-2 {
  width: 300px;
  height: 300px;
  right: -90px;
  bottom: 20px;
  background: rgba(93, 95, 255, 0.20);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 85%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 34px 16px 50px;
}

.page-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 8px 0 10px;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: 0.25s ease;
  box-shadow: var(--shadow-md);
}

.admin-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 30px rgba(47, 128, 255, 0.14);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #d9e7ff;
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.18), rgba(93, 95, 255, 0.14));
  border: 1px solid rgba(116, 173, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 12px 30px rgba(47, 128, 255, 0.12);
}

.page-header h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #b9d3ff 40%, #85a8ff 65%, #7a7cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  max-width: 690px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 1rem;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 24%, transparent 75%, rgba(47, 128, 255, 0.06));
}

.card + .card,
.card + section,
section + .card {
  margin-top: 18px;
}

.card {
  animation: cardFadeIn 0.4s ease;
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.rules-card {
  margin-bottom: 18px;
}

.rules-title,
.card-title {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.rules-title {
  font-size: 1.15rem;
}

.card-title {
  font-size: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #dce8ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.pill-info {
  background: rgba(47, 128, 255, 0.14);
  border-color: rgba(47, 128, 255, 0.24);
}

.rules-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text-soft);
}

.rules-list li + li {
  margin-top: 10px;
}

.form-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field-label {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
  background: rgba(7, 12, 26, 0.76);
  color: var(--text);
  font: inherit;
  transition: 0.24s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder,
textarea::placeholder {
  color: #6f83ab;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 128, 255, 0.55);
  box-shadow:
    0 0 0 4px rgba(47, 128, 255, 0.14),
    0 12px 28px rgba(47, 128, 255, 0.08);
  background: rgba(10, 16, 32, 0.96);
}

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

select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%239fb0cc' d='M5.5 7.5 10 12l4.5-4.5' stroke='%239fb0cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  transition: 0.24s ease;
}

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

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

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow:
    0 16px 34px rgba(47, 128, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.btn-primary:hover {
  box-shadow:
    0 18px 38px rgba(47, 128, 255, 0.30),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(47, 128, 255, 0.20);
}

.btn-danger {
  color: white;
  background: linear-gradient(135deg, #ff5f7d 0%, #ff4566 100%);
}

.btn-warning {
  color: #101828;
  background: linear-gradient(135deg, #ffd36d 0%, #ffbc42 100%);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
}

.test-card {
  padding-top: 22px;
}

.test-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-soft);
  min-width: 44px;
  text-align: right;
}

.question-badge {
  margin-bottom: 12px;
}

.badge-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #d4e5ff;
  background: rgba(47, 128, 255, 0.16);
  border: 1px solid rgba(47, 128, 255, 0.26);
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 22, 0.88);
  backdrop-filter: blur(6px);
  border-radius: 22px;
}

.video-overlay-content {
  text-align: center;
}

.video-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.video-overlay-content p {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-soft);
}

.test-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.test-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #d9e7ff;
  font-weight: 700;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 6px rgba(47, 128, 255, 0.16);
}

.question-title {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  line-height: 1.35;
  font-weight: 800;
  color: #fff;
}

.timer-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(47, 128, 255, 0.12);
  border: 1px solid rgba(47, 128, 255, 0.22);
  color: #d4e5ff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.video-wrap {
  margin: 18px 0 22px;
  border-radius: 22px;
  overflow: hidden;
  background: #020611;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.video-wrap video,
.video-wrap img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.answers {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.answers button {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.22s ease;
  animation: answerFadeIn 0.3s ease;
}

@keyframes answerFadeIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.answers button:nth-child(1) { animation-delay: 0.05s; }
.answers button:nth-child(2) { animation-delay: 0.10s; }
.answers button:nth-child(3) { animation-delay: 0.15s; }
.answers button:nth-child(4) { animation-delay: 0.20s; }

.answers button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(47, 128, 255, 0.34);
  background: rgba(47, 128, 255, 0.10);
  box-shadow: 0 12px 24px rgba(47, 128, 255, 0.12);
}

.answers button:disabled {
  cursor: default;
}

.answers button.correct {
  border-color: rgba(25, 195, 125, 0.42);
  background: rgba(25, 195, 125, 0.12);
  color: #d7ffec;
}

.answers button.wrong {
  border-color: rgba(255, 95, 125, 0.38);
  background: rgba(255, 95, 125, 0.12);
  color: #ffe4ea;
}

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

.card-result {
  text-align: center;
}

.result-content {
  padding: 10px 0 20px;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 6px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.result-score {
  margin-bottom: 16px;
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
}

.score-correct {
  background: linear-gradient(135deg, #ffffff 0%, var(--success) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-divider {
  color: var(--text-muted);
  margin: 0 4px;
}

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

.result-text {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.4;
}

.result-status {
  margin-bottom: 20px;
}

.status-pass,
.status-fail {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  animation: fadeSlideUp 0.5s ease 0.3s both;
}

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

.status-pass {
  background: linear-gradient(135deg, rgba(25, 195, 125, 0.24), rgba(25, 195, 125, 0.14));
  border: 1px solid rgba(25, 195, 125, 0.34);
  color: #7bffca;
}

.status-fail {
  background: linear-gradient(135deg, rgba(255, 95, 125, 0.24), rgba(255, 95, 125, 0.14));
  border: 1px solid rgba(255, 95, 125, 0.34);
  color: #ff9aad;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.result-review {
  text-align: left;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.review-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.review-item {
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeSlideUp 0.3s ease;
}

.review-item.correct {
  border-color: rgba(25, 195, 125, 0.22);
  background: rgba(25, 195, 125, 0.06);
}

.review-item.wrong {
  border-color: rgba(255, 95, 125, 0.22);
  background: rgba(255, 95, 125, 0.06);
}

.review-question {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.review-answer {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.review-answer strong {
  color: var(--text);
}

.review-correct {
  color: var(--success);
}

.review-wrong {
  color: var(--danger);
}

.review-status {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85rem;
}

.btn-restart {
  min-width: 220px;
}

/* login / generic */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.login-card .card-title {
  margin: 0 0 18px;
  color: var(--text-soft);
}

.rules-note,
.admin-error,
.admin-success {
  font-size: 0.9rem;
  margin-top: 10px;
}

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

.admin-error {
  color: #ff9aad;
  font-weight: 700;
}

.admin-success {
  color: #89f3c3;
  font-weight: 700;
}

/* admin layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(8, 14, 28, 0.98), rgba(7, 11, 22, 0.98));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 12px 0 32px rgba(0, 0, 0, 0.25);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sidebar-logo:hover {
  color: var(--accent-light);
}

.sidebar-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.sidebar-nav,
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  transition: 0.18s ease;
  cursor: pointer;
  text-align: left;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.24), rgba(93, 95, 255, 0.22));
  border-color: rgba(47, 128, 255, 0.16);
  box-shadow: 0 10px 24px rgba(47, 128, 255, 0.18);
}

.sidebar-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-logout {
  color: #ff97a9;
}

.sidebar-logout:hover {
  background: rgba(255, 95, 125, 0.10);
  color: #fff;
}

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px;
}

.admin-content {
  max-width: 1140px;
}

.admin-section {
  position: relative;
  overflow: hidden;
  padding: 22px;
  margin-bottom: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03)),
    var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.admin-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.admin-section-title::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

/* stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat-box {
  padding: 18px 14px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: 0.24s ease;
}

.stat-box:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 128, 255, 0.26);
  box-shadow: 0 14px 28px rgba(47, 128, 255, 0.14);
}

.stat-value {
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, #98c0ff 40%, #5d5fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

/* forms */
.settings-form,
.block-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.settings-form > div,
.block-form > div {
  flex: 1;
  min-width: 160px;
}

.block-form input,
.settings-form input,
.settings-form select {
  margin-bottom: 0;
}

.generated-code-box {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(47, 128, 255, 0.10);
  border: 1px solid rgba(47, 128, 255, 0.20);
}

.generated-code-box strong {
  font-size: 1.15rem;
  color: #d4e5ff;
  letter-spacing: 0.12em;
}

/* blocked list / badges */
.blocked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-pass {
  color: #d8ffec;
  background: rgba(25, 195, 125, 0.14);
  border: 1px solid rgba(25, 195, 125, 0.24);
}

.badge-fail {
  color: #ffe3ea;
  background: rgba(255, 95, 125, 0.14);
  border: 1px solid rgba(255, 95, 125, 0.22);
}

.badge-neutral {
  color: #dce7ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.unblock-btn {
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.08);
  transition: 0.2s ease;
}

.unblock-btn:hover {
  color: white;
  background: var(--danger);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-input {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  margin-bottom: 4px;
}

.admin-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.admin-table tbody tr:hover {
  background: rgba(47, 128, 255, 0.06);
}

.question-text {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-link {
  color: #a9c7ff;
  font-weight: 700;
  text-decoration: none;
}

.video-link:hover {
  color: white;
  text-decoration: underline;
}

/* modal */
.modal-content {
  width: min(92%, 720px);
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 24px;
  background: rgba(12, 19, 39, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

/* code form */
.code-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}

.code-form > div {
  flex: 1;
  min-width: 120px;
}

.code-form input {
  margin-bottom: 0;
}

/* search */
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}

.search-form > div {
  flex: 1;
  min-width: 150px;
}

.search-form input,
.search-form select {
  margin-bottom: 0;
}

.search-buttons {
  display: flex;
  gap: 6px;
}

/* section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-buttons {
  display: flex;
  gap: 4px;
}

.tab-buttons .btn.active {
  background: var(--accent);
  color: #fff;
}

/* question form */
.question-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-full {
  width: 100%;
}

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

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-row > div {
  flex: 1;
  min-width: 100px;
}

.form-row .btn {
  flex-shrink: 0;
}

/* answer item in modal */
.answer-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

/* responsive */
@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar {
    width: 210px;
  }

  .admin-main {
    margin-left: 210px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 20px 12px 32px;
  }

  .page-header {
    padding-top: 0;
  }

  .card,
  .admin-section,
  .login-card {
    padding: 18px;
    border-radius: 20px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .card-head,
  .test-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .timer-display {
    width: 100%;
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .test-actions {
    justify-content: stretch;
  }

  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .admin-main {
    margin-left: 0;
    padding: 16px 12px 24px;
  }

  .sidebar-nav,
  .sidebar-footer {
    padding: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-table th,
  .admin-table td {
    padding: 12px 10px;
    font-size: 0.84rem;
  }
}
