/* ============================================================
   EduPlatform — Skillbox-inspired Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand:        #4361ee;
    --brand-dark:   #3a56d4;
    --brand-deeper: #2c44bc;
    --accent:       #f97316;
    --accent-dark:  #ea6c0b;
    --success:      #10b981;
    --danger:       #ef4444;
    --warning:      #f59e0b;
    --info:         #3b82f6;

    --dark:         #0f1117;
    --dark-2:       #1a1d2e;
    --dark-3:       #252840;
    --text:         #1e2432;
    --text-2:       #4b5563;
    --text-3:       #9ca3af;
    --bg:           #f4f6fb;
    --bg-2:         #edf0f7;
    --white:        #ffffff;
    --border:       #e5e8f0;

    --nav-h:        68px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    16px;
    --radius-xl:    24px;

    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:       0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg:    0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
    --shadow-brand: 0 8px 24px rgba(67,97,238,.3);

    --transition:   all .2s ease;
    --transition-s: all .15s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--nav-h);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: var(--brand); text-decoration: none; transition: var(--transition-s); }
a:hover { color: var(--brand-dark); }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: var(--dark-2) !important;
    height: var(--nav-h);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.navbar .nav-link {
    color: rgba(255,255,255,.75) !important;
    font-weight: 500;
    font-size: .9rem;
    padding: .4rem .8rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-s);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--white) !important;
    background: rgba(255,255,255,.08);
}

.navbar .btn-nav-outline {
    border: 1.5px solid rgba(255,255,255,.3);
    color: var(--white) !important;
    border-radius: var(--radius-sm);
    padding: .35rem 1rem;
    font-size: .88rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar .btn-nav-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,.1);
}

.navbar .btn-nav-fill {
    background: var(--brand);
    color: var(--white) !important;
    border-radius: var(--radius-sm);
    padding: .35rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.navbar .btn-nav-fill:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,.2);
    padding: .3rem .6rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── Dropdown ───────────────────────────────────────────── */
.dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .5rem;
    min-width: 200px;
    animation: dropIn .15s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: .55rem .9rem;
    font-size: .9rem;
    color: var(--text);
    transition: var(--transition-s);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.dropdown-item:hover { background: var(--bg); color: var(--brand); }
.dropdown-item i { width: 16px; text-align: center; }

.dropdown-divider { margin: .3rem 0; border-color: var(--border); }

/* ── Flash messages ─────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    width: calc(100% - 32px);
}

.alert {
    border: none;
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #eff6ff; color: #1e40af; }

/* ── Hero Section ───────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--dark-2) 0%, var(--dark-3) 50%, #1e2a5e 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
    margin: calc(-1 * var(--nav-h)) -15px 0;
    padding-top: calc(var(--nav-h) + 4rem);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(67,97,238,.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(249,115,22,.15) 0%, transparent 50%);
}

.hero .container { position: relative; z-index: 1; }

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -.5px;
}

.hero-title span { color: var(--accent); }

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,.75);
    max-width: 540px;
    margin-bottom: 2rem;
    line-height: 1.65;
}

.hero-search {
    max-width: 520px;
    position: relative;
}

.hero-search input {
    width: 100%;
    height: 52px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
    color: var(--white);
    padding: 0 140px 0 1.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

.hero-search input::placeholder { color: rgba(255,255,255,.5); }

.hero-search input:focus {
    outline: none;
    border-color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.15);
}

.hero-search .btn-search {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 42px;
    border-radius: 40px;
    background: var(--brand);
    color: var(--white);
    border: none;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: var(--transition);
}

.hero-search .btn-search:hover { background: var(--brand-dark); }

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.hero-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.hero-stat-label {
    font-size: .82rem;
    color: rgba(255,255,255,.6);
    margin-top: .2rem;
}

.hero-visual {
    position: relative;
}

.hero-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(8px);
    color: var(--white);
}

.hero-card-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--accent);
    color: var(--white);
    border-radius: 20px;
    padding: .25rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

/* ── Section Title ──────────────────────────────────────── */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.3px;
    margin-bottom: .5rem;
}

.section-subtitle {
    color: var(--text-2);
    font-size: .95rem;
    margin-bottom: 2rem;
}

.section-link {
    color: var(--brand);
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.section-link:hover { gap: .5rem; }

/* ── Category Pills ─────────────────────────────────────── */
.category-grid {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cat-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    border-radius: 50px;
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
}

.cat-pill i { font-size: 1rem; }

/* ── Course Cards ───────────────────────────────────────── */
.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.course-card-img {
    position: relative;
    height: 186px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deeper) 100%);
    flex-shrink: 0;
}

