html, body {
  margin:0;
  min-height:100%;
}

body{
  margin:0;
  font-family:'Poppins', sans-serif;
  background:linear-gradient(135deg,#0b0f2a,#2b1e5a);
  color:white;
  transition:
    background 0.35s ease,
    color 0.35s ease;
  min-height:100vh;
  overflow-x:hidden;
  overflow-y:auto;
}

/* LAYOUT */
.layout{
  display:flex;
  min-height:100vh;
}

/* SIDEBAR */
.sidebar{
  width:240px;
  background:#1a1140;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:20px;
  box-sizing:border-box;
  transition:background 0.35s ease;
}

.sidebar-toggle{
  display:none;
  width:46px;
  height:46px;
  border:none;
  border-radius:14px;
  background:rgba(255,255,255,0.08);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  padding:0;
  flex-shrink:0;
}

.sidebar-toggle span{
  width:20px;
  height:2px;
  background:#fff;
  border-radius:999px;
  display:block;
  transition:transform 0.25s ease, opacity 0.25s ease, background 0.35s ease;
}

/* TOP SECTION */
.top-section{
  display:flex;
  flex-direction:column;
  gap:30px;
}

/* LOGO */
.logo-link{
  text-decoration:none;
  display:inline-block;
}

.logo{
  font-family:'Press Start 2P', cursive;
  font-size:14px;
  line-height:1.5;
  background:linear-gradient(90deg,#ff982e 0%,#ff7c2e 28%,#ff4d95 68%,#ff4fb8 100%);
  background-clip: text;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  margin:0;
  cursor:pointer;
  transition:transform 0.25s ease;
  filter:
    drop-shadow(0 0 6px rgba(255,138,42,0.45))
    drop-shadow(0 0 14px rgba(255,46,151,0.28));
}

.logo-link:hover .logo{
  transform:scale(1.03);
}

/* MENU */
.menu{
  display:flex;
  flex-direction:column;
  gap:30px;
  padding-top:14px;
}

.menu a{
  color:white;
  text-decoration:none;
  opacity:0.8;
  font-size:14px;
  line-height:1.2;
  padding:2px 0;
  display:flex;
  align-items:center;
  gap:8px;
  width:fit-content;
  transition:
    0.25s ease,
    color 0.35s ease;
}

.nav-reply-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:linear-gradient(135deg,#ff2e97,#ff8c00);
  color:#fff;
  font-size:11px;
  font-weight:800;
  line-height:1;
  box-shadow:0 8px 18px rgba(255,46,151,0.25);
}

.menu a:hover,
.menu a.active-link{
  opacity:1;
  transform:translateX(5px);
}

/* BOTTOM SECTION */
.bottom-section{
  padding-top:20px;
  border-top:1px solid rgba(255,255,255,0.1);
}

/* LOGOUT */
.logout-btn{
  width:100%;
  padding:12px;
  border:none;
  border-radius:12px;
  background:#ff2e97;
  color:white;
  cursor:pointer;
  font-weight:600;
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.logout-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 22px rgba(255,46,151,0.22);
  filter:brightness(1.05);
}

/* MAIN */
.main{
  flex:1;
  padding:24px;
  box-sizing:border-box;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:20px;
  overflow-y:auto;
}

.main::-webkit-scrollbar{
  width:8px;
}

.main::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.18);
  border-radius:999px;
}

/* TOPBAR */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  animation:fadeSlideUp 0.55s ease both;
}

.topbar h2{
  margin:0;
}

.topbar-title{
  display:flex;
  align-items:center;
  gap:12px;
}

/* USER */
.user-top{
  display:flex;
  align-items:center;
  gap:10px;
  background:rgba(255,255,255,0.06);
  padding:10px 14px;
  border-radius:14px;
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.25s ease;
}

.user-top:hover{
  transform:translateY(-2px);
}

.user-top span{
  font-weight:600;
}

.user-top img{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
}

/* GRID */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:20px;
}

/* CARD */
.card{
  background:#3a2575;
  padding:20px;
  border-radius:18px;
  box-sizing:border-box;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  transition:
    transform 0.28s ease,
    box-shadow 0.3s ease,
    background 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
  border:1px solid transparent;
}

.card:hover{
  transform:translateY(-4px);
  box-shadow:0 14px 28px rgba(0,0,0,0.16);
}

/* BIGGER STATS */
.stats-grid .card{
  min-height:140px;
}

