@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* ── Cinch Home Buyers — SOP Training Site ── */

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-dark: #020617;
  --orange: #C1272D;
  --orange-hover: #9E1F24;
  --orange-light: #FEF2F2;
  --primary: #C1272D;
  --primary-hover: #9E1F24;
  --primary-light: #FEF2F2;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --body-text: #374151;
  --green: #22c55e;
  --green-light: #dcfce7;
  --red: #ef4444;
  --red-light: #fef2f2;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 10px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-50);
  color: var(--body-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--orange-hover); text-decoration: underline; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes progressFill {
  from { width: 0; }
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes checkPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 39, 45, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(193, 39, 45, 0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Navbar ── */
.navbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.navbar .brand {
  color: var(--orange);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.navbar .brand img {
  height: 36px;
  width: auto;
  transition: opacity 0.2s;
}
.navbar .brand:hover { text-decoration: none; }
.navbar .brand:hover img { opacity: 0.85; }
.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.navbar .nav-links a {
  color: var(--gray-400);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}
.navbar .nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}
.navbar .nav-links a.active {
  color: var(--white);
  background: rgba(193, 39, 45, 0.12);
  text-decoration: none;
}
.navbar .nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--orange);
  border-radius: 1px;
}
.navbar .nav-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 0.4rem 0.85rem;
  gap: 0.5rem;
  transition: all 0.2s;
}
.navbar .nav-search:focus-within {
  background: rgba(255,255,255,0.12);
  border-color: rgba(193, 39, 45, 0.4);
}
.navbar .nav-search input {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 0.85rem;
  outline: none;
  width: 200px;
}
.navbar .nav-search input::placeholder { color: var(--gray-500); }
.navbar .user-info {
  color: var(--gray-400);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.navbar .user-info .role-badge {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  color: var(--white);
  padding: 0.2rem 0.65rem;
  border-radius: 14px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--gray-400);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

/* ── Login Page ── */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 40%, #1a2744 100%);
  position: relative;
  overflow: hidden;
}
.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(193, 39, 45, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.login-logo {
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out;
}
.login-logo img {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.login-box {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.6s ease-out 0.1s both;
  position: relative;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--orange-hover));
  border-radius: 0 0 3px 3px;
}
.login-box h1 {
  color: var(--navy);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  text-align: center;
  font-weight: 700;
}
.login-box .subtitle {
  color: var(--gray-500);
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
  transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 0.4rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(193, 39, 45, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange-hover) 0%, #8a1a1e 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(193, 39, 45, 0.35);
}
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Content Layout ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  animation: fadeInUp 0.4s ease-out;
}
.page-header {
  margin-bottom: 1.75rem;
}
.page-header h1 {
  font-size: 1.65rem;
  color: var(--navy);
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.page-header p {
  color: var(--gray-500);
  font-size: 0.92rem;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transition: all 0.25s ease;
  border: 1px solid rgba(0,0,0,0.04);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.sop-card {
  cursor: pointer;
  border-left: 4px solid var(--orange);
  position: relative;
  overflow: hidden;
}
.sop-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.sop-card:hover::before { opacity: 1; }
.sop-card .card-title {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--navy);
}
.sop-card .card-section {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}
.sop-card .card-role {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  padding: 0.12rem 0.55rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Quick Links ── */
.quick-links {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.quick-link:hover {
  border-color: var(--orange);
  text-decoration: none;
  color: var(--orange);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ── SOP Viewer ── */
.sop-viewer-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.sop-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  animation: slideInLeft 0.4s ease-out;
  border: 1px solid rgba(0,0,0,0.04);
}
.sop-sidebar h3 {
  font-size: 0.78rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  font-weight: 700;
}
.sop-sidebar a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--gray-600);
  font-size: 0.84rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sop-sidebar a:hover {
  background: var(--gray-100);
  color: var(--navy);
  text-decoration: none;
  border-left-color: var(--orange);
}

/* SOP Brand Bar */
.sop-brand-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border: 1px solid var(--gray-200);
  border-bottom: 2px solid var(--orange);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 0;
}
.sop-brand-bar img {
  height: 24px;
  opacity: 0.8;
}
.sop-brand-bar span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
}

