/* ═══════════════════════════════════════════════════════════
   css/student-dashboard.css v2.0
   Student Dashboard — updated to match new design system
═══════════════════════════════════════════════════════════ */

/* ─── LAYOUT ─── */
.sd-body {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(0,212,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text-primary);
}

/* ─── SIDEBAR ─── */
.sd-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sd-sidebar-logo {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sd-sidebar-logo .nav-logo { font-size: 0.9rem; }

/* User card */
.sd-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sd-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #020a0d;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sd-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}

.sd-user-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sd-user-info small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

/* Nav links */
.sd-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.sd-nav-section {
  padding: 0.5rem 1.5rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.sd-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  border-left: 3px solid transparent;
  font-family: var(--font-body);
}

.sd-link:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.sd-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sd-link-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }

.sd-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sd-back-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}
.sd-back-link:hover { color: var(--accent); }

/* ─── MAIN AREA ─── */
.sd-main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

/* Mobile topbar */
.sd-topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.sd-topbar-left  { display: flex; align-items: center; gap: 0.75rem; }
.sd-topbar-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.sd-topbar-nav  { display: flex; align-items: center; gap: 1.1rem; margin-left: 0.5rem; padding-left: 1.1rem; border-left: 1px solid var(--border); }
.sd-topbar-link { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: color .15s ease; }
.sd-topbar-link:hover { color: var(--accent); }
@media (max-width: 768px) {
  .sd-topbar-nav { display: none; }
}
.sd-topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.sd-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.95rem;
  transition: all var(--transition);
}
.sd-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ─── PANELS ─── */
.sd-panel {
  display: none;
  padding: 1.75rem 2rem;
  flex: 1;
  background: var(--bg-base);
  animation: fadeTab 250ms var(--ease-out) both;
}

.sd-panel.active { display: block; }

.sd-panel-header {
  margin-bottom: 1.75rem;
}

.sd-panel-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.sd-panel-header h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.25;
}
@media (max-width: 480px) {
  .sd-panel-header h1 { font-size: 1.4rem; }
}

.sd-panel-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.3rem;
}

/* ─── STAT CARDS ─── */
.sd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.sd-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition);
}
.sd-stat:hover { border-color: var(--border-medium); }

.sd-stat-icon { font-size: 1.6rem; flex-shrink: 0; }

.sd-stat-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: block;
}

.sd-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
  display: block;
  margin-top: 0.25rem;
}

/* ─── COURSE CARDS (student view) ─── */
.sd-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.sd-course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-slow), transform var(--transition-slow), box-shadow var(--transition-slow);
}
.sd-course-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.sd-course-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-overlay));
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sd-course-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-subtle) 0%, transparent 60%);
  pointer-events: none;
}

.sd-course-body { padding: 1rem 1.25rem 1.25rem; }

.sd-course-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sd-progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.sd-course-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ─── CERTIFICATE CARDS ─── */
.sd-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.sd-cert-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.sd-cert-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.sd-cert-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.sd-cert-icon  { font-size: 2rem; }
.sd-cert-title { font-size: 0.975rem; font-weight: 700; color: var(--text-primary); }
.sd-cert-date  { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.sd-cert-id    { font-size: 0.72rem; color: var(--accent); font-family: var(--font-mono); background: var(--accent-dim); padding: 2px 8px; border-radius: var(--radius-sm); display: inline-block; }
.sd-cert-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

/* ─── PROFILE FORM ─── */
.sd-profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.sd-avatar-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.sd-avatar-lg {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--accent);
  color: #020a0d;
  font-size: 2.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 3px solid var(--border-medium);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}
.sd-avatar-lg:hover { border-color: var(--accent); }
.sd-avatar-lg img   { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.sd-avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition);
  font-family: var(--font-mono);
  border-radius: 50%;
}
.sd-avatar-lg:hover .sd-avatar-upload-overlay { opacity: 1; }

/* ─── PROFILE LAYOUT ───────────────────────────────── */
/* Was previously unstyled — the avatar card and edit form were just
   stacking full-width with default block spacing, which is what made
   the panel look sparse. Real two-column grid: fixed sidebar for the
   avatar card, flexible column for the form. */
