/* =========================================================
   LMS — Design System
   Modern, elegant theme inspired by professional SaaS UIs
   ========================================================= */

:root {
    /* Brand */
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;

    /* Accents */
    --accent-pink: #ec4899;
    --accent-violet: #8b5cf6;
    --accent-teal: #14b8a6;
    --accent-amber: #f59e0b;

    /* Semantics */
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger:  #ef4444;
    --danger-soft: #fee2e2;
    --info:    #3b82f6;
    --info-soft: #dbeafe;

    /* Neutrals */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Layout */
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 80px;
    --topbar-h: 72px;
    --radius-sm: 8px;
    --radius:   12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow:    0 4px 12px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
    --shadow-md: 0 10px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
    --shadow-lg: 0 20px 40px rgba(15,23,42,.10);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Bootstrap overrides */
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 79,70,229;
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--gray-700);
    --bs-body-bg: #f6f7fb;
    --bs-border-color: var(--gray-200);
    --bs-border-radius: var(--radius);
}

/* ====================== Base ====================== */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { height: 100%; }
body {
    font-family: var(--font-sans);
    color: var(--gray-700);
    background: #f6f7fb;
    font-size: 14.5px;
    line-height: 1.55;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1,h2,h3,h4,h5,h6 { color: var(--gray-900); font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--gray-500) !important; }
.text-soft { color: var(--gray-400); }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }

::selection { background: var(--brand-200); color: var(--brand-900); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ====================== Layout ====================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width .25s ease;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -.02em;
}
.sidebar-brand .brand-logo {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-violet));
    color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 14px rgba(99,102,241,.35);
    font-size: 1.05rem;
}
.sidebar-section {
    padding: 1rem 1.25rem .35rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--gray-400);
    font-weight: 700;
}
.sidebar-nav { padding: .25rem .75rem; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem .8rem;
    color: var(--gray-600);
    border-radius: 10px;
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    transition: background .15s, color .15s;
    font-size: .92rem;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; color: var(--gray-400); transition: color .15s; }
.sidebar-nav .nav-link:hover { background: var(--gray-50); color: var(--gray-900); }
.sidebar-nav .nav-link:hover i { color: var(--brand-600); }
.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, var(--brand-50), transparent);
    color: var(--brand-700);
    font-weight: 600;
}
.sidebar-nav .nav-link.active i { color: var(--brand-600); }
.sidebar-nav .nav-link.active::before {
    content: ""; position: absolute; left: -0.5rem; top: 8px; bottom: 8px;
    width: 3px; background: var(--brand-600); border-radius: 0 4px 4px 0;
}
.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-weight: 600;
    font-size: .7rem;
    padding: .25em .5em;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}
.user-card {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem; border-radius: 10px; cursor: pointer;
    transition: background .15s;
}
.user-card:hover { background: var(--gray-50); }
.user-card .avatar { flex-shrink: 0; }
.user-card .user-name { font-weight: 600; color: var(--gray-900); font-size: .88rem; line-height: 1.2; }
.user-card .user-role { font-size: .75rem; color: var(--gray-500); }

/* Main */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky; top: 0; z-index: 90;
}
.topbar .search {
    flex: 1; max-width: 460px;
    position: relative;
}
.topbar .search i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 1rem;
}
.topbar .search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 10px;
    padding: 0 1rem 0 2.5rem;
    font-size: .9rem;
    transition: all .15s;
}
.topbar .search input:focus {
    outline: none; background: #fff;
    border-color: var(--brand-300);
    box-shadow: 0 0 0 4px var(--brand-50);
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.icon-btn {
    width: 42px; height: 42px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    display: inline-grid; place-items: center;
    font-size: 1.1rem;
    transition: all .15s;
    position: relative;
}
.icon-btn:hover { background: var(--gray-50); color: var(--brand-600); border-color: var(--gray-300); }
.icon-btn .dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
    border: 2px solid #fff;
}

.page-content {
    padding: 2rem 1.75rem 3rem;
    flex: 1;
}
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem;
}
.page-title { font-size: 1.65rem; margin: 0 0 .25rem; }
.page-subtitle { color: var(--gray-500); margin: 0; font-size: .95rem; }
.breadcrumb-soft { font-size: .82rem; color: var(--gray-500); margin-bottom: .25rem; }
.breadcrumb-soft a { color: var(--gray-500); }
.breadcrumb-soft a:hover { color: var(--brand-600); }
.breadcrumb-soft .sep { margin: 0 .35rem; color: var(--gray-300); }

