:root {
    --primary: #1777F1;
    --secondary: #4394F6;
    --primary-rgb: 23, 119, 241;    
    --text-dark: #242933;    
    --text-muted: #606267;   
 
    --text-sidebar: #475569; 
    --bg-color: #F4F7FE;     
    --card-bg: rgba(255, 255, 255, 0.85); 
    --card-border: rgba(255, 255, 255, 0.5);
    --shadow: 0px 4px 20px rgba(112, 144, 176, 0.08);
    --border-light: rgba(55, 55, 56, 0.2);
    --radius-lg: 24px;
    --radius-md: 16px;
    --base-font-size: 14px;
    --ui-scale: 1;
    --ui-secondary-size: 12px;
    --scrollbar-size: 8px;
    --scrollbar-track: rgba(163, 174, 208, 0.18);
    --scrollbar-thumb: rgba(var(--primary-rgb), 0.35);
    --scrollbar-thumb-hover: rgba(var(--primary-rgb), 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', var(--font-bn, sans-serif), sans-serif; }
html[lang="bn"] body { font-family: var(--font-bn, 'Hind Siliguri'), 'Inter', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-dark); min-height: 100vh; overflow-x: hidden; font-size: calc(14px * var(--ui-scale, 1)); }


* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 999px;
    min-height: 40px;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    background-clip: padding-box;
    border: 2px solid transparent;
}
*::-webkit-scrollbar-corner {
    background: transparent;
}
.main-content,
.sidebar,
.admin-split-content,
.lesson-list,
.grading-student-list,
.lb-assignment-list,
.lb-list-scroll,
.lb-mobile-panel,
.admin-table-wrapper {
    scrollbar-gutter: stable;
}

.toast-container { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 420px; background: rgba(255,255,255,0.92); border: 1px solid var(--border-light); box-shadow: 0 10px 30px rgba(0,0,0,0.12); border-radius: 12px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; }
.toast .toast-icon { width: 28px; height: 28px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.toast .toast-body { flex: 1; }
.toast .toast-title { font-weight: 800; font-size: 13px; margin-bottom: 2px; color: var(--text-dark); }
.toast .toast-msg { font-size: 12px; color: var(--text-sidebar); line-height: 1.35; }
.toast .toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.toast.toast-success .toast-icon { background: rgba(16,185,129,0.12); color: #10b981; }
.toast.toast-error .toast-icon { background: rgba(239,68,68,0.10); color: #ef4444; }


.nc-form-saving {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.nc-form-saving[hidden] { display: none !important; }
.nc-form-saving-card {
    width: min(360px, 100%);
    text-align: center;
    padding: 28px 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-light);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}
html.dark .nc-form-saving-card,
body.dark .nc-form-saving-card {
    background: rgba(30, 41, 59, 0.96);
}
.nc-form-saving-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 3px solid rgba(var(--primary-rgb), 0.18);
    border-top-color: var(--primary);
    animation: nc-form-spin 0.75s linear infinite;
}
@keyframes nc-form-spin { to { transform: rotate(360deg); } }
.nc-form-saving-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
}
.nc-form-saving-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}
html.nc-form-saving-active,
html.nc-form-saving-active body {
    overflow: hidden;
}

@media (max-width: 768px) {
    .toast-container { top: 12px; right: 12px; left: 12px; }
    .toast { max-width: none; width: 100%; }
}

.course-progress-card { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; }
.course-progress-title { font-weight: 800; font-size: calc(13px * var(--ui-scale, 1)); color: var(--text-dark); }
.course-progress-subtitle { font-size: calc(12px * var(--ui-scale, 1)); color: var(--text-muted); }
.course-complete-btn { background: #10b981; padding: 10px 14px; }
.course-completed-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: calc(13px * var(--ui-scale, 1)); background: rgba(16, 185, 129, 0.1); color: #10b981; border-radius: 10px; font-weight: 800; }

.course-details-panel { margin-top: 10px; padding: 12px; }
.course-detail-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-light); padding-bottom: 8px; margin-bottom: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.course-detail-tab { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text-muted); font-weight: 700; font-size: calc(12px * var(--ui-scale, 1)); padding: 8px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.course-detail-tab.active { color: var(--primary); background: rgba(var(--primary-rgb), 0.08); }
.course-detail-tab-lessons { display: none; }
.course-detail-panel { display: none; }
.course-detail-panel.active { display: block; }
.course-detail-section-title { font-weight: 800; font-size: calc(13px * var(--ui-scale, 1)); color: var(--text-dark); margin-bottom: 8px; }
.course-detail-empty { color: var(--text-muted); font-size: calc(12px * var(--ui-scale, 1)); margin: 0; }
.course-progress-inline { display: flex; flex-direction: column; gap: 10px; }
.course-progress-inline-text { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.course-progress-bar-wrap { width: 100%; }
.course-progress-bar { height: 8px; background: rgba(163,174,208,0.25); border-radius: 999px; overflow: hidden; }
.course-progress-bar > div { height: 100%; background: var(--primary); }
.course-progress-action { display: flex; justify-content: flex-end; }
.course-detail-lessons-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lesson-list-mobile { max-height: min(55vh, 420px); overflow-y: auto; padding-right: 4px; -webkit-overflow-scrolling: touch; }


.bg-mesh {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2;
    background-image: var(--bg-mesh-1), var(--bg-mesh-2);
    opacity: var(--bg-mesh-opacity, 0.4);
    pointer-events: none;
}
body.has-custom-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image: var(--bg-custom-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
body.has-custom-bg::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background: rgba(244, 247, 254, 0.55);
    pointer-events: none;
}
html.theme-dark body.has-custom-bg::after {
    background: rgba(11, 18, 32, 0.72);
}
body.has-custom-bg .bg-mesh { opacity: calc(var(--bg-mesh-opacity, 0.4) * 0.45); }

#blob {
    background: var(--bg-blob, linear-gradient(to right, var(--primary), #8ABBF8)); border-radius: 50%;
    position: fixed; left: 50%; top: 50%; height: 350px; width: 350px; 
    transform: translate(-50%, -50%); z-index: -1; filter: blur(120px); opacity: 0.2; pointer-events: none;
}

.page-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 10px; }
.page-wrapper.page-wrapper-tight { padding-left: 5px; padding-right: 5px; padding-top: 8px; padding-bottom: 8px; }


.page-wrapper.page-wrapper-tight .app-container {
    width: 100%;
    max-width: 1920px;
    padding: 5px;
    gap: 12px;
}
.page-wrapper.page-wrapper-tight .right-panel.glass-card { background: rgba(244, 247, 254, 0.55); }

.auth-card { max-width: 480px; width: 100%; margin: auto; padding: 40px 36px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand-logo { max-height: 72px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 12px; }
.auth-brand-name { color: var(--primary); font-weight: 700; font-size: calc(1.4rem * var(--ui-scale, 1)); margin: 0; line-height: 1.3; }
.auth-error { color: #dc2626; margin-bottom: 16px; font-size: calc(14px * var(--ui-scale, 1)); text-align: center; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; }
.password-field-wrapper { position: relative; }
.password-field-wrapper .password-input { padding-right: 44px; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 8px; font-size: 16px; line-height: 1; }
.password-toggle:hover { color: var(--primary); }

.app-container {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1920px;
    height: 98vh; min-height: 800px;
    background: color-mix(in srgb, var(--bg-color) 40%, transparent);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 16px;
    box-shadow: 0 10px 40px rgba(112, 144, 176, 0.15);
    overflow-x: hidden;
}

.app-container.has-right-panel {
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 300px);
}

.app-container.has-right-panel .sidebar,
.app-container.has-right-panel .right-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.app-container.has-right-panel .sidebar {
    max-width: 250px;
}

.app-container.has-right-panel .right-panel {
    max-width: 300px;
}

.glass-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 15px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.outline-primary {
    border: 1px solid rgba(var(--primary-rgb), 0.4) !important;
    box-shadow: 0 10px 32px rgba(var(--primary-rgb), 0.1), var(--shadow);
}


.course-price-free { font-weight: 800; color: #10b981; }
.course-price-compare {
    display: block;
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 600;
    opacity: 0.85;
}
.course-price-offer-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
    margin: 4px 0 6px;
}
.course-price-current { font-weight: 800; color: var(--text-dark); }
.course-price-sm .course-price-current,
.course-price-sm.course-price-current,
.course-price-sm.course-price-free { font-size: 13px; }
.course-price-sm .course-price-compare { font-size: 11px; }
.course-price-md .course-price-current,
.course-price-md.course-price-current { font-size: 20px; }
.course-price-lg .course-price-current,
.course-price-lg.course-price-current,
.course-price-lg.course-price-free { font-size: 30px; line-height: 1.15; }
.course-price-lg .course-price-compare { font-size: 14px; }
.course-price-lg .course-price-offer-label { font-size: 11px; }


.cd-price-card {
    position: sticky;
    top: 12px;
    border-radius: 22px;
    overflow: visible;
    isolation: isolate;
    background: #fff;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1), 0 4px 14px rgba(var(--primary-rgb), 0.08);
}
.cd-price-card.is-offer { position: sticky; }


.cd-offer-ribbon {
    position: absolute;
    top: -6px;
    right: 18px;
    z-index: 3;
    min-width: 92px;
    padding: 10px 12px 12px;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 22px rgba(185, 28, 28, 0.35);
    line-height: 1.15;
}
.cd-offer-ribbon::before,
.cd-offer-ribbon::after {
    content: "";
    position: absolute;
    top: 0;
    width: 10px;
    height: 8px;
    background: #991b1b;
}
.cd-offer-ribbon::before {
    left: -10px;
    border-radius: 0 0 0 4px;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.cd-offer-ribbon::after {
    right: -10px;
    border-radius: 0 0 4px 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.cd-offer-ribbon-en {
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.cd-offer-ribbon-bn {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-bn, inherit);
}

.cd-price-card-head {
    position: relative;
    padding: 22px 22px 24px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(145deg, var(--primary) 0%, var(--secondary) 55%, rgba(var(--primary-rgb), 0.85) 100%);
    color: #fff;
}
.cd-price-card.is-offer .cd-price-card-head { padding-top: 28px; }
.cd-price-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.cd-price-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 16px;
}
.cd-price-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.cd-price-card-badge.is-free {
    background: rgba(16, 185, 129, 0.95);
    border-color: transparent;
}
.cd-price-card-label {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    opacity: 0.96;
}
.cd-price-card-amount {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}
.cd-price-card-compare {
    font-size: 22px;
    font-weight: 700;
    text-decoration: line-through;
    opacity: 0.78;
}
.cd-price-card-current {
    font-size: clamp(2.5rem, 5.5vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.cd-price-card-hint {
    margin: 12px 0 0;
    font-size: 16px;
    font-weight: 650;
    opacity: 0.94;
}
.cd-price-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cd-price-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2px;
    order: 2;
}
.cd-price-card-includes { order: 1; }
.cd-price-card-cta,
.cd-price-card-actions .btn.cd-price-card-cta {
    width: 100%;
    justify-content: center;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 750;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.28);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
}
.cd-price-card-cta:hover,
.cd-price-card-actions .btn.cd-price-card-cta:hover {
    filter: brightness(1.05);
    color: #fff;
}
.cd-price-card-cta.is-disabled {
    opacity: 0.85;
    pointer-events: none;
    cursor: default;
}
.cd-price-card-cta-secondary,
.cd-price-card-actions .btn.cd-price-card-cta-secondary {
    width: 100%;
    justify-content: center;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 650;
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    box-shadow: none;
}
.cd-price-card-includes {
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 16px;
    padding: 14px 14px 6px;
}
.cd-price-card-includes h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cd-price-card-includes ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cd-price-card-includes li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(var(--primary-rgb), 0.08);
    font-size: 13px;
}
.cd-price-card-includes li:first-of-type { border-top: none; }
.cd-inc-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-size: 12px;
}
.cd-inc-label { color: var(--text-dark); font-weight: 600; min-width: 0; }
.cd-inc-value {
    color: var(--text-muted);
    font-weight: 650;
    text-align: right;
    white-space: nowrap;
    justify-self: end;
}


.nc-lang-switch-item {
    padding: 2px 10px 10px;
    list-style: none;
}
.nc-lang-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}
.nc-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    transition: background .15s ease, color .15s ease;
}
.nc-lang-btn.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.28);
}
.nc-lang-btn:not(.is-active):hover {
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.55);
}
html.theme-dark .nc-lang-switch {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(148, 163, 184, 0.2);
}
html.theme-dark .nc-lang-btn:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.08);
}

