:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-2: #f8fbff;
    --line: #e4eaf2;
    --text: #111827;
    --muted: #667085;
    --cyan: #00d5ff;
    --blue: #2478ff;
    --green: #31d07d;
    --danger: #ff5d6c;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(15, 23, 42, .09);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
input, button, textarea, select { font: inherit; }
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card, .card, .table-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-card {
    width: min(440px, 100%);
    padding: 34px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: .2px;
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #ffffff;
    font-weight: 900;
}
.muted { color: var(--muted); }
.form { display: grid; gap: 16px; margin-top: 26px; }
.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.field input, .field textarea {
    width: 100%;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
    transition: border .2s, box-shadow .2s;
    resize: vertical;
}
.field select {
    width: 100%;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(0, 213, 255, .65); box-shadow: 0 0 0 4px rgba(0, 213, 255, .12); }
.field input[readonly] { background: #f3f6fb; color: var(--muted); cursor: not-allowed; }
.btn {
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 800;
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    transition: transform .2s, filter .2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-secondary { background: #ffffff; color: var(--blue); border: 1px solid #cfe0ff; }
.btn-small { padding: 8px 10px; font-size: 12px; }
.btn-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 18px;
    border: 1px solid var(--line);
}
.alert.error { color: #be123c; background: #fff1f2; border-color: #fecdd3; }
.alert.success { color: #047857; background: #dcfce7; border-color: #bbf7d0; }
.activation-shell {
    background:
        radial-gradient(circle at 18% 18%, rgba(0, 213, 255, .22), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(49, 208, 125, .18), transparent 28%),
        linear-gradient(135deg, #061827 0%, #092b46 45%, #03101d 100%);
}
.activation-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
}
.activation-card {
    width: min(520px, 100%);
    padding: 42px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,249,255,.94));
    box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}
.activation-brand {
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
    margin-bottom: 10px;
}
.activation-brand img {
    width: min(230px, 72%);
    height: auto;
    display: block;
}
.activation-brand span {
    color: #52657d;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
}
.activation-card .field label {
    color: #31445d;
    font-weight: 700;
}
.activation-card .field input {
    border-radius: 15px;
    min-height: 58px;
    border-color: #d5e2f1;
    font-size: 16px;
}
.activation-card .btn {
    min-height: 58px;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #00c8ff 0%, #2478ff 52%, #0b56d9 100%);
    box-shadow: 0 16px 34px rgba(36, 120, 255, .35);
}
.activation-card .btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 20px 42px rgba(36, 120, 255, .44);
}
.activation-login { display: inline-block; margin-top: 18px; text-align: center; width: 100%; }
.login-card .form { margin-top: 30px; }
.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 22px 0 0;
    color: #52657d;
    font-weight: 700;
    font-size: 14px;
}
.auth-links span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #9fb0c4;
}
.auth-links a {
    color: #2478ff;
}
.auth-links a:hover {
    color: #0b56d9;
}
@media (max-width: 560px) {
    .activation-card { padding: 30px 22px; border-radius: 20px; }
    .auth-links { flex-direction: column; gap: 9px; }
    .auth-links span { display: none; }
}
.app {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(0, 213, 255, .22), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(49, 208, 125, .18), transparent 28%),
        linear-gradient(135deg, #061827 0%, #092b46 45%, #03101d 100%);
    color: #f8fbff;
}
.app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
}
.sidebar {
    padding: 16px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: rgba(3, 16, 29, .72);
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    backdrop-filter: blur(18px);
}
.student-brand {
    gap: 16px;
    color: #ffffff;
}
.student-brand img {
    width: 128px;
    height: auto;
    display: block;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}
.student-brand span {
    color: #d8e7f7;
    font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 8px; margin-top: 0; flex-wrap: wrap; }
