:root {
    --blue: #0066b8;
    --blue-2: #1a7fd0;
    --blue-deep: #00509a;
    --red: #e81038;
    --red-2: #ff3a5c;
    --red-deep: #c40c2e;
    --ink: #0a0a0a;
    --ink-2: #111111;
    --ink-3: #1a1a1a;
    --cream: #f4f8fc;
    --paper: #ffffff;
    --gold: var(--blue);
    --gold-2: var(--blue-2);
    --gold-deep: var(--blue-deep);
    --text: #102033;
    --muted: #5b6b7c;
    --line: rgba(0, 80, 154, .10);
    --shadow: 0 18px 50px rgba(0, 80, 154, .08);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --brand: linear-gradient(135deg, var(--blue), var(--red));
    /* Navbar and sidebar brand share this so their bottom borders line up */
    --chrome-h: 57px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-family: "Outfit", system-ui, sans-serif;
    color: var(--text);
    background: var(--cream);
    letter-spacing: .01em;
}

h1, h2, h3, h4, .brand-text, .page-kicker, .display-serif {
    font-family: "Fraunces", Georgia, serif;
}

a {
    color: var(--gold-deep);
    transition: color .25s var(--ease);
}

a:hover {
    color: var(--ink);
}

::selection {
    background: var(--blue-2);
    color: var(--ink);
}

.page-enter {
    animation: rise .7s var(--ease);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ---------- Admin chrome ---------- */
.lms-app .wrapper,
.lms-app .content-wrapper {
    background: var(--cream);
}

.lms-app .content-wrapper {
    min-height: calc(100vh - var(--chrome-h));
}

.lms-app .main-header {
    min-height: var(--chrome-h);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.lms-app .main-header .nav-link {
    color: var(--text) !important;
}

.lms-app .main-header .navbar-nav .nav-link:hover {
    color: var(--gold-deep) !important;
}

.lms-app .main-sidebar {
    background:
        radial-gradient(580px 360px at 0% 0%, rgba(0, 102, 184, .16), transparent 58%),
        linear-gradient(180deg, #07111c 0%, #0b1420 54%, #0d1724 100%);
    box-shadow: 18px 0 40px rgba(12, 16, 24, .22);
}

.lms-app .main-sidebar .brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--chrome-h);
    padding: .35rem .75rem;
}

/* Outweighs AdminLTE's .layout-navbar-fixed .wrapper .sidebar-dark-primary
   .brand-link rule, which paints this band grey instead of sidebar black */
.lms-app .wrapper .main-sidebar.sidebar-dark-primary .brand-link {
    background-color: transparent;
}

.lms-app .brand-link .brand-text {
    display: none;
}

.brand-logo {
    height: 42px;
    width: auto;
    max-width: 180px;
    display: block;
    object-fit: contain;
}

.header-logo {
    height: 32px;
    width: auto;
    display: block;
}

.nav-logo {
    height: 40px;
    width: auto;
    display: block;
}

.auth-logo {
    height: 84px;
    width: auto;
    display: block;
}

.theme-toggle-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    color: var(--text);
    border-radius: 999px;
    padding: .45rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 102, 184, .28);
}

.theme-toggle-nav {
    margin-right: .25rem;
}

.theme-toggle-floating {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 30;
}

/* The collapsed rail is only ~4.6rem wide, so scale the mark to fit it */
.lms-app.sidebar-mini.sidebar-collapse .main-sidebar .brand-link {
    padding: .35rem .4rem;
}

.lms-app.sidebar-mini.sidebar-collapse .brand-logo {
    height: auto;
    max-height: 40px;
    max-width: 100%;
}

.lms-app.sidebar-mini.sidebar-collapse .main-sidebar:hover .brand-logo {
    max-height: 42px;
}

.lms-app .user-panel {
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    margin: .9rem .85rem 1rem;
    padding: .85rem .85rem 1rem !important;
    border-radius: 18px;
    background: rgba(255, 255, 255, .035);
    backdrop-filter: blur(10px);
}

.lms-app .user-panel .info a {
    color: #fff;
    font-weight: 600;
}

.lms-app .user-panel .image img {
    border: 2px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.sidebar-role {
    display: inline-flex;
    align-items: center;
    margin-top: .35rem;
    padding: .28rem .58rem;
    border-radius: 999px;
    background: rgba(232, 16, 56, .14);
    border: 1px solid rgba(232, 16, 56, .16);
    color: #ff9caf;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
}

.lms-app .nav-sidebar .nav-header {
    color: rgba(255, 140, 164, .88);
    letter-spacing: .18em;
    font-size: .68rem;
    margin: 1rem .95rem .45rem;
    padding: 0;
}

.lms-app .nav-sidebar .nav-link {
    color: rgba(235, 243, 251, .76);
    border-radius: 14px;
    margin: 4px 10px;
    padding: .72rem .88rem;
    white-space: nowrap;
    transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}

.lms-app .nav-sidebar .nav-link:hover {
    background: linear-gradient(90deg, rgba(0, 102, 184, .16), rgba(255, 255, 255, .04));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}

.lms-app .nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 102, 184, .96), rgba(232, 16, 56, .92));
    color: #fff;
    box-shadow: 0 12px 26px rgba(0, 102, 184, .24);
}

.lms-app .nav-sidebar .nav-link.active .nav-icon {
    color: #fff;
}

.lms-app .nav-sidebar .nav-link .nav-icon {
    font-size: 1rem;
    color: rgba(255, 255, 255, .78);
}

