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

:root {
  /* Brand — upskilling.work blue palette */
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-900: #1e3a8a;
  --brand-950: #172554;

  /* Slate dark scale */
  --bg:        #020617;   /* slate-950 */
  --surface:   #0f172a;   /* slate-900 */
  --surface-2: #1e293b;   /* slate-800 */
  --border:    #1e293b;   /* slate-800 */
  --border-2:  #334155;   /* slate-700 */

  /* Text */
  --text:      #f8fafc;   /* slate-50  */
  --muted:     #94a3b8;   /* slate-400 */
  --muted-2:   #64748b;   /* slate-500 */

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --glow:      0 0 24px rgba(37,99,235,0.25);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Background grid (upskilling.work pattern) ─────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right,  rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; }

/* ─── Topbar ────────────────────────────────────────────────────────── */
.topbar {
  background: rgba(2,6,23,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1.5rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.4px;
}

.brand-icon { color: var(--brand-500); font-size: 1.2rem; }
.brand-name { letter-spacing: -0.5px; }

.topbar-nav { display: flex; gap: 0.25rem; flex: 1; }

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: var(--surface-2); color: var(--text); }

.avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-600), #7c3aed);
  color: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.72rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  overflow: hidden;
}

/* ─── Layout ────────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ─── Home ──────────────────────────────────────────────────────────── */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: rgba(37,99,235,0.12);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: 0.4rem; line-height: 1.2; }
.hero p { color: var(--muted); font-size: 0.95rem; }
.brand-highlight {
  background: linear-gradient(to right, var(--brand-400), #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats { display: flex; gap: 1rem; flex-wrap: wrap; position: relative; }

.stat-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 100px;
}
.stat-box.large {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 130px;
}

.stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* ─── Course Card ───────────────────────────────────────────────────── */
.course-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-600);
  box-shadow: var(--glow);
}

.course-card-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-icon { font-size: 2.5rem; }
.course-icon-lg { font-size: 3rem; flex-shrink: 0; }

.course-badges { display: flex; gap: 0.4rem; flex-direction: column; align-items: flex-end; }

.badge {
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.course-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.course-card-body h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--text); }
.course-subtitle { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.75rem; }
.course-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.55; margin-bottom: 1rem; }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.progress-bar-bg {
  flex: 1;
  background: var(--surface-2);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-bg.wide { height: 7px; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.progress-label { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.btn-primary {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 99px;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s, transform 0.15s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: 0.88; transform: scale(1.02); }

/* ─── Course View ───────────────────────────────────────────────────── */
.view-course { max-width: 800px; margin: 0 auto; }

.course-topbar, .lesson-topbar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-back {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.btn-back:hover { background: var(--surface-2); color: var(--text); }

.lesson-breadcrumb { color: var(--muted-2); font-size: 0.82rem; }

.course-hero {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
}
.course-hero h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--text); }
.course-hero p { color: var(--muted); font-size: 0.875rem; margin-bottom: 1rem; }

.module-block {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.85rem;
  transition: border-color 0.15s;
}
.module-block:hover { border-color: var(--border-2); }

.module-header {
  padding: 0.85rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.module-header h3 { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.module-count {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.lesson-item:last-child { border-bottom: none; }
.lesson-item:hover { background: var(--surface-2); }
.lesson-item.done { background: rgba(37,99,235,0.06); }
.lesson-item.done:hover { background: rgba(37,99,235,0.1); }

.lesson-status { font-size: 0.95rem; width: 20px; text-align: center; }
.lesson-info { flex: 1; }
.lesson-title { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.lesson-duration { font-size: 0.75rem; color: var(--muted); }
.lesson-arrow { color: var(--muted-2); font-size: 1.1rem; }

/* ─── Lesson View ───────────────────────────────────────────────────── */
.view-lesson { max-width: 1050px; margin: 0 auto; }

.lesson-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .lesson-body { grid-template-columns: 1fr; }
}

.lesson-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  min-width: 0;
  overflow-x: hidden;
}

/* ─── Prose (Markdown rendered) ────────────────────────────────────── */
.prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.3;
}
.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
  color: var(--brand-400);
  letter-spacing: 0.01em;
}
.prose h2 + h3 { margin-top: 1rem; }

.prose p {
  margin-bottom: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}
.prose p:last-child { margin-bottom: 0; }

.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--muted); font-style: italic; }

