:root {
    --sp-ink: #0f172a;
    --sp-muted: #475569;
    --sp-line: #e2e8f0;
    --sp-bg: #f4f7fb;
    --sp-card: #ffffff;
    --sp-brand: #be123c;
    --sp-brand-2: #1d4ed8;
    --sp-sidebar: #0b1220;
    --sp-sidebar-2: #151d2e;
    --sp-radius: 16px;
    --sp-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --sp-side: 268px;
    --sp-top: 68px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--sp-bg);
    color: var(--sp-ink);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a { color: var(--sp-brand-2); text-decoration: none; }
img { max-width: 100%; height: auto; }

.preloader { display: none !important; }

.sp-sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: var(--sp-side);
    height: 100vh;
    background: #f8f9fc;
    color: #334155;
    border-right: 1px solid #e8ecf4;
    display: flex;
    flex-direction: column;
    padding: 18px 16px 16px;
    overflow: auto;
}

.sp-brand { display: block; padding: 4px 8px 16px; }
.sp-brand img { width: 168px; height: auto; background: transparent; border-radius: 0; padding: 0; }

.sp-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #4f46e5;
    color: #fff;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 22px;
}
.sp-user-card strong { display: block; font-size: 14px; }
.sp-user-card small { display: block; opacity: 0.85; font-size: 11px; letter-spacing: 0.04em; }

.sp-nav-label {
    margin: 8px 10px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
}

.sp-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    padding: 10px 12px;
    border-radius: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}