.sd-profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .sd-profile-layout { grid-template-columns: 1fr; }
}
/* Tighter vertical rhythm inside the profile edit form specifically —
   the site-wide .form-group (--space-6 = 24px bottom margin) reads as
   too loose for a form this dense with fields. Scoped to this panel
   only, so other forms using .form-group elsewhere are unaffected. */
#panel-profile .form-group { margin-bottom: 1rem; }
#panel-profile .sd-settings-section { padding: 1.25rem 1.5rem; }
#panel-profile .sd-settings-section h3 { margin-bottom: 1rem; padding-bottom: .6rem; }
#panel-profile .form-row { gap: 1rem; }

/* ─── SETTINGS: TOGGLE ROWS & SWITCHES ───────────────── */
/* Was entirely unstyled — rendering as raw browser checkboxes with no
   row layout, which is what made this panel look cramped/unfinished. */
.sd-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.sd-toggle-row:last-child { border-bottom: none; }
.sd-toggle-row > div:first-child { display: flex; flex-direction: column; gap: .2rem; }
.sd-toggle-row label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.sd-toggle-row small {
  font-size: .75rem;
  color: var(--text-muted);
}
.sd-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.sd-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sd-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated, rgba(255,255,255,.08));
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .2s ease, border-color .2s ease;
}
.sd-switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .2s ease, background .2s ease;
}
.sd-switch input:checked + .sd-switch-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.sd-switch input:checked + .sd-switch-slider::before {
  transform: translateX(18px);
  background: #020a0d;
}
.sd-switch input:focus-visible + .sd-switch-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#panel-settings .sd-settings-section { padding: 1.25rem 1.5rem; margin-bottom: 0; }
#panel-settings .sd-settings-sections { gap: 1.25rem; }
#panel-settings .form-group { margin-bottom: 1rem; }
#panel-settings .form-row { gap: 1rem; }

/* ─── SETTINGS ─── */
.sd-settings-sections { display: flex; flex-direction: column; gap: 1.5rem; }

.sd-settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.sd-settings-section h3 {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

/* ─── NOTIFICATIONS PANEL ─── */
.sd-notif-list { display: flex; flex-direction: column; }

.sd-notif-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}
.sd-notif-item:last-child { border-bottom: none; }
.sd-notif-item.unread { background: var(--accent-subtle); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }

.sd-notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.sd-notif-dot.read { background: var(--text-muted); }

.sd-notif-text  { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.sd-notif-time  { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .sd-sidebar    { transform: translateX(-240px); }
  .sd-sidebar.open{ transform: translateX(0); }
  .sd-main       { margin-left: 0; }
  .sd-toggle     { display: flex; }
  .sd-profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sd-panel      { padding: 1.25rem 1rem; }
  .sd-stats      { grid-template-columns: 1fr 1fr; }
  .sd-course-grid{ grid-template-columns: 1fr; }
  .sd-cert-grid  { grid-template-columns: 1fr; }
}

/* ═══ DASHBOARD REDESIGN v1 ═══ */

/* Layout breathing room */
.sd-panel { padding: 2rem 2.25rem; }
#panel-home { max-width: 1360px; }

/* Welcome banner */
#panel-home .sd-panel-header {
  position: relative; overflow: hidden;
  padding: 2rem 2.25rem; margin-bottom: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(0,212,255,.16);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0,212,255,.16), transparent 55%),
    linear-gradient(135deg, #0b141c, #080d13);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
#panel-home .sd-panel-header::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.7), transparent);
}
#panel-home .sd-panel-header::after {
  content: ''; position: absolute; right: -70px; top: -70px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,.16), transparent 65%);
  pointer-events: none;
}
#panel-home .sd-panel-header h1,
#panel-home .sd-panel-header p { position: relative; z-index: 1; }
#panel-home .sd-panel-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
}
#panel-home .sd-panel-header p {
  margin-top: .55rem; font-size: .95rem; color: var(--text-secondary);
}

/* Stat cards */
#panel-home .sd-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
#panel-home .sd-stat {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr;
  align-items: center; column-gap: .85rem; row-gap: .7rem;
  padding: 1.15rem 1.15rem 1.3rem;
  background: linear-gradient(160deg, rgba(var(--sc), .10), rgba(13,17,23,.95) 62%);
  border: 1px solid rgba(var(--sc), .2);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
