/* أكاديمية مسار — الواجهة
   الهوية: أخضر النخلة، ذهبي الميزان، كريمي الورق الرسمي */
:root {
  --green-900: #16301F; --green-800: #1F3A26; --green-700: #23462A; --green-600: #2F5A37; --green-500: #374238;
  --olive: #55665A; --gold: #DD9B27; --gold-600: #B67A12; --gold-700: #8C5E0F; --gold-100: #F6E8CC;
  --cream: #FBFAF7; --paper: #FFFFFF; --sand: #F4F2ED; --line: #E5E1D8; --line-2: #D6D0C3;
  --ink: #1E2A21; --ink-2: #4A554B; --ink-3: #7A847B;
  --ok: #2F7A4B; --ok-bg: #E6F1E9; --warn: #A86A08; --warn-bg: #FBF0DA; --bad: #A33B2B; --bad-bg: #F7E3DF; --info-bg: #EEF0EA;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(22, 48, 31, .06), 0 6px 18px rgba(22, 48, 31, .07);
  --kufi: 'Noto Kufi Arabic', 'Cairo', Tahoma, sans-serif; --body: 'Cairo', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); color: var(--ink); background: var(--cream); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-600); }
h1, h2, h3, h4 { font-family: var(--kufi); margin: 0; line-height: 1.45; color: var(--green-800); }
:focus-visible { outline: 3px solid rgba(221, 155, 39, .55); outline-offset: 2px; border-radius: 6px; }

