:root {
  --nci-blue: #092b5f;
  --nci-blue-2: #12457f;
  --nci-gold: #c08b25;
  --nci-gold-soft: #f6ead0;
  --nci-bg: #f4f7fb;
  --nci-text: #1e2a3d;
  --nci-muted: #667085;
  --nci-border: #dce4ef;
  --nci-white: #ffffff;
  --nci-danger: #b42318;
  --nci-success: #067647;
  --nci-shadow: 0 20px 60px rgba(9, 43, 95, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--nci-bg);
  color: var(--nci-text);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

img {
  max-width: 100%;
  display: block;
}

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

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(9, 43, 95, 0.95), rgba(18, 69, 127, 0.9)),
    url("../../images/hero-bg-gold.webp?v=20260722-1") center/cover no-repeat;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  box-shadow: var(--nci-shadow);
  padding: 36px;
}

.auth-logo {
  width: 156px;
  margin: 0 auto 22px;
}

.auth-card h1 {
  margin: 0 0 10px;
  color: var(--nci-blue);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 34px;
  line-height: 1.15;
  text-align: center;
}

.auth-card p {
  margin: 0 0 24px;
  color: var(--nci-muted);
  text-align: center;
}

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: var(--nci-white);
  border-right: 1px solid var(--nci-border);
  box-shadow: 14px 0 34px rgba(9, 43, 95, 0.07);
}

.dashboard-content {
  min-width: 0;
}

.dashboard-topbar {
  display: none;
}

.dashboard-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--nci-border);
}

.dashboard-brand img {
  width: 86px;
  flex: 0 0 auto;
}

.dashboard-brand strong,
.dashboard-user strong {
  display: block;
  color: var(--nci-blue);
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-brand span,
.dashboard-user span {
  color: var(--nci-muted);
  font-size: 13px;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--nci-blue);
  font-weight: 700;
}

.dashboard-nav a i {
  width: 20px;
  text-align: center;
  color: var(--nci-gold);
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: var(--nci-blue);
  color: var(--nci-white);
}

.dashboard-nav a:hover i,
.dashboard-nav a.active i {
  color: var(--nci-gold);
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--nci-border);
  border-radius: 8px;
  background: #f8fbff;
  min-width: 0;
}

.dashboard-user div {
  min-width: 0;
}

.dashboard-user strong,
.dashboard-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--nci-blue);
  color: var(--nci-white);
  font-weight: 800;
}

.logout-link {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--nci-gold);
  color: var(--nci-white);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--nci-blue);
  color: var(--nci-white);
}

.dashboard-main {
  width: min(100% - 48px, 1220px);
  margin: 0 auto;
  padding: 40px 0 64px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--nci-gold);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.page-hero h1 {
  margin: 0;
  color: var(--nci-blue);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 44px;
  line-height: 1.1;
}

.page-hero p {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--nci-muted);
}

.stat-grid,
.course-grid,
.admin-grid,
.lesson-grid,
.question-grid {
  display: grid;
  gap: 18px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.stat-card,
.content-card,
.course-card,
.lesson-card,
.answer-card,
.form-card,
.table-card {
  background: var(--nci-white);
  border: 1px solid var(--nci-border);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(9, 43, 95, 0.06);
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  color: var(--nci-muted);
  font-size: 14px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--nci-blue);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 36px;
  line-height: 1;
}

.course-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.course-card {
  overflow: hidden;
}

.course-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.course-body {
  padding: 22px;
}

.course-body h2,
.content-card h2,
.form-card h2,
.table-card h2 {
  margin: 0 0 10px;
  color: var(--nci-blue);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 28px;
  line-height: 1.2;
}

.course-body p {
  margin: 0 0 16px;
  color: var(--nci-muted);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3fb;
  color: var(--nci-blue);
  font-size: 13px;
  font-weight: 700;
}

.badge.gold {
  background: var(--nci-gold-soft);
  color: #7b5410;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
}

.btn-primary {
  background: var(--nci-gold);
  color: var(--nci-white);
}

.btn-blue {
  background: var(--nci-blue);
  color: var(--nci-white);
}