#panel-home .sd-stat::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--sc), .75), transparent);
}
#panel-home .sd-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--sc), .45);
  box-shadow: 0 14px 34px rgba(0,0,0,.4), 0 8px 30px -12px rgba(var(--sc), .4);
}
#panel-home .sd-stat > div { display: contents; }
#panel-home .sd-stat-icon-wrap {
  grid-column: 1; grid-row: 1;
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--sc), .14);
  border: 1px solid rgba(var(--sc), .32);
  color: rgb(var(--sc));
}
#panel-home .sd-stat-icon { display: flex; align-items: center; justify-content: center; }
#panel-home .sd-stat-icon svg { width: 22px; height: 22px; }
#panel-home .sd-stat-value {
  grid-column: 2; grid-row: 1;
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 800; line-height: 1;
  color: #fff; letter-spacing: -0.02em;
}
#panel-home .sd-stat-label {
  grid-column: 1 / -1; grid-row: 2;
  font-size: .8rem; font-weight: 500; color: var(--text-secondary);
}

/* Continue learning card */
#resumeCard > div {
  border-radius: 18px !important;
  padding: 1.35rem 1.6rem !important;
  background: linear-gradient(135deg, rgba(0,212,170,.12), rgba(13,17,23,.92) 70%) !important;
  border: 1px solid rgba(0,212,170,.3) !important;
  box-shadow: 0 14px 36px rgba(0,0,0,.35) !important;
}
#resumeCard #resumeTitle { font-size: 1.1rem !important; }
#resumeBtn { padding: .7rem 1.5rem; border-radius: 10px; font-weight: 700; }

/* Quick actions */
#panel-home .sd-quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: .85rem !important;
}
#panel-home .sd-qa-btn {
  position: relative;
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: .8rem; padding: .9rem 1rem;
  background: rgba(13,17,23,.9);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  color: var(--text-primary); text-align: left; text-decoration: none; cursor: pointer;
  font-family: var(--font-body);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
#panel-home .sd-qa-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--sc), .45);
  background: rgba(var(--sc), .06);
}
#panel-home .sd-qa-icon-wrap {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--sc), .13);
  border: 1px solid rgba(var(--sc), .28);
  color: rgb(var(--sc));
}
#panel-home .sd-qa-icon { display: flex; }
#panel-home .sd-qa-icon svg { width: 18px; height: 18px; }
#panel-home .sd-qa-label { font-size: .85rem; font-weight: 600; }

/* Cards */
#panel-home .sd-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.25rem; align-items: start;
}
@media (max-width: 900px) { #panel-home .sd-two-col { grid-template-columns: 1fr; } }
#panel-home .sd-card {
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px; padding: 1.4rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
#panel-home .sd-card .sd-card-title {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 1rem; padding-bottom: .85rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Responsive stats */
@media (max-width: 1180px) { #panel-home .sd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  {
  #panel-home .sd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-panel { padding: 1.25rem 1rem; }
  #panel-home .sd-panel-header { padding: 1.5rem 1.25rem; }
}

/* Sidebar */
.sd-nav { padding: .5rem .75rem; }
.sd-nav-section { padding: .6rem .75rem .3rem; }
.sd-link {
  width: 100%; padding: .65rem .85rem; margin: .12rem 0;
  border-left: none; border-radius: 10px;
}
.sd-link:hover { background: rgba(0,212,255,.07); }
.sd-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,212,255,.2), rgba(0,212,255,.06));
  box-shadow: inset 0 0 0 1px rgba(0,212,255,.28);
}
.sd-user-card {
  margin: .9rem .75rem; padding: .85rem 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
}

/* ═══ DASHBOARD REDESIGN v2 ═══ */

/* Clean, bold numbers */
#panel-home .sd-stat-value {
  font-family: var(--font-body);
  font-size: 2.2rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
#panel-home .sd-stat-label { font-size: .82rem; letter-spacing: .01em; }

