@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* Anthropic Sans — Display (headings) */
@font-face { font-family: 'Anthropic Sans'; src: url('/fonts/AnthropicSans-Display-Regular-Static.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Sans'; src: url('/fonts/AnthropicSans-Display-Medium-Static.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Sans'; src: url('/fonts/AnthropicSans-Display-Semibold-Static.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Sans'; src: url('/fonts/AnthropicSans-Display-Bold-Static.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Sans'; src: url('/fonts/AnthropicSans-Display-Extrabold-Static.otf') format('opentype'); font-weight: 800; font-style: normal; font-display: swap; }

/* Anthropic Sans — Text (body, UI) */
@font-face { font-family: 'Anthropic Text'; src: url('/fonts/AnthropicSans-Text-Regular-Static.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Text'; src: url('/fonts/AnthropicSans-Text-Medium-Static.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Text'; src: url('/fonts/AnthropicSans-Text-Semibold-Static.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Text'; src: url('/fonts/AnthropicSans-Text-Bold-Static.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

/* Anthropic Serif — Text (body alt) */
@font-face { font-family: 'Anthropic Serif'; src: url('/fonts/AnthropicSerif-Text-Regular-Static.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Anthropic Serif'; src: url('/fonts/AnthropicSerif-Text-Medium-Static.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }

/* ═══════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════ */
:root {
  --dark: #141413;
  --light: #faf9f5;
  --mid-gray: #b0aea5;
  --light-gray: #e8e6dc;
  --orange: #d97757;
  --blue: #6a9bcc;
  --green: #788c5d;
  --orange-soft: rgba(217, 119, 87, 0.12);
  --blue-soft: rgba(106, 155, 204, 0.12);
  --green-soft: rgba(120, 140, 93, 0.12);
  --sidebar-width: 260px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(20, 20, 19, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 19, 0.08);
  --shadow-lg: 0 8px 32px rgba(20, 20, 19, 0.12);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Anthropic Serif', 'Anthropic Text', 'Lora', Georgia, serif;
  color: var(--dark);
  background: var(--light);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  line-height: 1.25;
  font-weight: 600;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  background: rgba(20, 20, 19, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--dark);
}

pre {
  background: var(--dark);
  color: var(--light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.75rem 0;
  max-width: 100%;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}
.copy-btn.copied {
  color: #6bcf7f;
  border-color: rgba(107, 207, 127, 0.3);
}
.copy-btn svg {
  width: 16px;
  height: 16px;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ═══════════════════════════════════════════
   GRAIN TEXTURE OVERLAY
   ═══════════════════════════════════════════ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ═══════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(217, 119, 87, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: loginGlow 8s ease-in-out infinite;
}

.login-screen::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(106, 155, 204, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: loginGlow 10s ease-in-out infinite reverse;
}

@keyframes loginGlow {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(20px, -15px); }
}

.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.login-logo h1 {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light);
  letter-spacing: -0.02em;
}

.login-logo p {
  color: var(--mid-gray);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.login-card {
  background: rgba(250, 249, 245, 0.04);
  border: 1px solid rgba(250, 249, 245, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(20px);
}

.login-card h2 {
  color: var(--light);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mid-gray);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(250, 249, 245, 0.06);
  border: 1px solid rgba(250, 249, 245, 0.1);
  border-radius: var(--radius-sm);
  color: var(--light);
  font-family: 'Anthropic Serif', 'Lora', serif;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input::placeholder {
  color: rgba(176, 174, 165, 0.5);
}

.form-group input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

.login-error {
  color: var(--orange);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 500;
}

.login-error.visible { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: var(--orange);
  color: var(--light);
}

.btn-primary:hover {
  background: #c4684b;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(217, 119, 87, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--light-gray);
  color: var(--dark);
}

.btn-secondary:hover {
  background: var(--light-gray);
}

.btn-ghost {
  background: transparent;
  color: var(--mid-gray);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost:hover { color: var(--dark); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: rgba(176, 174, 165, 0.6);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════ */
.app-shell {
  display: none;
  min-height: 100vh;
}

.app-shell.active {
  display: flex;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--dark);
  color: var(--light);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(250, 249, 245, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--light);
  letter-spacing: -0.01em;
}

.sidebar-brand-text span {
  font-size: 0.72rem;
  color: var(--mid-gray);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--mid-gray);
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--light);
  background: rgba(250, 249, 245, 0.05);
}

.nav-item.active {
  color: var(--light);
  background: rgba(217, 119, 87, 0.15);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg { opacity: 1; }

.nav-divider {
  height: 1px;
  background: rgba(250, 249, 245, 0.06);
  margin: 0.5rem 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(250, 249, 245, 0.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--light);
  flex-shrink: 0;
}

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

.user-details .name {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .points {
  font-size: 0.75rem;
  color: var(--green);
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 500;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--mid-gray);
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.logout-btn:hover { color: var(--orange); }

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
}

.page-header {
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--light-gray);
  background: var(--light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--dark);
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.page-body {
  padding: 2rem 2.5rem 3rem;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */
.progress-section {
  margin-bottom: 2rem;
}

.progress-stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.progress-stats .completed-count {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}

.progress-stats .points-total {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}

.progress-bar-track {
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
}

/* ═══════════════════════════════════════════
   TASK SECTIONS
   ═══════════════════════════════════════════ */
.tasks-section-label {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-gray);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.tasks-section-label:first-of-type { margin-top: 0; }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════
   TASK CARD
   ═══════════════════════════════════════════ */
.task-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  animation: taskSlideIn 0.3s ease both;
}

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

.task-card:hover {
  border-color: var(--mid-gray);
  box-shadow: var(--shadow-sm);
}

.task-card.completed {
  opacity: 0.65;
  border-color: var(--light-gray);
}

.task-card.completed:hover {
  opacity: 0.85;
}

/* Locked (gated) task cards */
.task-card.locked {
  opacity: 0.45;
  border-color: var(--light-gray);
}

.task-card.locked .task-header {
  cursor: not-allowed;
}

.task-card.locked:hover {
  border-color: var(--light-gray);
  box-shadow: none;
  opacity: 0.5;
}

.task-card.locked .task-status-icon {
  background: rgba(232, 230, 220, 0.6);
}

.locked-hint {
  color: var(--mid-gray) !important;
  font-style: italic !important;
  font-size: 0.8rem !important;
}

.task-card.completed .task-header {
  background: var(--green-soft);
}

.task-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

/* Task status icon (chevron / checkmark) */
.task-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--light-gray);
  transition: var(--transition);
}

.task-status-icon svg {
  width: 14px;
  height: 14px;
  color: var(--mid-gray);
  transition: var(--transition);
}

.task-card.expanded .task-status-icon:not(.done) svg {
  transform: rotate(180deg);
}

.task-status-icon.done {
  background: var(--green);
}

.task-status-icon.done svg {
  color: white;
}

/* "I'm done" / "Completed" toggle button */
.task-done-bar {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-gray);
  display: flex;
  justify-content: flex-end;
}

.btn-done {
  background: var(--green);
  color: white;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-done:hover {
  background: #6a7d50;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(120, 140, 93, 0.3);
}

.btn-done.is-completed {
  background: transparent;
  border: 1px solid var(--light-gray);
  color: var(--mid-gray);
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
}

.btn-done.is-completed:hover {
  border-color: var(--mid-gray);
  color: var(--dark);
  background: rgba(232, 230, 220, 0.2);
  transform: none;
  box-shadow: none;
}

.btn-done.is-completed svg {
  color: var(--green);
}

.task-info { flex: 1; min-width: 0; }

.task-title {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}

.completed .task-title {
  text-decoration: line-through;
  color: var(--mid-gray);
}

.task-subtitle {
  font-size: 0.82rem;
  color: var(--dark);
  margin-top: 0.15rem;
  font-style: italic;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.task-points {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

.task-points.core {
  background: var(--orange-soft);
  color: var(--orange);
}

.task-points.bonus {
  background: var(--blue-soft);
  color: var(--blue);
}

/* (expand icon now integrated into task-status-icon) */

.task-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-card.expanded .task-body {
  max-height: 3000px;
}

.task-body-inner {
  padding: 0 1.25rem 1.25rem;
  padding-left: calc(1.25rem + 22px + 0.85rem);
  border-top: 1px solid var(--light-gray);
  padding-top: 1rem;
}

.task-body-inner p {
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

.task-body-inner ul, .task-body-inner ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.task-body-inner li {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0.3rem;
}

.task-body-inner h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.task-body-inner h4:first-child { margin-top: 0; }

.task-tip {
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

.task-note {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

/* ═══════════════════════════════════════════
   PREREQUISITES BANNER
   ═══════════════════════════════════════════ */
.prereqs-banner {
  background: linear-gradient(135deg, var(--dark) 0%, #1e1e1d 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  color: var(--light);
}

.prereqs-banner h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--orange);
}

.prereqs-banner ul {
  list-style: none;
  padding: 0;
}

.prereqs-banner > ul > li {
  font-size: 0.9rem;
  padding: 0.3rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--light-gray);
}

.prereqs-banner > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.permissions-note {
  background: rgba(250, 249, 245, 0.06);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--mid-gray);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.permissions-note strong { color: var(--light); }
.permissions-note code {
  color: var(--light-gray);
  background: rgba(250, 249, 245, 0.08);
}
.prereqs-banner code {
  color: var(--light-gray);
  background: rgba(250, 249, 245, 0.08);
}

/* ═══════════════════════════════════════════
   PINNED REFERENCE CARD
   ═══════════════════════════════════════════ */
.reference-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.reference-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  user-select: none;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
  transition: var(--transition);
}

.reference-header:hover { color: var(--dark); }

.reference-header svg:first-child {
  flex-shrink: 0;
  opacity: 0.5;
}

.reference-header span { flex: 1; }

.reference-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.reference-card.expanded .reference-chevron {
  transform: rotate(180deg);
}

.reference-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.reference-card.expanded .reference-body {
  max-height: 2000px;
}

.reference-body-inner {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--light-gray);
  padding-top: 1rem;
}

.reference-body-inner h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.reference-body-inner h4:first-child { margin-top: 0; }

.reference-body-inner p, .reference-body-inner li {
  font-size: 0.92rem;
  line-height: 1.65;
}

.reference-body-inner ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ═══════════════════════════════════════════
   LEADERBOARD
   ═══════════════════════════════════════════ */
.leaderboard-wrapper {
  max-width: 100%;
}

.leaderboard-table {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--light-gray);
  overflow: hidden;
}

.leaderboard-table thead th {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-gray);
  padding: 0.85rem 1.25rem;
  text-align: left;
  background: rgba(232, 230, 220, 0.3);
  border-bottom: 1px solid var(--light-gray);
}

.leaderboard-table tbody tr {
  transition: var(--transition);
  animation: leaderboardRowIn 0.4s ease both;
}

.leaderboard-table tbody tr:nth-child(n) {
  animation-delay: calc(0.05s * var(--row-index, 0));
}

@keyframes leaderboardRowIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.leaderboard-table tbody tr:hover {
  background: rgba(232, 230, 220, 0.2);
}

.leaderboard-table tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(232, 230, 220, 0.5);
  font-size: 0.92rem;
}

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

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
}

.rank-1 { background: linear-gradient(135deg, #f7d774, #e6b422); color: #5c4813; }
.rank-2 { background: linear-gradient(135deg, #d0d0d0, #a8a8a8); color: #4a4a4a; }
.rank-3 { background: linear-gradient(135deg, #e0a87a, #c78547); color: #5c3d1e; }
.rank-other { background: var(--light-gray); color: var(--mid-gray); }

.leaderboard-name {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--dark);
}

.leaderboard-points {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--green);
  font-size: 1rem;
}

.leaderboard-tasks {
  color: var(--mid-gray);
  font-size: 0.85rem;
}

.leaderboard-bar-cell {
  width: 35%;
}

.leaderboard-bar {
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
}

.leaderboard-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--green));
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leaderboard-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auto-refresh-label {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.8rem;
  color: var(--mid-gray);
}

.leaderboard-empty {
  text-align: center;
  padding: 6rem 3rem;
  color: var(--mid-gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.leaderboard-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════
   ADMIN TABLE
   ═══════════════════════════════════════════ */
.admin-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-family: 'Anthropic Serif', 'Lora', serif;
  font-size: 0.9rem;
  background: white;
  outline: none;
  transition: var(--transition);
}

.admin-search:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.admin-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.admin-stat-card .stat-label {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-gray);
  margin-bottom: 0.35rem;
}

.admin-stat-card .stat-value {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
}

.admin-stat-card .stat-value.orange { color: var(--orange); }
.admin-stat-card .stat-value.green { color: var(--green); }
.admin-stat-card .stat-value.blue { color: var(--blue); }

.admin-table-wrapper {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead th {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-gray);
  padding: 0.85rem 1.25rem;
  text-align: left;
  background: rgba(232, 230, 220, 0.3);
  border-bottom: 1px solid var(--light-gray);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-table thead th:hover { color: var(--dark); }
.admin-table thead th .sort-arrow { margin-left: 0.25rem; }

.admin-table tbody td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(232, 230, 220, 0.5);
  font-size: 0.9rem;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(232, 230, 220, 0.15); }

/* Admin histogram & completion cards */
.admin-histogram-card,
.admin-completion-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card-header {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mid-gray);
  margin-bottom: 1.25rem;
}

.admin-histogram {
  display: flex;
  align-items: flex-end;
  gap: 0;
  height: 220px;
  padding: 0 0.25rem;
}

.histogram-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.histogram-count {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.histogram-bar-wrapper {
  width: 60%;
  max-width: 40px;
  height: 140px;
  display: flex;
  align-items: flex-end;
}

.histogram-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.histogram-label {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dark);
  margin-top: 0.5rem;
  text-align: center;
  white-space: nowrap;
}

.histogram-sublabel {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--mid-gray);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

.admin-completion-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-completion-track {
  flex: 1;
  height: 20px;
  background: var(--light-gray);
  border-radius: 10px;
  overflow: hidden;
}

.admin-completion-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--green));
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-completion-pct {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green);
  min-width: 50px;
}

.admin-login-card {
  max-width: 400px;
  margin: 3rem auto;
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 2rem;
}

.admin-login-card h2 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  color: var(--dark);
}

.admin-login-card .form-group input {
  background: var(--light);
  color: var(--dark);
  border-color: var(--light-gray);
}

.admin-login-card .form-group input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.admin-login-card .login-error { color: var(--orange); }

/* ═══════════════════════════════════════════
   CAST MODE (Leaderboard fullscreen for projection)
   ═══════════════════════════════════════════ */
.cast-mode { background: var(--dark); }
.cast-mode .sidebar { display: none; }
.cast-mode .main-content { margin-left: 0; }
.cast-mode .page-header {
  text-align: center;
  background: var(--dark);
  border-bottom-color: rgba(250, 249, 245, 0.06);
  padding: 2.5rem 2.5rem 1.5rem;
}
.cast-mode .page-header h1 {
  color: var(--light);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.cast-mode .page-header p { color: var(--mid-gray); font-size: 1rem; }
.cast-mode .page-body { background: var(--dark); }
.cast-mode .leaderboard-wrapper { max-width: 1100px; margin: 0 auto; }
.cast-mode .leaderboard-refresh-bar { display: none; }
.cast-mode .leaderboard-table {
  font-size: 1.15rem;
  background: rgba(250, 249, 245, 0.03);
  border-color: rgba(250, 249, 245, 0.06);
}
.cast-mode .leaderboard-table thead th {
  font-size: 0.85rem;
  padding: 1.1rem 1.75rem;
  background: rgba(250, 249, 245, 0.04);
  color: var(--mid-gray);
  border-bottom-color: rgba(250, 249, 245, 0.06);
}
.cast-mode .leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(250, 249, 245, 0.04);
  animation: none;
}
.cast-mode .leaderboard-table tbody tr:hover {
  background: rgba(217, 119, 87, 0.06);
}
.cast-mode .leaderboard-table tbody td {
  padding: 1.15rem 1.75rem;
  border-bottom-color: rgba(250, 249, 245, 0.04);
  color: var(--light-gray);
}
.cast-mode .leaderboard-name { color: var(--light); font-size: 1.15rem; }
.cast-mode .leaderboard-points { font-size: 1.35rem; color: var(--green); }
.cast-mode .rank-badge { width: 44px; height: 44px; font-size: 1.05rem; }
.cast-mode .leaderboard-bar { background: rgba(250, 249, 245, 0.06); }
.cast-mode .leaderboard-bar-fill {
  background: linear-gradient(90deg, var(--orange), var(--green));
  box-shadow: 0 0 8px rgba(217, 119, 87, 0.3);
}
/* Cast mode stats bar */
.cast-stats-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  background: rgba(250, 249, 245, 0.03);
  border: 1px solid rgba(250, 249, 245, 0.06);
  border-radius: var(--radius);
}

.cast-stat {
  text-align: center;
}

.cast-stat-value {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--light);
  line-height: 1.1;
}

.cast-stat-label {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-gray);
  margin-top: 0.25rem;
}

.cast-stat-progress {
  flex: 1;
  text-align: left;
}

.cast-progress-track {
  height: 12px;
  background: rgba(250, 249, 245, 0.06);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
}

.cast-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--green));
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(217, 119, 87, 0.3);
}

