/* ===================================================
   Izdehar AI Learning Hub — التنسيقات العامة
=================================================== */

:root {
  --primary: #1F5C3F;
  --dark-green: #0E3B26;
  --blue: #2C6E9E;
  --gold: #D98E29;
  --bg: #F5F6F4;

  --white: #FFFFFF;
  --text: #1E2621;
  --text-muted: #5C6B62;
  --border: #E2E6E1;
  --danger: #C0392B;
  --success: #2E8B57;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(14, 59, 38, 0.06);
  --shadow-md: 0 8px 24px rgba(14, 59, 38, 0.1);
  --sidebar-width: 272px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Tajawal", "Cairo", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.65;
}

h1, h2, h3, h4 { font-family: "Cairo", "Tajawal", sans-serif; margin: 0 0 .5em; color: var(--dark-green); }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--dark-green); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: rgba(31, 92, 63, 0.08); }
.btn-block { width: 100%; }

/* =====================================================
   صفحة الترحيب (Welcome / index.html)
===================================================== */
.welcome-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 20% 15%, rgba(31,92,63,.08), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(217,142,41,.10), transparent 40%),
              var(--bg);
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 6%;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--dark-green));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-family: "Cairo", sans-serif; font-weight: 900; font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-family: "Cairo", sans-serif; font-weight: 800; font-size: 19px; color: var(--dark-green); }
.brand-tagline { font-size: 12px; color: var(--text-muted); margin-top: -2px; }

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 6% 80px;
}

.hero-inner { max-width: 720px; }

.hero-eyebrow {
  display: inline-block;
  background: rgba(217, 142, 41, .14);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.3;
  color: var(--dark-green);
}
.hero h1 span { color: var(--gold); }

.hero p.lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 18px auto 34px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.hero-stats {
  display: flex;
  gap: 36px;
  justify-content: center;
  margin-top: 56px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 26px; font-family: "Cairo", sans-serif; color: var(--primary); }
.hero-stat span { font-size: 13px; color: var(--text-muted); }

.welcome-footer {
  text-align: center;
  padding: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   تخطيط لوحة التحكم (App Shell / Sidebar)
===================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--dark-green);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 40;
}

.sidebar .brand { color: var(--white); margin-bottom: 28px; padding: 0 4px; }
.sidebar .brand-logo { background: rgba(255,255,255,.12); color: var(--gold); }
.sidebar .brand-name { color: var(--white); }
.sidebar .brand-tagline { color: rgba(255,255,255,.6); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 22px;
}
.sidebar-user .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); color: var(--dark-green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: "Cairo", sans-serif;
  flex-shrink: 0;
}
.sidebar-user .name { font-weight: 700; font-size: 14px; }
.sidebar-user .role { font-size: 12px; color: rgba(255,255,255,.65); }

.sidebar-nav { list-style: none; margin: 0; padding: 0; flex: 1; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a .icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sidebar-nav a.is-active { background: var(--primary); color: var(--white); box-shadow: var(--shadow-sm); }

.sidebar-footer {
  font-size: 11.5px;
  color: rgba(255,255,255,.45);
  padding: 12px 8px 4px;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 12px;
}

.sidebar-toggle {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,59,38,.45);
  z-index: 35;
}
.sidebar-overlay.is-visible { display: block; }

/* ---------- المحتوى الرئيسي ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 26px clamp(18px, 4vw, 44px) 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.topbar h1 { font-size: 24px; margin: 0; }
.topbar .subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.topbar-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-green);
  box-shadow: var(--shadow-sm);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

/* ---------- بطاقات عامة ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: rgba(31,92,63,.1); color: var(--primary);
}
.stat-card.gold .stat-icon { background: rgba(217,142,41,.14); color: var(--gold); }
.stat-card.blue .stat-icon { background: rgba(44,110,158,.12); color: var(--blue); }
.stat-card .stat-value { font-family: "Cairo", sans-serif; font-size: 26px; font-weight: 800; color: var(--dark-green); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 999px;
  transition: width .5s ease;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
}
.section-title h2 { font-size: 18px; margin: 0; }
.section-title a { font-size: 13px; color: var(--primary); font-weight: 700; }

/* ---------- بطاقة المهمة القادمة ---------- */
.mission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(120deg, var(--dark-green), var(--primary));
  color: var(--white);
  border: none;
  flex-wrap: wrap;
}
.mission-card .mission-label { font-size: 12px; opacity: .75; margin-bottom: 6px; }
.mission-card h3 { color: var(--white); margin-bottom: 8px; }
.mission-card p { color: rgba(255,255,255,.8); margin-bottom: 0; max-width: 480px; }