.course-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.course-card:hover .course-card-img img { transform: scale(1.04); }

.course-card-img .cat-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
}

.course-card-img .icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: rgba(255,255,255,.5);
}

.course-card-body {
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-card-category {
    font-size: .75rem;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .4rem;
}

.course-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: .4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-desc {
    font-size: .83rem;
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .75rem;
    flex: 1;
}

.course-card-teacher {
    font-size: .82rem;
    color: var(--text-3);
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.course-card-teacher-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.course-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .65rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.course-card-rating {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.stars { color: #f59e0b; font-size: .8rem; }

.rating-text {
    font-size: .78rem;
    color: var(--text-3);
    font-weight: 500;
}

.course-card-info {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: var(--text-3);
}

.course-card-footer {
    padding: .75rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ── Difficulty Badge ───────────────────────────────────── */
.badge-level {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-beginner     { background: #d1fae5; color: #065f46; }
.badge-intermediate { background: #fef3c7; color: #92400e; }
.badge-advanced     { background: #fee2e2; color: #991b1b; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: .9rem;
    letter-spacing: .1px;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand);
}

.btn-outline-primary {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-outline-primary:hover {
    background: var(--brand);
    color: var(--white);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: .35rem .85rem; font-size: .82rem; border-radius: 6px; }

/* ── Cards (generic) ────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--white);
    overflow: hidden;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
}

.stat-card .stat-icon { font-size: 2.2rem; opacity: .8; margin-bottom: .25rem; }
.stat-card .stat-number { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: .85rem; opacity: .8; margin-top: .25rem; }

.bg-gradient-1 { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.bg-gradient-2 { background: linear-gradient(135deg, #f72585, #b5179e); }
.bg-gradient-3 { background: linear-gradient(135deg, #4cc9f0, #4895ef); }
.bg-gradient-4 { background: linear-gradient(135deg, #10b981, #059669); }
.bg-gradient-5 { background: linear-gradient(135deg, #f97316, #ef4444); }
.bg-gradient-6 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.sidebar-header {
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, var(--dark-2), var(--dark-3));
    color: var(--white);
}

.sidebar-header h6 {
    font-weight: 700;
    margin: 0;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .6;
}

.sidebar-nav { padding: .5rem; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--text-2);
    font-size: .9rem;
    font-weight: 500;
    padding: .6rem .85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-s);
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 18px; text-align: center; }

.sidebar-nav .nav-link:hover {
    background: var(--bg);
    color: var(--brand);
}

.sidebar-nav .nav-link.active {
    background: rgba(67,97,238,.1);
    color: var(--brand);
    font-weight: 600;
}

.sidebar-nav .nav-link.text-danger:hover { background: #fef2f2; }

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: .4rem .85rem;
}

/* ── Dashboard ──────────────────────────────────────────── */
.dashboard-page {
    padding: 1.5rem 0;
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1, .page-header h2 {
    font-weight: 700;
    letter-spacing: -.3px;
}

.page-header .text-muted { font-size: .92rem; }

/* ── Charts ─────────────────────────────────────────────── */
.chart-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.chart-card-title {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Table ──────────────────────────────────────────────── */
.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.table-card-title {
    font-weight: 700;
    font-size: .95rem;
    margin: 0;
}

.table {
    margin: 0;
    font-size: .9rem;
}

.table thead th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-2);
    padding: .75rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.04);
    vertical-align: middle;
    color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr:hover { background: var(--bg); }

/* ── User avatar ────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-placeholder {
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-sm, .avatar-placeholder.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-md, .avatar-placeholder.avatar-md { width: 40px; height: 40px; font-size: .95rem; }
.avatar-lg, .avatar-placeholder.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl, .avatar-placeholder.avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

/* ── Progress ───────────────────────────────────────────── */
.progress {
    border-radius: 50px;
    background: var(--bg-2);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    border-radius: 50px;
    transition: width .6s ease;
}

.progress-bar.bg-success { background: var(--success) !important; }

/* ── Forms ──────────────────────────────────────────────── */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .9rem;
    font-size: .9rem;
    color: var(--text);
    background: var(--white);
    transition: var(--transition-s);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}

.form-label {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: .4rem;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.input-group-text {
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-2);
    font-size: .9rem;
}

/* ── Auth pages ─────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--dark-2) 0%, var(--dark-3) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: .35rem;
    letter-spacing: -.3px;
}

.auth-subtitle {
    color: var(--text-2);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
    font-size: .85rem;
    background: none;
    padding: 0;
    margin-bottom: 1.25rem;
}

.breadcrumb-item a { color: var(--brand); font-weight: 500; }
.breadcrumb-item.active { color: var(--text-2); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-3); }

/* ── Course detail ──────────────────────────────────────── */
.course-hero {
    background: linear-gradient(135deg, var(--dark-2), var(--dark-3));
    color: var(--white);
    padding: 2.5rem 0;
}

.course-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .85rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: .85rem;
}

.course-hero-badge.beginner     { background: rgba(16,185,129,.2); color: #6ee7b7; }
.course-hero-badge.intermediate { background: rgba(245,158,11,.2); color: #fcd34d; }
.course-hero-badge.advanced     { background: rgba(239,68,68,.2); color: #fca5a5; }

.course-hero-title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -.3px;
}

.course-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: .88rem;
    color: rgba(255,255,255,.7);
    margin-bottom: 1.5rem;
}

.course-hero-meta span { display: flex; align-items: center; gap: .4rem; }

/* Enrollment card */
.enroll-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.enroll-card-img {
    height: 180px;
    overflow: hidden;
}

.enroll-card-img img { width: 100%; height: 100%; object-fit: cover; }

.enroll-card-img .img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brand), var(--brand-deeper));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,.4);
}

.enroll-card-body { padding: 1.25rem; }

.enroll-features { list-style: none; padding: 0; margin: 1rem 0; }
.enroll-features li {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .4rem 0;
    font-size: .88rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}
.enroll-features li:last-child { border: none; }
.enroll-features li i { color: var(--brand); width: 16px; }

/* ── Lesson page ────────────────────────────────────────── */
.lesson-sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-height: calc(100vh - var(--nav-h) - 32px);
    overflow-y: auto;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.lesson-sidebar-header {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1rem;
    font-size: .85rem;
    color: var(--text-2);
    border-bottom: 1px solid rgba(0,0,0,.04);
    cursor: pointer;
    transition: var(--transition-s);
    text-decoration: none;
}

.lesson-item:hover { background: var(--bg); color: var(--brand); }
.lesson-item.active { background: rgba(67,97,238,.08); color: var(--brand); font-weight: 600; }
.lesson-item.completed { color: var(--success); }
.lesson-item .check-icon { font-size: .85rem; flex-shrink: 0; }

.module-label {
    padding: .55rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-3);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.lesson-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.lesson-content h1, .lesson-content h2, .lesson-content h3 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: .75rem;
}

.lesson-content pre {
    background: var(--dark);
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: .88rem;
    line-height: 1.6;
}

.lesson-content code {
    background: var(--bg-2);
    color: var(--brand);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .88em;
}

.lesson-content pre code { background: none; color: inherit; padding: 0; }

.lesson-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.lesson-content th { background: var(--bg); font-weight: 600; }
.lesson-content th, .lesson-content td {
    border: 1px solid var(--border);
    padding: .6rem .85rem;
    font-size: .88rem;
}

/* ── Quiz ───────────────────────────────────────────────── */
.quiz-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.quiz-question-num {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--brand);
    margin-bottom: .5rem;
}

.quiz-question-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    cursor: pointer;
    transition: var(--transition-s);
}

