
:root {
  --background: #f3faf8;
  --foreground: #10221f;
  --panel: #ffffff;
  --panel-soft: #f4fbf9;
  --line: #cce3de;
  --muted: #59716b;
  --brand: #00a84f;
  --brand-dark: #007a3d;
  --brand-deep: #005f56;
  --blue: #0072ce;
  --cyan: #00a6d6;
  --clay: #c08a18;
  --gold: #d6a12a;
  --success: #008a4a;
  --danger: #b3261e;
  --shadow: 0 20px 60px rgb(0 95 86 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    Inter, "Noto Sans", "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.academy-shell {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgb(0 168 79 / 10%) 0 18%, transparent 18% 100%),
    linear-gradient(160deg, rgb(0 114 206 / 10%) 0 20%, transparent 20% 100%),
    linear-gradient(180deg, #ffffff 0%, #f3faf8 45%, #e7f7f2 100%);
  color: var(--foreground);
}

.academy-shell::before {
  position: fixed;
  top: 88px;
  right: -8vw;
  width: 46vw;
  height: 78vh;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 26%, rgb(0 168 79 / 9%) 26% 28%, transparent 28% 38%, rgb(0 166 214 / 9%) 38% 40%, transparent 40% 100%);
}

.loading-view {
  display: grid;
  place-items: center;
  gap: 12px;
}

.academy-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgb(204 227 222 / 80%);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-block strong {
  display: block;
  color: var(--brand-deep);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.1;
}

.brand-mark {
  display: inline-flex;
  width: 60px;
  height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(0 168 79 / 16%);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f2fbf8);
  box-shadow: 0 10px 28px rgb(0 95 86 / 14%);
}

.brand-mark img {
  display: block;
  width: 46px;
  max-height: 34px;
  object-fit: contain;
}

.brand-mark.large {
  width: 112px;
  height: 86px;
  border-radius: 24px;
}

.brand-mark.large img {
  width: 84px;
  max-height: 58px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-pill,
.secondary-action,
.code-actions button,
.generated-code button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 88%);
  color: var(--brand-deep);
  font-weight: 750;
  padding: 0 15px;
}

.nav-pill.active,
.secondary-action:hover,
.code-actions button:hover,
.generated-code button:hover {
  border-color: var(--brand);
  background: #eefbf5;
  color: var(--brand-dark);
}

.welcome-grid,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(20px, 4vw, 46px);
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 7vw, 76px) 0;
}

.intro-panel,
.admin-intro {
  align-self: center;
}

.intro-panel h1,
.admin-intro h1,
.lesson-panel h1 {
  max-width: 820px;
  margin: 0;
  color: var(--brand-deep);
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-panel p:not(.eyebrow),
.admin-intro p:not(.eyebrow) {
  max-width: 650px;
  margin: 20px 0 0;
  color: #415f58;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.7;
}

.academy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.academy-metrics div {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 80%);
  box-shadow: 0 14px 38px rgb(0 95 86 / 7%);
  padding: 18px;
}

.academy-metrics strong {
  display: block;
  color: var(--blue);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1;
}

.academy-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.login-panel,
.admin-card,
.code-list,
.lesson-panel,
.quiz-panel,
.training-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow);
}

.login-panel,
.admin-card,
.code-list {
  padding: clamp(20px, 3vw, 30px);
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--brand-deep);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.15;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.role-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--role-color);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--role-color) 7%, white), #ffffff);
  color: var(--foreground);
  padding: 15px;
  text-align: left;
}

.role-card span {
  display: inline-grid;
  min-width: 40px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--role-color) 12%, white);
  color: var(--role-color);
  font-size: 0.78rem;
  font-weight: 850;
}

.role-card strong {
  display: block;
  margin-top: 14px;
  font-size: 0.98rem;
  line-height: 1.25;
}

.role-card.selected {
  border-color: var(--role-color);
  box-shadow: 0 14px 32px rgb(0 95 86 / 13%);
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--brand-deep);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b9d8d1;
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(0 168 79 / 14%);
}

.form-error {
  margin: 14px 0 0;
  border-left: 4px solid var(--danger);
  background: #fff4f2;
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 700;
}

.primary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
  font-weight: 850;
  padding: 0 20px;
  box-shadow: 0 14px 28px rgb(0 168 79 / 22%);
}

.login-panel .primary-action,
.admin-card .primary-action,
.quiz-panel .primary-action {
  width: 100%;
  margin-top: 20px;
}

.primary-action:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--blue));
}

.admin-layout {
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
}

.admin-workspace {
  display: grid;
  gap: 18px;
}

