/* ═══════════════════════════════════════════════════════════════════════════
   Raftaar — Main Stylesheet
   Fonts: Fraunces (display) + DM Sans (body) + JetBrains Mono (code)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  /* Brand - SAMARTH Warm Orange */
  --hue: 21;
  --accent: hsl(var(--hue), 88%, 48%);          /* ≈ #ea580c */
  --accent-light: hsl(28, 100%, 55%);            /* ≈ #ff8a1a */
  --accent-pale: hsl(28, 100%, 94%);
  --accent-dark: hsl(var(--hue), 85%, 30%);
  --accent-gradient: linear-gradient(135deg, #ea580c, #ff9f43);

  --accent2: hsl(35, 90%, 55%);
  --accent2-pale: hsl(35, 95%, 94%);

  /* Light theme — warm cream, samarth.ndu.digital feel */
  --bg: #fffaf5;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-muted: #fdf3e7;
  --bg-hover: #f9e7d3;
  --border: rgba(244, 219, 194, 0.8);
  --border-light: rgba(250, 236, 219, 0.6);
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-light: #999999;
  
  /* Floating & Glass Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08), 0 8px 16px rgba(15, 23, 42, 0.06);
  
  /* Geometry */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --sidebar-w: 280px;

  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --trans: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --trans-slow: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg: #09090b;
  --bg-card: rgba(24, 24, 27, 0.65);
  --bg-muted: #27272a;
  --bg-hover: #3f3f46;
  --border: rgba(63, 63, 70, 0.5);
  --border-light: rgba(39, 39, 42, 0.4);
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-light: #71717a;
  --accent-pale: rgba(234, 88, 12, 0.16);
  --accent2-pale: rgba(245, 158, 11, 0.15);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.8);
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--trans), color var(--trans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;   /* long URLs/words in user content must never widen the page */
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--accent-light); }
img, video { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

h1,h2,h3,h4,h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--trans), box-shadow var(--trans);
}

.navbar.scrolled { box-shadow: var(--shadow); }

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.nav-brand em { color: var(--accent); font-style: normal; }
.brand-icon { color: var(--accent); font-size: 1.2rem; }

.nav-links {
  display: flex;
  gap: .25rem;
  flex: 1;
}

.nav-link {
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: .9rem;
  transition: all var(--trans);
}
.nav-link-mobile-only { display: none; }   /* shown inside the open hamburger menu only */
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-pale);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  transition: all var(--trans);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234,88,12,.3);
}
/* White button for use on accent-coloured banners (!important outranks the
   themed .btn-primary gradient so the two classes can't fight) */
.btn-light {
  background: #fff !important;
  color: var(--accent) !important;
  border-color: #fff !important;
}
.btn-light:hover {
  background: #fff4ec !important;
  color: var(--accent-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15) !important;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--trans);
  font-size: .9rem;
}
.btn-icon:hover { background: var(--bg-muted); color: var(--text); }

/* ── Notification Dropdown ──────────────────────────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 500;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: .875rem;
}
.mark-read-btn { font-size: .75rem; color: var(--accent); background: none; border: none; cursor: pointer; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--trans);
}
.notif-item:hover { background: var(--bg-muted); }
.notif-item.unread { background: var(--accent-pale); }
.notif-title { font-weight: 600; font-size: .8rem; margin-bottom: .2rem; }
.notif-msg { font-size: .75rem; color: var(--text-muted); }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .875rem; }
.notif-pill { background: var(--accent-pale); color: var(--accent); font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; }

/* ── Avatar Dropdown ─────────────────────────────────────────────────────────── */
.avatar-dropdown { position: relative; }
.avatar-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .3rem .75rem .3rem .3rem;
  transition: all var(--trans);
}
.avatar-btn:hover { border-color: var(--accent); }
/* ── Role-coloured initials avatar ──────────────────────────────────────── */
.role-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
  font-family: var(--font-body);
  transition: box-shadow var(--trans);
}
/* Larger variant used in profile pages */
.role-avatar.lg {
  width: 80px;
  height: 80px;
  font-size: 2.2rem;
  font-weight: 800;
}
/* role colour helpers (also used by inline styles) */
.role-avatar.student { background: #1a6b4a; box-shadow: 0 0 0 2px #6ee7b7; }
.role-avatar.teacher { background: #1d4ed8; box-shadow: 0 0 0 2px #93c5fd; }
.role-avatar.admin   { background: #7c3aed; box-shadow: 0 0 0 2px #c4b5fd; }
.avatar-name { font-size: .85rem; font-weight: 500; }
.avatar-btn .fa-chevron-down { font-size: .7rem; color: var(--text-muted); }
.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  display: none;
  z-index: 500;
}
.avatar-menu.open { display: block; }
.avatar-info { padding: .5rem .75rem; }
.avatar-info strong { display: block; font-size: .875rem; }
.avatar-info small { color: var(--text-muted); font-size: .75rem; }
.avatar-menu hr { border: none; border-top: 1px solid var(--border); margin: .35rem 0; }
.avatar-menu a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text-muted);
  transition: all var(--trans);
}
.avatar-menu a:hover { background: var(--bg-muted); color: var(--text); }
.avatar-menu a i { width: 16px; color: var(--accent); }
.logout-link { color: #dc2626 !important; }
.logout-link i { color: #dc2626 !important; }

/* ── Hamburger ───────────────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--trans);
}

/* ── Flash Messages ──────────────────────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 72px;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 380px;
}
.flash {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: .875rem;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.flash-success { border-left: 3px solid #16a34a; }
.flash-success i { color: #16a34a; }
.flash-danger { border-left: 3px solid #dc2626; }
.flash-danger i { color: #dc2626; }
.flash-warning { border-left: 3px solid #d97706; }
.flash-warning i { color: #d97706; }
.flash-info { border-left: 3px solid #2563eb; }
.flash-info i { color: #2563eb; }
.flash-close { margin-left: auto; color: var(--text-light); font-size: 1.1rem; padding: 0 .25rem; }

/* ── Hero Section ────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
  
  padding: 4rem 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(234,88,12,.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(255,179,102,.10) 0%, transparent 50%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .4;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent-pale);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .85rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-title .highlight {
  color: var(--accent);
  position: relative;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-light);
  border-radius: 2px;
  opacity: .5;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat-label { font-size: .8rem; color: var(--text-muted); }

.hero-visual {
  position: relative;
}

.hero-card-stack {
  position: relative;
  height: 420px;
}

.hero-card {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  transition: transform var(--trans-slow);
}

.hero-card-main {
  width: 280px;
  top: 0;
  right: 0;
  animation: float 4s ease-in-out infinite;
}

.hero-card-sm {
  width: 220px;
  bottom: 40px;
  left: 0;
  animation: float 4s ease-in-out infinite .8s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ── Section Styles ───────────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-muted { background: var(--bg-muted); }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  background: var(--accent-pale);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 99px;
  margin-bottom: .75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: .75rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Course Cards ─────────────────────────────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  
  transition: all var(--trans);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.course-thumb {
  aspect-ratio: 16/9;
  
  background: var(--bg-muted);
  position: relative;
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}

.course-card:hover .course-thumb img { transform: scale(1.05); }

.course-level-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 99px;
  backdrop-filter: blur(4px);
}

.course-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.course-category { font-size: .75rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.course-title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; line-height: 1.4; }
.course-teacher { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.course-meta { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border-light); }
.course-meta i { color: var(--accent); }

/* ── Stat Cards ───────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--trans);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon-green { background: var(--accent-pale); color: var(--accent); }
.stat-icon-amber { background: var(--accent2-pale); color: var(--accent2); }
.stat-icon-blue { background: #dbeafe; color: #2563eb; }
.stat-icon-red { background: #fee2e2; color: #dc2626; }
.stat-icon-purple { background: #ede9fe; color: #7c3aed; }

.stat-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Dashboard Layout ─────────────────────────────────────────────────────────── */
.dash-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform var(--trans-slow);
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close { display: none; color: var(--text-muted); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-pale);
}

.sidebar-name { font-weight: 600; font-size: .875rem; }

.role-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  text-transform: capitalize;
}
.role-admin { background: var(--accent2-pale); color: var(--accent2); }
.role-teacher { background: #dbeafe; color: #2563eb; }
.role-student { background: var(--accent-pale); color: var(--accent); }

.sidebar-nav { padding: .75rem .5rem; flex: 1; }

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: .5rem .75rem .25rem;
  margin-top: .5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--trans);
  margin-bottom: .15rem;
}