html.theme-dark .cd-price-card {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}
html.theme-dark .cd-price-card-cta,
html.theme-dark .cd-price-card-actions .btn.cd-price-card-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}
html.theme-dark .cd-price-card-cta-secondary,
html.theme-dark .cd-price-card-actions .btn.cd-price-card-cta-secondary {
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-dark);
    border-color: var(--border-light);
}
html.theme-dark .cd-price-card-includes {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.18);
}


.sidebar { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; height: 100%; padding-right: 5px; z-index: 100; position: relative;}


.app-container.course-player.has-right-panel .sidebar {
    background: rgba(244, 247, 254, 0.55);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 10px;
}


.app-container.admin-layout.leaderboard-workspace .sidebar,
.app-container.admin-layout.grading-workspace .sidebar,
.app-container.admin-layout.has-right-panel:not(.course-player) .sidebar {
    width: 100%;
    max-width: none;
    padding: 0 5px 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.close-sidebar-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(112, 144, 176, 0.12);
    color: var(--text-sidebar);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.close-sidebar-btn:hover,
.close-sidebar-btn:focus-visible {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.25);
    outline: none;
}
.close-sidebar-btn:active { transform: scale(0.96); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--border-light);
}
.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8ABBF8);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
    object-fit: cover;
    overflow: hidden;
}
.user-info h4 { font-size: 16px; color: var(--text-dark); font-weight: 700; line-height: 1.2; margin: 0 0 3px; }
.user-info p { font-size: 13px; color: var(--text-muted); margin: 0; }

.nav-label { font-size: 12px; text-transform: none; color: var(--text-muted); letter-spacing: normal; font-weight: 600; margin: 6px 0 2px 0; display: block; }
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-item { 
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; 
    color: var(--text-sidebar); font-weight: 600; cursor: pointer; transition: 0.2s; font-size: calc(14px * var(--ui-scale, 1)); text-decoration: none; 
}
.nav-item i { width: 16px; text-align: center; }
.nav-item:hover { background: rgba(var(--primary-rgb), 0.05); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3); }


.main-content { display: flex; flex-direction: column; gap: 12px; height: 100%; overflow-y: auto; overflow-x: hidden; padding-right: 0; min-width: 0; }
.app-container.has-right-panel .main-content { padding-right: 0; margin-right: 0; }

.assignment-panel { width: 100%; box-sizing: border-box; }
.assignment-submit-form { width: 100%; max-width: 100%; }
.assignment-fields { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.assignment-field { margin: 0; width: 100%; max-width: 100%; }
.assignment-upload {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.assignment-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.assignment-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    background: rgba(255,255,255,0.75);
    cursor: pointer;
    margin: 0;
    color: inherit;
    font-weight: 500;
    text-transform: none;
}
.assignment-dropzone:hover,
.assignment-dropzone.is-dragover {
    border-color: var(--primary);
    background: #fff;
}
.assignment-dropzone.has-file { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.04); }
.assignment-dropzone-icon { font-size: 28px; color: var(--primary); line-height: 1; }
.assignment-dropzone-title { font-size: 14px; color: var(--text-dark); }
.assignment-dropzone-hint { font-size: 12px; color: var(--text-muted); }
.assignment-dropzone-name { font-size: 13px; color: var(--primary); font-weight: 700; min-height: 1.2em; }

.assignment-submit-form.is-uploading .assignment-dropzone {
    pointer-events: none;
    opacity: 0.72;
    border-color: var(--primary);
}
.assignment-submit-form.is-uploading .assignment-submit-btn {
    opacity: 0.85;
    cursor: wait;
    transform: none;
}
.assignment-upload-progress {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}
.assignment-upload-progress-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.15);
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}
.assignment-upload-progress-bar::after {
    content: '';
    position: absolute;
    left: -40%;
    top: 0;
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 999px;
    animation: assignmentUploadIndeterminate 1.1s ease-in-out infinite;
}
.assignment-upload-progress-text {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
@keyframes assignmentUploadIndeterminate {
    0% { left: -40%; }
    100% { left: 100%; }
}


.header { display: flex; align-items: flex-start; gap: 15px; flex-shrink: 0; }
.header-brand {
    display: none;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-dark);
    min-width: 0;
    max-width: 42%;
    flex-shrink: 1;
}
.header-brand-logo {
    height: 28px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}
