:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d8e0e8;
  --soft: #f5f8fb;
  --panel: #ffffff;
  --blue: #2563eb;
  --cyan: #0f9fbc;
  --green: #16a34a;
  --yellow: #d99a00;
  --red: #d14c32;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: #eef4f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar,
.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 8px;
  font-weight: 800;
}

.brand span,
.profile span,
.timer-box span,
.status-card span,
.exam-meta,
.admin-card p,
.security-card p,
.score-card p,
.role-card span,
.monitor-card span,
.autosave,
small {
  color: var(--muted);
  font-size: 14px;
}

.brand div {
  display: grid;
  gap: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 55vw;
  padding: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav a,
.nav-group > button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: #344054;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.nav a:hover,
.nav-group:hover > button,
.nav-group:focus-within > button {
  background: #fff;
}

.nav-group {
  position: relative;
}

.nav-group > button::after {
  content: "+";
  margin-left: 6px;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #2563eb;
  background: #e8f1ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease;
}

.nav-group:hover > button::after,
.nav-group:focus-within > button::after {
  content: "−";
  color: #fff;
  background: #2563eb;
  transform: rotate(180deg);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  display: none;
  min-width: 220px;
  padding: 14px 8px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.submenu a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  white-space: nowrap;
}

.nav-group:hover .submenu,
.nav-group:focus-within .submenu {
  display: block;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger {
  color: var(--red);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 56px clamp(18px, 4vw, 56px) 44px;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.96), rgba(229,244,249,0.88)),
    url("Gemini_Generated_Image_9g98ez9g98ez9g98.png") center / cover;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 710px;
  color: #344054;
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.status-card,
.admin-card,
.question-panel,
.candidate-sidebar,
.login-panel,
.role-card,
.admin-content,
.security-card,
.proctor-panel,
.score-card,
.chart-card,
.wrong-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-card {
  min-height: 146px;
  padding: 22px;
}

.status-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 30px;
}

.status-card.pass {
  border-left: 5px solid var(--green);
}

.status-card.warn {
  border-left: 5px solid var(--yellow);
}

.workspace,
.admin-area,
.architecture {
  padding: 70px clamp(18px, 4vw, 56px);
}

.muted-band {
  background: #eef4f8;
}

.section-heading {
  margin-bottom: 24px;
}

.split-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 34px);
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 410px) minmax(0, 1fr);
  gap: 18px;
}

.login-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
  box-shadow: none;
}

.panel-head,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.login-panel input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chip,
.lock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.chip.blue,
.lock-badge {
  color: #174ea6;
  background: #e8f1ff;
}

.chip.green {
  color: #0b6b2a;
  background: #e7f7ec;
}

.chip.yellow {
  color: #7a5200;
  background: #fff0bd;
}

.role-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.role-card {
  min-height: 180px;
  padding: 22px;
  box-shadow: none;
}

.role-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
}

.role-card.active {
  border-color: var(--blue);
  background: #f0f6ff;
}

.autosave {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}

.exam-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.candidate-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile div {
  display: grid;
  gap: 4px;
}

.timer-box {
  padding: 18px;
  color: #fff;
  background: #17202a;
  border-radius: 8px;
}

.timer-box span {
  color: #bdc7d2;
}

.timer-box strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.security-mini {
  display: grid;
  gap: 8px;
}

.security-mini div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.good,
.ok {
  color: var(--green);
}

.pending {
  color: var(--yellow);
}

.palette-title {
  margin-bottom: 12px;
  font-weight: 900;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 32px);
  gap: 6px;
}