.sidebar-link:hover { background: var(--bg-muted); color: var(--text); }
.sidebar-link.active { background: var(--accent-pale); color: var(--accent); font-weight: 600; }
.sidebar-link i { width: 18px; font-size: .875rem; text-align: center; }
.sidebar-link .link-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; }

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

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: #dc2626;
  transition: all var(--trans);
}
.sidebar-logout:hover { background: #fee2e2; }

/* ── Dashboard Main ────────────────────────────────────────────────────────────── */
.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.dash-topbar {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-toggle {
  display: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: .4rem;
  border-radius: var(--radius-sm);
}
.sidebar-toggle:hover { background: var(--bg-muted); color: var(--text); }

.page-title { font-size: 1.1rem; font-weight: 600; }
.topbar-left { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

.dash-content { padding: 2rem 1.5rem; flex: 1; }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  
}

.table-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-title { font-weight: 600; font-size: .95rem; }

table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-muted);
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: .85rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-muted); }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .5rem; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .35rem; }

.form-control {
  width: 100%;
  padding: .65rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--text);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234,88,12,.12);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M1 4l5 5 5-5' stroke='%236b6860' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; }

.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Auth Pages ───────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(234,88,12,.06) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-title { font-size: 1.6rem; font-weight: 700; text-align: center; margin-bottom: .5rem; }
.auth-sub { text-align: center; font-size: .875rem; color: var(--text-muted); margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }

/* ── Progress Bar ─────────────────────────────────────────────────────────────── */
.progress { height: 6px; background: var(--bg-muted); border-radius: 99px;  }
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── Badge / Pill ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-green { background: var(--accent-pale); color: var(--accent); }
.badge-amber { background: var(--accent2-pale); color: #b45309; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--bg-muted); color: var(--text-muted); }

/* ── Blog Cards ───────────────────────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  
  transition: all var(--trans);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card-img { aspect-ratio: 16/9;  background: var(--bg-muted); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--trans-slow); }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body { padding: 1.25rem; }
.blog-card-cat { font-size: .7rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem; }
.blog-card-title { font-size: 1rem; font-weight: 600; line-height: 1.4; margin-bottom: .5rem; }
.blog-card-excerpt { font-size: .825rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.blog-card-meta { display: flex; align-items: center; gap: .75rem; font-size: .75rem; color: var(--text-muted); }

/* ── Testimonials ─────────────────────────────────────────────────────────────── */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.testimonial-stars { color: var(--accent2); font-size: .9rem; margin-bottom: .75rem; }
.testimonial-text { font-size: .9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.25rem; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: .75rem; }
.testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-muted); }
.testimonial-name { font-weight: 600; font-size: .875rem; }
.testimonial-role { font-size: .75rem; color: var(--text-muted); }

/* ── Video Embed ──────────────────────────────────────────────────────────────── */
.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  
  background: #000;
}
.video-embed iframe { width: 100%; height: 100%; border: none; }

/* ── Pagination ───────────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 2rem; }
.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all var(--trans);
}
.page-item:hover { background: var(--bg-muted); color: var(--text); }
.page-item.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Utilities ────────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-sm { padding: 1rem; }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; color: var(--text-light); margin-bottom: 1rem; }
.search-bar { display: flex; gap: .5rem; }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: .875rem; }
.search-input-wrap .form-control { padding-left: 2.5rem; }

/* ── Learn Page ───────────────────────────────────────────────────────────────── */
.learn-layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 64px); }
.lesson-sidebar { background: var(--bg-card); border-right: 1px solid var(--border); overflow-y: auto; }
.lesson-sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.lesson-list { padding: .5rem; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans);
  font-size: .85rem;
  color: var(--text-muted);
}
.lesson-item:hover { background: var(--bg-muted); color: var(--text); }
.lesson-item.active { background: var(--accent-pale); color: var(--accent); font-weight: 600; }
.lesson-item.completed { color: var(--accent); }
.lesson-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .65rem; flex-shrink: 0; }
.lesson-item.completed .lesson-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.lesson-content-area { padding: 2rem; overflow-y: auto; }

/* ── Footer ───────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 3rem;
}
.footer-brand p { font-size: .875rem; color: var(--text-muted); margin: .75rem 0 1.25rem; max-width: 280px; line-height: 1.7; }
.social-links { display: flex; gap: .75rem; }
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: all var(--trans);
}
.social-links a:hover { background: var(--accent-pale); color: var(--accent); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-col h4 { font-size: .875rem; font-weight: 700; margin-bottom: .75rem; }
.footer-col a { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: .4rem; transition: color var(--trans); }
.footer-col a:hover { color: var(--accent); }
.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: var(--accent-pale);
  border: 1px solid var(--accent);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--trans);
  text-decoration: none;
}
.btn-pwa-install:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.2);
}
.footer-bottom { border-top: 1px solid var(--border); padding: 1.25rem 1.5rem; text-align: center; font-size: .8rem; color: var(--text-muted); }
.footer-bottom i { color: #dc2626; }

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
  .learn-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: fixed; left: -100%; top: 0; height: 100vh; z-index: 500; width: 300px; transition: left var(--trans-slow); }
  .lesson-sidebar.open { left: 0; }
  .footer-container { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow);
    z-index: 800;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav-links.open .nav-link-mobile-only { display: block; }
  .hamburger { display: flex; }
  .avatar-name { display: none; }
  .logo-img { height: 36px !important; }
  .nav-extra-logos { gap: 6px !important; }
  .nav-extra-logos img { height: 24px !important; }
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 500;
    transition: left var(--trans-slow);
  }
  .sidebar.open { left: 0; }
  .sidebar-close { display: block; }
  .sidebar-toggle { display: flex; }
  .dash-content { padding: 1.25rem 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; text-align: center; }
  .courses-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Make sure navbar actions don't overflow */
  .nav-actions { gap: 0.4rem; }
  .nav-search { display: none !important; }
  .nav-actions .btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .nav-container { gap: 0.5rem; padding: 0 1rem; }
}

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .footer-links { grid-template-columns: 1fr; }
  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .hero-stat-num { font-size: 1.4rem; }
  .nav-search { display: none !important; }
  /* Tighten the bar so brand logos + actions fit a narrow phone */
  .nav-container { padding: 0 .6rem; gap: .35rem; }
  .logo-img { height: 30px !important; }
  .nav-extra-logos { gap: 4px !important; margin-left: 2px !important; }
  .nav-extra-logos img { height: 19px !important; }
  .nav-actions { gap: .3rem; }
  .nav-actions .btn { padding: .38rem .6rem; font-size: .75rem; }
  /* Log In moves into the hamburger menu; Register stays as the visible CTA */
  .nav-actions > .btn-ghost { display: none; }
  .btn-icon { width: 32px; height: 32px; }
}

/* ── Global Table Responsiveness ─────────────────────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive table {
  width: 100%;   /* fills the container; auto table layout still grows (and scrolls) beyond it */
}

/* ═══════════════════════════════════════════════════════════════════════════
   RAFTAAR PUNJAB — ENHANCED STYLES (Contest, Leaderboard, Certificates)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Contest Cards ─────────────────────────────────────────────────────────── */
.contest-hero { 
  background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 50%, #0f3460 100%);
  position: relative;  padding: 80px 0;
}
.contest-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: url('../images/bg-tech.jpg');
  background-size: cover; background-position: center;
  opacity: 0.12;
}
.contest-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.5rem); }
.contest-hero p  { color: rgba(255,255,255,.75); font-size: 1.1rem; }

.contest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex; flex-direction: column;
}
.contest-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.contest-card-banner {
  width: 100%; aspect-ratio: 16/7; object-fit: cover;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}
