:root {
  --bg-canvas: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface-card: #ffffff;
  --border-light: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --bg-dark: #0b1120;
  --surface-dark: #111827;
  --surface-dark-2: #1e293b;
  --border-dark: #1e293b;
  --text-dark-main: #f8fafc;
  --text-dark-muted: #94a3b8;
  --emerald: #059669;
  --amber: #d97706;
  --crimson: #dc2626;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.theme-light {
  background-color: var(--bg-canvas);
  color: var(--text-main);
}

body.theme-dark {
  background-color: var(--bg-dark);
  color: var(--text-dark-main);
}

.hidden {
  display: none !important;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.narrow-container {
  max-width: 640px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    color 160ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:focus-visible,
.input-control:focus-visible,
.input-dark:focus-visible,
.answer-textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-sm {
  font-size: 13px;
  padding: 9px 16px;
}

.btn-lg {
  font-size: 15px;
  padding: 14px 26px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background-color: var(--surface-card);
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-outline:hover {
  background-color: var(--bg-alt);
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--text-dark-main);
  border-color: #334155;
}

.btn-outline-dark:hover {
  background-color: #1e293b;
}

.btn-danger-outline {
  background-color: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

.btn-danger-outline:hover {
  background-color: rgba(220, 38, 38, 0.25);
}

.site-header {
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  min-width: 0;
  flex-shrink: 1;
}

.brand-emblem-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  background-color: var(--bg-alt);
}

.brand-emblem {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.header-action {
  flex-shrink: 0;
}

.marquee-bar {
  background-color: #0f172a;
  color: #f1f5f9;
  border-bottom: 1px solid #1e293b;
  overflow: hidden;
  height: 40px;
  display: flex;
  align-items: center;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  white-space: nowrap;
  animation: marquee-scroll 34s linear infinite;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.marquee-sep {
  color: #38bdf8;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    padding-left: 24px;
  }
}

.hero-section {
  padding-top: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--surface-card);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-kicker {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.hero-title {
  margin: 0 0 20px 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3.8vw, 3.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-desc {
  margin: 0 0 24px 0;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 62ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-media {
  display: flex;
}

.hero-image-frame {
  width: 100%;
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-band {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

.section-header {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-title {
  margin: 0 0 10px 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title-sm {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
}

.part-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-kicker {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.card-title {
  margin: 0 0 10px 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.card-body {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
}

.card-foot {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.rules-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
}

.rules-list {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rule-item {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
}

.rule-title {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.rule-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.steps-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 28px;
}

.steps-list {
  list-style: none;
  margin: 22px 0 28px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.steps-list li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.steps-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.site-footer {
  background-color: var(--surface-card);
  border-top: 1px solid var(--border-light);
  padding: 24px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-center {
  padding: 56px 0;
  min-height: calc(100vh - 140px);
}

.form-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 36px;
}

.form-head {
  margin-bottom: 28px;
}

.form-title {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.form-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.field-label-dark {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.req {
  color: var(--crimson);
}

.input-control,
.input-dark {
  width: 100%;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  min-height: 46px;
}

.input-control {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
}

.input-control.input-error {
  border-color: var(--crimson);
}

.input-dark {
  background-color: #0b1120;
  color: var(--text-dark-main);
  border: 1px solid #334155;
}

.custom-tinh-wrap {
  margin-top: 8px;
}

.field-error {
  margin: 0;
  font-size: 13px;
  color: var(--crimson);
  font-weight: 500;
}

.notice-box {
  background-color: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-danger {
  background-color: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #ef4444;
}

body.theme-dark .alert-danger {
  color: #fca5a5;
}

.alert-success-dark {
  background-color: rgba(5, 150, 105, 0.16);
  border: 1px solid rgba(5, 150, 105, 0.45);
  color: #6ee7b7;
  margin-bottom: 20px;
}

.dark-center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.waiting-card,
.admin-auth-card,
.status-card {
  width: 100%;
  max-width: 620px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  padding: 36px;
}

.admin-auth-card {
  max-width: 460px;
}

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

.candidate-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dark-muted);
  margin-bottom: 18px;
}

.waiting-title,
.auth-title,
.status-heading {
  margin: 0 0 10px 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  text-wrap: balance;
}

.waiting-desc,
.auth-subtitle,
.status-subtext {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--text-dark-muted);
}

.countdown-ring-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-svg {
  width: 144px;
  height: 144px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: #1e293b;
  stroke-width: 8;
}

.ring-fg {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear;
}

.countdown-number {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: #ffffff;
}

.prep-status {
  margin: 0;
  font-size: 14px;
  color: #bae6fd;
}

.fullscreen-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  max-width: 600px;
  background-color: var(--surface-dark);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 36px;
}

.gate-title {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.gate-desc {
  margin: 0 0 24px 0;
  color: var(--text-dark-muted);
  font-size: 15px;
}

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

.exam-topbar {
  background-color: var(--surface-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 24px;
  align-items: center;
}

.exam-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.exam-title-top {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-meta-inline {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dark-muted);
}

.exam-progress-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dark-muted);
}

.autosave-status {
  color: #38bdf8;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background-color: #1e293b;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  transition: width 200ms ease;
}

.exam-clock-box {
  text-align: right;
  padding-left: 16px;
  border-left: 1px solid var(--border-dark);
}

.clock-label {
  display: block;
  font-size: 11px;
  color: var(--text-dark-muted);
}

.clock-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.exam-warning-banner {
  background-color: rgba(217, 119, 6, 0.16);
  border-bottom: 1px solid rgba(217, 119, 6, 0.45);
  color: #fde68a;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
}

.exam-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
}

.question-pane,
.answer-pane {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.question-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.q-part-kicker {
  font-size: 13px;
  font-weight: 600;
  color: #38bdf8;
}

.q-points-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dark-muted);
}

.q-title {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.q-prompt {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.code-snippet-wrap {
  border: 1px solid #334155;
  border-radius: 10px;
  background-color: #020617;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 220px;
  max-height: 440px;
}

.code-snippet-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background-color: #0f172a;
  border-bottom: 1px solid #1e293b;
  font-size: 12px;
  color: var(--text-dark-muted);
}

.code-snippet-pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre;
  user-select: none;
  flex: 1;
}

.lang-select-wrap {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  font-size: 12px;
  color: var(--text-dark-muted);
}

.editor-container {
  display: flex;
  flex: 1;
  min-height: 300px;
  border: 1px solid #334155;
  border-radius: 0 0 10px 10px;
  background-color: #020617;
  overflow: hidden;
  margin-bottom: 14px;
}

.line-numbers {
  width: 44px;
  padding: 14px 8px;
  background-color: #0b1120;
  border-right: 1px solid #1e293b;
  color: #475569;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  overflow: hidden;
}

.answer-textarea {
  flex: 1;
  width: 100%;
  min-height: 300px;
  border: none;
  background-color: transparent;
  color: #f8fafc;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: none;
}

.answer-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.autosave-foot {
  font-size: 12px;
  color: var(--text-dark-muted);
}

.status-card-danger {
  border-color: rgba(220, 38, 38, 0.45);
}

.status-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.status-label-danger {
  color: #f87171;
}

.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px 0;
  padding: 18px;
  background-color: #0b1120;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
}

.kv-row dt {
  font-size: 12px;
  color: var(--text-dark-muted);
  margin-bottom: 4px;
}

.kv-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.kv-row-full {
  grid-column: 1 / -1;
}

.text-danger-bright {
  color: #fca5a5 !important;
}

.notice-dark {
  background-color: #0b1120;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-dark-muted);
}

.result-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.result-hero-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.result-title {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.result-meta {
  margin: 0 0 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.status-inline {
  margin: 0;
  font-size: 14px;
  color: var(--emerald);
}

.score-panel {
  text-align: right;
  padding: 18px 24px;
  border-radius: 12px;
  background-color: var(--bg-alt);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.score-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.score-big {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}

.score-max {
  font-size: 18px;
  color: var(--text-muted);
}

.parts-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.part-score-val {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.table-card {
  padding: 24px;
}

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

.muted-text {
  font-size: 13px;
  color: var(--text-muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th,
.data-table td,
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.num-col {
  text-align: right !important;
}

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

.admin-topbar {
  background-color: var(--surface-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-brand {
  display: flex;
  flex-direction: column;
}

.admin-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
}

.admin-sub {
  font-size: 12px;
  color: var(--text-dark-muted);
}

.admin-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-main {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 18px;
}

.kpi-label {
  display: block;
  font-size: 12px;
  color: var(--text-dark-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

.text-emerald {
  color: #34d399;
}

.text-crimson {
  color: #f87171;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-table-card {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border-dark);
  color: #e2e8f0;
}

.admin-table th {
  font-size: 12px;
  color: var(--text-dark-muted);
  background-color: #0f172a;
}

.admin-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.45);
}

.table-empty {
  text-align: center !important;
  color: var(--text-dark-muted) !important;
  padding: 36px !important;
}

.status-text-ok {
  color: #34d399;
  font-weight: 600;
}

.status-text-warn {
  color: #fbbf24;
  font-weight: 600;
}

.status-text-cancel {
  color: #f87171;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(2, 6, 23, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background-color: var(--surface-dark);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 28px;
}

.modal-card-wide {
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-dark);
  margin-bottom: 16px;
}

.modal-title {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.modal-body {
  margin: 0 0 22px 0;
  font-size: 14px;
  color: var(--text-dark-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.detail-scroll-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block {
  background-color: #0b1120;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 16px;
}

.detail-block-title {
  margin: 0 0 10px 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
}

.detail-code-pre {
  margin: 8px 0 0 0;
  padding: 12px;
  background-color: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.location-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.location-result-box {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.location-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.location-badge {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.location-coords {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #15803d;
}

.location-province-row {
  margin: 0;
  font-size: 15px;
  color: var(--text-light);
}

.location-address-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-light-muted);
}

.modal-backdrop-light {
  background-color: rgba(15, 23, 42, 0.65);
}

.modal-card-light {
  background-color: #ffffff;
  border-color: var(--border-light);
  color: var(--text-light);
}

.modal-title-light {
  margin: 0 0 10px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
}

.modal-body-light {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: #b91c1c;
}

.modal-help-light {
  margin: 0 0 20px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-light-muted);
}

.gmaps-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background-color: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.gmaps-link:hover {
  background-color: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.detail-maps-row {
  margin: 8px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1024px) {
  .hero-grid,
  .rules-layout,
  .exam-workspace {
    grid-template-columns: 1fr;
  }
  .parts-grid,
  .parts-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .exam-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .exam-clock-box {
    text-align: left;
    padding-left: 0;
    border-left: none;
  }
}

@media (max-width: 720px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .header-nav {
    display: none;
  }
  .brand-title {
    font-size: 14px;
  }
  .parts-grid,
  .parts-score-grid,
  .kpi-grid,
  .admin-toolbar,
  .detail-kv-grid {
    grid-template-columns: 1fr;
  }
  .result-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .score-panel {
    width: 100%;
    text-align: left;
  }
  .form-card {
    padding: 24px 18px;
  }
  .answer-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
}