.section{
  min-height:180px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

/* CARD TEXT */
.card h3{
  margin:0 0 10px 0;
}

.card p{
  margin:0;
  font-size:26px;
  font-weight:700;
}

/* PROGRESS */
.progress-bar{
  height:12px;
  background:rgba(255,255,255,0.2);
  border-radius:10px;
  margin-top:12px;
  overflow:hidden;
  position:relative;
}

#progressFill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,#00e5ff,#00ffcc);
  transition:width 1s cubic-bezier(0.22, 1, 0.36, 1);
  position:relative;
}

#progressFill::after{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:38px;
  height:100%;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.45));
  filter:blur(2px);
  opacity:0.7;
}

/* SUBJECTS */
.subjects{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:15px;
  margin-top:12px;
  flex:1;
}

.subjects button{
  width:100%;
  min-height:54px;
  padding:12px;
  border:none;
  border-radius:12px;
  background:#ff2e97;
  color:white;
  cursor:pointer;
  font-weight:600;
  transition:
    transform 0.22s ease,
    box-shadow 0.28s ease,
    filter 0.25s ease;
}

.subjects button:hover{
  transform:translateY(-3px) scale(1.01);
  box-shadow:0 12px 24px rgba(255,46,151,0.2);
  filter:brightness(1.05);
}

/* SECTION HEAD */
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.career-role-card p{
  margin-bottom:6px;
}

.career-role-path{
  display:block;
  margin-bottom:10px;
  font-size:13px;
  color:#7ff7ff;
  font-weight:800;
}

.career-role-track{
  margin:10px 0 8px;
}