.generated-code {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  border: 1px dashed var(--brand);
  border-radius: 8px;
  background: #ecfbf5;
  padding: 14px;
}

.generated-code span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.generated-code strong {
  color: var(--brand-deep);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  word-break: break-word;
}

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

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, var(--panel-soft));
  padding: 14px;
}

.code-row.muted {
  opacity: 0.62;
}

.code-row strong,
.code-row span,
.code-row small {
  display: block;
}

.code-row strong {
  color: var(--brand-deep);
  word-break: break-word;
}

.code-row span {
  margin-top: 5px;
  color: var(--muted);
}

.employee-name-line {
  margin: 10px 0 0;
  color: var(--brand-deep);
  font-size: 0.95rem;
  line-height: 1.35;
}

.employee-name-line b {
  font-weight: 850;
}

.admin-progress {
  display: grid;
  gap: 8px;
  max-width: 440px;
  margin-top: 12px;
  border: 1px solid #d7eae5;
  border-radius: 8px;
  background: #f6fcfa;
  padding: 10px 12px;
}

.admin-progress-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-progress-label strong {
  color: var(--brand-deep);
  font-size: 0.84rem;
}

.admin-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceee9;
}

.admin-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--cyan), var(--blue));
}

.code-row small {
  margin-top: 5px;
  color: #7a8781;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.score-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  background: #ecf8ff;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0 12px;
}

.training-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.training-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  padding: 18px;
}

.employee-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.role-dot {
  width: 16px;
  height: 46px;
  border-radius: 999px;
}

.employee-card p,
.employee-card strong {
  display: block;
  margin: 0;
}

.employee-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.employee-card strong {
  margin-top: 2px;
  color: var(--brand-deep);
}

.progress-block {
  display: grid;
  gap: 10px;
  padding: 18px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-deep);
}

.progress-label span,
.progress-block small {
  color: var(--muted);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dceee9;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--cyan), var(--blue));
  transition: width 200ms ease;
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-deep);
  padding: 8px 10px;
  text-align: left;
}

.module-button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #e7f8f1;
  color: var(--brand-dark);
  font-weight: 850;
}

.module-button strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.module-button.active {
  border-color: var(--brand);
  background: #ecfbf5;
}

.training-main {
  display: grid;
  gap: 22px;
}

.lesson-panel,
.quiz-panel {
  padding: clamp(22px, 4vw, 38px);
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.lesson-meta span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  background: #e7f8f1;
  color: var(--brand-deep);
  font-size: 0.84rem;
  font-weight: 850;
  padding: 0 12px;
}

.lesson-panel h1 {
  max-width: 920px;
  font-size: clamp(1.7rem, 3.8vw, 3.15rem);
}

.lesson-panel p {
  max-width: 860px;
  margin: 18px 0 0;
  color: #415f58;
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  line-height: 1.75;
}

.practice-strip {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: linear-gradient(90deg, #ecfbf5, #fffdf4);
  padding: 16px 18px;
}

.practice-strip strong {
  color: var(--brand-deep);
}

.practice-strip span {
  color: #36534d;
  line-height: 1.55;
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.locked-quiz {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4fbf9;
  padding: 18px;
}

.locked-quiz strong {
  color: var(--brand-deep);
}

.locked-quiz span {
  color: var(--muted);
}

.quiz-question {
  min-width: 0;
  margin: 0 0 18px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
}

.quiz-question legend {
  color: var(--brand-deep);
  font-weight: 850;
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quiz-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  padding: 12px 14px;
  text-align: left;
  line-height: 1.35;
}

.quiz-option.selected {
  border-color: var(--blue);
  background: #eef6ff;
}

.quiz-option.correct {
  border-color: var(--success);
  background: #ecfbf5;
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: #fff4f2;
}

.result-box {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  border: 1px solid #f0c2bb;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  padding: 16px;
}

.result-box.pass {
  border-color: #b8dec8;
  background: #ecfbf5;
  color: var(--success);
}

@media (max-width: 980px) {
  .welcome-grid,
  .admin-layout,
  .training-layout {
    grid-template-columns: 1fr;
  }

  .training-sidebar {
    position: static;
  }
}

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-pill {
    flex: 1 1 auto;
  }

  .role-grid,
  .academy-metrics {
    grid-template-columns: 1fr;
  }

  .code-row,
  .generated-code {
    grid-template-columns: 1fr;
  }

  .code-actions,
  .lesson-actions {
    justify-content: stretch;
  }

  .lesson-actions button,
  .code-actions button {
    width: 100%;
  }
}