.prose code {
  font-family: 'Fira Code', "SF Mono", monospace;
  font-size: 0.82em;
  background: var(--surface-2);
  color: var(--brand-400);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.prose ul, .prose ol {
  margin: 0.5rem 0 1rem 1.25rem;
  color: var(--muted);
}
.prose li { margin-bottom: 0.35rem; line-height: 1.65; }
.prose li strong { color: var(--text); }

/* Blockquote → callout box */
.prose blockquote {
  background: rgba(37,99,235,0.07);
  border-left: 3px solid var(--brand-500);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 1.1rem 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-style: normal;
}
.prose blockquote p { margin: 0; color: inherit; }
.prose blockquote strong { color: var(--brand-400); }

/* Fenced code block — marked outputs <pre><code class="language-*"> */
.prose pre {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0.85rem 0 1.1rem;
  overflow-x: auto;
  max-width: 100%;
}
.prose pre code {
  font-family: 'Fira Code', "SF Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #e2e8f0;
  background: none;
  border: none;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Markdown table */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.85rem 0 1.1rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: table;
}
.prose thead tr { background: var(--surface-2); }
.prose th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prose td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.5;
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ─── Quiz ──────────────────────────────────────────────────────────── */
.lesson-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }

.quiz-card, .nav-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.quiz-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.quiz-question { font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem; color: var(--muted); line-height: 1.5; }

.quiz-options { display: flex; flex-direction: column; gap: 0.45rem; }

.quiz-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  text-align: left;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.quiz-btn:hover:not(:disabled) {
  border-color: var(--brand-500);
  background: rgba(37,99,235,0.08);
  color: var(--text);
}
.quiz-btn:disabled { cursor: not-allowed; }
.quiz-btn.correct { border-color: #22c55e; background: rgba(34,197,94,0.08); color: #4ade80; }
.quiz-btn.wrong   { border-color: #ef4444; background: rgba(239,68,68,0.08);   color: #f87171; }

.quiz-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
  color: var(--muted);
}

.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.hidden { display: none; }
.correct-fb { background: rgba(34,197,94,0.08);  border: 1px solid rgba(34,197,94,0.3);  color: #4ade80; }
.wrong-fb   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }

/* ─── Nav Card ──────────────────────────────────────────────────────── */
.nav-card { display: flex; flex-direction: column; gap: 0.6rem; }

.badge-done {
  background: rgba(34,197,94,0.08);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.btn-nav {
  padding: 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  text-align: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.btn-nav:hover { background: var(--border); color: var(--text); }
.btn-nav.primary {
  background: var(--brand-600);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-nav.primary:hover { background: var(--brand-500); }

.btn-complete {
  padding: 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--brand-600);
  background: transparent;
  color: var(--brand-400);
  font-weight: 600;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-complete:hover:not(:disabled) { background: rgba(37,99,235,0.15); color: var(--text); }
.btn-complete:disabled { opacity: 0.35; cursor: not-allowed; border-color: var(--muted); color: var(--muted); }
.btn-complete.done {
  background: var(--brand-600);
  color: white;
  border-color: transparent;
  cursor: default;
}

/* ─── Feedback button & modal ───────────────────────────────────────── */
.btn-feedback {
  width: 100%;
  padding: 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--brand-600);
  background: transparent;
  color: var(--brand-400);
  font-weight: 600;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-feedback:hover { background: rgba(37,99,235,0.15); color: var(--text); }

.feedback-stars { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.star-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--border);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.1s, transform 0.1s;
}
.star-btn:hover, .star-btn.active { color: #f59e0b; }
.star-btn:hover { transform: scale(1.15); }

.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.feedback-textarea:focus { border-color: var(--brand-500); }

.feedback-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-600);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 9999;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ─── Progress View ─────────────────────────────────────────────────── */
.view-progress h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text); }

.prog-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.prog-course-block {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}
.prog-course-block:hover { border-color: var(--border-2); }

.prog-course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}

.prog-chevron {
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
  display: inline-block;
}