.lms-app .content-header h1 {
    font-size: 2rem;
    font-weight: 650;
    color: var(--ink);
}

.lms-app .content-header .btn-toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .6rem;
}

.lms-app .content-header .btn-toolbar > * {
    margin: 0 !important;
}

.lms-app .content-header .btn-toolbar .btn {
    min-height: 42px;
    padding: .55rem 1rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    line-height: 1;
    white-space: nowrap;
}

.lms-app .content-header .btn-toolbar .btn i {
    margin: 0 !important;
}

.page-kicker {
    font-family: "Outfit", sans-serif;
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: .68rem;
    color: var(--red);
}

.lms-app .main-footer {
    background: transparent;
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: .6rem 1rem;
    min-height: 0;
    line-height: 1.35;
}

html[data-theme="dark"] .lms-app,
html[data-theme="dark"] .lms-app .wrapper,
html[data-theme="dark"] .lms-app .content-wrapper {
    background: #08111c;
    color: #ecf3fb;
}

html[data-theme="dark"] .lms-app .main-header {
    background: rgba(9, 16, 27, .88);
    border-bottom-color: rgba(178, 203, 229, .1);
}

html[data-theme="dark"] .lms-app .main-header .nav-link,
html[data-theme="dark"] .lms-app .content-header h1,
html[data-theme="dark"] .lms-app .card-title,
html[data-theme="dark"] .lms-app .main-footer strong {
    color: #f4f8fc !important;
}

html[data-theme="dark"] .lms-app .main-footer,
html[data-theme="dark"] .lms-app .text-muted,
html[data-theme="dark"] .lms-app small,
html[data-theme="dark"] .lms-app .table thead th,
html[data-theme="dark"] .lms-app .card-header,
html[data-theme="dark"] .lms-app .form-text {
    color: #98abc0 !important;
}

html[data-theme="dark"] .lms-app .main-footer,
html[data-theme="dark"] .lms-app .card-header,
html[data-theme="dark"] .lms-app .table td,
html[data-theme="dark"] .lms-app .table th,
html[data-theme="dark"] .lms-app .list-group-item,
html[data-theme="dark"] .lms-app .dropdown-divider {
    border-color: rgba(178, 203, 229, .1);
}

html[data-theme="dark"] .lms-app .card,
html[data-theme="dark"] .lms-app .dropdown-menu,
html[data-theme="dark"] .lms-app .modal-content,
html[data-theme="dark"] .lms-app .toast,
html[data-theme="dark"] .lms-app .auth-card,
html[data-theme="dark"] .lms-app .lms-page > a,
html[data-theme="dark"] .lms-app .lms-page > span {
    background: #0f1a29;
    color: #ecf3fb;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

html[data-theme="dark"] .lms-app .dropdown-item,
html[data-theme="dark"] .lms-app .table,
html[data-theme="dark"] .lms-app .table tbody td,
html[data-theme="dark"] .lms-app .card-body,
html[data-theme="dark"] .lms-app .toast-body,
html[data-theme="dark"] .lms-app .lms-pagination-meta strong {
    color: #ecf3fb;
}

html[data-theme="dark"] .lms-app .lesson-pdf-viewer {
    background: rgba(15, 26, 41, .95);
    border-color: rgba(178, 203, 229, .12);
}

html[data-theme="dark"] .lms-app .lesson-pdf-toolbar {
    background: rgba(8, 17, 28, .88);
    border-color: rgba(178, 203, 229, .12);
}

html[data-theme="dark"] .lms-app .lesson-pdf-page,
html[data-theme="dark"] .lms-app .lesson-pdf-status {
    color: #d8e5f3;
}

html[data-theme="dark"] .lms-app .lesson-pdf-canvas-wrap {
    background:
        linear-gradient(135deg, rgba(3, 7, 18, .92), rgba(9, 14, 24, .86)),
        repeating-linear-gradient(
            45deg,
            rgba(148, 163, 184, .08),
            rgba(148, 163, 184, .08) 10px,
            rgba(15, 23, 42, .15) 10px,
            rgba(15, 23, 42, .15) 20px
        );
}

html[data-theme="dark"] .lms-app .dropdown-item:hover,
html[data-theme="dark"] .lms-app .dropdown-item:focus {
    background: rgba(255, 255, 255, .05);
}

html[data-theme="dark"] .lms-app .form-control,
html[data-theme="dark"] .lms-app .custom-select {
    background: #0a1421;
    color: #ecf3fb;
    border-color: rgba(178, 203, 229, .14);
}

html[data-theme="dark"] .lms-app .form-control::placeholder {
    color: #7f97b0;
}

html[data-theme="dark"] .lms-app .btn-default,
html[data-theme="dark"] .theme-toggle-btn {
    background: #102033;
    color: #ecf3fb;
    border-color: rgba(178, 203, 229, .12);
}

html[data-theme="dark"] .lms-app .btn-default:hover,
html[data-theme="dark"] .theme-toggle-btn:hover {
    background: #16304c;
    color: #fff;
}

html[data-theme="dark"] .lms-app .badge-info {
    background: rgba(82, 158, 222, .18);
    color: #cfe8ff;
    border-color: rgba(82, 158, 222, .22);
}

html[data-theme="dark"] .lms-app .badge-success {
    background: rgba(31, 186, 104, .18);
    color: #c7f5dd;
    border-color: rgba(31, 186, 104, .22);
}

html[data-theme="dark"] .lms-app .badge-warning {
    background: rgba(255, 193, 7, .18);
    color: #ffe8a3;
    border-color: rgba(255, 193, 7, .24);
}

html[data-theme="dark"] .lms-app .badge-danger {
    background: rgba(232, 16, 56, .18);
    color: #ffc7d3;
    border-color: rgba(232, 16, 56, .24);
}

html[data-theme="dark"] .lms-app .badge-secondary {
    background: rgba(152, 171, 192, .16);
    color: #d4e1ee;
    border-color: rgba(152, 171, 192, .18);
}

html[data-theme="dark"] .lms-app .badge-light {
    background: rgba(255, 255, 255, .06);
    color: #ecf3fb;
    border-color: rgba(255, 255, 255, .1);
}

/* Cards, tables, buttons */
.lms-app .card {
    border: 0;
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.lms-app .card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.lms-app .card-title {
    font-family: "Fraunces", serif;
    font-weight: 650;
}

.lms-app .table {
    margin-bottom: 0;
}

.lms-app .table thead th {
    border-top: 0;
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
}

.lms-app .table td,
.lms-app .table th {
    vertical-align: middle;
    border-color: var(--line);
}

.lms-app .btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .45rem 1.1rem;
    line-height: 1.25;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

.lms-app .btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.lms-app .btn:focus,
.lms-app .btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(0, 102, 184, .16);
}

.lms-app .btn-primary,
.auth-screen .btn-primary,
.site-btn-gold {
    background: var(--blue);
    border: 0;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 102, 184, .28);
}

