/* ==========================================================================
   Top Center — platform shell (student portal + admin dashboard)
   Builds on tokens/buttons in styles.css
   ========================================================================== */

.pf{background:var(--bg);min-height:100svh}
.pf .container{max-width:none}

/* ---------- login ---------- */
.auth{min-height:100svh;display:flex;flex-direction:column}
.auth__top{display:flex;justify-content:space-between;align-items:center;padding:20px var(--gutter)}
.auth__brand{display:flex;align-items:center;gap:10px;font-weight:800}
.auth__brand img{width:46px}
.auth__brand span{display:flex;flex-direction:column;line-height:1.2}
.auth__brand small{font-size:.72rem;color:var(--muted);font-weight:600}
.auth__back{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:.92rem;color:var(--ink-2);padding:8px 14px;border-radius:999px;border:1.5px solid var(--line-2);transition:border-color .25s,color .25s}
.auth__back:hover{border-color:var(--ink);color:var(--ink)}
.auth__back .ic{transform:scaleX(-1)}
.auth__main{flex:1;display:grid;place-items:center;padding:24px var(--gutter) 60px}
.auth__card{width:100%;max-width:440px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:clamp(26px,5vw,40px);box-shadow:var(--shadow-lg);animation:rise .9s var(--ease-out) both}
@keyframes rise{from{opacity:0;transform:translateY(24px)}}
.auth__tag{display:inline-flex;align-items:center;gap:8px;font-size:.8rem;font-weight:800;color:var(--brand-text);background:var(--brand-soft);padding:5px 12px;border-radius:999px;margin-bottom:18px}
.auth__tag .ic{width:16px;height:16px}
.auth__card h1{font-size:clamp(1.7rem,5vw,2.1rem);line-height:1.3}
.auth__card > p{color:var(--ink-2);margin:6px 0 26px}
.auth__form{display:grid;gap:16px}
.pw{position:relative}
.pw input{padding-left:52px}
.pw button{position:absolute;left:8px;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:10px;display:grid;place-items:center;color:var(--muted)}
.pw button:hover{color:var(--ink);background:var(--bg)}
.auth__row{display:flex;justify-content:space-between;align-items:center;font-size:.9rem}
.check{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-weight:600;color:var(--ink-2)}
.check input{width:18px;height:18px;accent-color:var(--ink)}
.auth__link{font-weight:700;color:var(--brand-text)}
.auth__or{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:.85rem;margin:6px 0}
.auth__or::before,.auth__or::after{content:"";flex:1;height:1px;background:var(--line-2)}
.auth__foot{text-align:center;font-size:.92rem;color:var(--ink-2)}
.auth__note{margin-top:22px;padding:12px 14px;border-radius:14px;background:var(--bg);font-size:.85rem;color:var(--ink-2);text-align:center;line-height:1.7}
.btn.is-loading{pointer-events:none}
.btn.is-loading .spin{display:inline-block}
.spin{display:none;width:18px;height:18px;border-radius:50%;border:2px solid currentColor;border-inline-end-color:transparent;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- shell ---------- */
.shell{min-height:100svh}
.side{display:none}
.main{min-width:0;padding:0 var(--gutter) 120px}
.top{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;padding:14px 0;margin-bottom:10px;background:rgba(246,244,239,.84);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur)}
.top__title{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.top__title small{color:var(--muted);font-weight:600;font-size:.85rem}
.top__title b{font-size:1.2rem;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top__search{display:none;align-items:center;gap:8px;height:44px;padding:0 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);min-width:260px;color:var(--muted)}
.top__search input{border:0;outline:none;background:transparent;flex:1;min-width:0}
.top__search kbd{font-family:inherit;font-size:.72rem;padding:2px 7px;border-radius:6px;border:1px solid var(--line-2)}
.icon-btn{position:relative;width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--surface);border:1px solid var(--line);transition:border-color .2s}
.icon-btn:hover{border-color:var(--ink)}
.icon-btn .dot{position:absolute;top:10px;right:11px;width:8px;height:8px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 2px var(--surface)}
.avatar{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--ink);color:#fff;font-weight:800;flex:none}
.avatar--sm{width:36px;height:36px;border-radius:12px;font-size:.85rem}
.avatar--soft{background:var(--bg-2);color:var(--ink)}