.nav a {
    color: #c7d7e8;
    padding: 10px 13px;
    border-radius: 12px;
    transition: .2s;
}
.nav a:hover, .nav a.active { color: #ffffff; background: rgba(36, 120, 255, .24); }
.main { position: relative; z-index: 1; padding: 46px 28px; max-width: 1180px; margin: 0 auto; width: 100%; }
.wide-main { max-width: none; padding-left: 40px; padding-right: 40px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}
.app .topbar h1, .app .section-title { color: #ffffff; }
.app .muted { color: #c7d7e8; }
.app .card, .app .table-card {
    background: rgba(255, 255, 255, .94);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    color: #102033;
}
.app .card .muted, .app .table-card .muted { color: #5d7189; }
.app .field label { color: #31445d; font-weight: 700; }
.app .field input, .app .field textarea, .app .field select {
    border-color: #d5e2f1;
    border-radius: 15px;
    min-height: 56px;
}
.app .btn {
    color: #ffffff;
    background: linear-gradient(135deg, #00c8ff 0%, #2478ff 52%, #0b56d9 100%);
    box-shadow: 0 14px 30px rgba(36, 120, 255, .28);
}
.app .btn-secondary {
    color: #0b56d9;
    background: #eef6ff;
    border: 1px solid #cfe0ff;
    box-shadow: none;
}
.course-title-card {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding: 22px 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.course-title-card h1 {
    margin: 0;
}
.user-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff !important;
    font-size: 22px;
    font-weight: 600;
}
.app .topbar .user-pill {
    color: #ffffff !important;
}
.user-pill .avatar {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255,255,255,.7);
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #00131c;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    font-weight: 900;
    object-fit: cover;
}
.grid { display: grid; gap: 18px; }
.grid.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.35fr .9fr; }
.card, .table-card { padding: 20px; }
.metric-value { font-size: 34px; font-weight: 900; margin-top: 10px; }
.metric-label { color: var(--muted); font-size: 13px; }
.progress {
    height: 10px;
    background: #e8eef7;
    border-radius: 999px;
    overflow: hidden;
}
.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--green));
}
.course-list { display: grid; gap: 12px; }
.course-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 213, 255, .12);
    color: #a8f2ff;
    color: #075985;
    font-size: 12px;
    font-weight: 800;
}
.section-title { margin: 28px 0 14px; }
.course-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.course-card { overflow: hidden; padding: 0; }
.course-card-completed {
    position: relative;
    border: 1px solid rgba(35, 209, 96, .45);
    background: linear-gradient(145deg, #ecfff3 0%, #ffffff 58%, #d8ffe6 100%);
    box-shadow: 0 18px 42px rgba(35, 209, 96, .22);
}
.course-card-completed::after {
    content: "🏆";
    position: absolute;
    top: 14px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe36e, #ffb800);
    box-shadow: 0 10px 24px rgba(255,184,0,.36);
    font-size: 25px;
}
.course-card-completed .course-cover {
    background-blend-mode: soft-light;
    border-bottom: 4px solid #23d160;
}
.course-card-completed .course-body {
    background: linear-gradient(135deg, rgba(35,209,96,.14), rgba(255,255,255,.72));
}
.completed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: #23d160;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(35,209,96,.28);
    font-weight: 800;
}
.completed-badge span {
    font-size: 18px;
}
.course-card-completed .progress span {
    background: linear-gradient(90deg, #16c784, #7ee787);
}
.course-card-completed .course-actions strong {
    color: #087a3a;
}
.certificate-achievement-card {
    position: relative;
    border: 1px solid rgba(250, 204, 21, .55);
    background: linear-gradient(145deg, #fff8d8 0%, #eafff0 48%, #ffffff 100%);
    box-shadow: 0 10px 24px rgba(250, 204, 21, .14), 0 6px 18px rgba(35, 209, 96, .12);
}
.certificate-achievement-card .course-body {
    gap: 10px;
    padding: 12px 14px 14px;
}
.certificate-achievement-card h3 {
    margin: 0;
    color: #063f2a;
    font-size: 15px;
    line-height: 1.25;
}
.certificate-miniature {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 96px;
    padding: 14px 12px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #102033;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, #facc15, #23d160, #00c2ff) border-box;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.certificate-miniature::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(6, 63, 42, .18);
    border-radius: 7px;
}
.certificate-star {
    position: absolute;
    top: 6px;
    right: 10px;
    color: #facc15;
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(250,204,21,.8));
    animation: star-twinkle 1.1s infinite ease-in-out;
}
.mini-cert-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 900;
    color: #06213f;
}
.mini-cert-line {
    width: 60%;
    height: 1px;
    margin: 4px 0;
    background: linear-gradient(90deg, transparent, #facc15, transparent);
}
.mini-cert-name {
    font-weight: 800;
    font-size: 11px;
    color: #0f766e;
}
.mini-cert-course {
    max-width: 90%;
    color: #3b526d;
    font-size: 10px;
}
@keyframes star-twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: .78; }
    50% { transform: scale(1.22) rotate(10deg); opacity: 1; }
}
.course-cover {
    min-height: 132px;
    padding: 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #1363df, #00c2ff);
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    font-weight: 900;
    font-size: 22px;
}
.large-cover { min-height: 240px; border-radius: 14px; }
.course-body { padding: 18px; display: grid; gap: 12px; }
.course-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.course-admin-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.course-admin-nav {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.course-admin-nav a {
    display: block;
    padding: 12px 13px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 800;
}
.course-admin-nav a:hover, .course-admin-nav a.active {
    color: var(--blue);
    background: #edf5ff;
}
.course-admin-nav a.disabled {
    pointer-events: none;
    opacity: .45;
}
.course-admin-content { min-width: 0; }
.course-admin-layout.full-editor {
    grid-template-columns: 1fr;
}
.course-admin-layout.full-editor .course-admin-nav {
    position: static;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.course-admin-layout.full-editor .course-admin-nav a {
    white-space: nowrap;
}
.image-editor {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}
.image-preview {
    min-height: 124px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
}
.image-preview img {
    width: 100%;
    height: 124px;
    object-fit: cover;
}
.course-view { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.course-hero {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding: 28px;
}
.course-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #f1f7ff;
    border: 1px solid #d8e8ff;
    color: #12315f;
    font-weight: 800;
}
.stat-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
    font-size: 14px;
}
.stars {
    color: #f5b301;
    letter-spacing: 1px;
    text-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.half-star {
    display: inline-block;
    width: .55em;
    overflow: hidden;
}
.course-hero-body {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.course-hero-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
}
.course-hero-text h2 {
    margin: 4px 0 10px;
    font-size: 28px;
}
.course-hero-text {
    font-size: 19px;
    line-height: 1.45;
}
.course-hero-actions {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(220px, 300px);
    gap: 18px;
}
.course-main-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    font-size: 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #00c2ff, #2563eb);
    border: 0;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .25);
}
.disabled-btn {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.4);
}
.course-progress {
    max-width: 660px;
}
.lesson-sidebar { align-self: start; position: sticky; top: 92px; }
.module-block { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.module-block a { color: var(--blue); font-size: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.fab {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.course-editor { margin-top: 18px; }
.compact-form { gap: 12px; margin-top: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.form-row.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.check-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; }
.inline-create {
    grid-template-columns: minmax(240px, 1fr) 110px auto auto;
    align-items: end;
}
.module-card { margin-top: 18px; }
.module-form {
    grid-template-columns: minmax(260px, 1fr) 110px auto auto;
    align-items: end;
}
.lesson-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}
.lesson-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
}
.lesson-line {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) minmax(190px, .9fr) minmax(260px, 1.4fr) 90px 80px 90px minmax(160px, auto);
    align-items: end;
}
.lesson-line textarea {
    min-height: 52px;
}
.file-link {
    display: block;
    margin-top: 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}