.lms-app .btn-primary:hover,
.lms-app .btn-primary:focus,
.auth-screen .btn-primary:hover,
.auth-screen .btn-primary:focus,
.site-btn-gold:hover {
    background: var(--blue-deep);
    color: #fff;
}

.site-btn-red {
    background: var(--red);
    border: 0;
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(232, 16, 56, .28);
}

.site-btn-red:hover {
    background: var(--red-deep);
    color: #fff;
}

.lms-app .btn-outline-primary,
.lms-app .btn-outline-danger,
.lms-app .btn-info,
.lms-app .btn-success,
.lms-app .btn-default {
    border-radius: 999px;
}

.lms-app .btn-outline-primary {
    color: var(--gold-deep);
    border-color: rgba(0, 102, 184, .5);
    background: #fff;
}

.lms-app .btn-outline-primary:hover,
.lms-app .btn-outline-primary:focus {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.lms-app .btn-outline-danger {
    color: var(--red-deep);
    border-color: rgba(232, 16, 56, .5);
    background: #fff;
}

.lms-app .btn-outline-danger:hover,
.lms-app .btn-outline-danger:focus {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.lms-app .btn-default {
    color: var(--text);
    border-color: rgba(20, 27, 40, .14);
    background: #fff;
    box-shadow: none;
}

.lms-app .btn-default:hover,
.lms-app .btn-default:focus {
    color: var(--text);
    background: #f7fbff;
    border-color: rgba(0, 102, 184, .22);
}

.lms-app .btn-info {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #12a7c8, #0f7cc0);
    box-shadow: 0 10px 24px rgba(15, 124, 192, .22);
}

.lms-app .btn-info:hover,
.lms-app .btn-info:focus {
    color: #fff;
    background: linear-gradient(135deg, #1198b5, #0d6dad);
}

.lms-app .btn-success {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #23b36b, #139c55);
    box-shadow: 0 10px 24px rgba(19, 156, 85, .22);
}

.lms-app .btn-success:hover,
.lms-app .btn-success:focus {
    color: #fff;
    background: linear-gradient(135deg, #1fa460, #108c4c);
}

.lms-app .form-control,
.lms-app .custom-select,
.auth-screen .form-control {
    border-radius: 12px;
    border-color: rgba(20, 27, 40, .12);
    background: #fff;
    min-height: 44px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.lms-app .form-control:focus,
.auth-screen .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(0, 102, 184, .18);
}

.lms-app .badge {
    border-radius: 999px;
    padding: .44rem .78rem;
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .04em;
    line-height: 1;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.lms-app .badge-info {
    background: rgba(0, 102, 184, .12);
    color: #0f5a99;
    border-color: rgba(0, 102, 184, .14);
}

.lms-app .badge-success {
    background: rgba(31, 186, 104, .14);
    color: #11824a;
    border-color: rgba(31, 186, 104, .16);
}

.lms-app .badge-warning {
    background: rgba(255, 193, 7, .18);
    color: #956600;
    border-color: rgba(255, 193, 7, .24);
}

.lms-app .badge-danger {
    background: rgba(232, 16, 56, .12);
    color: #b31333;
    border-color: rgba(232, 16, 56, .16);
}

.lms-app .badge-secondary {
    background: rgba(91, 107, 124, .12);
    color: #516172;
    border-color: rgba(91, 107, 124, .14);
}

.lms-app .badge-light {
    background: #f7fbff;
    color: var(--text);
    border-color: rgba(0, 102, 184, .14);
}

.lms-app .progress {
    background: rgba(20, 27, 40, .08);
    border-radius: 999px;
    overflow: hidden;
}

.lms-app .progress-bar {
    background: var(--brand);
}

.lms-app .alert {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

/* Toastr overrides */
#toast-container > .toast {
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(10, 18, 28, .14);
    backdrop-filter: blur(10px);
    opacity: .97;
    padding: 10px 14px 10px 42px;
    font-family: var(--font);
    font-size: .82rem;
}

#toast-container > .toast-success {
    background-color: #0f9d58;
}

#toast-container > .toast-error {
    background-color: #e81038;
}

#toast-container > .toast-info {
    background-color: var(--brand);
}

#toast-container > .toast-warning {
    background-color: #f5a623;
}

#toast-container .toast-close-button {
    font-weight: 400;
    font-size: 1rem;
    text-shadow: none;
}

