/* ==========================================================================
   منصتي — نظام التصميم المحسّن
   ========================================================================== */

:root {
  --ink: #0B1F2E;
  --ink-soft: #142C3F;
  --ink-deep: #060F18;
  /* سطوح "نيڤي" ثابتة — دايمًا كحلي غامق في الوضعين، مستخدمة للأجزاء اللي خلفيتها
     دايمًا غامقة (الهيدر، الشريط الجانبي، الهيرو، الفوتر) عشان متنقلبش بيضا في الوضع الليلي */
  --navy: #0B1F2E;
  --navy-soft: #142C3F;
  --navy-deep: #060F18;
  --gold: #D4A843;
  --gold-soft: #FDF6E7;
  --gold-deep: #A07B1F;
  --gold-light: #F5E4B0;
  --teal: #1E7A6A;
  --teal-soft: #E6F4F1;
  --teal-deep: #145548;
  --paper: #F5F6F4;
  --line: #E2E4DF;
  --text-muted: #667080;
  --danger: #C0392B;
  --danger-soft: #FBEAE7;
  --white: #FFFFFF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-sm: 0 2px 8px rgba(11,31,46,0.07);
  --shadow-md: 0 8px 28px rgba(11,31,46,0.11);
  --shadow-lg: 0 20px 52px rgba(11,31,46,0.18);
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.muted { color: var(--text-muted); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-deep); background: var(--gold-soft);
  padding: 5px 13px; border-radius: 20px; border: 1px solid var(--gold-light);
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 28px; }