.sop-content {
  background: var(--white);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  line-height: 1.75;
  word-wrap: break-word;
  font-size: 0.98rem;
  border: 1px solid rgba(0,0,0,0.04);
  border-top: none;
}
.sop-content h1, .sop-content h2, .sop-content h3 {
  color: var(--navy);
}
.sop-content h1 { font-size: 1.6rem; font-weight: 700; }
.sop-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}
.sop-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.sop-content ul, .sop-content ol {
  padding-left: 1.75rem;
  margin: 0.85rem 0;
}
.sop-content li {
  margin-bottom: 0.45rem;
}
.sop-content p {
  margin-bottom: 0.85rem;
}
.sop-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.sop-content code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.85em;
  color: var(--orange);
}
.sop-content pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}
.sop-content strong { font-weight: 700; color: var(--navy); }

/* ── Video Embeds ── */
.sop-video-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 1.25rem 0;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--navy);
}
.sop-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.sop-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin: 0.5rem 0;
  transition: all 0.2s;
}
.sop-download-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--white);
  text-decoration: none;
}

/* ── Search Results ── */
.search-result {
  padding: 1.1rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
  border-radius: var(--radius);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--gray-50); }
.search-result h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.search-result .excerpt {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
.search-result .excerpt mark {
  background: linear-gradient(120deg, rgba(193,39,45,0.1) 0%, rgba(193,39,45,0.2) 100%);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  color: var(--orange);
  font-weight: 500;
}
.search-result .meta {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* ── Quiz ── */
.quiz-container {
  max-width: 720px;
  margin: 0 auto;
}
.quiz-question {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.15rem;
  border: 1px solid rgba(0,0,0,0.04);
  animation: fadeInUp 0.3s ease-out;
}
.quiz-question h3 {
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.5;
}
.quiz-progress {
  background: var(--gray-200);
  height: 8px;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-hover));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1.15rem;
  margin-bottom: 0.55rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
  border-left-width: 4px;
}
.quiz-option:hover {
  border-color: var(--orange);
  border-left-color: var(--orange);
  background: var(--primary-light);
  transform: translateX(2px);
}
.quiz-option.selected { border-color: var(--orange); background: var(--primary-light); }
.quiz-option.correct {
  border-color: var(--green);
  background: var(--green-light);
  animation: correctPulse 0.5s ease-out;
}
.quiz-option.incorrect {
  border-color: var(--red);
  background: var(--red-light);
  animation: shake 0.4s ease-out;
}
.quiz-explanation {
  margin-top: 0.85rem;
  padding: 0.85rem;
  background: var(--blue-light);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
  border-left: 3px solid var(--blue);
}
.quiz-score {
  text-align: center;
  padding: 2.5rem;
}
.quiz-score .score-number {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--orange), var(--orange-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quiz-score .score-label {
  color: var(--gray-500);
  font-size: 0.95rem;
}

/* ── Chatbot Widget ── */
.chatbot-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(193, 39, 45, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.chatbot-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(193, 39, 45, 0.5); }
.chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 380px;
  max-height: 500px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}
