/* ===== VARIABLES ===== */
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #222632;
  --bg-sidebar: #141720;
  --bg-input: #1e2230;
  --border: #2a2e3d;
  --text: #e8eaf0;
  --text-muted: #8b8fa3;
  --text-dim: #5a5e72;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --danger: #ef4444;
  --gold: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 280px;
  --transition: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
input, button { font-family: inherit; }
button { cursor: pointer; border: none; }

/* ===== AUTH SCREEN ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0d14 0%, #141720 50%, #0f1117 100%);
  padding: 20px;
}
.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.auth-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border var(--transition);
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform 0.1s;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; justify-content: center; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text); text-decoration: none; }
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}
.auth-links a { font-size: 13px; color: var(--text-muted); }
.auth-links a:hover { color: var(--accent); }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }
.auth-success { color: var(--success); font-size: 13px; margin-top: 12px; text-align: center; }

/* ===== APP LAYOUT ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon-sm { font-size: 24px; }
.logo-text { font-size: 16px; font-weight: 700; color: var(--text); }
.sidebar-close {
  background: none;
  color: var(--text-muted);
  display: none;
}
.sidebar-nav {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 16px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item .material-symbols-outlined { font-size: 20px; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-progress {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.mobile-menu-btn { background: none; color: var(--text); }
.mobile-logo { flex: 1; font-weight: 700; font-size: 16px; }
.mobile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  max-width: 1200px;
}
.page { display: none; }
.page.active { display: block; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon .material-symbols-outlined { color: var(--accent); font-size: 24px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== SECTION HEADER ===== */
.section-header {
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* ===== CONTINUE CARD ===== */
.continue-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.continue-info { flex: 1; }
.continue-module {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.continue-title { font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.continue-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.continue-progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.continue-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.continue-btn { white-space: nowrap; }

/* ===== MODULE GRID ===== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.module-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.module-card.locked { opacity: 0.5; cursor: not-allowed; }
.module-card.locked:hover { transform: none; border-color: var(--border); box-shadow: none; }
.module-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.module-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.module-card-icon.mod1 { background: rgba(59,130,246,0.15); color: #3b82f6; }
.module-card-icon.mod2 { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.module-card-icon.mod3 { background: rgba(34,197,94,0.15); color: #22c55e; }
.module-card-icon.mod4 { background: rgba(245,158,11,0.15); color: #f59e0b; }
.module-card-icon.mod5 { background: rgba(239,68,68,0.15); color: #ef4444; }
.module-card-num { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.module-card-title { font-size: 16px; font-weight: 600; }
.module-card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.module-card-lessons { font-size: 12px; color: var(--text-dim); }
.module-card-progress {
  height: 6px;
  width: 100px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
}
.module-card-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}
.module-card-progress-fill.mod1 { background: #3b82f6; }
.module-card-progress-fill.mod2 { background: #8b5cf6; }
.module-card-progress-fill.mod3 { background: #22c55e; }
.module-card-progress-fill.mod4 { background: #f59e0b; }
.module-card-progress-fill.mod5 { background: #ef4444; }
.lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.lock-badge .material-symbols-outlined { font-size: 14px; }

/* ===== MODULE PAGE ===== */
.module-page .module-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}
.module-hero h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.module-hero p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.module-hero-progress {
  height: 8px;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
}
.module-hero-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
  transition: width 0.5s ease;
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.lesson-item:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.lesson-item.completed { border-left: 3px solid var(--success); }
.lesson-item.current { border-left: 3px solid var(--accent); }
.lesson-item.locked { opacity: 0.4; cursor: not-allowed; }
.lesson-item.locked:hover { border-color: var(--border); background: var(--bg-card); }
.lesson-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-item.completed .lesson-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.lesson-item.completed .lesson-check .material-symbols-outlined { font-size: 16px; }
.lesson-meta { flex: 1; }
.lesson-meta-num { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.lesson-meta-title { font-size: 15px; font-weight: 600; }
.lesson-meta-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lesson-duration { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* ===== LESSON PAGE ===== */
.lesson-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.breadcrumb-link { color: var(--accent); }
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}
.lesson-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}
.lesson-header-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin: -32px -32px 24px -32px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.06) 100%);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.lesson-duration-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(59,130,246,0.1);
  border-radius: 999px;
}
.lesson-content .external-link-box {
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}
.lesson-content .external-link-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: #8b5cf6;
  margin-bottom: 10px;
}
.lesson-content .external-link-box ul {
  list-style: none;
  padding: 0;
}
.lesson-content .external-link-box li {
  margin-bottom: 8px;
}
.lesson-content .external-link-box a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.lesson-content .external-link-box a:hover {
  text-decoration: underline;
}
.lesson-content h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.lesson-content h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; color: var(--accent); }
.lesson-content p { margin-bottom: 12px; color: var(--text-muted); line-height: 1.7; }
.lesson-content ul { padding-left: 20px; margin-bottom: 12px; }
.lesson-content li { color: var(--text-muted); margin-bottom: 6px; line-height: 1.6; }
.lesson-content .action-box {
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}
.lesson-content .action-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lesson-content .key-takeaway {
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}
.lesson-content .key-takeaway h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 8px;
}
.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lesson-sidebar {
  position: sticky;
  top: 32px;
}
.lesson-sidebar h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.lesson-list {
  margin-bottom: 24px;
}
.lesson-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.lesson-list-item:hover { background: var(--bg-card); }
.lesson-list-item.active { background: var(--accent-glow); color: var(--accent); }
.lesson-list-item.completed { color: var(--success); }
.lesson-list-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-list-item.completed .lesson-list-check {
  background: var(--success);
  border-color: var(--success);
}
.lesson-resources { margin-top: 16px; }
.resource-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
  transition: all var(--transition);
}
.resource-item:hover { border-color: var(--accent); }
.resource-item .material-symbols-outlined { font-size: 18px; color: var(--accent); }