/* Soft badge avatars, matching the site navbar */
.sd-avatar {
  background: linear-gradient(145deg, #1a2a33, #0e181e);
  color: #8ecfdc;
  border: 1px solid rgba(142,207,220,.28);
  box-shadow: 0 0 0 3px rgba(142,207,220,.06), 0 4px 14px rgba(0,0,0,.35);
  font-family: var(--font-mono);
  font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.sd-user-card .sd-avatar { width: 42px; height: 42px; }
.sd-user-info strong { font-size: .9rem; font-weight: 700; }

/* Subscription notice */
#subscriptionBadge {
  border-radius: 14px !important;
  padding: .95rem 1.25rem !important;
  border: 1px solid rgba(0,212,255,.2) !important;
  background: linear-gradient(135deg, rgba(0,212,255,.07), rgba(13,17,23,.9)) !important;
}

/* Page titles inside every tab */
.sd-panel .sd-panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.7rem; letter-spacing: -0.02em;
}
.sd-panel:not(#panel-home) .sd-panel-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Course cards (My Courses) */
.sd-course-card {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.sd-course-card:hover {
  border-color: rgba(0,212,255,.35);
  box-shadow: 0 18px 44px rgba(0,0,0,.42), 0 10px 34px -14px rgba(0,212,255,.35);
}

/* ═══ DASHBOARD REDESIGN v3 ═══ */

/* Recently accessed rows */
#recentCoursesList .sd-course-row {
  display: flex; align-items: center; gap: .9rem;
  padding: .75rem .9rem; margin-bottom: .65rem;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px; cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
#recentCoursesList .sd-course-row:last-child { margin-bottom: 0; }
#recentCoursesList .sd-course-row:hover {
  transform: translateX(3px);
  border-color: rgba(0,212,255,.35);
  background: rgba(0,212,255,.05);
}
#recentCoursesList .sd-course-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; position: relative;
}
#recentCoursesList .sd-course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#recentCoursesList .sd-course-row-info { flex: 1; min-width: 0; }
#recentCoursesList .sd-course-row-title {
  font-size: .92rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#recentCoursesList .sd-course-row-meta {
  margin-top: .25rem; font-size: .74rem; color: var(--text-muted);
  font-family: var(--font-mono);
}
#recentCoursesList .sd-mini-progress { width: 120px; flex-shrink: 0; display: flex; align-items: center; gap: .6rem; }
#recentCoursesList .sd-mini-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
#recentCoursesList .sd-mini-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #00d4ff, #22c55e); }
#recentCoursesList .sd-mini-pct {
  min-width: 2.3rem; text-align: right;
  font-size: .72rem; font-weight: 700; font-family: var(--font-mono);
  color: var(--text-secondary);
}
@media (max-width: 560px) { #recentCoursesList .sd-mini-progress { width: 82px; } }

/* Notifications */
#notifList .sd-notif {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .85rem 1rem; margin-bottom: .6rem;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
}
#notifList .sd-notif:last-child { margin-bottom: 0; }
#notifList .sd-notif-dot {
  width: 8px; height: 8px; margin-top: 6px;
  background: #00d4ff; box-shadow: 0 0 10px rgba(0,212,255,.6);
}
#notifList .sd-notif-dot.read { background: var(--text-muted); box-shadow: none; }
#notifList .sd-notif-text { font-size: .86rem; line-height: 1.55; color: var(--text-secondary); }
#notifList .sd-notif-text b { color: var(--text-primary); }
#notifList .sd-notif-time { margin-top: .3rem; font-size: .7rem; letter-spacing: .04em; }

/* View all button */
#panel-home .sd-card > .btn-ghost {
  border-radius: 10px; font-weight: 600; color: var(--accent);
  background: rgba(0,212,255,.05);
  border: 1px solid rgba(0,212,255,.22);
}
#panel-home .sd-card > .btn-ghost:hover {
  background: rgba(0,212,255,.12);
  border-color: rgba(0,212,255,.45);
}

/* Certificates */
.sd-cert-card {
  padding: 1.6rem; border-radius: 18px;
  background: linear-gradient(160deg, rgba(0,212,255,.08), rgba(13,17,23,.95) 60%);
  border: 1px solid rgba(0,212,255,.22);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.sd-cert-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0,0,0,.42), 0 10px 34px -14px rgba(0,212,255,.4);
}
.sd-cert-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.3);
}
.sd-cert-title { font-size: 1.02rem; line-height: 1.4; }

/* ═══ DASHBOARD REDESIGN v4 ═══ */

/* Names read properly even if saved in lowercase */
.sd-user-info strong, #sidebarName, #welcomeName { text-transform: capitalize; }