.header-brand-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hamburger-btn { display: none; background: white; border: 1px solid var(--border-light); border-radius: 8px; width: 40px; height: 40px; justify-content: center; align-items: center; font-size: 18px; color: var(--primary); cursor: pointer; box-shadow: var(--shadow); flex-shrink: 0; }
.header-text { min-width: 0; flex: 1; }
.header-text h1 { font-size: calc(24px * var(--ui-scale, 1)); color: var(--text-dark); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-text p { display: none; } 


.player-wrapper { position: relative; width: 100%; max-height: 68vh; aspect-ratio: 16 / 9; margin: 0 auto; background-color: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2); flex-shrink: 0; }
.player-wrapper:fullscreen { max-height: none !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.player-wrapper:-webkit-full-screen { max-height: none !important; width: 100% !important; height: 100% !important; border-radius: 0; }
#youtube-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-shield { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; background: transparent; }
.video-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; background-color: #1e293b; color: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: 2vw; font-weight: 600; }
.video-cover-play {
    font-size: 1.05rem;
    color: var(--primary);
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    pointer-events: none;
    padding-left: 2px; 
}
.video-cover.is-started {
    pointer-events: none;
    cursor: default;
}
.custom-controls { position: absolute; bottom: 0; left: 0; width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; background: #0f172a; padding: 0 15px; z-index: 30; }
.custom-controls button, .custom-controls select { flex-shrink: 0; }
.custom-controls button { background: none; color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 50%; transition: background 0.2s; }
.custom-controls button:hover { background-color: rgba(255, 255, 255, 0.1); }
.custom-controls button .material-symbols-outlined,
.custom-controls button i { font-size: 20px; }
.time-display { color: white; font-size: calc(12px * var(--ui-scale, 1)); font-weight: 500; min-width: 80px; text-align: center; white-space: nowrap;}
.custom-controls select { background-color: transparent; color: white; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; padding: 2px 4px; font-size: calc(12px * var(--ui-scale, 1)); outline: none; cursor: pointer; }
.custom-controls select option { background-color: #1e293b; }
input[type="range"] { flex-grow: 1; cursor: pointer; accent-color: var(--primary); height: 4px; min-width: 30px; }
.mobile-rotate-btn { display: none !important; }
.desktop-fullscreen-btn { display: flex !important; }


.course-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; margin-top: 5px; overflow-x: auto; flex-shrink: 0;}
.tab { font-size: calc(14px * var(--ui-scale, 1)); font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: 0.2s;}
.tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: -11px; }

.course-description { font-size: calc(14px * var(--ui-scale, 1)); color: var(--text-dark); line-height: 1.6; margin-top: 5px; flex-shrink: 0; }


.right-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; min-width: 0; }
.curriculum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    min-width: 0;
}
.curriculum-header h3 {
    margin: 0;
    font-size: calc(13px * var(--ui-scale, 1));
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-dark);
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress-text {
    flex: 0 0 auto;
    font-size: calc(11px * var(--ui-scale, 1));
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary);
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
}

.lesson-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overflow-x: hidden; padding-right: 5px; min-width: 0; }
.lesson-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: white; border-radius: 12px; border: 1px solid var(--border-light); cursor: pointer; transition: 0.2s;}
.lesson-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.lesson-item.active { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.07); box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.12); position: relative; }
.lesson-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 999px; background: var(--primary); }
.lesson-item.active .lesson-info h4 { color: var(--primary); }
.lesson-item.active:hover { transform: none; }

.lesson-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-color); display: flex; justify-content: center; align-items: center; color: var(--text-muted); font-size: 14px; flex-shrink: 0;}
.lesson-item.active .lesson-icon { background: var(--primary); color: white; }
.lesson-item.completed .lesson-icon { background: #34C759; color: white; }

.lesson-info h4 { font-size: calc(13px * var(--ui-scale, 1)); color: var(--text-dark); margin-bottom: 4px; overflow-wrap: anywhere; word-break: break-word; }
.lesson-info p { font-size: calc(11px * var(--ui-scale, 1)); color: var(--text-muted); }


@media (max-width: 1100px) {
    
    .app-container,
    .app-container.has-right-panel,
    .app-container.admin-layout.has-right-panel,
    .app-container.course-player,
    .app-container.course-player.has-right-panel,
    .app-container.grading-workspace,
    .app-container.leaderboard-workspace,
    .app-container.admin-layout.grading-workspace,
    .app-container.admin-layout.leaderboard-workspace,
    .app-container.admin-layout.course-player {
        grid-template-columns: 250px minmax(0, 1fr) !important;
    }
    .right-panel { display: none; }

    .app-container.course-player .course-detail-tab-lessons { display: inline-flex; }
    .app-container.course-player .right-panel { display: none !important; }
}


@media (min-width: 1101px) {
    .app-container.course-player.has-right-panel {
        grid-template-columns: 250px minmax(0, 1fr) minmax(260px, 300px) !important;
    }
    .app-container.course-player.has-right-panel > .right-panel {
        display: flex !important;
        min-width: 0;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .page-wrapper { padding: 0; display: block; }
    
    .app-container { 
        display: flex; flex-direction: column; 
        height: auto; min-height: 100vh;
        width: 100%; max-width: 100vw; overflow-x: hidden; overflow-wrap: break-word;
        padding: 15px; gap: 15px; border-radius: 0;
        
        background: transparent;
        background: color-mix(in srgb, var(--bg-color) 28%, transparent);
        border: none; box-shadow: none;
    }
    body.has-custom-bg .app-container {
        background: color-mix(in srgb, var(--bg-color) 14%, transparent);
    }
    html.theme-dark .app-container {
        background: color-mix(in srgb, var(--bg-color) 30%, transparent) !important;
        box-shadow: none !important;
    }
    html.theme-dark body.has-custom-bg .app-container {
        background: color-mix(in srgb, var(--bg-color) 16%, transparent) !important;
    }

    
    .app-container.course-player {
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        padding-top: 8px;
        padding-bottom: 10px;
        gap: 10px;
    }
    
    
    .hamburger-btn { display: flex; }

    
    .page-wrapper,
    .app-container {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        filter: none !important;
        perspective: none !important;
        contain: none !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: min(300px, 88vw);
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
        background: #ffffff !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18) !important;
        z-index: 10050 !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        transform: translateX(-105%) !important;
        transition: transform 0.28s ease !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sidebar.show {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10040;
        background: rgba(15, 23, 42, 0.48);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.show { display: block; }
    body.sidebar-open {
        overflow: hidden !important;
        touch-action: none;
        overscroll-behavior: none;
    }

    .close-sidebar-btn {
        display: inline-flex;
        top: 16px;
        right: 16px;
    }
    .sidebar .user-profile {
        padding-right: 44px; 
        margin-top: 2px;
        min-height: 52px;
        align-items: center;
        flex-shrink: 0;
    }
    .sidebar .nav-menu { flex-shrink: 0; }

    
    .main-content { overflow-x: hidden; overflow-y: visible; padding-right: 0; height: auto; gap: 8px; min-width: 0; max-width: 100%; }

    
    .header,
    .header.header-mobile-branded,
    .header.has-dark-toggle {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 0 !important;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .header > .hamburger-btn {
        order: 1;
        flex-shrink: 0;
        align-self: center;
        width: 40px;
        height: 40px;
    }
    .header > .header-brand {
        order: 2;
        flex-shrink: 0;
        display: inline-flex;
        max-width: none;
    }
    .header > .header-brand .header-brand-name { display: none; }
    .header > .header-brand:not(:has(.header-brand-logo)) { display: none; }
    .header > .header-text {
        order: 3;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0;
    }
    .header > .header-text h1 {
        font-size: 1.15rem;
        font-weight: 800;
        margin: 0;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    .header > .header-text p {
        display: block;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin: 0 0 1px;
        line-height: 1.2;
    }
    .header > .nc-dark-toggle-header {
        order: 4 !important;
        display: inline-flex !important;
        margin-left: 0 !important;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        align-self: center;
    }
    .header > *:not(.hamburger-btn):not(.header-brand):not(.header-text):not(.nc-dark-toggle-header) {
        order: 10;
        flex: 1 1 100%;
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        box-sizing: border-box;
    }
    .header > div[style*="margin-left: auto"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .header > div[style*="margin-left: auto"] > div { width: 100% !important; }
    .header input[type="text"],
    .header input[type="search"],
    .header .form-control { width: 100% !important; max-width: 100%; }
    .header .btn { width: 100%; justify-content: center; }

    .app-container.course-player .header { gap: 10px !important; margin-bottom: 10px !important; }
    .header-text h1 { font-size: 18px; }
    
    
.player-wrapper { max-height: unset; width: 100%; aspect-ratio: 16 / 9; }
.video-cover { font-size: 5vw; }
.video-cover-play {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
}
.custom-controls { padding: 0 6px; gap: 4px; height: 30px; background: #0f172a;}
.time-display { font-size: 10px; min-width: 60px;}
.custom-controls button { padding: 2px; }
.custom-controls button .material-symbols-outlined,
.custom-controls button i { font-size: 18px; }
.desktop-fullscreen-btn { display: none !important; }
.mobile-rotate-btn { display: flex !important; } 
    
    
    .right-panel { 
        display: flex; height: auto; overflow: visible; margin-top: 4px; padding: 12px;
    }
    .app-container.course-player .right-panel { display: none !important; }
    .curriculum-header { margin-bottom: 10px; }
    .lesson-list { max-height: 360px; overflow-y: auto; padding-right: 4px; } 

    .lesson-item { padding: 10px; border-radius: 12px; }
    .lesson-icon { width: 34px; height: 34px; }

    .app-container.course-player .course-progress-card { margin-top: 8px; padding: 10px 12px; }

    .app-container.course-player .course-details-panel { margin-top: 8px; padding: 10px; }
    .app-container.course-player .course-detail-tab { font-size: calc(11px * var(--ui-scale, 1)); padding: 7px 5px; }
    .app-container.course-player .course-complete-btn { padding: 8px 12px; font-size: calc(12px * var(--ui-scale, 1)); }
    .app-container.course-player .course-completed-pill { padding: 8px 12px; font-size: calc(12px * var(--ui-scale, 1)); }
}


.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }


.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px; }
.admin-stat-card { display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; text-align: center; padding: 30px 20px !important; }
.admin-stat-card h3 { font-size: 13px; color: var(--text-muted); text-transform: none; letter-spacing: normal;}
.admin-stat-card h2 { font-size: 36px; color: var(--primary); font-weight: 700;}

.admin-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.admin-table-wrapper { overflow-x: auto; width: 100%; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 15px; border-bottom: 1px solid var(--border-light); font-size: calc(14px * var(--ui-scale, 1)); color: var(--text-dark); white-space: nowrap; }
.admin-table th { color: var(--text-muted); font-weight: 700; text-transform: none; font-size: calc(13px * var(--ui-scale, 1)); letter-spacing: normal; }
.admin-table tr:hover { background: rgba(255,255,255,0.4); }
.group-row-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.group-row-actions form {
    margin: 0;
    display: inline-flex;
    flex: 0 0 auto;
}
.group-row-actions .btn,
.group-row-actions a.btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    justify-content: center;
    white-space: nowrap;
}
.group-row-actions .group-action-icon {
    width: 34px;
    min-width: 34px;
    padding: 0;
    gap: 0;
}
.group-manager-table th:last-child,
.group-manager-table td:last-child {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    text-align: right;
}

.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 6px; font-size: calc(13px * var(--ui-scale, 1)); font-weight: 600; color: var(--text-sidebar); text-transform: none; letter-spacing: normal; }
.form-control { width: 100%; padding: 12px 15px; border-radius: 10px; border: 1px solid var(--border-light); background: rgba(255,255,255,0.7); outline: none; font-family: 'Inter'; font-size: calc(14px * var(--ui-scale, 1)); transition: 0.2s; box-sizing: border-box; }
.form-control:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }

.btn { padding: 12px 24px; border-radius: 10px; border: none; background: var(--primary); color: white; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: calc(14px * var(--ui-scale, 1)); display: inline-flex; align-items: center; gap: 8px; text-decoration: none;}
.btn:hover { box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3); transform: translateY(-2px); }
.btn-sm { padding: 8px 14px; font-size: calc(12px * var(--ui-scale, 1)); border-radius: 8px; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3); }
.btn-secondary { background: white; color: var(--text-sidebar); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: #f8fafc; box-shadow: var(--shadow); }

@media (min-width: 769px) {
    .app-container.admin-layout { grid-template-columns: 250px 1fr !important; }
    .app-container.has-right-panel,
    .app-container.admin-layout.has-right-panel,
    .app-container.admin-layout.grading-workspace,
    .app-container.admin-layout.leaderboard-workspace,
    .app-container.admin-layout.course-player {
        grid-template-columns: 250px minmax(0, 1fr) 300px !important;
        max-width: 1920px;
    }
    
    .app-container.admin-layout.leaderboard-workspace,
    .app-container.admin-layout.grading-workspace {
        grid-template-columns: 250px minmax(0, 1fr) 300px !important;
    }
    .app-container.admin-layout.leaderboard-workspace > .sidebar,
    .app-container.admin-layout.grading-workspace > .sidebar {
        width: 250px;
        min-width: 250px;
        max-width: 250px;
    }
}

.admin-table-wrapper { overflow-x: auto; overflow-y: auto; max-height: 400px; width: 100%; }
.admin-table th { position: sticky; top: 0; background: #fff; z-index: 10; }


.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
.dashboard-grid-full {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
@media (max-width: 1024px) {
    .admin-grid, .dashboard-grid, .dashboard-grid-full { grid-template-columns: 1fr !important; }
}
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.chart-container canvas {
    max-width: 100% !important;
}


.admin-split-card {
    display: flex;
    flex-direction: row;
    padding: 0 !important;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    height: 100%;
}
.admin-split-sidebar {
    width: 250px;
    background: rgba(244, 247, 254, 0.5);
    border-right: 1px solid var(--border-light);
    padding: 20px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.admin-split-sidebar > .site-hub-nav,
.admin-split-sidebar > .ce-nav,
.admin-split-sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}
.admin-split-sidebar > .ce-nav-footer {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    background: rgba(244, 247, 254, 0.92);
    position: sticky;
    bottom: 0;
    z-index: 2;
}
html.theme-dark .admin-split-sidebar > .ce-nav-footer {
    background: rgba(15, 23, 42, 0.92);
}
.admin-split-sidebar .btn,
.admin-split-sidebar .btn-sm,
.admin-split-sidebar a.btn {
    font-size: calc(14px * var(--ui-scale, 1));
    font-weight: 650;
    line-height: 1.35;
    padding: 10px 14px;
}
.admin-split-sidebar .ann-sidebar-note { font-size: calc(13px * var(--ui-scale, 1)); }
.users-tab-btn,
.setting-tab-btn,
.ann-tab-btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-dark);
}
.users-tab-btn.active,
.setting-tab-btn.active,
.ann-tab-btn.active {
    background: var(--primary);
    color: #fff;
}


.ce-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 100%;
}
.ce-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ce-nav-toggle,
.ce-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 9px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dark);
    font: inherit;
    font-size: calc(14px * var(--ui-scale, 1));
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
a.ce-nav-item:hover,
a.ce-nav-item:focus,
a.ce-nav-item:active,
a.ce-nav-item.active {
    text-decoration: none !important;
}
.ce-nav-toggle {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
    font-size: calc(12px * var(--ui-scale, 1));
    padding: 8px 10px;
}
.ce-nav-toggle:hover,
.ce-nav-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-dark);
}
.ce-nav-chevron {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 11px;
}
.ce-nav-item i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}
.ce-nav-item.active {
    background: var(--primary);
    color: #fff;
}
.ce-nav-item.active i { opacity: 1; }
.ce-nav-list {
    list-style: none;
    margin: 0;
    padding: 2px 0 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 2px solid rgba(var(--primary-rgb), 0.18);
    margin-left: 10px;
}
.ce-nav-list[hidden] { display: none !important; }
.ce-nav-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.ce-nav-save {
    width: 100%;
    justify-content: center;
}


