/* ================================================
   GREAT SCHOLAR — STUDENT DASHBOARD
   Layout: Fixed sidebar left + scrollable main right
   Light bg, navy sidebar, card-based content
================================================ */

/* ── Shell ───────────────────────────────────── */
.dash-shell {
  display: flex;
  min-height: 100vh;
  background: #f0f4fb;
  font-family: 'Poppins', sans-serif;
}

/* ── Sidebar ─────────────────────────────────── */
.dash-sidebar {
  width: 260px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.dash-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dash-sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--sky);
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 1.1rem; color: var(--white);
  flex-shrink: 0;
}

.dash-sidebar-logo .logo-main {
  display: block;
  font-size: 1rem; font-weight: 800;
  color: var(--white);
}

.dash-sidebar-logo .logo-sub {
  display: block;
  font-size: 0.65rem; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.4px;
}

/* Student mini-profile in sidebar */
.dash-sidebar-user {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}

.dash-sidebar-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--sky);
  border: 2px solid rgba(255,255,255,0.25);
  overflow: hidden;
  flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--white); font-size: 1.1rem; font-weight: 700;
}

.dash-sidebar-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

.dash-sidebar-user-info .user-name {
  font-size: 0.85rem; font-weight: 700;
  color: var(--white); display: block;
}

.dash-sidebar-user-info .user-class {
  font-size: 0.72rem; color: rgba(255,255,255,0.5);
  display: block;
}

/* Nav links */
.dash-nav {
  flex: 1;
  padding: 16px 12px;
}

.dash-nav-section-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  padding: 14px 14px 6px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.dash-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.dash-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.dash-nav-item.active {
  background: var(--sky);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(30,144,255,0.35);
}

.dash-nav-item.logout-btn {
  color: rgba(255,100,100,0.8);
  margin-top: 8px;
}
.dash-nav-item.logout-btn:hover {
  background: rgba(255,100,100,0.12);
  color: #ff6b6b;
}

/* Sidebar bottom */
.dash-sidebar-bottom {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

/* ── Main area ───────────────────────────────── */
.dash-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top header bar */
.dash-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

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

.dash-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}

.dash-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s;
}

#dashPageTitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

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

.dash-notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--light-bg);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.dash-notif-btn:hover { background: var(--sky-light); color: var(--sky); }

.dash-notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.dash-topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.dash-topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid; place-items: center;
  overflow: hidden;
  border: 2px solid var(--sky-light);
}

.dash-topbar-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

.dash-topbar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

/* ── Content area ────────────────────────────── */
.dash-content {
  padding: 28px;
  flex: 1;
}

/* Section panels — only active shows */
.dash-section { display: none; }
.dash-section.active { display: block; }

/* ── Dashboard cards ─────────────────────────── */
.dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 18px;
}

.dash-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.dash-card-body { padding: 0 24px 24px; }

/* ── Stat cards row ──────────────────────────── */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon-sky    { background: var(--sky-light);    color: var(--sky); }
.stat-icon-green  { background: var(--green-light);  color: var(--green); }
.stat-icon-orange { background: var(--orange-light); color: var(--orange-dark); }
.stat-icon-purple { background: var(--purple-light); color: var(--purple); }

.stat-card-info .stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-card-info .stat-lbl {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Welcome banner ──────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #1a4a8e 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(30,144,255,0.15);
  border-radius: 50%;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 120px;
  width: 150px; height: 150px;
  background: rgba(245,166,35,0.1);
  border-radius: 50%;
}

.welcome-text { position: relative; z-index: 1; }

.welcome-text .greet {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.welcome-text h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
}

.welcome-text .welcome-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.welcome-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  padding: 4px 12px;
  border-radius: 100px;
}

.welcome-meta span i { color: var(--orange); }

.welcome-banner-img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  position: relative; z-index: 1;
}

.welcome-banner-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--sky);
  border: 4px solid rgba(255,255,255,0.2);
  display: grid; place-items: center;
  font-size: 2.5rem; font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
  position: relative; z-index: 1;
  overflow: hidden;
}

/* ── Two-column grid ─────────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dash-grid-3-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ── Results table ───────────────────────────── */
.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  background: var(--light-bg);
  color: var(--text-mid);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 13px 16px;
  font-size: 0.86rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}

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

.results-table tr:hover td {
  background: var(--sky-light);
}

.grade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.73rem;
  font-weight: 700;
}

