/* Dashboard shell shared by the admin panel, student portal and teacher portal. */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app.with-panel { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px 12px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 20px; font-weight: 700; font-size: 20px; color: var(--heading); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-red); position: relative; }
.brand-mark svg { display: none; }
.brand-mark::before { content: 'K'; font-weight: 800; font-size: 17px; line-height: 1; }
.brand small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 0 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s; }
.nav a svg { width: 19px; height: 19px; }
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a .badge { margin-left: auto; }
.nav a .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.nav .group.open > a .chev { transform: rotate(90deg); }
.nav .sub { display: none; flex-direction: column; gap: 2px; padding: 2px 0 4px 30px; }
.nav .group.open .sub { display: flex; }
.nav .sub a { padding: 7px 12px; font-size: 13px; }
.nav .sub a.active { background: none; color: var(--primary); }
.nav .nav-label { margin-top: 12px; }
.side-promo { position: relative; margin-top: 12px; padding: 18px; border-radius: var(--radius); background: linear-gradient(140deg, #e23a50 0%, #c8102e 55%, #a50d25 100%); color: #fff; overflow: hidden; box-shadow: var(--shadow-red); }
.side-promo::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -50px; top: -60px; background: rgba(255,255,255,.12); }
.side-promo .flag { display: none; }
.side-promo h4 { font-size: 15px; margin-bottom: 4px; color: #fff; }
.side-promo p { font-size: 13px; color: rgba(255,255,255,.9); margin-bottom: 14px; line-height: 1.45; }
.side-promo .btn { background: #fff; color: var(--primary); border-color: #fff; position: relative; z-index: 1; }
.side-promo .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

/* Main column */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 26px; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar .title { font-size: 19px; font-weight: 700; color: var(--heading); }
.topbar .spacer { flex: 1; }
.topbar .search { width: 320px; }
.topbar .search .input { height: 44px; border-radius: var(--pill); background: var(--surface-2); border-color: transparent; }
.topbar .user-chip .avatar { width: 40px; height: 40px; font-size: 14px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); flex: none; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary-soft-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--card); }
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: 0; padding: 0; }
.content { padding: 26px 26px 40px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--primary); margin-bottom: 6px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--muted); }
.breadcrumb a:hover { text-decoration: underline; }