.prog-modules { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.prog-mod-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
}
.prog-count { font-weight: 400; color: var(--muted); }
.prog-lesson { font-size: 0.85rem; padding: 0.25rem 0; color: var(--muted-2); }
.prog-lesson.done { color: #4ade80; }

.btn-danger {
  margin-top: 1rem;
  padding: 0.6rem 1.25rem;
  border-radius: 99px;
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  color: #f87171;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  transition: background 0.15s;
}

/* ─── Admin ───────────────────────────────────────────────────────────── */
.view-admin { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; }
.admin-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.4rem; margin: 0; flex: 1; }
.admin-course-list { display: flex; flex-direction: column; gap: 0.6rem; }
.admin-course-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.admin-course-row:hover { border-color: var(--brand-500); background: var(--surface-2); }
.admin-course-info { flex: 1; }
.admin-course-info strong { display: block; font-size: 0.95rem; }
.admin-course-info span { font-size: 0.78rem; color: var(--muted); }
.admin-course-arrow { color: var(--muted); font-size: 1.1rem; }

/* ─── Edit Course ─────────────────────────────────────────────────────── */
.view-edit-course { max-width: 860px; margin: 0 auto; padding: 0 1.5rem 4rem; }

.edit-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.edit-topbar-title { font-size: 0.95rem; font-weight: 600; color: var(--muted); flex: 1; text-align: center; }

.edit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; margin-bottom: 1.25rem;
}
.edit-section-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted-2); text-transform: uppercase; margin-bottom: 1.25rem;
}
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.edit-full { grid-column: 1 / -1; }

.edit-field { display: flex; flex-direction: column; gap: 0.3rem; }
.edit-field label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.edit-field input,
.edit-field textarea,
.edit-field select {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 0.5rem 0.7rem;
  color: var(--text); font-family: var(--font); font-size: 0.88rem;
  transition: border-color 0.2s;
}
.edit-field input:focus,
.edit-field textarea:focus { outline: none; border-color: var(--brand-500); }
.edit-field textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.edit-field input[type="color"] { padding: 0.15rem 0.3rem; height: 2.2rem; cursor: pointer; }

/* Toggle switch */
.edit-toggle-row { flex-direction: row; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.toggle-label { font-size: 0.9rem; color: var(--text); }
.toggle-description { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-2); border-radius: 24px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Lesson blocks inside edit-course */
.edit-lesson-block { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.6rem; overflow: hidden; }
.edit-lesson-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; background: var(--bg); cursor: pointer;
  transition: background 0.15s;
}
.edit-lesson-header:hover { background: var(--surface); }
.edit-lesson-num { font-size: 0.72rem; font-weight: 700; color: var(--muted-2); min-width: 1.6rem; }
.edit-lesson-title-preview { flex: 1; font-size: 0.9rem; }
.edit-chevron { color: var(--muted); transition: transform 0.2s; }

.edit-lesson-body { display: none; padding: 1.25rem; border-top: 1px solid var(--border); }
.edit-lesson-body.open { display: block; }

/* Quiz editor */
.quiz-editor {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.1rem; margin-top: 1rem;
}
.quiz-editor h4 { margin: 0 0 0.9rem; font-size: 0.82rem; color: var(--muted); }
.quiz-option-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.quiz-opt-letter { font-weight: 700; min-width: 1.1rem; color: var(--muted); }
.quiz-option-row input[type="text"] { flex: 1; }
.quiz-correct-label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; white-space: nowrap; cursor: pointer; color: var(--muted); }
.quiz-correct-label input { cursor: pointer; }

.btn-edit-content {
  display: inline-block; margin-bottom: 0.9rem;
  background: transparent; border: 1px solid var(--border-2);
  border-radius: 6px; padding: 0.4rem 0.9rem;
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  font-family: var(--font); transition: border-color 0.2s, color 0.2s;
}
.btn-edit-content:hover { border-color: var(--brand-500); color: var(--brand-400); }

.btn-save {
  background: var(--brand-600); color: #fff; border: none;
  border-radius: 7px; padding: 0.45rem 1.2rem;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: background 0.2s;
  white-space: nowrap;
}
.btn-save:hover { background: var(--brand-500); }
.btn-save:disabled { opacity: 0.5; cursor: default; }

