/* ==========================================================================
   LMS design system
   Sits on top of Bootstrap 5.3 — Bootstrap's grid, utilities, modals and
   dropdowns are kept; colors, type and components are restyled here.
   Rebrand by changing the --brand* tokens below.
   ========================================================================== */

:root {
    --brand: #16a34a;           /* Main green (buttons, links) */
    --brand-rgb: 22, 163, 74;   /* RGB version for shadows/opacity */
    --brand-600: #15803d;       /* Hover state (dark green) */
    --brand-700: #166534;       /* Active state (darker green) */
    --brand-50: #f0fdf4;        /* Light background tint */
    --brand-100: #dcfce7;       /* Slightly darker tint */

    --ink: #12142b;
    --ink-2: #41455e;
    --muted: #6e7391;
    --faint: #9aa0b8;
    --line: #e6e7ef;
    --line-2: #f0f1f6;
    --bg: #f6f7fb;
    --surface: #ffffff;

    --success: #12804a;
    --success-solid: #22c55e;
    --success-bg: #e8f7ee;
    --warning: #8f5b00;
    --warning-solid: #f59e0b;
    --warning-bg: #fff4dc;
    --danger: #c3343a;
    --danger-solid: #e5484d;
    --danger-bg: #fdeded;
    --info: #0a6aa8;
    --info-bg: #e6f2fb;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(18, 20, 43, .05);
    --shadow: 0 1px 3px rgba(18, 20, 43, .06), 0 8px 20px -10px rgba(18, 20, 43, .14);
    --shadow-lg: 0 18px 50px -16px rgba(18, 20, 43, .30);

    --sidebar-w: 254px;
    --topbar-h: 54px;

    /* Bootstrap bridge */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-success-rgb: 22, 163, 74;
    --bs-danger-rgb: 229, 72, 77;
    --bs-warning-rgb: 245, 158, 11;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ink);
    --bs-body-bg: #fff;           /* components (cards, inputs, menus) stay white; the page itself uses --bg */
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--muted);
    --bs-heading-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius);
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 75, 60, 224;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 61, 48, 189;
    --bs-focus-ring-color: rgba(var(--brand-rgb), .22);
}

body {
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .sb-link:hover, .course-card:hover, .inbox-item:hover, .pn-item:hover,
.dropdown-item:hover, .nav-link:hover, .stretched-link:hover, .cur-title:hover, .choice:hover, .list-group-item:hover { text-decoration: none; }

.text-muted { color: var(--muted) !important; }
.text-ink { color: var(--ink) !important; }
.text-brand { color: var(--brand) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.small-caps { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.min-w-0 { min-width: 0; }
.mw-prose { max-width: 720px; }
.mw-form { max-width: 680px; }

/* ---------- App shell -------------------------------------------------- */

.app { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .25s ease;
}

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 32px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.app-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px 56px;
    flex: 1;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 20, 43, .4);
    z-index: 1040;
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 0 16px; }
    .app-content { padding: 20px 16px 48px; }
}

/* Brand */

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.05rem;
    background: linear-gradient(135deg, #8577ff 0%, var(--brand-600) 100%);
    box-shadow: 0 6px 14px -4px rgba(var(--brand-rgb), .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* Sidebar nav */
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.sb-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    padding: 18px 12px 6px;
}
.sb-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-weight: 500;
    font-size: .9rem;
    transition: background .12s, color .12s;
}
.sb-link > i { font-size: 1.1rem; width: 20px; text-align: center; color: #8b91aa; transition: color .12s; }
.sb-link:hover { background: var(--line-2); color: var(--ink); }
.sb-link:hover > i { color: var(--ink-2); }
.sb-link.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.sb-link.active > i { color: var(--brand); }
.sb-link.sub { padding: 6px 12px 6px 44px; font-size: .84rem; color: var(--muted); }
.sb-link.sub:hover { color: var(--ink); }
.sb-count {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--danger-solid);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.6;
}