/* ===== PROMPT VAULT ===== */
.vault-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 16px;
}
.vault-search .material-symbols-outlined { color: var(--text-dim); }
.vault-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.vault-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.vault-cat {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.vault-cat:hover { border-color: var(--accent); color: var(--text); }
.vault-cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 12px;
}
.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.prompt-card:hover { border-color: var(--accent); }
.prompt-card-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.prompt-card-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.prompt-card-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}
.prompt-card-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--bg-input));
}
.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.prompt-copy-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.prompt-copy-btn .material-symbols-outlined { font-size: 14px; }

/* ===== CLIENT SCRIPTS ===== */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.script-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.script-card:hover { border-color: var(--accent); }
.script-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.script-card-icon .material-symbols-outlined { color: var(--accent); }
.script-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.script-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.script-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
}

/* ===== COMMUNITY PLACEHOLDER ===== */
.community-placeholder {
  text-align: center;
  padding: 80px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.community-placeholder h2 { margin: 16px 0 8px; font-size: 22px; }
.community-placeholder p { color: var(--text-muted); font-size: 15px; }

/* ===== SETTINGS ===== */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.settings-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* ===== MODULE PAGE EXTENDED ===== */
.module-hero-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.module-hero-progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
.module-hero-progress span {
  font-size: 13px;
  color: var(--text-muted);
}
.module-lessons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.module-lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.module-lesson-row:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.module-lesson-row.completed { border-left: 3px solid var(--success); }
.lesson-status-icon { flex-shrink: 0; }
.lesson-row-info { flex: 1; }
.lesson-row-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.lesson-row-info p { font-size: 13px; color: var(--text-muted); }
.lesson-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.lesson-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 8px;
  border-radius: 4px;
}
.lesson-duration { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.module-card-progress {
  margin-top: auto;
}
.module-card-progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.module-card-stat { font-size: 12px; color: var(--text-dim); }

/* ===== VAULT CARD (app.js dynamic) ===== */
.vault-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: all var(--transition);
}
.vault-card:hover { border-color: var(--accent); }
.vault-card-header { margin-bottom: 8px; }
.vault-cat-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}
.vault-cat-badge.outreach { background: #3b82f6; }
.vault-cat-badge.sales { background: #22c55e; }
.vault-cat-badge.chatbot { background: #8b5cf6; }
.vault-cat-badge.email { background: #f59e0b; }
.vault-cat-badge.content { background: #ef4444; }
.vault-cat-badge.social { background: #ec4899; }
.vault-cat-badge.operations { background: #06b6d4; }
.vault-cat-badge.reporting { background: #14b8a6; }
.vault-cat-badge.proposals { background: #f97316; }
.vault-card-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.vault-card-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  max-height: 140px;
  overflow: hidden;
  margin: 0;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-copy:hover { background: rgba(59,130,246,0.2); }
.btn-copy .material-symbols-outlined { font-size: 14px; }

/* ===== SCRIPT CARD (app.js) ===== */
.script-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.script-icon .material-symbols-outlined { color: var(--accent); }
.script-card .btn-sm { font-size: 13px; padding: 8px 14px; }

/* ===== RESOURCE LINK ===== */
.resource-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
  transition: all var(--transition);
  text-decoration: none;
}
.resource-link:hover { border-color: var(--accent); text-decoration: none; }
.resource-link .material-symbols-outlined { font-size: 18px; color: var(--accent); }

/* ===== SUCCESS BUTTON ===== */
.btn-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--success);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-success:hover { background: #16a34a; }


/* ===== PRODUCT BADGE EXTENDED ===== */
.product-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.product-badge .material-symbols-outlined { font-size: 20px; }
.product-active {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
  grid-column: 1 / -1;
}

/* ===== TEXT HELPERS ===== */
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ===== TOAST INFO ===== */
.toast.info { border-color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; }
}
/* ── Resources & Downloads ── */
.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s, transform 0.15s;
}

.resource-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.resource-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
}

.resource-icon .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}

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

.resource-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.resource-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.4;
}

.resource-meta {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resource-dl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  white-space: nowrap;
}

.resource-dl .material-symbols-outlined {
  font-size: 18px;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 72px 16px 32px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .continue-card { flex-direction: column; align-items: stretch; }
  .module-grid { grid-template-columns: 1fr; }
  .vault-grid { grid-template-columns: 1fr; }
  .lesson-nav { flex-wrap: wrap; }
  .resource-card { flex-direction: column; align-items: stretch; text-align: center; }
  .resource-icon { margin: 0 auto; }
  .resource-dl { align-self: center; }
  .community-layout { flex-direction: column; }
  .community-channels { width: 100%; flex-direction: row; overflow-x: auto; gap: 8px; padding: 0; background: transparent; border: none; border-radius: 0; margin-bottom: 16px; }
  .channel-item { padding: 8px 14px; white-space: nowrap; }
  .channel-icon { display: none; }
}

/* ===== COMMUNITY ===== */
.community-stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.comm-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}
.comm-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.comm-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.comm-stat-live .comm-stat-value { color: #22c55e; }
.comm-stat-live .comm-stat-value::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 6px;
  animation: livePulse 2s infinite;
  vertical-align: middle;
}
@keyframes livePulse { 0%,100%{opacity:1;}50%{opacity:0.4;} }

.community-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.community-channels {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 20px;
}
.channels-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px 8px;
}
.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.channel-item:hover { background: var(--bg-card-hover); color: var(--text); }
.channel-item.active { background: rgba(59,130,246,0.12); color: var(--accent); }
.channel-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.channel-count {
  margin-left: auto;
  background: rgba(59,130,246,0.15);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.community-feed {
  flex: 1;
  min-width: 0;
}

/* New Post Composer */
.community-composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.community-composer:hover { border-color: var(--accent); }
.composer-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.composer-placeholder {
  flex: 1;
  color: var(--text-dim);
  font-size: 14px;
}

/* Post Cards */
.community-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.community-post:hover { border-color: rgba(255,255,255,0.1); }
.community-post.pinned { border-left: 3px solid var(--gold); }

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.post-meta { flex: 1; min-width: 0; }
.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.post-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.post-badge-elite { background: rgba(245,158,11,0.15); color: var(--gold); }
.post-badge-top { background: rgba(139,92,246,0.15); color: #a78bfa; }
.post-badge-instructor { background: rgba(59,130,246,0.2); color: var(--accent); }
.post-time {
  font-size: 12px;
  color: var(--text-dim);
}
.post-pinned-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  margin-left: auto;
}

.post-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.4;
}
.post-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 14px;
}
.post-body strong { color: var(--text); font-weight: 600; }

/* Reactions */
.post-reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.reaction-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.reaction-chip:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.3);
}
.reaction-count { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Replies */
.post-replies-toggle {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.post-replies-toggle:hover { text-decoration: underline; }

.post-replies {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.reply-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}
.reply-item + .reply-item { border-top: 1px solid rgba(255,255,255,0.03); }
.reply-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.reply-content { flex: 1; min-width: 0; }
.reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.reply-author { font-size: 13px; font-weight: 600; color: var(--text); }
.reply-time { font-size: 11px; color: var(--text-dim); }
.reply-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Compose Modal */
.compose-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.compose-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 560px;
}
.compose-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.compose-modal-header h3 { font-size: 18px; font-weight: 700; }
.compose-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.compose-close:hover { color: var(--text); }
.compose-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  outline: none;
  font-family: inherit;
}
.compose-input:focus { border-color: var(--accent); }
.compose-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 16px;
  outline: none;
  font-family: inherit;
}
.compose-textarea:focus { border-color: var(--accent); }
.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Community Loading State */
.community-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.community-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
