Initial commit: Learning Lab Express

Includes fixes found while reviewing the app:
- Results: open each result by a type+agent+id key, so a video and a
  material draft with the same id no longer open each other's popup
- AuthGate: clear the query cache during render, before pages build their
  queries, and remount pages on organization switch (pages no longer stay
  on skeletons for up to a minute after sign-in or refresh)
- Instruction: keep only failed rules after a partial approve, so retrying
  does not create the successful schedules twice; drop the monthly note
  once count or frequency is edited
- Parser/schedules: never schedule a count below one
- Audio: ignore the end event of a cancelled utterance when changing speed
- Downloads: revoke the object URL later so Safari/Firefox can read it
- Results: refetch SCORM content when any part's revision changes; show a
  failed video as failed instead of "still rendering"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iqbal
2026-10-23 10:42:12 +07:00
commit f219b26f71
41 changed files with 8172 additions and 0 deletions

260
src/styles/theme.css Normal file
View File

@@ -0,0 +1,260 @@
/* Modern theme from the "Learning Lab Express Redesign" canvas: light sidebar, bright blue
accent, Plus Jakarta Sans, softer radii and layered shadows. Loaded last, so it only overrides. */
:root{
--blue:#1570ef;--blue-dark:#175cd3;--navy:#101828;--ink:#101828;--muted:#667085;--line:#e4e7ec;--bg:#f5f8ff;--light:#eff8ff;--green:#067647;--radius:18px;
--glow:#2e90fa;--soft:#d1e9ff;--deep:#194185;
--shadow-card:0 1px 2px rgba(16,24,40,.04),0 10px 30px -14px rgba(21,94,239,.16);
--shadow-btn:inset 0 1px 0 rgba(255,255,255,.22),0 8px 18px -8px rgba(21,112,239,.7);
font-family:'Plus Jakarta Sans',system-ui,-apple-system,"Segoe UI",sans-serif;font-size:14px;
-webkit-font-smoothing:antialiased;
}
button:focus-visible,a:focus-visible{outline:2px solid var(--glow);outline-offset:2px}
p{color:var(--muted)}
h1,h2,h3,h4{letter-spacing:-.03em}
small{color:var(--muted)}
/* Brand */
.brand-mark{background:linear-gradient(140deg,#53b1fd,#2e90fa 45%,#1570ef);border-radius:12px;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 8px 20px -6px rgba(46,144,250,.6)}
.brand{font-weight:800;letter-spacing:-.02em}
/* Buttons and controls */
.btn{min-height:40px;padding:9px 16px;border-radius:12px;border-color:var(--line);font-size:13.5px;font-weight:600;transition:background .15s,transform .15s,box-shadow .15s}
.btn:hover{background:#f5f8ff;border-color:#d0d5dd}
.btn.primary{background:var(--blue);border-color:var(--blue);box-shadow:var(--shadow-btn)}
.btn.primary:hover{background:var(--blue-dark);transform:translateY(-1px)}
.btn.primary:disabled{transform:none;box-shadow:none}
.btn.light{background:var(--light);border-color:var(--soft);color:var(--blue-dark)}
.btn.small{min-height:34px;padding:7px 12px;font-size:12.5px;border-radius:10px}
.btn.danger{color:#b91c1c}
.icon-btn{border-radius:10px;color:var(--muted)}
.icon-btn:hover{background:var(--light);color:var(--blue)}
.text-btn{color:var(--blue-dark);font-size:13px}
.badge,.status,.type-badge{border-radius:999px;padding:5px 10px;font-size:11.5px;font-weight:600}
.badge.blue{color:var(--blue-dark);background:var(--light)}
.badge.neutral{background:#f2f4f7;color:#475467}
.status.ready{color:#047857;background:#ecfdf5}
.status.draft{color:#b45309;background:#fffbeb}
.status.failed{color:#b91c1c;background:#fef2f2}
.type-badge{background:var(--light);color:var(--blue-dark)}
label{font-size:13px;font-weight:600}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{border-color:#d0d5dd;border-radius:12px;font-size:14px;outline-color:var(--blue);transition:border-color .15s,box-shadow .15s}
input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 4px rgba(21,112,239,.14)}
input::placeholder,textarea::placeholder{color:#98a2b3}
.inline-note,.preview-notice{background:#f5faff;border:1px solid var(--soft);border-radius:14px;color:#475467;font-size:12.5px}
.inline-note svg,.preview-notice svg{color:var(--blue)}
.error{color:#b91c1c}
/* Sidebar: light, bright blue active state */
.sidebar{width:264px;background:#fff;border-right:1px solid var(--line);padding:24px 16px 16px;color:var(--ink);overflow:hidden}
.sidebar::before{content:"";position:absolute;left:-120px;top:-140px;width:360px;height:360px;border-radius:50%;background:radial-gradient(closest-side,rgba(46,144,250,.16),rgba(46,144,250,0));pointer-events:none}
.sidebar>*{position:relative}
.sidebar>a:first-child{display:block}
.sidebar>a>.brand{margin:0 4px 24px;font-size:16px}
.sidebar .brand-mark{width:38px;height:38px;border-radius:12px}
.workspace{border:1px solid var(--line);background:#f8faff;border-radius:14px;padding:10px;margin-bottom:26px;font-size:13.5px}
.workspace small{font-size:12px}
.workspace-icon{background:var(--light);color:var(--blue-dark);border-radius:9px;width:30px;height:30px;font-weight:800}
.nav-label{color:var(--muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase;margin:0 12px 10px}
.sidebar nav{gap:4px}
.sidebar nav :is(button,a){position:relative;padding:11px 12px;border-radius:12px;color:#475467;font-size:14px;font-weight:550;transition:background .15s,color .15s}
.sidebar nav :is(button,a) svg{color:#98a2b3}
.sidebar nav :is(button,a):hover{background:#f2f7ff;color:var(--ink)}
.sidebar nav :is(button,a).active{background:linear-gradient(90deg,#1570ef,#2e90fa);color:#fff;font-weight:650;box-shadow:0 8px 18px -10px rgba(21,112,239,.8)}
.sidebar nav :is(button,a).active svg{color:#fff}
.sidebar-help{border:1px solid var(--soft);background:linear-gradient(160deg,#eff8ff,#fff);border-radius:16px;padding:16px 14px}
.sidebar-help>svg{color:var(--blue)}
.sidebar-help b{font-size:13px}
.sidebar-help p{font-size:12px}
.sidebar-help button{color:var(--blue-dark);font-size:12.5px}
.profile{border-top:1px solid var(--line);padding:14px 4px 0}
.profile b{font-size:13px}
.profile small{font-size:11.5px}
.avatar{background:linear-gradient(140deg,#2e90fa,#1570ef);color:#fff;width:34px;height:34px;font-weight:700;box-shadow:0 0 0 2px #fff,0 0 0 3.5px rgba(46,144,250,.5);flex-shrink:0}
/* Main column: glass top bar and a soft blue glow at the top */
.workspace-main{margin-left:264px;width:calc(100% - 264px);background:radial-gradient(900px 420px at 85% -120px,rgba(46,144,250,.18),rgba(124,92,255,0) 70%),radial-gradient(700px 360px at 10% -160px,rgba(125,215,255,.22),rgba(190,242,100,0) 70%) no-repeat}
.topbar{position:sticky;top:0;z-index:4;height:64px;padding:0 36px;background:rgba(255,255,255,.7);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid #eaecf0}
.breadcrumb{font-size:13.5px;color:var(--muted)}
.breadcrumb span{color:#d0d5dd}
.breadcrumb b{color:var(--ink);font-weight:600}
.topbar-right{font-size:13px;color:var(--muted);gap:16px}
.demo-indicator{height:30px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:12.5px;font-weight:550;color:#344054}
.demo-indicator i{width:7px;height:7px;background:#059669;box-shadow:0 0 0 3px #d1fae5}
.lang-switch{border:0;border-radius:999px;background:#f2f4f7;padding:3px}
.lang-switch button{border-radius:999px;padding:5px 11px;font-size:12px;color:#475467}
.lang-switch button.active{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(16,24,40,.12)}
.demo-strip{margin:24px 36px 0;padding:8px 10px 8px 16px;border:1px solid rgba(46,144,250,.25);border-radius:999px;background:rgba(255,255,255,.75);box-shadow:0 6px 20px -12px rgba(21,112,239,.35);color:var(--deep);font-size:13px}
.demo-strip svg{color:var(--blue)}
.demo-strip-tag{font-size:11px;letter-spacing:.06em;font-weight:700;color:#fff;background:var(--blue);border-radius:999px;padding:4px 10px}
.app main{padding:28px 36px 32px}
.page-head{margin-bottom:28px}
.page-head h1{font-size:38px;line-height:1.08;font-weight:800;letter-spacing:-.04em}
.page-head p{font-size:15px;margin-top:8px;max-width:720px}
.app-footer{margin:auto 36px 0;padding:20px 0;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.app-footer>span:first-child{color:var(--blue-dark)}
.app-footer>span:last-child{font-size:12.5px}
/* Cards and sections */
.card{border-color:var(--line);border-radius:var(--radius);box-shadow:var(--shadow-card)}
.card-head{padding:18px 22px}
.card-head h3{font-size:16px;font-weight:700}
.card-head p{font-size:13px}
.card-body{padding:22px}
.section-heading h3,.toolbar h3{font-size:16px;font-weight:700}
.section-heading p{font-size:13px}
/* Metrics: bento tiles, the first one dark */
.metrics{gap:16px;margin-bottom:24px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.metric{border-color:var(--line);border-radius:18px;padding:20px 22px;box-shadow:var(--shadow-card);overflow:hidden}
.metric>span{font-size:13px;font-weight:600;color:#475467}
.metric strong{font-size:38px;font-weight:800;letter-spacing:-.045em;line-height:1.05;margin:10px 0 6px;font-variant-numeric:tabular-nums}
.metric small{font-size:12.5px}
.metric:first-child{background:linear-gradient(140deg,#175cd3,#1570ef);border-color:#1570ef;color:#fff;box-shadow:0 18px 40px -18px rgba(21,112,239,.7)}
.metric:first-child::after{content:"";position:absolute;right:-60px;top:-80px;width:220px;height:220px;border-radius:50%;background:radial-gradient(closest-side,rgba(255,255,255,.35),rgba(255,255,255,0));pointer-events:none}
.metric:first-child>span{color:#eff8ff}
.metric:first-child small{color:#eff8ff}
.metric i{border-radius:12px;background:var(--light);color:var(--blue)}
/* Upload */
.upload-box{border:1.5px dashed #84caff;border-radius:20px;background:linear-gradient(135deg,#f5faff,#fff 60%);padding:32px 24px}
.upload-box.drag{background:var(--soft);border-color:var(--blue);box-shadow:0 0 0 4px rgba(21,112,239,.12)}
.upload-symbol{background:#fff;border:1px solid #b2ddff;color:var(--blue);border-radius:14px}
.upload-box h3{font-size:17px;font-weight:700}
.upload-box p{font-size:14px;color:#475467}
.upload-box .upload-limit{font-size:12px;color:var(--muted)}
.drop-overlay{background:rgba(16,24,40,.4);backdrop-filter:blur(4px)}
.drop-overlay>div{border-radius:20px;border-color:var(--blue);color:var(--blue-dark)}
/* Tables and lists */
.toolbar{padding:16px 22px}
.search>svg{color:var(--muted);top:12px}
.search input{font-size:13px;min-height:38px!important;border-radius:12px}
th{font-size:12px;font-weight:600;color:var(--muted);background:#f9fafb;padding:12px 22px}
td{font-size:13px;color:#475467;padding:16px 22px;border-bottom-color:#eaecf0}
tbody tr{transition:background .12s}
tbody tr:hover{background:#f9fafb}
.file-name b{font-size:14px;color:var(--ink)}
.file-name small{font-size:12px}
.file-icon{border-radius:10px}
.table-note{font-size:12px;color:var(--muted)}
.notice-row{background:var(--light);border-color:var(--soft);border-radius:14px;color:var(--deep);font-size:13px}
.result-row{padding:18px 0}
.result-title{font-size:14.5px;color:var(--ink);font-weight:700}
.result-meta{font-size:12px;color:var(--muted)}
.result-cover,.rule-icon{background:var(--light);border-color:var(--soft);color:var(--blue);border-radius:12px}
.rule-body>b{font-size:14.5px}
.rule-note,.rule-check,.rule-approve small{font-size:12.5px;color:var(--muted)}
.rule-approve,.run-history{background:#f9fafb}
.run-history,.produce-panel,.production-progress{border-radius:14px}
.produce-panel,.production-progress{background:#f5faff;border-color:var(--soft);color:#475467}
.production-steps li.current:before{box-shadow:0 0 0 3px var(--soft)}
.production-bar,.progress-track{background:#ecebf3}
.spinner{border-color:var(--soft);border-top-color:var(--blue)}
/* Results */
.content-grid{gap:18px}
.content-card{border-radius:18px;box-shadow:var(--shadow-card);transition:transform .15s,box-shadow .15s}
.content-card:hover{transform:translateY(-2px);box-shadow:0 1px 2px rgba(16,24,40,.04),0 18px 36px -16px rgba(21,94,239,.25)}
.content-cover{background:linear-gradient(140deg,#eff8ff,#d1e9ff);color:var(--blue)}
.content-cover>span{font-size:13px}
.content-title{font-size:14.5px;font-weight:700}
.content-title:hover{color:var(--blue)}
.content-card-body>p{font-size:12px}
.content-card-foot>span{font-size:11.5px;color:var(--muted)}
.content-card-foot .text-btn{font-size:12.5px}
.preview-tabs button{font-size:13px}
.preview-tabs button.active{color:var(--blue-dark);border-color:var(--blue)}
.preview-side{background:#f9fafb;border-color:var(--line);border-radius:14px}
.prose p,.prose li{font-size:14px;color:#344054}
.quiz-item,.flashcard,.slide-preview,.chapter{border-radius:14px}
/* Empty states */
.empty{color:var(--muted)}
.empty-icon{background:var(--light);color:var(--blue);border-radius:14px}
.empty h3{font-size:16px;color:var(--ink)}
.empty p{font-size:13.5px}
/* Dialogs and toast */
dialog{border:1px solid var(--line);border-radius:22px;box-shadow:0 30px 80px -20px rgba(16,24,40,.45)}
dialog::backdrop{background:rgba(16,24,40,.45);backdrop-filter:blur(4px)}
.modal-head h2{font-size:22px;font-weight:800}
.modal-head p{font-size:13px}
.help-step>span{background:var(--light);color:var(--blue-dark);border-radius:10px;font-weight:700}
.help-step h3{font-size:14.5px}
.help-step p{font-size:13px}
.toast{background:var(--ink);border-radius:14px;font-size:13.5px;box-shadow:0 18px 40px -16px rgba(16,24,40,.6)}
.toast.error{background:#991b1b}
.progress-orb{background:var(--light);color:var(--blue);border-radius:20px}
/* Sign in: bright blue story panel with dot grid and light glow */
.login-story{background:linear-gradient(150deg,#175cd3,#1570ef 55%,#2e90fa);color:#fff;padding:48px 64px}
.login-story::before{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.16) 1px,transparent 1.2px);background-size:22px 22px;pointer-events:none}
.login-story::after{right:-260px;top:-240px;bottom:auto;width:720px;height:720px;border:0;background:radial-gradient(closest-side,rgba(255,255,255,.28),rgba(255,255,255,0))}
.login-story .brand,.login-story .brand b{color:#fff}
.login-story .brand small{color:#d1e9ff}
.login-story .brand-mark{background:#fff;color:#1570ef}
.login-story .lang-switch{background:rgba(255,255,255,.16)}
.login-story .lang-switch button{color:#fff}
.login-story .lang-switch button.active{background:#fff;color:var(--blue-dark)}
.eyebrow{display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);color:#fff;font-size:12px;letter-spacing:.04em}
.eyebrow::before{content:"NEW";padding:2px 8px;border-radius:999px;background:#fff;color:var(--blue-dark);font-size:10.5px;font-weight:800}
.login-copy h1{font-size:60px;line-height:1.03;font-weight:800;letter-spacing:-.04em;color:#fff}
.login-copy>p{font-size:17px;line-height:1.6;color:#eff8ff;max-width:520px}
.login-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:32px;color:#fff;font-size:14px;font-weight:600}
.login-benefits>span{flex-direction:column;align-items:flex-start;gap:14px;padding:16px;border-radius:18px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);line-height:1.35;backdrop-filter:blur(6px)}
.login-benefits i{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#fff}
.login-benefits svg{color:#1570ef}
.login-footer{font-size:12px;letter-spacing:.06em;color:#d1e9ff}
.login-panel{background:#fff}
.login-form-wrap h2{font-size:28px;font-weight:800;letter-spacing:-.035em}
.login-form-wrap>div>p{font-size:14px;margin:8px 0 20px}
@media(max-width:1120px){
.sidebar{width:230px}
.workspace-main{margin-left:230px;width:calc(100% - 230px)}
.topbar{padding:0 24px}.demo-strip{margin-left:24px;margin-right:24px}.app main{padding-left:24px;padding-right:24px}.app-footer{margin-left:24px;margin-right:24px}
.login-copy h1{font-size:46px}.login-story{padding:40px}
}
@media(max-width:900px){
.login-benefits{grid-template-columns:1fr}
.login-copy h1{font-size:36px}
}
@media(max-width:700px){
.sidebar{width:100%;padding:16px 16px 4px}
.sidebar>a>.brand{margin:0 0 14px}
.sidebar nav :is(button,a){font-size:12.5px;padding:10px}
.sidebar nav :is(button,a).active::before{display:none}
.workspace-main{margin:0;width:100%}
.topbar{position:static;height:auto;min-height:56px;padding:10px 16px;flex-wrap:wrap}
.topbar-right{gap:10px}
.topbar-right>span:not(.demo-indicator){display:none}
.demo-strip{margin:16px 16px 0;border-radius:16px;font-size:12px}
.app main{padding:22px 16px}
.app-footer{margin-left:16px;margin-right:16px}
.page-head h1{font-size:30px}
.page-head p{font-size:14px}
.metric strong{font-size:32px}
.login-story{padding:28px 20px}
}
@media (prefers-reduced-motion:reduce){
.btn,.content-card,.sidebar nav :is(button,a){transition:none}
.btn.primary:hover,.content-card:hover{transform:none}
}
/* Skeletons: a soft blue shimmer in the shape of the content that is loading */
.skel{display:block;border-radius:8px;background:linear-gradient(90deg,#eaf2ff 0%,#f5f9ff 40%,#eaf2ff 80%) 0 0/300% 100%;animation:skel-shimmer 1.4s ease-in-out infinite}
.skel-stack{display:grid;gap:10px}
.skel-row{align-items:center}
.skel-row .result-main{display:grid;gap:9px}
.skel-cover{width:46px;height:52px;border-radius:12px;flex-shrink:0}
.skel-pill{width:78px;height:24px;border-radius:999px;flex-shrink:0}
.skel-block{height:122px;border-radius:0}
.skel-num{display:block;width:56px;height:38px;margin:10px 0 6px;border-radius:10px}
.metric:first-child .skel{background:linear-gradient(90deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.38) 40%,rgba(255,255,255,.18) 80%) 0 0/300% 100%}
@keyframes skel-shimmer{from{background-position:100% 0}to{background-position:-50% 0}}
/* Each route fades in instead of snapping, which hides the swap between pages */
.app main{animation:page-in .28s ease-out}
@keyframes page-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){.skel,.app main{animation:none}}