/* ─── Edit Lesson (Markdown editor) ─────────────────────────────────── */
.view-edit-lesson { display: flex; flex-direction: column; height: calc(100vh - 60px); }

.edit-lesson-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 1rem;
}
.edit-breadcrumb { font-size: 0.82rem; color: var(--muted); flex: 1; text-align: center; }

.editor-split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; overflow: hidden; min-height: 0; }
.editor-pane { display: flex; flex-direction: column; overflow: hidden; }
.editor-pane > label {
  padding: 0.45rem 1rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.editor-pane textarea {
  flex: 1; padding: 1.25rem; background: var(--bg);
  border: none; border-right: 1px solid var(--border);
  color: var(--text); font-family: 'Fira Code', monospace;
  font-size: 0.83rem; line-height: 1.7; resize: none; outline: none;
}
.editor-preview { flex: 1; overflow-y: auto; padding: 1.5rem; background: var(--surface); }

/* ─── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.75rem; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2);
  padding: 0.6rem 1.4rem; border-radius: 8px;
  font-size: 0.875rem; z-index: 9999;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; }
.toast-error { border-color: #f87171; background: #1f0f0f; }
.btn-danger:hover { background: rgba(239,68,68,0.15); }

/* ─── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 2rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 1rem;
  transform: translateY(8px); transition: transform 0.2s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.modal-body { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }
.modal-input {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem; color: var(--text); font-size: 0.875rem;
  font-family: var(--font); outline: none; transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--brand-500); }
.modal-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.25rem;
}
.modal-btn {
  padding: 0.5rem 1.1rem; border-radius: 8px; border: none;
  font-size: 0.875rem; font-family: var(--font); cursor: pointer;
  font-weight: 500; transition: background 0.15s;
}
.modal-btn-cancel {
  background: transparent; border: 1px solid var(--border-2); color: var(--muted);
}
.modal-btn-cancel:hover { background: var(--surface-2); }
.modal-btn-confirm { background: var(--brand-600); color: #fff; }
.modal-btn-confirm:hover { background: var(--brand-500); }
.modal-btn-danger {
  background: rgba(239,68,68,0.15); color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.modal-btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ─── Add / Delete buttons ───────────────────────────────────────────────── */
.btn-add {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.75rem;
  background: transparent; border: 1px dashed var(--border-2);
  border-radius: 7px; padding: 0.45rem 1rem;
  font-size: 0.83rem; color: var(--muted); cursor: pointer;
  font-family: var(--font); width: 100%; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.btn-add:hover { border-color: var(--brand-500); color: var(--brand-400); }
.btn-add-module {
  margin-top: 0; border-radius: 10px; padding: 0.65rem 1rem;
  border-style: dashed;
}

.btn-icon-danger {
  background: transparent; border: none; cursor: pointer;
  font-size: 0.95rem; padding: 0.2rem 0.35rem; border-radius: 5px;
  transition: background 0.15s; flex-shrink: 0;
  opacity: 0.5;
}
.btn-icon-danger:hover { background: rgba(239,68,68,0.15); opacity: 1; }

.btn-text-danger {
  background: transparent; border: none; cursor: pointer;
  font-size: 0.78rem; color: #f87171; font-family: var(--font);
  padding: 0.3rem 0.5rem; border-radius: 5px; white-space: nowrap;
  transition: background 0.15s; flex-shrink: 0;
  opacity: 0.7;
}
.btn-text-danger:hover { background: rgba(239,68,68,0.1); opacity: 1; }

/* Module header row (title input + delete btn) */
.edit-module-header {
  display: flex; align-items: flex-end; gap: 1rem;
  margin-bottom: 1rem;
}

/* ─── Login screen ───────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  background-image:
    linear-gradient(to right,  rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 0.75rem;
}

.login-brand {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.login-brand .brand-icon { color: var(--brand-500); font-size: 1.3rem; }
.login-brand .brand-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }

.login-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.login-sub   { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.5; }

.login-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

.login-form input {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 8px; padding: 0.75rem 1rem;
  color: var(--text); font-family: var(--font); font-size: 1rem;
  transition: border-color 0.2s; width: 100%;
}
.login-form input:focus { outline: none; border-color: var(--brand-500); }

#login-code {
  font-family: 'Fira Code', monospace; font-size: 1.6rem;
  letter-spacing: 0.4em; text-align: center;
}

.btn-login {
  background: var(--brand-600); color: #fff; border: none;
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: background 0.2s; width: 100%;
}
.btn-login:hover  { background: var(--brand-500); }
.btn-login:disabled { opacity: 0.5; cursor: default; }

.login-error {
  font-size: 0.82rem; color: #f87171; min-height: 1.1rem; text-align: center;
}

.login-timer {
  font-size: 0.8rem; color: var(--muted); text-align: center;
  font-variant-numeric: tabular-nums;
}
.login-timer.expired { color: #f87171; }

.btn-login-back {
  background: transparent; border: none; cursor: pointer;
  font-size: 0.82rem; color: var(--muted); font-family: var(--font);
  text-align: center; padding: 0.25rem;
  transition: color 0.2s;
}
.btn-login-back:hover { color: var(--text); }

/* ─── User menu dropdown ─────────────────────────────────────────────── */
.user-menu { position: relative; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dropdown-email {
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.user-dropdown-item:hover { background: var(--surface-2); }
.user-dropdown-item--danger { color: #f87171; }
.user-dropdown-item--danger:hover { background: rgba(248,113,113,0.08); }

/* ─── Users management view ──────────────────────────────────────────────── */
.view-users { max-width: 720px; margin: 0 auto; padding-bottom: 3rem; }

.edit-input {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 7px; padding: 0.5rem 0.75rem;
  color: var(--text); font-family: var(--font); font-size: 0.88rem;
  outline: none; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
}
.edit-input:focus { border-color: var(--brand-500); }
.edit-input option { background: var(--surface-2); color: var(--text); }
select.edit-input {
  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 fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

.user-add-form {
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
}
.user-add-form .edit-input { flex: 1; min-width: 180px; }

.user-list { display: flex; flex-direction: column; gap: 0.4rem; }

.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
  transition: background 0.15s;
}
.user-row--clickable { cursor: pointer; }
.user-row--clickable:hover { background: var(--border-2); }
.user-row-info { display: flex; align-items: center; gap: 0.75rem; }
.user-row-actions { display: flex; align-items: center; gap: 0.4rem; }
.user-row-chevron { font-size: 0.8rem; color: var(--muted); margin-right: 0.25rem; }
.user-row-email { font-size: 0.88rem; color: var(--text); }

.user-role-badge {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem; border-radius: 99px;
}
.user-role-badge--admin     { background: rgba(251,191,36,0.18); color: #fbbf24; }
.user-role-badge--editor    { background: rgba(139,92,246,0.18); color: #a78bfa; }
.user-role-badge--student   { background: rgba(99,179,237,0.15); color: #63b3ed; }
.user-role-badge--recruiter { background: rgba(52,211,153,0.15); color: #34d399; }
.user-role-badge--demo      { background: rgba(251,146,60,0.18);  color: #fb923c; }

.form-error { font-size: 0.82rem; color: #f87171; margin-top: 0.5rem; }

.btn-secondary {
  background: transparent; border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 0.4rem 0.9rem;
  font-size: 0.82rem; color: var(--muted); cursor: pointer;
  font-family: var(--font); transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--brand-500); color: var(--brand-400); }

/* ─── Student Progress View ──────────────────────────────────────────────── */
.view-student-progress { max-width: 800px; margin: 0 auto; padding-bottom: 3rem; }

.sp-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem; color: var(--muted);
  margin-bottom: 1.5rem;
}

.sp-student-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.sp-student-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
}
.sp-student-email { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.sp-student-pct   { font-size: 1rem; font-weight: 700; color: var(--brand-400); }

.sp-bar { margin-bottom: 0.5rem; }

.sp-stat { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }

.sp-details { margin-top: 0.5rem; }
.sp-details summary {
  font-size: 0.78rem; color: var(--brand-400); cursor: pointer;
  list-style: none; user-select: none;
}
.sp-details summary::-webkit-details-marker { display: none; }
.sp-lesson-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sp-lesson-row  { display: flex; gap: 0.5rem; font-size: 0.78rem; }
.sp-lesson-module { color: var(--muted); min-width: 120px; }
.sp-lesson-title  { color: var(--text); }

/* ─── Course Feedback View ───────────────────────────────────────────────── */
.cf-course-section { margin-bottom: 2rem; }
.cf-course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.5rem 0 0.6rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.75rem;
}

.cf-lesson-block {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.cf-lesson-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cf-lesson-title { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.cf-lesson-avg   { font-size: 0.85rem; color: #f59e0b; white-space: nowrap; }
.cf-feedback-rows { display: flex; flex-direction: column; }
.cf-feedback-row {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.cf-feedback-row:last-child { border-bottom: none; }
.cf-feedback-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}
.cf-feedback-email  { font-size: 0.8rem; color: var(--muted); }
.cf-feedback-stars  { font-size: 0.85rem; color: #f59e0b; letter-spacing: 1px; }
.cf-feedback-comment { font-size: 0.85rem; color: var(--text); margin: 0; line-height: 1.45; }
.cf-unseen { background: rgba(37,99,235,0.04); }
.cf-badge-new {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--brand-600);
  color: #fff;
  letter-spacing: 0.02em;
}
.cf-btn-seen {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.cf-btn-seen:hover { background: var(--surface-2); color: var(--text); }

/* ─── Access management view ─────────────────────────────────────────────── */
.view-access { max-width: 720px; margin: 0 auto; padding-bottom: 3rem; display: flex; flex-direction: column; gap: 1rem; }
.access-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.access-card-info { display: flex; align-items: center; gap: 0.6rem; }
.access-courses { display: flex; flex-direction: column; gap: 0.25rem; }
.access-check-label {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.4rem 0.5rem; border-radius: 6px; cursor: pointer;
  transition: background 0.15s;
}
.access-check-label:hover { background: var(--surface-2); }
.access-checkbox { accent-color: var(--brand-500); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.access-check-title { font-size: 0.875rem; color: var(--text); }

/* ─── Search profiles view ───────────────────────────────────────────────── */
.view-search-profiles { max-width: 1100px; margin: 0 auto; padding-bottom: 3rem; }
.search-profiles-header { padding: 1.5rem 0 1rem; display: flex; flex-direction: column; gap: 1rem; }
.search-profiles-header h1 { margin: 0; }
.search-input-wrap { position: relative; }
.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; }
.search-input-lg {
  width: 100%; padding: 0.65rem 1rem 0.65rem 2.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 0.95rem;
  font-family: inherit; box-sizing: border-box;
  transition: border-color 0.15s;
}
.search-input-lg:focus { outline: none; border-color: var(--brand-500); }
.search-profiles-count { margin: 0 0 1rem; font-size: 0.82rem; color: var(--muted); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

/* ── Profile card v2 ── */
.pc2 {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.25rem;
  cursor: pointer; display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.pc2:hover {
  border-color: var(--brand-500); transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.15);
}
.pc2-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1rem;
}
.pc2-avatar-wrap { position: relative; display: inline-block; }
.pc2-avatar {
  width: 72px; height: 72px; border-radius: 14px;
  background: var(--brand-500); color: #fff;
  font-size: 1.5rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pc2-dot {
  position: absolute; bottom: 4px; left: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--surface-1);
}
.pc2-level {
  background: var(--brand-500); color: #fff;
  font-size: 0.78rem; font-weight: 700;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  white-space: nowrap;
}
.pc2-body { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 0; }
.pc2-name     { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc2-title    { font-size: 0.875rem; font-weight: 600; color: var(--brand-400); }
.pc2-location { font-size: 0.8rem; color: var(--muted); }
.pc2-techs    { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.pc2-tech {
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 0.78rem; font-weight: 500;
}
.pc2-tech-more { color: var(--muted); }
.pc2-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.pc2-exp  { font-size: 0.8rem; color: var(--muted); }
.pc2-link { font-size: 0.82rem; font-weight: 600; color: var(--brand-400); }
.skill-tag--sm { font-size: 0.72rem; padding: 0.2rem 0.5rem; }
.skill-tag-more {
  font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-weight: 500;
}

/* Profile detail modal */
.profile-detail-modal {
  width: min(92vw, 560px); max-height: 80vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 1.25rem;
}
.profile-detail-header {
  display: flex; align-items: center; gap: 1rem; position: relative;
}
.profile-detail-avatar { width: 56px; height: 56px; font-size: 1.2rem; flex-shrink: 0; }
.profile-detail-info { flex: 1; }
.profile-detail-name  { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.profile-detail-email { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.profile-detail-bio   { font-size: 0.875rem; color: var(--muted); line-height: 1.6; margin: 0; }
.profile-detail-close {
  position: absolute; top: 0; right: 0;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; padding: 0.25rem;
  transition: color 0.15s;
}
.profile-detail-close:hover { color: var(--text); }
.profile-detail-section { display: flex; flex-direction: column; gap: 0.6rem; }
.profile-detail-section-title { margin: 0; font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Config view ────────────────────────────────────────────────────────── */
.view-config { max-width: 720px; margin: 0 auto; padding-bottom: 3rem; display: flex; flex-direction: column; gap: 1.5rem; }
.config-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.config-section-header .edit-section-label { margin: 0; }
.config-cat-list { display: flex; flex-direction: column; gap: 0.4rem; }
.config-cat-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  background: var(--surface-2);
}
.config-cat-icon  { font-size: 1.2rem; width: 1.6rem; text-align: center; flex-shrink: 0; }
.config-cat-label { flex: 1; font-size: 0.9rem; font-weight: 500; }
.config-cat-id    { font-size: 0.75rem; color: var(--muted); font-family: 'Fira Code', monospace; }
.config-cat-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.config-btn-sm { font-size: 0.78rem; padding: 0.25rem 0.6rem; }
.config-permissions-wrap { overflow-x: auto; }
.config-permissions-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.config-permissions-table th,
.config-permissions-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
.config-permissions-table thead th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.config-permissions-table tbody tr:hover { background: var(--surface-2); }
.config-permissions-table tbody td:first-child { font-weight: 500; }
.config-permissions-table input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--brand-500); cursor: pointer; }
.config-permissions-table input[type=checkbox]:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Profile view ───────────────────────────────────────────────────────── */
.view-profile { max-width: 720px; margin: 0 auto; padding-bottom: 3rem; display: flex; flex-direction: column; gap: 1.5rem; }
.profile-header { display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem 0 0.5rem; }
.profile-header-info h1 { margin: 0; font-size: 1.4rem; }
.profile-avatar-wrap {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.profile-avatar-wrap:hover .profile-avatar-edit { opacity: 1; }
.profile-avatar-edit {
  position: absolute; inset: 0;
  border-radius: 16px;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity 0.18s;
}
.profile-avatar-wrap.uploading .profile-avatar-edit { opacity: 1; }
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 16px;
  background: var(--brand-500); color: #fff;
  font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  user-select: none;
  width: 100%; height: 100%;
}
.profile-email { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }
.profile-meta-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.profile-meta-item { font-size: 0.82rem; color: var(--muted); }
.profile-meta-link { color: var(--brand-400); text-decoration: none; }
.profile-meta-link:hover { text-decoration: underline; }
.profile-actions { display: flex; justify-content: flex-end; margin-top: 1.25rem; }

/* Spider chart */
.spider-wrap { display: flex; justify-content: center; padding: 0.25rem 0; }

/* Skill tags */
.skill-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  min-height: 2rem; margin-bottom: 0.75rem;
}
.skill-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  background: var(--brand-500); color: #fff;
  font-size: 0.82rem; font-weight: 500;
}
.skill-tag-remove {
  background: none; border: none; color: rgba(255,255,255,0.75);
  cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 0; display: flex; align-items: center;
  transition: color 0.15s;
}
.skill-tag-remove:hover { color: #fff; }
.skill-add-row { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.skill-add-row .edit-input { flex: 1; }

/* Experience modal date row */
.em-date-row { display: flex; gap: 0.5rem; }
.em-date-row .em-start-month, .em-date-row .em-end-month { flex: 2; min-width: 0; }
.em-date-row .em-start-year,  .em-date-row .em-end-year  { flex: 1; min-width: 0; }

.em-end-row { display: flex; align-items: flex-end; gap: 0.75rem; }
.em-end-row #em-end-field { flex: 1; transition: opacity 0.2s; }
.em-current-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 500; color: var(--text);
  padding-bottom: 0.45rem; white-space: nowrap; cursor: pointer;
}
.em-current-label input[type="checkbox"] { accent-color: var(--brand-500); width: 15px; height: 15px; cursor: pointer; }

/* Experiences */
.experience-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.exp-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.9rem 1rem; background: var(--surface-1);
}
.exp-card-header { display: flex; align-items: flex-start; gap: 0.75rem; }
.exp-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.exp-card-info { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.exp-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.exp-role { font-size: 0.82rem; color: var(--muted); }
.exp-period {
  font-size: 0.75rem; color: var(--brand-500);
  font-weight: 500; letter-spacing: 0.02em;
}
.exp-desc { font-size: 0.82rem; color: var(--muted); margin: 0.6rem 0 0 2.05rem; line-height: 1.5; }
.exp-card-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; flex-shrink: 0; }
.exp-add-btns { display: flex; gap: 0.5rem; }

/* ─── Profile View (professional card) ──────────────────────────────────── */
.pv-wrap { padding: 1.5rem 1rem 3rem; display: flex; justify-content: center; }
.pv-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 16px; width: min(90vw, 900px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  overflow: hidden;
}
.pv-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.pv-card-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.pv-close-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 0.3rem 0.6rem; transition: background 0.15s, color 0.15s;
}
.pv-close-btn:hover { background: var(--surface-2); color: var(--text); }
.pv-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; padding: 0;
}
@media (max-width: 680px) { .pv-body { grid-template-columns: 1fr; } }
.pv-left {
  padding: 1.5rem; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1.1rem;
}
.pv-right {
  padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem;
}
.pv-identity { display: flex; align-items: flex-start; gap: 1rem; }
.pv-avatar {
  width: 72px; height: 72px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand-500); color: #fff;
  font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pv-identity-info { flex: 1; }
.pv-name { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.pv-title { margin: 0.2rem 0 0; font-size: 0.9rem; font-weight: 600; color: var(--brand-400); }
.pv-location { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--muted); }
.pv-bio { margin: 0; font-size: 0.875rem; line-height: 1.65; color: var(--muted); }
.pv-section-label { margin: 0 0 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.pv-stats { display: flex; gap: 0.75rem; }
.pv-stat {
  flex: 1; background: var(--surface-2); border-radius: 10px;
  padding: 0.7rem 0.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
}
.pv-stat-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.pv-stat-highlight { color: var(--brand-400); }
.pv-stat-label { font-size: 0.72rem; color: var(--muted); }
.pv-tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pv-tech-tag {
  padding: 0.28rem 0.65rem; border-radius: 999px;
  background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
  color: var(--brand-400); font-size: 0.8rem; font-weight: 500;
}
.pv-exp-list { display: flex; flex-direction: column; gap: 0.6rem; }
.pv-exp-item { display: flex; align-items: flex-start; gap: 0.75rem; }
.pv-exp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
  background: var(--brand-500);
}
.pv-exp-info { display: flex; flex-direction: column; gap: 0.15rem; }
.pv-exp-info strong { font-size: 0.9rem; color: var(--text); }
.pv-exp-info span { font-size: 0.8rem; color: var(--muted); }
.pv-contact-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pv-contact-item {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; color: var(--muted); text-decoration: none;
}
.pv-contact-item:hover { color: var(--brand-400); }
.pv-spider-wrap { display: flex; justify-content: center; }
.pv-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pv-score-card {
  background: var(--surface-2); border-radius: 10px;
  padding: 0.6rem 0.75rem; display: flex; align-items: center; gap: 0.6rem;
}
.pv-score-value { font-size: 1.1rem; font-weight: 700; color: var(--brand-400); min-width: 1.5rem; }
.pv-score-label { font-size: 0.78rem; color: var(--muted); }
.pv-actions { margin-top: auto; padding-top: 0.5rem; }
.btn-contact {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.8rem 1.25rem; border-radius: 10px;
  background: var(--brand-500); color: #fff; font-weight: 600;
  font-size: 0.9rem; text-decoration: none; transition: background 0.2s;
}
.btn-contact:hover { background: var(--brand-600, #4f46e5); }