#toast-container .toast-progress {
    opacity: .22;
}

.lms-modal .modal-content {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(10, 18, 28, .2);
}

.lms-modal .modal-body {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.lms-modal .modal-footer {
    padding: 0 2rem 2rem;
    border-top: 0;
    gap: .6rem;
}

.lms-modal .btn {
    min-width: 140px;
}

.lms-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.lms-modal-icon.success {
    color: #fff;
    background: linear-gradient(135deg, #1fba68, #0f9d58);
    box-shadow: 0 14px 32px rgba(15, 157, 88, .24);
}

.lms-modal-icon.danger {
    color: #fff;
    background: linear-gradient(135deg, #ff5a75, #e81038);
    box-shadow: 0 14px 32px rgba(232, 16, 56, .22);
}

.lms-modal-icon.warning {
    color: #fff;
    background: linear-gradient(135deg, #1a7fd0, #00509a);
    box-shadow: 0 14px 32px rgba(0, 102, 184, .22);
}

.lms-modal-title {
    margin-bottom: .65rem;
    color: var(--text);
}

.lms-modal-copy {
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
    color: var(--muted);
    line-height: 1.7;
}

.lms-app .callout {
    border-radius: 16px;
    border-left-color: var(--gold);
    background: var(--paper);
}

.kpi-card {
    position: relative;
    background: var(--paper);
    border-radius: 20px;
    padding: 1.25rem 1.3rem 1.1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 132px;
    transition: transform .35s var(--ease);
    margin-bottom: 1.25rem;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-card .kpi-label {
    color: var(--muted);
    font-size: .82rem;
    margin-bottom: .15rem;
}

.kpi-card h3 {
    font-size: 2rem;
    margin: 0;
    font-weight: 650;
}

.kpi-card .kpi-icon {
    position: absolute;
    right: 1rem;
    bottom: .7rem;
    font-size: 2.1rem;
    color: var(--gold);
    opacity: .28;
}

.kpi-card a {
    font-size: .8rem;
    font-weight: 600;
}

.lms-stepper {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding: .25rem .15rem 1rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.lms-stepper-path {
    flex-direction: column;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
    gap: .7rem;
}

.lms-step {
    min-width: 168px;
    flex: 1 0 168px;
    scroll-snap-align: start;
    border-radius: 16px;
    padding: .95rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform .3s var(--ease), border-color .3s var(--ease);
}

.lms-stepper-path .lms-step {
    min-width: 0;
    flex: 0 0 auto;
    width: 100%;
}

.lms-step:hover {
    transform: translateY(-3px);
}

.lms-stepper-path .lms-step:hover {
    transform: translateX(4px);
}

.lms-step.completed {
    border-color: rgba(47, 122, 74, .35);
    background: #f4faf5;
}

.lms-step.current {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(0, 102, 184, .18);
}

.lms-step.locked {
    opacity: .58;
}

.lms-step .step-index {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

.lms-step .step-title {
    display: block;
    margin-top: .45rem;
    line-height: 1.35;
}

.lms-step .step-meta {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
}

.learn-course-hero {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(0, 102, 184, .07), rgba(255, 255, 255, .9)),
        var(--paper);
    box-shadow: var(--shadow);
}

.learn-course-hero-media {
    overflow: hidden;
    border-radius: 18px;
    min-height: 220px;
    background: #0f1a29;
}

.learn-course-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.learn-course-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.learn-course-meta,
.learn-lesson-status,
.learn-review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}

.learn-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .72rem;
    border-radius: 999px;
    background: rgba(0, 102, 184, .06);
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
}

.learn-course-lead,
.learn-lesson-lead {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.65;
}

.learn-progress-panel {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(0, 102, 184, .08);
}

.learn-progress {
    height: .7rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 102, 184, .08);
}

.learn-progress .progress-bar {
    border-radius: 999px;
}

.learn-progress-note {
    margin-top: .65rem;
    color: var(--muted);
    font-size: .85rem;
}

.learn-panel {
    border-radius: 22px;
    overflow: hidden;
}

.learn-panel-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.learn-about {
    white-space: pre-line;
    line-height: 1.7;
}

.learn-locked-note {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(0, 102, 184, .05);
    color: var(--muted);
}

.learn-locked-note i {
    margin-top: .2rem;
    color: var(--gold);
}

.learn-lesson-top {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.learn-lesson-actions {
    border-radius: 22px;
    overflow: hidden;
}

.learn-course-cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: stretch;
}

.learn-course-cta .btn,
.learn-enroll-form .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lesson-content-modal .modal-dialog {
    max-width: min(980px, calc(100vw - 1.5rem));
    margin: 1rem auto;
    transform: translateY(16px) scale(0.985);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .32s ease;
}

.lesson-content-modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.lesson-content-modal.lms-modal .modal-body {
    padding: 1.15rem 1.25rem;
    text-align: left;
}

.lesson-content-modal.lms-modal .modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--line);
    justify-content: space-between;
}

.lesson-content-modal.lms-modal .modal-footer .btn {
    min-width: 0;
}

.lesson-content-modal .modal-content {
    border-radius: 24px;
    overflow: hidden;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.lesson-content-modal .modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.lesson-content-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding: 1.15rem 1.25rem;
}

.lesson-content-modal-header .close {
    margin: 0;
    padding: 0;
    opacity: 1;
}

.lesson-content-modal-body {
    padding: 1.15rem 1.25rem;
    background: rgba(248, 250, 252, .7);
    flex: 1 1 auto;
}

.lesson-content-modal-body .card {
    margin-bottom: 1rem;
}

.lesson-content-modal-body .card:last-child {
    margin-bottom: 0;
}

.lesson-content-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    border-top: 1px solid var(--line);
    padding: 1rem 1.25rem;
}