.career-role-fill{
  height:100%;
  border-radius:10px;
  background:linear-gradient(90deg,#ff2e97,#00e5ff,#32ffc7);
  transition:width 0.4s ease;
}

.career-role-card small{
  display:block;
  line-height:1.45;
  opacity:0.84;
}

.section-head-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.section-note{
  font-size:12px;
  opacity:0.8;
}

/* VIEW FULL BUTTON */
.view-full-btn{
  border:none;
  border-radius:12px;
  padding:10px 14px;
  background:linear-gradient(135deg,#00e5ff,#00ffcc);
  color:#000;
  cursor:pointer;
  font-weight:700;
  transition:
    transform 0.2s ease,
    box-shadow 0.28s ease,
    filter 0.28s ease;
}

.view-full-btn:hover{
  transform:translateY(-2px) scale(1.02);
  box-shadow:0 10px 24px rgba(0,229,255,0.24);
  filter:brightness(1.04);
}

.alt-action-btn{
  background:linear-gradient(135deg,#6d5dfc,#9d4edd);
  color:#fff;
}

/* DASHBOARD LEADERBOARD PREVIEW */
.leaderboard-preview-section{
  min-height:250px;
  animation:fadeSlideUp 0.75s ease both;
}

.dashboard-leaderboard-preview{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
}

.dashboard-certificates-preview{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
}

.dashboard-certificate-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px;
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  border:1px solid rgba(255,255,255,0.08);
}

.dashboard-certificate-card.locked{
  opacity:0.78;
}

.dashboard-certificate-mark{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:800;
  background:rgba(255,255,255,0.1);
}

.dashboard-certificate-card.unlocked .dashboard-certificate-mark{
  color:#08111f;
  background:linear-gradient(135deg,#00e5ff,#32ffc7);
}

.dashboard-certificate-copy{
  flex:1;
}

.dashboard-certificate-copy h4{
  margin:0 0 6px;
  font-size:17px;
}

.dashboard-certificate-copy p{
  margin:0;
  font-size:13px;
  line-height:1.5;
  opacity:0.82;
}

.dashboard-certificate-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:0 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  background:rgba(255,255,255,0.08);
}

.preview-player{
  position:relative;
  border-radius:18px;
  padding:18px 16px;
  text-align:center;
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  border:1px solid rgba(255,255,255,0.09);
  box-shadow:0 10px 20px rgba(0,0,0,0.18);
  transition:
    transform 0.28s ease,
    box-shadow 0.3s ease,
    filter 0.28s ease,
    background 0.35s ease,
    color 0.35s ease;
  animation:cardPopIn 0.6s ease both;
}

.preview-player:nth-child(1){ animation-delay:0.05s; }
.preview-player:nth-child(2){ animation-delay:0.14s; }
.preview-player:nth-child(3){ animation-delay:0.23s; }

.preview-player:hover{
  transform:translateY(-5px) scale(1.015);
  box-shadow:0 16px 30px rgba(0,0,0,0.18);
  filter:brightness(1.03);
}

.preview-player.first{
  background:linear-gradient(135deg,rgba(255,140,0,0.92),rgba(255,46,151,0.95));
  box-shadow:0 0 24px rgba(255,46,151,0.32);
  animation:
    cardPopIn 0.6s ease both,
    championPulse 2.8s ease-in-out infinite;
}

.preview-player.second{
  background:linear-gradient(135deg,rgba(0,229,255,0.18),rgba(255,255,255,0.06));
}

.preview-player.third{
  background:linear-gradient(135deg,rgba(0,255,204,0.15),rgba(255,255,255,0.06));
}

.preview-badge{
  position:absolute;
  top:12px;
  right:12px;
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  background:rgba(255,255,255,0.16);
  animation:floatMedal 2.4s ease-in-out infinite;
}

.preview-avatar{
  width:70px;
  height:70px;
  border-radius:50%;
  object-fit:cover;
  border:3px solid rgba(255,255,255,0.55);
  box-shadow:0 6px 15px rgba(0,0,0,0.22);
  margin-top:10px;
  transition:transform 0.25s ease;
}

.preview-player:hover .preview-avatar{
  transform:scale(1.05);
}

.preview-name{
  margin-top:12px;
  font-size:16px;
  font-weight:700;
  line-height:1.3;
  word-break:break-word;
}

.preview-rank{
  margin-top:6px;
  font-size:12px;
  opacity:0.88;
  font-weight:600;
}

.preview-xp{
  margin-top:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  background:rgba(255,255,255,0.14);
  animation:xpGlow 2.2s ease-in-out infinite;
}

.preview-empty{
  grid-column:1 / -1;
  padding:18px;
  border-radius:14px;
  text-align:center;
  background:rgba(255,255,255,0.06);
  font-size:14px;
  opacity:0.88;
}

/* ACHIEVEMENTS */
.achievements-section{
  min-height:250px;
  animation:fadeSlideUp 0.95s ease both;
}

.achievements-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}

.achievement-card{
  background:rgba(255,255,255,0.08);
  border:none;
  border-radius:14px;
  padding:16px;
  color:white;
  text-align:left;
  cursor:pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.28s ease,
    background 0.35s ease,
    color 0.35s ease,
    opacity 0.28s ease,
    filter 0.28s ease;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.achievement-card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 20px rgba(0,0,0,0.2);
}

.achievement-card.unlocked{
  background:linear-gradient(135deg,rgba(255,46,151,0.35),rgba(0,229,255,0.2));
  border:1px solid rgba(255,255,255,0.15);
}

.achievement-card.unlocked:hover{
  box-shadow:0 12px 24px rgba(255,46,151,0.14);
}

.achievement-card.locked{
  background:rgba(255,255,255,0.05);
  opacity:0.82;
  filter:saturate(0.85);
}

.achievement-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}

.achievement-icon{
  font-size:24px;
  transition:transform 0.2s ease;
}

.achievement-card:hover .achievement-icon{
  transform:scale(1.08);
}

.achievement-status{
  font-size:11px;
  font-weight:700;
  padding:4px 8px;
  border-radius:999px;
}

.achievement-status.unlocked{
  background:#00ffcc;
  color:#0b0f2a;
}

.achievement-status.locked{
  background:rgba(255,255,255,0.15);
  color:white;
}

.achievement-title{
  font-weight:700;
  margin-top:10px;
  font-size:15px;
}

.achievement-subtext{
  margin-top:6px;
  font-size:12px;
  opacity:0.85;
  line-height:1.5;
}

/* THEME BUTTON */
.theme-toggle{
  position:fixed;
  bottom:20px;
  right:20px;
  width:55px;
  height:55px;
  border:none;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  cursor:pointer;
  background:linear-gradient(135deg,#00e5ff,#00ffcc);
  color:#000;
  box-shadow:0 0 15px #00e5ff;
  transition:
    transform 0.28s ease,
    box-shadow 0.35s ease,
    background 0.35s ease,
    color 0.35s ease;
  z-index:1000;
}

.theme-toggle:hover{
  transform:scale(1.1) rotate(10deg);
  box-shadow:0 0 24px rgba(0,229,255,0.45);
}

/* POPUP */
.popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.65);
  display:flex;
  justify-content:center;
  align-items:center;
  opacity:0;
  pointer-events:none;
  transition:0.25s;
  z-index:1200;
}