.cast-mode .main-content { max-width: 100vw; }
.cast-mode .leaderboard-empty { color: var(--mid-gray); }

.cast-exit-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  background: rgba(250, 249, 245, 0.08);
  border: 1px solid rgba(250, 249, 245, 0.12);
  color: var(--mid-gray);
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: none;
}

.cast-exit-btn:hover {
  background: rgba(250, 249, 245, 0.15);
  color: var(--light);
}

.cast-mode .cast-exit-btn { display: block; }

/* Live pulse indicator */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: var(--green-soft);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.cast-mode .live-badge {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
}

.cast-mode .live-dot { width: 9px; height: 9px; }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--light);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             toastOut 0.3s ease 2.2s forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.toast.success {
  background: var(--green);
}

.toast.undo {
  background: var(--mid-gray);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ═══════════════════════════════════════════
   CLAWD CELEBRATION OVERLAY
   ═══════════════════════════════════════════ */
.clawd-celebration {
  position: fixed;
  bottom: -200px;
  right: 2rem;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: none;
}

.clawd-celebration img {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.15));
}

.clawd-celebration.active {
  animation: clawdBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             clawdBounceOut 0.4s ease 1.8s forwards;
}

@keyframes clawdBounceIn {
  0% { opacity: 0; bottom: -200px; transform: scale(0.5) rotate(-10deg); }
  60% { opacity: 1; bottom: 2rem; transform: scale(1.1) rotate(3deg); }
  100% { opacity: 1; bottom: 1.5rem; transform: scale(1) rotate(0deg); }
}