.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--cream); z-index: 50; transition: opacity .3s; }
.boot img { width: 64px; animation: pulse 1.4s ease-in-out infinite; }
.boot span { font-family: var(--kufi); font-weight: 700; color: var(--green-700); }
.boot.gone { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- الدخول ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 480px) 1fr; }
.auth-side { position: relative; overflow: hidden; background: var(--green-800); color: #F3EFE3; padding: 56px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 85%, rgba(221, 155, 39, .18), transparent 45%), radial-gradient(circle at 95% 5%, rgba(255, 255, 255, .06), transparent 40%); }
.auth-side .wm { position: absolute; left: -60px; bottom: -40px; width: 340px; opacity: .07; }
.auth-side > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { width: 46px; }
.auth-brand b { font-family: var(--kufi); font-size: 19px; display: block; color: #fff; }
.auth-brand small { color: #C9CFC4; font-size: 13px; }
.auth-side h1 { color: #fff; font-size: 30px; margin-bottom: 12px; }
.auth-side h1 em { font-style: normal; color: var(--gold); }
.auth-side p { color: #D3D8CF; margin: 0 0 22px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #E7E3D6; }
.auth-points i { color: var(--gold); font-size: 18px; }
.auth-foot { font-size: 12px; color: #A9B2A6; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; background: var(--cream); background-image: radial-gradient(rgba(221, 155, 39, .10) 1.2px, transparent 1.3px); background-size: 26px 26px; }
.auth-card { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 32px; border-top: 5px solid var(--gold); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-3); margin: 0 0 22px; font-size: 14px; }

/* ---------- عناصر النماذج ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-sm); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(221, 155, 39, .18); }
textarea.input { min-height: 180px; resize: vertical; line-height: 1.9; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px; margin-bottom: 12px; display: none; }
.err.show { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 16px; font-weight: 700; cursor: pointer; background: var(--sand); color: var(--green-800); text-decoration: none; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: #ECE8DF; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--green-700); color: #fff; }
.btn.primary:hover { background: var(--green-800); }
.btn.gold { background: var(--gold); color: var(--green-900); }
.btn.gold:hover { background: #D08E1C; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; }
.btn i { font-size: 1.1em; }

/* ---------- الهيكل ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--green-800); color: #E8E5DA; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; }
.side-brand img { width: 34px; }
.side-brand b { font-family: var(--kufi); color: #fff; font-size: 15px; display: block; line-height: 1.3; }
.side-brand small { color: #B9C1B5; font-size: 11.5px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #DAD8CD; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav a i { font-size: 18px; color: #A7B0A3; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(221, 155, 39, .16); color: #fff; }
.nav a.on i { color: var(--gold); }
.nav .badge { margin-inline-start: auto; background: var(--gold); color: var(--green-900); border-radius: 20px; font-size: 11.5px; padding: 0 8px; font-weight: 800; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px 8px 0; display: grid; gap: 8px; }
.me { display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--green-900); display: grid; place-items: center; font-weight: 800; font-family: var(--kufi); flex: none; }
.me b { display: block; color: #fff; font-size: 13.5px; line-height: 1.3; }
.me small { color: #AEB7AA; font-size: 12px; }
.side-foot .btn { background: rgba(255, 255, 255, .06); color: #E8E5DA; justify-content: flex-start; }
.side-foot .btn:hover { background: rgba(255, 255, 255, .12); }

.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 30px 38px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.crumb a { color: var(--gold-700); text-decoration: none; font-weight: 700; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 16.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 i { color: var(--gold); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(145deg, #2F7A4B, #1F4D2E); color: #F5F2EA; flex: none; }
.kpi .ic.gold { background: linear-gradient(145deg, #E9C78F, #DD9B27); color: var(--green-900); }
.kpi .ic.olive { background: linear-gradient(145deg, #55665A, #384339); color: #E2B681; }
.kpi b { font-family: var(--kufi); font-size: 24px; color: var(--green-800); display: block; line-height: 1.2; }
.kpi span { color: var(--ink-3); font-size: 13px; }

.hero { background: var(--green-800); color: #EDEAE0; border-radius: 18px; padding: 26px 28px; position: relative; overflow: hidden; display: flex; gap: 24px; align-items: center; }
.hero::after { content: ""; position: absolute; left: -40px; top: -60px; width: 260px; height: 260px; border: 6px solid rgba(221, 155, 39, .45); border-radius: 50%; }
.hero .wm { position: absolute; left: 30px; bottom: -30px; width: 150px; opacity: .08; }
.hero h2 { color: #fff; font-size: 22px; margin-bottom: 6px; }
.hero p { margin: 0 0 14px; color: #D2D7CD; }
.hero .eyebrow { color: var(--gold); font-weight: 800; font-family: var(--kufi); font-size: 13px; margin-bottom: 4px; }
.hero > div { position: relative; z-index: 1; }
.ring { --p: 0; width: 108px; height: 108px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 84px; height: 84px; border-radius: 50%; background: var(--green-800); display: grid; place-items: center; text-align: center; line-height: 1.2; }
.ring b { font-family: var(--kufi); font-size: 22px; color: #fff; display: block; }
.ring small { font-size: 11px; color: #C3CABF; }

/* ---------- الدروس ---------- */
.level { margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; font-family: var(--kufi); font-weight: 700; color: var(--gold-700); font-size: 14px; }
.level::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.lesson { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; position: relative; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; border-top: 4px solid var(--gold); }
.lesson:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 48, 31, .10); }
.lesson.locked { border-top-color: var(--line-2); background: #FAF9F6; }
.lesson.locked .ln { background: var(--sand); color: var(--ink-3); }
.lesson .top { display: flex; gap: 10px; align-items: flex-start; }
.ln { width: 38px; height: 38px; border-radius: 10px; background: var(--green-700); color: #fff; display: grid; place-items: center; font-family: var(--kufi); font-weight: 800; flex: none; }
.lesson h4 { font-size: 15px; color: var(--green-800); }
.lesson .sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.lesson .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.lesson .acts { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.bar { height: 6px; background: var(--sand); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 1px 10px; font-size: 12px; font-weight: 700; background: var(--info-bg); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.gold { background: var(--gold-100); color: var(--gold-700); }
.chip.dark { background: var(--green-700); color: #fff; }

/* ---------- الجداول ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: #F1EDE3; color: var(--green-800); font-weight: 800; text-align: right; padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; font-family: var(--kufi); font-size: 12.5px; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #FCFBF8; }
.tbl .num { text-align: center; font-variant-numeric: tabular-nums; }
.tbl.book th, .tbl.book td { text-align: center; padding: 8px 6px; }
.tbl.book td:first-child, .tbl.book th:first-child { text-align: right; position: sticky; right: 0; background: #fff; z-index: 2; min-width: 170px; }
.tbl.book th:first-child { background: #F1EDE3; z-index: 3; }
.cell { display: grid; gap: 2px; font-size: 12px; line-height: 1.35; }
.cell b { font-weight: 800; }
.sc-hi { color: var(--ok); } .sc-mid { color: var(--warn); } .sc-lo { color: var(--bad); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty i { font-size: 38px; color: var(--line-2); display: block; margin-bottom: 6px; }

/* ---------- عارض العروض ---------- */
.viewer { display: grid; gap: 12px; }
.stage-wrap { background: #E9E6DE; border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--cream); box-shadow: 0 8px 26px rgba(22, 48, 31, .16); direction: ltr; }
.stage .slide-host { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.slide-host section { position: relative; width: 1920px; height: 1080px; box-sizing: border-box; overflow: hidden; text-rendering: optimizeLegibility; }
.slide-host section > * { position: relative; }
.slide-host section > svg, .slide-host section > img[alt=""], .slide-host section [style*="position:absolute"] { position: absolute; }
.slide-host p, .slide-host h1, .slide-host h2, .slide-host h3 { margin: 0; }
.slide-host table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.slide-host th, .slide-host td { padding: 14px 22px; vertical-align: top; line-height: 1.5; }
.slide-host td { border-top: 1px solid rgba(35, 64, 42, .12); }
.stage:fullscreen { border-radius: 0; background: #111; }
.vbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vbar .count { font-family: var(--kufi); font-weight: 700; color: var(--green-800); min-width: 84px; text-align: center; }
.vbar .prog { flex: 1; min-width: 120px; }
.notes { background: #FFF9EC; border: 1px solid #F0DDB4; border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; font-size: 14.5px; }
.notes b { color: var(--gold-700); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: 12px; cursor: pointer; }
.thumbs button.on { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.thumbs button.t { border-style: dashed; border-color: var(--gold); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--green-800); border-color: var(--gold); }

/* ---------- الاختبار ---------- */
.quiz-q { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.quiz-q h4 { font-size: 15.5px; margin-bottom: 12px; display: flex; gap: 10px; }
.quiz-q h4 span { width: 28px; height: 28px; border-radius: 8px; background: var(--gold-100); color: var(--gold-700); display: grid; place-items: center; flex: none; font-size: 13px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin-top: 8px; font-size: 14px; line-height: 1.75; background: #fff; }
.opt:hover { border-color: var(--gold); }
.opt input { margin-top: 6px; accent-color: var(--green-700); flex: none; }
.opt.sel { border-color: var(--green-600); background: #F2F7F1; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.timer { position: sticky; top: 10px; z-index: 5; display: inline-flex; gap: 8px; align-items: center; background: var(--green-800); color: #fff; border-radius: 30px; padding: 6px 16px; font-family: var(--kufi); font-weight: 700; box-shadow: var(--shadow); }
.timer.low { background: var(--bad); }

/* ---------- التصحيح ---------- */
.rubric { display: grid; gap: 10px; }
.rub { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; background: var(--sand); border-radius: 10px; padding: 8px 12px; }
.rub b { font-size: 14px; }
.rub small { color: var(--ink-3); display: block; font-size: 12px; }
.total-box { display: flex; justify-content: space-between; align-items: center; background: var(--green-800); color: #fff; border-radius: 12px; padding: 12px 16px; font-family: var(--kufi); }
.total-box b { font-size: 24px; color: var(--gold); }
.answer-body { white-space: pre-wrap; background: #FFFEFB; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; line-height: 2; max-height: 520px; overflow: auto; }
.file-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; text-decoration: none; color: var(--green-800); font-weight: 700; }
.file-pill i { color: var(--gold); font-size: 20px; }
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--ink-3); cursor: pointer; background: #FFFEFB; }
.drop.on { border-color: var(--gold); background: #FFF8EA; }
.drop i { font-size: 28px; color: var(--gold); display: block; }

/* ---------- نوافذ ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 28, 19, .45); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); border-top: 5px solid var(--gold); }
.modal.wide { width: min(860px, 100%); }
.modal header { padding: 18px 22px 6px; display: flex; justify-content: space-between; align-items: center; }
.modal header h3 { font-size: 18px; }
.modal .body { padding: 10px 22px 8px; }
.modal footer { padding: 12px 22px 18px; display: flex; gap: 8px; justify-content: flex-start; }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink-3); }
@keyframes fade { from { opacity: 0; } }
.cred { background: var(--sand); border: 1px dashed var(--gold); border-radius: 12px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: left; white-space: pre-wrap; font-size: 13.5px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); background: var(--green-800); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; z-index: 60; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

.copyright { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); text-align: center; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 30; transform: translateX(100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--green-800); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar img { width: 26px; }
  .topbar b { font-family: var(--kufi); }
  .topbar button { margin-inline-start: auto; background: none; border: 0; color: #fff; font-size: 24px; }
  .page { padding: 20px 16px 50px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; }
  .auth-side .hide-m { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .stage-wrap { padding: 6px; }
}
@media print { .side, .topbar, .btn { display: none !important; } .shell { display: block; } }

/* ---------- النشر ---------- */
.togs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tog { display: grid; justify-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px; border: 1px dashed var(--line-2); background: #fff; cursor: pointer; font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.tog i { font-size: 17px; }
.tog b { font-size: 11px; font-weight: 800; }
.tog.on { border: 1px solid var(--ok); background: var(--ok-bg); color: var(--ok); }
.tog:hover { border-color: var(--gold); }

/* ---------- شريط الجلسة المباشرة ---------- */
.livebar { display: flex; align-items: center; gap: 10px; background: #7A2620; color: #fff; padding: 10px 16px; text-decoration: none; font-size: 14.5px; position: sticky; top: 0; z-index: 15; }
.livebar.trainer { border-radius: 12px; margin-bottom: 14px; position: static; }
.livebar .btn { margin-inline-start: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #FF5A4E; box-shadow: 0 0 0 0 rgba(255, 90, 78, .7); animation: blink 1.6s infinite; vertical-align: middle; }
.dot.on { background: var(--ok); animation: none; }
.tbl .dot:not(.on), .live-side .dot:not(.on) { background: var(--line-2); animation: none; }
@keyframes blink { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 78, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 90, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0); } }

/* ---------- الجلسة المباشرة ---------- */
.live-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.live-top h1 { font-size: 21px; }
.live-top .crumb { color: #A33B2B; font-weight: 800; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.live-main { display: grid; gap: 10px; }
.live-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 12px 14px; }
.live-side .tabs { margin-bottom: 10px; }
.live-side .tabs a { cursor: pointer; padding: 7px 9px; font-size: 13.5px; }
.board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 3; }
.stage-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: var(--green-800); color: #fff; text-align: center; z-index: 4; }
.stage-msg i { font-size: 46px; color: var(--gold); }
.stage-msg b { font-family: var(--kufi); font-size: 22px; }
.stage-msg span { color: #CBD2C6; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 2px var(--gold); }
.qlist { display: grid; gap: 8px; }
.q { background: var(--sand); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.q p { margin: 2px 0 4px; white-space: pre-wrap; }
.q.done { opacity: .65; }
.q.hid { opacity: .45; border: 1px dashed var(--line-2); }
.poll { background: var(--sand); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.pbar { display: grid; gap: 3px; font-size: 14px; }
.pbar.mine b, .pbar.mine span:first-child { color: var(--green-700); font-weight: 800; }
.poll .opt { margin-top: 0; }

/* ---------- حماية المحتوى والعلامة المائية ---------- */
.wm-layer { position: absolute; inset: -20%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 40px 60px; transform: rotate(-24deg); pointer-events: none; z-index: 5; direction: rtl; }
.wm-layer span { font: 700 15px var(--body); color: rgba(31, 58, 38, .10); white-space: nowrap; user-select: none; }
body.protect .stage, body.protect .live-stage, body.protect .slide-host { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect .slide-host img { pointer-events: none; -webkit-user-drag: none; }
@media print { body.protect * { visibility: hidden !important; } body.protect::after { content: "المحتوى للعرض داخل منصة أكاديمية مسار فقط"; visibility: visible; position: fixed; top: 40%; left: 0; right: 0; text-align: center; font-size: 22px; } }

@media (max-width: 980px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-side { position: static; max-height: none; }
  .togs { grid-template-columns: repeat(3, 1fr); }
}
.hands{background:#FFF6E3;border:1px solid #F0D9A8;border-radius:12px;padding:10px 12px;margin-bottom:12px;display:flex;flex-direction:column;gap:8px}
.hands .hrow{display:flex;align-items:center;gap:6px}
.vbar .btn.on{background:var(--gold,#DD9B27);color:#fff}
[hidden] { display: none !important; }
/* غرف الورش */
.room-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.room-head h2 { margin: 2px 0 0; font-family: var(--kufi); font-size: 22px; color: var(--green-800); }
.room-msg { background: #FFF6E3; border: 1px solid #F0D9A8; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.room-grid .stack { display: flex; flex-direction: column; gap: 16px; }
.room-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat { height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.chat .cm { background: var(--cream, #F7F4EC); border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.chat .cm.me { background: #E7EFE4; }
.chat .cm b { font-size: 12px; color: var(--green-800); }
.answer-ed { min-height: 220px; line-height: 1.9; font-size: 15px; margin-top: 10px; }
.answer-ed.ro { background: #F6F4EF; }
.rboard { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); margin-top: 10px; direction: ltr; }
.row.wrap { flex-wrap: wrap; }
.wsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.wsg { display: flex; flex-direction: column; gap: 10px; }
.ans-prev { white-space: pre-wrap; background: #FBFAF6; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; max-height: 220px; overflow-y: auto; font-size: 14px; line-height: 1.8; }
select.mv { border: none; background: transparent; font: inherit; font-size: 12px; color: var(--muted, #777); cursor: pointer; }
.rub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 12px; }
.rub label { display: flex; flex-direction: column; gap: 4px; }
.shown { position: absolute; inset: 0; z-index: 5; background: #FFFEFB; overflow-y: auto; padding: 4% 6%; }
.shown-in { display: flex; flex-direction: column; gap: 6px; }
.shown-in .crumb { font-family: var(--kufi); font-size: 20px; color: var(--green-800); }
.shown-text { white-space: pre-wrap; font-size: clamp(14px, 1.6vw, 22px); line-height: 1.9; margin-top: 8px; }
@media (max-width: 900px) { .room-grid { grid-template-columns: 1fr; } .room-side { position: static; } .rub { grid-template-columns: repeat(2, 1fr); } }
/* ملف القضية */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cdoc { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; transition: transform .15s; }
.cdoc:hover { transform: translateY(-2px); }
.ccode { flex: none; background: var(--green-800); color: #fff; font-family: var(--kufi); font-weight: 700; border-radius: 10px; padding: 8px 10px; min-width: 54px; text-align: center; }
.casedoc { position: relative; overflow: hidden; background: #FFFEFB; border: 1px solid var(--line); border-radius: 16px; padding: 28px 34px; line-height: 1.95; font-size: 15.5px; }
.casedoc .chead { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--gold, #DD9B27); padding-bottom: 14px; margin-bottom: 18px; }
.casedoc .chead h1 { margin: 0; font-family: var(--kufi); font-size: 22px; color: var(--green-800); }
.casedoc h2 { font-family: var(--kufi); font-size: 18px; color: var(--green-800); margin: 22px 0 8px; }
.casedoc h3 { font-size: 16px; color: #8A5A0F; margin: 16px 0 6px; }
.casedoc p { margin: 6px 0; }
.casedoc blockquote { margin: 8px 0; padding: 8px 14px; border-inline-start: 3px solid var(--gold, #DD9B27); background: #FBF7EE; border-radius: 6px; font-family: 'Amiri', serif; font-size: 17px; }
.cnote { display: flex; gap: 8px; background: #EEF3EC; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.cnote i { color: var(--green-800); margin-top: 3px; }
.cfield { display: grid; grid-template-columns: 210px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cfield .lines i { display: block; border-bottom: 1px solid #ccc; height: 26px; }
.ctbl { overflow-x: auto; margin: 8px 0 12px; }
.ctbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ctbl th { background: var(--green-800); color: #fff; padding: 8px 10px; text-align: right; font-weight: 600; }
.ctbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; height: 20px; }
.ctbl tr:nth-child(even) td { background: #FAF8F2; }
.casedoc ul.check { list-style: none; padding: 0; } .casedoc ul.check i { color: var(--gold); margin-inline-end: 6px; }
.csign { display: flex; gap: 20px; margin: 18px 0; } .csign div { flex: 1; text-align: center; font-size: 13px; } .csign span { display: block; border-bottom: 1px solid #999; height: 36px; margin-bottom: 6px; }
.casedoc .wm-layer { position: absolute; inset: 0; transform: none; align-content: space-evenly; z-index: 1; }
.casedoc .wm-layer span { transform: rotate(-24deg); }
.cstrip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.cstrip .chip { text-decoration: none; }
.cmodal { display: grid; grid-template-columns: 240px 1fr; gap: 14px; height: 70vh; }
.clist { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.clist a { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.clist a:hover, .clist a.on { background: #EEF3EC; }
.cview { overflow-y: auto; }
.cview .casedoc { padding: 20px; }
body.protect .casedoc { -webkit-user-select: none; user-select: none; }
@media (max-width: 800px) { .cfield { grid-template-columns: 1fr; } .cmodal { grid-template-columns: 1fr; height: auto; } .clist { max-height: 160px; } .casedoc { padding: 18px; } }
.modal.wide:has(.cmodal) { width: min(1200px, 100%); }