.answer-option:hover { border-color: var(--brand); background: rgba(67,97,238,.04); }
.answer-option.selected { border-color: var(--brand); background: rgba(67,97,238,.08); }
.answer-option.correct  { border-color: var(--success); background: rgba(16,185,129,.08); }
.answer-option.wrong    { border-color: var(--danger); background: rgba(239,68,68,.08); }

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] { cursor: pointer; }

/* Timer */
.quiz-timer {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.quiz-timer.danger { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Result */
.result-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    border: 6px solid;
}

.result-circle.passed  { color: var(--success); border-color: var(--success); background: rgba(16,185,129,.08); }
.result-circle.failed  { color: var(--danger);  border-color: var(--danger);  background: rgba(239,68,68,.08); }

/* ── Review stars ───────────────────────────────────────── */
.rating-stars { color: #f59e0b; }
.rating-stars .bi-star { color: #d1d5db; }

.star-rating { display: flex; gap: .25rem; }

.star-rating input { display: none; }

.star-rating label {
    font-size: 1.4rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color .1s;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f59e0b; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-3);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: .4;
}

.empty-state h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: .5rem;
}

.empty-state p { font-size: .9rem; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    font-weight: 600;
    letter-spacing: .3px;
    border-radius: 6px;
}

/* ── Notification dot ───────────────────────────────────── */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    position: absolute;
    top: 2px;
    right: 2px;
}