.ui-secondary,
.lp-hint,
.pu-muted,
.form-group > small {
    font-size: var(--ui-secondary-size, 12px);
    line-height: 1.45;
}


.btn.is-loading,
button.is-loading.btn {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}
.btn.is-loading > *,
button.is-loading.btn > * {
    visibility: hidden;
}
.btn.is-loading::after,
button.is-loading.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    margin: -0.5em 0 0 -0.5em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nc-btn-spin 0.65s linear infinite;
}
@keyframes nc-btn-spin {
    to { transform: rotate(360deg); }
}
.admin-split-content {
    flex: 1 1 auto;
    padding: 30px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}


.admin-split-content:has(> .users-section),
.admin-split-content:has(> .admin-table-wrapper),
.admin-split-content:has(> .setting-section .admin-table-wrapper) {
    overflow-y: hidden;
}


.admin-split-content:has(> .cb-tab-content),
.admin-split-content:has(> .setting-section):not(:has(.admin-table-wrapper)) {
    overflow-y: auto;
}


.main-content:has(.admin-split-card) {
    min-height: 0;
    overflow: hidden;
    gap: 8px;
}
.main-content:has(.admin-split-card) > .header,
.main-content:has(.admin-split-card) > .header.has-dark-toggle {
    flex-shrink: 0;
    margin-bottom: 0 !important;
}
.main-content:has(.admin-split-card) > form:has(.admin-split-card) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}
.main-content:has(.admin-split-card) > form:has(.admin-split-card) > .admin-split-card,
.main-content:has(.admin-split-card) > .admin-split-card {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    align-self: stretch;
}


.admin-split-content > .setting-section,
.admin-split-content > .users-section,
.admin-split-content > .ann-section {
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
}
.admin-split-content > .setting-section[style*="display: flex"],
.admin-split-content > .setting-section[style*="display:flex"],
.admin-split-content > .users-section[style*="display: flex"],
.admin-split-content > .users-section[style*="display:flex"],
.admin-split-content > .ann-section[style*="display: flex"],
.admin-split-content > .ann-section[style*="display:flex"] {
    display: flex !important;
}
.admin-split-content .admin-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}