/* ---------- المسارات التعليمية ---------- */
.track-card { display: flex; flex-direction: column; gap: 14px; }
.track-card .track-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(31,92,63,.1); color: var(--primary);
}
.track-badge.blue { background: rgba(44,110,158,.12); color: var(--blue); }
.track-badge.gold { background: rgba(217,142,41,.14); color: var(--gold); }

.module-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
}
.module-item .module-status {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
  background: var(--border); color: var(--text-muted);
}
.module-item.done { background: rgba(46,139,87,.06); }
.module-item.done .module-status { background: var(--success); color: var(--white); }
.module-item.in-progress .module-status { background: var(--gold); color: var(--white); }
.module-item.locked { opacity: .55; }
.module-item .module-title { flex: 1; font-weight: 600; }
.module-item .module-xp { font-size: 12px; color: var(--text-muted); }

/* ---------- الشارات (Badges) ---------- */
.badge-tile {
  text-align: center;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.badge-tile .badge-icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: rgba(217,142,41,.14);
}
.badge-tile.locked { opacity: .4; filter: grayscale(1); }
.badge-tile .badge-title { font-weight: 700; font-size: 14px; }
.badge-tile .badge-desc { font-size: 12px; color: var(--text-muted); }

/* ---------- الدرس المصغر / الاختبار ---------- */
.lesson-block { margin-bottom: 22px; }
.lesson-block h3 { font-size: 17px; }

.quiz-progress { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; }
.quiz-question { font-size: 18px; margin-bottom: 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: right;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 14.5px;
  transition: border-color .15s ease, background .15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: var(--success); background: rgba(46,139,87,.08); }
.quiz-option.incorrect { border-color: var(--danger); background: rgba(192,57,43,.06); }
.quiz-feedback { margin-top: 14px; font-weight: 700; font-size: 14px; }
.quiz-feedback.is-correct { color: var(--success); }
.quiz-feedback.is-incorrect { color: var(--danger); }
.quiz-next { margin-top: 18px; }
.quiz-result { text-align: center; padding: 20px 0; }
.quiz-result .result-score { font-family: "Cairo", sans-serif; font-size: 40px; color: var(--primary); font-weight: 800; }

/* ---------- مختبر المحاكاة ---------- */
.sim-scenario { background: rgba(44,110,158,.06); border-right: 4px solid var(--blue); padding: 16px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.sim-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.sim-choice {
  text-align: right;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--white);
}
.sim-choice:hover:not(:disabled) { border-color: var(--blue); }
.sim-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
.sim-feedback.positive { background: rgba(46,139,87,.08); color: var(--success); }
.sim-feedback.negative { background: rgba(192,57,43,.06); color: var(--danger); }
.sim-summary { text-align: center; padding: 24px 0; }

/* ---------- الشهادة ---------- */
.certificate {
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 50px 40px;
  text-align: center;
  background: var(--white);
  position: relative;
  background-image: radial-gradient(circle at 50% 0%, rgba(217,142,41,.06), transparent 60%);
}
.certificate .cert-seal {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--primary));
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 34px;
}
.certificate .cert-title { font-size: 13px; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; }
.certificate h2 { font-size: 30px; margin: 10px 0; }
.certificate .cert-name { font-size: 24px; color: var(--gold); font-family: "Cairo", sans-serif; font-weight: 800; margin: 14px 0; }
.certificate .cert-meta { display: flex; justify-content: center; gap: 40px; margin-top: 28px; flex-wrap: wrap; }
.certificate .cert-meta div { font-size: 13px; color: var(--text-muted); }
.certificate .cert-meta strong { display: block; color: var(--dark-green); font-size: 15px; }

/* ---------- المساعد الذكي (Widget) ---------- */
.ai-fab {
  position: fixed;
  bottom: 26px;
  left: 26px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  border: none;
  font-size: 24px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
}