.tabbar{position:fixed;z-index:40;inset:auto 10px calc(10px + env(safe-area-inset-bottom)) 10px;display:flex;gap:4px;padding:6px;border-radius:22px;background:rgba(255,255,255,.8);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);border:1px solid rgba(255,255,255,.9);box-shadow:var(--shadow-lg)}
.tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px;border-radius:16px;font-size:.72rem;font-weight:700;color:var(--muted);transition:background .25s,color .25s}
.tabbar a .ic{width:22px;height:22px}
.tabbar a.is-on{background:var(--ink);color:#fff}

@media (min-width:1024px){
  .shell{display:grid;grid-template-columns:272px 1fr}
  .tabbar{display:none}
  .side{display:flex;flex-direction:column;gap:6px;position:sticky;top:0;height:100svh;padding:22px 16px;background:var(--surface);border-inline-start:1px solid var(--line)}
  .main{padding:0 36px 60px}
  .top{padding:20px 0}
  .top__search{display:flex}
}
.side__brand{display:flex;align-items:center;gap:10px;padding:2px 8px 18px;margin-bottom:10px;border-bottom:1px solid var(--line)}
.side__brand img{width:46px}
.side__brand span{display:flex;flex-direction:column;line-height:1.25}
.side__brand b{font-weight:800}
.side__brand small{color:var(--muted);font-weight:600;font-size:.78rem}
.side__label{font-size:.75rem;font-weight:700;color:var(--muted);padding:12px 12px 4px}
.side__link{position:relative;display:flex;align-items:center;gap:12px;height:46px;padding:0 12px;border-radius:14px;font-weight:700;color:var(--ink-2);transition:background .2s,color .2s}
.side__link .ic{width:21px;height:21px}
.side__link:hover{background:var(--bg);color:var(--ink)}
.side__link.is-on{background:var(--ink);color:#fff}
.side__link .count{margin-inline-start:auto;font-size:.75rem;padding:1px 8px;border-radius:99px;background:var(--brand);color:var(--ink)}
.side__foot{margin-top:auto;padding:16px;border-radius:20px;background:var(--bg)}
.side__foot b{display:block}
.side__foot p{font-size:.85rem;color:var(--ink-2);margin:4px 0 12px;line-height:1.7}
.side__user{display:flex;align-items:center;gap:10px;margin-top:12px;padding:10px;border-radius:16px;border:1px solid var(--line)}
.side__user div{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.side__user b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.92rem}
.side__user small{color:var(--muted);font-size:.78rem;overflow:hidden;text-overflow:ellipsis}
.side__user button{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;color:var(--muted)}
.side__user button:hover{background:var(--bg);color:var(--ink)}

/* dark sidebar variant (admin) */
.side--dark{background:var(--night);border:0;color:#fff}
.side--dark .side__brand{border-color:var(--night-line)}
.side--dark .side__brand small,.side--dark .side__label{color:var(--night-muted)}
.side--dark .side__link{color:#C9C8CC}
.side--dark .side__link:hover{background:rgba(255,255,255,.06);color:#fff}
.side--dark .side__link.is-on{background:var(--brand);color:var(--ink)}
.side--dark .side__link.is-on .count{background:var(--ink);color:#fff}
.side--dark .side__foot{background:rgba(255,255,255,.05)}
.side--dark .side__foot p{color:var(--night-muted)}
.side--dark .side__user{border-color:var(--night-line)}
.side--dark .side__user small{color:var(--night-muted)}
.side--dark .side__user button:hover{background:rgba(255,255,255,.08);color:#fff}
.side--dark .avatar{background:var(--brand);color:var(--ink)}

/* ---------- views ---------- */
.view{animation:viewIn .6s var(--ease-out)}
@keyframes viewIn{from{opacity:0;transform:translateY(14px)}}
.vh{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:14px;margin:6px 0 22px}
.vh h1{font-size:clamp(1.6rem,4vw,2.2rem)}
.vh p{color:var(--ink-2);margin-top:4px}
.crumbs{display:flex;align-items:center;gap:6px;font-size:.85rem;font-weight:700;color:var(--muted);margin-bottom:6px}
.crumbs a{color:var(--brand-text)}
.crumbs .ic{width:14px;height:14px;transform:scaleX(-1)}

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:22px;box-shadow:var(--shadow-sm)}
.card__h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.card__h h2,.card__h h3{font-size:1.08rem;font-weight:800}
.card__h small{color:var(--muted);font-weight:600}
.link{font-weight:700;font-size:.9rem;color:var(--brand-text);display:inline-flex;align-items:center;gap:4px}
.link .ic{width:15px;height:15px}
.grid{display:grid;gap:16px}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:700;padding:4px 11px;border-radius:999px;background:var(--bg);color:var(--ink-2);white-space:nowrap;border:1px solid var(--line)}
.pill .ic{width:14px;height:14px}
.pill--brand{background:var(--brand-soft);color:var(--brand-text);border-color:transparent}
.pill--ink{background:var(--ink);color:#fff;border-color:var(--ink)}
.pill--ok{background:#E6F4EC;color:var(--ok);border-color:transparent}
.pill--warn{background:#FFF3D6;color:#8F5E00;border-color:transparent}
.pill--bad{background:#FBE9E7;color:var(--danger);border-color:transparent}
.bar{height:6px;border-radius:6px;background:var(--bg-2);overflow:hidden}
.bar > span{display:block;height:100%;border-radius:inherit;background:var(--brand);transition:width 1s var(--ease-out)}
.bar--ink > span{background:var(--ink)}
.ring{position:relative;flex:none;width:var(--s,64px);height:var(--s,64px)}
.ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:4}
.ring circle:first-child{stroke:var(--bg-2)}
.ring circle:last-child{stroke:var(--brand);stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:calc(100 - var(--p,0));transition:stroke-dashoffset 1.2s var(--ease-out)}
.ring > b{position:absolute;inset:0;display:grid;place-items:center;font-weight:800;font-size:calc(var(--s,64px) * .24)}

/* ---------- student: home ---------- */
.resume{position:relative;display:grid;border-radius:var(--r-xl);overflow:hidden;background:var(--night);color:#fff;min-height:320px;isolation:isolate}
.resume > img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.5;z-index:-1;transform:scale(1.02);transition:transform 1.4s var(--ease-out)}
.resume:hover > img{transform:scale(1.07)}
.resume__in{align-self:end;margin:14px;padding:22px;border-radius:24px;background:rgba(19,19,22,.45);-webkit-backdrop-filter:blur(20px) saturate(140%);backdrop-filter:blur(20px) saturate(140%);border:1px solid rgba(255,255,255,.14);display:grid;gap:10px;max-width:560px}
.resume__in small{color:rgba(255,255,255,.72);font-weight:600}
.resume__in h2{font-size:clamp(1.3rem,3.4vw,1.8rem);color:#fff}
.resume__in .bar{background:rgba(255,255,255,.16)}
.resume__row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;font-size:.88rem;color:rgba(255,255,255,.8);font-weight:600}
.kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:18px}
.kpi small{display:flex;align-items:center;gap:6px;color:var(--muted);font-weight:700;font-size:.82rem}
.kpi small .ic{width:16px;height:16px}
.kpi b{display:block;font-size:clamp(1.6rem,3.4vw,2.1rem);font-weight:800;line-height:1.3;margin-top:6px;font-variant-numeric:tabular-nums}
.kpi b span{font-size:.5em;color:var(--muted);font-weight:700}
@media (min-width:900px){ .kpis{grid-template-columns:repeat(4,1fr)} }
.mycourses{display:grid;gap:14px}
@media (min-width:760px){ .mycourses{grid-template-columns:repeat(2,1fr)} }
.mc{display:flex;gap:16px;align-items:center;padding:14px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line);transition:transform .5s var(--ease-out),box-shadow .5s}
.mc:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.mc__img{width:96px;height:96px;border-radius:18px;object-fit:cover;flex:none}
.mc__body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;line-height:1.45}
.mc__body b{font-weight:800}
.mc__body small{color:var(--muted);font-weight:600;font-size:.85rem}
.home-grid{display:grid;gap:16px}
@media (min-width:1200px){ .home-grid{grid-template-columns:1.6fr 1fr;align-items:start} }
.activity{list-style:none;margin:0;padding:0;display:grid}
.activity li{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line);font-size:.92rem;line-height:1.6}
.activity li:first-child{border:0;padding-top:0}
.activity .a-ic{width:34px;height:34px;border-radius:11px;flex:none;display:grid;place-items:center;background:var(--bg)}
.activity .a-ic .ic{width:17px;height:17px}
.activity small{display:block;color:var(--muted);font-weight:600;font-size:.8rem}

/* ---------- student: course ---------- */
.chero{position:relative;display:grid;border-radius:var(--r-xl);overflow:hidden;min-height:280px;color:#fff;background:var(--night);isolation:isolate;margin-bottom:18px}
.chero > img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.45;z-index:-1}
.chero__in{align-self:end;padding:clamp(20px,4vw,34px);display:grid;gap:12px}
.chero h1{font-size:clamp(1.7rem,4.6vw,2.6rem);color:#fff}
.chero__meta{display:flex;flex-wrap:wrap;gap:8px}
.chero__meta span{display:inline-flex;align-items:center;gap:6px;font-size:.85rem;font-weight:700;padding:6px 12px;border-radius:999px;background:rgba(255,255,255,.12);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.chero__meta .ic{width:16px;height:16px}
.chero__prog{display:flex;align-items:center;gap:14px;max-width:520px}
.chero__prog .bar{flex:1;background:rgba(255,255,255,.18)}
.chero__prog b{font-weight:800}
.course-grid{display:grid;gap:16px}
@media (min-width:1200px){ .course-grid{grid-template-columns:1fr 340px;align-items:start} .course-aside{position:sticky;top:100px} }
.level{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden;transition:box-shadow .3s}
.level + .level{margin-top:12px}
.level[open]{box-shadow:var(--shadow-sm)}
.level summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:14px;padding:18px 20px}
.level summary::-webkit-details-marker{display:none}
.level__n{width:44px;height:44px;border-radius:14px;flex:none;display:grid;place-items:center;font-weight:800;background:var(--bg)}
.level.is-done .level__n{background:var(--brand)}
.level.is-cur .level__n{background:var(--ink);color:#fff}
.level__t{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;line-height:1.4}
.level__t b{font-weight:800}
.level__t small{color:var(--muted);font-weight:600;font-size:.84rem}
.level__t .bar{max-width:260px}
.level__chev{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--bg);transition:transform .4s var(--ease-out)}
.level[open] .level__chev{transform:rotate(180deg)}
.lessons{list-style:none;margin:0;padding:0 12px 12px}
.lesson{display:flex;align-items:center;gap:12px;padding:12px;border-radius:16px;transition:background .2s}
.lesson + .lesson{border-top:1px solid var(--line)}
a.lesson:hover{background:var(--bg)}
.lesson__st{width:34px;height:34px;border-radius:50%;flex:none;display:grid;place-items:center;border:1.5px solid var(--line-2);color:var(--muted)}
.lesson__st .ic{width:16px;height:16px}
.lesson.is-done .lesson__st{background:var(--ink);border-color:var(--ink);color:#fff}
.lesson.is-cur .lesson__st{background:var(--brand);border-color:var(--brand);color:var(--ink)}
.lesson.is-locked{opacity:.55}
.lesson__t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.45}
.lesson__t b{font-weight:700;font-size:.97rem}
.lesson__t small{color:var(--muted);font-weight:600;font-size:.8rem}
.lesson__end{display:flex;align-items:center;gap:8px}
.lesson--exam{margin-top:12px;border:1.5px dashed var(--line-2);border-radius:var(--r-lg);padding:18px 20px;background:var(--surface)}
.lesson--exam.is-open{border-style:solid;border-color:var(--ink)}
.lesson--exam .lesson__st{width:44px;height:44px;border-radius:14px}

/* ---------- student: lesson ---------- */
.lesson-grid{display:grid;gap:18px}
@media (min-width:1200px){ .lesson-grid{grid-template-columns:1fr 340px;align-items:start} .lesson-aside{position:sticky;top:100px} }
.player{position:relative;border-radius:var(--r-lg);overflow:hidden;background:#0d0d0f;aspect-ratio:16/9;isolation:isolate}
.player > img{width:100%;height:100%;object-fit:cover;opacity:.92;transition:opacity .4s}
.player.is-playing > img{opacity:1}
.player__big{position:absolute;inset:0;margin:auto;width:78px;height:78px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.78);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);transition:transform .4s var(--ease-out),opacity .3s}
.player__big:hover{transform:scale(1.08)}
.player__big .ic{width:30px;height:30px}
.player.is-playing .player__big{opacity:0}
.player.is-playing:hover .player__big{opacity:1}
.player__ctrl{position:absolute;inset:auto 12px 12px 12px;display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:16px;background:rgba(19,19,22,.45);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);color:#fff;font-size:.82rem;font-weight:700}
.player__ctrl button{color:#fff;display:grid;place-items:center}
.player__ctrl .ic{width:20px;height:20px}
.player__track{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,.25);cursor:pointer;position:relative}
.player__track span{position:absolute;inset:0 auto 0 0;right:auto;border-radius:inherit;background:var(--brand)}
[dir=rtl] .player__track span{left:auto;right:0}
.ltabs{display:flex;gap:4px;padding:4px;border-radius:14px;background:var(--bg-2);width:max-content;margin:18px 0 14px}
.ltabs button{padding:8px 16px;border-radius:10px;font-weight:700;font-size:.9rem;color:var(--ink-2);transition:background .2s,color .2s}
.ltabs button.is-on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-sm)}
.lpane{color:var(--ink-2);line-height:1.9}
.files{display:grid;gap:8px}
.file{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;border:1px solid var(--line);background:var(--surface);font-weight:700;font-size:.93rem}
.file .ic{width:20px;height:20px;color:var(--brand-text)}
.file small{margin-inline-start:auto;color:var(--muted);font-weight:600}
.notes{width:100%;min-height:120px;border-radius:14px;border:1.5px solid var(--line-2);background:var(--surface);padding:14px;resize:vertical;outline:none}
.notes:focus{border-color:var(--ink)}
.next-card{display:grid;gap:12px;padding:20px;border-radius:var(--r-lg);background:var(--ink);color:#fff}
.next-card p{color:var(--night-muted);font-size:.92rem}
.next-card .btn--brand:hover{color:var(--ink)}
.next-card .btn--brand{--fill:#fff}
.mini-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}

/* ---------- quiz ---------- */
.quiz{max-width:760px;margin:0 auto}
.quiz__top{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.quiz__top .bar{flex:1}
.quiz__top small{font-weight:700;color:var(--muted);white-space:nowrap}
.qbox{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:clamp(22px,4vw,36px);box-shadow:var(--shadow-sm)}
.qbox__n{font-size:.85rem;font-weight:800;color:var(--brand-text)}
.qbox h2{font-size:clamp(1.25rem,3vw,1.6rem);margin:8px 0 20px;line-height:1.55}
.opts{display:grid;gap:10px}
.opt{position:relative;display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:16px;border:1.5px solid var(--line-2);font-weight:700;cursor:pointer;transition:border-color .2s,background .2s,transform .3s var(--ease-out)}
.opt:hover{border-color:var(--ink)}
.opt input{position:absolute;opacity:0}
.opt__k{width:34px;height:34px;border-radius:11px;flex:none;display:grid;place-items:center;background:var(--bg);font-weight:800;transition:all .2s}
.opt:has(input:checked){border-color:var(--ink);background:var(--bg)}
.opt:has(input:checked) .opt__k{background:var(--ink);color:#fff}
.opt:has(input:focus-visible){outline:2.5px solid var(--ink);outline-offset:2px}
.qbox__nav{display:flex;justify-content:space-between;gap:10px;margin-top:24px}
.result{text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px;padding:clamp(26px,5vw,44px);border-radius:var(--r-xl);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.result .ring{--s:150px}
.result .ring circle{stroke-width:3.2}
.result h2{font-size:clamp(1.5rem,4vw,2rem);margin-top:8px}
.result p{color:var(--ink-2);max-width:48ch}
.result__acts{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:10px}
.review{display:grid;gap:10px;margin-top:18px;text-align:start}
.review li{list-style:none;padding:14px 16px;border-radius:16px;border:1px solid var(--line);background:var(--surface)}
.review b{display:flex;gap:8px;align-items:flex-start;line-height:1.6}
.review b .ic{width:22px;height:22px;padding:4px;border-radius:50%;flex:none;margin-top:2px}
.review .ok .ic{background:var(--brand);color:var(--ink)}
.review .no .ic{background:var(--ink);color:#fff}
.review small{display:block;color:var(--ink-2);margin-top:6px;padding-inline-start:30px;line-height:1.7}

/* ---------- certificate ---------- */
.cert-wrap{container-type:inline-size}
.cert{
  position:relative;aspect-ratio:1.414;background:#FFFEFB;border-radius:10px;overflow:hidden;color:var(--ink);
  box-shadow:0 2px 4px rgba(22,23,27,.05),0 50px 90px -40px rgba(22,23,27,.4);
  font-size:clamp(6px,1.55cqi,15px);
}
.cert__frame{position:absolute;inset:3.2em;border:.22em solid var(--brand);border-radius:.4em}
.cert__frame::after{content:"";position:absolute;inset:.7em;border:1px solid rgba(22,23,27,.28);border-radius:.2em}
.cert__corner{position:absolute;width:5.2em;height:5.2em;border-color:var(--ink);border-style:solid;border-width:0}
.cert__corner--tr{top:2.2em;right:2.2em;border-top-width:.18em;border-right-width:.18em}
.cert__corner--tl{top:2.2em;left:2.2em;border-top-width:.18em;border-left-width:.18em}
.cert__corner--br{bottom:2.2em;right:2.2em;border-bottom-width:.18em;border-right-width:.18em}
.cert__corner--bl{bottom:2.2em;left:2.2em;border-bottom-width:.18em;border-left-width:.18em}
.cert__wm{position:absolute;inset:0;margin:auto;width:34em;opacity:.045;filter:grayscale(1)}
.cert__in{position:absolute;inset:6.2em 7em;display:flex;flex-direction:column;align-items:center;text-align:center}
.cert__head{display:flex;align-items:center;gap:1.2em;align-self:stretch;justify-content:space-between}
.cert__org{display:flex;align-items:center;gap:1em;text-align:start}
.cert__org img{width:5.4em}
.cert__org b{display:block;font-size:1.25em;font-weight:800;line-height:1.35}
.cert__org small{display:block;font-size:.85em;color:var(--muted);letter-spacing:.14em;font-weight:700}
.cert__no{display:flex;flex-direction:column;align-items:flex-end;line-height:1.4}
.cert__no small{font-size:.8em;color:var(--muted);font-weight:700}
.cert__no b{font-size:1em;letter-spacing:.06em}
.cert__title{margin-top:1.4em;font-size:3.6em;font-weight:800;line-height:1.2}
.cert__en{font-size:.85em;letter-spacing:.5em;color:var(--brand-text);font-weight:800;margin-top:.3em}
.cert__lead{margin-top:1.6em;font-size:1.2em;color:var(--ink-2)}
.cert__name{font-size:3.3em;font-weight:800;line-height:1.35;margin:.15em 0 .1em;padding:0 .6em .05em;border-bottom:.08em solid var(--brand)}
.cert__course{font-size:1.9em;font-weight:800;margin-top:.2em}
.cert__meta{display:flex;gap:2.4em;margin-top:1.1em;font-size:1em;color:var(--ink-2)}
.cert__meta span{display:flex;flex-direction:column;line-height:1.5}
.cert__meta b{color:var(--ink);font-size:1.1em}
.cert__foot{margin-top:auto;align-self:stretch;display:flex;align-items:flex-end;justify-content:space-between}
.cert__sig{display:flex;flex-direction:column;align-items:center;gap:.3em;width:13em}
.cert__sig i{width:100%;height:3em;border-bottom:1px solid var(--ink);background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 34'%3E%3Cpath d='M6 26c10-14 16-18 18-10s-6 12 2 6 12-16 18-10-4 14 6 8 10-12 16-8 6 8 14 4 12-8 20-6' fill='none' stroke='%2316171B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center/70% no-repeat}
.cert__sig small{font-size:.85em;color:var(--muted);font-weight:700}
.cert__seal{position:relative;width:9.5em;height:9.5em;display:grid;place-items:center}
.cert__seal svg{position:absolute;inset:0;width:100%;height:100%}
.cert__seal span{width:5.6em;height:5.6em;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:var(--ink)}
.cert__seal span .ic{width:2.6em;height:2.6em}
.cert__qr{display:flex;align-items:flex-end;gap:.8em;width:13em;justify-content:flex-end}
.cert__qr .qr{width:6.2em;height:6.2em;flex:none}
.cert__qr small{font-size:.75em;color:var(--muted);font-weight:700;line-height:1.5;text-align:start}
.cert-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
.certs-list{display:grid;gap:14px}
@media (min-width:760px){ .certs-list{grid-template-columns:repeat(2,1fr)} }
.cthumb{display:block;border-radius:var(--r-lg);padding:14px;background:var(--surface);border:1px solid var(--line);transition:transform .5s var(--ease-out),box-shadow .5s}
.cthumb:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.cthumb .cert{box-shadow:none;border:1px solid var(--line)}
.cthumb__meta{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px 4px 2px}
.cthumb__meta div{display:flex;flex-direction:column;line-height:1.4}
.cthumb__meta small{color:var(--muted);font-weight:600}

/* ---------- modal / drawer / toast ---------- */
.modal{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:16px;background:rgba(19,19,22,.4);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);animation:fade .3s}
@keyframes fade{from{opacity:0}}
.modal__box{position:relative;width:100%;max-width:560px;max-height:calc(100svh - 32px);overflow:auto;background:var(--surface);border-radius:var(--r-xl);padding:clamp(22px,4vw,34px);box-shadow:var(--shadow-lg);animation:pop .6s var(--ease-out)}
@keyframes pop{from{opacity:0;transform:translateY(24px) scale(.97)}}
.modal__x{position:absolute;top:14px;left:14px;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--bg)}
.modal__box h2{font-size:1.5rem;margin-bottom:6px}
.modal__box > p{color:var(--ink-2);margin-bottom:18px}
.celebrate{text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.celebrate__seal{width:110px;height:110px;border-radius:50%;display:grid;place-items:center;background:var(--brand);animation:sealIn 1s var(--ease-out) both}
.celebrate__seal .ic{width:52px;height:52px}
@keyframes sealIn{from{transform:scale(.4) rotate(-40deg);opacity:0}}
.confetti{position:fixed;inset:0;pointer-events:none;z-index:210;overflow:hidden}
.confetti i{position:absolute;top:-20px;width:10px;height:14px;border-radius:2px;animation:fall linear forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}
.drawer{position:fixed;inset:0;z-index:200;background:rgba(19,19,22,.35);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:fade .3s}
.drawer__box{position:absolute;top:0;bottom:0;left:0;width:min(100%,460px);background:var(--surface);padding:26px;overflow:auto;box-shadow:var(--shadow-lg);animation:slideIn .55s var(--ease-out)}
@keyframes slideIn{from{transform:translateX(-100%)}}
.toast{position:fixed;z-index:260;left:50%;bottom:calc(96px + env(safe-area-inset-bottom));transform:translate(-50%,20px);opacity:0;pointer-events:none;max-width:min(92vw,460px);padding:14px 18px;border-radius:16px;background:var(--ink);color:#fff;font-weight:600;font-size:.93rem;line-height:1.7;box-shadow:var(--shadow-lg);transition:opacity .3s,transform .45s var(--ease-out);display:flex;gap:10px;align-items:center}
.toast .ic{color:var(--brand);width:20px;height:20px}
.toast.is-on{opacity:1;transform:translate(-50%,0)}
@media (min-width:1024px){ .toast{bottom:28px} }

/* ==========================================================================
   ADMIN
   ========================================================================== */
.seg-ctl{display:inline-flex;gap:3px;padding:4px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.seg-ctl button{padding:7px 14px;border-radius:10px;font-weight:700;font-size:.86rem;color:var(--ink-2);transition:background .2s,color .2s}
.seg-ctl button.is-on{background:var(--ink);color:#fff}
.stat-tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media (min-width:1100px){ .stat-tiles{grid-template-columns:repeat(4,1fr);gap:16px} }
.tile{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:18px 18px 12px;overflow:hidden}
.tile__h{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tile__h small{font-weight:700;color:var(--muted);font-size:.84rem}
.tile__ic{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:var(--bg)}
.tile__ic .ic{width:18px;height:18px}
.tile__v{font-size:clamp(1.5rem,3vw,2.1rem);font-weight:800;line-height:1.3;margin-top:8px;font-variant-numeric:tabular-nums}
.tile__d{display:flex;align-items:center;gap:6px;font-size:.8rem;font-weight:700;color:var(--muted)}
.delta{display:inline-flex;align-items:center;gap:2px;padding:1px 7px;border-radius:99px;font-weight:800}
.delta--up{background:#E6F4EC;color:var(--ok)}
.delta--down{background:#FBE9E7;color:var(--danger)}
.spark{display:block;width:100%;height:42px;margin-top:8px}
.tile--hero{background:var(--ink);color:#fff;border-color:var(--ink)}
.tile--hero .tile__h small,.tile--hero .tile__d{color:var(--night-muted)}
.tile--hero .tile__ic{background:rgba(255,255,255,.08);color:var(--brand)}
.dash{display:grid;gap:16px;margin-top:16px}
@media (min-width:1200px){ .dash{grid-template-columns:1.7fr 1fr} .dash--even{grid-template-columns:1fr 1fr} }
.chart{position:relative}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart .grid-line{stroke:rgba(22,23,27,.08);stroke-width:1}
.chart .axis{font-size:11px;fill:var(--muted);font-family:inherit;font-weight:600}
.chart .area{fill:rgba(208,140,0,.1)}
.chart .line{fill:none;stroke:#D08C00;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart .hair{stroke:var(--ink);stroke-width:1;opacity:0;transition:opacity .15s}
.chart .dot{fill:#D08C00;stroke:var(--surface);stroke-width:2;opacity:0;transition:opacity .15s}
.chart.is-hover .hair,.chart.is-hover .dot{opacity:1}
.chart .end-label{font-size:12px;font-weight:800;fill:var(--ink)}
.tip{position:absolute;z-index:5;pointer-events:none;padding:8px 12px;border-radius:12px;background:var(--ink);color:#fff;font-size:.8rem;line-height:1.5;white-space:nowrap;opacity:0;transform:translate(-50%,-110%);transition:opacity .15s}
.tip b{display:block;font-size:.95rem}
.chart.is-hover .tip{opacity:1}
.hbars{display:grid;gap:12px}
.hbar{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;cursor:default}
.hbar__t{display:flex;justify-content:space-between;gap:10px;font-size:.9rem;font-weight:700}
.hbar__t span:last-child{font-variant-numeric:tabular-nums}
.hbar__track{height:12px;border-radius:0 4px 4px 0;position:relative}
.hbar__track i{position:absolute;inset:0 0 0 auto;border-radius:4px 0 0 4px;background:#D08C00;transition:width 1.1s var(--ease-out),background .2s}
.hbar:hover .hbar__track i{background:var(--ink)}
.hbar__track::before{content:"";position:absolute;inset:5px 0;background:rgba(22,23,27,.06);border-radius:4px}
.table-wrap{overflow-x:auto;margin:0 -22px;padding:0 22px}
.table{width:100%;border-collapse:collapse;font-size:.92rem;min-width:620px}
.table th{font-size:.8rem;font-weight:700;color:var(--muted);text-align:start;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.table td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle;white-space:nowrap}
.table tbody tr{transition:background .2s}
.table tbody tr:hover{background:var(--bg)}
.table tbody tr.click{cursor:pointer}
.who{display:flex;align-items:center;gap:10px}
.who div{display:flex;flex-direction:column;line-height:1.35}
.who small{color:var(--muted);font-size:.8rem}
.num{font-variant-numeric:tabular-nums;font-weight:700}
.mini-bar{display:flex;align-items:center;gap:8px;min-width:130px}
.mini-bar .bar{flex:1}
.mini-bar small{font-weight:700;color:var(--ink-2);min-width:34px}
.toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:16px}
.toolbar .search{flex:1;min-width:200px;display:flex;align-items:center;gap:8px;height:46px;padding:0 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.toolbar .search input{flex:1;border:0;outline:none;background:transparent;min-width:0}
.toolbar select{height:46px;border-radius:14px;border:1px solid var(--line);background:var(--surface);padding:0 14px 0 36px;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316171B' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:left 12px center;font-weight:600}
.switch{position:relative;width:44px;height:26px;flex:none}
.switch input{position:absolute;opacity:0;inset:0;cursor:pointer;z-index:1;margin:0}
.switch span{position:absolute;inset:0;border-radius:99px;background:var(--bg-2);transition:background .25s}
.switch span::after{content:"";position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:var(--shadow-sm);transition:transform .3s var(--ease-out)}
.switch input:checked + span{background:var(--ink)}
.switch input:checked + span::after{transform:translateX(-18px)}
.switch input:focus-visible + span{outline:2.5px solid var(--ink);outline-offset:2px}
.acourses{display:grid;gap:14px}
@media (min-width:760px){ .acourses{grid-template-columns:repeat(2,1fr)} }
@media (min-width:1300px){ .acourses{grid-template-columns:repeat(3,1fr)} }
.acard{display:flex;flex-direction:column;border-radius:var(--r-lg);overflow:hidden;background:var(--surface);border:1px solid var(--line);transition:box-shadow .4s,transform .5s var(--ease-out)}
.acard:hover{box-shadow:var(--shadow);transform:translateY(-3px)}
.acard__img{position:relative;aspect-ratio:16/9;overflow:hidden}
.acard__img img{position:absolute;inset:0}
.acard__img img{width:100%;height:100%;object-fit:cover}
.acard__img .pill{position:absolute;top:12px;right:12px}
.acard__b{padding:16px 18px;display:grid;gap:10px}
.acard__b h3{font-size:1.08rem;font-weight:800}
.acard__stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.acard__stats div{padding:8px;border-radius:12px;background:var(--bg);display:flex;flex-direction:column;line-height:1.35}
.acard__stats b{font-weight:800}
.acard__stats small{font-size:.75rem;color:var(--muted);font-weight:600}
.acard__f{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;border-top:1px solid var(--line);font-size:.88rem;font-weight:700}
.acard__f label{display:flex;align-items:center;gap:10px}
.builder{display:grid;gap:16px}
@media (min-width:1200px){ .builder{grid-template-columns:1fr 360px;align-items:start} .builder aside{position:sticky;top:100px;display:grid;gap:16px} }
.blevel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:8px}
.blevel + .blevel{margin-top:12px}
.blevel__h{display:flex;align-items:center;gap:12px;padding:10px 12px}
.blevel__h b{flex:1;font-weight:800}
.grip{color:var(--muted);cursor:grab;display:grid;place-items:center}
.grip .ic{width:18px;height:18px}
.blesson{display:flex;align-items:center;gap:12px;padding:12px;margin:4px;border-radius:14px;background:var(--bg);font-size:.93rem}
.blesson .vid{width:64px;height:40px;border-radius:9px;overflow:hidden;flex:none;position:relative}
.blesson .vid img{width:100%;height:100%;object-fit:cover}
.blesson > div{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.4}
.blesson small{color:var(--muted);font-weight:600;font-size:.8rem}
.blesson .acts{display:flex;gap:4px}
.blesson .acts button{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;color:var(--muted)}
.blesson .acts button:hover{background:var(--surface);color:var(--ink)}
.add-row{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 8px);margin:6px 4px 4px;padding:12px;border-radius:14px;border:1.5px dashed var(--line-2);font-weight:700;color:var(--ink-2);transition:border-color .2s,color .2s}
.add-row:hover{border-color:var(--ink);color:var(--ink)}
.set-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);font-size:.93rem}
.set-row:first-of-type{border-top:0}
.set-row span{color:var(--ink-2);font-weight:600}
.set-row b{font-weight:800}
.drop{display:grid;place-items:center;gap:6px;padding:26px;border-radius:16px;border:1.5px dashed var(--line-2);text-align:center;color:var(--ink-2);background:var(--bg)}
.drop .ic{width:28px;height:28px;color:var(--brand-text)}
.drop small{color:var(--muted)}
.form-grid{display:grid;gap:14px}
@media (min-width:560px){ .form-grid--2{grid-template-columns:1fr 1fr} }
.dlist{display:grid;gap:0;margin:0}
.dlist div{display:flex;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid var(--line);font-size:.93rem}
.dlist dt{color:var(--ink-2);font-weight:600}
.dlist dd{margin:0;font-weight:800}
.feed{list-style:none;margin:0;padding:0;display:grid}
.feed li{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);font-size:.92rem}
.feed li:first-child{border:0;padding-top:0}
.feed li > div{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.4}
.feed small{color:var(--muted);font-weight:600;font-size:.8rem}
.funnel{display:grid;gap:14px}
.funnel__row{display:grid;gap:6px}
.funnel__row div:first-child{display:flex;justify-content:space-between;font-size:.9rem;font-weight:700}
.funnel__row div:first-child span:last-child{font-variant-numeric:tabular-nums}

/* ---------- print: certificate only ---------- */
@media print{
  @page{size:A4 landscape;margin:0}
  body *{visibility:hidden!important}
  #printCert,#printCert *{visibility:visible!important}
  #printCert{position:fixed;inset:0;width:297mm;height:210mm}
  #printCert .cert{width:297mm;height:210mm;aspect-ratio:auto;border-radius:0;box-shadow:none;font-size:3.35mm}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important}
}
.dash > *,.grid > *,.home-grid > *,.course-grid > *,.lesson-grid > *,.builder > *,.stat-tiles > *,.kpis > *{min-width:0}
.delta{white-space:nowrap}.tile__d{flex-wrap:wrap}@media (max-width:600px){.tile__cmp{display:none}}

/* ---------- demo sign-in ---------- */
.creds{margin:-12px 0 22px;padding:12px 14px;border-radius:14px;background:var(--brand-soft);color:#5E4200;font-size:.84rem;display:grid;gap:4px}
.creds__t{font-weight:800}
.creds span:not(.creds__t){display:flex;justify-content:space-between;gap:10px;line-height:1.6}
.creds small{font-size:.8rem;font-weight:600}
.creds b{font-weight:800;font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cta-wrap{position:relative}
.pulse{animation:pulseRing 2.2s var(--ease-out) infinite}
@keyframes pulseRing{0%{box-shadow:0 0 0 0 rgba(255,176,0,.55)}70%,100%{box-shadow:0 0 0 14px rgba(255,176,0,0)}}
.btn--dark.pulse{animation-name:pulseInk}
@keyframes pulseInk{0%{box-shadow:0 0 0 0 rgba(22,23,27,.35)}70%,100%{box-shadow:0 0 0 14px rgba(22,23,27,0)}}
.callout{display:none;position:absolute;top:50%;right:calc(100% + 60px);transform:translateY(-50%);align-items:center;gap:8px;color:var(--ink);font-weight:800;font-size:.95rem;white-space:nowrap;pointer-events:none}
.callout svg{width:64px;height:28px;color:var(--brand-text);animation:nudge 1.2s var(--ease-io) infinite alternate}
@keyframes nudge{to{transform:translateX(9px)}}
@media (min-width:980px){ .callout{display:inline-flex;right:calc(100% + 28px);flex-direction:row-reverse} }
.demo{margin-top:26px;padding-top:22px;border-top:1px solid var(--line)}
.demo__hint{display:flex;align-items:flex-end;justify-content:center;gap:6px;font-weight:800;font-size:.92rem;color:var(--ink-2);margin-bottom:12px}
.demo__hint svg{width:46px;height:30px;color:var(--brand-text);animation:bob 1.3s var(--ease-io) infinite alternate}
@keyframes bob{to{transform:translateY(5px)}}
.demo__btns{display:grid;gap:10px}
.demo__btn{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:18px;border:1.5px solid var(--line-2);background:var(--surface);transition:border-color .25s,transform .4s var(--ease-out),box-shadow .4s}
.demo__btn:hover{border-color:var(--ink);transform:translateY(-2px);box-shadow:var(--shadow)}
.demo__btn > .ic{width:20px;height:20px;transition:transform .4s var(--ease-out)}
.demo__btn:hover > .ic{transform:translateX(-5px)}
.demo__ic{width:44px;height:44px;border-radius:14px;flex:none;display:grid;place-items:center;background:var(--brand);color:var(--ink)}
.demo__ic .ic{width:22px;height:22px}
.demo__t{flex:1;display:flex;flex-direction:column;line-height:1.4}
.demo__t b{font-weight:800}
.demo__t small{color:var(--muted);font-weight:600;font-size:.82rem}
.demo__btn--dark{background:var(--ink);border-color:var(--ink);color:#fff}
.demo__btn--dark .demo__t small{color:var(--night-muted)}
.demo__btn--dark:hover{border-color:var(--ink)}