/* ── Profile ────────────────────────────────────────────── */
.profile-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--dark-2), var(--dark-3));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
}

.profile-avatar-wrap {
    position: absolute;
    bottom: -40px;
    left: 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
    background: var(--dark-2);
    color: rgba(255,255,255,.6);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--white);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: .75rem;
}

.footer-logo .brand-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--white);
}

footer a { color: rgba(255,255,255,.55); font-size: .88rem; }
footer a:hover { color: var(--white); }
footer h6 { color: var(--white); font-weight: 600; font-size: .88rem; margin-bottom: .75rem; }
.footer-link-list { list-style: none; padding: 0; }
.footer-link-list li { margin-bottom: .35rem; }

footer hr { border-color: rgba(255,255,255,.08); }

.footer-bottom {
    padding-top: 1rem;
    font-size: .82rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Utility ────────────────────────────────────────────── */
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }

.bg-brand { background: var(--brand) !important; }

.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.shadow-brand { box-shadow: var(--shadow-brand) !important; }

section { padding: 3.5rem 0; }

.section-light { background: var(--white); }

/* Catalog filter sidebar */
.filter-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group-title {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-2);
    margin-bottom: .75rem;
}

/* Pagination */
.pagination { gap: .25rem; }

.page-link {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    padding: .4rem .75rem;
    transition: var(--transition-s);
}

.page-link:hover { background: var(--bg); border-color: var(--brand); color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: var(--white); }
.page-item.disabled .page-link { opacity: .4; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* ══════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ — ПОЛНАЯ МОБИЛЬНАЯ ПОДДЕРЖКА
   ══════════════════════════════════════════════════════════ */

/* ── Планшет (≤ 991px) ──────────────────────────────────── */
@media (max-width: 991.98px) {

    /* Hero */
    .hero {
        padding: calc(var(--nav-h) + 2.5rem) 0 2.5rem;
        text-align: center;
    }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { margin: 0 auto 1.5rem; }
    .hero-search { margin: 0 auto 1.5rem; }
    .hero-stats { justify-content: center; }

    /* Sidebar — static on tablet */
    .sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }

    /* Sidebar nav → horizontal scroll on tablet */
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: .4rem;
        gap: .25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .sidebar-nav .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: .45rem .85rem;
    }
    .sidebar-divider { display: none; }
    .sidebar-header { display: none; }

    /* Filter card — static */
    .filter-card { position: static; margin-bottom: 1.25rem; }

    /* Enroll card — static */
    .enroll-card { position: static; }
}