.popup.active{
  opacity:1;
  pointer-events:auto;
}

.popup-box{
  width:360px;
  max-width:90%;
  background:#1a1140;
  border-radius:18px;
  padding:24px;
  box-shadow:0 0 35px rgba(255,46,151,0.45);
  text-align:center;
  transition:
    background 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

.popup-box h3{
  margin:0 0 12px 0;
}

.popup-box p{
  margin:0;
  line-height:1.6;
  font-size:14px;
  opacity:0.95;
}

.popup-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:18px;
}

.popup-actions button{
  border:none;
  border-radius:12px;
  padding:12px;
  cursor:pointer;
  font-weight:600;
  background:#ff2e97;
  color:white;
}

.popup-actions .secondary-btn{
  background:transparent;
  border:2px solid #00e5ff;
  color:#00e5ff;
}

.achievement-popup-box{
  text-align:center;
}

.achievement-modal-icon{
  font-size:42px;
  margin-bottom:10px;
}

.achievement-modal-status{
  margin-top:14px;
  font-size:13px;
  font-weight:700;
  padding:8px 12px;
  border-radius:999px;
  display:inline-block;
}

.achievement-modal-status.unlocked{
  background:#00ffcc;
  color:#0b0f2a;
}

.achievement-modal-status.locked{
  background:rgba(255,255,255,0.14);
  color:white;
}

/* CONFETTI */
.confetti-container{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:1300;
}

.confetti-piece{
  position:absolute;
  width:10px;
  height:16px;
  top:-20px;
  opacity:0.9;
  animation:fallConfetti linear forwards;
}

@keyframes fallConfetti{
  from{
    transform:translateY(-20px) rotate(0deg);
  }
  to{
    transform:translateY(110vh) rotate(720deg);
  }
}