/* Study Plan: lesson cards */
#panel-studyplan .sd-stat {
  display: flex; align-items: center !important; gap: 1rem;
  padding: 1rem 1.25rem; margin-bottom: .7rem !important;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#panel-studyplan .sd-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(0,212,255,.35);
  box-shadow: 0 14px 34px rgba(0,0,0,.38), 0 8px 28px -14px rgba(0,212,255,.35);
}
#panel-studyplan .sd-stat-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; border-radius: 13px;
  background: rgba(0,212,255,.10);
  border: 1px solid rgba(0,212,255,.25);
}
#panel-studyplan .sd-stat .btn-sm {
  border-radius: 10px; padding: .6rem 1.15rem;
  font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
#studyPlanToday h3, #studyPlanCourseList h3 {
  padding-left: .75rem; border-left: 3px solid var(--accent);
  line-height: 1.2; margin-bottom: 1rem !important;
}
@media (max-width: 640px) {
  #panel-studyplan .sd-stat { flex-wrap: wrap; }
  #panel-studyplan .sd-stat .btn-sm { width: 100%; text-align: center; }
}

/* My Courses: search + filter on one line */
.sd-main .sd-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .75rem; margin-bottom: 1.25rem;
}
.sd-main .sd-filter-bar .input {
  flex: 1 1 260px; min-width: 0;
  border-radius: 12px; padding: .75rem 1rem;
}
.sd-main .sd-filter-bar .select {
  min-width: 170px; border-radius: 12px; padding: .75rem 1rem;
}

/* ═══ DASHBOARD REDESIGN v5 ═══ */

/* My Courses: cards, two per row on wide screens */
.sd-main .sd-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1rem;
}
@media (max-width: 560px) { .sd-main .sd-courses-grid { grid-template-columns: 1fr; } }

.sd-main #myCoursesGrid .course-card {
  height: auto; min-height: 112px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.sd-main #myCoursesGrid .course-card:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(19,27,36,.65), rgba(13,17,23,.95));
  border-color: rgba(var(--diff-glow,0,212,255), .4);
  box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 10px 32px -14px rgba(var(--diff-glow,0,212,255), .4);
}
.sd-main #myCoursesGrid .course-card::before {
  opacity: .9; width: 4px; border-radius: 0;
}

.sd-main #myCoursesGrid .course-thumb {
  width: 112px; min-width: 112px; height: auto; align-self: stretch;
  border-radius: 0;
}
.sd-main #myCoursesGrid .course-thumb-emoji { font-size: 2.2rem; }

.sd-main #myCoursesGrid .course-body {
  padding: 1rem 1.1rem; gap: .5rem;
}
.sd-main #myCoursesGrid .course-meta { gap: .6rem; }
.sd-main #myCoursesGrid .course-meta .badge {
  display: inline-flex; align-items: center;
  font-size: .62rem; padding: .18rem .6rem; border-radius: 999px;
  font-family: var(--font-mono); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
}
.sd-main #myCoursesGrid .course-duration-chip {
  font-size: .7rem; color: var(--text-muted);
}
.sd-main #myCoursesGrid .course-title {
  font-size: 1rem; font-weight: 700; line-height: 1.3;
  white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.sd-main #myCoursesGrid .progress-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: .66rem; color: var(--text-muted);
  margin-bottom: .35rem;
}
.sd-main #myCoursesGrid .progress-bar {
  height: 6px; border-radius: 999px; background: rgba(255,255,255,.08);
}
.sd-main #myCoursesGrid .progress-fill {
  background: linear-gradient(90deg, #00d4ff, #22c55e);
}
.sd-main #myCoursesGrid .progress-fill.completed { background: #22c55e; }

.sd-main #myCoursesGrid .course-footer {
  padding: 0 1.1rem 0 .25rem; justify-content: center;
}
.sd-main #myCoursesGrid .course-pct { display: none; }
.sd-main #myCoursesGrid .course-action-btn {
  font-size: .72rem; padding: .5rem 1rem; border-radius: 10px;
  letter-spacing: .04em; font-weight: 700;
}

@media (max-width: 640px) {
  .sd-main #myCoursesGrid .course-thumb { width: 84px; min-width: 84px; }
  .sd-main #myCoursesGrid .course-footer { padding-right: .8rem; }
  .sd-main #myCoursesGrid .course-action-btn { padding: .45rem .75rem; }
}

/* ═══ DASHBOARD REDESIGN v6 (Profile) ═══ */

#panel-profile .sd-profile-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 860px) {
  #panel-profile .sd-profile-layout { grid-template-columns: 1fr; }
}