.contest-card-banner-placeholder {
  width: 100%; aspect-ratio: 16/7;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(255,255,255,.4);
}
.contest-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.contest-card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.contest-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-upcoming { background: #dbeafe; color: #1d4ed8; }
.badge-review   { background: #fef9c3; color: #a16207; }
.badge-completed{ background: var(--bg-muted); color: var(--text-muted); }
.contest-card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.contest-card-desc { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.contest-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
}

/* ── Contest Detail ─────────────────────────────────────────────────────────── */
.contest-detail-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative; 
  color: #fff; padding: 64px 0;
}
.contest-detail-header::before {
  content: ''; position: absolute; inset: 0;
  background-image: url('../images/bg-lab.jpg');
  background-size: cover; background-position: center;
  opacity: 0.1;
}
.contest-detail-header > * { position: relative; }
.contest-detail-header h1 { color: #fff; }
.contest-meta-bar {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.contest-meta-item { display: flex; flex-direction: column; gap: 2px; }
.contest-meta-item span:first-child { font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.5); }
.contest-meta-item span:last-child  { font-weight: 600; color: #fff; }

/* ── Leaderboard ─────────────────────────────────────────────────────────────── */
.leaderboard-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.leaderboard-table th {
  padding: 10px 16px; text-align: left;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.leaderboard-table tr td {
  padding: 12px 16px; background: var(--bg-card);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.leaderboard-table tr td:first-child { border-left: 1px solid var(--border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.leaderboard-table tr td:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.leaderboard-table tr:hover td { background: var(--bg-hover); }
.rank-badge {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.rank-n { background: var(--bg-muted); color: var(--text-muted); }

/* ── Certificates ─────────────────────────────────────────────────────────────── */
.cert-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b; border-radius: var(--radius-lg);
  padding: 24px; position: relative; 
  transition: transform var(--trans), box-shadow var(--trans);
}
[data-theme="dark"] .cert-card {
  background: linear-gradient(135deg, #1c1a0d 0%, #262010 100%);
  border-color: #a16207;
}
.cert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cert-card::before {
  content: '🏆'; position: absolute; right: 16px; top: 16px;
  font-size: 2.5rem; opacity: .15;
}
.cert-card-type { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #a16207; margin-bottom: 6px; }
.cert-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.cert-card-code  { font-family: var(--font-mono); font-size: 12px;
  background: rgba(0,0,0,.08); padding: 4px 8px; border-radius: 4px;
  display: inline-block; color: var(--text-muted); }

/* ── Submission Form ──────────────────────────────────────────────────────────── */
.submission-form { max-width: 720px; }
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-pale); }
.upload-zone i { font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; }

/* ── Points/Gamification ──────────────────────────────────────────────────────── */
.points-display {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff; padding: 4px 12px; border-radius: 20px;
  font-weight: 700; font-size: 14px;
}
.progress-ring { position: relative; display: inline-block; }
.stat-icon-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  transition: transform var(--trans);
}
.stat-icon-card:hover { transform: translateY(-2px); }
.stat-icon-card .icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.stat-icon-card .value { font-size: 1.8rem; font-weight: 800; font-family: var(--font-display); }
.stat-icon-card .label { font-size: 13px; color: var(--text-muted); }

/* ── Dashboard Sidebar ────────────────────────────────────────────────────────── */
.dash-layout { display: flex; min-height: calc(100vh - 64px); }
.dash-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 24px 0; position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
  display: flex; flex-direction: column;
}
.dash-content { flex: 1; padding: 32px; overflow: auto; }
.sidebar-nav { padding: 0 12px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-light);
  padding: 16px 12px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  transition: all var(--trans); margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--accent-pale); color: var(--accent);
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; min-width: 20px; text-align: center;
}
.sidebar-user {
  padding: 16px; border-top: 1px solid var(--border); margin-top: auto;
}

/* ── Enhanced Cards ──────────────────────────────────────────────────────────── */
.card-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.card-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 1100px) { .card-grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px)  {
  .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
  body:not(.app-dashboard) .dash-layout { flex-direction: column; }
  body:not(.app-dashboard) .dash-sidebar { width: 100%; height: auto; position: static; }
  body:not(.app-dashboard) .dash-content { padding: 20px; }
}

/* ── Contest Category Filter ─────────────────────────────────────────────────── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 0; }
.filter-chip {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  transition: all var(--trans); cursor: pointer; text-decoration: none;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ── Timeline ─────────────────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 4px;
  bottom: 4px; width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -24px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-content { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; }

/* ── Progress Steps ──────────────────────────────────────────────────────────── */
.progress-steps { display: flex; gap: 0; margin-bottom: 24px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: 50%; right: -50%;
  height: 2px; background: var(--border); z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--accent); }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--bg-card); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; z-index: 1; position: relative;
  color: var(--text-muted);
}
.step.done .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.active .step-dot { border-color: var(--accent); color: var(--accent); }
.step-label { font-size: 11px; margin-top: 6px; color: var(--text-muted); text-align: center; }
.step.done .step-label, .step.active .step-label { color: var(--accent); }

/* ── Category Icons ──────────────────────────────────────────────────────────── */
.category-icon {
  width: 80px; height: 80px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.category-icon.coding    { background: #dbeafe; color: #1d4ed8; }
.category-icon.robotics  { background: #dcfce7; color: #15803d; }
.category-icon.iot       { background: #fce7f3; color: #be185d; }
.category-icon.stem      { background: #ede9fe; color: #7c3aed; }
.category-icon.design    { background: #fff7ed; color: #c2410c; }
.category-icon.innovation{ background: #fef9c3; color: #a16207; }

/* ── Responsive Tables ──────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg-muted); padding: 10px 16px; text-align: left;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 14px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

/* ── Alert Variants ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm);
  border-left: 4px solid; font-size: 14px; }
.alert-info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.alert-success { background: #f0fdf4; border-color: #22c55e; color: #14532d; }
.alert-danger  { background: #fff1f2; border-color: #f43f5e; color: #881337; }
[data-theme="dark"] .alert-info    { background: #0f172a; color: #93c5fd; }
[data-theme="dark"] .alert-warning { background: #1c1407; color: #fcd34d; }
[data-theme="dark"] .alert-success { background: #052e16; color: #86efac; }
[data-theme="dark"] .alert-danger  { background: #1c0a0f; color: #fda4af; }

/* ── Contest Submission Status ───────────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.status-pending     { background: #fef3c7; color: #92400e; }
.status-shortlisted { background: #dbeafe; color: #1e40af; }
.status-winner      { background: #dcfce7; color: #14532d; }
.status-rejected    { background: #fee2e2; color: #991b1b; }

/* ── Countdown Timer ─────────────────────────────────────────────────────────── */
.countdown { display: flex; gap: 12px; }
.countdown-unit {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; text-align: center;
  min-width: 56px;
}
.countdown-unit .num { font-size: 1.6rem; font-weight: 800; font-family: var(--font-display); line-height: 1; }
.countdown-unit .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   UI refresh v2 — layout, landing hero, dashboard, auth (frontend only)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: .75rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus {
  left: 1rem;
  top: .75rem;
}

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* Glass navbar */
.navbar--glass {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .navbar--glass {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.15); }
}

/* Landing hero */
.hero-landing {
  position: relative;
  
  padding: 5rem 0 3.5rem;
  background: linear-gradient(135deg, #1a1206 0%, #7c2d12 55%, #c2410c 100%);
}
.hero-landing-pattern {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 60L60 0' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-landing-inner { position: relative; display: flex; align-items: center; gap: 2.5rem; }
.hero-landing-copy { max-width: 42rem; flex: 1 1 auto; }
.hero-landing-visual {
  flex: 0 0 320px;
  display: none;
}
.hero-landing-visual img { width: 100%; height: auto; display: block; animation: hero-float 4s ease-in-out infinite; }
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-landing-visual img { animation: none; }
}
@media (min-width: 992px) {
  .hero-landing-visual { display: block; }
}
.hero-landing-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 99px;
  padding: .35rem .9rem;
  margin-bottom: 1.5rem;
  font-size: .8125rem;
  color: rgba(255,255,255,.85);
}
.hero-landing-pulse {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}
.hero-landing-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  color: #fff;
  margin-bottom: 1.25rem;
  line-height: 1.08;
}
.hero-landing-title em {
  color: #4ade80;
  font-style: normal;
}
.hero-landing-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.78);
  margin-bottom: 2rem;
  line-height: 1.7;
  max-width: 36rem;
}
.hero-landing-cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.hero-landing-cta-secondary {
  border-color: rgba(255,255,255,.35) !important;
  color: rgba(255,255,255,.92) !important;
}
.hero-landing-cta-secondary:hover {
  background: rgba(255,255,255,.1) !important;
  color: #fff !important;
}
.hero-landing-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.12);
  flex-wrap: wrap;
}
.hero-landing-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: #4ade80;
  font-family: var(--font-display);
  line-height: 1;
}
.hero-landing-stat-label {
  font-size: .8125rem;
  color: rgba(255,255,255,.6);
  margin-top: .25rem;
}