/* ── Мобильный (≤ 767px) ────────────────────────────────── */
@media (max-width: 767.98px) {

    body { font-size: 14px; }

    /* ─ Navbar ─ */
    .navbar { height: auto; min-height: var(--nav-h); }

    .navbar-collapse {
        background: var(--dark-3);
        margin: 0 -16px;
        padding: .75rem 1rem 1rem;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    .navbar .nav-link {
        padding: .6rem .75rem !important;
        border-radius: var(--radius-sm);
    }

    .navbar .btn-nav-outline,
    .navbar .btn-nav-fill {
        width: 100%;
        text-align: center;
        margin: .25rem 0 0;
        padding: .6rem 1rem;
    }

    .navbar-nav.align-items-center { align-items: stretch !important; }

    /* ─ Flash ─ */
    .flash-container {
        top: calc(var(--nav-h) + 8px);
        right: 8px;
        left: 8px;
        width: auto;
        max-width: 100%;
    }

    /* ─ Hero ─ */
    .hero { padding: calc(var(--nav-h) + 2rem) 0 2rem; }
    .hero-title { font-size: 1.65rem; letter-spacing: -.3px; }
    .hero-subtitle { font-size: .95rem; }
    .hero-search input { font-size: .9rem; padding: 0 110px 0 1.1rem; height: 46px; }
    .hero-search .btn-search { height: 36px; padding: 0 1.1rem; font-size: .83rem; top: 5px; right: 5px; }
    .hero-stats { gap: 1.25rem; }
    .hero-stat-num { font-size: 1.4rem; }
    .hero-stat-label { font-size: .75rem; }

    /* ─ Sections ─ */
    section { padding: 2rem 0; }
    .section-title { font-size: 1.3rem; }

    /* ─ Category pills ─ */
    .category-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .5rem;
        scrollbar-width: none;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .category-grid::-webkit-scrollbar { display: none; }
    .cat-pill { flex-shrink: 0; font-size: .82rem; padding: .5rem .9rem; }

    /* ─ Course cards ─ */
    .course-card-img { height: 160px; }
    .course-card-body { padding: .9rem; }
    .course-card-title { font-size: .9rem; }

    /* ─ Stat cards ─ */
    .stat-card { padding: 1rem 1.1rem; }
    .stat-card .stat-icon { font-size: 1.8rem; }
    .stat-card .stat-number { font-size: 1.7rem; }
    .stat-card .stat-label { font-size: .78rem; }

    /* ─ Tables → scrollable ─ */
    .table-card { overflow-x: auto; }
    .table { min-width: 560px; }
    .table thead th { padding: .6rem .75rem; font-size: .75rem; }
    .table td { padding: .7rem .75rem; font-size: .82rem; }

    /* ─ Chart cards ─ */
    .chart-card { padding: 1rem; }

    /* ─ Auth ─ */
    .auth-page { align-items: flex-start; padding: 1.25rem 0; }
    .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--radius-lg); }
    .auth-title { font-size: 1.35rem; }

    /* ─ Course hero ─ */
    .course-hero { padding: 1.75rem 0; }
    .course-hero-title { font-size: 1.3rem; }
    .course-hero-meta { gap: .75rem; font-size: .8rem; }

    /* ─ Enroll card ─ */
    .enroll-card { margin-bottom: 1.5rem; }
    .enroll-card-img { height: 140px; }

    /* ─ Quiz ─ */
    .quiz-card { padding: 1rem; }
    .quiz-question-text { font-size: .92rem; }
    .answer-option { padding: .6rem .85rem; font-size: .88rem; }
    .result-circle { width: 110px; height: 110px; font-size: 2rem; }

    /* ─ Profile ─ */
    .profile-cover { height: 120px; }

    /* ─ Footer ─ */
    .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }

    /* ─ Page header ─ */
    .page-header h2 { font-size: 1.4rem; }

    /* ─ Admin actions column ─ */
    .table td:last-child .d-flex { flex-wrap: wrap; gap: 4px; }

    /* ─ Breadcrumb ─ */
    .breadcrumb { font-size: .78rem; }
    .breadcrumb-item + .breadcrumb-item::before { padding: 0 .3rem; }
}

/* ── Маленький экран (≤ 575px) ──────────────────────────── */
@media (max-width: 575.98px) {

    /* Full-width container */
    .container { padding-left: 14px; padding-right: 14px; }

    /* Hero */
    .hero-title { font-size: 1.45rem; }
    .hero-search { max-width: 100%; }

    /* Course cards → 1 column */
    .course-card-img { height: 150px; }

    /* Auth card */
    .auth-card { border-radius: var(--radius); }

    /* Lesson page — stacked layout */
    .lesson-content { padding: 1.25rem; border-radius: var(--radius); }
    .lesson-content pre { padding: .85rem; font-size: .8rem; }

    /* Remove card hover lift on touch devices */
    .course-card:hover { transform: none; }

    /* Wider buttons in small modals */
    .modal-body .btn { width: 100%; }

    /* Sidebar horizontal — tighter */
    .sidebar-nav .nav-link { font-size: .82rem; padding: .4rem .7rem; }

    /* Stats 2x2 grid — enforce via Bootstrap overrides */
    /* (Bootstrap col-6 col-md-3 already handles this) */

    /* Tables always scroll on phones */
    .table-card { -webkit-overflow-scrolling: touch; }

    /* Empty state compact */
    .empty-state { padding: 2.5rem .75rem; }
    .empty-state i { font-size: 2.5rem; }

    /* Pagination compact */
    .page-link { padding: .3rem .6rem; font-size: .8rem; }

    /* Footer */
    footer { padding: 2rem 0 1rem; }
    .footer-logo { font-size: 1rem; }
}

/* ── Touch devices — remove hover effects ─────────────────── */
@media (hover: none) {
    .course-card:hover { transform: none; box-shadow: var(--shadow-sm); }
    .btn-primary:hover { transform: none; }
    .btn-accent:hover { transform: none; }
    .cat-pill:hover { background: var(--white); border-color: var(--border); color: var(--text); }
    .cat-pill.active { background: var(--brand); border-color: var(--brand); color: var(--white); }
}