.chatbot-panel.open { display: flex; animation: fadeInUp 0.2s ease-out; }
.chatbot-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chatbot-header button {
  background: none; border: none; color: var(--gray-400);
  cursor: pointer; font-size: 1.2rem; transition: color 0.2s;
}
.chatbot-header button:hover { color: var(--white); }
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 350px;
}
.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.chat-msg.user {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  background: var(--gray-100);
  color: var(--navy);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg .sources {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.75rem;
}
.chat-msg .sources a { color: var(--orange); }
.chatbot-input {
  display: flex;
  border-top: 1px solid var(--gray-200);
  padding: 0.6rem;
  gap: 0.5rem;
}
.chatbot-input input {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.chatbot-input input:focus { border-color: var(--orange); }
.chatbot-input button {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
}

/* ── Admin Panel ── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-tab {
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--navy); background: var(--gray-50); }
.admin-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeInUp 0.3s ease-out; }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th {
  background: var(--gray-50);
  text-align: left;
  padding: 0.7rem 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tr:nth-child(even) td { background: rgba(241, 245, 249, 0.4); }
tr:hover td { background: rgba(193, 39, 45, 0.02); }

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
}
.toast-success { background: var(--green); color: var(--white); }
.toast-error { background: var(--red); color: var(--white); }
.toast-info { background: var(--blue); color: var(--white); }

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease-out;
}
.modal h2 { font-size: 1.25rem; margin-bottom: 1.15rem; color: var(--navy); }
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: var(--blue-light); color: var(--blue); }

/* KEY TRAINING Badge */
.badge-key-training {
  background: linear-gradient(135deg, var(--gold) 0%, #d97706 100%);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

/* ── Section Headers ── */
.section-title {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  border-left: 3px solid var(--orange);
  font-weight: 700;
}

/* ── Progress Overview ── */
.progress-overview {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.progress-stat {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
  text-align: center;
  flex: 1;
  min-width: 150px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.25s;
  animation: fadeInUp 0.4s ease-out both;
}
.progress-stat:nth-child(1) { animation-delay: 0s; border-top: 3px solid var(--orange); }
.progress-stat:nth-child(2) { animation-delay: 0.1s; border-top: 3px solid var(--blue); }
.progress-stat:nth-child(3) { animation-delay: 0.2s; border-top: 3px solid var(--green); }
.progress-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.progress-stat-number {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--orange);
}
.progress-stat:nth-child(2) .progress-stat-number { color: var(--blue); }
.progress-stat:nth-child(3) .progress-stat-number { color: var(--green); }
.progress-stat-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 0.3rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Learning Path Cards ── */
.path-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  border-left: 4px solid var(--gray-300);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
  border-left: 4px solid var(--gray-300);
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease-out both;
}
.path-card:nth-child(1) { animation-delay: 0s; }
.path-card:nth-child(2) { animation-delay: 0.1s; }
.path-card:nth-child(3) { animation-delay: 0.15s; }
.path-card:nth-child(4) { animation-delay: 0.2s; }
.path-card:hover { box-shadow: var(--shadow-md); }
.path-card.completed {
  border-left-color: var(--green);
}
.path-card.locked {
  opacity: 0.55;
}
.path-card-header {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.35rem;
  cursor: pointer;
  gap: 1rem;
  transition: background 0.2s;
}
.path-card-header:hover {
  background: var(--gray-50);
}
.path-card-info {
  flex: 1;
}
.path-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.15rem;
}
.path-card-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0;
}
.path-card-progress {
  text-align: right;
  min-width: 130px;
}
.path-card-pct {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--orange);
}
.path-card.completed .path-card-pct { color: var(--green); }
.path-card-counts {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.4rem;
}
.path-progress-bar-bg {
  width: 130px;
  height: 7px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.path-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-hover));
  border-radius: 4px;
  transition: width 0.5s ease;
  animation: progressFill 0.8s ease-out;
}
.path-card.completed .path-progress-bar-fill {
  background: linear-gradient(90deg, var(--green), #16a34a);
}
.path-card-chevron {
  font-size: 0.8rem;
  color: var(--gray-400);
  transition: transform 0.2s;
}

/* ── Step List ── */
.step-list {
  border-top: 1px solid var(--gray-200);
}
.step-list-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.35rem;
  gap: 0.85rem;
  border-bottom: 1px solid var(--gray-100);
  transition: all 0.15s;
  cursor: pointer;
}
.step-list-item:last-child {
  border-bottom: none;
}
.step-list-item:hover {
  background: var(--gray-50);
  padding-left: 1.5rem;
}
.step-list-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.step-list-item.locked:hover {
  background: transparent;
  padding-left: 1.35rem;
}
.step-list-item.completed {
  background: rgba(34, 197, 94, 0.03);
}

/* Step status icons */
.step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.step-list-item:hover .step-icon { transform: scale(1.08); }
.step-icon.completed {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.25);
}
.step-icon.in_progress {
  background: linear-gradient(135deg, var(--orange), var(--orange-hover));
  color: var(--white);
  box-shadow: 0 2px 6px rgba(193, 39, 45, 0.25);
  animation: pulseGlow 2s ease infinite;
}
.step-icon.available {
  background: var(--white);
  border: 2px solid var(--orange);
  color: var(--orange);
}
.step-icon.locked {
  background: var(--gray-200);
  color: var(--gray-400);
  font-size: 0.65rem;
}