/* Dashboard app shell */
body.app-dashboard { background: var(--bg-muted); }
body.app-dashboard .site-footer { display: none; }
body.app-dashboard .dash-layout {
  min-height: 100vh;
}
body.app-dashboard .dash-sidebar {
  top: 0;
  height: 100vh;
  padding: 0;
  z-index: 400;
}
.dash-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border-light);
}
.dash-sidebar-brand img { height: 36px; width: auto; }
.dash-sidebar-close { display: none; }
.dash-sidebar-foot {
  margin-top: auto;
  padding: .75rem 12px 1rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  margin-top: 0;
  border-top: none;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-user-meta { min-width: 0; }
.sidebar-user-name {
  font-weight: 700;
  font-size: .875rem;
  white-space: nowrap;
  
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .75rem;
  color: var(--text-muted);
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.dash-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.dash-menu-btn { display: none; }
.dash-topbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dash-topbar-home { display: none; }
.dash-flashes { margin-bottom: 1rem; }
.dash-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 350;
  opacity: 0;
  transition: opacity var(--trans);
}
.dash-sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* Page banners (dashboards) */
.page-banner {
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  position: relative;
  
}
.page-banner--accent {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  color: #fff;
}
.page-banner-deco::before,
.page-banner-deco::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.page-banner-deco::before {
  width: 120px;
  height: 120px;
  right: -20px;
  top: -20px;
}
.page-banner-deco::after {
  width: 80px;
  height: 80px;
  right: 60px;
  bottom: -30px;
  background: rgba(255,255,255,.04);
}
.page-banner-inner { position: relative; z-index: 1; }
.page-banner-eyebrow {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .75;
  margin-bottom: .35rem;
}
.page-banner-title {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-display);
  margin-bottom: .25rem;
  color: inherit;
}

/* Auth split layout */
body.auth-layout-page .site-footer { display: none; }
body.auth-layout-page main { min-height: calc(100vh - 64px); }

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 64px);
}
.auth-split-panel {
  background: linear-gradient(160deg, var(--accent-dark) 0%, var(--accent) 45%, #ffb366 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  align-items: center;
}
.auth-split-inner { max-width: 22rem; }
.auth-split-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .8;
  margin-bottom: 1rem;
}
.auth-split-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}
.auth-split-desc {
  opacity: .85;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.auth-split-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.auth-split-features li {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 500;
}
.auth-split-features i {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-split-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
}
.auth-card--elevated {
  box-shadow: var(--shadow-lg);
}
.auth-card--wide { max-width: 520px; }
.auth-inline-link {
  float: right;
  font-weight: 400;
  font-size: .8rem;
}
.auth-page--register { min-height: calc(100vh - 64px); }

/* Section utilities */
.section-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .5rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: .5rem;
}
.section-desc {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 auto;
}

/* Mobile: dashboard + auth */
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-split-panel { display: none; }
}

@media (max-width: 768px) {
  .dash-menu-btn { display: flex; }
  .dash-topbar-home { display: inline-flex; }
  .dash-sidebar-close { display: flex; }

  body.app-dashboard .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--trans-slow);
    box-shadow: var(--shadow-lg);
  }
  body.app-dashboard .dash-sidebar.open {
    transform: translateX(0);
  }
  body.dash-sidebar-open {  }

  .dash-content { padding: 1.25rem 1rem; }
  .hero-landing { padding: 3.5rem 0 2.5rem; }
  .hero-landing-stats { gap: 1.25rem; }

  .nav-links.open {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
}

@media (min-width: 769px) {
  body.app-dashboard .dash-sidebar-backdrop { display: none !important; }
}


/* ── Badge Chips (gamification) ─────────────────────────────────────────────── */
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: default;
  transition: transform var(--trans);
}
.badge-chip.earned {
  background: var(--accent-pale);
  color: var(--accent);
  border-color: var(--accent-light);
}
.badge-chip.earned:hover { transform: translateY(-2px); }
.badge-chip.locked {
  background: var(--bg-muted);
  color: var(--text-light);
  opacity: .65;
}

/* ── Star Rating Input ──────────────────────────────────────────────────────── */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse; /* right-to-left so hover fills left side */
  gap: 4px;
}
.star-rating input { display: none; }
.star-rating label {
  cursor: pointer;
  font-size: 22px;
  color: var(--border);
  transition: color var(--trans), transform var(--trans);
}
.star-rating label:hover { transform: scale(1.15); }
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: #f59e0b; }

/* ── Rich text content (Quill output) ───────────────────────────────────────── */
.rich-content h2, .rich-content h3 { margin: 14px 0 8px; color: var(--text); }
.rich-content p { margin-bottom: 8px; }
.rich-content ul, .rich-content ol { margin: 8px 0 8px 22px; }
.rich-content li { margin-bottom: 4px; }
.rich-content a { color: var(--accent); text-decoration: underline; }
.rich-content pre,
.rich-content .ql-code-block-container,
.rich-content .ql-syntax {
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  margin: 8px 0;
}
.rich-content .ql-size-small { font-size: 12px; }
.rich-content .ql-size-large { font-size: 18px; }
.rich-content .ql-size-huge  { font-size: 24px; }
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right  { text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM POLISH LAYER v3 — system-wide refinement (frontend only)
   Softer elevation, universal focus states, refined controls & motion.
   Appended last so it layers over the base rules above.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Refined design tokens ─────────────────────────────────────────────────── */
:root {
  /* Layered, low-opacity shadows — the hallmark of premium product UI */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow:    0 1px 3px rgba(16,24,40,.07), 0 6px 16px -6px rgba(16,24,40,.10);
  --shadow-lg: 0 8px 24px -8px rgba(16,24,40,.14), 0 24px 56px -20px rgba(16,24,40,.18);
  --ring:      0 0 0 3px rgba(234,88,12,.16);
  --ease-out:  cubic-bezier(.22,1,.36,1);
}
[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 1px 3px rgba(0,0,0,.5), 0 8px 20px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6), 0 28px 64px -24px rgba(0,0,0,.7);
  --ring:      0 0 0 3px rgba(34,163,110,.28);
}

/* ── Base typography & rendering polish ────────────────────────────────────── */
body {
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}
h1, h2, .hero-title, .hero-landing-title, .section-title, .page-banner-title {
  letter-spacing: -.015em;
}
::selection { background: var(--accent-pale); color: var(--accent-dark); }
[data-theme="dark"] ::selection { color: var(--accent-light); }

/* ── Custom scrollbars ─────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 3px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Universal form focus states ───────────────────────────────────────────────
   Many inputs across the app carry inline styles and had NO focus feedback.
   These rules give every control a consistent accent ring (!important beats the
   inline border-color) — a big lift to perceived quality and accessibility. */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