/* ========== NAVBAR ========== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,31,46,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-brand {
  font-family: 'Tajawal', sans-serif; font-weight: 900; font-size: 20px;
  color: #fff; display: flex; align-items: center; gap: 2px; text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.is-active { color: #fff; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-burger {
  display: none; background: transparent; border: none; color: #fff; cursor: pointer;
  padding: 8px; border-radius: 8px;
}

.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); padding: 6px 12px 6px 8px; border-radius: 30px;
  cursor: pointer; color: #fff; font-size: 13.5px; transition: background .15s var(--ease);
}
.user-chip:hover { background: rgba(255,255,255,0.12); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.user-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); min-width: 196px; padding: 8px;
  display: none; z-index: 50;
}
.user-dropdown.is-open { display: block; animation: fadeUp .2s var(--ease); }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: right; background: none;
  border: none; padding: 10px 12px; border-radius: 9px; font-size: 13.5px; color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--paper); }
.user-dropdown .danger { color: var(--danger); }
.user-dropdown hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.badge-admin {
  background: rgba(212,168,67,0.2); color: var(--gold-deep); font-size: 11px; padding: 3px 10px;
  border-radius: 20px; font-weight: 700;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Tajawal', sans-serif; font-weight: 700; font-size: 14px; cursor: pointer;
  border-radius: 11px; padding: 12px 24px; border: none;
  transition: all .18s var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-soft); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover:not(:disabled) { background: #c49930; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,168,67,0.35); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); background: rgba(11,31,46,0.04); }
.btn-outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.28); }
.btn-outline-light:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #f3d5cf; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: rgba(11,31,46,0.06); }
.btn-sm { padding: 8px 16px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 15px 32px; font-size: 15.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: 9px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; animation: spin .7s linear infinite;
}
.spinner.dark { border: 2px solid rgba(11,31,46,0.15); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== FORMS ========== */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,168,67,0.18);
}
.input-group { position: relative; }
.input-group input { padding-left: 42px; }
.input-toggle {
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%); background: none; border: none;
  cursor: pointer; color: var(--text-muted); padding: 8px; border-radius: 6px; display: flex;
}
.input-toggle:hover { color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.full { grid-template-columns: 1fr; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin: 0; font-size: 13.5px; }
.strength-meter { display: flex; gap: 4px; margin-top: 8px; }
.strength-meter i { height: 4px; flex: 1; background: var(--line); border-radius: 2px; transition: background .2s; }

/* ========== CARDS & BADGES ========== */
.card { background: #fff; border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--line); }
.card h2 { font-size: 16px; margin-bottom: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px;
}
.badge-teal { background: var(--teal-soft); color: var(--teal-deep); }
.badge-gold { background: var(--gold-soft); color: var(--gold-deep); }
.badge-muted { background: rgba(102,112,128,0.1); color: var(--text-muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ========== PROGRESS + PATH ========== */
.progress-track { height: 7px; background: var(--line); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 20px; transition: width .5s var(--ease); }
.progress-track.sm { height: 5px; }

.path-thread { position: relative; display: flex; flex-direction: column; }
.path-node {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 3px 0 26px;
}
.path-node:last-child { padding-bottom: 3px; }
.path-node::before {
  content: ""; position: absolute; right: 15px; top: 32px; bottom: -3px; width: 2px;
  background: var(--line);
}
.path-node:last-child::before { display: none; }
.path-node.is-done::before { background: var(--teal); }
.path-dot {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12.5px; font-weight: 700; z-index: 1; border: 2px solid var(--line);
  background: #fff; color: var(--text-muted); transition: all .2s var(--ease);
}
.path-node.is-done .path-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.path-node.is-current .path-dot { border-color: var(--gold); color: var(--gold-deep); box-shadow: 0 0 0 4px var(--gold-soft); }
.path-node .path-body { flex: 1; padding-top: 4px; cursor: pointer; }
.path-node .path-title { font-size: 13.5px; font-weight: 500; }
.path-node.is-current .path-title { font-weight: 700; }
.path-node .path-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.mini-thread { display: flex; align-items: center; gap: 3px; }
.mini-thread i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.mini-thread i.filled { background: var(--teal); }

/* ========== STAT CARDS ========== */
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-family: 'Tajawal', sans-serif; font-weight: 900; font-size: 22px; color: var(--ink); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ========== STARS ========== */
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars.interactive i { cursor: pointer; }
.rating-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rating-line .num { font-weight: 700; color: var(--ink); }

/* ========== TABS ========== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-btn {
  padding: 12px 18px; background: none; border: none; cursor: pointer; white-space: nowrap;
  font-family: 'Tajawal', sans-serif; font-weight: 600; font-size: 13.5px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--gold); }
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .3s var(--ease); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: right; padding: 10px 8px; color: var(--text-muted); font-weight: 500; border-bottom: 1.5px solid var(--line); font-size: 12px; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.action-btn { background: none; border: none; cursor: pointer; font-size: 12.5px; padding: 5px 9px; border-radius: 6px; font-weight: 600; }
.action-btn.delete { color: var(--danger); }
.action-btn.delete:hover { background: var(--danger-soft); }
.action-btn.toggle { color: var(--teal); }
.action-btn.toggle:hover { background: var(--teal-soft); }
.thumb-cell { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--paper); }

/* ========== EMPTY + LOADING ========== */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state .icon { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--line); }
.empty-state h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 24px; font-size: 13px; }

.skeleton {
  background: linear-gradient(100deg, var(--line) 30%, #eaecea 50%, var(--line) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-md);
}
.skel-card { height: 240px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ========== TOAST ========== */
#toastHost { position: fixed; bottom: 22px; left: 22px; z-index: 999; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.toast {
  background: var(--navy); color: #fff; padding: 13px 16px; border-radius: 11px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s var(--ease);
}
.toast.success { background: var(--teal-deep); }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ========== ANIMATIONS ========== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s var(--ease) both; }
.stagger > * { opacity: 0; animation: fadeUp .5s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }
.stagger > *:nth-child(5) { animation-delay: .28s; }
.stagger > *:nth-child(6) { animation-delay: .34s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ========== MOBILE NAV ========== */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; top: 66px; right: 0; left: 0; background: var(--navy); flex-direction: column;
    align-items: stretch; padding: 10px 16px 18px; gap: 2px; display: none; box-shadow: var(--shadow-lg);
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links.is-open { display: flex; }
  .nav-burger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
}

/* ========== NOTIFICATIONS ========== */
.notif-bell { position: relative; }
.bell-btn {
  position: relative; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background .15s;
}
.bell-btn:hover { background: rgba(255,255,255,0.12); }
.notif-badge {
  position: absolute; top: -3px; left: -3px; background: var(--danger); color: #fff; font-size: 10px;
  font-weight: 700; min-width: 17px; height: 17px; border-radius: 20px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; border: 2px solid var(--ink);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); width: 320px; max-height: 380px;
  overflow-y: auto; display: none; z-index: 50;
}
.notif-dropdown.is-open { display: block; animation: fadeUp .2s var(--ease); }
.notif-dropdown .nd-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-dropdown .nd-head strong { font-size: 13.5px; }
.notif-dropdown .nd-head button { background: none; border: none; color: var(--teal); font-size: 12px; cursor: pointer; font-weight: 600; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--gold-soft); }
.notif-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 5px; }
.notif-item .body p { color: var(--ink); line-height: 1.5; }
.notif-item .body span { color: var(--text-muted); font-size: 11px; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ========== FAV BTN ========== */
.fav-btn {
  background: #fff; border: 1.5px solid var(--line); width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted);
  transition: all .15s; flex-shrink: 0;
}
.fav-btn:hover { border-color: var(--danger); color: var(--danger); }
.fav-btn.is-fav { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.fav-btn-card { position: absolute; top: 12px; left: 12px; z-index: 2; box-shadow: var(--shadow-sm); }

/* ========== ADMIN LAYOUT ========== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 244px; flex-shrink: 0; background: var(--navy); color: #fff; padding: 20px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .side-brand { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 22px; }
.admin-sidebar .side-brand a { font-family: 'Tajawal', sans-serif; font-weight: 900; font-size: 18px; color: #fff; text-decoration: none; }
.admin-sidebar .side-brand a span { color: var(--gold); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px; color: rgba(255,255,255,0.65);
  font-size: 13.5px; font-weight: 500; cursor: pointer; background: none; border: none; text-align: right;
  width: 100%; transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.side-link.active { background: rgba(212,168,67,0.15); color: var(--gold); }
.side-link .side-count { margin-right: auto; font-size: 10.5px; background: rgba(255,255,255,0.1); padding: 1px 7px; border-radius: 20px; }
.side-link.active .side-count { background: rgba(212,168,67,0.25); }
.side-foot { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 12px; margin-top: 10px; }

.admin-main { flex: 1; min-width: 0; background: var(--paper); }
.admin-topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { font-size: 17px; }
.admin-content { padding: 26px; max-width: 1100px; }
.sidebar-burger { display: none; }
.admin-topbar .nav-burger { color: var(--ink); }
[data-theme="dark"] .admin-topbar { background: #1a1f2e; }

@media (max-width: 980px) {
  .admin-sidebar { position: fixed; right: 0; top: 0; z-index: 200; transform: translateX(100%); transition: transform .2s var(--ease); box-shadow: var(--shadow-lg); }
  .admin-sidebar.is-open { transform: translateX(0); }
  .sidebar-burger { display: flex; }
  .admin-content { padding: 18px; }
}

/* ========== Q&A ========== */
.qa-form { display: flex; gap: 10px; margin-bottom: 20px; align-items: flex-end; }
.qa-form textarea { flex: 1; min-height: 52px; resize: vertical; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 11px; font-family: inherit; font-size: 13.5px; transition: border-color .15s; }
.qa-form textarea:focus { outline: none; border-color: var(--gold); }
.qa-form .btn { flex-shrink: 0; height: 44px; width: 44px; padding: 0; }
.qa-thread { display: flex; flex-direction: column; gap: 14px; }
.qa-item { display: flex; gap: 12px; }
.qa-item .qa-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.qa-item.is-teacher .qa-avatar { background: var(--gold); color: var(--navy); }
.qa-body { flex: 1; background: var(--paper); border-radius: 12px; padding: 12px 14px; }
.qa-body .qa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 12.5px; }
.qa-body .qa-head strong { font-size: 13px; }
.qa-body .qa-head span { color: var(--text-muted); font-size: 11px; }
.qa-body p.msg { font-size: 13.5px; line-height: 1.6; }
.qa-replies { margin-right: 26px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.qa-reply-form { display: none; margin-right: 26px; margin-top: 10px; gap: 8px; align-items: flex-end; }
.qa-reply-form textarea { flex: 1; min-height: 40px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 13px; }
.qa-reply-form textarea:focus { outline: none; border-color: var(--gold); }
.qa-reply-toggle { background: none; border: none; color: var(--teal); font-size: 12px; font-weight: 600; cursor: pointer; margin-top: 6px; padding: 0; }

.path-node.exam-node .path-dot { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-deep); font-size: 11px; }

/* ========== STATIC PAGES ========== */
.static-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); padding: 60px 0; text-align: center; }
.static-hero h1 { color: #fff; font-size: 30px; margin-bottom: 10px; }
.static-hero p { color: rgba(255,255,255,0.65); font-size: 14.5px; max-width: 520px; margin: 0 auto; }

.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.value-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.value-card .feature-icon { margin: 0 auto 14px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; align-items: start; }
.contact-info-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.contact-info-item .stat-icon { flex-shrink: 0; }

.cp-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); padding: 44px 0; }
.cp-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.cp-title h1 { color: #fff; font-size: 26px; margin-bottom: 10px; }
.cp-title p { color: rgba(255,255,255,0.68); font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.cp-buybox { background: #fff; border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg); position: sticky; top: 84px; }
.cp-buybox .price-big { font-family: 'Tajawal', sans-serif; font-weight: 900; font-size: 26px; margin-bottom: 14px; }
.syllabus-item { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.syllabus-item:last-child { border-bottom: none; }
.syllabus-item .n { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

@media (max-width: 900px) {
  .value-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .cp-grid { grid-template-columns: 1fr; }
  .cp-buybox { position: static; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 14px; height: 60px; }
  .container, .container-narrow { padding: 0 16px; }
  .nav-right { gap: 6px; }
  .nav-brand { font-size: 17px; }
  #userChipName { display: none; }
  .btn-lg { padding: 12px 18px; font-size: 13.5px; }
  .static-hero h1, .cp-title h1 { font-size: 22px; }
  .card, .cp-section { padding: 16px; }
  .admin-content { padding: 12px; }
  .form-row { gap: 10px; }
}

/* ========== SHARED COMPONENTS ========== */
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-deep); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-card h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); border-radius: var(--radius-xl);
  padding: 60px 48px; text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; font-size: 28px; margin-bottom: 12px; }
.cta-band p { color: rgba(255,255,255,0.62); margin-bottom: 28px; font-size: 15px; }
.cta-band::before { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border: 1px solid rgba(212,168,67,0.18); border-radius: 50%; }
.cta-band::after { content: ""; position: absolute; left: -40px; bottom: -50px; width: 200px; height: 200px; border: 1px solid rgba(255,255,255,0.05); border-radius: 50%; }

.site-footer { background: var(--ink-deep); color: rgba(255,255,255,0.5); padding: 50px 0 28px; margin-top: 36px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 28px; padding-bottom: 30px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 13.5px; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 22px; font-size: 12.5px; text-align: center; }

/* ========== DARK MODE ========== */
[data-theme="dark"] {
  --ink: #e8eaf0;
  --ink-deep: #f4f5f8;
  --ink-soft: #9ba3b4;
  --text-muted: #6b7280;
  --paper: #1a1f2e;
  --line: #2a3145;
  --gold: #d4a843;
  --gold-soft: rgba(212,168,67,.14);
  --gold-deep: #b88e30;
  --teal: #2ec4b6;
  --teal-soft: rgba(46,196,182,.11);
  --teal-deep: #25a99d;
  --danger-soft: rgba(185,28,28,.15);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,.5);
}
[data-theme="dark"] body { background: #111724; color: var(--ink); }
[data-theme="dark"] .navbar { background: rgba(17,23,36,0.97); border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .card, [data-theme="dark"] .cp-section { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .btn-outline:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select { background: #111724; color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .course-card { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .q-option { background: #111724; border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .qa-body { background: #111724; }
[data-theme="dark"] .assign-q { background: #111724; }
[data-theme="dark"] .resource-item { background: #111724; border-color: var(--line); }
[data-theme="dark"] .ann-item { background: #111724; }
[data-theme="dark"] .site-footer { background: #0a0f1a; }
[data-theme="dark"] .notif-dropdown { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .notif-item { border-color: var(--line); }
[data-theme="dark"] table thead tr { background: #111724; }
[data-theme="dark"] table tbody tr:nth-child(even) { background: #151b28; }
[data-theme="dark"] .chip { background: #1a1f2e; border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .search-box input, [data-theme="dark"] .toolbar select { background: #1a1f2e; }
[data-theme="dark"] .skeleton { background: linear-gradient(100deg, #2a3145 30%, #333d56 50%, #2a3145 70%); }
[data-theme="dark"] .feature-card, [data-theme="dark"] .stat-card { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .continue-card { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .path-dot { background: #1a1f2e; }
[data-theme="dark"] .stat-icon[style*="rgba(15,37,54"], [data-theme="dark"] .feature-icon[style*="rgba(15,37,54"] { background: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .cp-buybox,
[data-theme="dark"] .value-card,
[data-theme="dark"] .course-header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .main-content,
[data-theme="dark"] .path-thread,
[data-theme="dark"] .lock-box {
  background: #1a1f2e; border-color: var(--line);
}
[data-theme="dark"] .how-num { background: #1a1f2e; border-color: var(--line); }
[data-theme="dark"] .video-fallback { background: rgba(212,168,67,.14); }
[data-theme="dark"] .result-circle > div { background: #1a1f2e !important; }

.theme-toggle {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 9px;
  padding: 7px 11px; cursor: pointer; color: #fff; font-size: 14px;
  display: flex; align-items: center; transition: all .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); }

.notif-badge-pulse { animation: pulse-badge 1.5s infinite; }
@keyframes pulse-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

#studentDetailModal { cursor: pointer; }
#studentDetailModal > div { cursor: default; }

/* ========== COURSE PAGE SPECIFICS ========== */
main { max-width: 1140px; margin: 0 auto; padding: 28px 28px 70px; }
.course-header { background: #fff; padding: 26px 28px; border-radius: var(--radius-lg); margin-bottom: 22px; border: 1px solid var(--line); }
.course-header .top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.course-header h1 { font-size: 20px; margin-bottom: 8px; }
.course-header p.desc { color: var(--text-muted); font-size: 13.5px; max-width: 640px; line-height: 1.7; }
.course-header .tags-row { display: flex; gap: 6px; margin-bottom: 10px; }
.header-progress { min-width: 200px; }
.header-progress .pct-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.header-progress b { font-family: 'Tajawal', sans-serif; }