/* Left card */
#panel-profile .sd-profile-avatar-card {
  position: relative; overflow: hidden;
  padding: 5.5rem 1.5rem 1.75rem;
  text-align: center;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
}
#panel-profile .sd-profile-avatar-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 96px;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(0,212,255,.28), transparent 70%),
    linear-gradient(135deg, #0f2a33, #0a141a);
  border-bottom: 1px solid rgba(0,212,255,.15);
}
#panel-profile .sd-profile-avatar-card > * { position: relative; z-index: 1; }

/* Big avatar: soft badge, sitting across the header strip */
#panel-profile .sd-avatar-lg,
#panel-profile .sd-profile-avatar-large {
  position: absolute; top: 44px; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 96px; margin: 0;
  background: linear-gradient(145deg, #1a2a33, #0e181e);
  color: #8ecfdc;
  border: 3px solid #0b1117;
  box-shadow: 0 0 0 2px rgba(142,207,220,.35), 0 10px 28px rgba(0,0,0,.5);
  font-family: var(--font-mono);
  font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
#panel-profile .sd-profile-avatar-card { padding-top: 8.25rem; }

#panel-profile .sd-profile-avatar-card h3,
#panel-profile .sd-profile-avatar-card strong {
  text-transform: capitalize;
}

/* Upload + color picker */
#panel-profile .sd-profile-avatar-card .btn,
#panel-profile .sd-profile-avatar-card button {
  border-radius: 10px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
#panel-profile .sd-profile-avatar-card .btn:hover,
#panel-profile .sd-profile-avatar-card button:hover {
  transform: translateY(-1px);
}

/* Edit form card */
#panel-profile .sd-settings-section {
  position: relative; overflow: hidden;
  padding: 1.75rem 1.9rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
}
#panel-profile .sd-settings-section::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.6), transparent);
}
#panel-profile .sd-settings-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem; letter-spacing: -0.01em;
  margin-bottom: 1.35rem; padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

/* Fields */
#panel-profile label {
  display: block; margin-bottom: .45rem;
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
#panel-profile .input,
#panel-profile input[type="text"],
#panel-profile input[type="email"],
#panel-profile input[type="url"],
#panel-profile textarea,
#panel-profile select {
  width: 100%;
  padding: .85rem 1.05rem;
  border-radius: 12px;
  background: rgba(6,9,13,.75);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--text-primary);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#panel-profile .input:focus,
#panel-profile input:focus,
#panel-profile textarea:focus,
#panel-profile select:focus {
  outline: none;
  border-color: rgba(0,212,255,.6);
  background: rgba(8,13,19,.95);
  box-shadow: 0 0 0 4px rgba(0,212,255,.12);
}
#panel-profile input:disabled,
#panel-profile input[readonly] {
  opacity: .6; cursor: not-allowed;
  background: rgba(255,255,255,.03);
}
#panel-profile textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

/* Save button */
#panel-profile .sd-settings-section .btn-primary {
  padding: .85rem 2rem; border-radius: 12px;
  font-weight: 700; letter-spacing: .03em;
  box-shadow: 0 8px 24px -8px rgba(0,212,255,.5);
  transition: transform .18s ease, box-shadow .18s ease;
}
#panel-profile .sd-settings-section .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(0,212,255,.6);
}

/* ═══ DASHBOARD REDESIGN v7 (Settings) ═══ */

#panel-settings .sd-settings-sections { gap: 1.25rem; max-width: 980px; }

#panel-settings .sd-settings-section {
  position: relative; overflow: hidden;
  padding: 1.6rem 1.8rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(19,27,36,.55), rgba(13,17,23,.95));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
}
#panel-settings .sd-settings-section::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.55), transparent);
}
#panel-settings .sd-settings-section h3 {
  font-family: var(--font-display);
  font-size: 1.05rem; letter-spacing: -0.01em;
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

/* Password form */
#panel-settings .form-group label {
  display: block; margin-bottom: .45rem;
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
#panel-settings .input,
#panel-settings input[type="password"],
#panel-settings input[type="text"],
#panel-settings input[type="email"] {
  width: 100%;
  padding: .85rem 1.05rem;
  border-radius: 12px;
  background: rgba(6,9,13,.75);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--text-primary);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#panel-settings .input:focus,