select, textarea {
  transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: var(--ring);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* ── Buttons: subtle gradient + tactile press ──────────────────────────────── */
.btn { letter-spacing: .005em; will-change: transform; }
.btn-primary {
  background-image: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.btn-primary:hover {
  background-image: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 8px 20px -6px rgba(234,88,12,.5);
}
.btn:active { transform: translateY(0) scale(.97); }
.btn-icon:hover { transform: translateY(-1px); }
.btn-icon:active { transform: scale(.92); }

/* ── Cards & interactive surfaces ──────────────────────────────────────────── */
.card, .stat-card, .stat-icon-card, .testimonial-card,
.contest-card, .blog-card, .course-card {
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.card:hover { box-shadow: var(--shadow); }
.stat-card:hover { transform: translateY(-2px); border-color: var(--border); }

/* ── Navigation refinement ─────────────────────────────────────────────────── */
.nav-link { position: relative; }
.nav-link.active { background: var(--accent-pale); }
.avatar-btn:hover { box-shadow: var(--shadow-sm); }
.dash-topbar { backdrop-filter: saturate(1.2); }

/* ── Sidebar active indicator ──────────────────────────────────────────────── */
.sidebar-link { position: relative; }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

/* ── Tables: rounded, cleaner hover ────────────────────────────────────────── */
tbody tr { transition: background var(--trans); }

/* ── Flash toasts: refined depth ───────────────────────────────────────────── */
.flash { box-shadow: var(--shadow-lg); border-radius: var(--radius); backdrop-filter: blur(8px); }
.flash-close { transition: color var(--trans); border-radius: 4px; }
.flash-close:hover { color: var(--text); }

/* ── Media: crisper images ─────────────────────────────────────────────────── */
img { image-rendering: auto; }

/* ── Motion entrance for dashboard content ─────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dash-content > * { animation: rise .4s var(--ease-out) backwards; }

/* ── Respect reduced-motion across the app ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM SYSTEM — canonical building blocks for admin/create-edit forms
   Replaces the repeated inline styles that used to live in each template.
   Tuned to the app's de-facto standard (13px/700 labels, 11px×14px inputs).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Field label + control (override the earlier base defs to the real standard) */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.form-label .label-soft,
.label-soft { font-weight: 400; color: var(--text-muted); }

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--text);
}
textarea.form-control { min-height: auto; }

/* Form scaffolding */
.form-stack { max-width: 820px; display: flex; flex-direction: column; gap: 20px; }
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.form-card.stacked { display: flex; flex-direction: column; gap: 16px; }
.form-card-label {           /* section label at the top of a card */
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.form-actions { display: flex; gap: 12px; }
.form-heading { font-size: 1.4rem; margin: 12px 0 20px; }

/* Column layouts */
.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field-grid.grid-title { grid-template-columns: 1fr 100px; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }

/* Back link above a form heading */
.back-link {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-link:hover { color: var(--accent); }

/* Inline checkbox rows */
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.check-row { display: flex; gap: 24px; flex-wrap: wrap; }

/* Selectable tiles (e.g. assign-teachers grid) */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.checkbox-tile:hover { border-color: var(--accent); }
.checkbox-tile:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }

/* Small helper note under a field */
.field-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Dashed upload dropzone (generic) */
.upload-drop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.upload-drop:hover { border-color: var(--accent); background: var(--accent-pale); }

/* File attachment chip */
.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.file-chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Quill editor frame (shared by course + lesson forms) */
.editor-frame { border: 1.5px solid var(--border); border-radius: var(--radius-sm);  }
.editor-toolbar { border: none; border-bottom: 1px solid var(--border); background: var(--bg-muted); border-radius: calc(var(--radius-sm) - 1.5px) calc(var(--radius-sm) - 1.5px) 0 0; }
.editor-area { font-size: 14px; background: var(--bg); border-radius: 0 0 calc(var(--radius-sm) - 1.5px) calc(var(--radius-sm) - 1.5px); resize: vertical; overflow: auto; min-height: 150px; }

/* Thumbnail / image dropzone with live preview (course form) */
.thumb-drop {
  position: relative;
  margin-top: 6px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  max-width: 440px;
  
  cursor: pointer;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color var(--trans), background var(--trans);
}
.thumb-drop:hover { border-color: var(--accent); }
.thumb-drop-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-drop-empty { padding: 24px; color: var(--text-muted); }
.thumb-drop-empty i { font-size: 26px; color: var(--accent); margin-bottom: 8px; display: block; }
.thumb-drop-empty .t { font-size: 13.5px; font-weight: 700; color: var(--text); }
.thumb-drop-empty .s { font-size: 12px; margin-top: 2px; }
.thumb-drop-actions {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.thumb-btn { font-size: 12px; padding: 6px 12px; }
.thumb-btn-light  { background: #fff; color: #111; }
.thumb-btn-danger { background: #dc2626; color: #fff; }
.thumb-error { font-size: 12px; color: #dc2626; margin-top: 6px; }

/* Repeatable input rows + quiz builder (lesson form, JS-generated) */
.input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.btn-remove { color: #ef4444; padding: 0 10px; background: none; }
.btn-remove-pad { color: #ef4444; padding: 6px; background: none; }
.quiz-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.quiz-item-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.quiz-qnum { font-weight: 800; font-size: 13px; color: var(--text-muted); }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.quiz-correct { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.input-sm { width: 70px; }

/* ── Public course grid helpers ────────────────────────────────────────────── */
.course-thumb { display: flex; align-items: center; justify-content: center; }
.course-thumb-fallback { background: linear-gradient(135deg, var(--accent-dark), var(--accent)); }
.course-thumb-fallback i { color: rgba(255,255,255,.9); font-size: 2rem; }
.course-desc { font-size: .8125rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .75rem; }
.course-meta .rating { color: #f59e0b; }

/* Public page heading + filter bar (courses, contests, browse) */
.page-pad { padding-top: 100px; padding-bottom: 60px; }
.public-title { font-size: 1.6rem; margin-bottom: 20px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-bar .filter-search { flex: 1; min-width: 200px; }
.filter-bar .form-control { width: auto; }

/* ── Admin content header + table helpers ──────────────────────────────────── */
.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.content-title { font-size: 1.4rem; }
.content-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; }
.inline-form .form-control { width: auto; }

.table-thumb {
  width: 64px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-thumb i { color: rgba(255,255,255,.85); font-size: 13px; }
.cell-title { display: flex; align-items: center; gap: 12px; }
.cell-sub { font-size: 12px; color: var(--text-muted); }
.row-actions { display: flex; gap: 10px; justify-content: center; align-items: center; }
.act-edit { color: #1d4ed8; }
.act-pub  { color: #15803d; }
.act-del  { color: #b91c1c; }
.ta-c { text-align: center !important; }
.text-amber { color: #f59e0b; }

/* ── List rows (lessons + generic item lists) ──────────────────────────────── */
.list-stack { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.list-row:hover { box-shadow: var(--shadow-sm); }
.list-num {
  width: 34px;
  height: 34px;
  background: var(--accent-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.list-body { flex: 1; min-width: 0; }
.list-row-title { font-weight: 700; font-size: 14px; }
.list-row-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-actions { display: flex; gap: 12px; }
.text-free { color: #15803d; font-weight: 700; }

/* ── Dashboard panels, stat tiles & mini rows ──────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel--warn { border-color: #f59e0b; }
.panel-title { font-size: .95rem; font-weight: 800; margin-bottom: 14px; }

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-tile-num { font-size: 1.3rem; font-weight: 900; line-height: 1; color: var(--text); }
.stat-tile-label { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.dash-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dash-grid-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.dash-grid-2, .dash-grid-21, .dash-grid-sidebar { margin-bottom: 24px; }
@media (max-width: 768px) { .dash-grid-2, .dash-grid-21, .dash-grid-sidebar { grid-template-columns: 1fr !important; } }

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.mini-row:last-child { border-bottom: none; }
.mini-row.split { justify-content: space-between; }
.mini-row-body { flex: 1; min-width: 0; }
.mini-row-meta { font-size: 12px; color: var(--text-muted); }
.text-danger { color: #b91c1c; }

/* Card footer for enroll/continue action (student browse grid) */
.course-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   COURSE DETAIL PAGE — hero, curriculum, instructors, reviews, enroll sidebar
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hero */
.course-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  padding: 100px 0 56px;
  
}
.course-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .18;
}
.course-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,.82), rgba(30,58,95,.72));
}
.course-hero .container { position: relative; z-index: 1; }
.course-hero-inner { max-width: 680px; }
.course-hero-cat { font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.course-hero-title { color: #fff; font-size: 1.9rem; margin-bottom: 12px; }
.course-hero-desc { color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.8; }
.course-hero-meta { display: flex; gap: 20px; margin-top: 20px; font-size: 13px; color: rgba(255,255,255,.6); }
.course-hero-meta .rating { color: #fbbf24; }
.course-hero-meta .rating span { color: rgba(255,255,255,.6); }

/* Two-column body layout */
.course-detail { padding: 48px 0; }
.course-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } }
.course-section-title { font-size: 1.2rem; margin-bottom: 16px; }
.course-section-title.mt { margin-top: 32px; }
.about-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Curriculum */
.curriculum-list { display: flex; flex-direction: column; gap: 8px; }
.curriculum-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.curriculum-num {
  width: 30px;
  height: 30px;
  background: var(--accent-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.curriculum-title { font-weight: 600; font-size: 13px; }
.curriculum-sub { font-size: 11px; color: var(--text-muted); }
.curriculum-free { font-size: 11px; color: #15803d; font-weight: 600; }
.curriculum-lock { color: var(--text-muted); font-size: 12px; }

/* Instructors */
.instructor-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.instructor-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.instructor-name { font-weight: 600; font-size: 13px; }
.instructor-role { font-size: 12px; color: var(--text-muted); }

/* Reviews */
.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.review-name { font-size: 13.5px; }
.review-stars { color: #f59e0b; font-size: 12px; }
.review-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.review-text { font-size: 13.5px; color: var(--text-muted); }

/* Enroll sidebar */
.enroll-sidebar { position: sticky; top: 80px; }
.enroll-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  
}
.enroll-thumb { aspect-ratio: 16 / 9; background: var(--bg-muted); }
.enroll-thumb img { width: 100%; height: 100%; object-fit: cover; }
.enroll-body { padding: 24px; }
.enroll-body .btn { width: 100%; justify-content: center; padding: 12px; margin-bottom: 12px; }
.enroll-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.enroll-stat { display: flex; justify-content: space-between; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTEST & BLOG PAGES — public headers, generic cards, articles, submissions
   ═══════════════════════════════════════════════════════════════════════════ */

/* Public page header (title + optional subtitle + action) */
.page-subtitle { color: var(--text-muted); font-size: 14px; }
.public-title.tight { margin-bottom: 4px; }

/* Row of filter buttons / chips */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* 3-column form grid */
.field-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 620px) { .field-grid.cols-3 { grid-template-columns: 1fr; } }

/* Public centered form wrapper */
.form-page { max-width: 820px; margin: 0 auto; padding: 100px 20px 60px; }

/* Generic clickable card + shared card text bits */
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  text-decoration: none;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.link-card.sm { padding: 16px; }
.card-eyebrow { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.card-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.card-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.split-row { display: flex; justify-content: space-between; }
.ml-auto { margin-left: auto; }
.pre-line { white-space: pre-line; }

/* Contest list card internals */
.contest-status { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.contest-status.active { color: #15803d; }
.contest-status.inactive { color: var(--text-muted); }
.contest-tag { font-size: 11px; color: var(--text-muted); }
.contest-prize { margin-top: 10px; font-size: 12.5px; color: var(--accent2); font-weight: 700; }
.contest-card-meta2 { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--text-muted); }

/* Blog cards — enhance the (previously unused) component to flex + fallbacks */
.blog-card { display: flex; flex-direction: column; text-decoration: none; }
.blog-card-body { flex: 1; }
.blog-card-img-fallback {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-card-img-fallback i { color: rgba(255,255,255,.85); font-size: 1.8rem; }

/* Article (blog post) layout */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 100px 20px 60px; }
.article-cat { margin: 16px 0 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.article-title { font-size: 1.9rem; font-family: var(--font-display); line-height: 1.3; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); margin-bottom: 26px; flex-wrap: wrap; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 26px; }
.article-body { font-size: 15px; line-height: 1.9; color: var(--text); }
.article-actions {
  display: flex;
  gap: 12px;
  margin: 32px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-h2 { font-size: 1.15rem; margin-bottom: 16px; }
.section-h2.mt { margin-top: 36px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.comment-head { display: flex; gap: 8px; font-size: 13px; margin-bottom: 3px; }
.comment-body { font-size: 13.5px; color: var(--text-muted); }

/* Small card grid (related posts) */
.mini-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: block;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.mini-card:hover { box-shadow: var(--shadow-sm); }
.mini-card-title { font-weight: 700; font-size: 13.5px; color: var(--text); }
.mini-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Detail-page notice + winners */
.notice-accent {
  text-align: center;
  padding: 10px;
  background: var(--accent-pale);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.list-row.gold { border-color: #f59e0b; }

/* Submission review cards */
.sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.sub-card.winner { border-color: #f59e0b; }
.sub-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.sub-by { font-size: 12.5px; color: var(--text-muted); margin: 6px 0; }
.sub-text { font-size: 13.5px; color: var(--text-muted); }
.sub-links { display: flex; gap: 14px; margin: 8px 0; font-size: 13px; }
.judge-note { margin-top: 10px; padding: 10px 14px; background: var(--bg-muted); border-radius: var(--radius-sm); font-size: 13px; }
.review-form { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.review-note { flex: 1; min-width: 200px; }

/* Small inline select (admin table cells) */
.select-mini { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 12px; }
.act-pin { color: #b45309; }
.act-feature { color: #a16207; }
.act-save { color: var(--accent); }
.act-warn { color: #b45309; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN & TEACHER SWEEP — dashboards, detail pages, panels, side layouts
   ═══════════════════════════════════════════════════════════════════════════ */

/* Code chips + misc utilities */
.code-chip { background: var(--bg-muted); padding: 4px 10px; border-radius: 6px; font-weight: 700; color: var(--accent); }
.code-chip-plain { background: var(--bg-muted); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.cell-truncate { max-width: 380px;  text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.text-ok { color: #15803d; font-weight: 700; }
.text-warn { color: #b45309; font-weight: 700; }
.overflow-x { overflow-x: auto; }
.code-block { background: var(--bg-muted); border-radius: var(--radius-sm); padding: 12px; font-size: 11px; overflow-x: auto; }
.row-link { cursor: pointer; }

/* Side layout: content list + sticky side panel */
.side-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.side-layout.w300 { grid-template-columns: 1fr 300px; }
.side-layout.w340 { grid-template-columns: 1fr 340px; }
.side-layout.w360 { grid-template-columns: 1fr 360px; }
@media (max-width: 820px) {
  .side-layout, .side-layout.w300, .side-layout.w340, .side-layout.w360 { grid-template-columns: 1fr; }
}

/* Panel header row (title + "view all") */
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.panel-h { font-size: 1rem; font-weight: 800; }
.link-more { font-size: 13px; font-weight: 600; }
.panel-sticky { position: sticky; top: 80px; }

/* Notice / announcement card (accent left bar) */
.notice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.notice-card-body { flex: 1; min-width: 0; }

/* Centered mini stat tiles */
.mini-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.mini-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.mini-stat-num { font-size: 1.4rem; font-weight: 900; color: var(--accent); }
.mini-stat-label { font-size: 12px; color: var(--text-muted); }

/* Entity detail header (avatar/icon + title + meta) */
.entity-head { display: flex; align-items: center; gap: 16px; margin: 16px 0 24px; }
.entity-head-main { display: flex; align-items: center; gap: 16px; }
.entity-icon { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.entity-icon-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.entity-title { font-size: 1.4rem; font-weight: 800; }
.entity-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Paneled table block (card + header bar + table) */
.panel-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);  }
.panel-block-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.panel-block .data-table { border: none; }
.panel-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Dashboard feed rows (text-only list) */
.feed-row { padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.feed-row:last-child { border-bottom: none; }
.feed-title { font-weight: 700; font-size: 13px; }
.feed-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Item row (bordered link with trailing status) */
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-bottom: 10px;
  transition: border-color var(--trans);
}
.item-row:hover { border-color: var(--accent); }

/* Avatar row (student links with progress) */
.avatar-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); text-decoration: none; }
.avatar-row:last-child { border-bottom: none; }
.avatar-row-body { flex: 1; min-width: 0; }
.avatar-row-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.avatar-row-sub { font-size: 11.5px; color: var(--text-muted); }

/* Inline mini progress bar */
.progress-wrap { display: flex; align-items: center; gap: 8px; width: 120px; }
.mini-bar { flex: 1; height: 5px; background: var(--border); border-radius: 99px;  }
.mini-bar-fill { height: 100%; background: var(--accent); }
.mini-bar-fill.done { background: #22c55e; }

/* Key/value list (profile account panel) */
.kv-list { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.kv-row { display: flex; justify-content: space-between; }

/* Reply box (answered query) */
.reply-box { margin-top: 12px; padding: 12px 14px; background: var(--accent-pale); border-radius: var(--radius-sm); }
.reply-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

/* 2fr/1fr form grid */
.field-grid.grid-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 560px) { .field-grid.grid-2-1 { grid-template-columns: 1fr; } }

.progress-bar.done { background: #22c55e; }

/* ── Quill Custom Fonts ──────────────────────────────────────────────────────── */
.ql-font-cambria { font-family: Cambria, Georgia, serif !important; }
.ql-font-times-new-roman { font-family: 'Times New Roman', Times, serif !important; }
.ql-font-calibri { font-family: Calibri, Helvetica, sans-serif !important; }
.ql-font-monospace { font-family: monospace !important; }
.ql-font-serif { font-family: serif !important; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="cambria"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="cambria"]::before {
  content: 'Cambria';
  font-family: Cambria, Georgia, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="times-new-roman"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="times-new-roman"]::before {
  content: 'Times New Roman';
  font-family: 'Times New Roman', Times, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="calibri"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="calibri"]::before {
  content: 'Calibri';
  font-family: Calibri, Helvetica, sans-serif;
}

/* Logo Dark Mode Support */
[data-theme="dark"] .logo-img {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 4px;
}

/* -- Premium Aesthetic Overrides ----------------------------------------------- */
body {
  background-image: 
    radial-gradient(at 0% 0%, rgba(234,88,12,0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245,159,11,0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

.navbar {
  background: rgba(250, 250, 248, 0.7) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

[data-theme="dark"] .navbar {
  background: rgba(17, 17, 16, 0.7) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #ea580c, #ff9f43) !important;
  border: none !important;
  box-shadow: 0 10px 25px -8px rgba(26, 107, 74, 0.5) !important;
}

.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 34px -10px rgba(26, 107, 74, 0.7) !important;
}

.course-card, .card {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

[data-theme="dark"] .course-card, [data-theme="dark"] .card {
  background: rgba(28, 28, 26, 0.65) !important;
  border-color: rgba(63, 63, 70, 0.5) !important;
}

.course-card:hover, .card:hover {
  transform: translateY(-6px) scale(1.01) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: rgba(26, 107, 74, 0.3) !important;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #ea580c, #ff9f43);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title .highlight::after { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Assessment Insights — samarth.ndu.digital section (quadrant circles + cards)
   ═══════════════════════════════════════════════════════════════════════════ */
.ai-section { padding: 64px 20px; background: linear-gradient(135deg, #fff9f5 0%, #fff3e0 100%); position: relative; overflow: hidden; }
[data-theme="dark"] .ai-section { background: linear-gradient(135deg, #1c130b 0%, #251507 100%); }
.ai-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.ai-blob-tr { width: 220px; height: 220px; top: -60px; right: -60px; background: rgba(255,122,0,.06); }
.ai-blob-bl { width: 170px; height: 170px; bottom: -40px; left: -40px; background: rgba(255,122,0,.08); }
.ai-container { max-width: 1500px; margin: 0 auto; position: relative; z-index: 1; }
.ai-header { text-align: center; margin-bottom: 52px; }
.ai-heading { font-size: 42px; font-weight: 700; color: #1a1a1a; margin: 0 0 12px; letter-spacing: -.5px; }
[data-theme="dark"] .ai-heading { color: #fafafa; }
.ai-heading-bar { width: 72px; height: 4px; background: linear-gradient(90deg, #ff7a00, #ffb366); border-radius: 2px; margin: 0 auto 18px; }
.ai-subheading { font-size: 15px; color: #666; max-width: 580px; margin: 0 auto; line-height: 1.65; }
[data-theme="dark"] .ai-subheading { color: #a1a1aa; }
.ai-sec-head { text-align: center; margin: 46px 0 36px; }
.ai-sec-head h3 { font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px; letter-spacing: .2px; }
[data-theme="dark"] .ai-sec-head h3 { color: #fafafa; }
.ai-sec-bar { width: 40px; height: 3px; background: #ff7a00; border-radius: 2px; margin: 0 auto; }
.ai-layout { display: grid; grid-template-columns: 2fr 360px 2fr; gap: 40px; align-items: center; }
.ai-col { display: flex; flex-direction: column; gap: 20px; }
.ai-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.07); transition: transform .25s, box-shadow .25s; cursor: default; }
[data-theme="dark"] .ai-card { background: #27272a; }
.ai-card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(255,122,0,.16); }
.ai-card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; }
.ai-card-badge { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-card-title { font-size: 14px; font-weight: 700; color: #fff; }
.ai-card-body { padding: 14px 16px 16px; }
.ai-bullet { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; font-size: 13px; color: #444; line-height: 1.5; }
[data-theme="dark"] .ai-bullet { color: #d4d4d8; }
.ai-bullet:last-child { margin-bottom: 0; }
.ai-bullet-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ai-circle-wrap { display: flex; align-items: center; justify-content: center; }
.ai-circle-outer { position: relative; width: 310px; height: 310px; flex-shrink: 0; }
.ai-circle { width: 310px; height: 310px; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.ai-icon-bubble { position: absolute; width: 80px; height: 80px; border-radius: 50%; background: #fff; border: 4px solid; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 10; }
[data-theme="dark"] .ai-icon-bubble { background: #18181b; }
.ai-quarter { position: absolute; width: 50%; height: 50%; overflow: hidden; }
.ai-quarter-top-left { top: 0; left: 0; }
.ai-quarter-top-right { top: 0; right: 0; }
.ai-quarter-bottom-left { bottom: 0; left: 0; }
.ai-quarter-bottom-right { bottom: 0; right: 0; }
.ai-quarter-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ai-quarter-label { position: absolute; font-size: 22px; font-weight: 900; color: rgba(255,255,255,.9); line-height: 1; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ai-label-top-left { bottom: 28%; right: 18%; }
.ai-label-top-right { bottom: 28%; left: 18%; }
.ai-label-bottom-left { top: 28%; right: 18%; }
.ai-label-bottom-right { top: 28%; left: 18%; }
.ai-cross-h, .ai-cross-v { position: absolute; background: rgba(255,255,255,.35); pointer-events: none; }
.ai-cross-h { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.ai-cross-v { top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%); }
.ai-extra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.ai-footnote { text-align: center; font-size: 12.5px; color: #888; margin-top: 34px; }
[data-theme="dark"] .ai-footnote { color: #a1a1aa; }
.ai-section-c-wrap { display: flex; justify-content: center; padding: 0 20px; }
.ai-section-c-card { background: #fff; border-radius: 20px; padding: 40px 48px; max-width: 640px; width: 100%; box-shadow: 0 4px 24px rgba(0,0,0,.08); border: 1.5px solid rgba(255,122,0,.12); text-align: center; transition: transform .25s, box-shadow .25s; }
[data-theme="dark"] .ai-section-c-card { background: #27272a; }
.ai-section-c-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(255,122,0,.14); }
.ai-sc-icon { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,122,0,.08); border: 2px solid rgba(255,122,0,.2); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.ai-sc-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin: 0 0 14px; letter-spacing: -.3px; }
[data-theme="dark"] .ai-sc-title { color: #fafafa; }
.ai-sc-desc { font-size: 14px; color: #555; line-height: 1.75; margin: 0 0 24px; }
[data-theme="dark"] .ai-sc-desc { color: #a1a1aa; }
.ai-sc-bullets { text-align: left; display: flex; flex-direction: column; gap: 10px; background: #faf9f7; border-radius: 12px; padding: 16px 20px; }
[data-theme="dark"] .ai-sc-bullets { background: #18181b; }
.ai-sc-bullet { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #444; line-height: 1.5; }
[data-theme="dark"] .ai-sc-bullet { color: #d4d4d8; }
.ai-sc-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff7a00; flex-shrink: 0; margin-top: 4px; }
@media (max-width: 960px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-circle-outer, .ai-circle { width: 240px; height: 240px; }
  .ai-circle-wrap { order: -1; }
  .ai-heading { font-size: 30px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Assessment taking UI (pre/post development screening)
   ═══════════════════════════════════════════════════════════════════════════ */
.assess-hero { background: linear-gradient(135deg, #ea580c, #ff9f43); border-radius: var(--radius-lg); padding: 30px 32px; color: #fff; margin-bottom: 24px; box-shadow: 0 14px 34px rgba(234,88,12,.28); }
.assess-hero h1 { color: #fff; font-size: 1.55rem; margin: 10px 0 8px; }
.assess-hero p { color: rgba(255,255,255,.92); font-size: 14px; max-width: 720px; line-height: 1.6; }
.assess-hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); padding: 6px 16px; border-radius: 50px; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; }
.assess-hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.95); }
.assess-hero-meta i { opacity: .85; margin-right: 4px; }
.assess-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px; }
.assess-card-head { text-align: center; margin-bottom: 20px; }
.assess-card-head h2 { font-size: 20px; margin-bottom: 8px; }
.assess-card-head p { font-size: 13px; color: var(--text-muted); max-width: 640px; margin: 10px auto 0; }
.assess-bar { width: 40px; height: 3px; background: var(--accent); border-radius: 2px; margin: 0 auto; }
.assess-likert-wrap { width: 100%; max-width: 100%; overflow-x: auto; margin-bottom: 8px; border-radius: var(--radius-sm); }
.assess-likert { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.assess-likert th { padding: 12px 10px; font-size: 12px; color: var(--text-muted); font-weight: 700; text-align: center; border-bottom: 2px solid var(--border); white-space: nowrap; }
.assess-likert th.assess-q-head { text-align: left; width: 45%; }
.assess-likert td { padding: 11px 10px; border-bottom: 1px solid var(--border-light); text-align: center; vertical-align: middle; }
.assess-likert tr:hover td { background: var(--accent-pale); }
.assess-likert .assess-q { text-align: left; line-height: 1.45; font-weight: 500; padding-right: 14px; }
.assess-radio { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.assess-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.assess-radio-circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); display: inline-block; transition: all .15s ease; flex-shrink: 0; }
.assess-radio:hover .assess-radio-circle { border-color: var(--accent-light); transform: scale(1.06); }
.assess-radio input:checked + .assess-radio-circle { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--bg); }
.assess-radio-label { display: none; }

/* Mobile view (< 768px): transform Likert matrix table into clear vertical card options */
@media (max-width: 767px) {
  .assess-likert-wrap { overflow-x: visible; }
  .assess-likert, .assess-likert tbody, .assess-likert tr, .assess-likert td { display: block; width: 100% !important; box-sizing: border-box; }
  .assess-likert thead { display: none; }
  .assess-likert tr { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
  .assess-likert tr:hover td { background: transparent; }
  .assess-likert td { border: none !important; padding: 0 !important; text-align: left !important; background: transparent !important; }
  .assess-likert td.assess-q { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.45; }
  .assess-radio { display: flex !important; align-items: center !alignment: center; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); width: 100%; box-sizing: border-box; transition: all .15s ease; cursor: pointer; }
  .assess-radio:hover { border-color: var(--accent-light); background: var(--accent-pale); }
  .assess-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); box-shadow: 0 2px 8px rgba(234,88,12,.15); }
  .assess-radio-label { display: inline-block !important; font-size: 13.5px; font-weight: 600; color: var(--text); }
}
.assess-mcq-list { display: flex; flex-direction: column; gap: 20px; }
.assess-mcq-q { font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.assess-opt { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: all .15s; font-size: 13.5px; }
.assess-opt:hover { border-color: var(--accent-light); background: var(--accent-pale); }
.assess-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); box-shadow: 0 2px 10px rgba(234,88,12,.15); }
.assess-opt input { accent-color: var(--accent); }
.assess-opt-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--accent); flex-shrink: 0; }
.assess-submit { position: sticky; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--bg-card); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.assess-progress { font-size: 13.5px; font-weight: 700; color: var(--text-muted); }
.assess-progress span { color: var(--accent); font-size: 16px; }
.assess-banner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #ea580c, #ff9f43); border-radius: var(--radius); padding: 20px 24px; color: #fff; margin-bottom: 24px; box-shadow: 0 12px 30px rgba(234,88,12,.25); }
.assess-banner-post { background: linear-gradient(135deg, #b45309, #f59e0b); }
.assess-banner-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.assess-banner-title { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.assess-banner-text { font-size: 13.5px; color: rgba(255,255,255,.94); line-height: 1.55; max-width: 640px; }
.assess-banner-btn { background: #fff !important; color: #ea580c !important; font-weight: 800; border: none; white-space: nowrap; }
.assess-banner-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }

/* ── Project Impact (homepage) ───────────────────────────────────────────────── */
.impact-layout { display: grid; grid-template-columns: 1.05fr 1.2fr; gap: 22px; align-items: stretch; }
.impact-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; box-shadow: 0 4px 18px rgba(0,0,0,.04);
}
.impact-card-title { font-weight: 700; font-size: 15px; margin-bottom: 18px; }
.impact-card-title i { color: var(--accent); margin-right: 6px; }
.impact-right { display: flex; flex-direction: column; gap: 14px; }
.impact-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.impact-tile {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.04); transition: transform var(--trans), box-shadow var(--trans);
}
.impact-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.impact-tile > i { color: var(--accent); font-size: 1.6rem; opacity: .85; flex-shrink: 0; }
.impact-num { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.impact-label { font-size: .74rem; font-weight: 700; color: var(--text-muted); }
.impact-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; }
.impact-people { display: flex; justify-content: space-around; gap: 10px; text-align: center; }
.impact-person-icon {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--accent-gradient, linear-gradient(135deg, #ea580c, #ff9f43));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.impact-person-num { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.impact-person-pct { color: var(--accent); font-weight: 700; font-size: .85rem; }
.impact-person-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.impact-bars { display: flex; flex-direction: column; gap: 13px; }
.impact-bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 34px; gap: 10px; align-items: center; }
.impact-bar-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.impact-bar-track { height: 10px; background: var(--bg-hover); border-radius: 5px; overflow: hidden; }
.impact-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #ff9f43, #ea580c); min-width: 4px; }
.impact-bar-num { font-size: 12.5px; font-weight: 700; text-align: right; }
@media (max-width: 960px) {
  .impact-layout { grid-template-columns: 1fr; }
  .impact-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .impact-two { grid-template-columns: 1fr; }
}

/* ── Gallery carousel (homepage) ─────────────────────────────────────────────── */
.gal-carousel { position: relative; max-width: 920px; margin: 0 auto; }
.gal-track { position: relative; height: 400px; }
.gal-slide {
  position: absolute; top: 0; left: 50%; width: 62%; height: 100%;
  border-radius: 16px; overflow: hidden; cursor: pointer;
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
  transition: transform .45s ease, opacity .45s ease;
}
.gal-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff; font-size: 13.5px; font-weight: 600;
}
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: 0 6px 16px rgba(234,88,12,.4); transition: transform var(--trans);
}
.gal-nav:hover { transform: translateY(-50%) scale(1.08); }
#galPrev { left: 0; }
#galNext { right: 0; }
.gal-dots { display: flex; justify-content: center; gap: 7px; margin-top: 22px; }
.gal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: all var(--trans); padding: 0; }
.gal-dot.active { background: var(--accent); transform: scale(1.35); }
@media (max-width: 768px) {
  .gal-track { height: 250px; }
  .gal-slide { width: 78%; }
  .gal-nav { width: 34px; height: 34px; }
}

/* ── Public gallery page ─────────────────────────────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery-item {
  position: relative; border-radius: 14px; overflow: hidden; cursor: zoom-in; margin: 0;
  border: 1px solid var(--border); background: var(--bg-card);
}
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 13px; font-weight: 600;
}
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(10,10,10,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }   /* author display beats the UA's [hidden] rule otherwise */
.lightbox img { max-width: min(1100px, 94vw); max-height: 82vh; border-radius: 10px; }
.lightbox-caption { color: #fff; margin-top: 14px; font-size: 14px; }
.lightbox-close {
  position: absolute; top: 16px; right: 22px; color: #fff; font-size: 2rem; line-height: 1;
}

/* ── Punjab SVG district map (homepage impact) ──────────────────────────────── */
.pj-map-card { overflow: visible; }
.pj-map-wrap { position: relative; max-width: 460px; margin: 0 auto; }
.pj-district {
  fill: var(--accent, #047857);
  fill-opacity: 0.25;
  stroke: var(--accent, #047857);
  stroke-width: 0.8;
  stroke-linejoin: round;
  cursor: pointer;
  transition: all .2s ease;
}
.pj-district:hover { filter: brightness(1.12) drop-shadow(0 2px 6px rgba(234,88,12,.35)); stroke-width: 2; z-index: 10; }
.pj-label {
  font-size: 7.5px; font-weight: 700; fill: #3c1a08; pointer-events: none;
  text-anchor: middle; dominant-baseline: central;
}
.pj-tooltip {
  position: absolute; z-index: 50; pointer-events: none;
  background: rgba(30, 15, 5, .92); backdrop-filter: blur(10px);
  color: #fff; border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; line-height: 1.6; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1);
  transform: translate(-50%, -110%);
  opacity: 0; transition: opacity .15s ease;
}
.pj-tooltip:not([hidden]) { opacity: 1; }
.pj-tooltip .pj-tt-name { font-weight: 800; font-size: 13px; margin-bottom: 3px; color: #fdba74; }
.pj-tooltip .pj-tt-row { display: flex; justify-content: space-between; gap: 18px; }
.pj-tooltip .pj-tt-row span:last-child { font-weight: 700; }
.dist-legend {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; font-size: 12.5px; color: var(--text-muted);
}
.dist-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.dist-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid rgba(124,45,18,.15); }

/* ── Comprehensive Mobile Responsiveness Patch ────────────────────────── */
@media (max-width: 768px) {
  /* Stack grid layouts that are still multi-column on medium screens */
  .stats-grid, .hero-stats-grid, .courses-grid, .impact-layout, .impact-two, .impact-people,
  .card-grid-3, .card-grid-4, .dash-grid-2, .dash-grid-21, .ai-layout, .ai-extra-grid,
  .field-grid, .field-grid.grid-title, .checkbox-grid, .quiz-opts, .side-layout, .mini-stat-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Prevent modals/dropdowns/sidebars from exceeding viewport width */
  .notif-dropdown, .avatar-menu { max-width: calc(100vw - 2rem); }
  .lesson-sidebar, .dash-sidebar { max-width: 100vw; }
  
  /* Ensure hero visual card scales */
  .hero-card-stack { height: auto; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
  .hero-card { position: static; animation: none; width: 100% !important; max-width: 320px; }
  .hero-card-main, .hero-card-sm { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 480px) {
  /* Fix notifications and avatar menus overflowing screen */
  .notif-dropdown, .avatar-menu { 
    position: fixed !important;
    top: 70px !important;
    left: 1rem !important;
    right: 1rem !important;
    width: auto !important;
    max-width: none !important;
  }
  
  /* Assessment responsiveness */
  .assess-hero { padding: 20px !important; }
  .assess-card { padding: 15px !important; }
  .assess-submit { flex-direction: column; text-align: center; }
  .assess-submit .btn { width: 100%; }
  
  /* Ensure typography doesn't overflow */
  .hero-title { font-size: clamp(2rem, 8vw, 3rem) !important; }
  .section-title { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  
  /* Hamburger menu item sizing */
  .nav-link { padding: 0.6rem 0.8rem; font-size: 1rem; }
  
  /* Full width container for small screens */
  .container { padding: 0 1rem; }
}

@media (max-width: 380px) {
  .btn { padding: .4rem .75rem !important; font-size: .8rem !important; }
  .hero-stat-num { font-size: 1.2rem !important; }
  .nav-extra-logos { display: none !important; } /* Hide extra logos on very small screens to make room for hamburger/avatar */
}