.admin-split-card:has(.vf-heading) .admin-split-sidebar {
    width: 300px;
    min-width: 280px;
    flex-shrink: 0;
}
.vf-heading {
    font-size: calc(13px * var(--ui-scale, 1));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 15px;
    font-weight: 750;
}
.vf-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    line-height: 1.3;
    min-width: 0;
    font-size: calc(14px * var(--ui-scale, 1));
}
.vf-btn .vf-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    margin-top: 3px;
    font-size: 14px;
}
.vf-btn .vf-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
}
.vf-btn .vf-name {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-weight: 650;
    font-size: 15px;
}
.vf-btn .vf-meta {
    display: block;
    margin-top: 3px;
    font-size: calc(12px * var(--ui-scale, 1));
    font-weight: 500;
    opacity: 0.75;
}
.virtual-folder-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.virtual-folder-btn.vf-warn:not(.active) {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.virtual-folder-btn.vf-caution:not(.active) {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}


.fm-file-name {
    display: inline-block;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
@media (max-width: 900px) {
    .fm-file-name { max-width: 140px; }
}


.admin-info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
}
.admin-info-tip-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-info-tip-btn:hover,
.admin-info-tip.is-open .admin-info-tip-btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.admin-info-tip-pop {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 8px);
    left: 0;
    width: min(320px, 72vw);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    font-size: var(--ui-secondary-size, 12px);
    line-height: 1.45;
    color: var(--text-dark);
    font-weight: 400;
    font-style: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.admin-info-tip-pop a { color: var(--primary); }
.admin-info-tip.tip-end .admin-info-tip-pop {
    left: auto;
    right: 0;
}
html.theme-dark .admin-info-tip-pop {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.25);
}
.admin-info-tip-pop[hidden] { display: none !important; }


.yt-pl-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    padding: 16px;
    box-sizing: border-box;
}
.yt-pl-dialog {
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.yt-pl-head {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.yt-pl-body {
    padding: 16px 20px 20px;
    overflow: auto;
    min-width: 0;
}
.yt-pl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.yt-pl-status {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}
.yt-pl-preview-host { min-width: 0; }
.yt-pl-preview-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.06);
    overflow: hidden;
}
.yt-pl-preview-meta {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-dark);
    word-break: break-word;
}
.yt-pl-preview-meta strong { font-weight: 700; }
.yt-pl-preview-meta .yt-pl-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}
.yt-pl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow: auto;
}
.yt-pl-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-dark);
}
.yt-pl-list li:last-child { border-bottom: none; }
.yt-pl-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
    padding-top: 1px;
}
.yt-pl-title {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
html.theme-dark .yt-pl-preview-card { background: rgba(15, 23, 42, 0.45); }
.lp-section-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 0;
    margin-bottom: 12px;
}
.lp-section-themes-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .main-content:has(.admin-split-card) { overflow-y: auto; }
    .admin-split-card { flex-direction: column; min-height: auto; flex: 0 0 auto; height: auto; }
    .admin-split-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-light); padding: 15px; }
    .admin-split-content { padding: 15px; max-height: min(70vh, 640px); overflow-y: auto; }
    .admin-split-content .admin-table-wrapper { max-height: min(50vh, 420px); flex: 0 1 auto; }
}


.grading-workspace-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.grading-workspace-toolbar-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.grading-workspace-alert { margin-bottom: 12px; }
.grading-workspace-main { min-height: 0; flex: 1; }
.grading-right-panel { padding: 0; overflow: hidden; }
.grading-students-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.grading-students-header h3 i { color: var(--primary); font-size: 14px; }
.grading-students-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.grading-sidebar-scroll { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.grading-sidebar { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; padding: 12px; }
.grading-sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border-light);
}
.grading-sidebar-search { margin: 0; }
.grading-search-field { position: relative; }
.grading-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}
.grading-search-field .form-control { padding-left: 34px; }
.grading-sidebar-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grading-filter-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}
.grading-filter-chip > i { display: none; }
.grading-filter-chip .form-control { padding: 8px 10px; font-size: 12px; }
.grading-search-active {
    margin-left: auto;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.grading-search-clear {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}
.grading-search-clear:hover { color: #ef4444; }
.grading-student-list-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 0 2px;
}
.grading-student-list-label i { color: var(--primary); }
.grading-student-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; flex: 1; padding-right: 2px; }
.grading-student-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.85);
    color: inherit;
    transition: 0.15s;
    position: relative;
    overflow: hidden;
}
.grading-student-main {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.grading-student-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8ABBF8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    object-fit: cover;
}
.grading-student-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.grading-student-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    z-index: 2;
}
.grading-status-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    pointer-events: none;
}
.grading-status-dot.is-pending { background: rgba(245,158,11,0.18); color: #b45309; }
.grading-status-dot.is-graded { background: rgba(16,185,129,0.18); color: #047857; }
.grading-profile-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: 0.15s;
}
.grading-profile-btn:hover {
    background: var(--primary);
    color: #fff;
}
.grading-student-status { display: none; }
.grading-student-item:hover { border-color: var(--primary); background: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(112,144,176,0.12); }
.grading-student-item.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.15);
}
.grading-student-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
    z-index: 1;
}
.grading-student-meta strong { font-size: 14px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grading-student-meta small {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: inline-flex; align-items: center; gap: 5px;
}
.grading-student-meta small i { font-size: 11px; opacity: 0.8; flex-shrink: 0; }
.grading-student-date {
    font-size: 12px; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 5px;
}
.grading-student-status {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 4px 8px; border-radius: 999px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 2px;
}
.grading-student-status.is-pending { background: rgba(245,158,11,0.15); color: #b45309; }
.grading-student-status.is-graded { background: rgba(16,185,129,0.15); color: #047857; }
.grading-student-empty {
    color: var(--text-muted); font-size: 13px; text-align: center;
    padding: 28px 12px; margin: 0;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.grading-student-empty i { font-size: 22px; color: var(--primary); opacity: 0.55; }

.grading-submission-panel { padding: 20px; }
.grading-submission-header {
    display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
    flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light);
}
.grading-submission-subtitle { font-size: 13px; color: var(--text-muted); }
.grading-submission-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grading-score-pill {
    font-size: 13px; font-weight: 700; color: var(--text-dark);
    background: rgba(16,185,129,0.1); border-radius: 999px; padding: 6px 10px;
}
.grading-submission-body {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: start;
}
.grading-section-label { font-size: 13px; margin: 0 0 8px; color: var(--text-sidebar); text-transform: none; letter-spacing: normal; }
.grading-text-answer {
    background: rgba(0,0,0,0.03); border: 1px solid var(--border-light);
    border-radius: 10px; padding: 14px; white-space: pre-wrap;
    color: var(--text-dark); min-height: 80px; margin-bottom: 16px;
}
.grading-empty-note, .grading-empty-state p { color: var(--text-muted); }
.grading-grade-form-wrap {
    background: rgba(244,247,254,0.55);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
}
.grading-save-btn { width: 100%; justify-content: center; margin-top: 16px; }
.grading-empty-state { padding: 40px 24px; text-align: center; }

.grading-mobile-students { display: none; margin-bottom: 12px; padding: 0; overflow: hidden; }
.grading-mobile-students-toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border: none; background: transparent; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--text-dark);
}
.grading-mobile-chevron { margin-left: auto; transition: transform 0.2s; }
.grading-mobile-students-toggle.is-open .grading-mobile-chevron { transform: rotate(180deg); }
.grading-mobile-students-panel { border-top: 1px solid var(--border-light); max-height: 360px; overflow: auto; }

@media (max-width: 1100px) {
    .app-container.grading-workspace .grading-right-panel { display: none !important; }
    .grading-mobile-students { display: block; }
    .grading-submission-body { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .grading-student-main { grid-template-columns: 36px 1fr; }
    .grading-student-avatar { width: 36px; height: 36px; min-width: 36px; max-width: 36px; }
}


.nc-media {
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
    vertical-align: middle;
}
img.nc-media {
    display: block;
    object-fit: cover;
}
.nc-media-ph {
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 800;
}
img.nc-media.admin-user-avatar,
.nc-media-ph.admin-user-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
}
img.nc-media.lb-list-avatar,
.nc-media-ph.lb-list-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    pointer-events: none;
    user-select: none;
}
img.nc-media.lb-podium-avatar,
.nc-media-ph.lb-podium-avatar {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.18);
}
img.nc-media.avatar,
.nc-media-ph.avatar {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
}
img.nc-media.sd-course-thumb,
.nc-media-ph.sd-course-thumb {
    width: 88px !important;
    height: 64px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    border-radius: 10px !important;
}
img.nc-media.store-thumb,
.nc-media-ph.store-thumb {
    width: 100% !important;
    height: 160px !important;
    border-radius: 0 !important;
}
img.nc-media.id-course-thumb,
.nc-media-ph.id-course-thumb {
    width: 72px !important;
    height: 56px !important;
    border-radius: 10px !important;
}