/* ====================== Cards ====================== */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    background: #fff;
}
.card > *:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card > *:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > *:only-child { border-radius: var(--radius-lg); }
.card > img:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card .table { border-radius: inherit; }
.card .table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.card .table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }
.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.1rem 1.35rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.card .card-header h5,
.card .card-header h6 { margin: 0; }
.card .card-body { padding: 1.35rem; }
.card.card-flush { box-shadow: none; }
.card.card-elevated { box-shadow: var(--shadow); border-color: transparent; }

/* Stat KPI cards */
.stat-card {
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--gray-200);
    display: grid;
    grid-template-columns: auto 1fr;
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
    display: grid; place-items: center;
    font-size: 2.5rem;
    flex-shrink: 0;
    width: 130px;
    align-self: stretch;
}
.stat-card .stat-icon i { font-size: 3rem; }
.stat-card .stat-body {
    display: flex; flex-direction: column; justify-content: center;
    padding: 1.5rem 1.5rem 1.5rem .75rem;
    min-height: 5rem;
}
.stat-card .stat-icon.ic-brand   { background: var(--brand-50) !important;    color: var(--brand-600) !important; }
.stat-card .stat-icon.ic-success { background: var(--success-soft) !important; color: var(--success) !important; }
.stat-card .stat-icon.ic-warning { background: var(--warning-soft) !important; color: var(--warning) !important; }
.stat-card .stat-icon.ic-info    { background: var(--info-soft) !important;    color: var(--info) !important; }
.stat-card .stat-icon.ic-pink    { background: #fce7f3 !important;             color: var(--accent-pink) !important; }
.stat-card .stat-icon.ic-violet  { background: #ede9fe !important;             color: var(--accent-violet) !important; }
.stat-card .stat-icon.ic-danger  { background: var(--danger-soft) !important;  color: var(--danger) !important; }
.stat-card .stat-label { color: var(--gray-500); font-size: .9rem; font-weight: 500; text-align: left; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; line-height: 1.1; text-align: left; }
.stat-card .stat-trend { font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }
.stat-card .stat-trend.up   { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

/* ====================== Buttons ====================== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    padding: .55rem 1rem;
    transition: all .15s;
    display: inline-flex; align-items: center; gap: .45rem;
}
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-primary {
    background: var(--brand-600); border-color: var(--brand-600);
    color: #fff;
    box-shadow: 0 6px 12px -4px rgba(79,70,229,.35);
}
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); transform: translateY(-1px); box-shadow: 0 10px 18px -4px rgba(79,70,229,.4); }
.btn-primary:focus { box-shadow: 0 0 0 4px var(--brand-100); }

.btn-soft {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid transparent;
}
.btn-soft:hover { background: var(--brand-100); color: var(--brand-800); }

.btn-light-2 {
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.btn-light-2:hover { background: var(--gray-50); color: var(--gray-900); border-color: var(--gray-300); }

.btn-ghost {
    background: transparent; border: 1px solid transparent; color: var(--gray-600);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn-outline-primary { color: var(--brand-600); border-color: var(--brand-200); }
.btn-outline-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ====================== Forms ====================== */
.form-label { font-weight: 600; color: var(--gray-700); font-size: .85rem; margin-bottom: .4rem; }
.form-text  { color: var(--gray-500); font-size: .8rem; }
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: .6rem .85rem;
    font-size: .92rem;
    background: #fff;
    transition: all .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px var(--brand-50);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control-lg { padding: .8rem 1rem; border-radius: 12px; font-size: 1rem; }
textarea.form-control { min-height: 110px; }

.input-group-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--gray-500);
    border-radius: 10px;
}

.form-check-input {
    border-color: var(--gray-300);
    width: 1.05rem; height: 1.05rem;
}
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-50); border-color: var(--brand-300); }

