/* App layout shared by the student account (/learn), the office portal (/office) and the admin (/admin).
   Side navigation on wide screens, a bottom tab bar on phones. Sits on top of styles.css and panel.css. */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; max-width: 1240px; margin: 0 auto; padding: 88px var(--gutter) 60px; }
.shell.solo { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.shell > .panel { padding: 0; max-width: none; margin: 0; }
.side { position: sticky; top: 88px; align-self: start; display: grid; gap: 4px; padding: 12px; border-radius: 22px; background: var(--glass); box-shadow: var(--glass-shadow); }
.side .who { padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.side .who b { display: block; font-family: var(--display); font-weight: 600; }
.side .who small { color: var(--muted); font-size: .82rem; }
.side .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: .65rem .8rem; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 500; min-height: 46px; transition: background-color .25s, color .25s; border: 0; background: none; cursor: pointer; font: inherit; text-align: start; width: 100%; }
.nav-item .ic { width: 20px; height: 20px; color: var(--muted); vertical-align: 0; }
.nav-item:hover { background: rgba(255, 255, 255, .8); color: var(--ink); }
.nav-item.on { background: var(--ink); color: #fff; }
.nav-item.on .ic { color: var(--lamp-2); }
.nav-item .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--lamp); color: var(--ink); font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.tabbar { display: none; }

/* Status chips */
.st { display: inline-flex; align-items: center; gap: 6px; padding: .15rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.active, .st.approved, .st.answered, .st.used { background: rgba(46, 139, 98, .13); color: #2E8B62; }
.st.free, .st.pending, .st.open, .st.unused { background: rgba(246, 176, 74, .22); color: var(--lamp-ink); }
.st.frozen { background: rgba(70, 120, 200, .13); color: #3768B8; }
.st.disabled, .st.rejected, .st.cancelled { background: rgba(194, 69, 59, .11); color: #C2453B; }
.st.closed { background: rgba(20, 20, 23, .07); color: var(--muted); }

/* Page parts */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1; min-width: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 10px; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.crumb .ic { width: 16px; height: 16px; transform: scaleX(-1); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panel .card h3 { margin: 0 0 .6rem; font-size: 1.1rem; }
.panel .card .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel .card .card-head h3 { margin: 0; flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--display); letter-spacing: .04em; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; display: block; margin: 0 auto .6rem; color: var(--line-2); }
.banner { display: flex; align-items: center; gap: 12px; padding: 1rem 1.1rem; border-radius: var(--r); margin-bottom: 12px; background: linear-gradient(160deg, rgba(255, 249, 238, .96), rgba(253, 236, 210, .72)); box-shadow: 0 0 0 1px rgba(232, 134, 42, .3), var(--glass-shadow); }
.banner .grow b { display: block; font-family: var(--display); }
.banner.blue { background: rgba(232, 240, 252, .9); box-shadow: 0 0 0 1px rgba(70, 120, 200, .25); }
.banner.red { background: rgba(252, 236, 234, .9); box-shadow: 0 0 0 1px rgba(194, 69, 59, .25); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 30px 18px 0; }
.timeline li::before { content: ""; position: absolute; right: 7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); }
.timeline li::after { content: ""; position: absolute; right: 12px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: #2E8B62; }
.timeline li.now::before { background: var(--lamp); box-shadow: 0 0 0 4px rgba(232, 134, 42, .2); }
.timeline b { display: block; }
.checks { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: .7rem .9rem; border-radius: 14px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; border: 0; font: inherit; text-align: start; width: 100%; }
.check-row .box { width: 24px; height: 24px; flex: none; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; }
.check-row.on .box { background: linear-gradient(180deg, var(--lamp-2), var(--lamp)); box-shadow: none; }
.check-row .box .ic { width: 16px; height: 16px; color: var(--ink); opacity: 0; vertical-align: 0; }
.check-row.on .box .ic { opacity: 1; }
.check-row.on .grow b { text-decoration: line-through; color: var(--muted); }
.panel .list-item .side-txt { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.panel .list-item.locked .n { background: rgba(20, 20, 23, .08); color: var(--muted); }
.panel .list-item .n .ic { width: 18px; height: 18px; color: inherit; vertical-align: 0; }
.tag { display: inline-block; padding: .05rem .5rem; border-radius: 8px; font-size: .74rem; font-weight: 700; background: var(--lamp); color: var(--ink); margin-inline-start: 6px; vertical-align: 1px; }
.tag.soft { background: rgba(20, 20, 23, .07); color: var(--ink-2); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn { border: 0; cursor: pointer; padding: .5rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2); font: inherit; font-size: .9rem; min-height: 40px; }
.chip-btn.on { background: var(--ink); color: #fff; box-shadow: none; }
.pay-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.pay-opt { border: 0; cursor: pointer; padding: 1rem; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); text-align: start; font: inherit; min-height: 70px; }
.pay-opt small { display: block; color: var(--muted); }
.pay-opt.on { box-shadow: inset 0 0 0 2px var(--lamp); background: rgba(246, 176, 74, .12); }
.pay-box { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.pay-box img { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 12px; padding: 6px; image-rendering: pixelated; }
.pay-box .num { font-family: var(--display); font-size: 1.4rem; direction: ltr; letter-spacing: .05em; }
.drop { display: grid; gap: 8px; padding: 1.1rem; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1.5px dashed var(--line-2); cursor: pointer; text-align: center; color: var(--ink-2); min-height: 76px; align-content: center; margin-bottom: 12px; font-weight: 500; }
.drop img { max-height: 140px; margin: 0 auto; border-radius: 10px; }
.drop input { display: none; }
.thread-box { display: grid; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 86%; padding: .75rem 1rem; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); white-space: pre-wrap; line-height: 1.7; }
.bubble.admin { justify-self: end; background: var(--ink); color: #fff; box-shadow: none; }
.bubble small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
.bubble.admin small { color: var(--on-night-muted); }
.faq { display: grid; gap: 8px; margin-bottom: 12px; }
.faq details { border-radius: 14px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line); padding: .2rem 1rem; }
.faq summary { cursor: pointer; padding: .7rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--lamp-ink); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 .8rem; color: var(--ink-2); line-height: 1.8; }
.quiz-review .opt { cursor: default; }
.terms-box { max-height: 340px; overflow-y: auto; padding: .4rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 1px var(--line); overscroll-behavior: contain; }
.terms { margin: 0; padding-inline-start: 1.3rem; }
.terms li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.terms li:last-child { border-bottom: 0; }
.terms b { font-family: var(--display); }
.terms p { margin: .2rem 0 0; color: var(--ink-2); line-height: 1.8; font-size: .95rem; }
.check-row input[type=checkbox] { flex: none; }
.job-list { margin: 0; padding-inline-start: 1.2rem; line-height: 1.9; }
.job-list li { margin-bottom: .3rem; }
.job-details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job-details summary::after { content: "+"; font-weight: 700; color: var(--lamp-ink); font-size: 1.3rem; }
.job-details[open] summary::after { content: "−"; }
/* Back button in the top bar of every inner page. */
.back-btn { display: inline-flex; align-items: center; gap: 6px; }
.back-btn .ic { width: 18px; height: 18px; transform: scaleX(-1); color: currentColor; vertical-align: 0; }
.score-pill { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 8px; border-radius: 10px; font-family: var(--display); font-weight: 700; }
.score-pill.hi { background: rgba(46, 139, 98, .15); color: #2E8B62; }
.score-pill.mid { background: rgba(246, 176, 74, .25); color: var(--lamp-ink); }
.score-pill.lo { background: rgba(194, 69, 59, .12); color: #C2453B; }
.job-list li::marker { color: var(--lamp); }
.job-list.soft { color: var(--ink-2); }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.tool-row { display: grid !important; grid-template-columns: 1fr 150px; align-items: center; gap: 8px; margin: 0 !important; }
.tool-row .field { min-height: 44px; padding: .5rem .8rem; font-size: .95rem; }
@media (max-width: 899px) { .tools-grid { grid-template-columns: minmax(0, 1fr); } }
.avatar { flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(180deg, var(--lamp-2), var(--lamp)); color: var(--ink); font-family: var(--display); font-weight: 700; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(232, 134, 42, .35); }
.page-head .avatar { align-self: center; }
.panel .list-item .thumb { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111; }
.panel .list-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel .list-item .thumb .n { position: absolute; bottom: 4px; inset-inline-start: 4px; width: 28px; height: 28px; border-radius: 9px; font-size: .8rem; }
.panel .list-item.locked .thumb img { filter: grayscale(1) brightness(.7); }
.upsell { box-shadow: 0 0 0 1.5px rgba(246, 176, 74, .45), var(--glass-shadow); }
.upsell .ic { color: var(--lamp-2); }
/* Lecture video protection: a moving name-and-number watermark, and a black screen when the page loses focus. */
.player.protected { position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.player .wm { position: absolute; z-index: 2; pointer-events: none; color: rgba(255, 255, 255, .16); font-size: .62rem; font-weight: 500; letter-spacing: .02em; text-shadow: 0 0 1px rgba(0, 0, 0, .25); white-space: nowrap; transition: left 1.2s var(--ease), top 1.2s var(--ease); direction: ltr; }
.player .shield { position: absolute; inset: 0; z-index: 3; background: #000; color: #fff; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 1.5rem; }
.player .shield[hidden] { display: none; }
.player .shield .ic { width: 34px; height: 34px; color: var(--lamp-2); }
.player .shield > span { color: var(--on-night-muted); max-width: 28rem; line-height: 1.8; font-size: .85rem; }
.player .shield [data-resume] { margin: 6px 0; min-height: 52px; padding: .8em 1.6em; font-size: 1.05rem; }
.player.hidden-video video { visibility: hidden; }
.live-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.live-date { min-width: 68px; text-align: center; padding: .5rem; border-radius: 14px; background: var(--ink); color: #fff; font-family: var(--display); line-height: 1.3; }
.live-date b { display: block; font-size: 1.5rem; color: var(--lamp-2); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: .15rem .7rem; border-radius: 999px; background: #C2453B; color: #fff; font-size: .78rem; font-weight: 700; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.stars { display: flex; gap: 4px; margin-bottom: 10px; direction: ltr; justify-content: flex-end; }
.stars button { border: 0; background: none; cursor: pointer; font-size: 1.7rem; line-height: 1; color: var(--line-2); padding: 2px; }
.stars button.on { color: var(--lamp); }
@media (max-width: 899px) { .panel .list-item .thumb { width: 92px; } }
.notes { width: 100%; min-height: 110px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-size: .92rem; transition: opacity .3s, transform .3s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 23, .35); display: grid; place-items: center; padding: 16px; animation: fade .25s var(--ease); }
.modal { width: min(460px, 100%); max-height: 90svh; overflow: auto; border-radius: 22px; padding: 1.3rem; background: var(--card); box-shadow: 0 30px 80px -30px rgba(20, 20, 23, .6); }
.modal h3 { margin: 0 0 .6rem; }
.secret { font-family: var(--display); font-size: 1.4rem; letter-spacing: .08em; direction: ltr; text-align: center; padding: .8rem; border-radius: 14px; background: rgba(246, 176, 74, .15); color: var(--lamp-ink); user-select: all; margin: .6rem 0; }
.cert { position: relative; padding: 2.4rem 2rem; border-radius: 24px; text-align: center; background: linear-gradient(160deg, #fffdf9, #fbf1e1); box-shadow: 0 0 0 1px rgba(232, 134, 42, .35), inset 0 0 0 10px #fff, inset 0 0 0 11px rgba(232, 134, 42, .3), var(--glass-shadow); }
.cert img { height: 40px; margin: 0 auto 1rem; }
.cert .lbl { font-family: var(--wide); font-size: .7rem; letter-spacing: .3em; color: var(--lamp-ink); }
.cert h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: .4rem 0; }
.cert .meta { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-top: 1.4rem; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .field { padding-inline-start: 2.6rem; min-height: 46px; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); vertical-align: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-danger { background: rgba(194, 69, 59, .1); color: #C2453B; box-shadow: inset 0 0 0 1px rgba(194, 69, 59, .3); }
.panel tr.click { cursor: pointer; }
.panel tr.total td { border-top: 2px solid var(--ink); background: rgba(246, 176, 74, .1); }
.panel tr.total td:last-child { font-size: 1.1rem; font-weight: 700; }
.panel tr.click:hover td { background: rgba(255, 255, 255, .7); }
.panel .kpi.warn { box-shadow: 0 0 0 1.5px rgba(232, 134, 42, .55), var(--glass-shadow); }

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 76px var(--gutter) 110px; gap: 0; }
  .side { display: none; }
  .tabbar { display: flex; position: fixed; z-index: 40; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); justify-content: space-around; padding: 6px; border-radius: 24px;
    background: rgba(254, 252, 249, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 0 0 1px var(--line), 0 16px 40px -14px rgba(20, 20, 23, .45); }
  .tabbar[hidden] { display: none; }
  .tabbar a, .tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 16px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; position: relative; border: 0; background: none; font-family: inherit; cursor: pointer; }
  .tabbar .ic { width: 22px; height: 22px; color: inherit; vertical-align: 0; }
  .tabbar .on { color: var(--ink); background: rgba(246, 176, 74, .2); }
  .tabbar .dot { position: absolute; top: 4px; inset-inline-end: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .banner { flex-wrap: wrap; }
  .banner .grow { flex: 1 1 calc(100% - 40px); }
  .banner .btn { flex: 1 1 100%; }
  .panel .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel .kpi b { font-size: 1.4rem; }
  .pay-box { grid-template-columns: 1fr; justify-items: start; }
  .toast { bottom: 100px; }
}
/* Courses page: the list, one course, bundles and the booking form. */
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.course-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; margin: 0; }
.course-card h3 { margin: .4rem 0 0; }
.course-card p { margin: 0; flex: 1; }
.course-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(160deg, var(--lamp-2, #F5C451), var(--lamp, #E8A33D)); color: #1A1306; flex: none; }
.course-ic .ic { width: 22px; height: 22px; }
.course-ic.big { width: 58px; height: 58px; border-radius: 18px; }
.course-ic.big .ic { width: 28px; height: 28px; }
.course-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.course-price b { font-size: 1.45rem; font-family: var(--display, inherit); }
.course-price s { color: var(--muted, #888); }
.course-price span { color: var(--muted, #888); font-size: .85rem; }
.course-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.course-points li { display: flex; gap: 10px; align-items: flex-start; }
.course-points .ic { flex: none; color: #2E8B62; margin-top: 2px; }
.bundles .bundle { padding: 1rem; border-radius: var(--r, 16px); background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); color: #fff; }
.bundles .bundle .course-price b { color: var(--lamp-2, #F5C451); }
.course-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.panel label.course-pick, .course-pick { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: .7rem .8rem; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; margin: 0; }
.course-pick small { display: block; color: var(--muted, #888); font-weight: 400; }
.course-pick input { width: 20px; height: 20px; accent-color: var(--ink, #15151B); flex: none; }
.course-pick:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink, #15151B); background: rgba(255, 255, 255, .6); }
.sum-box { padding: .8rem 1rem; border-radius: 14px; background: rgba(232, 163, 61, .12); margin-bottom: 14px; }
.sum-box b { font-size: 1.2rem; }

/* The review box, when opened from the review-request link. */
[data-review].glow { box-shadow: 0 0 0 2px var(--lamp, #E8A33D), 0 10px 30px rgba(232, 163, 61, .25); }

/* Admin "بدؤوا وما كملوا": on phones the buttons go under the details. */
.lead-row { flex-wrap: wrap; }
.lead-row .grow { min-width: 200px; }
@media (max-width: 640px) { .lead-row .actions { width: 100%; justify-content: flex-end; } }

/* Two lists side by side: course lectures and detailed lectures. */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; cursor: pointer; padding: .55rem .8rem; border-radius: 999px; font: inherit; font-weight: 700; color: var(--ink-2, inherit); min-height: 42px; }
.seg button.on { background: var(--ink, #15151B); color: #fff; }

@media print {
  .bar, .side, .tabbar, .no-print { display: none !important; }
  .shell { display: block; padding: 0; }
  body { background: #fff; }
}