.learn-modal-status {
    flex: 1 1 220px;
}

html[data-theme="dark"] .lms-app .lesson-content-modal-body {
    background: rgba(8, 17, 28, .55);
}

body.lms-app.modal-open {
    padding-right: 0 !important;
}

body.lms-app.modal-open .main-header,
body.lms-app.modal-open .main-sidebar,
body.lms-app.modal-open .content-wrapper {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

html[data-theme="dark"] .lms-app .learn-course-hero,
html[data-theme="dark"] .lms-app .learn-lesson-top,
html[data-theme="dark"] .lms-app .learn-progress-panel {
    background: rgba(15, 26, 41, .92);
}

html[data-theme="dark"] .lms-app .lms-step.completed {
    background: rgba(17, 130, 74, .12);
}

html[data-theme="dark"] .lms-app .learn-chip {
    background: rgba(255, 255, 255, .05);
    color: #c7d7e8;
}

.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #111;
    border-radius: 14px;
    overflow: hidden;
}

.video-wrap iframe,
.video-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lesson-pdf-viewer {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(248, 250, 252, .94);
}

.lesson-pdf-toolbar {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .82);
}

.lesson-pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.lesson-pdf-page {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
}

.lesson-pdf-status {
    padding: 1rem;
    font-size: .92rem;
    color: var(--muted);
}

.lesson-pdf-canvas-wrap {
    padding: 1rem;
    overflow: auto;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .04), rgba(15, 23, 42, .01)),
        repeating-linear-gradient(
            45deg,
            rgba(148, 163, 184, .08),
            rgba(148, 163, 184, .08) 10px,
            rgba(255, 255, 255, .22) 10px,
            rgba(255, 255, 255, .22) 20px
        );
}

.lesson-pdf-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
    background: #fff;
}

/* Lesson bodies hold author-supplied HTML, so keep it inside the card */
.lesson-text img,
.lesson-text video,
.lesson-text iframe {
    max-width: 100%;
    height: auto;
}

.lesson-text pre {
    overflow-x: auto;
}

.lesson-text table {
    width: 100%;
    display: block;
    overflow-x: auto;
}

.lesson-text a {
    overflow-wrap: anywhere;
}

.course-thumb {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: #e8e0d2;
}

.catalog-card {
    border-radius: 22px;
    overflow: hidden;
    transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}

.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 54px rgba(0, 80, 154, .14);
}

.catalog-thumb-wrap {
    position: relative;
    overflow: hidden;
}

.catalog-thumb-wrap::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 48%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(7, 17, 28, .18));
    pointer-events: none;
}

.catalog-flag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .42rem .78rem;
    background: rgba(255, 255, 255, .94);
    color: var(--red-deep);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(10, 18, 28, .12);
}

.catalog-card-body {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    padding: 1.2rem 1.2rem .8rem;
}

.catalog-meta,
.catalog-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}

.catalog-chip,
.catalog-stats span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
}

.catalog-chip {
    padding: .38rem .72rem;
    border-radius: 999px;
    background: rgba(0, 102, 184, .06);
}

.catalog-title {
    margin: 0;
    line-height: 1.2;
}

.catalog-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    min-height: 4.9em;
}

.catalog-stat-success {
    color: #11824a !important;
}

.catalog-card-footer {
    padding: 0 1.2rem 1.2rem;
    background: transparent;
    border-top: 0;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

/* The global .btn padding above swallows Bootstrap's small sizes */
.lms-app .btn-sm {
    padding: .3rem .9rem;
    font-size: .8rem;
}

.lms-app .btn-xs {
    padding: .18rem .7rem;
    font-size: .72rem;
}

/* ---------- Row actions ---------- */
.action-group {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.action-group form {
    display: inline-flex;
    margin: 0;
}

.action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted);
    font-size: .82rem;
    cursor: pointer;
    transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}

.action-btn:hover,
.action-btn:focus-visible {
    color: var(--gold-deep);
    border-color: rgba(0, 102, 184, .42);
    background: #f1f7fe;
    transform: translateY(-1px);
    text-decoration: none;
}

.action-btn.action-primary {
    color: var(--gold-deep);
    border-color: rgba(0, 102, 184, .3);
}

.action-btn.action-danger:hover,
.action-btn.action-danger:focus-visible {
    color: var(--red-deep);
    border-color: rgba(232, 16, 56, .42);
    background: #fff4f6;
}

.status-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 999px;
    padding: .35rem .78rem;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
}

.status-pill-success {
    background: rgba(31, 186, 104, .14);
    color: #11824a;
}

.status-pill-warning {
    background: rgba(255, 193, 7, .16);
    color: #9a6b00;
}

.status-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .34rem .8rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 102, 184, .2);
    background: #f5faff;
    color: var(--gold-deep);
    font-size: .76rem;
    font-weight: 600;
    line-height: 1;
}