.leaderboard-board-main { transition: opacity .25s ease; }
.lb-board-head {
    display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
    flex-wrap: wrap; margin-bottom: 14px;
}
.lb-board-head h2 { margin: 0 0 4px; font-size: 22px; color: var(--text-dark); }
.lb-board-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.lb-board-stats { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lb-board-stats span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 999px; background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary); font-size: 13px; font-weight: 700;
}
.lb-my-position-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.08); color: var(--primary);
    font-size: 12px; font-weight: 700; border: 1px solid transparent;
    cursor: pointer; font: inherit;
    transition: background .15s, border-color .15s, transform .15s;
}
.lb-my-position-btn:hover,
.lb-my-position-btn.is-active {
    background: rgba(var(--primary-rgb), 0.16);
    border-color: rgba(var(--primary-rgb), 0.35);
}
.lb-list-card {
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(52vh, 520px);
}
.lb-list-scroll {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    padding-right: 2px;
}
.lb-row.lb-flash {
    animation: lbFlash 1.4s ease;
    border-color: rgba(var(--primary-rgb), 0.55) !important;
    background: rgba(var(--primary-rgb), 0.12) !important;
}
@keyframes lbFlash {
    0%, 100% { box-shadow: none; }
    30% { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25); }
}
.lb-position-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    z-index: 9999;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--text-dark, #1a1a1a);
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.lb-position-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.lb-podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}
.lb-podium-card {
    position: relative;
    padding: 18px 14px 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.95), rgba(244,247,254,0.9)),
        #fff;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    text-align: center;
    animation: lbFadeUp .55s ease both;
    animation-delay: var(--lb-delay, 0s);
}
.lb-podium-first {
    padding-top: 26px;
    background:
        linear-gradient(160deg, rgba(251,191,36,0.28), rgba(255,255,255,0.95) 55%),
        #fff;
    border-color: rgba(245,158,11,0.35);
}
.lb-podium-second {
    background:
        linear-gradient(160deg, rgba(148,163,184,0.22), rgba(255,255,255,0.95) 55%),
        #fff;
}
.lb-podium-third {
    background:
        linear-gradient(160deg, rgba(251,146,60,0.22), rgba(255,255,255,0.95) 55%),
        #fff;
}
.lb-podium-empty { visibility: hidden; min-height: 120px; }
.lb-podium-rank {
    position: absolute; top: 10px; right: 12px;
    font-size: 12px; font-weight: 800; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 4px;
}
.lb-podium-first .lb-podium-rank { color: #b45309; }
.lb-podium-avatar-wrap { display: flex; justify-content: center; margin: 8px 0 10px; }
.lb-podium-name {
    display: block; font-size: 15px; color: var(--text-dark);
    margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-score-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; padding: 8px 12px; border-radius: 999px;
    background: #0f172a; color: #fff; font-weight: 800; font-size: 14px;
}
.lb-score-pill.compact { min-width: 58px; padding: 7px 11px; font-size: 13px; }

.lb-list-head {
    display: grid; grid-template-columns: 52px 1fr 88px; gap: 10px;
    padding: 10px 8px; font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-muted);
}
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
    display: grid; grid-template-columns: 52px 1fr 88px; gap: 10px; align-items: center;
    padding: 10px 8px; border-radius: 12px; border: 1px solid transparent;
    background: rgba(255,255,255,0.55);
    animation: lbFadeUp .45s ease both;
    animation-delay: var(--lb-row-delay, 0s);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.lb-row:hover { transform: translateY(-1px); border-color: rgba(var(--primary-rgb), 0.2); background: #fff; }
.lb-row.is-you { border-color: rgba(var(--primary-rgb), 0.35); background: rgba(var(--primary-rgb), 0.06); }
.lb-rank-num {
    width: 32px; height: 32px; border-radius: 10px; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
    background: rgba(var(--primary-rgb), 0.1); color: var(--primary);
}
.lb-rank-dash { color: var(--text-muted); font-weight: 700; padding-left: 10px; }
.lb-student { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-student-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-student-meta strong {
    font-size: 15px; color: var(--text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-student-meta strong em {
    font-style: normal; font-size: 11px; margin-left: 6px; padding: 2px 6px;
    border-radius: 999px; background: rgba(var(--primary-rgb), 0.12); color: var(--primary); font-weight: 800;
}
.lb-student-meta small { font-size: 13px; color: var(--text-muted); }
.lb-gentle { color: #64748b !important; }
.lb-chip {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-size: 11px;
}
.lb-chip.awaiting { background: rgba(245,158,11,0.15); color: #b45309; }
.lb-chip.incomplete { background: rgba(148,163,184,0.18); color: #64748b; }
.lb-score { display: flex; justify-content: flex-end; }

.lb-sidebar { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; padding: 0; }
.lb-sidebar-filters {
    display: flex; flex-direction: column; gap: 8px; padding: 10px;
    border-radius: 12px; background: rgba(255,255,255,0.7); border: 1px solid var(--border-light);
    flex-shrink: 0;
}
.lb-course-field label,
.lb-sidebar-filters label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 4px;
}
.lb-course-select-wrap { position: relative; }
.lb-course-select-wrap > select.js-lb-course {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.lb-course-picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.9);
    color: var(--text-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.lb-course-picker-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lb-course-picker-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-course-picker-btn i { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.lb-course-select-wrap.is-open .lb-course-picker-btn {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.lb-course-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 12px 28px rgba(15,23,42,0.14);
    max-height: 220px;
    overflow-y: auto;
}
.lb-course-picker-menu li { margin: 0; }
.lb-course-picker-option {
    width: 100%;
    display: block;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}
.lb-course-picker-option:hover,
.lb-course-picker-option.is-active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}
.lb-mobile-panel { overflow-x: hidden; overflow-y: auto; }
.lb-mobile-panel .lb-course-select-wrap { z-index: 5; }
.lb-assignment-list-label {
    display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 0;
    flex-shrink: 0;
}
.lb-assignment-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; flex: 1; }
.lb-assignment-item {
    display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center;
    padding: 10px; border-radius: 12px; border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.85); text-decoration: none; color: inherit;
    transition: .15s;
}
.lb-assignment-item:hover { border-color: var(--primary); background: #fff; }
.lb-assignment-item.active {
    border-color: var(--primary); background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.12);
}
.lb-assignment-icon {
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: rgba(var(--primary-rgb), 0.1); color: var(--primary);
}
.lb-assignment-item strong { display: block; font-size: 14px; color: var(--text-dark); }
.lb-assignment-item small { font-size: 12px; color: var(--text-muted); }
.lb-empty-note, .lb-empty-state { text-align: center; color: var(--text-muted); padding: 24px 12px; }
.lb-empty-state i { font-size: 34px; color: var(--primary); opacity: .7; margin-bottom: 10px; display: block; }
.lb-empty-state h3 { margin: 0 0 6px; color: var(--text-dark); }

.lb-mobile-assignments {
    display: none;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}
.lb-mobile-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: var(--text-dark);
}
.lb-mobile-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    flex-shrink: 0;
}
.lb-mobile-toggle-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.lb-mobile-toggle-copy strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}
.lb-mobile-toggle-copy small {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.lb-mobile-chevron {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    transition: transform .2s, background .15s;
    flex-shrink: 0;
}
.lb-mobile-toggle.is-open .lb-mobile-chevron { transform: rotate(180deg); background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.lb-mobile-panel {
    border-top: 1px solid rgba(55,55,56,0.12);
    max-height: 420px;
    overflow: auto;
    padding: 10px 12px 12px;
    background: rgba(255,255,255,0.35);
}
.lb-mobile-panel .lb-sidebar { padding: 0; gap: 10px; height: auto; }
.lb-mobile-panel .lb-sidebar-filters {
    background: rgba(255,255,255,0.72);
    border-radius: 12px;
    padding: 10px;
}
.lb-mobile-panel .lb-assignment-item {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.85);
}

@keyframes lbFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .lb-podium-card, .lb-row { animation: none; }
    .leaderboard-board-main { transition: none; }
}

@media (max-width: 1100px) {
    .app-container.leaderboard-workspace .lb-right-panel { display: none !important; }
    .lb-mobile-assignments { display: block; }
    
}
@media (max-width: 700px) {
    .lb-list-head { display: none; }
    .lb-row { grid-template-columns: 40px 1fr auto; }
    .lb-podium { gap: 8px; margin-bottom: 12px; }
    .lb-podium-card { padding: 12px 8px 12px; border-radius: 14px; }
    .lb-podium-first { padding-top: 18px; }
    img.nc-media.lb-podium-avatar,
    .nc-media-ph.lb-podium-avatar {
        width: 44px !important;
        height: 44px !important;
    }
    .lb-podium-name { font-size: 13px; margin-bottom: 8px; }
    .lb-podium .lb-score-pill { min-width: 0; padding: 5px 8px; font-size: 13px; }
    .lb-podium-empty { min-height: 80px; }
    .lb-list-card { max-height: none; }
    .lb-board-head { margin-bottom: 10px; gap: 8px; }
    .lb-board-head h2 {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .lb-board-head p {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .lb-board-stats { gap: 6px; }
    .lb-board-stats span,
    .lb-my-position-btn {
        padding: 6px 9px;
        font-size: 11px;
    }
    .lb-sidebar-filters label,
    .lb-course-field label {
        font-size: 10px;
    }
    .lb-assignment-item strong {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .lb-assignment-item small { font-size: 12px; }
    .lb-student-meta strong {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .lb-student-meta small { font-size: 12px; }
    .form-group label {
        font-size: 11px;
    }
}
@media (max-width: 480px) {
    .lb-podium { gap: 6px; margin-bottom: 10px; }
    .lb-podium-card { padding: 10px 6px 10px; border-radius: 12px; }
    .lb-podium-first { padding-top: 16px; }
    .lb-podium-avatar-wrap { margin: 6px 0 8px; }
    img.nc-media.lb-podium-avatar,
    .nc-media-ph.lb-podium-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    .lb-podium-rank { font-size: 11px; top: 8px; right: 8px; }
    .lb-podium-name { font-size: 13px; }
}


.nc-wa-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 12px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 12px 28px rgba(18, 140, 126, 0.38);
    transition: transform .18s ease, box-shadow .18s ease;
}
.nc-wa-fab:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 34px rgba(18, 140, 126, 0.48); color: #fff !important; }
.nc-wa-fab i { font-size: 26px; line-height: 1; }
.nc-wa-fab-label { letter-spacing: .02em; }
@media (max-width: 640px) {
    .nc-wa-fab { right: 14px; bottom: 14px; padding: 12px; border-radius: 50%; }
    .nc-wa-fab-label { display: none; }
    .nc-wa-fab i { font-size: 28px; }
}


.nc-push-toast .nc-push-toast-link {
    display: inline-flex;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}
.nc-push-toast .nc-push-toast-link:hover { text-decoration: underline; }



html.theme-dark {
    --text-dark: #E8EEF7;
    --text-muted: #94A3B8;
    --text-sidebar: #CBD5E1;
    --bg-color: #0B1220;
    --card-bg: #111827;
    --card-border: rgba(148, 163, 184, 0.16);
    --shadow: 0px 8px 28px rgba(0, 0, 0, 0.35);
    --border-light: rgba(148, 163, 184, 0.22);
    --scrollbar-track: rgba(148, 163, 184, 0.12);
    color-scheme: dark;
}
html.theme-dark body { background-color: var(--bg-color); color: var(--text-dark); }
html.theme-dark .bg-mesh {
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(var(--primary-rgb), 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(var(--primary-rgb), 0.12), transparent),
        var(--bg-color);
}
html.theme-dark #blob {
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.22), transparent 70%);
    opacity: 0.55;
}
html.theme-dark .glass-card,
html.theme-dark .sidebar,
html.theme-dark .header,
html.theme-dark .right-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark);
}
html.theme-dark .form-control,
html.theme-dark select.form-control,
html.theme-dark input,
html.theme-dark textarea,
html.theme-dark select {
    background: rgba(15, 23, 42, 0.85) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-light) !important;
}
html.theme-dark .form-control:focus,
html.theme-dark input:focus,
html.theme-dark textarea:focus,
html.theme-dark select:focus {
    background: rgba(15, 23, 42, 0.95) !important;
}
html.theme-dark .admin-table th,
html.theme-dark .admin-table td {
    border-color: var(--border-light);
    color: var(--text-dark);
    background: var(--card-bg);
}
html.theme-dark .admin-table th { background: #0f172a; }
html.theme-dark .toast {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--border-light);
}
html.theme-dark .hamburger-btn {
    background: rgba(15, 23, 42, 0.9) !important;
    color: var(--primary);
}
html.theme-dark .nav-item:hover {
    background: rgba(var(--primary-rgb), 0.12);
}
html.theme-dark .app-container {
    background: color-mix(in srgb, var(--bg-color) 55%, transparent) !important;
    border-color: var(--border-light);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
html.theme-dark .auth-error {
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}
html.theme-dark .nav-item.active,
html.theme-dark .nav-item.active:hover {
    background: rgba(var(--primary-rgb), 0.22);
    color: #fff;
}
html.theme-dark .user-profile,
html.theme-dark .sidebar-footer {
    background: rgba(15, 23, 42, 0.65) !important;
    border-color: var(--border-light);
}
html.theme-dark .btn-secondary {
    background: rgba(15, 23, 42, 0.8) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-light) !important;
}
html.theme-dark .btn-secondary:hover {
    background: rgba(30, 41, 59, 0.95) !important;
}
html.theme-dark .btn-secondary.is-loading {
    color: transparent !important;
}
html.theme-dark .btn-secondary.is-loading::after {
    border-color: rgba(232, 238, 247, 0.25);
    border-top-color: #E8EEF7;
}
.settings-block-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-dark);
}
.settings-block-title:first-of-type { margin-top: 0; }
.branding-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.branding-panel {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 18px 18px 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.branding-save-btn {
    align-self: flex-start;
    margin-top: 4px;
}
html.theme-dark .branding-panel {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.2);
}
.lp-subtabs .lp-tab-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.lp-design-card.is-selected {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
}
html.theme-dark .lesson-item,
html.theme-dark .module-card,
html.theme-dark .lesson-card,
html.theme-dark .admin-split-content,
html.theme-dark .lessons-container {
    background: #0f172a !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark);
}
html.theme-dark .course-card,
html.theme-dark .course-empty-state,
html.theme-dark .course-modal-panel,
html.theme-dark .course-search-results,
html.theme-dark .store-card {
    background: var(--card-bg) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
}
html.theme-dark .course-content h3,
html.theme-dark .store-title,
html.theme-dark .course-modal-panel h3 {
    color: var(--text-dark) !important;
}
html.theme-dark .store-card {
    background: linear-gradient(180deg, #111827 0%, #0f172a 55%) !important;
}
html.theme-dark .store-desc,
html.theme-dark .tag {
    color: var(--text-muted) !important;
}
html.theme-dark .tag {
    background: rgba(148, 163, 184, 0.12) !important;
}
html.theme-dark .lb-row:hover,
html.theme-dark .lb-assignment-item:hover,
html.theme-dark .grading-student-item:hover {
    background: rgba(var(--primary-rgb), 0.1) !important;
}
html.theme-dark .page-wrapper.page-wrapper-tight .right-panel.glass-card {
    background: rgba(15, 23, 42, 0.82) !important;
}
html.theme-dark .lb-assignment-list,
html.theme-dark .lb-list-scroll,
html.theme-dark .lb-mobile-panel,
html.theme-dark .grading-queue-panel,
html.theme-dark .right-panel .glass-card {
    background: var(--card-bg) !important;
    border-color: var(--border-light);
}
html.theme-dark .tag,
html.theme-dark .store-card .tag {
    background: rgba(148, 163, 184, 0.18) !important;
    color: var(--text-muted) !important;
}
html.theme-dark .lb-sidebar-filters {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: var(--border-light) !important;
}
html.theme-dark .lb-course-picker-btn {
    background: rgba(15, 23, 42, 0.95) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-light) !important;
}
html.theme-dark .lb-course-picker-menu {
    background: #0f172a !important;
    border-color: var(--border-light) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
html.theme-dark .lb-course-picker-option {
    color: var(--text-dark);
}
html.theme-dark .ad-welcome {
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.22) 0%, rgba(15, 23, 42, 0.95) 48%, rgba(var(--primary-rgb), 0.12) 100%),
        #111827 !important;
    border-color: var(--border-light) !important;
}