.ai-panel {
  position: fixed;
  bottom: 96px;
  left: 26px;
  width: min(360px, 90vw);
  max-height: 70vh;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 60;
}
.ai-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.ai-panel-header {
  background: var(--dark-green);
  color: var(--white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-panel-header strong { font-size: 14px; }
.ai-panel-header span { font-size: 11px; color: rgba(255,255,255,.6); }
.ai-panel-header button { background: transparent; border: none; color: var(--white); font-size: 18px; }

.ai-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-message { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.ai-message--bot { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-message--user { background: var(--primary); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }

.ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-suggestion {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
}
.ai-suggestion:hover { border-color: var(--primary); color: var(--primary); }

.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; font-family: inherit; font-size: 13.5px; }
.ai-input:focus { outline: 2px solid var(--primary); }
.ai-form button { background: var(--primary); color: var(--white); border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: var(--dark-green);
  color: var(--white);
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 80;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- استجابة الشاشات ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .mission-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .hero-stats { gap: 22px; }
  .certificate { padding: 32px 18px; }
  .certificate .cert-meta { gap: 20px; }
  .ai-panel { left: 12px; right: 12px; width: auto; }
  .ai-fab { left: 16px; bottom: 16px; }
}

/* =====================================================
   المرحلة الثانية — التقييم التشخيصي والنتيجة (Phase 2)
   إضافات فقط، لا تعديل على القواعد الحالية أعلاه
===================================================== */

.assessment-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 20% 15%, rgba(31,92,63,.08), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(217,142,41,.10), transparent 40%),
              var(--bg);
}

.assessment-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 6% 60px;
}

.assessment-wrap { width: 100%; max-width: 620px; }

.assessment-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.assessment-card { margin-top: 10px; }

.skill-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: rgba(44,110,158,.1);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.assessment-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.assessment-nav .btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- صفحة النتيجة ---------- */
.result-level-badge {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, var(--primary), var(--dark-green));
  color: var(--white);
}
.result-level-badge .level-value { font-family: "Cairo", sans-serif; font-weight: 800; font-size: 18px; }
.result-level-badge .level-caption { font-size: 10px; opacity: .8; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0;
}

.skill-pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.skill-pill {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
}
.skill-pill.strength { background: rgba(46,139,87,.1); color: var(--success); }
.skill-pill.weakness { background: rgba(217,142,41,.14); color: var(--gold); }

.recommendation-box {
  background: rgba(31,92,63,.06);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 14px;
}

.recommended-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
}

.track-card.is-recommended {
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
}

@media (max-width: 620px) {
  .result-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   المرحلة الثالثة — مهمة CRM: الدرس، السؤال، المحاكاة، التحدي (Phase 3)
   إضافات فقط، لا تعديل على القواعد الحالية أعلاه
===================================================== */

.mission-step-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--blue);
  background: rgba(44,110,158,.1);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.challenge-box {
  border: 2px dashed var(--gold);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
}

.success-screen {
  text-align: center;
  padding: 12px 0 6px;
}
.success-screen .success-badge {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  background: linear-gradient(135deg, var(--gold), var(--primary));
  color: var(--white);
  animation: izd-pop .45s ease;
}
.success-screen .success-xp {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  color: var(--gold);
  font-family: "Cairo", sans-serif;
  font-size: 20px;
}
.success-screen .success-summary {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.success-screen .success-summary strong {
  display: block;
  color: var(--dark-green);
  font-size: 15px;
}

@keyframes izd-pop {
  0% { transform: scale(.4); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- رابط إعادة ضبط العرض التجريبي ---------- */
.demo-reset-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-decoration: underline;
}
.demo-reset-link:hover { color: rgba(255,255,255,.7); }

.demo-reset-inline {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  align-self: center;
}
.demo-reset-inline:hover { color: var(--primary); }

/* =====================================================
   المرحلة الرابعة — صقل العرض النهائي (Phase 4)
   إضافات فقط، لا تعديل على القواعد الحالية أعلاه
===================================================== */

/* ---------- بطاقة المتعلمة التجريبية في صفحة الترحيب ---------- */
.demo-learner-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px 8px 8px;
  margin: 6px 0 28px;
  box-shadow: var(--shadow-sm);
}
.demo-learner-chip .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: "Cairo", sans-serif; flex-shrink: 0;
}
.demo-learner-chip div { display: flex; flex-direction: column; text-align: right; }
.demo-learner-chip strong { font-size: 14px; color: var(--dark-green); }
.demo-learner-chip span { font-size: 11.5px; color: var(--text-muted); }