.status-link:hover {
    color: var(--gold-deep);
    border-color: rgba(0, 102, 184, .4);
    background: #edf6ff;
    text-decoration: none;
}

/* ---------- File upload ---------- */
.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1rem;
    border: 1.5px dashed rgba(0, 80, 154, .28);
    border-radius: 16px;
    background: #fbfdff;
    transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}

.file-drop:hover {
    border-color: rgba(0, 102, 184, .55);
    background: #f4f9ff;
}

.file-drop:focus-within,
.file-drop.is-dragging {
    border-color: var(--blue);
    background: #f1f7fe;
    box-shadow: 0 0 0 4px rgba(0, 102, 184, .15);
}

.file-drop.has-file {
    border-style: solid;
    border-color: rgba(0, 102, 184, .42);
    background: var(--paper);
}

.file-drop-input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-thumb,
.file-drop-copy {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

.file-drop-thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(0, 102, 184, .1);
    color: var(--blue);
    font-size: 1.15rem;
}

.file-drop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-drop-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-drop-name {
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.file-drop-hint {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.file-drop-actions {
    position: relative;
    z-index: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .4rem;
    pointer-events: none;
}

.file-drop-cta {
    flex: 0 0 auto;
    border: 1px solid rgba(0, 102, 184, .35);
    border-radius: 999px;
    padding: .28rem .9rem;
    font-size: .76rem;
    font-weight: 600;
    color: var(--gold-deep);
    white-space: nowrap;
}

.file-drop-clear {
    pointer-events: auto;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(232, 16, 56, .12);
    color: var(--red-deep);
    font-size: .72rem;
    cursor: pointer;
    transition: background .2s var(--ease);
}

.file-drop-clear:hover {
    background: rgba(232, 16, 56, .2);
}

/* ---------- Pagination ---------- */
.lms-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.lms-pagination-meta {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

.lms-pagination-meta strong {
    color: var(--text);
}

.lms-pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lms-page > a,
.lms-page > span {
    min-width: 36px;
    height: 36px;
    padding: 0 .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}

.lms-page > a:hover {
    border-color: rgba(0, 102, 184, .45);
    background: #f1f7fe;
    color: var(--gold-deep);
    transform: translateY(-1px);
    text-decoration: none;
}

.lms-page.is-active > span {
    background: linear-gradient(135deg, var(--blue-2), var(--blue-deep));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 102, 184, .28);
}

.lms-page.is-disabled > span {
    opacity: .4;
}

.lms-page.is-gap > span {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    min-width: 22px;
    padding: 0;
}

/* Narrow screens keep only prev / current / next so the row never wraps */
@media (max-width: 575.98px) {
    .lms-page:not(.is-prev):not(.is-next):not(.is-active) {
        display: none;
    }
}

.certificate-sheet {
    max-width: 920px;
    margin: 0 auto;
    border: 12px solid var(--ink);
    padding: 2.6rem 2rem;
    background:
        linear-gradient(var(--paper), var(--paper)) padding-box,
        repeating-linear-gradient(45deg, var(--blue), var(--blue) 8px, var(--red) 8px, var(--red) 16px);
    text-align: center;
    border-radius: 8px;
    overflow-wrap: break-word;
}

.certificate-logo {
    display: block;
    height: 78px;
    width: auto;
    margin: 0 auto 1.1rem;
}

.certificate-sheet h1 {
    font-family: "Fraunces", serif;
    letter-spacing: .1em;
    color: var(--ink);
}

/* ---------- Auth ---------- */
.auth-screen {
    min-height: 100vh;
    margin: 0;
    background: var(--ink);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 3rem;
    color: #fff;
    background:
        radial-gradient(900px 500px at 10% 15%, rgba(0, 102, 184, .28), transparent 55%),
        radial-gradient(700px 400px at 90% 90%, rgba(232, 16, 56, .18), transparent 50%),
        #0a0a0a;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
    opacity: .35;
    pointer-events: none;
}

.auth-visual-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 650;
}

.auth-visual h1 {
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    line-height: 1.08;
    max-width: 11ch;
    margin: 4rem 0 1rem;
}

.auth-visual p {
    max-width: 36ch;
    color: rgba(255, 255, 255, .72);
    font-size: 1.05rem;
}

.auth-orb {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1px solid rgba(0, 102, 184, .35);
    margin-top: 2rem;
    animation: floaty 6s ease-in-out infinite;
    box-shadow: inset 0 0 40px rgba(0, 102, 184, .18), 0 0 60px rgba(0, 102, 184, .12);
}

.auth-panel {
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-card {
    width: min(420px, 100%);
    animation: rise .8s var(--ease);
}

.auth-card h2 {
    font-size: 2.1rem;
    margin-bottom: .35rem;
}

.field {
    position: relative;
    margin-bottom: 1rem;
}

.field label {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: .3rem;
    display: block;
}

.field .toggle-pass {
    position: absolute;
    right: 14px;
    top: 38px;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.demo-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 1.1rem;
}

.demo-pills button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .75rem;
    cursor: pointer;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.demo-pills button:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.btn-loading .btn-label {
    opacity: 0;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

/* ---------- Marketing site ---------- */
.site {
    background: var(--ink);
    color: #fff;
    min-height: 100vh;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: rgba(0, 0, 0, .82);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.site-nav .navbar-brand {
    padding: 0;
}

.site-nav .nav-link {
    color: rgba(255, 255, 255, .82) !important;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 6.5rem 0 5.5rem;
    background:
        radial-gradient(900px 420px at 80% 10%, rgba(0, 102, 184, .2), transparent 55%),
        radial-gradient(700px 380px at 0% 80%, rgba(232, 16, 56, .16), transparent 50%);
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    line-height: 1.02;
    max-width: 12ch;
}

.hero .lede {
    max-width: 40ch;
    color: rgba(255, 255, 255, .72);
    font-size: 1.15rem;
}

.hero-panel {
    background: rgba(251, 248, 242, .06);
    border: 1px solid rgba(0, 102, 184, .2);
    border-radius: 22px;
    padding: 1.4rem 1.5rem;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
    line-height: 1.15;
}

.site-section {
    padding: 5rem 0;
}

.site-section.cream {
    background: var(--cream);
    color: var(--text);
}

.feature-card {
    height: 100%;
    background: var(--paper);
    color: var(--text);
    border-radius: 22px;
    padding: 1.6rem;
    box-shadow: var(--shadow);
    transition: transform .4s var(--ease);
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-card .icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(0, 102, 184, .16);
    color: var(--blue);
    margin-bottom: 1rem;
}

.step-rail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.step-rail article {
    border-top: 2px solid var(--gold);
    padding-top: 1rem;
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 2rem 0;
    color: rgba(246, 240, 230, .55);
}

.footer-main-logo {
    display: block;
    width: min(220px, 56vw);
    height: auto;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.lms-app .list-group-item {
    background: transparent;
    border-color: var(--line);
}

.site .btn-outline-light {
    border-radius: 999px;
    border-color: rgba(246, 240, 230, .35);
}

.site .btn-outline-light:hover {
    background: #f6f0e6;
    color: var(--ink);
}

html[data-theme="light"] .site {
    background: var(--cream);
    color: var(--text);
}

html[data-theme="light"] .site-nav {
    background: rgba(255, 255, 255, .9);
    border-bottom-color: var(--line);
}

html[data-theme="light"] .site-nav .nav-link,
html[data-theme="light"] .site-nav .navbar-toggler,
html[data-theme="light"] .hero h1,
html[data-theme="light"] .site .display-serif {
    color: var(--text) !important;
}

html[data-theme="light"] .hero {
    background:
        radial-gradient(900px 420px at 80% 10%, rgba(0, 102, 184, .12), transparent 55%),
        radial-gradient(700px 380px at 0% 80%, rgba(232, 16, 56, .1), transparent 50%);
}

html[data-theme="light"] .hero .lede,
html[data-theme="light"] .hero-panel,
html[data-theme="light"] .site-footer,
html[data-theme="light"] .auth-visual p,
html[data-theme="light"] .auth-screen small {
    color: var(--muted);
}

html[data-theme="light"] .hero-panel {
    background: rgba(255, 255, 255, .84);
    border-color: rgba(0, 102, 184, .12);
}

html[data-theme="light"] .site-footer {
    border-top-color: var(--line);
}

html[data-theme="light"] .site .btn-outline-light {
    border-color: rgba(0, 102, 184, .22);
    color: var(--gold-deep);
}

html[data-theme="light"] .site .btn-outline-light:hover {
    background: #fff;
    color: var(--text);
}

html[data-theme="light"] .auth-screen {
    background: var(--cream);
}

html[data-theme="light"] .auth-visual {
    color: var(--text);
    background:
        radial-gradient(900px 500px at 10% 15%, rgba(0, 102, 184, .14), transparent 55%),
        radial-gradient(700px 400px at 90% 90%, rgba(232, 16, 56, .1), transparent 50%),
        #eef5fb;
}

html[data-theme="light"] .auth-brand,
html[data-theme="light"] .auth-visual h1 {
    color: var(--text);
}

html[data-theme="light"] .auth-panel {
    background: #ffffff;
}

/* ---------- Responsive ---------- */

/* Tablet and below */
@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100%;
    }

    .auth-visual {
        padding: 1.5rem;
    }

    .auth-visual-inner {
        gap: 1rem;
    }

    .auth-visual h1 {
        margin: 1rem 0 .5rem;
        font-size: clamp(1.7rem, 6vw, 2.4rem);
        max-width: 20ch;
    }

    .auth-visual p {
        max-width: 46ch;
        font-size: .98rem;
    }

    .auth-orb {
        display: none;
    }

    .auth-panel {
        padding: 2rem 1.25rem 2.5rem;
    }

    .content-header .btn-toolbar {
        margin-top: .75rem;
        width: 100%;
    }

    .step-rail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero {
        padding: 3.5rem 0 3rem;
    }

    .site-section {
        padding: 3.5rem 0;
    }

    /* AdminLTE's tap-to-close overlay is nearly invisible by default */
    .lms-app #sidebar-overlay {
        background: rgba(10, 10, 10, .45);
    }
}

/* Phones */
@media (max-width: 767.98px) {
    .lms-app .content-header {
        padding: 1rem .25rem .25rem;
    }

    .lms-app .content-header h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .lms-app .content-header .btn-toolbar {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .lms-app .content-header .btn-toolbar > * {
        flex: 1 1 auto;
        margin: 0 !important;
    }

    .lms-app .content-header .btn-toolbar .btn {
        width: 100%;
    }

    /* Inputs at 16px stop iOS from zooming on focus */
    .lms-app .form-control,
    .lms-app .custom-select,
    .auth-screen .form-control,
    .site .form-control {
        font-size: 16px;
    }

    /* Filter bars stack instead of squeezing */
    .lms-app .card-header .form-inline {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .lms-app .card-header .form-inline > * {
        width: 100%;
        margin-right: 0 !important;
    }

    /* Tables scroll instead of collapsing */
    .lms-app .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
    }

    .lms-app .table td,
    .lms-app .table th {
        padding: .6rem .55rem;
        font-size: .92rem;
    }

    /* Headers and action buttons stay on one line, so a wide table widens
       its scroll container instead of crushing every column. */
    .lms-app .table thead th {
        white-space: nowrap;
    }

    .lms-app .table td.table-actions {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .lms-app .table td .progress {
        min-width: 90px;
    }

    .kpi-card {
        min-height: 108px;
        padding: 1rem 1rem .9rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .kpi-card h3 {
        font-size: 1.5rem;
    }

    .kpi-card .kpi-label {
        font-size: .75rem;
    }

    .kpi-card .kpi-icon {
        font-size: 1.5rem;
        right: .7rem;
        bottom: .5rem;
    }

    /* Let the next step peek so the row reads as scrollable */
    .lms-stepper {
        gap: .6rem;
        padding-right: 1.25rem;
    }

    .lms-stepper-path {
        padding-right: 0;
    }

    .lms-step {
        min-width: 78%;
        flex: 0 0 78%;
    }

    .lms-stepper-path .lms-step {
        min-width: 0;
        flex: 0 0 auto;
        width: 100%;
    }

    .learn-course-hero {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .learn-course-hero-media {
        min-height: 180px;
    }

    .lms-app .card {
        border-radius: 14px;
    }

    .lms-app .card-body {
        padding: 1rem;
    }

    .lms-app .btn {
        padding: .5rem 1rem;
    }

    .table-actions .btn {
        min-height: 34px;
    }

    .lms-app .pagination {
        flex-wrap: wrap;
        gap: .25rem;
    }

    .lms-app .main-header .navbar-nav .nav-link {
        padding: .5rem .65rem;
    }

    .lms-app .dropdown-menu {
        min-width: 220px;
    }

    .pdf-frame {
        min-height: 60vh;
    }

    .course-thumb {
        height: 190px;
    }

    .certificate-sheet {
        border-width: 8px;
        padding: 1.5rem 1rem;
    }

    .certificate-sheet h1 {
        font-size: 1.5rem;
        letter-spacing: .05em;
    }

    .certificate-sheet h2 {
        font-size: 1.35rem;
    }

    .certificate-sheet h3 {
        font-size: 1.1rem;
    }

    .certificate-logo {
        height: 58px;
        margin-bottom: .75rem;
    }

    .lms-pagination {
        justify-content: center;
    }

    .lms-pagination-meta {
        width: 100%;
        text-align: center;
        order: 2;
    }

    .file-drop {
        padding: .7rem .75rem;
        gap: .7rem;
    }

    .file-drop-thumb {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 1rem;
    }

    .file-drop-cta {
        padding: .24rem .7rem;
        font-size: .72rem;
    }

    .main-footer {
        font-size: .8rem;
        text-align: center;
    }

    /* Landing */
    .site-nav .navbar-collapse {
        background: rgba(10, 10, 10, .96);
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 16px;
        margin-top: .75rem;
        padding: .75rem;
    }

    .site-nav .navbar-collapse .nav-link {
        padding: .6rem .25rem;
    }

    .site-nav .navbar-collapse .btn {
        display: block;
        width: 100%;
        margin-top: .5rem;
    }

    .hero {
        padding: 2.75rem 0 2.5rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 2.9rem);
        max-width: 18ch;
    }

    .hero .lede {
        font-size: 1.02rem;
        max-width: none;
    }

    .hero .btn,
    .hero .btn-lg {
        width: 100%;
        margin-right: 0 !important;
    }

    .hero-panel {
        padding: 1.1rem 1.15rem;
        border-radius: 18px;
        word-break: break-word;
    }

    .feature-card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .site-footer {
        text-align: center;
    }

    .site-footer .container > span + span {
        margin-top: .5rem;
    }

    /* Auth */
    .auth-visual {
        padding: 1.5rem 1.25rem;
    }

    .auth-visual-inner {
        gap: .75rem;
    }

    .auth-visual h1 {
        font-size: 1.65rem;
        margin: .75rem 0 .4rem;
    }

    .auth-visual p {
        font-size: .93rem;
    }

    .auth-visual small {
        display: none;
    }

    .auth-card {
        width: 100%;
    }

    .auth-card h2 {
        font-size: 1.7rem;
    }

    .auth-logo {
        height: 60px;
    }

    .field .toggle-pass {
        top: 34px;
        padding: .25rem .35rem;
    }

    .demo-pills button {
        flex: 1 1 auto;
        min-height: 36px;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .lms-app .content-header h1 {
        font-size: 1.3rem;
    }

    .kpi-card h3 {
        font-size: 1.3rem;
    }

    .lms-step {
        min-width: 86%;
        flex: 0 0 86%;
    }

    .brand-logo {
        height: 36px;
    }

    .nav-logo {
        height: 34px;
    }

    .header-logo {
        height: 28px;
    }

    .certificate-sheet {
        border-width: 6px;
        padding: 1.1rem .75rem;
    }
}

/* Short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
    .auth-visual {
        display: none;
    }

    .auth-panel {
        padding: 1.5rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    .main-header,
    .main-sidebar,
    .main-footer,
    .content-header,
    .no-print,
    .alert {
        display: none !important;
    }

    .content-wrapper,
    .main-footer {
        margin-left: 0 !important;
    }
}