.nc-dark-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    display: flex !important;
    align-items: center;
    gap: 10px;
}
.nc-dark-toggle .nc-dark-toggle-label { flex: 1; }
.nc-switch {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    flex-shrink: 0;
    transition: background .2s ease;
    margin-left: auto;
}
.nc-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s ease;
}
.nc-dark-toggle[aria-pressed="true"] .nc-switch {
    background: var(--primary);
}
.nc-dark-toggle[aria-pressed="true"] .nc-switch-knob {
    transform: translateX(18px);
}
html.theme-dark .nc-switch {
    background: #475569;
}
html.theme-dark .nc-dark-toggle[aria-pressed="true"] .nc-switch {
    background: var(--primary);
}


.nc-dark-toggle-sidebar-item { display: none !important; }

.header.has-dark-toggle {
    align-items: center;
    margin-bottom: 0 !important;
}
.header > .nc-dark-toggle-header {
    margin-left: auto;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--card-bg, rgba(255,255,255,0.85));
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: var(--shadow);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    order: 4;
}
.header > .nc-dark-toggle-header:hover {
    border-color: var(--primary);
    color: var(--primary);
}
html.theme-dark .header > .nc-dark-toggle-header {
    background: rgba(15, 23, 42, 0.9);
    color: #fbbf24;
    border-color: var(--border-light);
}