#panel-settings input[type="password"]:focus,
#panel-settings input[type="text"]:focus {
  outline: none;
  border-color: rgba(0,212,255,.6);
  background: rgba(8,13,19,.95);
  box-shadow: 0 0 0 4px rgba(0,212,255,.12);
}

/* Buttons */
#panel-settings .sd-settings-section .btn {
  padding: .8rem 1.6rem; border-radius: 12px;
  font-weight: 700; letter-spacing: .03em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
#panel-settings .sd-settings-section .btn:hover { transform: translateY(-2px); }
#panel-settings .sd-settings-section .btn:not(.btn-primary):not(.btn-danger) {
  color: var(--accent);
  background: rgba(0,212,255,.07);
  border: 1px solid rgba(0,212,255,.35);
}
#panel-settings .sd-settings-section .btn:not(.btn-primary):not(.btn-danger):hover {
  background: rgba(0,212,255,.16);
  border-color: rgba(0,212,255,.6);
  box-shadow: 0 10px 26px -10px rgba(0,212,255,.5);
}

/* Toggle rows */
#panel-settings .sd-toggle-row {
  padding: 1rem .9rem; margin: 0 -.9rem;
  border-radius: 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .18s ease;
}
#panel-settings .sd-toggle-row:hover { background: rgba(255,255,255,.025); }
#panel-settings .sd-toggle-row:last-child { border-bottom: none; }
#panel-settings .sd-toggle-row label { font-size: .92rem; }
#panel-settings .sd-toggle-row small { font-size: .78rem; line-height: 1.5; }

#panel-settings .sd-switch { width: 48px; height: 28px; }
#panel-settings .sd-switch-slider {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
}
#panel-settings .sd-switch-slider::before {
  width: 20px; height: 20px; left: 3px; top: 3px;
  background: #8493a5;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
#panel-settings .sd-switch input:checked + .sd-switch-slider {
  background: linear-gradient(135deg, #00d4ff, #22c9a8);
  border-color: rgba(0,212,255,.7);
  box-shadow: 0 0 16px rgba(0,212,255,.35);
}
#panel-settings .sd-switch input:checked + .sd-switch-slider::before {
  transform: translateX(20px);
  background: #04121a;
}

/* Danger zone (last card) */
#panel-settings .sd-settings-sections > .sd-settings-section:last-child {
  background: linear-gradient(180deg, rgba(244,63,94,.07), rgba(13,17,23,.95)) !important;
  border: 1px solid rgba(244,63,94,.3) !important;
}
#panel-settings .sd-settings-sections > .sd-settings-section:last-child::before {
  background: linear-gradient(90deg, transparent, rgba(244,63,94,.65), transparent);
}
#panel-settings .sd-settings-sections > .sd-settings-section:last-child .btn {
  color: #ff5f7a; background: rgba(244,63,94,.08);
  border: 1px solid rgba(244,63,94,.45);
}
#panel-settings .sd-settings-sections > .sd-settings-section:last-child .btn:hover {
  color: #fff; background: #f43f5e; border-color: #f43f5e;
  box-shadow: 0 12px 28px -10px rgba(244,63,94,.6);
}

@media (max-width: 640px) {
  #panel-settings .sd-settings-section { padding: 1.25rem 1.1rem; }
  #panel-settings .sd-toggle-row { margin: 0 -.5rem; padding: .9rem .5rem; }
}

/* ═══ DASHBOARD REDESIGN v8 ═══ */

/* Profile card: name always capitalised, "Member since" centred */
#panel-profile .sd-profile-name,
#panel-profile #profileDisplayName { text-transform: capitalize; font-weight: 800; font-size: 1.15rem; }
#panel-profile .sd-profile-email { margin-bottom: .25rem; }
#panel-profile .sd-profile-avatar-card div[style*="text-align:left"] {
  text-align: center !important;
  font-family: var(--font-mono);
  font-size: .66rem !important;
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .45rem !important;
}
#panel-profile #profileSince {
  display: inline-block;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: rgba(0,212,255,.07);
  border: 1px solid rgba(0,212,255,.2);
  color: var(--text-primary);
  font-size: .78rem;
}
#panel-profile .sd-profile-avatar-card > div[style*="margin-top:.5rem"] { text-align: center; }

/* Danger box: no title, so tighten the top */
#panel-settings .sd-settings-sections > .sd-settings-section:last-child p { margin-top: 0; }