.lesson-view {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
}
.lesson-view h3 { margin-top: 0; }
.video-box {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
    border-radius: 14px;
    background: #0f172a;
}
.video-box iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.new-lesson { background: #ffffff; border-style: dashed; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #ffffff; box-shadow: var(--shadow); }
.full { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .sidebar { position: relative; align-items: flex-start; flex-direction: column; }
    .grid.metrics, .grid.two { grid-template-columns: 1fr; }
    .course-admin-layout, .image-editor { grid-template-columns: 1fr; }
    .course-admin-nav { position: static; }
    .course-view, .course-hero-body, .course-hero-actions { grid-template-columns: 1fr; }
    .course-hero-actions { margin-left: 0; gap: 12px; }
    .lesson-sidebar { position: static; }
    .course-cards, .profile-grid { grid-template-columns: 1fr; }
    .form-row, .form-row.two-cols, .form-row.four-cols, .inline-create, .module-form, .lesson-line { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
}

.learn-page {
    display: grid;
    grid-template-columns: 475px minmax(0, 1fr);
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(0, 213, 255, .22), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(49, 208, 125, .18), transparent 28%),
        linear-gradient(135deg, #061827 0%, #092b46 45%, #03101d 100%);
    color: #f8fbff;
}
.learn-sidebar {
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.12);
    background: rgba(3, 16, 29, .82);
    backdrop-filter: blur(18px);
}
.learn-search {
    height: 68px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
}
.learn-search input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: 0;
    color: #ffffff;
    font-size: 16px;
}
.learn-search input::placeholder { color: #b8cadc; }
.learn-module-title {
    display: grid;
    grid-template-columns: 24px 1fr 32px;
    align-items: center;
    gap: 8px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #ffffff;
    font-size: 18px;
    text-transform: uppercase;
}
.learn-lesson {
    display: grid;
    grid-template-columns: 22px 1fr 24px;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: #e9f3ff;
}
.learn-lesson.active {
    border-left: 4px solid #00c8ff;
    background: rgba(36, 120, 255, .18);
}
.learn-lesson.completed {
    background: rgba(49, 208, 125, .14);
}
.learn-lesson.completed.active {
    border-left-color: #31d07d;
    background: rgba(49, 208, 125, .22);
}
.learn-lesson strong {
    display: block;
    font-weight: 500;
    line-height: 1.35;
}
.learn-lesson small {
    color: #b8cadc;
    font-size: 15px;
}
.learn-lesson em {
    color: #31d07d;
    font-style: normal;
}
.learn-main {
    min-width: 0;
}
.learn-topbar {
    height: 70px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    background: rgba(3, 16, 29, .78);
    color: #ffffff;
}
.learn-back {
    height: 70px;
    display: grid;
    place-items: center;
    background: rgba(36, 120, 255, .28);
    color: #ffffff;
    font-size: 34px;
}
.learn-topbar > strong {
    text-align: center;
    font-size: 16px;
}
.learn-topbar .learn-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 28px;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0;
    color: rgba(255,255,255,.92);
}
.learn-topbar .learn-progress div {
    width: 220px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.learn-topbar .learn-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #23d160, #7ee787);
    box-shadow: 0 0 18px rgba(35,209,96,.45);
}
.learn-content {
    max-width: 1120px;
    margin: 28px auto 40px;
    padding: 0 28px;
}
.learn-content h1 {
    font-size: 34px;
    margin: 0 0 24px;
    color: #ffffff;
}
.learn-video {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111111;
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.learn-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.learn-text {
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.6;
    color: #d8e7f7;
}
.learn-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.14);
}
.primary-actions {
    margin-top: 18px;
    padding-top: 0;
    border-top: 0;
}
.finish-lesson-btn {
    opacity: .35;
    cursor: not-allowed;
    color: #00111a;
    background: #dbeafe;
}
.finish-lesson-btn.watching {
    opacity: .55;
}
.finish-lesson-btn.ready {
    opacity: 1;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #0f766e);
}
.finish-lesson-btn.completed {
    background: #16a34a;
    color: #ffffff;
}
.certificate-request-btn {
    color: #082f49;
    background: linear-gradient(135deg, #facc15, #f59e0b);
}
.lesson-documents, .lesson-comments {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.certificate-page {
    min-height: 100vh;
    background: #eef4fb;
    color: #061a33;
}
.certificate-shell {
    width: min(860px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}
.certificate-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}
.certificate-status {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
}
.certificate-status.valid { background: #dcfce7; color: #047857; }
.certificate-status.revoked { background: #fee2e2; color: #b91c1c; }
.certificate-canvas {
    position: relative;
    aspect-ratio: 210 / 297;
    min-height: 980px;
    padding: 72px 56px 52px;
    text-align: center;
    background-color: #ffffff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}
.certificate-bg-layer {
    position: absolute;
    z-index: 0;
    aspect-ratio: 210 / 297;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}
.certificate-bg-layer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}
.certificate-canvas::before { display: none; }
.certificate-canvas.has-template h1,
.certificate-canvas.has-template h2,
.certificate-canvas.has-template p,
.certificate-canvas.has-template .certificate-footer,
.certificate-canvas.has-template .certificate-validation,
.certificate-canvas.has-template .certificate-brand {
    display: none;
}
.certificate-brand {
    display: none;
}
.certificate-qr {
    position: absolute;
    top: 40px;
    right: 46px;
    display: grid;
    gap: 6px;
    justify-items: center;
    font-size: 11px;
    color: #334155;
}
.certificate-qr img {
    width: 92px;
    height: 92px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 8px;
}
.cert-field {
    position: absolute;
    z-index: 2;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    color: #061a33;
    line-height: 1.2;
}
.cert-qr {
    display: grid;
    justify-items: center;
    gap: 4px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #334155;
}
.cert-qr img {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    background: #ffffff;
    border: 0;
    border-radius: 0;
}
.certificate-public-view .cert-name {
    font-size: 18px !important;
    line-height: 1 !important;
}
.certificate-public-view .cert-course {
    font-size: 17px !important;
    line-height: 1 !important;
    transform: translateY(-8px);
}
.certificate-public-view .cert-date {
    font-size: 12px !important;
    line-height: 1 !important;
    transform: translateY(-22px);
}
.certificate-admin-card {
    padding: 22px;
}
.certificate-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 18px;
    align-items: start;
}
.certificate-preview-wrap {
    overflow: auto;
}
.certificate-layout-preview {
    width: 520px;
    min-width: 520px;
    height: 735px;
    min-height: 735px;
    flex: 0 0 auto;
}
@media (max-width: 640px) {
    .certificate-page {
        overflow-x: hidden;
    }
    .certificate-shell {
        width: 100%;
        padding: 18px 8px;
        overflow: hidden;
    }
    .certificate-status {
        margin-left: 10px;
        font-size: 18px;
    }
    .certificate-layout-preview {
        width: 520px;
        min-width: 520px;
        height: 735px;
        min-height: 735px;
        margin: 0;
        transform-origin: top left;
    }
}
.certificate-editor-preview .cert-field {
    outline: 1px dashed rgba(37, 99, 235, .75);
    background: rgba(255, 255, 255, .35);
}
.certificate-editor-preview .certificate-bg-layer {
    outline: 1px dashed rgba(245, 158, 11, .8);
}
.certificate-controls {
    display: grid;
    gap: 12px;
}
.certificate-controls fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}
.certificate-controls legend {
    padding: 0 6px;
    color: var(--blue);
    font-weight: 800;
}
.certificate-list-card {
    margin-top: 18px;
}
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.table-actions form {
    margin: 0;
}
.certificate-canvas h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    letter-spacing: 0;
    color: #002d62;
}
.certificate-canvas h2 {
    margin: 8px 0 32px;
    font-size: 14px;
    color: #9a7100;
}
.certificate-canvas p {
    max-width: 640px;
    margin: 18px auto;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.5;
}
.certificate-intro {
    margin-top: 28px;
}
.certificate-name, .certificate-course {
    width: min(560px, 80%);
    margin: 18px auto;
    padding: 10px 0 8px;
    border-bottom: 2px solid #0f2747;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 700;
}
.certificate-course {
    font-size: 24px;
}
.certificate-footer {
    position: absolute;
    left: 72px;
    right: 72px;
    bottom: 56px;
    display: flex;
    justify-content: space-between;
    gap: 60px;
    font-size: 12px;
    font-weight: 800;
}
.certificate-footer span {
    flex: 1;
    padding-top: 10px;
    border-top: 2px solid #0f2747;
}
.certificate-validation {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    color: #475569;
}
@media print {
    .certificate-toolbar, .certificate-status { display: none; }
    .certificate-shell { width: 100%; padding: 0; }
    .certificate-canvas { width: 210mm; min-height: 297mm; box-shadow: none; border-radius: 0; }
    .cert-field, .certificate-bg-layer { outline: 0 !important; background-color: transparent !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4 portrait; margin: 0; }
}
@media (max-width: 760px) {
    .certificate-admin-grid { grid-template-columns: 1fr; }
    .certificate-canvas {
        min-height: 760px;
        padding: 120px 24px 90px;
    }
    .certificate-brand { top: 32px; left: 28px; font-size: 22px; }
    .certificate-qr { top: 26px; right: 24px; }
    .certificate-canvas h1 { font-size: 34px; }
    .certificate-name, .certificate-course { width: 100%; font-size: 22px; }
    .certificate-footer { left: 28px; right: 28px; bottom: 58px; gap: 18px; }
}
.lesson-documents h2, .lesson-comments h2, .learn-text h2 {
    font-size: 22px;
    margin: 0 0 12px;
}
.lesson-download-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    border: 0;
    border-radius: 999px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #22c55e, #16a34a, #047857);
    box-shadow: 0 14px 30px rgba(34, 197, 94, .34);
    font-weight: 900;
    text-decoration: none;
    overflow: hidden;
    animation: download-pulse 1.45s infinite;
}
.lesson-download-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent);
    transform: translateX(-120%);
    animation: download-shine 2.4s infinite;
}
.lesson-download-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.lesson-download-btn span {
    position: relative;
    z-index: 1;
}
.lesson-download-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    font-size: 22px;
    line-height: 1;
}
@keyframes download-pulse {
    0%, 100% { box-shadow: 0 14px 30px rgba(34, 197, 94, .34); }
    50% { box-shadow: 0 18px 42px rgba(34, 197, 94, .58); }
}
@keyframes download-shine {
    0% { transform: translateX(-120%); }
    55%, 100% { transform: translateX(120%); }
}
.learn-text a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 8px 0;
    padding: 11px 15px;
    border-radius: 14px;
    color: #111827;
    background: linear-gradient(135deg, #fde047 0%, #facc15 58%, #f59e0b 100%);
    box-shadow: 0 14px 30px rgba(250, 204, 21, .22);
    font-weight: 900;
    text-decoration: none;
}
.learn-text a::before {
    content: "↓";
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: #111827;
    background: rgba(255, 255, 255, .72);
    font-size: 18px;
    line-height: 1;
}
.learn-text a:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}
.outline-print-page {
    margin: 0;
    background: #eef4fb;
    color: #102033;
}
.outline-print-shell {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}
.outline-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}
.outline-document {
    background: #ffffff;
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    padding: 38px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .12);
}
.outline-header {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 2px solid #e7eef7;
    padding-bottom: 24px;
}
.outline-header img {
    width: 170px;
    height: auto;
}
.outline-header p {
    margin: 0 0 6px;
    color: #2478ff;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
}
.outline-header h1 {
    margin: 0;
    font-size: 32px;
}
.outline-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0;
}
.outline-summary div {
    border-radius: 14px;
    background: #f4f8fd;
    border: 1px solid #dbe7f3;
    padding: 14px;
}
.outline-summary span {
    display: block;
    color: #61758d;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.outline-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}
.outline-description {
    color: #4b6078;
    line-height: 1.55;
}
.outline-module {
    break-inside: avoid;
    margin-top: 22px;
}
.outline-module h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
}
.outline-module h2 span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #00c8ff, #2478ff);
    font-size: 15px;
}
.outline-module table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
}
.outline-module th, .outline-module td {
    border-bottom: 1px solid #e7eef7;
    padding: 11px 12px;
    text-align: left;
}
.outline-module th {
    color: #31445d;
    background: #f4f8fd;
    font-size: 12px;
    text-transform: uppercase;
}
.outline-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #e7eef7;
    color: #61758d;
    font-size: 12px;
}
.outline-empty {
    padding: 18px;
    border-radius: 12px;
    background: #f4f8fd;
    color: #61758d;
}
@media print {
    .outline-toolbar { display: none; }
    .outline-print-page { background: #ffffff; }
    .outline-print-shell { width: 100%; padding: 0; }
    .outline-document { border: 0; border-radius: 0; box-shadow: none; padding: 18mm; }
    @page { size: A4 portrait; margin: 0; }
}
.comment-form {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
.comment-form textarea, .comment-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    outline: 0;
}
.comment-list {
    display: grid;
    gap: 14px;
}
.comment-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
}
.comment-item img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2f7;
}
.comment-item .avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
}
.comment-item strong {
    color: #111827;
}
.comment-item small {
    display: block;
    color: #475569;
    margin-top: 2px;
}
.comment-item p {
    margin: 8px 0 0;
    color: #111827;
    opacity: 1;
}
.reply-form {
    grid-template-columns: 1fr auto;
    margin-top: 12px;
}
.comment-reply {
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--blue);
    background: #f8fafc;
    color: #111827;
}
.learn-next {
    margin-left: auto;
    color: #777777;
    font-weight: 800;
}
.disabled-next {
    opacity: .45;
    cursor: not-allowed;
}
@media (max-width: 900px) {
    .learn-page { grid-template-columns: 1fr; }
    .learn-sidebar { height: auto; max-height: 45vh; }
    .learn-topbar { grid-template-columns: 48px 1fr; height: auto; }
    .learn-progress { grid-column: 1 / -1; justify-content: center; padding: 12px; }
}