/* PAGE ENTRANCE */
@keyframes fadeSlideUp{
  from{
    opacity:0;
    transform:translateY(18px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes cardPopIn{
  from{
    opacity:0;
    transform:translateY(18px) scale(0.97);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes championPulse{
  0%,100%{
    box-shadow:0 0 24px rgba(255,46,151,0.26);
  }
  50%{
    box-shadow:0 0 34px rgba(255,46,151,0.42);
  }
}

@keyframes floatMedal{
  0%,100%{
    transform:translateY(0);
  }
  50%{
    transform:translateY(-4px);
  }
}

@keyframes xpGlow{
  0%,100%{
    box-shadow:0 0 0 rgba(255,255,255,0);
  }
  50%{
    box-shadow:0 0 16px rgba(255,255,255,0.16);
  }
}

/* LOAD ANIMATION TARGETS */
.stats-grid .card{
  animation:fadeSlideUp 0.55s ease both;
}

.stats-grid .card:nth-child(1){ animation-delay:0.05s; }
.stats-grid .card:nth-child(2){ animation-delay:0.14s; }
.stats-grid .card:nth-child(3){ animation-delay:0.23s; }

.section:nth-of-type(1){
  animation:fadeSlideUp 0.65s ease both;
}

/* LIGHT MODE */
body.light-mode{
  background:#f4f6fb;
  color:#222;
}

body.light-mode .sidebar{
  background:white;
}

body.light-mode .sidebar-toggle{
  background:rgba(108,76,255,0.1);
}

body.light-mode .sidebar-toggle span{
  background:#1a1140;
}

body.light-mode .menu a{
  color:#222;
}

body.light-mode .nav-reply-badge{
  color:#fff;
}

body.light-mode .card{
  background:white;
  color:#222;
  box-shadow:0 5px 15px rgba(0,0,0,0.1);
}

body.light-mode .progress-bar{
  background:#ddd;
}

body.light-mode .career-role-path{
  color:#007ca6;
}

body.light-mode .user-top{
  background:#ffffff;
  box-shadow:0 5px 15px rgba(0,0,0,0.08);
}

body.light-mode .achievement-card{
  color:#222;
}

body.light-mode .achievement-card.locked{
  background:#f3f4fb;
}

body.light-mode .achievement-card.unlocked{
  background:linear-gradient(135deg,rgba(108,76,255,0.16),rgba(0,119,255,0.1));
}

body.light-mode .preview-player{
  background:linear-gradient(180deg,#ffffff,#f4f6fb);
  color:#222;
  border:1px solid rgba(0,0,0,0.06);
  box-shadow:0 10px 18px rgba(0,0,0,0.08);
}

body.light-mode .preview-player.first{
  background:linear-gradient(135deg,#ff8c00,#ff2e97);
  color:white;
}

body.light-mode .preview-player.second{
  background:linear-gradient(135deg,rgba(0,119,255,0.1),rgba(108,76,255,0.12));
}

body.light-mode .preview-player.third{
  background:linear-gradient(135deg,rgba(0,229,255,0.1),rgba(0,255,204,0.12));
}

body.light-mode .dashboard-certificate-card{
  background:linear-gradient(180deg,#ffffff,#f4f6fb);
  color:#222;
  border:1px solid rgba(0,0,0,0.06);
  box-shadow:0 10px 18px rgba(0,0,0,0.08);
}

body.light-mode .dashboard-certificate-copy p{
  color:rgba(34,34,34,0.78);
}

body.light-mode .dashboard-certificate-mark{
  background:rgba(108,76,255,0.08);
  color:#3d2b8f;
}

body.light-mode .dashboard-certificate-pill{
  background:#f0ecff;
  color:#3d2b8f;
}

body.light-mode .achievement-status.locked{
  background:#e8e8f5;
  color:#222;
}

body.light-mode .popup-box{
  background:white;
  color:#222;
  box-shadow:0 10px 30px rgba(0,0,0,0.15);
}

body.light-mode .popup-actions .secondary-btn{
  color:#0077ff;
  border-color:#0077ff;
}

body.light-mode .theme-toggle{
  background:linear-gradient(135deg,#ff2e97,#ff8c00);
  color:white;
  box-shadow:0 0 15px rgba(255,46,151,0.35);
}

body.light-mode .view-full-btn{
  background:linear-gradient(135deg,#ff2e97,#ff8c00);
  color:white;
}

/* RESPONSIVE */
@media(max-width:1400px){
  .stats-grid{
    grid-template-columns:repeat(2, 1fr);
  }
}

@media(max-width:1100px){
  .stats-grid{
    grid-template-columns:1fr;
  }

  .subjects{
    grid-template-columns:1fr;
  }

  .achievements-grid{
    grid-template-columns:repeat(2, 1fr);
  }

  .dashboard-leaderboard-preview{
    grid-template-columns:1fr;
  }

  .dashboard-certificates-preview{
    grid-template-columns:1fr;
  }
}

@media(max-width:900px){
  .layout{
    flex-direction:column;
    position:relative;
  }

  .sidebar-toggle{
    display:inline-flex;
  }

  .sidebar{
    display:none;
    position:fixed;
    top:84px;
    left:12px;
    right:12px;
    width:auto;
    min-height:auto;
    max-height:calc(100vh - 108px);
    overflow:auto;
    border-radius:22px;
    box-shadow:0 18px 42px rgba(6,8,28,0.4);
    border:1px solid rgba(255,255,255,0.08);
    z-index:1200;
  }

  .layout.mobile-nav-open .sidebar{
    display:flex;
  }

  .layout.mobile-nav-open .sidebar-toggle span:nth-child(1){
    transform:translateY(7px) rotate(45deg);
  }

  .layout.mobile-nav-open .sidebar-toggle span:nth-child(2){
    opacity:0;
  }

  .layout.mobile-nav-open .sidebar-toggle span:nth-child(3){
    transform:translateY(-7px) rotate(-45deg);
  }

  .main{
    padding:20px;
  }

  .topbar{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    flex-wrap:nowrap;
  }

  .achievements-grid{
    grid-template-columns:1fr;
  }

  .section-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .user-top{
    margin-left:auto;
    align-self:auto;
    flex-shrink:0;
  }
}

@media(max-width:600px){
  .main{
    padding:16px 12px 24px;
  }

  .topbar{
    gap:10px;
  }

  .topbar-title{
    flex:1;
    min-width:0;
  }

  .topbar h2{
    font-size:22px;
  }

  .user-top{
    padding:8px 10px;
    gap:8px;
  }

  .user-top span{
    font-size:13px;
    white-space:nowrap;
  }

  .user-top img{
    width:34px;
    height:34px;
  }

  .sidebar{
    top:72px;
    left:10px;
    right:10px;
    padding:18px;
  }

  .menu{
    gap:20px;
    padding-top:8px;
  }
}

.review-tools-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  margin-top:16px;
}

.review-tool-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  padding:18px 20px;
  border-radius:18px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
}

.review-tool-icon{
  width:52px;
  height:52px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,rgba(255,46,151,0.24),rgba(0,229,255,0.2));
  font-size:24px;
}

.review-tool-copy h4{
  margin:0 0 6px;
  font-size:18px;
}

.review-tool-copy p{
  margin:0;
  opacity:0.85;
  line-height:1.5;
}

.review-tool-metric{
  min-width:76px;
  text-align:right;
}

.review-tool-metric span{
  display:block;
  font-size:30px;
  font-weight:700;
}

.review-tool-metric small{
  opacity:0.75;
}

.insight-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  padding:18px 20px;
  margin-top:16px;
  border-radius:18px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
}

.insight-icon{
  width:54px;
  height:54px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,rgba(255,46,151,0.22),rgba(0,229,255,0.18));
  font-size:24px;
}

.insight-copy h4{
  margin:0 0 6px;
  font-size:20px;
}

.insight-copy p{
  margin:0;
  opacity:0.85;
  line-height:1.55;
}

.insight-meta{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:flex-end;
  gap:8px;
}

.insight-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,229,255,0.14);
  color:#88fbff;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.04em;
}

.resume-save-meta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  max-width:180px;
  text-align:right;
  color:#d7d2f6;
  font-size:12px;
  line-height:1.35;
  opacity:0.84;
}

.missed-topics-list{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-top:16px;
}

.missed-topic-card{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
}

.missed-topic-copy h4{
  margin:0 0 8px;
  font-size:19px;
  line-height:1.45;
}

.missed-topic-copy p{
  margin:0;
  opacity:0.84;
  line-height:1.5;
}

.missed-topic-count{
  min-width:54px;
  font-size:24px;
  color:#7ff7ff;
  text-align:right;
}

.compact-empty-state{
  margin-top:0;
}

.slow-load-warning{
  color:#8effe4 !important;
  font-weight:700;
}

.is-loading{
  position:relative;
  overflow:hidden;
}

.is-loading::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.08),transparent);
  transform:translateX(-100%);
  animation:dashboardShimmer 1.2s infinite;
}

