:root {
  --portal-bg: #eef3f8;
  --portal-surface: #ffffff;
  --portal-text: #0f172a;
  --portal-muted: #64748b;
  --portal-primary: #1268b3;
  --portal-accent: #0f8b6f;
  --portal-border: #dbe4ee;
  --portal-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #162033;
  color: #fff;
  overflow: auto;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 20px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf6ff;
  color: var(--portal-primary);
  font-size: 22px;
  font-weight: 950;
}

.portal-brand strong,
.portal-brand small {
  display: block;
}

.portal-brand small {
  color: #b7c5d7;
  margin-top: 2px;
}

.portal-nav {
  display: grid;
  gap: 8px;
}

.portal-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #e6eef8;
  text-decoration: none;
  font-weight: 850;
  transition: background .15s ease, transform .15s ease;
}

.portal-link:hover,
.portal-link.active {
  background: #eaf6ff;
  color: #0b4f8a;
  transform: translateX(-2px);
}

.portal-link i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .10);
}

.portal-link.active i,
.portal-link:hover i {
  background: #d7ebff;
}

.portal-main {
  padding: 18px;
}

.portal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
}

.portal-topbar h1 {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 950;
}

.eyebrow {
  color: var(--portal-accent);
  font-size: 12px;
  font-weight: 950;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef7f4;
  color: #0b6b58;
  font-weight: 850;
}

.portal-hero {
  min-height: 170px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(18, 104, 179, .12), rgba(15, 139, 111, .08)), #fff;
  box-shadow: var(--portal-shadow);
}

.portal-hero h2 {
  margin: 6px 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.18;
  font-weight: 950;
}

.portal-hero p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.8;
}

.portal-hero-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--portal-primary);
  font-size: 38px;
}

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

.portal-card {
  grid-column: span 4;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--portal-shadow);
}

.portal-card.wide {
  grid-column: span 8;
}

.portal-card.full {
  grid-column: span 12;
}

.portal-card h3,
.portal-card h4 {
  margin: 0 0 12px;
  font-weight: 950;
}

.portal-entry {
  color: var(--portal-text);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.portal-entry:hover {
  transform: translateY(-2px);
  border-color: rgba(18, 104, 179, .35);
  box-shadow: 0 22px 48px rgba(15, 23, 42, .14);
}

.portal-entry > i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--portal-primary);
  font-size: 24px;
}

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

.metric {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #f8fbff;
}

.metric span,
.empty-state {
  color: var(--portal-muted);
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 950;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.portal-tab {
  border: 1px solid var(--portal-border);
  background: #fff;
  color: var(--portal-text);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
  font-weight: 850;
}

.portal-tab.active {
  border-color: rgba(18, 104, 179, .35);
  background: #eaf6ff;
  color: var(--portal-primary);
}

.portal-table {
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
}

.portal-table table {
  margin: 0;
}

.portal-table th {
  background: #1f2d42;
  color: #fff;
  white-space: nowrap;
}

.profile-stack {
  display: grid;
  gap: 6px;
}

.profile-stack strong {
  font-size: 20px;
  font-weight: 950;
}

.profile-stack span {
  color: var(--portal-muted);
  font-weight: 750;
}

.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.learning-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #f8fbff;
}

.learning-card strong {
  font-size: 17px;
  font-weight: 950;
}

.learning-card small {
  color: var(--portal-muted);
  font-weight: 750;
}

.learning-type {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf6ff;
  color: var(--portal-primary);
  font-size: 12px;
  font-weight: 950;
}

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

.form-control,
.btn {
  border-radius: 8px;
}

@media (max-width: 1000px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
    height: auto;
  }

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

  .portal-card,
  .portal-card.wide,
  .portal-card.full {
    grid-column: span 2;
  }

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

@media (max-width: 680px) {
  .portal-main {
    padding: 10px;
  }

  .portal-topbar,
  .portal-hero {
    display: block;
  }

  .topbar-actions {
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .portal-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .portal-card,
  .portal-card.wide,
  .portal-card.full {
    grid-column: span 1;
  }

  .portal-hero-icon {
    margin-top: 14px;
  }
}