.btn-outline {
  background: var(--nci-white);
  border-color: var(--nci-blue);
  color: var(--nci-blue);
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.content-card {
  padding: 28px;
  margin-bottom: 24px;
}

.course-detail-hero {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.course-detail-hero img {
  width: 100%;
  min-height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

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

.lesson-card {
  padding: 22px;
}

.lesson-card h3 {
  margin: 0 0 8px;
  color: var(--nci-blue);
  font-family: "Josefin Sans", Arial, sans-serif;
  font-size: 24px;
}

.lesson-card p {
  color: var(--nci-muted);
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #d8e5f4;
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.empty-box {
  padding: 22px;
  border: 1px dashed var(--nci-border);
  border-radius: 8px;
  color: var(--nci-muted);
  background: #fbfcfe;
}

.admin-grid {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.admin-tabs {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--nci-white);
  border: 1px solid var(--nci-border);
  border-radius: 8px;
}

.admin-tabs a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--nci-blue);
  font-weight: 800;
}

.admin-tabs a.active,
.admin-tabs a:hover {
  background: var(--nci-blue);
  color: var(--nci-white);
}

.form-card,
.table-card {
  padding: 24px;
  margin-bottom: 22px;
}

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

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

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--nci-blue);
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--nci-border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--nci-text);
  background: var(--nci-white);
  outline: none;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.cms-image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--nci-border);
  border-radius: 8px;
  background: #f8fbff;
}

.cms-image-preview img {
  width: 96px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--nci-border);
  border-radius: 6px;
  background: var(--nci-white);
}

.cms-image-preview span {
  min-width: 0;
  color: var(--nci-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--nci-blue);
  box-shadow: 0 0 0 3px rgba(9, 43, 95, 0.12);
}

.auth-card .field {
  margin-bottom: 14px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--nci-border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--nci-blue);
  font-size: 13px;
  text-transform: uppercase;
}

.table td {
  color: var(--nci-muted);
}

.table td strong {
  color: var(--nci-text);
}

.alert {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 8px;
  font-weight: 600;
}

.alert-success {
  color: var(--nci-success);
  background: #e8f6ef;
}

.alert-danger {
  color: var(--nci-danger);
  background: #fef3f2;
}

.alert-info {
  color: var(--nci-blue);
  background: #edf3fb;
}

.question-grid {
  gap: 16px;
}

.answer-card {
  display: block;
  padding: 16px;
  cursor: pointer;
}

.answer-card input {
  margin-right: 10px;
}

.score-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.score-circle {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--nci-gold) var(--score), #e8eef6 0);
  color: var(--nci-blue);
  font-size: 30px;
  font-weight: 900;
}

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

@media (max-width: 1199px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 306px);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  .dashboard-layout.nav-open .dashboard-sidebar {
    transform: translateX(0);
  }

  .dashboard-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(9, 43, 95, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .dashboard-layout.nav-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 12px 24px;
    background: var(--nci-white);
    border-bottom: 1px solid var(--nci-border);
    box-shadow: 0 10px 30px rgba(9, 43, 95, 0.07);
  }

  .dashboard-topbar strong {
    display: block;
    color: var(--nci-blue);
    line-height: 1.2;
  }

  .dashboard-topbar span {
    display: block;
    color: var(--nci-muted);
    font-size: 13px;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

@media (max-width: 991px) {
  .course-detail-hero,
  .admin-grid,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    position: static;
  }
}

@media (max-width: 767px) {
  .auth-card {
    padding: 28px 22px;
  }

  .dashboard-topbar {
    min-height: 66px;
    padding: 10px 16px;
  }

  .dashboard-brand img {
    width: 74px;
  }

  .dashboard-main {
    width: min(100% - 24px, 1220px);
    padding-top: 24px;
  }

  .page-hero {
    grid-template-columns: 1fr;
  }

  .page-hero h1 {
    font-size: 34px;
  }

  .stat-grid,
  .course-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .content-card,
  .form-card,
  .table-card {
    padding: 20px;
  }
}