@keyframes clawdBounceOut {
  0% { opacity: 1; bottom: 1.5rem; transform: scale(1); }
  100% { opacity: 0; bottom: -200px; transform: scale(0.6) rotate(10deg); }
}

/* ═══════════════════════════════════════════
   CLAWD MASCOT ON DASHBOARD
   ═══════════════════════════════════════════ */
.clawd-mascot {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--orange-soft);
  border: 1px solid rgba(217, 119, 87, 0.15);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.clawd-mascot img {
  width: 64px;
  height: auto;
  flex-shrink: 0;
}

.clawd-mascot .clawd-text {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--dark);
  line-height: 1.5;
}

.clawd-mascot .clawd-text strong {
  font-weight: 700;
  color: var(--orange);
}

/* ═══════════════════════════════════════════
   MOBILE HAMBURGER
   ═══════════════════════════════════════════ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--dark);
  color: var(--light);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.5);
  z-index: 90;
}

/* ═══════════════════════════════════════════
   LOADING & SPINNER
   ═══════════════════════════════════════════ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(217, 119, 87, 0.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 0.75rem;
  color: var(--mid-gray);
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════
   ADVANCED WORKFLOWS TABS (Step 12)
   ═══════════════════════════════════════════ */
.adv-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--light-gray);
  margin-bottom: 0;
  overflow-x: auto;
}