.step-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.step-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
}
.step-title {
  font-size: 0.9rem;
  color: var(--navy);
}
.step-quiz-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 0.12rem 0.45rem;
  border-radius: 8px;
  text-transform: uppercase;
}
.step-section-label {
  font-size: 0.72rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* ── Phase Gate ── */
.phase-gate {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.35rem;
  margin: 1.15rem 0;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-300);
}
.phase-gate.unlocked {
  background: var(--green-light);
  border-color: var(--green);
  border-style: solid;
}
.phase-gate-icon {
  font-size: 1.25rem;
}
.phase-gate-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
}
.phase-gate.unlocked .phase-gate-text {
  color: #16a34a;
}

/* ── Scroll Progress Bar (Anti-Gaming) ── */
.scroll-progress-bar-bg {
  width: 100%;
  height: 7px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.scroll-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-hover));
  border-radius: 4px;
  transition: width 0.2s ease;
}

/* ── Completion Overlay ── */
.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}
.completion-overlay-content {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem 4rem;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.4s ease-out;
}
.completion-checkmark {
  font-size: 4rem;
  color: var(--green);
  animation: checkPop 0.5s ease-out;
}
.completion-overlay-content h2 {
  font-size: 1.5rem;
  color: var(--navy);
  margin: 1rem 0 0.5rem;
}
.completion-overlay-content p {
  color: var(--gray-500);
  font-size: 0.95rem;
}

/* ── Library Section Groups ── */
.library-filter-input {
  width: 100%;
  padding: 0.8rem 1.15rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: var(--white);
}
.library-filter-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.08);
}
.library-section {
  margin-bottom: 1.5rem;
}
.library-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  border: 1px solid rgba(0,0,0,0.04);
  border-left: 3px solid var(--orange);
}
.library-section-header:hover {
  background: var(--gray-50);
  box-shadow: var(--shadow-md);
}
.library-section-chevron {
  font-size: 0.8rem;
  color: var(--gray-400);
  flex-shrink: 0;
}
.library-section-title {
  font-weight: 600;
  color: var(--navy);
  flex: 1;
}
.library-section-count {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ── Sales Training Hub ── */
.sales-hub {
  margin-bottom: 2rem;
  animation: fadeInUp 0.4s ease-out;
}
.sales-hub-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.sales-hub-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.sales-hub-header .sales-hub-icon {
  font-size: 1.3rem;
}
.sales-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.sales-hub-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.04);
  border-left: 4px solid var(--gold);
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.sales-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.sales-hub-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.sales-hub-card .card-section {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

/* ── Game Styles ── */
.game-card {
  cursor: pointer;
  text-align: center;
  border-left: 4px solid var(--orange);
  padding: 1.5rem;
  position: relative;
}
.game-card-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.game-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.game-card-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}
.game-card-character {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-style: italic;
}