.sb-foot { flex-shrink: 0; border-top: 1px solid var(--line); padding: 12px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.sb-user-name { font-weight: 600; font-size: .875rem; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: .75rem; color: var(--muted); text-transform: capitalize; }

/* Top bar */
.topbar-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .875rem; color: var(--muted); }
.topbar-crumbs a { color: var(--muted); }
.topbar-crumbs a:hover { color: var(--ink); text-decoration: none; }
.topbar-crumbs .sep { color: #c5c9d8; font-size: .7rem; }
.topbar-crumbs .current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    color: var(--ink-2);
    font-size: 1.15rem;
    border: 1px solid transparent;
    background: transparent;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn .dot-count {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger-solid);
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ---------- Page header ------------------------------------------------ */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-title { font-size: 1.625rem; font-weight: 750; letter-spacing: -.025em; margin: 0; line-height: 1.2; }
.page-sub { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 6px;
}
.back-link { display: flex; width: fit-content; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- Cards ------------------------------------------------------ */

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .875rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 650;
    border-bottom-color: var(--line);
}
.card-header .card-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-header .card-title i { color: var(--brand); }
.card-footer { background: #fbfbfd; border-top-color: var(--line); }
.card-flush { overflow: hidden; }
.card-hint { padding: 10px 20px; border-top: 1px solid var(--line-2); background: #fbfbfd; color: var(--muted); font-size: .8125rem; display: flex; gap: 8px; align-items: center; }
.count-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--line-2);
    color: var(--ink-2);
    font-size: .75rem;
    font-weight: 600;
}

/* ---------- Buttons ---------------------------------------------------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: .875rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-border-radius: var(--radius-sm);
    --bs-btn-focus-box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    white-space: nowrap;
}
.btn-sm { --bs-btn-font-size: .8125rem; --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .32rem; --bs-btn-border-radius: 7px; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .72rem; --bs-btn-border-radius: 10px; }
.btn > i { font-size: 1.05em; line-height: 1; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(var(--brand-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: rgba(var(--brand-rgb), .32);
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-border-color: rgba(var(--brand-rgb), .5);
    --bs-btn-active-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-border-color: rgba(var(--brand-rgb), .5);
}
.btn-soft {
    --bs-btn-color: var(--brand-700);
    --bs-btn-bg: var(--brand-50);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-100);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-border-color: transparent;
}
.btn-outline-secondary, .btn-white {
    --bs-btn-color: var(--ink-2);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #dddfe9;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: #f7f8fb;
    --bs-btn-hover-border-color: #cfd2df;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: #eef0f5;
    --bs-btn-active-border-color: #cfd2df;
    --bs-btn-disabled-color: var(--muted);
    --bs-btn-disabled-bg: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-success {
    --bs-btn-bg: var(--success-solid);
    --bs-btn-border-color: var(--success-solid);
    --bs-btn-hover-bg: #12913f;
    --bs-btn-hover-border-color: #12913f;
    --bs-btn-active-bg: #0f7d36;
    --bs-btn-active-border-color: #0f7d36;
    --bs-btn-disabled-bg: var(--success-solid);
    --bs-btn-disabled-border-color: var(--success-solid);
    box-shadow: 0 1px 2px rgba(22, 163, 74, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-outline-success {
    --bs-btn-color: var(--success);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #b9e3ca;
    --bs-btn-hover-color: var(--success);
    --bs-btn-hover-bg: var(--success-bg);
    --bs-btn-hover-border-color: #94d3ae;
    --bs-btn-active-color: var(--success);
    --bs-btn-active-bg: #d6f0e1;
    --bs-btn-active-border-color: #94d3ae;
}
.btn-danger {
    --bs-btn-bg: var(--danger-solid);
    --bs-btn-border-color: var(--danger-solid);
    --bs-btn-hover-bg: #d63c41;
    --bs-btn-hover-border-color: #d63c41;
    --bs-btn-active-bg: #c3343a;
    --bs-btn-active-border-color: #c3343a;
}
.btn-outline-danger {
    --bs-btn-color: var(--danger);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #f1c9cb;
    --bs-btn-hover-color: var(--danger);
    --bs-btn-hover-bg: var(--danger-bg);
    --bs-btn-hover-border-color: #e9a9ac;
    --bs-btn-active-color: var(--danger);
    --bs-btn-active-bg: #fbdcdd;
    --bs-btn-active-border-color: #e9a9ac;
}
.btn-ghost {
    --bs-btn-color: var(--ink-2);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--line-2);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--line);
    --bs-btn-active-border-color: transparent;
}
.btn-ghost-danger {
    --bs-btn-color: var(--muted);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--danger);
    --bs-btn-hover-bg: var(--danger-bg);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--danger);
    --bs-btn-active-bg: #fbdcdd;
    --bs-btn-active-border-color: transparent;
}
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-sm.btn-icon { width: 31px; height: 31px; }
.btn-link { --bs-btn-font-weight: 600; }

/* ---------- Forms ------------------------------------------------------ */

.form-label { font-weight: 600; font-size: .875rem; color: var(--ink); margin-bottom: 6px; }
.form-label .opt { font-weight: 500; color: var(--muted); }
.form-control, .form-select {
    border-color: #dcdee9;
    border-radius: var(--radius-sm);
    padding: .56rem .85rem;
    font-size: .9375rem;
    color: var(--ink);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color .12s, box-shadow .12s;
}
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { padding: .34rem .65rem; font-size: .84rem; border-radius: 7px; }
.form-control::placeholder { color: #a6abc0; }
.form-control:focus, .form-select:focus {
    border-color: rgba(var(--brand-rgb), .65);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .13);
}
.form-control[type="file"] { padding: .45rem; border-style: dashed; background: #fbfbfe; cursor: pointer; }
.form-control[type="file"]::file-selector-button {
    margin: -.45rem .75rem -.45rem -.45rem;
    padding: .56rem .9rem;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
}
.form-control-sm[type="file"]::file-selector-button { padding: .34rem .7rem; }
.form-control[type="file"]:hover:not(:disabled):not([readonly])::file-selector-button { background: var(--brand-100); }
.form-text { color: var(--muted); font-size: .8125rem; margin-top: 6px; }
.form-check-input { border-color: #c9ccda; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: rgba(var(--brand-rgb), .65); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .13); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; margin-top: .1em; }
.form-switch .form-check-input:focus:not(:checked) { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238577ff'/%3e%3c/svg%3e"); }
.input-group-text { background: var(--line-2); border-color: #dcdee9; color: var(--ink-2); font-size: .875rem; }

.form-section { padding: 24px; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; }
.form-section-title { font-weight: 700; font-size: .95rem; margin-bottom: 2px; }
.form-section-desc { color: var(--muted); font-size: .84rem; margin-bottom: 16px; }

/* Selectable option cards (radio / checkbox) */
.choice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.choice:hover { border-color: #cdd0de; }
.choice .form-check-input { margin: 2px 0 0; flex-shrink: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .1); }
.choice-title { font-weight: 600; font-size: .9rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.choice-desc { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.choice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); font-size: 1.1rem; flex-shrink: 0; }
.choice:has(input:checked) .choice-icon { background: #fff; color: var(--brand); }

/* ---------- Tables ----------------------------------------------------- */

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line-2);
    --bs-table-hover-bg: #fafaff;
    margin-bottom: 0;
    font-size: .9rem;
}
.table > thead th {
    padding: 10px 16px;
    background: #fafbfd;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table > tbody > tr > td { padding: 13px 16px; vertical-align: middle; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions form { display: inline; }
.card > .table-responsive > .table > thead th:first-child, .card > .table > thead th:first-child { padding-left: 20px; }
.card > .table-responsive > .table > tbody td:first-child, .card > .table > tbody td:first-child { padding-left: 20px; }
.card > .table-responsive > .table > thead th:last-child, .card > .table > thead th:last-child { padding-right: 20px; }
.card > .table-responsive > .table > tbody td:last-child, .card > .table > tbody td:last-child { padding-right: 20px; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-name { font-weight: 600; color: var(--ink); line-height: 1.25; }
a.person-name:hover { color: var(--brand-600); }
.person-sub { color: var(--muted); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Pills / badges -------------------------------------------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .62rem;
    border-radius: 999px;
    background: var(--line-2);
    color: var(--ink-2);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
    vertical-align: middle;
}
.pill > i { font-size: .8rem; }
.pill-brand { background: var(--brand-50); color: var(--brand-700); }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-dark { background: rgba(18, 20, 43, .72); color: #fff; backdrop-filter: blur(6px); }
.pill-light { background: rgba(255, 255, 255, .92); color: var(--ink); }
.pill-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Legacy Bootstrap badges (e.g. messages printed from includes/auth.php) */
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }
.badge.bg-success { background: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-danger { background: var(--danger-solid) !important; color: #fff !important; }
.badge.bg-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-primary { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.badge.bg-info { background: var(--info-bg) !important; color: var(--info) !important; }
.badge.bg-secondary { background: var(--line-2) !important; color: var(--ink-2) !important; }

/* ---------- Alerts ----------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .9rem;
    border: 1px solid transparent;
}
.alert > i:first-child { font-size: 1.05rem; line-height: 1.35; flex-shrink: 0; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close { padding: 1rem; font-size: .7rem; }
.alert-success { background: var(--success-bg); border-color: #c4e8d3; color: #0d5e36; }
.alert-danger { background: var(--danger-bg); border-color: #f5cdcf; color: #8f2328; }
.alert-warning { background: var(--warning-bg); border-color: #f6dfa6; color: #6e4600; }
.alert-info { background: var(--info-bg); border-color: #c4dff2; color: #0a4f7d; }
.alert-secondary { background: var(--line-2); border-color: var(--line); color: var(--ink-2); }
.alert .alert-link { font-weight: 700; }
.flash { margin-bottom: 20px; box-shadow: var(--shadow-sm); }

/* ---------- Progress --------------------------------------------------- */

.progress {
    --bs-progress-height: 8px;
    --bs-progress-bg: #eceef5;
    --bs-progress-border-radius: 999px;
    --bs-progress-bar-bg: var(--brand);
}
.progress-bar { border-radius: 999px; }
.progress-sm { --bs-progress-height: 6px; }
.progress-lg { --bs-progress-height: 10px; }
.progress.is-complete { --bs-progress-bar-bg: var(--success-solid); }

.ring {
    --p: 0;
    --c: var(--brand);
    --size: 116px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), #eceef5 0);
}
.ring::before { content: ''; grid-area: 1 / 1; width: calc(var(--size) - 18px); height: calc(var(--size) - 18px); border-radius: 50%; background: #fff; }
.ring > * { grid-area: 1 / 1; position: relative; text-align: center; }
.ring-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring-label { font-size: .7rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.ring-sm { --size: 52px; }
.ring-sm::before { width: 42px; height: 42px; }
.ring-sm .ring-value { font-size: .78rem; }

/* ---------- Avatars ---------------------------------------------------- */

.avatar {
    --size: 36px;
    --h: 250;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    background: hsl(var(--h) 80% 93%);
    color: hsl(var(--h) 50% 34%);
    font-weight: 700;
    font-size: calc(var(--size) * .38);
    letter-spacing: .01em;
    user-select: none;
}
.avatar-xs { --size: 24px; }
.avatar-sm { --size: 30px; }
.avatar-lg { --size: 48px; }
.avatar-xl { --size: 84px; box-shadow: 0 0 0 4px #fff, var(--shadow); }

/* ---------- Stats ------------------------------------------------------ */

.stat {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.3rem;
    background: var(--brand-50);
    color: var(--brand);
}
.stat-icon.green { background: var(--success-bg); color: var(--success-solid); }
.stat-icon.amber { background: var(--warning-bg); color: #d98a00; }
.stat-icon.sky { background: var(--info-bg); color: #0b84d6; }
.stat-icon.rose { background: var(--danger-bg); color: var(--danger-solid); }
.stat-value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 500; }

/* ---------- Course covers & cards ------------------------------------- */

.cover {
    --g: linear-gradient(135deg, #8577ff, #4b3ce0);
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--g);
    color: #fff;
    isolation: isolate;
}
.cover::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .22) 0 2px, transparent 3px) 0 0 / 22px 22px,
        radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .28), transparent 55%);
    opacity: .6;
}
.cover.has-image::before { display: none; }
.stage-image { display: flex; justify-content: center; padding: 16px; }
.stage-image img { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; }
.cover-tl { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.cover-tr { position: absolute; top: 12px; right: 12px; }

.course-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dcdee9; }
.cc-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.cc-title { margin: 0; font-size: 1.04rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.cc-title a { color: var(--ink); }
.cc-desc { color: var(--muted); font-size: .86rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; margin-top: auto; padding-top: 6px; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: .84rem; }
.cc-progress { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 6px; }
.cc-progress-row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 500; }
.cc-progress-row strong { color: var(--ink); font-weight: 700; }

/* ---------- Course hero ------------------------------------------------ */

/* ---------- Course hero ------------------------------------------------ */

.course-hero {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr); 
    align-items: stretch;          /* dono columns ki height same rahe */
    overflow: hidden;              /* cover ka overflow clip ho */
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Cover ko grid cell ke andar fill karo — aspect-ratio hata do */
/* Cover ko grid cell ke andar fill karo — aspect-ratio hata do */
.course-hero .cover {
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    background-size: contain; /* Image poori dikhegi */
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff; /* Khali jagah white dikhegi */
}
.course-hero-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    /* text kabhi cover ke upar na aaye */
    position: relative;
    z-index: 1;
}

/* Mobile: single column */
@media (max-width: 991.98px) {
    .course-hero {
        grid-template-columns: 1fr;
    }
    .course-hero .cover {
        aspect-ratio: 16 / 6;      /* mobile pe wide banner */
        height: auto;
    }
}
.course-hero-title { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 0; }
.course-hero-desc { color: var(--ink-2); margin: 0; max-width: 760px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: .875rem; }
.meta-row > span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row i { color: var(--faint); }
.hero-progress { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 12px; background: #f8f9fc; border: 1px solid var(--line-2); }

/* ---------- Tabs ------------------------------------------------------- */

.tabs-line {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}
.tabs-line .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    padding: 11px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--muted);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}
.tabs-line .nav-link:hover { color: var(--ink); }
.tabs-line .nav-link.active { color: var(--brand-700); border-bottom-color: var(--brand); }
.tabs-line .nav-link .count-chip { font-size: .7rem; }
.tabs-line .nav-link.active .count-chip { background: var(--brand-50); color: var(--brand-700); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #eef0f5; }
.segmented a, .segmented button, .segmented label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
}
.segmented a:hover, .segmented button:hover, .segmented label:hover { color: var(--ink); text-decoration: none; }
.segmented .active, .segmented input:checked + label { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Curriculum / list rows ------------------------------------ */

.curriculum { list-style: none; margin: 0; padding: 0; }
.cur-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-2); transition: background .12s; }
.cur-item:first-child { border-top: 0; }
.cur-item:hover { background: #fbfbfe; }
.cur-status {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--brand-50);
    color: var(--brand);
    font-size: .95rem;
}
.cur-status.done { background: var(--success-bg); color: var(--success-solid); }
.cur-status.locked { background: #f1f2f6; color: #a8adc2; }
.cur-status.next { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.cur-status.neutral { background: var(--line-2); color: var(--ink-2); }
.cur-main { flex: 1; min-width: 0; }
.cur-title { font-weight: 600; color: var(--ink); }
a.cur-title:hover { color: var(--brand-600); }
.cur-item.is-locked .cur-title { color: #a2a7bc; }
.cur-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 3px; color: var(--muted); font-size: .8rem; }
.cur-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.cur-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cur-actions form { display: inline; margin: 0; }
@media (min-width: 768px) { .cur-actions.fixed { min-width: 250px; justify-content: flex-end; } }
.cur-num { font-size: .72rem; font-weight: 700; color: var(--faint); letter-spacing: .04em; }
@media (max-width: 575.98px) {
    .cur-item { flex-wrap: wrap; }
    .cur-actions { width: 100%; padding-left: 48px; flex-wrap: wrap; }
}

/* ---------- Empty states ---------------------------------------------- */

.empty { text-align: center; padding: 44px 20px; }
.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: var(--brand-50);
    color: var(--brand);
}
.empty-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.empty-text { color: var(--muted); font-size: .9rem; max-width: 440px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }
.empty-sm { padding: 24px 16px; }
.empty-sm .empty-icon { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 12px; margin-bottom: 10px; }

/* ---------- Definition list ------------------------------------------- */

.dl-grid { display: grid; grid-template-columns: 180px 1fr; gap: 0; margin: 0; }
.dl-grid dt, .dl-grid dd { padding: 12px 0; border-top: 1px solid var(--line-2); margin: 0; }
.dl-grid dt:first-of-type, .dl-grid dd:first-of-type { border-top: 0; }
.dl-grid dt { color: var(--muted); font-weight: 500; font-size: .875rem; }
.dl-grid dd { color: var(--ink); }
@media (max-width: 575.98px) {
    .dl-grid { grid-template-columns: 1fr; }
    .dl-grid dd { border-top: 0; padding-top: 0; }
}

/* ---------- Toolbar / filters ----------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search-box { position: relative; min-width: 240px; }
.search-box > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box .form-control { padding-left: 36px; }

/* ---------- Messaging -------------------------------------------------- */

.inbox-item { display: flex; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line-2); color: inherit; transition: background .12s; }
.inbox-item:first-child { border-top: 0; }
.inbox-item:hover { background: #fbfbfe; color: inherit; }
.inbox-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.inbox-subject { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.unread .inbox-subject { font-weight: 750; }
.inbox-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.inbox-meta { color: var(--muted); font-size: .8125rem; margin-top: 1px; }
.inbox-preview { color: var(--ink-2); font-size: .875rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); display: inline-block; flex-shrink: 0; }

.chat { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; align-items: flex-end; gap: 10px; max-width: 78%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); font-size: .75rem; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta strong { color: var(--ink-2); font-weight: 600; }
.bubble {
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.msg.mine .bubble { background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px; }
.composer { position: sticky; bottom: 16px; }
@media (max-width: 575.98px) { .msg { max-width: 92%; } }

/* ---------- Q&A -------------------------------------------------------- */

.qa-item { padding: 18px 20px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.qa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qa-quote { margin: 10px 0; padding: 6px 0 6px 14px; border-left: 3px solid var(--brand-100); color: var(--muted); font-style: italic; }
.qa-answer { display: flex; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f8f9fc; border: 1px solid var(--line-2); }

/* ---------- Quizzes ------------------------------------------------------ */

.q-num {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 700;
    font-size: .85rem;
}
.option-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.option-tile:hover { border-color: #cdd0de; background: #fbfbfe; }
.option-tile .form-check-input { margin: 0; flex-shrink: 0; }
.option-tile:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.option-tile:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.option-result { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.option-result.correct { border-color: #b9e3ca; background: var(--success-bg); }
.option-result.wrong { border-color: #f1c9cb; background: var(--danger-bg); }
.option-result > i { font-size: 1.05rem; }
.option-result.correct > i { color: var(--success-solid); }
.option-result.wrong > i { color: var(--danger-solid); }
.timer-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 750;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}
.timer-chip.is-low { background: var(--danger-bg); color: var(--danger); }
.q-timer { font-variant-numeric: tabular-nums; }
.q-timer.is-low { background: var(--danger-bg); color: var(--danger); }
.sticky-bar {
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Rich text / prose ----------------------------------------- */

.prose { font-size: 1.02rem; line-height: 1.75; color: #2b2f45; overflow-wrap: anywhere; }
.prose p:last-child { margin-bottom: 0; }
.prose blockquote { border-left: 3px solid var(--brand-100); padding-left: 14px; color: var(--muted); }
.rich-editor { border-color: #dcdee9 !important; border-radius: var(--radius-sm) !important; overflow: hidden; box-shadow: var(--shadow-sm); }
.rich-editor .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); background: #fafbfd; font-family: inherit; }
.rich-editor .ql-container.ql-snow { border: 0; font-family: inherit; font-size: .95rem; }
.rich-editor .ql-editor { min-height: 170px; background: #fff; }
.rich-editor .ql-editor.ql-blank::before { color: #a6abc0; font-style: normal; }

/* ---------- File rows -------------------------------------------------- */

.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.file-row:first-child { border-top: 0; }
.file-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--danger-bg); color: var(--danger-solid); font-size: 1.1rem; }
.file-icon.doc { background: var(--info-bg); color: #0b84d6; }
.file-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.file-actions form { display: inline; }

/* ---------- Modals & dropdowns ---------------------------------------- */

.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom-color: var(--line); }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top-color: var(--line); background: #fbfbfd; }
.modal-backdrop.show { opacity: .45; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--danger-bg); color: var(--danger-solid); flex-shrink: 0; }
.confirm-icon.primary { background: var(--brand-50); color: var(--brand); }

.dropdown-menu {
    --bs-dropdown-border-color: var(--line);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-active-bg: var(--brand);
    --bs-dropdown-font-size: .875rem;
    padding: 6px;
    box-shadow: var(--shadow-lg);
}
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.dropdown-item > i { color: var(--muted); font-size: 1rem; }
.dropdown-item:hover > i, .dropdown-item:active > i { color: inherit; }
.dropdown-header { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }



/* ---------- Auth screens (split layout) -------------------------------- */

body.layout-auth { background: #fff; }

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Left: form column */
.auth-form-col {
    display: flex;
    flex-direction: column;
    padding: 48px 64px;
    box-sizing: border-box;
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 40px 0;
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
    color: var(--ink);
}
.auth-sub {
    color: #4B5A52;
    margin: 8px 0 0;
    font-size: 1.0625rem;
}
.auth .form-control {
    height: 54px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 16px;
}
.auth .form-control:focus {
    outline: 3px solid #22b052;
    outline-offset: 2px;
    border-color: #C9D3CD;
    box-shadow: none;
}
.auth .form-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}
.auth .input-group .btn {
    width: 56px;
    border-left: 1px solid #C9D3CD;
    background: #fff;
    border-color: #C9D3CD;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
}
.auth .input-group .form-control {
    border-radius: 12px 0 0 12px;
}
.auth .btn-primary.btn-lg {
    height: 56px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
}
.auth-foot {
    color: #5C6B63;
    font-size: 14px;
    margin-top: auto;
}

/* Right: green art panel (original dark green) */
.auth-art {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 48px 64px;
    color: #fff;
    background: linear-gradient(160deg, #0B3B24 0%, #126B3A 100%);
}

.auth-art-content {
    position: relative;
    z-index: 2;
}

.auth-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.auth-features span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.auth-art h2 {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    max-width: 560px;
    margin: 0;
    color: #fff;
}
.auth-art p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 520px;
    font-size: 18px;
    line-height: 1.5;
    margin: 28px 0 0;
}

/* Floating cards stack */
.mock-stack {
    position: relative;
    height: 440px;
    width: 100%;
    max-width: 560px;
    margin-top: auto;
    align-self: flex-end;
}

.mock-card {
    position: absolute;
    background: #fff;
    color: #0F1F17;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
    border: 0;
    margin-left: 80px;
}

/* Course card — aur chhota size */
.mock-course {
    left: 0;
    top: 70px;
    width: 300px;
    overflow: hidden;
    transform: rotate(-2deg);
    z-index: 2;
    margin-top: 33px
}
.mock-course .cover {
    aspect-ratio: 16 / 9;
    background: #E8F6EE;
    position: relative;
    overflow: hidden;
}
.mock-course .cover svg {
    display: block;
    width: 100%;
    height: 100%;
}
.mock-course-body {
    padding: 14px 16px 16px;
}

/* Certificate card */
.mock-cert {
    right: 0;
    top: 0;
    width: 240px;
    padding: 16px;
    transform: rotate(3deg);
    z-index: 3;
    border-radius: 18px;
}
.mock-cert .cert-seal {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5A623;
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 10px;
    box-shadow: none;
}

/* Next lesson card — thora upar, halka sa overlap (percentage bar visible) */
.mock-score {
    right: 10px;
    bottom: 20px;
    width: 320px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: rotate(-1deg);
    z-index: 5;
    border-radius: 18px;
}
.mock-score .mock-icon {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #E8F6EE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #126B3A;
    font-size: 1.4rem;
}

@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-form-col { padding: 32px 24px; }
}

/* ---------- Lesson player --------------------------------------------- */

body.layout-player { background: #fff; overflow: hidden; }
.player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.player-top {
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.player-course { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.player-course small { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.player-course strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.player-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.player-progress { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.player-progress .progress { width: 140px; }
.player-body { flex: 1; display: flex; min-height: 0; position: relative; }
.player-nav { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; background: #fafbfd; border-left: 1px solid var(--line); order: 2; }
.player-col { order: 1; }
.pn-head { padding: 18px 20px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.pn-list { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
.pn-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 20px 11px 17px; border-left: 3px solid transparent; color: var(--ink-2); font-size: .875rem; line-height: 1.4; }
.pn-item:hover { background: #f0f1f8; color: var(--ink); }
.pn-item.active { background: var(--brand-50); border-left-color: var(--brand); color: var(--brand-700); font-weight: 600; }
.pn-item.locked { color: #a8adc2; cursor: not-allowed; }
.pn-item.locked:hover { background: transparent; color: #a8adc2; }
.pn-status { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; font-size: .72rem; border: 1.5px solid #cdd0de; color: var(--muted); background: #fff; }
.pn-item.done .pn-status { background: var(--success-solid); border-color: var(--success-solid); color: #fff; }
.pn-item.active .pn-status { border-color: var(--brand); color: var(--brand); }
.pn-item.active.done .pn-status { border-color: var(--success-solid); color: #fff; }
.pn-item.locked .pn-status { border-color: #e1e3eb; background: #f3f4f8; color: #b3b8cb; }
.pn-meta { display: block; margin-top: 2px; font-size: .75rem; font-weight: 500; color: var(--muted); }
.pn-item.locked .pn-meta { color: #b9bdce; }
.player-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.player-scroll { flex: 1; overflow-y: auto; }
.player-stage { background: #0c0d1a; }
.player-stage-inner { max-width: min(1120px, calc(68vh * 16 / 9)); margin: 0 auto; }
.player-stage video { display: block; width: 100%; max-height: 68vh; background: #000; }
.player-content { max-width: 880px; margin: 0 auto; padding: 28px 28px 48px; }
.lesson-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 0; }
.player-bottom {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid var(--line);
}
.player-bottom .btn { max-width: 42vw; }
.player-bottom .btn span { overflow: hidden; text-overflow: ellipsis; }
.stage-switch { display: flex; justify-content: center; gap: 8px; padding: 10px; background: #0c0d1a; }
.stage-switch .btn { --bs-btn-color: rgba(255, 255, 255, .7); --bs-btn-bg: rgba(255, 255, 255, .06); --bs-btn-border-color: rgba(255, 255, 255, .12); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .12); --bs-btn-hover-border-color: rgba(255, 255, 255, .2); --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255, 255, 255, .18); --bs-btn-active-border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.stage-switch .btn.active { --bs-btn-bg: rgba(255, 255, 255, .18); --bs-btn-color: #fff; }
.player-backdrop { display: none; }
@media (max-width: 991.98px) {
    .player-nav { position: absolute; inset: 0 0 0 auto; z-index: 20; width: min(86vw, 340px); transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .player-nav { transform: none; }
    body.nav-open .player-backdrop { display: block; position: absolute; inset: 0; z-index: 15; background: rgba(18, 20, 43, .4); }
    .player-progress .progress { width: 80px; }
    .player-content { padding: 22px 16px 40px; }
}
@media (max-width: 575.98px) {
    .player-progress { display: none; }
}

/* ---------- Certificate list cards ------------------------------------ */

.cert-card { position: relative; overflow: hidden; padding: 22px; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.cert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cert-card::after { content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px; background: radial-gradient(circle at 100% 0, var(--brand-100), transparent 70%); }
.cert-seal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, #f7b733, #e8890c); box-shadow: 0 6px 14px -4px rgba(232, 137, 12, .6); margin-bottom: 14px; }

/* ---------- Attendance ------------------------------------------------- */

.att-toggle { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: #f1f2f6; }
.att-toggle .btn-check + label { padding: 5px 12px; border-radius: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.att-toggle .btn-check + label:hover { color: var(--ink); }
.att-toggle .btn-check:checked + label.present { background: var(--success-solid); color: #fff; }
.att-toggle .btn-check:checked + label.late { background: var(--warning-solid); color: #fff; }
.att-toggle .btn-check:checked + label.absent { background: var(--danger-solid); color: #fff; }
.att-toggle .btn-check:focus-visible + label { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .25); }
.att-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; }
.att-dot.present { background: var(--success-bg); color: var(--success); }
.att-dot.late { background: var(--warning-bg); color: var(--warning); }
.att-dot.absent { background: var(--danger-bg); color: var(--danger); }
.att-dot.none { color: #c5c9d8; }

/* ---------- Print ------------------------------------------------------ */

@media print {
    .app-sidebar, .app-topbar, .sidebar-backdrop, .no-print { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; max-width: none !important; }
    body { background: #fff !important; }
}

/* Strips default button chrome so a <button> can carry pill/badge styling and still be clickable (used by note timestamp "seek" pills). */
.btn-link-reset { background: none; padding: 0; appearance: none; }

/* ---------- Curriculum accordion (lesson player, right-hand panel) ---------- */
.pn-lesson { border-bottom: 1px solid var(--line); }
.pn-lesson-head, .pn-section-head {
    width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left;
    border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.pn-lesson-head { padding: 14px 18px 14px 17px; border-left: 3px solid transparent; font-size: .9rem; line-height: 1.4; }
.pn-lesson-head:hover:not(:disabled) { background: #f0f1f8; }
.pn-lesson.current > .pn-lesson-head { border-left-color: var(--brand); background: var(--brand-50); }
.pn-lesson.locked > .pn-lesson-head { color: #a8adc2; cursor: not-allowed; }
.pn-lesson-title, .pn-section-title { display: block; font-weight: 700; }
.pn-chev { margin-left: auto; flex-shrink: 0; margin-top: 4px; color: var(--muted); font-size: .8rem; transition: transform .2s ease; }
.pn-lesson.open > .pn-lesson-head .pn-chev,
.pn-section.open > .pn-section-head .pn-chev { transform: rotate(180deg); }
.pn-lesson.done .pn-status { background: var(--success-solid); border-color: var(--success-solid); color: #fff; }
.pn-lesson.current .pn-status { border-color: var(--brand); }
.pn-lesson.current.done .pn-status { border-color: var(--success-solid); }
.pn-lesson-body { display: none; background: #fff; border-top: 1px solid var(--line); }
.pn-lesson.open > .pn-lesson-body { display: block; }
.pn-empty { padding: 12px 20px 14px 52px; font-size: .82rem; color: var(--muted); }
.pn-section + .pn-section { border-top: 1px solid var(--line-2); }
.pn-section-head { padding: 11px 18px 11px 52px; font-size: .84rem; background: #fafbfd; }
.pn-section-head:hover { background: #f0f1f8; }
.pn-section-body { display: none; list-style: none; margin: 0; padding: 0; }
.pn-section.open > .pn-section-body { display: block; }
.pn-file {
    display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 18px 9px 52px;
    border: 0; border-left: 3px solid transparent; background: transparent; text-align: left;
    font-size: .84rem; line-height: 1.4; color: var(--ink-2); cursor: pointer;
}
.pn-file:hover { background: #f0f1f8; color: var(--ink); }
.pn-file.active { background: var(--brand-50); border-left-color: var(--brand); color: var(--brand-700); font-weight: 600; }
.pn-file > i { margin-top: 2px; flex-shrink: 0; }
.pn-file .pn-time { margin-left: auto; flex-shrink: 0; font-size: .75rem; font-weight: 500; color: var(--muted); }

/* Stage for PDFs and text (videos keep the dark stage) */
.player-stage.is-doc { background: #fff; border-bottom: 1px solid var(--line); }
.player-stage-inner.is-doc { max-width: none; }
.stage-pdf { display: block; width: 100%; height: 72vh; border: 0; }
.stage-text { max-height: 68vh; overflow: auto; padding: 28px clamp(18px, 4vw, 56px); line-height: 1.7; }
.stage-doc-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; background: #fafbfd; border-top: 1px solid var(--line); }
.now-playing { display: flex; align-items: center; gap: 8px; margin: -12px 0 20px; color: var(--muted); font-size: .875rem; }
.now-playing i { color: var(--brand); }

/* Long file names wrap inside their own space instead of running into the right-hand label */
.pn-file > .min-w-0 { flex: 1 1 auto; overflow-wrap: anywhere; }
.pn-file .pn-time { padding-left: 6px; }



/* ---------- Sentence case for all captions/headings ---------- */

/* Browsers jo text-transform: capitalize karte hain unke liye:
   we want ONLY first letter of the whole string uppercased. */

h1, h2, h3, h4, h5, h6,
.page-title,
.card-title,
.section-title,
.auth-title,
.course-hero-title,
.cc-title,
.cur-title,
.pn-lesson-title,
.pn-section-title,
.modal-title,
.eyebrow,
.small-caps,
.sb-label,
.inbox-subject,
.person-name,
.file-name,
.lesson-title,
.q-num + * .fw-600,   /* question text */
.sticky-bar h1 {
    text-transform: none;   /* remove any existing title-casing */
}

h1::first-letter, h2::first-letter, h3::first-letter, h4::first-letter,
h5::first-letter, h6::first-letter,
.page-title::first-letter,
.card-title::first-letter,
.section-title::first-letter,
.auth-title::first-letter,
.course-hero-title::first-letter,
.cc-title::first-letter,
.cur-title::first-letter,
.pn-lesson-title::first-letter,
.pn-section-title::first-letter,
.modal-title::first-letter,
.eyebrow::first-letter,
.small-caps::first-letter,
.inbox-subject::first-letter,
.person-name::first-letter,
.file-name::first-letter,
.lesson-title::first-letter {
    text-transform: uppercase;
}


/* Rich-text links inside lesson content should always be clickable */
.prose a,
.stage-text a,
#lesson-text a {
    pointer-events: auto !important;
    cursor: pointer;
    text-decoration: underline;
    color: var(--brand, #4b3ce0);
}



/* Brand Container (Logo + Text) */
.sb-brand {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline; /* Bottom alignment */
    justify-content: flex-start;
    padding: 12px 26px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    line-height: 1;
    gap: 0; /* Gap bilkul khatam kar diya */
}

.sb-brand:hover { color: var(--ink); text-decoration: none; }

/* Logo Wrapper */
.sb-brand-logo-wrap {
    width: 55px;   
    height: 25px;  
    flex-shrink: 0;
    display: flex;
    align-items: baseline; 
    justify-content: flex-start;
    transform: translateY(2px); 
    /* Image ke andar ki khali jagah ko khatam karne ke liye negative margin */
    margin-right: -18px; 
}

/* Logo Image */
.sb-brand-logo-wrap img {
    width: 100%;
    height: 90%;
    object-fit: contain;
    display: block;
    transform: none;
}

/* Brand Name (Text) */
.sb-brand-name {
    font-size: 1.18rem; 
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    line-height: 1;
    white-space: nowrap;
    display: inline-block; 
    margin: 0; 
    padding: 0;
    /* Agar text ko thora aur pass laana ho toh margin-left negative kar sakte hain */
}




.cert-sig-image {

    height: 70px;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-end;
}
.cert-sig-image img {
    max-height: 70px;
    max-width: 250px;
    object-fit: contain;
    filter: contrast(150%);
}



/* ============================================
   Auth pages — sidebar-style logo, centered & bigger
   ============================================ */
.auth .sb-brand {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline; /* Bottom alignment */
    justify-content: flex-start;
    padding: 12px 26px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    line-height: 1;
    gap: 0; /* Gap bilkul khatam kar diya */
}
.auth .sb-brand-logo-wrap {
    width: 75px;   
    height: 43px;  
    flex-shrink: 0;
    display: flex;
    align-items: baseline; 
    justify-content: flex-start;
    transform: translateY(2px); 
    /* Image ke andar ki khali jagah ko khatam karne ke liye negative margin */
    margin-right: -23px; 
}
.auth .sb-brand-name {
 font-size: 2.20rem; 
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    line-height: 1;
    white-space: nowrap;
    display: inline-block; 
    margin: 0; 
    padding: 0;
}