.review-page-section{
  min-height:260px;
}

.flashcard-review-section{
  margin-top:18px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.flashcard-review-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

.flashcard-review-head h4{
  margin:0 0 6px;
  font-size:22px;
}

.flashcard-review-head p{
  margin:0;
  font-size:14px;
  opacity:0.82;
}

.flashcard-progress-meta{
  padding:10px 14px;
  border-radius:14px;
  background:rgba(255,255,255,0.08);
  font-size:13px;
  font-weight:700;
}

.flashcard-stage-card{
  position:relative;
  overflow:hidden;
  padding:24px;
  border-radius:24px;
  background:linear-gradient(135deg, rgba(255,255,255,0.08), rgba(0,217,255,0.08));
  border:1px solid rgba(255,255,255,0.10);
}

.flashcard-stage-card::before{
  content:"";
  position:absolute;
  inset:-20% auto auto -10%;
  width:220px;
  height:220px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,46,151,0.18), transparent 68%);
  pointer-events:none;
}

.flashcard-stage-meta{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:16px;
}

.flashcard-chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
  font-size:11px;
  font-weight:800;
  letter-spacing:0.4px;
  text-transform:uppercase;
}

.flashcard-chip.secondary{
  background:rgba(0,229,255,0.14);
}

.flashcard-stage-prompt{
  position:relative;
  margin:0 0 18px;
  font-size:28px;
  line-height:1.35;
  font-weight:700;
}

.flashcard-stage-visual{
  position:relative;
  margin:0 0 18px;
  padding:14px;
  border-radius:20px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
}

.flashcard-stage-image{
  width:100%;
  max-height:320px;
  object-fit:contain;
  display:block;
  border-radius:16px;
  background:rgba(255,255,255,0.04);
}

.flashcard-stage-image.is-cropped{
  height:calc(320px - var(--flashcard-image-crop-bottom, 0px));
  object-fit:cover;
  object-position:center top;
}

