:root {
  --bg-page: #f4f5f6;
  --bg-header: #ffffff;
  --text-main: #1a1f2c;
  --text-link: #0f65c3;
  --text-muted: #5a677c;
  --border: #d6dce4;
  --border-soft: #e4e8ee;
  --card-bg: #ffffff;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

.topbar {
  min-height: 76px;
  padding: 0 22px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.topbar-nav {
  display: flex;
  align-items: center;
}

.nav-link {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  padding: 22px 12px 18px;
  border-bottom: 4px solid transparent;
}

.nav-link.active {
  border-bottom-color: var(--text-link);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang {
  border: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.arrow {
  font-size: 11px;
}

.login-link {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-link);
  font-size: 17px;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.admin-link {
  text-decoration: none;
  color: var(--text-link);
  font-size: 17px;
}

.page {
  width: min(1200px, 94%);
  margin: 42px auto;
}

.app-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.4fr 1fr;
}

.hero-card,
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 30px 34px;
}

.panel {
  padding: 22px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 54px);
  letter-spacing: 0.5px;
  font-weight: 800;
}

.subtitle {
  margin: 12px 0 0;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--text-muted);
  max-width: 64ch;
}

.stats-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.stat-label {
  display: block;
  font-size: 15px;
  color: var(--text-muted);
}

.stat-value {
  display: block;
  font-size: 34px;
  line-height: 1.1;
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.guinee-badge {
  width: clamp(160px, 17vw, 220px);
  min-height: 84px;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 8px 10px;
  flex: 0 0 auto;
}

.guinee-badge img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 68px;
  object-fit: contain;
}

.panel h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 700;
}

#course-section-title {
  font-size: clamp(22px, 2.2vw, 34px);
}

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

.search {
  width: min(360px, 100%);
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 18px;
  padding: 11px 14px;
}

.search:focus-visible {
  outline: 3px solid #99c7fb;
  outline-offset: 1px;
}

.course-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-item {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  display: block;
  width: 100%;
  color: var(--text-link);
  text-decoration: none;
  font-size: clamp(23px, 3vw, 36px);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  padding: 20px 24px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.course-item:hover {
  border-color: #bed3eb;
  transform: translateY(-1px);
}

.course-item.active {
  border-color: #79afea;
  box-shadow: 0 0 0 1px #79afea inset;
}

.course-item:focus-visible {
  outline: 3px solid #70aef0;
  outline-offset: 2px;
}

.details {
  align-self: start;
}

.details h3 {
  margin: 0;
  font-size: 32px;
}

.module-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 18px;
}

.module-list li {
  margin-bottom: 8px;
}

.primary-btn,
.ghost-btn {
  border: 0;
  font: inherit;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 17px;
  cursor: pointer;
}

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

.ghost-btn {
  background: #edf2f9;
  color: var(--text-main);
}

.details-link {
  margin-top: 8px;
  text-decoration: none;
  display: inline-block;
}

.empty {
  margin-top: 12px;
  font-size: 19px;
  color: var(--text-muted);
}

.hidden {
  display: none;
}

.login-dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
}

.login-dialog::backdrop {
  background: rgba(0, 8, 24, 0.3);
}

.login-dialog form {
  width: min(420px, 92vw);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-dialog h3 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-dialog label {
  font-size: 16px;
}

.login-dialog input {
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 16px;
  padding: 10px 12px;
}

.dialog-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1080px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 62px;
    padding: 0 10px;
  }

  .nav-link {
    font-size: 24px;
    padding: 16px 8px;
  }

  .lang {
    font-size: 14px;
  }

  .login-link {
    font-size: 15px;
  }

  .admin-link {
    font-size: 15px;
  }

  .page {
    margin-top: 26px;
    width: 94%;
  }

  .hero-card,
  .panel {
    border-radius: 12px;
    padding: 16px;
  }

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

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .guinee-badge {
    width: 100%;
    max-width: 240px;
    align-self: center;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .course-item {
    border-radius: 10px;
    padding: 14px 16px;
  }
}