/* Game page */
.game-character-large {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}
.game-progress-header {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.game-scenario-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.game-character-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.game-character-avatar {
  font-size: 2rem;
  flex-shrink: 0;
}
.game-character-avatar-sm {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.speech-bubble {
  background: var(--gray-100);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--navy);
  line-height: 1.5;
  flex: 1;
}
.game-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}
.game-option:hover {
  border-color: var(--orange);
  background: var(--primary-light);
}
.game-option.correct {
  border-color: var(--green);
  background: var(--green-light);
  animation: correctPulse 0.5s ease-out;
}
.game-option.incorrect {
  border-color: var(--red);
  background: var(--red-light);
  animation: shake 0.4s ease-out;
}
.game-feedback-bubble {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.game-feedback-bubble.correct {
  background: var(--green-light);
}
.game-feedback-bubble.incorrect {
  background: var(--red-light);
}
.game-feedback-bubble p {
  margin-top: 0.25rem;
  color: var(--gray-600);
}
.game-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .navbar .nav-links { gap: 0.25rem; }
  .navbar .nav-links a { padding: 0.35rem 0.6rem; font-size: 0.82rem; }
  .navbar .nav-search { width: 100%; order: 10; }
  .navbar .nav-search input { width: 100%; }
  .navbar .user-info { font-size: 0.75rem; gap: 0.5rem; }
  .page-container { padding: 1.25rem; }
  .page-header h1 { font-size: 1.35rem; }
  .sop-viewer-layout {
    grid-template-columns: 1fr;
  }
  .sop-sidebar {
    position: static;
    max-height: none;
  }
  .chatbot-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 5rem;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .sales-hub-grid {
    grid-template-columns: 1fr;
  }
  .quick-links { flex-direction: column; }
  .progress-overview { gap: 0.75rem; }
  .progress-stat { min-width: 100px; padding: 1rem; }
  .quiz-option { padding: 0.75rem 1rem; }
  .admin-tabs { gap: 0; }
  .admin-tab { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .sop-brand-bar { padding: 0.5rem 0.85rem; }
  .sop-content { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .navbar .user-info span:first-child { display: none; }
  .path-card-progress { min-width: 90px; }
  .path-progress-bar-bg { width: 90px; }
  .step-section-label { display: none; }
}

/* ── Locked Game Cards ── */
.game-card-locked {
  position: relative;
  opacity: 0.7;
  pointer-events: none;
  filter: grayscale(40%);
}
.game-card-locked .game-card-emoji {
  filter: grayscale(100%);
  opacity: 0.5;
}
.game-card-lock-overlay {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.5rem;
  z-index: 2;
}
.game-card-locked .game-card-title {
  color: var(--gray-400);
}
.game-card-locked .game-card-desc {
  color: var(--gray-400);
}
.game-card-unlock-progress {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--gray-500);
}
.game-card-unlock-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.game-card-unlock-progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.3s;
}
.game-locked-screen {
  text-align: center;
  padding: 3rem 2rem;
}
.game-locked-screen .lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.game-locked-screen h2 {
  margin-bottom: 0.75rem;
  color: var(--navy);
}
.game-locked-screen p {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

/* ── Milestone Popup System ── */
.milestone-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.milestone-popup {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: milestoneEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.milestone-icon {
  font-size: 4rem;
  animation: milestoneBounce 1s ease-in-out infinite;
  margin-bottom: 0.5rem;
}
.milestone-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--navy);
}
.milestone-message {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.milestone-progress-bar-bg {
  height: 10px;
  background: var(--gray-200);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.milestone-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  border-radius: 5px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.milestone-progress-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 1.25rem;
}
.milestone-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.milestone-play-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  animation: milestoneGlowPulse 2s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(247, 151, 30, 0.4);
}
.milestone-play-btn:hover {
  transform: scale(1.05);
}
.milestone-continue-btn {
  padding: 0.5rem 1.5rem;
  background: transparent;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.milestone-continue-btn:hover {
  border-color: var(--gray-400);
  color: var(--gray-600);
}
.milestone-particle {
  position: absolute;
  top: -2rem;
  pointer-events: none;
  z-index: 0;
  animation: milestoneFloat linear forwards;
  opacity: 0.7;
}

/* Theme variants */
.milestone-teaser1 .milestone-popup {
  border-top: 4px solid #ffd200;
}
.milestone-teaser2 .milestone-popup {
  border-top: 4px solid #f7971e;
}
.milestone-unlock .milestone-popup {
  border-top: 4px solid #28a745;
  background: linear-gradient(180deg, #f0fff4 0%, #fff 30%);
}
.milestone-unlock .milestone-title {
  color: #28a745;
}

/* Keyframes */
@keyframes milestoneEnter {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes milestoneBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes milestoneGlowPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(247, 151, 30, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(247, 151, 30, 0.7); }
}
@keyframes milestoneFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* ── Print ── */
@media print {
  .navbar, .chatbot-toggle, .chatbot-panel, .sop-sidebar, .toast-container, .completion-overlay, .sop-brand-bar { display: none !important; }
  .sop-viewer-layout { grid-template-columns: 1fr; }
  .sop-content { box-shadow: none; padding: 0; border: none; border-radius: 0; }
  body { background: white; }
}