.flashcard-stage-answer{
  position:relative;
  margin:0;
  padding:18px 20px;
  border-radius:18px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.flashcard-stage-answer strong{
  font-size:14px;
  opacity:0.82;
  text-transform:uppercase;
  letter-spacing:0.5px;
}

.flashcard-answer-text{
  font-size:26px;
  font-weight:800;
  line-height:1.2;
}

.flashcard-rationale{
  font-size:15px;
  line-height:1.65;
  opacity:0.9;
}

.flashcard-quality-note{
  font-size:13px;
  line-height:1.55;
  opacity:0.78;
}

.flashcard-hidden{
  display:none;
}

.flashcard-actions{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.flashcard-btn{
  border:none;
  border-radius:14px;
  padding:12px 18px;
  font-family:'Poppins', sans-serif;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  background:rgba(255,255,255,0.08);
  color:#fff;
  transition:transform 0.2s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

.flashcard-btn:hover{
  transform:translateY(-2px);
}

.flashcard-btn.primary{
  background:linear-gradient(135deg,#00e5ff,#00ffcc);
  color:#04111d;
}

.flashcard-btn.secondary{
  background:linear-gradient(135deg,#6d5dfc,#9d4edd);
  color:#fff;
}

.flashcard-btn.success{
  background:linear-gradient(135deg,#35e0c8,#00d4ff);
  color:#04111d;
}

.flashcard-btn.warning{
  background:linear-gradient(135deg,#ff2e97,#ff8c00);
  color:#fff;
}

.flashcard-empty-state{
  padding:28px 22px;
  border-radius:20px;
  background:rgba(255,255,255,0.04);
  border:1px dashed rgba(255,255,255,0.16);
  text-align:center;
}

.flashcard-empty-state h4{
  margin:0 0 10px;
  font-size:20px;
}

.flashcard-empty-state p{
  margin:0;
  opacity:0.82;
}

.wrong-answer-review-list{
  display:grid;
  gap:16px;
  margin-top:18px;
}

.wrong-answer-card{
  padding:20px;
  border-radius:18px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
}

.wrong-answer-card h4{
  margin:0 0 12px;
  font-size:20px;
  line-height:1.4;
}

.wrong-answer-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.wrong-answer-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:rgba(0,229,255,0.16);
  color:#7ff7ff;
}

.wrong-answer-chip.secondary{
  background:rgba(255,255,255,0.08);
  color:#fff;
}

.wrong-answer-detail{
  margin:8px 0;
  line-height:1.5;
}

.wrong-answer-rationale{
  margin:14px 0 0;
  opacity:0.9;
  line-height:1.6;
}

.wrong-answer-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}

.review-open-btn,
.review-clear-btn{
  border:none;
  border-radius:12px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
}

.review-open-btn{
  background:linear-gradient(90deg,#ff2e97,#00e5ff);
  color:#fff;
}

.review-open-btn:disabled{
  cursor:not-allowed;
  opacity:0.6;
  filter:grayscale(0.12);
  box-shadow:none;
}

.review-clear-btn{
  background:transparent;
  border:2px solid rgba(255,255,255,0.16);
  color:#fff;
}

.review-empty-state{
  padding:28px 20px;
  border-radius:18px;
  background:rgba(255,255,255,0.04);
  border:1px dashed rgba(255,255,255,0.16);
  text-align:center;
}

.review-empty-state h4{
  margin:0 0 10px;
  font-size:20px;
}

.review-empty-state p{
  margin:0;
  opacity:0.82;
}

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

.subject-progress-card{
  border-radius:20px;
  padding:20px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction:column;
  gap:14px;
}

.subject-progress-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.subject-progress-top h4{
  margin:0 0 6px;
  font-size:20px;
}

.subject-progress-top p{
  margin:0;
  opacity:0.82;
  line-height:1.5;
}

.subject-progress-percent{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:68px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,229,255,0.14);
  color:#88fbff;
  font-weight:800;
}

.subject-progress-bar{
  height:12px;
  overflow:hidden;
}

.subject-progress-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ff2e97,#00e5ff);
}

.subject-progress-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  justify-content:space-between;
  align-items:center;
  opacity:0.94;
}

.subject-progress-meta strong{
  color:#7ff7ff;
}

.subject-assessment-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding-top:6px;
  border-top:1px solid rgba(255,255,255,0.08);
}

.subject-assessment-row{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(12,14,40,0.28);
  border:1px solid rgba(255,255,255,0.06);
}

.subject-assessment-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.subject-assessment-head h5{
  margin:0 0 4px;
  font-size:14px;
  font-weight:800;
}

.subject-assessment-head p{
  margin:0;
  font-size:12px;
  opacity:0.78;
}

.subject-assessment-values{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
  font-size:12px;
  white-space:nowrap;
}

.subject-assessment-values strong{
  color:#7ff7ff;
}

.subject-assessment-track{
  position:relative;
  height:8px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,0.08);
}

.subject-assessment-track.xp{
  height:6px;
}

.subject-assessment-fill{
  height:100%;
  border-radius:999px;
}

.subject-assessment-fill.score{
  background:linear-gradient(90deg,#ff4aa2,#8f7bff);
}

.subject-assessment-fill.xp{
  background:linear-gradient(90deg,#35e0c8,#00d4ff);
}

body.light-mode .review-tool-card,
body.light-mode .wrong-answer-card,
body.light-mode .subject-progress-card,
body.light-mode .insight-card,
body.light-mode .missed-topic-card{
  background:rgba(255,255,255,0.72);
  border-color:rgba(60, 40, 120, 0.08);
}

body.light-mode .resume-save-meta{
  color:#4b5563;
}

body.light-mode .subject-progress-percent{
  background:rgba(0,134,176,0.12);
  color:#007ca6;
}

body.light-mode .subject-progress-meta strong{
  color:#0a84ae;
}

body.light-mode .subject-assessment-stack{
  border-top-color:rgba(60, 40, 120, 0.08);
}

body.light-mode .subject-assessment-row{
  background:rgba(255,255,255,0.58);
  border-color:rgba(60, 40, 120, 0.08);
}

body.light-mode .subject-assessment-values strong{
  color:#0a84ae;
}

body.light-mode .subject-assessment-track{
  background:rgba(60, 40, 120, 0.08);
}

body.light-mode .insight-pill{
  background:rgba(0,134,176,0.12);
  color:#007ca6;
}

body.light-mode .missed-topic-count{
  color:#0a84ae;
}

body.light-mode .wrong-answer-chip.secondary{
  background:rgba(58,37,117,0.1);
  color:#2b1e5a;
}

body.light-mode .review-clear-btn{
  color:#2b1e5a;
  border-color:rgba(58,37,117,0.18);
}

body.light-mode .review-empty-state{
  background:rgba(255,255,255,0.7);
  border-color:rgba(58,37,117,0.14);
}

body.light-mode .alt-action-btn{
  background:linear-gradient(135deg,#6d5dfc,#9d4edd);
  color:#fff;
}

body.light-mode .flashcard-progress-meta,
body.light-mode .flashcard-stage-card,
body.light-mode .flashcard-stage-answer{
  background:rgba(255,255,255,0.72);
  border-color:rgba(60, 40, 120, 0.08);
  color:#251b4b;
}

body.light-mode .flashcard-chip{
  background:rgba(37,27,75,0.06);
  border-color:rgba(37,27,75,0.08);
  color:#251b4b;
}

body.light-mode .flashcard-chip.secondary{
  background:rgba(0,134,176,0.12);
  color:#007ca6;
}

body.light-mode .flashcard-stage-visual{
  background:rgba(255,255,255,0.72);
  border-color:rgba(60, 40, 120, 0.08);
}

body.light-mode .flashcard-stage-image{
  background:rgba(37,27,75,0.04);
}

body.light-mode .flashcard-btn{
  background:rgba(37,27,75,0.08);
  color:#251b4b;
}

body.light-mode .flashcard-empty-state{
  background:rgba(255,255,255,0.7);
  border-color:rgba(58,37,117,0.14);
  color:#251b4b;
}

@media(max-width:900px){
  .review-tool-card{
    grid-template-columns:1fr;
    text-align:left;
  }

  .review-tool-metric{
    text-align:left;
  }

  .insight-card{
    grid-template-columns:1fr;
  }

  .insight-meta{
    align-items:flex-start;
    justify-content:flex-start;
    width:100%;
  }

  .resume-save-meta{
    max-width:none;
    text-align:left;
  }

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

  .subject-progress-grid{
    grid-template-columns:1fr;
  }

  .subject-progress-top{
    flex-direction:column;
    align-items:flex-start;
  }

  .subject-assessment-head{
    flex-direction:column;
  }

  .subject-assessment-values{
    align-items:flex-start;
  }

  .section-head-actions{
    width:100%;
  }

  .flashcard-review-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .flashcard-stage-prompt{
    font-size:22px;
  }

  .flashcard-answer-text{
    font-size:22px;
  }
}

@keyframes dashboardShimmer{
  100%{
    transform:translateX(100%);
  }
}