.question-grid button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6f8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.question-grid .done {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.question-grid .review {
  color: #3b2a00;
  background: #ffe8a3;
  border-color: #efc34c;
}

.question-grid .current {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.question-panel {
  padding: clamp(20px, 4vw, 36px);
}

.exam-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.question-panel h3 {
  max-width: 900px;
  font-size: 24px;
  line-height: 1.35;
}

.question-visual {
  margin: 22px 0;
  padding: 18px;
  background: #edf7fb;
  border: 1px solid #cce6ef;
  border-radius: 8px;
}

.mock-spreadsheet {
  max-width: 620px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #aab8c2;
  border-radius: 8px;
}

.sheet-bar {
  height: 34px;
  background: linear-gradient(90deg, #16a34a 0 26%, #eef4f8 26%);
  border-bottom: 1px solid #aab8c2;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.sheet-grid span {
  min-height: 42px;
  padding: 11px;
  border-right: 1px solid #d4dde5;
  border-bottom: 1px solid #d4dde5;
  font-size: 14px;
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answers label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.answers .selected {
  border-color: var(--blue);
  background: #eef5ff;
}

.exam-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.admin-area {
  background: #fff;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.admin-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-menu button {
  min-height: 46px;
  padding: 0 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.admin-menu .active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.admin-content {
  padding: 22px;
  box-shadow: none;
}

.data-table {
  display: grid;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  color: #344054;
  background: var(--soft);
  font-weight: 900;
}

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

.admin-card {
  min-height: 240px;
  padding: 22px;
  box-shadow: none;
}

.card-icon {
  margin-bottom: 18px;
  background: #17202a;
}

.admin-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.admin-card p {
  line-height: 1.6;
}

.admin-card strong {
  display: block;
  margin-top: 22px;
  color: var(--blue);
  font-size: 20px;
}

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

.security-card {
  min-height: 230px;
  padding: 22px;
  box-shadow: none;
}

.security-card h3 {
  margin-bottom: 10px;
}

.meter {
  height: 10px;
  margin: 22px 0 12px;
  overflow: hidden;
  background: #ffe7df;
  border-radius: 999px;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--red);
}

.meter.safe {
  background: #ddf4e4;
}

.meter.safe span {
  background: var(--green);
}

.proctor-panel {
  margin-top: 18px;
  padding: 22px;
  box-shadow: none;
}

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

.monitor-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
}

.monitor-card.warning {
  border-left-color: var(--yellow);
}

.monitor-card.danger-state {
  border-left-color: var(--red);
}

.score-card,
.chart-card,
.wrong-list {
  min-height: 260px;
  padding: 22px;
  box-shadow: none;
}

.score-card strong {
  display: block;
  margin: 16px 0;
  color: var(--green);
  font-size: 44px;
  line-height: 1;
}

.chart-card,
.wrong-list {
  grid-column: span 1;
}

.bars {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 170px;
  padding-top: 18px;
}

.bars span {
  flex: 1;
  min-width: 20px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  border-radius: 8px 8px 0 0;
}

.wrong-list ol {
  display: grid;
  gap: 14px;
  padding-left: 20px;
  line-height: 1.5;
}

.architecture {
  background: #eef4f8;
}

.architecture img {
  display: block;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  color: #fff;
  background: #17202a;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition: 0.25s ease;
  pointer-events: none;
}

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

@media (max-width: 1080px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    max-width: none;
    flex-wrap: wrap;
  }

  .hero,
  .exam-shell,
  .portal-grid,
  .admin-layout,
  .admin-grid,
  .security-grid,
  .monitor-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .role-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .brand span {
    display: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link,
  .nav-group > button {
    width: 100%;
    text-align: left;
  }

  .submenu {
    position: static;
    min-width: 0;
    margin-top: 4px;
    box-shadow: none;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .split-heading,
  .exam-meta,
  .exam-actions,
  .panel-head,
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .question-grid {
    grid-template-columns: repeat(6, 32px);
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 32px;
  }
}

/* UI tuning: giam khoang trang va chi giu dam cho tieu de chinh */
.workspace,
.admin-area,
.architecture {
  padding-top: 28px;
  padding-bottom: 40px;
}

.brand-mark,
.avatar,
.card-icon,
.nav a,
.nav-group > button,
.login-panel label,
.chip,
.lock-badge,
.palette-title,
.question-grid button,
.answers label,
.admin-menu button {
  font-weight: 400;
}

h1,
h2,
h3,
.section-heading h2,
.table-head,
.primary-button,
.secondary-button,
.ghost-button {
  font-weight: 700;
}

.eyebrow {
  font-weight: 600;
}

.question-grid button {
  font-weight: 500;
}

h2,
.section-heading h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