.sp-nav a i { width: 18px; text-align: center; color: #64748b; }
.sp-nav a:hover { background: #eef2ff; color: #312e81; }
.sp-nav a.active { background: #ece9ff; color: #4f46e5; }
.sp-nav a.active i { color: #4f46e5; }

.sp-logout {
    margin-top: auto;
    border-top: 1px solid #e6eaf2;
    padding-top: 12px;
}
.sp-logout a { color: #64748b; }

.sp-topbar {
    position: fixed;
    z-index: 30;
    top: 0;
    left: var(--sp-side);
    right: 0;
    height: var(--sp-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0 22px;
    background: #fff;
    border-bottom: 1px solid var(--sp-line);
}

.sp-top-left, .sp-top-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sp-top-left { flex: 1 1 auto; }
.sp-top-right { flex: 0 0 auto; }
.sp-topbar h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-crumb { color: #94a3b8; font-size: 13px; font-weight: 600; }
.sp-crumb b { color: #334155; }

.sp-icon-btn, .sp-user-chip, .sp-course-btn {
    border: 1px solid #e6eaf2;
    background: #fff;
    color: var(--sp-ink);
    border-radius: 999px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
}
.sp-icon-btn { width: 40px; justify-content: center; padding: 0; display: none; }
.sp-avatar-text {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e11d48;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}
.sp-user-card .sp-avatar-text { background: #fff; color: #4f46e5; }
.sp-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.sp-user-meta small { color: #94a3b8; font-size: 11px; font-weight: 600; }
.sp-courses { position: relative; }
.sp-course-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    padding: 8px;
    z-index: 80;
}
.sp-course-menu.open { display: block; }
.sp-course-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: #334155; font-weight: 600; }
.sp-course-menu a:hover { background: #f5f3ff; color: #4f46e5; }

.sp-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 35;
}

.page-wrapper, #main-wrapper .page-wrapper {
    margin-left: var(--sp-side) !important;
    padding: calc(var(--sp-top) + 22px) 22px 28px !important;
    min-height: 100vh;
    background: var(--sp-bg) !important;
    width: auto !important;
}

.container-fluid { width: 100%; padding: 0; }
.footer {
    margin-left: var(--sp-side);
    padding: 8px 22px 22px;
    color: var(--sp-muted);
    font-size: 13px;
    background: transparent;
}

.card, .sp-card {
    background: var(--sp-card);
    border: 1px solid var(--sp-line) !important;
    border-radius: var(--sp-radius) !important;
    box-shadow: var(--sp-shadow);
    margin-bottom: 18px;
}

.card-body { padding: 22px; }
.card-title, .box-title, h3.box-title, h4.card-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--sp-ink);
}

.sp-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.sp-profile { text-align: center; }
.sp-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(15,23,42,0.12);
}
.sp-kicker { color: var(--sp-brand); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.sp-meta { text-align: left; margin-top: 16px; display: grid; gap: 10px; }
.sp-meta div { background: #f8fafc; border-radius: 12px; padding: 10px 12px; }
.sp-meta small { display: block; color: var(--sp-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.sp-meta b { font-weight: 700; }

.sp-hero {
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 55%, #be123c 140%);
    color: #fff;
    border-radius: var(--sp-radius);
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.sp-hero h2 { margin: 0 0 6px; font-size: 26px; }
.sp-hero p { margin: 0; color: rgba(255,255,255,0.82); }
.sp-hero a, .btn, button.btn, input.btn, a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px !important;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
}
.sp-hero a, .btn-info, .btn-primary, .btn-success {
    background: #fff;
    color: var(--sp-ink) !important;
}
.btn-danger, a.btn-danger { background: #be123c; color: #fff !important; }
.btn-primary, a.btn-primary, .btn-info { background: var(--sp-brand-2); color: #fff !important; }
.btn-success, a.btn-success, button.btn-success { background: #0f766e; color: #fff !important; }
.btn-outline-success {
    background: #fff !important;
    color: #0f766e !important;
    border: 1px solid #99f6e4 !important;
}
.btn-inverse { background: #e2e8f0; color: var(--sp-ink) !important; }
.btn-block { width: 100%; }

.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-section-title { margin: 8px 0 12px; font-size: 14px; color: var(--sp-muted); font-weight: 700; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    background: #f8fafc;
    padding: 12px;
}
.table td { padding: 14px 12px; border-top: 1px solid var(--sp-line); vertical-align: middle; }
.table tr:hover td { background: #fafbff; }
.color-table, .success-table { background: transparent; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.form-control {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: var(--sp-ink);
}
.form-control:focus { outline: 2px solid rgba(29,78,216,0.25); border-color: var(--sp-brand-2); }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger, .alert-warning { background: #fff1f2; color: #9f1239; }

.nav-tabs { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.nav-tabs li { list-style: none; }
.nav-tabs a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--sp-ink);
    font-weight: 700;
}
.nav-tabs li.active a, .nav-tabs a.active { background: var(--sp-ink); color: #fff; }
.tab-pane { display: none; }
.tab-pane.active, .tab-pane.show { display: block; }

#chart_div { width: 100% !important; max-width: 100%; height: 380px; }

.sp-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: #0b1220;
}
.sp-auth-art {
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(190,18,60,0.45), transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(29,78,216,0.45), transparent 32%),
        #0b1220;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.sp-auth-art img { max-width: 400px; background: #fff; border-radius: 18px; padding: 8px; }
.sp-auth-art h2,
.sp-auth-art p,
.sp-auth-art div {
    color: #fff;
    background: transparent;
}
.sp-auth-art h2 {
    font-size: 42px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 12px;
    max-width: 520px;
}
.sp-auth-art p {
    margin: 0;
    max-width: 460px;
    color: rgba(255,255,255,0.86);
    font-size: 16px;
    line-height: 1.5;
}
.sp-auth-panel {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.sp-auth-card { width: min(420px, 100%); }
.sp-auth-card h3 { margin: 0 0 6px; font-size: 28px; }
.sp-auth-card .hint { color: var(--sp-muted); margin-bottom: 18px; }
#recoverform { display: none; }
.sp-auth.is-signup .sp-auth-panel { align-items: flex-start; overflow: auto; }
.sp-auth.is-signup .sp-auth-card { width: min(640px, 100%); padding: 28px 0 40px; }
.signup-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}
.signup-steps li {
    flex: 1 1 0;
    position: relative;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}
.signup-steps li span {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.signup-steps li::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    right: 50%;
    height: 2px;
    background: #e2e8f0;
}
.signup-steps li:first-child::before { display: none; }
.signup-steps li.is-on span,
.signup-steps li.is-done span {
    border-color: #16a34a;
    color: #16a34a;
}
.signup-steps li.is-on { color: #0f172a; }
.signup-steps li.is-done::before,
.signup-steps li.is-on::before { background: #16a34a; }
.signup-step[hidden] { display: none !important; }
.signup-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.signup-nav [hidden] { display: none !important; }
.signup-section { margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.signup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.signup-grid .wide { grid-column: 1 / -1; }
.signup-msg { display: none; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: #fff1f2; color: #be123c; font-weight: 600; }
.signup-msg.is-ok { display: block; background: #ecfdf5; color: #0f766e; }
.field-error { margin: 4px 2px 0; color: #be123c; font-size: 12px; font-weight: 600; line-height: 1.35; }
.field-error[hidden] { display: none !important; }
.form-control.is-invalid { border-color: #be123c; }
@media (max-width: 640px) {
    .signup-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .sp-icon-btn { display: inline-flex; }
    .sp-sidebar { transform: translateX(-105%); transition: transform 0.2s ease; }
    body.sp-open .sp-sidebar { transform: none; }
    body.sp-open .sp-backdrop { display: block; }
    .sp-topbar, .page-wrapper, #main-wrapper .page-wrapper, .footer { left: 0; margin-left: 0 !important; }
    .sp-topbar { padding: 0 12px; gap: 8px; }
    .sp-top-left, .sp-top-right { gap: 8px; }
    .sp-topbar h1 { font-size: 16px; }
    .sp-user-meta { display: none; }
    .sp-user-chip {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border: 0;
        background: transparent;
    }
    .sp-course-btn { height: 40px; padding: 0 12px; font-size: 14px; }
    .sp-grid, .sp-auth { grid-template-columns: 1fr; }
    .sp-auth-art { display: none; }
    .sp-hero { flex-direction: column; align-items: flex-start; }
    .pf-grid, .pf-banner { grid-template-columns: 1fr; }
    .pf-banner { align-items: flex-start; flex-direction: column; }
}

.pf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.pf-head h2 { margin: 0; font-size: 28px; }
.pf-head p { margin: 4px 0 0; color: #64748b; }
.pf-edit {
    background: #4f46e5 !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
}

.pf-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: linear-gradient(90deg, #312e81 0%, #4338ca 70%, #e11d48 140%);
    color: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.pf-banner:after {
    content: "";
    position: absolute;
    right: -30px;
    top: -40px;
    width: 160px;
    height: 180px;
    background: #e11d48;
    border-radius: 40px;
    transform: rotate(28deg);
}
.pf-banner-user, .pf-status { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.pf-banner .sp-avatar-text { width: 64px; height: 64px; font-size: 20px; background: #fff; color: #312e81; }
.pf-banner h3 { margin: 0; font-size: 22px; }
.pf-banner p { margin: 2px 0 0; opacity: 0.9; }
.pf-status {
    background: #fff;
    color: #166534;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 13px;
}
.pf-status i { color: #16a34a; }

.pf-card {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    padding: 18px 18px 8px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.pf-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pf-card-head i {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.pf-card-head h3 { margin: 0; font-size: 16px; }
.pf-card-head p { margin: 0; color: #94a3b8; font-size: 13px; }
.pf-ico-blue { background: #4f46e5; }
.pf-ico-red { background: #e11d48; }
.pf-ico-green { background: #0f766e; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; }
.pf-field { padding: 14px 8px 16px; border-top: 1px solid #f1f5f9; }
.pf-field.wide { grid-column: 1 / -1; }
.pf-field small { display: block; color: #94a3b8; font-size: 11px; letter-spacing: 0.08em; font-weight: 700; }
.pf-field b { display: block; margin-top: 4px; font-size: 15px; }
.pf-form { padding-bottom: 18px; }

.course-card { height: 100%; overflow: hidden; }
.course-card .card-accent { height: 6px; background: linear-gradient(90deg, #4f46e5, #e11d48); }
.course-card .card-body { display: flex; flex-direction: column; min-height: 0; padding: 16px 18px 18px; }
.course-card .card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.course-card .card-title .course-icon { width: 34px; height: 34px; margin: 0; border-radius: 10px; flex: 0 0 34px; }
.course-card p { color: #64748b; margin: 0 0 12px; }
.course-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0; }
.subject-actions { justify-content: flex-end; }
.test-card { width: fit-content; max-width: 100%; }
.test-card .card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.test-card .card-title { margin: 0 0 12px; }
.test-card .course-actions { justify-content: flex-end; margin-left: 0; }
.course-icon {
    width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eef2ff; color: #4f46e5; font-size: 18px;
}
.course-icon.red { background: #fff1f2; color: #e11d48; }
.course-icon.green { background: #ecfdf5; color: #0f766e; }
.study-video { width: 100%; border-radius: 12px; background: #0f172a; max-height: 160px; }

.rs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.rs-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.rs-head p { margin: 4px 0 0; color: #64748b; }
.rs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-hero {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.rs-score {
    border-radius: 16px;
    background: linear-gradient(160deg, #312e81, #4f46e5);
    color: #fff;
    text-align: center;
    padding: 22px 12px;
}
.rs-score b { display: block; font-size: 42px; line-height: 1; }
.rs-score span { display: block; margin-top: 6px; opacity: 0.85; font-weight: 700; }
.rs-score small { display: block; margin-top: 10px; font-size: 13px; opacity: 0.8; }
.rs-meta h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.rs-meta p { margin: 0 0 14px; color: #64748b; }
.rs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rs-stat { background: #f8fafc; border-radius: 14px; padding: 12px 14px; }
.rs-stat small { display: block; color: #94a3b8; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.rs-stat b { display: block; margin-top: 4px; font-size: 22px; }
.rs-stat.ok b { color: #0f766e; }
.rs-stat.bad b { color: #e11d48; }
.rs-q {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    padding: 16px 18px 14px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.rs-q-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.rs-q-top strong { font-size: 15px; }
.rs-pill { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.rs-pill.correct { background: #ecfdf5; color: #0f766e; }
.rs-pill.wrong { background: #fff1f2; color: #e11d48; }
.rs-pill.skip { background: #f1f5f9; color: #475569; }
.rs-q img { display: block; width: auto; max-width: 100%; height: auto; }
.rs-q .question-text { font-size: 16px; font-weight: 700; }
.rs-answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rs-answers span {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.rs-answers .yours.correct { background: #ecfdf5; color: #0f766e; }
.rs-answers .yours.wrong { background: #fff1f2; color: #e11d48; }
.rs-empty {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    padding: 28px;
}
@media (max-width: 800px) {
    .rs-hero, .rs-stats { grid-template-columns: 1fr; }
}

.ti-wrap { max-width: 760px; }
.ti-head { margin-bottom: 16px; }
.ti-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.ti-head p { margin: 4px 0 0; color: #64748b; }
.ti-card {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.ti-title span { color: #4f46e5; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ti-title h3 { margin: 4px 0 16px; font-size: 28px; font-weight: 800; }
.ti-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.ti-stats div { background: #f8fafc; border-radius: 14px; padding: 14px; }
.ti-stats small { display: block; color: #94a3b8; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ti-stats b { display: block; margin-top: 4px; font-size: 20px; }
.ti-note { margin-bottom: 16px; color: #334155; }
.ti-list { margin: 0 0 20px; padding-left: 18px; color: #334155; }
.ti-list li { margin: 0 0 8px; }
.ti-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
    .ti-stats { grid-template-columns: 1fr; }
}

.sp-nav-label,
.sp-user-meta small,
.sp-meta small,
.pf-field small,
.pf-head p,
.pf-card-head p,
.rs-head p,
.rs-meta p,
.rs-stat small,
.ti-head p,
.ti-stats small,
.course-card p,
.sp-crumb,
.footer,
.sp-section-title {
    color: #475569;
}
.sp-nav-label,
.sp-user-meta small,
.sp-meta small,
.pf-field small,
.rs-stat small,
.ti-stats small {
    font-size: 11px;
}
.sp-crumb,
.footer,
.sp-section-title,
.pf-card-head p,
.pf-head p,
.rs-head p,
.rs-meta p,
.ti-head p,
.course-card p {
    font-size: 13px;
}
.sp-crumb b,
.sp-meta b,
.pf-field b,
h1, h2, h3, h4, .card-title {
    color: #0f172a;
}
.sp-user-card,
.sp-user-card small,
.sp-user-card strong {
    color: #fff;
}
.sp-hero,
.sp-hero h2,
.sp-hero p {
    color: #fff;
}
.sp-hero p { color: rgba(255,255,255,0.92); }
.rs-score,
.rs-score b,
.rs-score span,
.rs-score small,
.pf-banner,
.pf-banner h2,
.pf-banner h3,
.pf-banner p {
    color: #fff;
}
.pf-status { color: #166534; }

.home-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 14px;
    padding: 22px 24px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e8ecf4;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.home-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #4f46e5; }
.home-hero h2 { margin: 0; font-size: 24px; font-weight: 700; color: #0f172a; }
.home-hero > div > p { margin: 6px 0 0; color: #475569; font-size: 14px; }
.home-stats { display: flex; gap: 8px; margin: 0; }
.home-stats div {
    min-width: 92px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e8ecf4;
    text-align: center;
}
.home-stats b { display: block; font-size: 20px; color: #0f172a; line-height: 1.1; font-weight: 700; }
.home-stats small { display: block; margin-top: 2px; color: #475569; font-size: 12px; font-weight: 500; }
.home-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.home-steps a {
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.home-steps span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 800;
}
.home-steps strong { display: block; margin-top: 10px; font-size: 15px; font-weight: 700; color: #0f172a; }
.home-steps em { display: block; margin-top: 2px; font-style: normal; color: #475569; font-size: 13px; }
.home-steps a:hover { border-color: #4f46e5; }
.home-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.home-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: #0f172a; }
.home-head a { font-weight: 800; }
.home-subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.home-subject {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
}
.home-subject strong { font-size: 14px; font-weight: 700; color: #0f172a; }
.home-subject span { display: block; color: #475569; font-size: 12px; }
.home-subject em {
    font-style: normal;
    background: #4f46e5;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 800;
}
.home-list, .home-panel {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    margin-bottom: 18px;
    overflow: hidden;
}
.home-row, .home-attempt {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(120px, 1fr) 88px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    color: #0f172a;
}
.home-list .home-row:first-child { border-top: 0; }
.home-row strong, .home-attempt strong { color: #0f172a; font-size: 14px; font-weight: 600; }
.home-row span, .home-attempt small { color: #475569; font-size: 12px; }
.home-row em {
    font-style: normal;
    text-align: center;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 10px;
    padding: 7px 0;
    font-weight: 800;
}
.home-row:hover, .home-subject:hover, .home-attempt:hover { background: #f8fafc; }
.home-empty { padding: 16px; margin: 0; color: #475569; }
.home-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-panel { padding: 6px 6px 10px; margin: 0; }
.home-panel .home-head { padding: 10px 10px 0; }
.home-attempt { grid-template-columns: 1fr auto; }
.home-attempt b { color: #4f46e5; font-size: 14px; font-weight: 700; }
#chart_div { width: 100% !important; height: 240px; }
.pdf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.pdf-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.pdf-frame, .pdf-sheet {
    width: 100%;
    height: calc(100vh - 170px);
    min-height: 520px;
    border: 0;
    border-radius: 16px;
    background: #fff;
}
.pdf-sheet { object-fit: contain; }
.pdf-missing {
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    padding: 28px;
}
.pdf-missing h2 { margin: 0 0 8px; font-size: 22px; }
.pdf-missing p { margin: 0 0 16px; color: #475569; }
@media (max-width: 760px) {
    .home-hero, .home-steps, .home-subjects, .home-split { display: block; }
    .home-stats { margin-top: 14px; }
    .home-steps a, .home-subject { margin-bottom: 10px; }
    .home-row { grid-template-columns: 1fr auto; }
    .home-row span { display: none; }
}

.video-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.video-page-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.video-page-head p { margin: 0; color: #475569; }
.video-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    padding: 10px 12px;
    color: #64748b;
}
.video-search input {
    border: 0;
    outline: 0;
    width: 100%;
    font: inherit;
    background: transparent;
}
.video-test { margin-bottom: 8px; }
.video-test-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px;
}
.video-test-head span {
    display: block;
    color: #be123c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.video-test-head h3 { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.video-test-head em {
    font-style: normal;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
    font-size: 12px;
}
.video-card {
    display: block;
    background: #fff;
    border: 1px solid #e8ecf4;
    border-radius: 16px;
    overflow: hidden;
    color: inherit;
    height: 100%;
    box-shadow: var(--sp-shadow);
}
.video-card:hover { color: inherit; transform: translateY(-2px); }
.video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #1e1b4b;
}
.video-thumb img, .video-thumb video, .video-thumb-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-thumb-fallback {
    background: linear-gradient(135deg, #312e81, #be123c);
}
.video-play {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-card-body { display: block; padding: 14px 16px 16px; }
.video-card-body small {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.video-card-body strong { display: block; margin-top: 4px; color: #0f172a; font-size: 16px; }
.video-card-body em { display: block; margin-top: 4px; color: #475569; font-style: normal; font-size: 13px; }
@media (max-width: 760px) {
    .video-page-head { display: block; }
    .video-search { margin-top: 12px; min-width: 0; }
}
