
:root {
  --navy: #243f6b;
  --navy-hover: #3e5a83;
  --blue: #397fc5;
  --background: #f5f7fc;
  --white: #ffffff;
  --text: #1d2d45;
  --muted: #7c8ba2;
  --border: #e1e7f0;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
}

button {
  font-family: inherit;
}

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* SIDEBAR */

.sidebar {
  width: 295px;
  flex: 0 0 295px;
  min-height: 100vh;
  padding: 40px 25px;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 65px;
}

.brand-logo {
  font-size: 40px;
  font-weight: 800;
  color: white;
}

.brand-logo span {
  color: #8fc7eb;
}

.brand-name {
  font-size: 17px;
  font-weight: bold;
}

.demo-label {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  background: #48648c;
  border-radius: 5px;
  font-size: 10px;
  font-weight: bold;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav {
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e6edf8;
  text-align: left;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav span {
  display: inline-block;
  width: 30px;
}

.nav:hover,
.nav.active {
  background: var(--navy-hover);
  color: white;
}

.sidebar-note {
  margin-top: auto;
  padding-top: 35px;
  color: #c4d4ec;
  font-size: 13px;
  line-height: 1.8;
}

/* MAIN LAYOUT */

.main {
  flex: 1;
  min-width: 0;
  background: var(--background);
}

.topbar {
  height: 90px;
  padding: 0 50px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb {
  color: var(--muted);
  font-size: 15px;
}

.avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: #e1effa;
  color: #32699e;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.avatar:hover {
  background: #bddcf3;
  transform: scale(1.08);
}

.avatar:focus-visible,
.nav:focus-visible,
.card:focus-visible {
  outline: 3px solid #64a8e6;
  outline-offset: 3px;
}

/* PAGE CONTENT */

.content {
  width: 100%;
  max-width: 1500px;
  padding: 60px 50px;
  margin: 0 auto;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h1 {
  margin: 12px 0 22px;
  font-size: 38px;
}

h2 {
  margin: 35px 0 22px;
  font-size: 23px;
}

p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* DASHBOARD STATS */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 35px 0 45px;
}

.stat {
  min-width: 0;
  padding: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(20,40,80,0.03);
}

.stat small {
  display: block;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  font-size: 34px;
  overflow-wrap: anywhere;
}

/* COURSE CARDS */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 30px;
}

.card {
  min-width: 0;
  min-height: 185px;
  padding: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: 0.2s;
  box-shadow: 0 6px 20px rgba(20,40,80,0.03);
}

.card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(20,40,80,0.08);
}

.card .code {
  color: #3976b7;
  font-size: 15px;
  font-weight: bold;
}

.card h3 {
  margin: 22px 0;
  font-size: 19px;
  line-height: 1.4;
}

.card .foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.grade {
  color: #3976b7;
  font-weight: bold;
  white-space: nowrap;
}

/* ASSESSMENT TABLE */

.panel {
  padding: 30px;
  margin-top: 30px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
}

.panel h2 {
  margin-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 17px;
  background: #f1f5fa;
  color: #61718b;
  font-size: 14px;
  text-align: left;
}

td {
  padding: 18px 17px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

tr:last-child td {
  border-bottom: none;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: #e2f4e9;
  color: #278453;
  font-size: 12px;
  font-weight: bold;
}

.tag.pending {
  background: #fff1d9;
  color: #b57a21;
}

.back {
  display: block;
  margin-bottom: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
  cursor: pointer;
}

.back:hover {
  text-decoration: underline;
}

/* STUDENT PROFILE */

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #dceaf7;
  color: #24527f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  font-weight: bold;
}

.profile-header h2 {
  margin: 0;
}

.profile-header p {
  margin: 8px 0;
}

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

.field {
  min-width: 0;
  padding: 20px;
  background: #f8fafd;
  border: 1px solid #edf0f5;
  border-radius: 10px;
}

.field small {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.field strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.notice {
  margin-top: 55px;
  color: #98a4b6;
  font-size: 13px;
}

/* RESPONSIVE */

@media (max-width: 1150px) {
  .cards,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 750px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    flex: none;
    padding: 20px;
  }

  .brand {
    margin-bottom: 20px;
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 30px 20px;
  }

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

  h1 {
    font-size: 30px;
  }
}


/* =========================
   MOBILE RESPONSIVE DESIGN
   ========================= */

@media screen and (max-width: 768px) {

  /* Main layout */
  .layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Sidebar becomes a compact header */
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 18px 16px 12px;
    position: relative;
  }

  /* Smaller logo */
  .brand {
    margin-bottom: 16px;
    gap: 12px;
  }

  .brand-logo {
    font-size: 30px;
  }

  .brand-name {
    font-size: 18px;
  }

  .demo-label {
    font-size: 10px;
  }

  /* Horizontal navigation */
  .navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 12px 4px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .nav span {
    font-size: 18px;
  }

  /* Hide sidebar disclaimer on mobile */
  .sidebar-note {
    display: none;
  }

  /* Main content */
  .main {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .topbar {
    padding: 14px 16px;
    min-height: 70px;
    gap: 12px;
  }

  .breadcrumb {
    font-size: 12px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .content {
    width: 100%;
    max-width: 100%;
    padding: 24px 16px 40px;
    box-sizing: border-box;
  }

  /* Page headings */
  .content h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  .content h2 {
    font-size: 21px;
  }

  /* Statistics stack vertically */
  .stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat {
    min-width: 0;
    padding: 18px;
  }

  /* Unit cards */
  .cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    width: 100%;
    min-width: 0;
    padding: 20px;
    box-sizing: border-box;
  }

  /* Profile */
  .panel {
    width: 100%;
    min-width: 0;
    padding: 18px;
    box-sizing: border-box;
  }

  .profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    font-size: 24px;
  }

  .profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Allow assessment tables to scroll */
  .panel:has(table) {
    overflow-x: auto;
  }

  table {
    min-width: 480px;
  }

  /* Footer notice */
  .notice {
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
}
