/* ================= ASFAN Virtual Academy (courses, lessons, community, projects, dashboards) ================= */
.top-icon { position: relative; }
.top-icon .badge { position: absolute; top: 1px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif-pop { position: fixed; top: 62px; inset-inline-end: 16px; width: min(390px, calc(100vw - 32px)); max-height: 72vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; }
.notif-pop .np-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.notif-item .ico-tile { width: 32px; height: 32px; border-radius: 9px; }
.notif-item .ico-tile svg { width: 16px; height: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 22px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.cat-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.cat-tag svg { width: 13px; height: 13px; }
.module { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.module-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.module-head h3 { margin: 0; font-size: 16px; flex: 1; }
.module-num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; font-size: 14px; }
.topic-label { padding: 10px 18px 4px; font-size: 12.5px; font-weight: 700; color: var(--text-3); letter-spacing: .3px; display: flex; align-items: center; gap: 6px; }
.topic-label svg { width: 14px; height: 14px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row .ico-tile { width: 34px; height: 34px; border-radius: 10px; }
.lesson-row .ico-tile svg { width: 17px; height: 17px; }
.lesson-row.done .ico-tile { background: var(--ok) !important; }
.lesson-row.current { background: color-mix(in srgb, var(--brand) 12%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .lesson-row.current { box-shadow: inset -3px 0 0 var(--brand); }
.lt { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.lt.final { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); font-weight: 700; }
.prog-break { display: grid; gap: 10px; }
.prog-break .pb { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.prog-break .pb svg { width: 17px; height: 17px; color: var(--text-3); }
.prog-break .pb b { font-variant-numeric: tabular-nums; }
.bullets { margin: 0; padding-inline-start: 18px; display: grid; gap: 5px; color: var(--text-2); font-size: 14px; }
.qr-box { display: flex; gap: 14px; align-items: center; }
.qr-box img { width: 112px; height: 112px; background: #fff; border-radius: 10px; padding: 4px; flex: none; border: 1px solid var(--line); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.lesson-aside { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: 0; }
.lesson-aside .lesson-row { padding: 9px 14px; font-size: 13.5px; }
.lesson-aside .module-head { padding: 10px 14px; }
.lesson-aside .module-head h3 { font-size: 14px; }
.lesson-aside .module { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); margin: 0; }
.lesson-body { line-height: 1.85; font-size: 15.5px; color: var(--text); white-space: pre-wrap; }
.viewer { border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.viewer video, .viewer iframe { width: 100%; display: block; border: 0; }
.viewer video { max-height: 70vh; }
.viewer iframe { height: 72vh; background: #fff; }
.viewer img { width: 100%; display: block; background: var(--surface-2); }
.file-card { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); flex-wrap: wrap; }
.file-card .ico-tile { width: 56px; height: 56px; border-radius: 14px; }
.file-card .ico-tile svg { width: 28px; height: 28px; }
.thread { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); margin-bottom: 12px; }
.thread.pinned { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-head .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.post-title { font-size: 16px; font-weight: 700; margin-top: 10px; }
.post-body { margin: 8px 0 6px; white-space: pre-wrap; line-height: 1.7; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.replies { margin-top: 10px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); display: grid; gap: 10px; }
.reply { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.reply.staff { box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .reply.staff { box-shadow: inset -3px 0 0 var(--brand); }
.reply .post-body { margin: 6px 0 0; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; }
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-list { border-inline-end: 1px solid var(--line); overflow: auto; }
.chat-list .ch { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text); }
.chat-list .ch.active, .chat-list .ch:hover { background: var(--surface-2); }
.chat-list .ch .n { background: var(--brand); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-2); }
.bubble { max-width: 72%; padding: 9px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; line-height: 1.6; align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-color: transparent; }
.bubble small { display: block; font-size: 11px; opacity: .72; margin-top: 3px; }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.timeline { display: grid; gap: 12px; }
.tl-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.tl-item .avatar { width: 34px; height: 34px; font-size: 12.5px; }
.tl-item .tl-card { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.tl-item.update .tl-card { box-shadow: inset 3px 0 0 var(--ok); }
[dir="rtl"] .tl-item.update .tl-card { box-shadow: inset -3px 0 0 var(--ok); }
.avatars { display: flex; align-items: center; }
.avatars .avatar { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--surface); margin-inline-start: -8px; }
.avatars .avatar:first-child { margin-inline-start: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.done .t { text-decoration: line-through; color: var(--text-3); }
.gb-wrap { overflow: auto; max-height: 70vh; }
.gb th, .gb td { text-align: center; white-space: nowrap; }
.gb th.l, .gb td.l { text-align: start; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.gb .c-ok { color: var(--ok); font-weight: 700; }
.gb .c-bad { color: var(--bad); font-weight: 700; }
.gb .c-sub { color: var(--warn); font-weight: 700; }
.q-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.q-edit .opt { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.le-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.le-row:last-child { border-bottom: 0; }
.upbar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.upbar span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.chip { padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.proj-card { display: grid; gap: 10px; color: var(--text); }
.proj-card h3 { margin: 0; font-size: 16px; }
.ann { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.ann + .ann { margin-top: 10px; }
.ann h4 { margin: 0 0 4px; font-size: 15px; }
.ann p { margin: 0; color: var(--text-2); white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.quiz-result { padding: 14px 18px; border-radius: 12px; font-weight: 700; font-size: 16px; }
.quiz-result.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.quiz-result.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.verify-box { text-align: center; }
@media (max-width: 1100px) { .dash-grid, .lesson-layout { grid-template-columns: 1fr; } .lesson-aside { position: static; max-height: none; } }
@media (max-width: 760px) { .chat { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 220px; border-inline-end: 0; border-bottom: 1px solid var(--line); } .chat-msgs { min-height: 360px; } .bubble { max-width: 88%; } .kpis { grid-template-columns: 1fr 1fr; } .topbar .top-icon.hide-sm { display: none; } }

/* progress ring inside coloured banners */
.banner .ring { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.banner .ring > b { background: rgba(8,18,40,.55); color: #fff; }