/* ====================== Badges ====================== */
.badge { font-weight: 600; padding: .35em .7em; border-radius: 6px; letter-spacing: .01em; }
.badge.rounded-pill { border-radius: 999px; padding: .35em .8em; }
.badge-soft-primary { background: var(--brand-50); color: var(--brand-700); }
.badge-soft-success { background: var(--success-soft); color: #047857; }
.badge-soft-warning { background: var(--warning-soft); color: #b45309; }
.badge-soft-danger  { background: var(--danger-soft);  color: #b91c1c; }
.badge-soft-info    { background: var(--info-soft);    color: #1d4ed8; }
.badge-soft-violet  { background: #ede9fe;             color: #6d28d9; }
.badge-soft-pink    { background: #fce7f3;             color: #be185d; }
.badge-soft-gray    { background: var(--gray-100);     color: var(--gray-700); }
.badge-soft-secondary { background: var(--gray-200);   color: var(--gray-700); }

/* ====================== Avatars ====================== */
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    display: inline-grid; place-items: center;
    font-weight: 600; font-size: .85rem;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.avatar-xs { width: 28px; height: 28px; font-size: .7rem; }
.avatar.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 1rem; }
.avatar.avatar-xl { width: 80px; height: 80px; font-size: 1.4rem; }
.avatar-initial {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: inherit;
}
.bg-label-primary { background-color: var(--brand-50) !important; }
.bg-label-success { background-color: var(--success-soft) !important; }
.bg-label-warning { background-color: var(--warning-soft) !important; }
.bg-label-info    { background-color: var(--info-soft) !important; }
.bg-label-danger  { background-color: var(--danger-soft) !important; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -10px; box-shadow: 0 0 0 1px var(--gray-200); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Random color avatars */
.avatar.bg-1 { background: #fee2e2; color: #b91c1c; }
.avatar.bg-2 { background: #fef3c7; color: #b45309; }
.avatar.bg-3 { background: #d1fae5; color: #047857; }
.avatar.bg-4 { background: #dbeafe; color: #1d4ed8; }
.avatar.bg-5 { background: #ede9fe; color: #6d28d9; }
.avatar.bg-6 { background: #fce7f3; color: #be185d; }
.avatar.bg-7 { background: #ccfbf1; color: #0f766e; }

/* ====================== Tables ====================== */
.table { color: var(--gray-700); font-size: .9rem; margin: 0; background: transparent; }
.table > :not(caption) > * > * { padding: .9rem 1rem; background: transparent; }
.table thead th {
    background: transparent;
    color: var(--gray-500);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--gray-200);
}
.table tbody td { border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: var(--gray-50); }

/* ====================== Progress ====================== */
.progress {
    height: 8px; border-radius: 8px; background: var(--gray-100) !important; overflow: hidden;
    --bs-progress-bg: var(--gray-100);
}
.progress-bar {
    background: var(--brand-600) !important; background-color: var(--brand-600) !important;
    border-radius: 8px;
}
.progress.progress-sm { height: 6px; }
.progress.progress-lg { height: 12px; }
.progress-bar.bg-gradient { background: linear-gradient(90deg, var(--brand-500), var(--accent-violet)) !important; }
.progress-bar.bg-success { background: var(--success) !important; background-color: var(--success) !important; }
.progress-bar.bg-white { background: #fff !important; background-color: #fff !important; }

/* Circular progress */
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.progress-ring .track { stroke: var(--gray-100); }
.progress-ring .bar   { stroke: var(--brand-600); stroke-linecap: round; transition: stroke-dashoffset .4s ease; }

/* ====================== Course cards ====================== */
.course-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
    height: 100%;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.course-card .course-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-violet));
    position: relative;
    color: #fff;
    display: grid; place-items: center;
    font-size: 2.5rem;
    overflow: hidden;
}
.course-card .course-thumb.gr-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.course-card .course-thumb.gr-2 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.course-card .course-thumb.gr-3 { background: linear-gradient(135deg, #10b981, #14b8a6); }
.course-card .course-thumb.gr-4 { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.course-card .course-thumb.gr-5 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.course-card .course-thumb.gr-6 { background: linear-gradient(135deg, #0f172a, #475569); }
.course-card .course-thumb .badge {
    position: absolute; top: .75rem; left: .75rem;
    background: rgba(255,255,255,.95); color: var(--gray-800);
    backdrop-filter: blur(6px);
    font-size: .75rem;
}
.course-card .course-thumb .actions {
    position: absolute; top: .75rem; right: .75rem;
    display: flex; gap: .35rem;
}
.course-card .course-thumb .actions button {
    width: 32px; height: 32px; border-radius: 8px; border: 0;
    background: rgba(255,255,255,.9); color: var(--gray-700);
    display: grid; place-items: center;
    backdrop-filter: blur(6px);
}
.course-card .course-thumb .actions button:hover { background: #fff; color: var(--brand-600); }
.course-card .course-body { padding: 1.1rem 1.2rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.course-card .course-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-600); }
.course-card .course-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin: .35rem 0 .55rem; line-height: 1.35; }
.course-card .course-meta { display: flex; align-items: center; gap: .85rem; color: var(--gray-500); font-size: .8rem; margin-bottom: .85rem; }
.course-card .course-meta i { margin-right: .2rem; }
.course-card .course-footer { margin-top: auto; }

/* ====================== Misc ====================== */
.divider {
    height: 1px; background: var(--gray-200); margin: 1.25rem 0;
}
.dot-sep { color: var(--gray-300); margin: 0 .5rem; }

.empty-state {
    text-align: center; padding: 3rem 1rem;
}
.empty-state .empty-icon {
    width: 84px; height: 84px; border-radius: 24px;
    background: var(--brand-50); color: var(--brand-600);
    display: grid; place-items: center; margin: 0 auto 1rem;
    font-size: 2.4rem;
}
.empty-state h5 { color: var(--gray-900); margin-bottom: .35rem; }
.empty-state p { color: var(--gray-500); }

/* Tabs */
.nav-tabs-soft {
    border-bottom: 1px solid var(--gray-200);
    gap: .25rem;
    flex-wrap: nowrap; overflow-x: auto;
}
.nav-tabs-soft .nav-link {
    border: 0; color: var(--gray-500);
    padding: .75rem 1rem;
    font-weight: 600; font-size: .9rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    white-space: nowrap;
}
.nav-tabs-soft .nav-link:hover { color: var(--gray-800); }
.nav-tabs-soft .nav-link.active {
    color: var(--brand-600);
    background: transparent;
    border-bottom-color: var(--brand-600);
}

/* Pills */
.nav-pills .nav-link {
    color: var(--gray-600); border-radius: 10px; font-weight: 600; font-size: .88rem;
    padding: .5rem .9rem;
}
.nav-pills .nav-link.active { background: var(--brand-600); color: #fff; }

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: .5rem;
    font-size: .9rem;
    min-width: 220px;
}
.dropdown-item {
    border-radius: 8px;
    padding: .55rem .7rem;
    color: var(--gray-700);
    font-weight: 500;
    display: flex; align-items: center; gap: .55rem;
}
.dropdown-item i { color: var(--gray-400); font-size: 1rem; }
.dropdown-item:hover { background: var(--gray-50); color: var(--brand-600); }
.dropdown-item:hover i { color: var(--brand-600); }
.dropdown-header { color: var(--gray-400); text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; font-weight: 700; padding: .5rem .7rem .25rem; }
.dropdown-divider { border-top-color: var(--gray-100); margin: .35rem 0; }

/* Modals */
.modal-content {
    border: 0; border-radius: 16px; box-shadow: var(--shadow-lg);
}
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); }

/* Alerts */
.alert { border: 0; border-radius: 12px; padding: 1rem 1.1rem; font-weight: 500; }
.alert-soft-primary { background: var(--brand-50);    color: var(--brand-700); }
.alert-soft-success { background: var(--success-soft); color: #065f46; }
.alert-soft-warning { background: var(--warning-soft); color: #92400e; }
.alert-soft-danger  { background: var(--danger-soft);  color: #991b1b; }
.alert-soft-info    { background: var(--info-soft);    color: #1e40af; }

/* List groups */
.list-group-flush .list-group-item {
    border-color: var(--gray-100);
    padding: .9rem 0;
    background: transparent;
}

/* Timeline */
.timeline { position: relative; padding-left: 1.25rem; }
.timeline::before {
    content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 2px; background: var(--gray-200);
}
.timeline-item { position: relative; padding: 0 0 1.25rem .75rem; }
.timeline-item::before {
    content: ""; position: absolute; left: -1.25rem; top: 6px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand-500);
}
.timeline-item.is-success::before { border-color: var(--success); }
.timeline-item.is-warning::before { border-color: var(--warning); }

/* Chips */
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: .78rem;
    font-weight: 600;
}
.chip i { font-size: .9rem; }

/* Toasts */
.toast { border: 0; box-shadow: var(--shadow-md); border-radius: 12px; }

/* Auth pages */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-shell .auth-art {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--accent-violet) 100%);
    color: #fff;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; padding: 3rem;
}
.auth-shell .auth-art::before, .auth-shell .auth-art::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08);
}
.auth-shell .auth-art::before { width: 480px; height: 480px; top: -160px; right: -160px; }
.auth-shell .auth-art::after  { width: 320px; height: 320px; bottom: -120px; left: -120px; }
.auth-shell .auth-form { padding: 3rem; display: flex; align-items: center; justify-content: center; }
@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-shell .auth-art { display: none; }
}

/* ====================== Responsive ====================== */
.sidebar-toggle { display: none; }
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; left: -100%; width: 280px; height: 100vh;
        box-shadow: var(--shadow-lg); transition: left .25s ease;
    }
    .sidebar.is-open { left: 0; }
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 95;
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .sidebar-backdrop.is-active { opacity: 1; pointer-events: auto; }
    .sidebar-toggle { display: inline-grid; }
    .topbar .search { max-width: 100%; }
    .page-content { padding: 1.25rem 1rem 2rem; }
}

/* Utilities */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bg-soft-primary { background-color: var(--brand-50) !important; }
.bg-soft-success { background-color: var(--success-soft) !important; }
.bg-soft-warning { background-color: var(--warning-soft) !important; }
.bg-soft-danger  { background-color: var(--danger-soft) !important; }
.bg-soft-info    { background-color: var(--info-soft) !important; }
.text-brand { color: var(--brand-600) !important; }

/* Animations */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-up { animation: fade-up .35s ease both; }

/* Quiz / Resource viewer specific */
.resource-shell { display: grid; grid-template-columns: 1fr 380px; min-height: calc(100vh - 60px); }
.resource-main { padding: 1.5rem 2rem; }
.resource-side { background: #fff; border-left: 1px solid var(--gray-200); padding: 1.25rem; height: calc(100vh - 60px); overflow-y: auto; position: sticky; top: 60px; }
@media (max-width: 1199.98px) {
    .resource-shell { grid-template-columns: 1fr; }
    .resource-side { position: static; height: auto; border-left: 0; border-top: 1px solid var(--gray-200); }
}

.lesson-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.lesson-item:hover { background: var(--gray-50); }
.lesson-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.lesson-item .lesson-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--gray-100); color: var(--gray-500);
    flex-shrink: 0;
    font-size: 1.3rem;
}
.lesson-item.active .lesson-icon { background: var(--brand-100); color: var(--brand-600); }
.lesson-item.completed .lesson-icon { background: var(--success-soft); color: var(--success); }
.lesson-item .lesson-meta { flex: 1; min-width: 0; }
.lesson-item .lesson-title { font-size: 1rem; color: var(--gray-800); margin: 0; }
.lesson-item.active .lesson-title { color: var(--brand-700); }
.lesson-item .lesson-sub { font-size: .8rem; color: var(--gray-500); }

.module-block {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: .85rem;
    overflow: hidden;
    background: #fff;
}
.module-head {
    padding: .85rem 1rem;
    display: flex; align-items: center; gap: .75rem;
    cursor: pointer;
    background: var(--gray-50);
}
.module-head h6 { margin: 0; font-size: .92rem; color: var(--gray-900); }
.module-head .chevron { margin-left: auto; transition: transform .2s; color: var(--gray-400); }
.module-block.is-open .module-head .chevron { transform: rotate(180deg); }
.module-body { padding: .5rem .5rem; display: none; }
.module-block.is-open .module-body { display: block; }

/* Wizard steps */
.wizard-steps {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.wizard-step {
    display: flex; align-items: center; gap: .65rem;
    padding: .35rem 0;
    flex: 1; min-width: 150px;
    position: relative;
}
.wizard-step + .wizard-step::before {
    content: ""; position: absolute; left: -.5rem; right: calc(100% + .5rem);
    top: 50%;
}
.wizard-step .step-num {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gray-100); color: var(--gray-500);
    display: grid; place-items: center; font-weight: 700; font-size: .9rem;
    flex-shrink: 0;
    border: 2px solid transparent;
}
.wizard-step.is-active .step-num { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.wizard-step.is-done .step-num { background: var(--success); color: #fff; }
.wizard-step .step-meta .step-label { font-weight: 700; color: var(--gray-700); font-size: .85rem; }
.wizard-step.is-active .step-meta .step-label { color: var(--brand-700); }
.wizard-step .step-meta .step-sub { color: var(--gray-400); font-size: .76rem; }
.wizard-divider {
    flex: 0 0 32px; height: 2px; background: var(--gray-200); margin: 0 .25rem;
}
.wizard-divider.is-done { background: var(--success); }

/* Drag handle */
.drag-handle { color: var(--gray-300); cursor: grab; }
.drag-handle:hover { color: var(--gray-500); }

/* Print/clean */
.notif-item {
    display: flex; gap: .8rem; padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item .avatar { flex-shrink: 0; }
.notif-item .meta { flex: 1; }
.notif-item .meta p { margin: 0; font-size: .88rem; color: var(--gray-700); }
.notif-item .meta time { font-size: .75rem; color: var(--gray-400); }

/* Filepicker / dropzone */
.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    background: var(--gray-50);
    transition: all .15s;
    cursor: pointer;
}
.dropzone:hover { border-color: var(--brand-400); background: var(--brand-50); }
.dropzone i { font-size: 2.4rem; color: var(--brand-500); }
.dropzone p { margin: .35rem 0 0; color: var(--gray-600); }
.dropzone small { color: var(--gray-400); }
