/* ───────── الألوان ───────── */
:root {
  --bg: #f3f6f1; --surface: #ffffff; --surface-2: #eaf0ea; --ink: #0e2220; --muted: #526865; --line: #d9e3dc;
  --teal: #0f8583; --teal-soft: #d9f0ee; --green: #5b9a1b; --green-soft: #e4f1d3; --green-ink: #3f7410;
  --danger: #b93232; --danger-soft: #fbe3e3; --warn: #8a5a0b; --warn-soft: #fcefd0;
  --on-accent: #ffffff; --paper: #ffffff; --shadow: 0 1px 0 rgba(14,34,32,.04), 0 8px 24px -12px rgba(14,34,32,.18);
  --brand: linear-gradient(135deg, #0f8583 0%, #5b9a1b 100%);
  --font-head: "Reem Kufi", "Segoe UI", Tahoma, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #051716; --surface: #0b2321; --surface-2: #11302d; --ink: #e5f3ef; --muted: #8fb1ab; --line: #1b4340;
    --teal: #3fd6cf; --teal-soft: #0f3a38; --green: #a8de57; --green-soft: #213d12; --green-ink: #b8e878;
    --danger: #ff8d8d; --danger-soft: #3a1a1a; --warn: #f1c46a; --warn-soft: #3a2c0d;
    --on-accent: #04201e; --shadow: 0 0 0 1px rgba(63,214,207,.06), 0 14px 34px -16px rgba(0,0,0,.7);
    --brand: linear-gradient(135deg, #3fd6cf 0%, #a8de57 100%); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #051716; --surface: #0b2321; --surface-2: #11302d; --ink: #e5f3ef; --muted: #8fb1ab; --line: #1b4340;
  --teal: #3fd6cf; --teal-soft: #0f3a38; --green: #a8de57; --green-soft: #213d12; --green-ink: #b8e878;
  --danger: #ff8d8d; --danger-soft: #3a1a1a; --warn: #f1c46a; --warn-soft: #3a2c0d;
  --on-accent: #04201e; --shadow: 0 0 0 1px rgba(63,214,207,.06), 0 14px 34px -16px rgba(0,0,0,.7);
  --brand: linear-gradient(135deg, #3fd6cf 0%, #a8de57 100%); color-scheme: dark;
}

/* ───────── أساسيات ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.75 var(--font-body); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.35; margin: 0 0 .5em; letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; } span.num, b.num { display: inline-block; } td.num { text-align: right; }
.row { display: flex; align-items: center; } .gap { gap: 12px; } .end { justify-content: flex-end; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; } .grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* ───────── أزرار وحقول ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; transition: transform .12s, background .15s, border-color .15s; text-decoration: none; }
.btn:hover { border-color: var(--teal); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: .9rem; border-radius: 9px; }
.btn.icon { padding: 0; width: 44px; } .btn.sm.icon { width: 34px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.in { width: 100%; min-height: 46px; padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.in:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent); }
textarea.in { min-height: 96px; resize: vertical; line-height: 1.7; }
.in.ltr, .ltr { direction: ltr; text-align: left; }
.err { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 10px; font-size: .92rem; margin-bottom: 14px; }
.hint { color: var(--green-ink); background: var(--green-soft); padding: 10px 14px; border-radius: 10px; font-size: .92rem; }

/* ───────── كروت وشارات ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; font-weight: 600; }
.chip.teal { background: var(--teal-soft); color: var(--teal); } .chip.green { background: var(--green-soft); color: var(--green-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; flex: none; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty p { margin-inline: auto; } /* الفقرة ليها max-width فكانت بتقعد على جنب وبتبعد عن الأيقونة */
.empty .ic { width: 38px; height: 38px; margin-bottom: 8px; color: var(--teal); }
.logo-card { background: var(--paper); border-radius: 22px; border: 1px solid var(--line); display: block; overflow: hidden; }
.logo-card img { display: block; width: 100%; height: auto; }

/* ───────── شاشة الدخول ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-form { padding: clamp(20px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; max-width: 560px; width: 100%; margin-inline: auto; }
.auth-form .logo-card { width: min(250px, 62%); margin-bottom: 22px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin-bottom: 20px; }
.tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.auth-hero { position: sticky; top: 0; align-self: start; height: 100vh; background: #fbfcfa; overflow: hidden; display: grid; place-items: end center; }
:root[data-theme="dark"] .auth-hero { background: #e4efeb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-hero { background: #e4efeb; } }
.auth-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 22%, transparent 46%); mask-image: linear-gradient(to bottom, #000 0, #000 22%, transparent 46%); }
.auth-hero img { position: relative; width: min(100%, 720px); display: block; mix-blend-mode: multiply; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%); mask-image: linear-gradient(to bottom, transparent 0, #000 16%); }
.auth-foot { margin-top: 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: .92rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.code-row { display: grid; grid-template-columns: 1fr 56px auto; gap: 0; align-items: start; }
.code-row .arrow-v { display: none; }
.code-row .arrow-h { width: 56px; height: 130px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(15,133,131,.45); } 50% { box-shadow: 0 0 0 6px rgba(15,133,131,0); } }
.demo-box { margin-top: 20px; border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; font-size: .9rem; }
.demo-box .row { flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ───────── هيكل التطبيق ───────── */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .logo-card { flex: none; width: 150px; max-width: 100%; margin: 0 auto 10px; border-radius: 16px; } /* flex:none عشان اللوجو ما يتضغطش ويتقصّ، وصغّرته عشان القايمة كلها تتحط في الشاشة */
.side .nav { min-height: 40px; padding-block: 8px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; border: 0; background: none; width: 100%; text-align: start; cursor: pointer; min-height: 44px; }
.nav:hover { background: var(--surface-2); }
.nav[aria-current="page"] { background: var(--teal-soft); color: var(--teal); }
.nav .badge { margin-inline-start: auto; background: var(--danger); color: #fff; font-size: .75rem; border-radius: 999px; padding: 0 8px; min-width: 22px; text-align: center; }
.side .spacer { flex: 1; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar .title { font: 700 1.1rem var(--font-head); }
.idpill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.page { padding: clamp(16px, 3vw, 32px); max-width: 1180px; }
.page > h1 { margin-bottom: 18px; }
.tabbar { display: none; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { order: -1; position: relative; height: auto; min-height: 0; max-height: 330px; place-items: end center; }
  .auth-hero img { width: min(100%, 420px); }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 0 0 auto; width: min(300px, 86vw); z-index: 40; box-shadow: -20px 0 60px rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; min-height: 56px; }
  .tabbar a[aria-current="page"] { color: var(--teal); }
  .page { padding-bottom: 96px; }
  .code-row { grid-template-columns: 1fr; } .code-row .arrow-h { display: none; } .code-row .arrow-v { display: block; width: 40px; height: 46px; margin-inline-start: 40px; }
}

/* ───────── الصفحة الرئيسية للطالب ───────── */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.welcome h1 { margin: 0; }
.newsbox { border-inline-start: 5px solid var(--green); background: var(--surface); border-radius: 14px; padding: 16px 20px; margin-bottom: 26px; box-shadow: var(--shadow); }
.newsbox h3 { margin-bottom: 4px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.course { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.course:hover { border-color: var(--teal); transform: translateY(-2px); }
.course .ci { width: 54px; height: 54px; border-radius: 16px 16px 16px 4px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.course .ci .ic { width: 28px; height: 28px; }
.course h3 { margin: 0; }
.ticks { display: flex; gap: 4px; }
.ticks i { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.ticks i.on { background: var(--brand); border-color: transparent; }

/* ───────── الدروس: شريط الـ DNA ───────── */
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .course-layout { grid-template-columns: 1fr; } }
.strand { position: relative; list-style: none; margin: 0; padding: 0; padding-inline-start: 44px; }
.strand::before, .strand::after { content: ""; position: absolute; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; }
.strand::before { inset-inline-start: 8px; background: color-mix(in srgb, var(--teal) 50%, var(--line)); }
.strand::after { inset-inline-start: 26px; background: color-mix(in srgb, var(--green) 50%, var(--line)); }
.lesson { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 6px 0; border-radius: 12px; cursor: pointer; border: 1px solid transparent; width: 100%; background: none; text-align: start; }
.lesson:hover { background: var(--surface-2); }
.lesson[aria-current="true"] { background: var(--surface); border-color: var(--teal); box-shadow: var(--shadow); }
.lesson .rung { position: absolute; inset-inline-start: -44px; top: 50%; width: 38px; height: 20px; transform: translateY(-50%); }
.rung::before { content: ""; position: absolute; inset-inline: 6px; top: 50%; height: 2px; background: var(--line); }
.rung i { position: absolute; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--teal); }
.rung i:first-child { inset-inline-start: 2px; } .rung i:last-child { inset-inline-end: 2px; border-color: var(--green); }
.lesson.done .rung::before { background: var(--brand); }
.lesson.done .rung i:first-child { background: var(--teal); } .lesson.done .rung i:last-child { background: var(--green); }
.lesson[aria-current="true"] .rung i { box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal) 25%, transparent); }
.lesson .kind { color: var(--muted); } .lesson .t { flex: 1; font-weight: 600; }

/* ───────── مشغل الفيديو المحمي ───────── */
.player { position: relative; aspect-ratio: 16 / 9; background: #02100f; border-radius: 16px; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; isolation: isolate; }
.player video, .player canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.player.blocked video, .player.blocked canvas { filter: blur(26px) brightness(.3); }
.wm { position: absolute; z-index: 3; pointer-events: none; color: #fff; font: 600 13px/1.3 var(--font-body); text-shadow: 0 0 4px rgba(0,0,0,.8); opacity: .34; white-space: nowrap; transition: top 1.2s ease, left 1.2s ease; direction: ltr; }
.wm-tile { position: absolute; inset: -20%; z-index: 2; pointer-events: none; opacity: .07; transform: rotate(-24deg); display: grid; grid-template-columns: repeat(4, 1fr); gap: 60px 20px; align-content: space-around; color: #fff; font: 700 15px var(--font-body); direction: ltr; text-align: center; }
.pbar { position: absolute; z-index: 4; inset-inline: 0; bottom: 0; padding: 10px 14px; display: flex; align-items: center; gap: 12px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; direction: ltr; }
.pbar button { background: none; border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.pbar button:hover { background: rgba(255,255,255,.15); }
.pbar input[type=range] { flex: 1; accent-color: var(--teal); }
.player .shade { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; background: rgba(2,16,15,.72); padding: 20px; }
.viewer { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-height: 280px; display: grid; place-items: center; padding: 24px; text-align: center; }
.viewer img, .viewer iframe { max-width: 100%; border: 0; border-radius: 10px; }
.viewer iframe { width: 100%; height: 70vh; }

/* ───────── الامتحانات ───────── */
.timer { position: sticky; top: 66px; z-index: 15; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 700 1.2rem var(--font-head); box-shadow: var(--shadow); direction: ltr; }
.timer.low { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
.qcard { margin: 16px 0; }
.qcard .qh { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.opt { display: flex; gap: 12px; align-items: center; width: 100%; text-align: start; padding: 12px 16px; margin-top: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; min-height: 48px; }
.opt:hover { border-color: var(--teal); }
.opt[aria-checked="true"] { border-color: var(--teal); background: var(--teal-soft); font-weight: 600; }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.opt[aria-checked="true"] .dot { border-color: var(--teal); background: radial-gradient(var(--teal) 45%, transparent 50%); }
.score-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.score-ring b { position: relative; font: 700 1.5rem var(--font-head); }

/* ───────── جداول ───────── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
tr.gone td { opacity: .55; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .in { width: auto; flex: 1; min-width: 180px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 18px; } .stat b { display: block; font: 700 2rem var(--font-head); color: var(--teal); }

/* ───────── شات ───────── */
.chat-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
@media (max-width: 800px) { .chat-wrap { grid-template-columns: 1fr; } }
.threads { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.thread { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: start; cursor: pointer; width: 100%; }
.thread:hover { background: var(--surface-2); } .thread[aria-current="true"] { border-color: var(--teal); background: var(--surface); }
.chat { display: flex; flex-direction: column; height: min(62vh, 560px); }
.msgs { flex: 1; overflow: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 78%; padding: 9px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.bub.me { align-self: flex-end; background: var(--teal-soft); color: var(--ink); border-radius: 16px 16px 4px 16px; }
.bub.note { align-self: stretch; max-width: 100%; background: var(--warn-soft); border-radius: 12px; }
.bub small { display: block; color: var(--muted); font-size: .76rem; }
.composer { display: flex; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.composer .in { flex: 1; min-height: 46px; }

/* ───────── مودال وتوست ───────── */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(3,20,19,.6); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); overflow: auto; }
.modal { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 20px; padding: 26px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: pop .18s ease-out; }
.modal.wide { width: min(860px, 100%); }
.modal .x { position: absolute; inset-inline-end: 12px; top: 12px; width: 36px; height: 36px; border: 0; background: var(--surface-2); border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
#toasts { position: fixed; inset-inline: 0; bottom: 80px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s; }
.toast.bad { background: var(--danger); color: #fff; } .toast.out { opacity: 0; transition: opacity .3s; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot canvas { width: 120px; height: 160px; }
.builder-q { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; background: var(--surface-2); }
.demo-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .85rem; font-weight: 600; padding: 4px 12px; }

@media print { body { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* كارنيه الطالب (رسمة بتشبه الكارنيه الحقيقي) */
.idcard { width: 252px; height: 150px; border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 46% 1fr; direction: ltr; color: #fff;
  background: linear-gradient(120deg, #7a1620 0%, #4a0f18 60%, #2c0a10 100%); box-shadow: 0 10px 24px -12px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15); }
.idcard .ph { position: relative; background: #e9f4f1; }
.idcard .ph img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.idcard .cart { width: 100%; height: 100%; display: block; }
.idcard .rt { display: flex; flex-direction: column; justify-content: space-between; padding: 10px 10px 8px; }
.idcard .lab { background: #fff; border-radius: 8px; padding: 6px 6px 5px; text-align: center; color: #12302c; }
.idcard .bars { height: 40px; background: repeating-linear-gradient(90deg, #12302c 0 2px, transparent 2px 4px, #12302c 4px 5px, transparent 5px 8px, #12302c 8px 11px, transparent 11px 12px); border-radius: 2px; }
.idcard .digits { display: inline-block; margin-top: 4px; font: 700 15px/1 ui-monospace, "Courier New", monospace; letter-spacing: 2px; white-space: nowrap; padding: 3px 6px; border-radius: 5px; background: #d9f0ee; color: #0a5e5c; animation: pulse 2s ease-in-out infinite; }
.idcard .nm { font: 700 11px/1.3 var(--font-head); direction: rtl; text-align: end; opacity: .92; }

/* ───────── الفوتر: بيظهر في آخر الصفحة بس، لما تعمل سكرول لتحت خالص ───────── */
.site-foot { padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: .78rem; text-align: center; color: var(--muted); }
.sf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sf-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; opacity: .72; transition: opacity .15s, transform .15s; text-decoration: none; }
a.sf-ic:hover, a.sf-ic:focus-visible { opacity: 1; transform: translateY(-2px); }
.sf-ic svg { width: 18px; height: 18px; display: block; }
.sf-wa { background: #25d366; } .sf-fb { background: #1877f2; } .sf-yt { background: #ff0000; } .sf-tg { background: #229ed9; } .sf-map { background: #ea4335; }
.sf-ig { background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); }
.sf-bottom { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 16px; }
.sf-made { display: inline-flex; align-items: center; gap: 6px; }
.sf-made img { display: block; opacity: .9; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }
@media (max-width: 900px) { .site-foot { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* وضع تسجيل الإدارة: بيانات الطالب بتختفي */
.staff-mode [data-student], .staff-mode .idcard, .staff-mode .arrow, .staff-mode .code-row label.row, .staff-mode #nocodeNote { display: none !important; }

/* زرار إظهار الباسورد */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .in { padding-left: 46px; padding-right: 46px; } /* الخانة LTR فالنص بيبدأ من الشمال، فبنسيب مسافة على الناحيتين عشان العين ماتغطيش الكتابة */
.pw-eye { position: absolute; left: 6px; right: auto; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: rgba(120,150,145,.18); }
.pw-eye .ic { width: 20px; height: 20px; }

/* زرار مسح رسالة في الشات (للإدارة): بيظهر لما تقف على الرسالة، وعلى الموبايل ظاهر دايمًا */
.bub { position: relative; }
.bub-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--danger-soft); color: var(--danger); cursor: pointer; opacity: .75; transition: opacity .15s; }
.bub-x .ic { width: 15px; height: 15px; }
.bub:hover .bub-x, .bub-x:focus-visible { opacity: 1; }
.bub:has(.bub-x) { padding-inline-end: 38px; }

/* الصورة الشخصية */
.avatar.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; font-size: 0; }
.avatar[data-act="avatar"] { cursor: pointer; transition: box-shadow .15s; }
.avatar[data-act="avatar"]:hover, .avatar[data-act="avatar"]:focus-visible { box-shadow: 0 0 0 3px rgba(15,133,131,.45); outline: 0; }