.grade-A  { background: var(--green-light);  color: var(--green-dark); }
.grade-B  { background: var(--sky-light);    color: var(--sky-dark); }
.grade-C  { background: var(--orange-light); color: var(--orange-dark); }
.grade-D  { background: #fff0f0;             color: #c53030; }
.grade-F  { background: #fff0f0;             color: #c53030; }

.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.fill-green  { background: var(--green); }
.fill-sky    { background: var(--sky); }
.fill-orange { background: var(--orange); }
.fill-red    { background: #fc8181; }

/* ── Timetable ───────────────────────────────── */
.timetable-wrap {
  overflow-x: auto;
}

.timetable {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.timetable th {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 10px;
  text-align: center;
}

.timetable th:first-child {
  background: var(--navy-mid);
  text-align: left;
  padding-left: 16px;
  border-radius: 10px 0 0 0;
}

.timetable th:last-child { border-radius: 0 10px 0 0; }

.timetable td {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  vertical-align: middle;
  min-width: 90px;
}

.timetable td:first-child {
  text-align: left;
  padding-left: 16px;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-mid);
  background: var(--light-bg);
  white-space: nowrap;
}

.tt-cell {
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.tt-break {
  background: var(--light-bg);
  color: var(--text-light);
  font-style: italic;
  font-size: 0.72rem;
}

.tt-eng   { background: #dbeafe; color: #1e40af; }
.tt-math  { background: #fce7f3; color: #9d174d; }
.tt-sci   { background: #d1fae5; color: #065f46; }
.tt-ss    { background: #fef3c7; color: #92400e; }
.tt-civic { background: #ede9fe; color: #4c1d95; }
.tt-comp  { background: #e0f2fe; color: #075985; }
.tt-agric { background: #d1fae5; color: #064e3b; }
.tt-phe   { background: #ffedd5; color: #9a3412; }
.tt-art   { background: #fce7f3; color: #831843; }

/* ── Announcements ───────────────────────────── */
.announcement-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.announcement-item:last-child { border-bottom: none; padding-bottom: 0; }
.announcement-item:first-child { padding-top: 0; }

.ann-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ann-icon-orange { background: var(--orange-light); color: var(--orange-dark); }
.ann-icon-sky    { background: var(--sky-light);    color: var(--sky-dark); }
.ann-icon-green  { background: var(--green-light);  color: var(--green-dark); }
.ann-icon-purple { background: var(--purple-light); color: var(--purple); }

.ann-body { flex: 1; }

.ann-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
}

.ann-text {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 6px;
}

.ann-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ann-date {
  font-size: 0.72rem;
  color: var(--text-light);
  display: flex; align-items: center; gap: 4px;
}

.priority-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.p-urgent  { background: #fff0f0; color: #c53030; }
.p-info    { background: var(--sky-light); color: var(--sky-dark); }
.p-general { background: var(--light-bg);  color: var(--text-mid); }

/* ── Profile page ────────────────────────────── */
.profile-card-top {
  text-align: center;
  padding: 36px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.profile-big-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 4px solid var(--sky-light);
  overflow: hidden;
  background: var(--sky);
  display: grid; place-items: center;
  font-size: 2.5rem; font-weight: 800;
  color: var(--white);
}

.profile-big-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.profile-id-tag {
  font-size: 0.78rem;
  color: var(--text-mid);
  background: var(--light-bg);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
  font-weight: 600;
}

.profile-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--sky-light);
  color: var(--sky-dark);
}

.profile-tag.green { background: var(--green-light); color: var(--green-dark); }
.profile-tag.orange { background: var(--orange-light); color: var(--orange-dark); }

.profile-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.profile-detail-item {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.profile-detail-item:nth-child(even) { border-right: none; }
.profile-detail-item:nth-last-child(-n+2) { border-bottom: none; }

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

/* ── Term selector ───────────────────────────── */
.term-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.term-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}

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

.results-summary {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.res-sum-item { text-align: center; flex: 1; }
.res-sum-val  { font-size: 1.4rem; font-weight: 800; color: var(--white); display: block; }
.res-sum-lbl  { font-size: 0.68rem; color: rgba(255,255,255,0.55); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--green-light);
  color: var(--green-dark);
  border: 1.5px solid var(--green);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.download-btn:hover {
  background: var(--green);
  color: var(--white);
}

/* ── Sidebar overlay (mobile) ────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .stat-cards-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3-1  { grid-template-columns: 1fr; }
}

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

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

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

  .dash-hamburger { display: flex; }

  .dash-grid-2 { grid-template-columns: 1fr; }

  .profile-details-grid { grid-template-columns: 1fr; }
  .profile-detail-item  { border-right: none; }
  .profile-detail-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .profile-detail-item:last-child { border-bottom: none; }
}

@media (max-width: 540px) {
  .stat-cards-row { grid-template-columns: 1fr; }
  .dash-content   { padding: 16px; }
  .welcome-banner { flex-direction: column; text-align: center; }
  .welcome-banner-avatar, .welcome-banner-img { display: none; }
  .welcome-meta   { justify-content: center; }
  .results-summary { gap: 10px; }
}