@media (min-width: 1101px) {
    .header {
        flex-wrap: nowrap;
        align-items: center;
    }
    .header > .hamburger-btn { order: 1; }
    .header > .header-brand { order: 2; }
    .header > .header-text { order: 3; flex: 0 1 auto; }
    .header > *:not(.hamburger-btn):not(.header-brand):not(.header-text):not(.nc-dark-toggle-header) {
        order: 5;
    }
    .header > .nc-dark-toggle-header {
        order: 6;
        margin-left: auto;
    }
    
    .header > [style*="margin-left: auto"] ~ .nc-dark-toggle-header,
    .header > .btn ~ .nc-dark-toggle-header,
    .header > a.btn ~ .nc-dark-toggle-header {
        margin-left: 10px;
    }
}


.nc-profile {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.nc-profile-aside,
.nc-profile-main {
    min-width: 0;
}
.nc-profile-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.nc-profile-card {
    padding: 22px 20px;
    text-align: center;
}
.nc-profile-card.is-sticky {
    position: sticky;
    top: 12px;
}
.nc-profile-avatar,
.nc-profile-avatar-ph {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 14px;
    border: 3px solid var(--border-light);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
}
.nc-profile-name {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.25;
    word-break: break-word;
}
.nc-profile-email,
.nc-profile-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.nc-profile-meta { margin-top: 6px; }
.nc-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}
.nc-profile-panel {
    padding: 22px 22px 20px;
}
.nc-profile-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 15px;
    font-weight: 750;
    color: var(--text-dark);
}
.nc-profile-panel-title i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-size: 13px;
}
.nc-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.nc-profile-fields .form-group { margin: 0; }
.nc-profile-fields .form-group-full { grid-column: 1 / -1; }
.nc-profile-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.nc-profile-error {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 12px;
}
.nc-profile-readonly {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-muted);
    font-size: 14px;
    word-break: break-word;
}
.nc-profile-photo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.nc-profile-photo-preview,
.nc-profile-photo-preview-ph {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
    background: var(--bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
}
.nc-profile-photo-row .form-control { flex: 1; min-width: 180px; }
.nc-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.nc-profile-actions .btn { margin: 0; }
.btn-outline-soft {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
}
.btn-outline-soft:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.nc-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.nc-toggle-copy { min-width: 0; flex: 1; }
.nc-toggle-copy strong {
    display: block;
    margin: 0 0 6px;
    color: var(--text-dark);
    font-weight: 700;
}
.nc-toggle-copy p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.nc-toggle-switch {
    position: relative;
    width: 52px;
    height: 30px;
    flex-shrink: 0;
}
.nc-toggle-switch input { opacity: 0; width: 0; height: 0; }
.nc-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: .2s;
}
.nc-toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    top: 4px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nc-toggle-switch input:checked + .nc-toggle-slider { background: var(--primary); }
.nc-toggle-switch input:checked + .nc-toggle-slider:before { transform: translateX(22px); }
.nc-profile-app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
html.theme-dark .nc-profile-readonly {
    background: rgba(15, 23, 42, 0.55);
}
html.theme-dark .nc-toggle-slider { background: #475569; }

@media (max-width: 900px) {
    .nc-profile {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .nc-profile-card.is-sticky { position: static; }
    .nc-profile-card {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "avatar text"
            "badge badge";
        gap: 4px 14px;
        text-align: left;
        align-items: center;
        padding: 16px;
    }
    .nc-profile-avatar,
    .nc-profile-avatar-ph {
        grid-area: avatar;
        width: 72px;
        height: 72px;
        margin: 0;
        font-size: 24px;
        border-width: 2px;
    }
    .nc-profile-text { grid-area: text; min-width: 0; }
    .nc-profile-name { font-size: 1.05rem; margin-bottom: 2px; }
    .nc-profile-email { font-size: 12px; }
    .nc-profile-meta { font-size: 12px; margin-top: 4px; }
    .nc-profile-badge {
        grid-area: badge;
        justify-self: start;
        margin-top: 8px;
    }
    .nc-profile-panel { padding: 16px; }
    .nc-profile-panel-title { font-size: 14px; margin-bottom: 14px; padding-bottom: 10px; }
    .nc-profile-fields { grid-template-columns: 1fr; gap: 12px; }
    .nc-profile-photo-row { flex-direction: row; }
    .nc-toggle-row { align-items: flex-start; }
}


@media (max-width: 900px) {
    .cd-layout-grid {
        display: flex !important;
        flex-direction: column;
        gap: 16px !important;
    }
    .cd-layout-aside { order: -1; }
    .cd-price-card { position: static; }
    .cd-details-page { padding: 14px !important; }
    .video-container { height: min(48vw, 220px) !important; margin-bottom: 16px !important; border-radius: 10px !important; }
    .learn-grid { grid-template-columns: 1fr !important; }
    .details-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
    .meta-info-row { gap: 14px !important; }
    .meta-block { border-right: none !important; padding-right: 0 !important; min-width: 40%; }
    .instructor-profile { flex-direction: row; gap: 12px; align-items: flex-start; }
    .instructor-avatar { width: 64px !important; height: 64px !important; flex-shrink: 0; }
    .cd-header-top h1 { font-size: 22px !important; }
    .cd-accordion-header { font-size: 13px; padding: 12px 14px; gap: 8px; }
    .cd-lecture-row { padding: 10px 14px; }
    .section-title { font-size: 16px; margin-bottom: 12px; }
    .cd-details-page > .glass-card { padding: 16px !important; margin-top: 14px !important; }
}

@media (max-width: 768px) {
    .cd-price-card-head { padding: 18px 16px 20px; }
    .cd-price-card.is-offer .cd-price-card-head { padding-top: 26px; }
    .cd-price-card-label { font-size: var(--cd-label, 15px); }
    .cd-price-card-badge { font-size: 12px; padding: 5px 10px; }
    .cd-price-card-compare { font-size: 16px; }
    .cd-price-card-current { font-size: clamp(1.85rem, 8vw, 2.4rem); }
    .cd-price-card-hint { font-size: var(--cd-hint, 13px); }
    .cd-price-card-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
    .cd-price-card-includes { padding: 10px 12px 2px; border-radius: 12px; }
    .cd-price-card-includes h4 { font-size: var(--cd-meta, 11px); margin-bottom: 4px; }
    .cd-price-card-includes li { font-size: var(--cd-meta, 13px); gap: 8px; padding: 9px 0; }
    .cd-inc-value {
        max-width: none;
        overflow-wrap: normal;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    .cd-offer-ribbon {
        right: 10px;
        top: -4px;
        min-width: 96px;
        padding: 8px 10px 10px;
    }
    .cd-price-card-cta,
    .cd-price-card-actions .btn.cd-price-card-cta {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 15px;
    }
    .cd-price-card-actions {
        position: sticky;
        bottom: 10px;
        z-index: 30;
        margin-top: 2px;
        padding: 8px 0 2px;
        background: linear-gradient(180deg, transparent, rgba(255,255,255,0.92) 28%);
    }
    html.theme-dark .cd-price-card-actions {
        background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.92) 28%);
    }
    .cd-price-card-actions form { margin: 0; }
    .cd-price-card-actions .btn { width: 100%; }

    .branding-panel { padding: 14px 14px 6px; border-radius: 14px; }
    .branding-save-btn { width: 100%; justify-content: center; }

    .admin-split-sidebar { max-height: none; }
    .site-hub-nav .ce-nav-item { font-size: 14px; padding: 10px 12px; }
    .lp-grid2 { grid-template-columns: 1fr !important; }
    .lp-design-card { min-width: 0; }

    .glass-card { max-width: 100%; }
    .btn { max-width: 100%; }
    table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .header-text h1 { font-size: 18px !important; line-height: 1.25; }
    .form-group label { letter-spacing: 0; }

    
    .admin-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .admin-grid .glass-card { padding: 14px !important; }

    .nc-lang-switch-item { padding: 2px 8px 8px; }
    .nc-lang-btn { min-height: 32px; font-size: 12px; }

    
    body:has(.cd-details-page) .nc-wa-fab { bottom: 76px; }
}

@media (max-width: 480px) {
    .admin-grid { grid-template-columns: 1fr !important; }
    .course-grid { grid-template-columns: 1fr !important; }
    .app-container { padding: 10px !important; gap: 10px !important; }
    .cd-price-card-topline { flex-wrap: wrap; }
    .cd-price-card-includes li {
        grid-template-columns: 26px minmax(0, 1fr) auto;
        gap: 8px;
    }
    .cd-inc-icon { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
}


#nc-dialog-root.nc-dialog-open {
    position: fixed;
    inset: 0;
    z-index: 10050;
}
.nc-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.nc-dialog {
    width: 100%;
    max-width: 420px;
    padding: 22px 22px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: var(--card-bg);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    text-align: left;
}
.nc-dialog-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}
.nc-dialog-icon.is-warn { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.nc-dialog-icon.is-danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.nc-dialog-icon.is-info { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.nc-dialog-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
}
.nc-dialog-msg {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-sidebar);
}
.nc-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.nc-dialog-actions .btn { min-width: 88px; justify-content: center; }
html.theme-dark .nc-dialog {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.22);
}
html.theme-dark .nc-dialog-overlay { background: rgba(0, 0, 0, 0.55); }