.adv-tab {
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  color: var(--mid-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
}

.adv-tab:hover {
  color: var(--dark);
  background: rgba(232, 230, 220, 0.2);
}

.adv-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.adv-panels {
  border: 1px solid var(--light-gray);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: white;
}

.adv-panel {
  display: none;
  padding: 1.25rem;
}

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

.adv-panel h4 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem;
  font-size: 0.95rem !important;
}

/* Collapsible "Try it" exercise */
.adv-tryit {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
  overflow: hidden;
}

.adv-tryit-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-family: 'Anthropic Sans', 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
  cursor: pointer;
  user-select: none;
  background: var(--orange-soft);
  transition: var(--transition);
}

.adv-tryit-toggle:hover {
  background: rgba(217, 119, 87, 0.12);
}

.adv-tryit-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.adv-tryit.open .adv-tryit-toggle svg {
  transform: rotate(180deg);
}

.adv-tryit-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.adv-tryit.open .adv-tryit-body {
  max-height: 800px;
}

.adv-tryit-body > :first-child {
  margin-top: 0.85rem;
}

.adv-tryit-body {
  padding: 0 0.85rem;
}

.adv-tryit.open .adv-tryit-body {
  padding-bottom: 0.85rem;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .mobile-overlay.open { display: block; }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }

  .page-header {
    padding: 1.25rem 1.25rem 1rem;
    padding-top: 3.5rem;
  }

  .page-body {
    padding: 1.25rem;
  }

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

  .task-body-inner {
    padding-left: 1.25rem;
  }

  .leaderboard-bar-cell { display: none; }
}
