/* HSG design system — RTL-first, logical properties throughout */
:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #faf9f8;
  --ink: #29292c;
  --ink-2: #56565c;
  --ink-3: #8c8c93;
  --line: #e8e6e3;
  --line-2: #d6d3cf;
  --brand: #c8202f;
  --brand-strong: #9f1724;
  --brand-soft: #fdecec;
  --accent: #f09018;
  --red: #e84030;
  --side: #232326;
  --side-ink: #c4c4c9;
  --ok: #17895b;
  --ok-soft: #e3f5ec;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --danger: #b3261e;
  --danger-soft: #fdeaea;
  --info: #2a62d6;
  --info-soft: #e8effd;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(30, 24, 22, .05), 0 6px 20px -8px rgba(30, 24, 22, .12);
  --shadow-lg: 0 18px 50px -18px rgba(30, 24, 22, .32);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--ink-3); } .small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
td.num, th.num { display: table-cell; text-align: end; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--brand); color: #fff;
  font: 600 14px/1 var(--font); cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--brand-strong); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.soft { background: var(--brand-soft); color: var(--brand-strong); }
.btn.soft:hover { background: #f9d9d9; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #f0c4c4; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.icon-only { padding: 0; width: 32px; }
.btn.block { width: 100%; }

/* ── Layout: staff shell (sidebar) ── */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; padding: 4px 8px 18px; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.brand-mark img { width: 28px; height: 28px; display: block; }
.brand small { display: block; font-weight: 400; font-size: 11.500px; color: var(--side-ink); letter-spacing: 0; }
.side .group { font-size: 11.5px; color: #85858c; padding: 16px 10px 6px; font-weight: 600; }
.side a.nav {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--side-ink); font-weight: 500;
}
.side a.nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side a.nav.active { background: rgba(232, 64, 48, .30); color: #fff; }
.side a.nav .count {
  margin-inline-start: auto; background: #f09018; color: #2b1a00; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 19px;
}
.side .spacer { flex: 1; }
.side .me { border-top: 1px solid rgba(255, 255, 255, .09); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.side .me b { color: #fff; font-weight: 600; display: block; font-size: 13.5px; }
.side .me span { font-size: 12px; }
.side .me button { margin-inline-start: auto; background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 6px; border-radius: 8px; }
.side .me button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.main { padding: 28px 36px 60px; min-width: 0; }
.main > .inner { max-width: 1180px; margin: 0 auto; }

/* ── Layout: learner (top bar) ── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 18px; }
.topbar .brand { color: var(--ink); padding: 0; }
.topbar .brand small { color: var(--ink-3); }
.topbar .who { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 70px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head p { color: var(--ink-2); margin-top: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; margin-bottom: 8px; }
.crumb .icon { transform: scaleX(1); }

/* ── Surfaces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.card > header { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card > header h2 { flex: 1; font-size: 16px; }
.card > .body { padding: 22px; }
.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; line-height: 20px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.muted { background: #efeeec; color: var(--ink-2); }

/* ── Alerts ── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-weight: 500; margin-bottom: 18px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); color: #0d6844; border-color: #bfe6d2; }
.alert.err { background: var(--danger-soft); color: #9c2626; border-color: #f3c9c9; }
.alert.warn { background: var(--warn-soft); color: #8a5200; border-color: #f3dcae; }
.alert.info { background: var(--info-soft); color: #1f4cab; border-color: #c9d8f8; }
.alert .icon { margin-top: 3px; }

/* ── Forms ── */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .error, .validation-summary-errors { color: var(--danger); font-size: 13px; }
.validation-summary-errors ul { margin: 0 0 14px; padding: 12px 30px 12px 14px; background: var(--danger-soft); border-radius: 10px; border: 1px solid #f3c9c9; }
.validation-summary-valid { display: none; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 400 14.5px/1.5 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 32, 47, .15); }
input.input-validation-error { border-color: var(--danger); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); cursor: pointer; }
.switch-row b { display: block; font-size: 14px; } .switch-row span { font-size: 12.5px; color: var(--ink-3); }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.pick-list { border: 1px solid var(--line); border-radius: 11px; max-height: 300px; overflow: auto; background: var(--surface); }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list label[hidden] { display: none; }
.pick-list .meta { margin-inline-start: auto; font-size: 12.5px; color: var(--ink-3); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: start; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfaf9; }
table.data td.actions { text-align: end; white-space: nowrap; }
table.data .title { font-weight: 600; color: var(--ink); }
table.data .sub { font-size: 12.5px; color: var(--ink-3); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .icon { color: var(--line-2); margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); flex: none; }
.stat .ico.amber { background: var(--warn-soft); color: var(--warn); }
.stat .ico.blue { background: var(--info-soft); color: var(--info); }
.stat b { font-size: 24px; line-height: 1.15; display: block; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }

/* ── Progress ── */
.bar { height: 7px; background: #ebe9e6; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #f09018, var(--brand)); border-radius: 99px; transition: width .4s; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--ring, var(--brand)) calc(var(--p) * 1%), #ebe9e6 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; background: var(--surface); border-radius: 50%; }
.ring > div { position: relative; text-align: center; }
.ring b { font-size: 30px; line-height: 1; display: block; }
.ring span { font-size: 12px; color: var(--ink-3); }

/* ── Learner: hero + course cards ── */
.hero {
  background: radial-gradient(1200px 300px at 100% 0%, #e84030 0%, transparent 60%), linear-gradient(120deg, #232326, #b81828);
  color: #fff; border-radius: 20px; padding: 28px 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  margin-bottom: 30px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.hero h1 { font-size: 27px; margin-bottom: 6px; }
.hero p { color: #f3dcd9; max-width: 56ch; }
.hero .kpis { display: flex; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.hero .kpis b { font-size: 24px; display: block; line-height: 1.2; }
.hero .kpis span { font-size: 12.5px; color: #e3bfbb; }
.hero .next { background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 18px; width: 300px; backdrop-filter: blur(4px); }
.hero .next small { color: #e3bfbb; display: block; margin-bottom: 4px; }
.hero .next b { display: block; font-size: 16px; margin-bottom: 12px; line-height: 1.45; }
.hero .next .bar { background: rgba(255, 255, 255, .18); margin-bottom: 14px; }
.hero .next .btn { background: #fff; color: var(--brand-strong); width: 100%; }
.hero .next .btn:hover { background: #fdeeee; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; }
.section-head .when { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 13px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 18px; margin-bottom: 34px; }
.course {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  color: inherit; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; position: relative;
}
a.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); color: inherit; }
.cover {
  --h: 170; height: 118px; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 62% 30%), hsl(calc(var(--h) + 32) 58% 46%));
}
.cover::before, .cover::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.cover::before { width: 150px; height: 150px; inset-inline-start: -40px; top: -60px; }
.cover::after { width: 90px; height: 90px; inset-inline-end: 22px; bottom: -44px; background: rgba(255, 255, 255, .1); }
.cover .step { position: absolute; inset-inline-start: 16px; bottom: 12px; font-size: 44px; font-weight: 700; line-height: 1; opacity: .95; font-variant-numeric: tabular-nums; }
.cover .badge { position: absolute; inset-inline-end: 12px; top: 12px; background: rgba(255, 255, 255, .94); color: var(--ink); }
.cover .badge.ok { color: var(--ok); } .cover .badge.warn { color: var(--warn); } .cover .badge.info { color: var(--info); }
.course .c-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course h3 { font-size: 16px; line-height: 1.45; }
.course .sum { color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course .meta { display: flex; gap: 14px; color: var(--ink-3); font-size: 12.5px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.course .meta span { display: inline-flex; gap: 5px; align-items: center; }
.course .foot { padding: 0 16px 16px; }
.course .foot .pct { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.course.locked .cover { filter: grayscale(.85) brightness(.92); }
.course.locked h3, .course.locked .sum { color: var(--ink-3); }
.course .lock-note { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; color: var(--ink-2); }

/* ── Learner: course player ── */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.video-box { background: #111113; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; position: relative; box-shadow: var(--shadow-lg); }
.video-box video { width: 100%; height: 100%; display: block; background: #111113; }
.video-box .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #b5b5bb; padding: 24px; }
.video-box .placeholder .big { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .09); display: grid; place-items: center; margin: 0 auto 14px; color: #fff; }
.now { margin-top: 16px; }
.now h2 { font-size: 20px; }
.lessons { padding: 8px; display: grid; gap: 2px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 11px; border: 0; background: none; width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.lesson:hover { background: var(--surface-2); color: inherit; }
.lesson.active { background: var(--brand-soft); }
.lesson .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #efeeec; color: var(--ink-2); flex: none; }
.lesson.done .dot { background: var(--ok); color: #fff; }
.lesson.active:not(.done) .dot { background: var(--brand); color: #fff; }
.lesson .t { flex: 1; min-width: 0; }
.lesson .t b { display: block; font-weight: 600; font-size: 14px; line-height: 1.45; }
.lesson .t span { font-size: 12.5px; color: var(--ink-3); }
.lesson[disabled] { opacity: .55; cursor: not-allowed; }
.exam-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: linear-gradient(180deg, #fdfcfb, var(--surface)); }
.exam-card + .exam-card { margin-top: 12px; }
.exam-card h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.exam-card .facts { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; margin-bottom: 12px; }
.attempts { margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 10px; display: grid; gap: 6px; font-size: 13px; }
.attempts a { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.attempts a:hover { color: var(--brand); }
.attempts .pct { margin-inline-start: auto; font-weight: 600; }

/* ── Exam ── */
.exam-wrap { max-width: 780px; margin: 0 auto; }
.exam-bar { position: sticky; top: 64px; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); margin-bottom: 18px; }
.exam-bar .bar { flex: 1; }
.timer { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; direction: ltr; }
.timer.low { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c9; }
.q { padding: 22px; }
.q + .q { margin-top: 14px; }
.q .q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.q .n { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.q .q-head h3 { flex: 1; font-size: 16px; line-height: 1.6; font-weight: 600; }
.opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.opt + .opt { margin-top: 8px; }
.opt:hover { border-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 500; }
.opt.right { border-color: #9ad5b9; background: var(--ok-soft); }
.opt.wrong { border-color: #f0c4c4; background: var(--danger-soft); }
.result { text-align: center; padding: 40px 28px; }
.result .ring { margin: 0 auto 20px; width: 160px; height: 160px; }
.result .ring b { font-size: 38px; }
.result h1 { margin-bottom: 8px; }
.result p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 22px; }

/* ── Studio bits ── */
.lesson-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row .dot { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.lesson-row .dot.file { background: var(--info-soft); color: var(--info); }
.lesson-row .t { flex: 1; min-width: 0; }
.lesson-row .t b { display: block; font-weight: 600; }
.lesson-row .t span { font-size: 12.5px; color: var(--ink-3); }
.lesson-row form { display: inline; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; background: var(--surface-2); cursor: pointer; display: block; color: var(--ink-2); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop b { color: var(--ink); display: block; }
.drop input { display: none; }
.upload-progress { display: none; gap: 10px; align-items: center; font-size: 13px; }
.upload-progress.on { display: flex; }
.upload-progress .bar { flex: 1; }
.swatch { height: 54px; border-radius: 11px; --h: 170; background: linear-gradient(135deg, hsl(var(--h) 62% 30%), hsl(calc(var(--h) + 32) 58% 46%)); }
.option-row { display: flex; gap: 10px; align-items: center; }
.option-row + .option-row { margin-top: 8px; }
.matrix td.cell { text-align: center; }
.matrix .pill { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.matrix .pill.ok { background: var(--ok); color: #fff; }
.matrix .pill.warn { background: var(--warn-soft); color: var(--warn); font-size: 10.5px; font-weight: 700; width: 38px; border-radius: 99px; }
.matrix .pill.info { background: #efeeec; color: var(--ink-3); }
.matrix .pill.muted { color: var(--line-2); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 99px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Login ── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.login .art {
  background: radial-gradient(900px 500px at 0% 100%, #e84030 0%, transparent 60%), linear-gradient(150deg, #232326, #7d1420);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login .art::after { content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); inset-inline-end: -160px; top: -140px; }
.login .art h1 { font-size: 36px; line-height: 1.35; max-width: 16ch; margin-bottom: 16px; }
.login .art p { color: #f3dcd9; max-width: 44ch; font-size: 16px; }
.login .art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.login .art li { display: flex; gap: 12px; align-items: center; color: #f1e4e2; }
.login .art li i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; }
.login .panel { display: grid; place-items: center; padding: 40px 24px; }
.login form { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login form h2 { font-size: 24px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .side .group, .side .spacer { display: none; }
  .side .brand { padding: 0 6px; } .side .brand small { display: none; }
  .side .me { border: 0; padding: 0; margin-inline-start: auto; } .side .me div { display: none; }
  .main { padding: 20px 16px 50px; }
  .grid-2, .player-layout, .hero, .login { grid-template-columns: 1fr; }
  .hero .next { width: auto; }
  .login .art { display: none; }
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cols-2 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 50px; }
  .topbar .inner { padding: 0 16px; }
  .topbar .who .name { display: none; }
  .hero { padding: 22px 20px; }
  h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Refinements ── */
@media (max-width: 1280px) { .grid-2 { grid-template-columns: 1fr; } }
.lesson-row { flex-wrap: wrap; }
.lesson-row .t { min-width: 150px; }
.lesson-row .acts { display: flex; gap: 6px; }

/* ── Tracks (المسارات) ── */
.track-mark {
  --h: 200; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 62% 30%), hsl(calc(var(--h) + 32) 58% 46%));
}
.track {
  background: linear-gradient(180deg, hsl(var(--h) 45% 96%), var(--surface) 140px); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px 20px 2px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.track .course-grid { margin-bottom: 18px; }
.track-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.track-head .t { flex: 1; min-width: 200px; }
.track-head h3 { font-size: 18px; }
.track-head p { color: var(--ink-2); font-size: 13.5px; }
.track-progress { width: 220px; }
.track-progress .pct { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.others-title { margin: 4px 0 14px; color: var(--ink-2); font-size: 15px; }
.track-row { display: flex; gap: 16px; align-items: center; padding: 18px 20px; flex-wrap: wrap; transition: box-shadow .18s, border-color .18s; }
a.track-row:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.track-row .t { flex: 1; min-width: 240px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.step-chip { display: inline-flex; gap: 7px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px 3px 4px; font-size: 13px; }
.step-chip b { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-size: 12px; }
.track-list { display: grid; gap: 8px; }
.track-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.track-item .n { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; flex: none; }
.track-item .t { flex: 1; min-width: 0; }
.track-item .t b { display: block; font-weight: 600; }
.track-item .t span { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) { .track { padding: 16px 14px 2px; } .track-progress { width: 100%; } }

/* ── HSG identity ── */
.bar > i { background: linear-gradient(90deg, var(--accent), var(--red)); }
.login-logo { width: 150px; height: auto; display: block; margin: 0 auto 4px; }
.hero { background: radial-gradient(900px 320px at 100% 0%, rgba(240, 144, 24, .55) 0%, transparent 62%), linear-gradient(120deg, #232326 0%, #7d1420 55%, #c8202f 100%); }
.login .art { background: radial-gradient(800px 480px at 0% 100%, rgba(240, 144, 24, .5) 0%, transparent 62%), linear-gradient(150deg, #232326 0%, #7d1420 60%, #c8202f 100%); }

/* ── Brand uploads ── */
.brand-preview { height: 96px; border: 1px dashed var(--line-2); border-radius: 11px; display: grid; place-items: center; padding: 10px;
  background: repeating-conic-gradient(#f1efec 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.brand-preview img { max-width: 100%; max-height: 76px; }
input[type=file] { font: 13px var(--font); max-width: 100%; }
