* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #a78bfa;
  --primary-soft: #ede9fe;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(165deg, #7c3aed 0%, #4c1d95 60%, #2e1065 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1100;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 26px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.78rem;
  opacity: 0.82;
}

.sidebar-profile {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-profile-info h3 {
  font-size: 0.98rem;
  font-weight: 600;
}

.sidebar-profile-info p {
  font-size: 0.78rem;
  opacity: 0.78;
}

.sidebar-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
}

.sidebar-menu li {
  margin: 2px 16px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  font-weight: 500;
  transition: 0.2s;
}

.sidebar-menu a i {
  width: 22px;
  text-align: center;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-logout {
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logout a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  font-weight: 500;
}

.sidebar-logout a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main area */
.main-area {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s;
}

/* Top header */
.top-header {
  height: 72px;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger {
  display: none;
  font-size: 1.4rem;
  color: var(--text);
  padding: 8px;
}

.top-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification {
  position: relative;
  font-size: 1.25rem;
  color: var(--muted);
  padding: 8px;
}

.notification .count {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.top-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.top-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.top-profile-info {
  text-align: right;
}

.top-profile-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
}

.top-profile-info span {
  font-size: 0.75rem;
  color: var(--muted);
}

.top-profile > i {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: 0.2s;
  z-index: 120;
}

.profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown a {
  display: block;
  padding: 10px 18px;
  color: var(--text);
  font-size: 0.9rem;
}

.profile-dropdown a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* Dashboard header */
.dashboard-header {
  padding: 30px 28px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}

.dashboard-header p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.current-date {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.current-date i {
  color: var(--primary);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  padding: 0 28px 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.stat-info p {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 0 28px 40px;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.view-all {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.view-all:hover {
  color: var(--primary-dark);
}

/* My courses */
.course-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.course-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: 0.2s;
}

.course-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.08);
}

.course-thumb {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.6rem;
}

.course-details {
  flex: 1;
  min-width: 0;
}

.course-details h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.course-details > p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.course-meta span {
  font-size: 0.8rem;
  color: var(--muted);
}

.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

/* Today's schedule */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schedule-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.schedule-time {
  min-width: 110px;
  text-align: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 10px;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 0.82rem;
}

.schedule-body {
  flex: 1;
  min-width: 0;
}

.schedule-body h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.schedule-body > p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.schedule-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-live {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge-room {
  background: #f3f4f6;
  color: var(--muted);
}

/* Pending assignments */
.assignment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assignment-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.assignment-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.assignment-top h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.assignment-top .due {
  font-size: 0.78rem;
  color: #dc2626;
  font-weight: 600;
  background: #fee2e2;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.assignment-item > p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 0%;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Announcements */
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.announcement-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.announcement-body {
  flex: 1;
  min-width: 0;
}

.announcement-body h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.announcement-body span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Profile card */
.profile-card {
  text-align: center;
}

.profile-card .avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 14px;
}

.profile-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-card .role {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.profile-card .dept {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 18px;
}

.profile-info {
  text-align: left;
  margin-bottom: 18px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row i {
  color: var(--primary);
  width: 18px;
  text-align: center;
}

.info-row div {
  flex: 1;
}

.info-row span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.info-row strong {
  font-size: 0.85rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
}

/* Page sections / SPA */
.page-section {
  display: none;
  animation: fadeIn 0.3s;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.placeholder-page {
  padding: 50px 24px;
  text-align: center;
}

.placeholder-page i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.placeholder-page h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text);
}

.placeholder-page p {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

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

  .course-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-header {
    padding: 20px 18px 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    padding: 0 18px 20px;
  }

  .dashboard-grid {
    padding: 0 18px 30px;
  }

  .card {
    padding: 18px;
  }

  .top-header {
    padding: 0 18px;
  }

  .top-profile-info {
    display: none;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-item {
    gap: 12px;
  }

  .schedule-time {
    min-width: 90px;
    font-size: 0.75rem;
  }

  .course-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