/* Right details column: beside the page on wide screens, below it otherwise */
.panel { position: sticky; top: var(--topbar-h); align-self: start; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; background: var(--bg); padding: 26px 26px 30px 0; display: flex; flex-direction: column; gap: 16px; }
.panel-close { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 12px; font-weight: 500; background: none; border: 0; cursor: pointer; padding: 6px 0; }
.profile-card { display: flex; flex-direction: column; gap: 14px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-top h3 { font-size: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-2); border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; }
.stat-row > div + div { border-left: 1px solid var(--border-strong); }
.stat-row .v { font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.stat-row .v svg { width: 17px; height: 17px; color: var(--primary); }
.stat-row .l { font-size: 11px; color: var(--muted); }
.show-panel-btn { position: fixed; right: 18px; bottom: 18px; z-index: 35; }

/* Week calendar strip (Weekly Streak) */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week-strip .d { font-size: 11px; color: var(--muted); }
.week-strip .n { margin-top: 4px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.week-strip .on .n { background: var(--primary); color: #fff; }
.week-strip .on .d { color: var(--primary); }
.week-strip .on { background: var(--primary); border-radius: 11px; padding: 6px 0 0; }
.week-strip .on .d { color: rgba(255,255,255,.8); }
.week-strip > div { padding: 6px 0 0; }
.week-strip .today .n { box-shadow: inset 0 0 0 1.5px var(--primary); }
.week-strip .on.today .n { box-shadow: none; }

/* Stat cards */
.kpi { display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 20px; }
.kpi .top { display: flex; align-items: center; }
.kpi .top > svg { display: none; }
.kpi .top .delta { display: none; }
.kpi .icon-tile { width: 46px; height: 46px; border-radius: 12px; }
.kpi .value { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.kpi .label { color: var(--muted); font-size: 13px; margin-top: 3px; }
a.kpi:hover { box-shadow: var(--shadow); }
.kpi .delta { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: var(--success-soft); color: var(--success); }
.kpi .delta.down { background: var(--danger-soft); color: var(--danger); }

/* Bar chart */
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.bar-chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.bar-chart .bar { fill: var(--bar); transition: fill .15s; }
.bar-chart .bar.hl, .bar-chart g:hover .bar { fill: var(--primary); }
.bar-chart .tip { opacity: 0; transition: opacity .12s; pointer-events: none; }
.bar-chart g:hover .tip, .bar-chart .tip.show { opacity: 1; }
.bar-chart .tip rect { fill: var(--tip-bg); }
.bar-chart .tip text { fill: var(--tip-text); font-weight: 600; }

/* Course cards ("Continue learning" / "Recommended") */
.learn-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.learn-card .head { display: flex; gap: 12px; align-items: center; }
.learn-card .head > div { min-width: 0; flex: 1; }
.learn-card .head a.ellipsis { display: block; }
.learn-grid > * { min-width: 0; }
.learn-card .head .icon-tile, .mini-thumb { width: 64px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, var(--pink-grad-1), var(--pink-grad-2)) !important; color: var(--primary) !important; border: 0 !important; display: flex; align-items: center; justify-content: center; flex: none; }
.learn-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.learn-card .link { font-weight: 700; }
.course-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; display: flex; flex-direction: column; gap: 0; transition: box-shadow .15s, transform .15s; min-width: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.course-card > a > .thumb, .course-card > .thumb { border-radius: 0; }
.course-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-card h4 { font-size: 15px; line-height: 1.35; }
.course-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-weight: 700; }
.price del { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }

/* Chat */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 64px); min-height: 480px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list .head { padding: 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.chat-list .items { overflow-y: auto; flex: 1; }
.chat-list .sec { padding: 12px 14px 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chat-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; border-left: 3px solid transparent; }
.chat-item:hover { background: var(--bg-2); }
.chat-item.active { background: var(--primary-soft); border-left-color: var(--primary); }
.chat-item .grow .row { gap: 6px; }
.chat-item .last { font-size: 12px; color: var(--muted); }
.group-icon { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; font-weight: 700; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-main .head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
:root { --chat-bg: var(--card); --chat-me: var(--primary); --chat-me-text: #ffffff; --chat-them: var(--card); --chat-meta: var(--muted); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--chat-bg); }
.msg { display: flex; gap: 8px; max-width: 78%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { position: relative; background: var(--chat-them); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px 7px; font-size: 14px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); }
.msg.me .bubble { background: var(--chat-me); color: var(--chat-me-text); border-color: var(--chat-me); }
.msg .bubble .txt { white-space: pre-wrap; }
.msg .bubble .txt a { color: var(--primary); text-decoration: underline; }
.msg.me .bubble .txt a { color: #fff; }
.msg .bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 11px; color: var(--chat-meta); margin-top: 3px; line-height: 1; }
.msg.me .bubble .meta { color: rgba(255,255,255,.8); }
.msg.me .bubble .meta svg { width: 15px; height: 15px; color: #fff; }
.msg.me .att, .msg.me .meet-card { background: rgba(255,255,255,.16) !important; }
.msg .bubble.media { padding: 4px 4px 6px; }
.msg .bubble.media .meta { padding-right: 6px; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.msg.me .who { justify-content: flex-end; }
.msg .who:empty { display: none; }
.msg .bubble .att { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 8px 10px; border-radius: 9px; background: rgba(0,0,0,.05); cursor: pointer; font-size: 13px; min-width: 200px; }
.msg .bubble .att svg:last-child { margin-left: auto; opacity: .7; }
:root[data-theme="dark"] .msg .bubble .att { background: rgba(255,255,255,.07); }
.att-img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 9px; overflow: hidden; max-width: 280px; }
.att-img img { display: block; max-width: 100%; max-height: 300px; min-width: 120px; min-height: 80px; object-fit: cover; background: rgba(0,0,0,.06); }
.att-audio { display: flex; align-items: center; gap: 8px; padding: 4px 6px 2px; min-width: 240px; }
.att-audio > svg { color: var(--success); flex: none; }
.att-audio audio { height: 36px; width: 240px; max-width: 100%; }
.meet-card { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.05); color: inherit; text-decoration: none; min-width: 230px; }
.meet-card > svg { color: #1a73e8; flex: none; width: 22px; height: 22px; }
.meet-card .grow { display: flex; flex-direction: column; min-width: 0; }
:root[data-theme="dark"] .meet-card { background: rgba(255,255,255,.07); }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(5,10,20,.88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
.lightbox .btn { position: absolute; top: 14px; right: 14px; color: #fff; }
.msg.pinned .bubble { box-shadow: 0 0 0 2px var(--warning); }
.msg .tools { opacity: 0; display: flex; gap: 2px; align-self: center; transition: opacity .12s; }
.msg:hover .tools { opacity: 1; }
.msg.deleted .bubble { font-style: italic; color: var(--muted); background: var(--deleted-bg); border-color: var(--deleted-bg); }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-compose textarea { min-height: 40px; height: 40px; max-height: 120px; resize: none; padding-top: 9px; }
.chat-day { align-self: center; font-size: 11px; color: var(--muted); background: var(--bg-2); padding: 2px 10px; border-radius: var(--pill); }
.chat-back { display: none; }
.pinned-bar { padding: 8px 16px; background: var(--warning-soft); font-size: 12px; color: var(--note-warn-text); display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }

/* Builder */
.stepper { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.stepper button { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--muted); }
.stepper button .num { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.stepper button.active { border-color: var(--primary); color: var(--text); }
.stepper button.active .num { background: var(--primary); color: #fff; }
.stepper button.done .num { background: var(--success-soft); color: var(--success); }
.curr-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin-bottom: 14px; }
.curr-section .sec-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.curr-section .sec-head input { border: 0; background: transparent; font-weight: 600; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 6px; }
.curr-section .sec-head input:focus { outline: none; background: var(--card); box-shadow: 0 0 0 2px var(--primary-soft-2); }
.lesson { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--card); }
.lesson:last-child { border-bottom: 0; }
.lesson.dragging { opacity: .5; }
.lesson.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.drag-handle { cursor: grab; color: var(--muted); display: flex; }
.lesson .ltype { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-2); color: var(--primary); flex: none; }
.lesson .ltype svg { width: 16px; height: 16px; }
.rec-preview { width: 100%; border-radius: var(--radius-sm); background: #111; aspect-ratio: 16/9; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Kanban-ish request columns */
.status-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.status-strip .s { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; min-width: 120px; cursor: pointer; }
.status-strip .s.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.status-strip .s .v { font-size: 20px; font-weight: 700; }
.status-strip .s .l { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* Notifications dropdown */
.notif-pop { position: absolute; top: 52px; right: 0; width: 360px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 70; overflow: hidden; }
.notif-pop .head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-pop .list { max-height: 380px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif:hover { background: var(--bg-2); }
.notif.unread { background: var(--surface-2); }
.notif.unread .t::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-left: 6px; vertical-align: middle; }
.notif .icon-tile { width: 34px; height: 34px; border-radius: 10px; }
.notif .icon-tile svg { width: 16px; height: 16px; }
.notif .t { font-weight: 500; font-size: 13px; }
.notif .d { font-size: 12px; color: var(--muted); }

/* File manager */
.fm { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.folder-tree a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.folder-tree a:hover { background: var(--bg-2); }
.folder-tree a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.folder-tree .icon { color: var(--warning); }
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fm-tile { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; position: relative; min-width: 0; }
.fm-tile:hover { box-shadow: var(--shadow); }
.fm-tile .big { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.fm-tile .big.folder { background: var(--warning-soft); color: var(--warning); }
.fm-tile .more { position: absolute; top: 8px; right: 8px; }
@media (max-width: 860px) { .fm { grid-template-columns: minmax(0, 1fr); } }

/* Teacher dashboard rows */
.live-row, .ns-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.live-row:first-child, .ns-row:first-child { border-top: 0; }
.live-row .icon-tile { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.live-row .grow, .ns-row .grow { min-width: 0; }
.live-row a.ellipsis, .ns-row a.ellipsis { display: block; }
@media (max-width: 420px) { .live-row { flex-wrap: wrap; } .live-row > .btn { margin-left: 48px; } }
.caps { text-transform: uppercase; letter-spacing: .06em; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.t-course a.strong:hover { color: var(--primary); }

/* Lesson player */
.player-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.player-head h1 { font-size: 24px; margin: 6px 0; }
.ph-prog { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.player-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.player-card .player-stage { border-radius: 0; }
.player-card .lesson-info { padding: 18px; }
.player-card .lesson-info h2 { font-size: 20px; }
.doubt { background: var(--primary-soft); border: 1px solid var(--primary-soft-2); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; }
.lesson-list { padding: 8px 12px 12px; align-self: start; max-height: 76vh; overflow-y: auto; }
.ll-sec { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 6px 6px; }
.ll-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.ll-row:hover { background: var(--bg-2); }
.ll-row.current { background: var(--primary-soft-2); color: var(--primary); }
.ll-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; color: var(--muted); }
.ll-dot svg { width: 12px; height: 12px; }
.ll-row.done .ll-dot { background: var(--success); border-color: var(--success); color: #fff; }
.ll-note { font-size: 12px; color: var(--muted); padding: 10px 6px 0; }
.live-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; background: var(--primary-soft); border: 1px solid var(--primary-soft-2); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; color: var(--text-2); font-size: 14px; }
.live-strip span { display: inline-flex; align-items: center; gap: 7px; }
.live-strip svg { width: 16px; height: 16px; }
.live-strip .ls-live { font-weight: 700; color: var(--text); }
.live-strip .btn { margin-left: auto; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(200,16,46,.18); font-style: normal; flex: none; }
.player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.player-stage { background: #111; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: #fff; }
.player-stage iframe, .player-stage video { width: 100%; height: 100%; border: 0; }
.player-stage.doc { background: var(--card); color: var(--text); border: 1px solid var(--border); aspect-ratio: auto; min-height: 320px; align-items: stretch; justify-content: flex-start; padding: 24px; }
.curriculum .lesson { cursor: pointer; }
.curriculum .lesson.current { background: var(--primary-soft); }
.curriculum .lesson .done { color: var(--success); }
@media (max-width: 1100px) { .player { grid-template-columns: minmax(0, 1fr); } }

/* Schedule: next-class banner, class cards, calendar */
.next-class { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px 28px; margin-bottom: 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, #7f0a1c 0%, #c8102e 60%, #e23a50 100%); color: #fff; box-shadow: var(--shadow-red); position: relative; overflow: hidden; }
.next-class::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -70px; top: -120px; background: rgba(255,255,255,.07); }
.next-class > * { position: relative; z-index: 1; }
.next-class h2 { color: #fff; font-size: 26px; }
.next-class .nc-sub { color: rgba(255,255,255,.85); font-size: 13px; margin: 4px 0 12px; }
.next-class .nc-row { font-size: 15px; color: rgba(255,255,255,.92); margin-top: 4px; }
.next-class .nc-row span { color: rgba(255,255,255,.75); }
.next-class .nc-row strong { color: #fff; }
.next-class .nc-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.next-class .nc-when { color: rgba(255,255,255,.85); }
.next-class .btn.lg { min-width: 180px; }
.next-class .btn.white, .next-class .btn.primary { background: #fff; color: var(--primary); border-color: #fff; }
@media (max-width: 600px) { .next-class { padding: 20px; } .next-class h2 { font-size: 22px; } .next-class .nc-cta { align-items: stretch; width: 100%; } }

.sched-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .sched-layout { grid-template-columns: minmax(0, 1fr); } }
.class-card { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.class-card.ongoing { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
.class-card.cancelled { opacity: .65; }
.class-card.cancelled .strong { text-decoration: line-through; }
.cc-date { flex: none; width: 52px; height: 58px; border-radius: 12px; background: var(--navy-soft); color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }

.cc-date span { font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
.cc-date strong { font-size: 20px; }
.tlines { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.tline { display: flex; flex-direction: column; font-size: 13px; }
.tline .muted { font-size: 11px; }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sched-layout > * { min-width: 0; }
.calendar { min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-dow { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-cell { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.cal-cell.blank { cursor: default; }
.cal-cell:not(.blank):hover { background: var(--bg-2); }
.cal-cell.today span { color: var(--primary); font-weight: 700; }
.cal-cell.has span { font-weight: 600; }
.cal-cell.sel { background: var(--primary); color: #fff; }
.cal-cell.sel span { color: #fff; }
.cal-cell .dots { display: flex; gap: 2px; font-style: normal; }
.cal-cell .dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.cal-cell .dots b.demo { background: #16a34a; }
.cal-cell .dots b.meeting { background: #7c3aed; }
.cal-cell .dots b.x { background: var(--muted); }
.cal-cell.sel .dots b { background: #fff; }
.cal-day { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cal-ev { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cal-ev .t { font-weight: 600; color: var(--navy); min-width: 64px; }

.cal-ev.cancelled { text-decoration: line-through; opacity: .6; }
.sched-preview { background: var(--navy-soft); border-radius: 12px; padding: 12px 14px; color: var(--navy); }

.sched-preview:empty { display: none; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.teacher-card { display: flex; flex-direction: column; gap: 12px; }
.teacher-card .row svg { color: var(--primary); flex: none; }

/* Sign-in cards: centred white card (admin & teacher pages on a soft pink wash; student pages inside the website) */
.auth-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 16px;
  background: radial-gradient(1200px 600px at 100% 0%, var(--pink-grad-1), transparent 60%), radial-gradient(900px 500px at 0% 100%, var(--primary-soft), transparent 60%), var(--surface-2); }
.auth-center .brand { padding: 0; font-size: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 24px; line-height: 1.2; }
.auth-card .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.auth-card .btn.primary { height: 46px; font-size: 15px; }
.auth-card .accent { color: var(--primary); }
.auth-card .check input { width: 17px; height: 17px; }
.auth-links { font-size: 14px; color: var(--primary); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.auth-links a, .auth-links button { color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.auth-links a:hover, .auth-links button:hover { text-decoration: underline; }
.auth-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-google { display: flex; justify-content: center; min-height: 44px; }
.auth-note { font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.auth-foot a { color: var(--primary); }

/* Show / hide password */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > .input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--bg-2); }
.pw-eye svg { width: 20px; height: 20px; }

/* Responsive shell */
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; align-items: start; }
.app.with-panel .main-grid { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
@media (max-width: 1280px) {
  .app.with-panel .main-grid { grid-template-columns: minmax(0, 1fr); }
  .app.with-panel .panel { position: static; max-height: none; overflow: visible; padding: 0 26px 30px; display: grid; }
  .app.with-panel .panel > [data-panel-body] { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
}
@media (max-width: 1024px) {
  .app, .app.with-panel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
  .topbar .search { display: none; }
  .scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 39; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .content { padding: 18px 16px 32px; }
  .app.with-panel .panel { padding: 0 16px 28px; }
  .app.with-panel .panel > [data-panel-body] { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 50px); }
  .chat.thread-open .chat-list { display: none; }
  .chat:not(.thread-open) .chat-main { display: none; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 92%; }
  .topbar .user-chip .meta { display: none; }
}

@media (max-width: 760px) { .topbar .site-btn span { display: none; } .topbar .site-btn { padding: 0 10px; } }

/* Theme toggle on sign-in pages */
.theme-fab { position: fixed; top: 16px; right: 16px; z-index: 90; }

.topbar .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
@media (max-width: 760px) { .topbar .title { font-size: 15px; } }

/* ---------- admin dashboard (reference: desktop-admin-dashboard) ---------- */
a.card.kpi { color: inherit; transition: box-shadow .15s, transform .15s; }
a.card.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.dash-kpis .kpi .icon-tile { flex: none; }
.top-course { display: flex; flex-direction: column; gap: 12px; background: var(--primary-soft); border-color: transparent; }
:root[data-theme="dark"] .top-course { background: var(--surface-2); }
.top-course .icon-tile.white { background: var(--card); color: var(--primary); border: 1px solid var(--border); }
.top-course .caps { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.top-course .tiny svg { width: 13px; height: 13px; vertical-align: -2px; }
.card-head.pad { padding: 16px 18px 0; margin-bottom: 8px; }
.dash-list { display: flex; flex-direction: column; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); color: inherit; }
.dl-row:hover { background: var(--surface-2); }
.dl-row .pill { min-width: 74px; justify-content: center; }

/* teacher drawer – portal access card */
.access-card .kv, .kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; padding: 5px 0; }
.kv > span:first-child { color: var(--muted); }
.kv a, .kv strong { overflow-wrap: anywhere; text-align: right; }

/* colour picker field */
.input[type="color"] { width: 96px; padding: 4px; cursor: pointer; }

/* admin on phones */
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-kpis .kpi { padding: 14px; gap: 10px; }
  .dash-kpis .kpi .value { font-size: 20px; }
  .dl-row { padding: 11px 14px; gap: 8px; }
  .dl-row .pill { min-width: 0; }
}

/* course builder (reference: desktop-admin-course-builder) */
.curr-section { overflow: hidden; }
.curr-section .sec-head .sec-ic { color: var(--text-2); display: inline-flex; }
.curr-section .sec-head .sec-ic svg { width: 18px; height: 18px; }
.lesson .ltype { background: var(--primary-soft); }
.curr-section .add-row { padding: 12px 16px; border-top: 1px solid var(--border); }
.curr-section .add-row .link { color: var(--primary); display: inline-flex; align-items: center; gap: 8px; }
.add-sec-bar { display: flex; gap: 12px; align-items: center; padding: 16px 18px; }
.add-sec-bar .input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .add-sec-bar { flex-direction: column; align-items: stretch; } .hide-xs { display: none; } .lesson { flex-wrap: wrap; } }

/* ---------- student & teacher portals: WhatsApp is the only floating button ---------- */
.portal-wa { position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 54px; height: 54px; border-radius: 50%; background: #22c55e; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(34, 197, 94, .4); transition: transform .15s; }
.portal-wa:hover { transform: scale(1.06); }
.portal-wa svg { width: 27px; height: 27px; }
body:has(.chat) .portal-wa, body:has(.scrim) .portal-wa { display: none; }
@media (max-width: 760px) { .portal-wa { right: 14px; bottom: 14px; width: 50px; height: 50px; } }

/* ---------- chat: only the message list scrolls; the composer stays at the bottom ---------- */
.content:has(.chat) { padding-bottom: 24px; }
.chat { height: calc(100vh - var(--topbar-h) - 50px); height: calc(100dvh - var(--topbar-h) - 50px); }
.chat-main > .head, .chat-compose, .chat-main > .pinned-bar { flex: none; }
.chat-msgs { min-height: 0; overscroll-behavior: contain; }
@media (max-width: 760px) {
  /* full-screen chat under the top bar: no page scrolling, composer right at the bottom edge */
  .content:has(.chat) { padding: 0; }
  .chat { height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); min-height: 0; border: 0; border-radius: 0; }
  .chat-msgs { padding: 12px; }
  .chat-main > .head { padding: 10px 12px; }
  .chat-compose { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .chat-compose .btn { width: 40px; height: 40px; padding: 0; }
}

/* checkout: billing details + "New here / Log in" account step */
/* Student account: the back button + trail stays under the top bar while scrolling */
.content .trail-row { position: sticky; top: var(--topbar-h); z-index: 20; background: var(--bg); margin: -10px 0 12px; padding: 10px 0; }

/* Admin: a menu group's pages as a sliding red mini menu at the top of the page (no drop-downs in the sidebar) */
.gtabs-wrap { padding: 16px 26px 0; }
.gtabs { position: relative; display: inline-flex; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--pill); padding: 4px; box-shadow: var(--shadow-sm); vertical-align: top; }
.gtabs::-webkit-scrollbar { display: none; }
.gtabs a { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--pill); font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap; transition: color .3s ease; }
.gtabs a:hover { color: var(--primary); }
.gtabs a.active { color: #fff; }
.gtabs a .badge { background: var(--primary); color: #fff; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; }
.gtabs a.active .badge { background: #fff; color: var(--primary); }
.gtabs-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--pill); background: var(--primary); box-shadow: 0 4px 12px rgba(200,16,46,.28); pointer-events: none; }
.gtabs.ready .gtabs-pill { transition: transform .3s ease, width .3s ease; }
.gtabs:not(.ready) a.active { background: var(--primary); }
@media (max-width: 760px) { .gtabs-wrap { padding: 12px 16px 0; } .gtabs a { padding: 8px 13px; font-size: 13px; } }

/* Admin → Arrange order */
.arrange-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.arrange-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.arrange-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.arrange-thumb { flex: none; width: 72px; }
.arrange-thumb .thumb { padding: 0; border-radius: 8px; }
.arrange-thumb .thumb .tag { display: none; }

/* Store cart drawer */
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.cart-row .thumb { width: 74px; flex: none; aspect-ratio: 4 / 3; padding: 0; border-radius: 9px; }
.cart-row .thumb .thumb-icon { width: 46%; }
.cart-row .thumb .tag { display: none; }
.cart-row .c-price { display: inline-flex; background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; line-height: 1; padding: 6px 9px; border-radius: 7px; }
.cart-row.is-owned { opacity: .6; }
.cart-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px dashed var(--border-strong); font-weight: 600; }
.cart-total strong { font-size: 22px; color: var(--primary); }
.billing { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.billing .label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.billing .label svg { width: 15px; height: 15px; color: var(--primary); }
.billing .input[readonly] { background: var(--card); color: var(--muted); }
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.acct-tabs button { justify-content: center; font-size: 13px; }
@media (max-width: 420px) { .billing .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* student dashboard – "From the store" */
.store-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 8px; }
/* One 16:9 frame for every picture; the whole picture is shown, never cropped */
.thumb.has-img { background-size: contain; background-repeat: no-repeat; }
.store-row.mine { grid-template-columns: repeat(auto-fill, minmax(180px, 240px)); }
.store-row.mine .course-card .body { padding: 10px; }
.store-row.mine .course-card h4 { font-size: 13px; }
@media (max-width: 560px) { .store-row.mine { grid-template-columns: minmax(0, 1fr); } }
.store-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px; min-width: 0; }
.store-mini .thumb { aspect-ratio: 16 / 9; border-radius: 10px; }
.store-mini .row.between { align-items: center; gap: 8px; }