/* ---------- تمييز شارة Master Lead كنتيجة العرض ---------- */
.badge-tile.featured {
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(217,142,41,.12), var(--shadow-md);
  position: relative;
}
.badge-tile.featured::before {
  content: "نتيجة المهمة";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- تمييز وحدة العرض التوضيحي في مساري التعليمي ---------- */
.module-item.is-demo-module {
  border-color: var(--gold);
  background: rgba(217,142,41,.05);
}
.demo-module-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(217,142,41,.14);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- شريط تسلسل Lead → Opportunity في الدرس المصغر ---------- */
.sequence-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.sequence-step {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(31,92,63,.08);
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.sequence-arrow { color: var(--text-muted); font-size: 13px; }

@media (max-width: 520px) {
  .demo-learner-chip { padding-left: 4px; }
  .sequence-strip { gap: 6px; padding: 12px; }
  .sequence-step { font-size: 11.5px; padding: 5px 10px; }
}

/* =====================================================
   المرحلة الخامسة — الدخول التجريبي وربط الشريط الجانبي (Phase 5)
   إضافات فقط، لا تعديل على القواعد الحالية أعلاه
===================================================== */

/* ---------- تقسيم الشريط الجانبي إلى مجموعات (التعلم / الموقع / الحساب) ---------- */
.sidebar-groups {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-groups .sidebar-nav { flex: 0 0 auto; margin-bottom: 6px; }

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.4);
  padding: 14px 12px 6px;
}
.sidebar-groups > .sidebar-section-label:first-child { padding-top: 2px; }

/* ---------- صفحة تسجيل الدخول ---------- */
.login-card { max-width: 440px; margin: 0 auto; }
.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dark-green);
  margin-bottom: 8px;
}
.login-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s ease;
}
.login-field input:focus { outline: none; border-color: var(--primary); }

.demo-account-box {
  background: rgba(44,110,158,.06);
  border: 1px dashed var(--blue);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 20px;
  font-size: 13px;
}
.demo-account-box strong { display: block; color: var(--blue); margin-bottom: 6px; font-size: 13px; }
.demo-account-box .demo-account-row { color: var(--text-muted); margin-bottom: 2px; }
.demo-account-box .demo-account-row b { color: var(--dark-green); font-family: monospace, monospace; }
.demo-account-box button { margin-top: 10px; }

/* =====================================================
   المرحلة السادسة — وضع العرض التقديمي وبوابة الدخول (Phase 6)
   إضافات فقط، لا تعديل على القواعد الحالية أعلاه
===================================================== */

/* ---------- نافذة تأكيد بدء العرض (بوابة index.html) ---------- */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,59,38,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 90;
}
.confirm-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.confirm-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.confirm-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
}

/* ---------- مؤشر وضع العرض ---------- */
.presentation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(217,142,41,.14);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.presentation-reset-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(217,142,41,.85);
  text-decoration: underline;
}
.presentation-reset-link:hover { color: var(--gold); }
.presentation-reset-inline {
  font-size: 12px;
  color: var(--gold);
  text-decoration: underline;
  align-self: center;
}
.presentation-reset-inline:hover { filter: brightness(.9); }

/* ---------- مؤشر مسار العرض التوضيحي (Journey Stepper) ---------- */
.journey-stepper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.journey-stepper .step {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.journey-stepper .step.is-current {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  font-weight: 800;
}
.journey-stepper .step-arrow { color: var(--border); font-size: 12px; }

/* ---------- لمحة التقييم التشخيصي (Diagnostic Snapshot) ---------- */
.diagnostic-bar-row { margin-bottom: 14px; }
.diagnostic-bar-row:last-child { margin-bottom: 0; }
.diagnostic-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.diagnostic-bar-head span:first-child { color: var(--dark-green); font-weight: 700; }
.diagnostic-bar-head span:last-child { color: var(--text-muted); font-weight: 700; }

@media (max-width: 520px) {
  .journey-stepper .step { font-size: 10.5px; padding: 5px 10px; }
}
