/* ================================================================
   design-system.css — LearnFlow Global Design System
   Place: /lms-project/assets/css/design-system.css

   Centralised CSS variables, reset, typography, utilities,
   toast notifications, skeleton loaders, page transitions,
   and responsive mobile nav. Imported by all pages via
   a <link> in the shared partial header.
   ================================================================ */

/* ══════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ══════════════════════════════════════════════════════════ */
:root {
    /* Brand */
    --brand-blue:      #3b82f6;
    --brand-blue-dark: #2563eb;
    --brand-blue-dim:  #1d4ed8;
    --brand-cyan:      #06b6d4;
    --brand-glow:      rgba(59,130,246,0.35);

    /* Neutrals */
    --gray-950: #030712;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50:  #f9fafb;
    --white:    #ffffff;

    /* Semantic */
    --success:  #22c55e;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;

    /* Sidebar */
    --sidebar-bg:    #0c1220;
    --sidebar-w:     248px;
    --sidebar-w-col: #1e293b;

    /* Content */
    --content-bg:  #f8fafc;
    --card-bg:     #ffffff;
    --card-border: #e2e8f0;

    /* Typography */
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    /* Radius */
    --r-xs:  4px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-full: 9999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.20);

    /* Transitions */
    --t-fast:   0.12s ease;
    --t-base:   0.20s ease;
    --t-slow:   0.35s ease;

    /* Z-index layers */
    --z-sidebar:  100;
    --z-topbar:   110;
    --z-modal:    200;
    --z-toast:    300;
    --z-overlay:  400;
}

/* ══════════════════════════════════════════════════════════
   2. RESET & BASE
   ══════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--content-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ══════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.9rem; }

p { color: var(--gray-600); line-height: 1.7; }

/* ══════════════════════════════════════════════════════════
   4. REDESIGNED APP LAYOUT (sidebar + content)
   ══════════════════════════════════════════════════════════ */
.app-body {
    display: flex;
    min-height: 100vh;
    background: var(--content-bg);
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: var(--z-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--t-slow);
    padding: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 0 1rem;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.logo-text-wrap { min-width: 0; }

.logo-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.02em;
    display: block;
    line-height: 1;
}

.logo-sub {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Nav sections */
.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    padding: 0.75rem 0.5rem 0.35rem;
    display: block;
}

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(135deg,
        rgba(59,130,246,0.2),
        rgba(6,182,212,0.12));
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: linear-gradient(to bottom, var(--brand-blue), var(--brand-cyan));
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--t-fast);
}

.nav-item:hover .nav-icon { transform: scale(1.1); }

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.5rem 0.75rem;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
    cursor: default;
}

.user-chip:hover { background: rgba(255,255,255,0.05); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.admin-av { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    color: rgba(255,255,255,0.35);
    transition: color var(--t-fast), background var(--t-fast);
    flex-shrink: 0;
}
.logout-btn:hover {
    color: #f87171;
    background: rgba(239,68,68,0.12);
    text-decoration: none;
}

/* Admin badge */
.admin-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.3);
    padding: 2px 6px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

/* ── Content wrapper ──────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    padding: 2rem 2.5rem;
    max-width: 1400px;
    animation: pageIn 0.25s ease both;
}

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

/* ── Mobile hamburger ─────────────────────────────────── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--sidebar-bg);
    z-index: var(--z-topbar);
    align-items: center;
    padding: 0 1rem;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hamburger-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast), color var(--t-fast);
}
.hamburger-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.mobile-logo {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
    backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════════════════════
   5. PAGE HEADER
   ══════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-header h1 { margin-bottom: 3px; }

.page-sub {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   6. CARDS
   ══════════════════════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.card-hover {
    transition: box-shadow var(--t-base), transform var(--t-base);
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   7. BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--r-sm);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition:
        background var(--t-fast),
        border-color var(--t-fast),
        transform var(--t-fast),
        box-shadow var(--t-fast),
        opacity var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn:hover   { transform: translateY(-1px); text-decoration: none; }
.btn:active  { transform: translateY(0); }
.btn:disabled{ opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dim));
    color: #fff;
    box-shadow: 0 3px 12px var(--brand-glow);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.45); }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); border-color: var(--gray-300); }

.btn-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-50); color: var(--gray-800); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-outline-red { background: transparent; color: #ef4444; border: 1px solid #ef4444; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: all .2s; }
.btn-outline-red:hover { background: #ef4444; color: #fff; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* Action button (page header) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--brand-blue);
    color: #fff;
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-display);
    text-decoration: none;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.btn-action:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--brand-glow);
    text-decoration: none;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r-sm);
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--t-fast);
}
.btn-back:hover { border-color: var(--brand-blue); color: var(--brand-blue); text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   8. STAT CARDS
   ══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--t-base), transform var(--t-base);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════════════════
   9. TABLE
   ══════════════════════════════════════════════════════════ */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
    background: var(--gray-50);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-50);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
    transition: background var(--t-fast);
}
.data-table tbody tr:hover td { background: var(--gray-50); }

/* ══════════════════════════════════════════════════════════
   10. BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red   { background: #fee2e2; color: #b91c1c; }
.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-gray  { background: var(--gray-100); color: var(--gray-500); }
.badge-yellow{ background: #fef9c3; color: #854d0e; }
.badge-purple{ background: #f3e8ff; color: #7e22ce; }

/* ══════════════════════════════════════════════════════════
   11. ALERTS / FLASH BANNERS
   ══════════════════════════════════════════════════════════ */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: alertIn 0.3s ease both;
}
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ══════════════════════════════════════════════════════════
   12. TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-900);
    color: #f1f5f9;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    min-width: 260px;
    max-width: 380px;
    border-left: 3px solid var(--brand-blue);
    animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-out {
    animation: toastOut 0.25s ease both;
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(16px); height: 0; padding: 0; margin: 0; }
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger);  }
.toast-warning { border-left-color: var(--warning); }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
    transition: color var(--t-fast);
}
.toast-close:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════
   13. SKELETON LOADERS
   ══════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--r-sm);
}

.sk-text     { height: 14px; margin-bottom: 8px; }
.sk-text.lg  { height: 20px; }
.sk-text.sm  { height: 10px; }
.sk-block    { height: 120px; }
.sk-avatar   { width: 36px; height: 36px; border-radius: 50%; }
.sk-thumb    { width: 100%; height: 150px; }

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   14. EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--card-bg);
    border: 1.5px dashed var(--card-border);
    border-radius: var(--r-lg);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.7; }
.empty-state h3 { margin-bottom: 6px; color: var(--gray-700); }
.empty-state p  { color: var(--gray-400); margin-bottom: 1.5rem; font-size: 0.875rem; }

/* ══════════════════════════════════════════════════════════
   15. COURSE CARDS
   ══════════════════════════════════════════════════════════ */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.course-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--t-base), transform var(--t-base);
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: var(--gray-100);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.4s ease;
}
.course-card:hover .card-thumb[style*="background-image"] {
    background-size: contain;
}
.card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.3s ease;
    pointer-events: none;
}
.course-card:hover .card-thumb::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.1) 100%);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card:hover .card-thumb img { object-fit: contain; }
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}

.card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--r-xs);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}

.card-badge-complete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--success);
    color: #fff;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
}
.card-desc  { font-size: 0.8rem; color: var(--gray-400); line-height: 1.5; flex: 1; }
.card-meta  { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.72rem; color: var(--gray-400); }

.card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 7px;
}

.card-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity var(--t-fast), transform var(--t-fast);
    font-family: var(--font-display);
}
.card-btn:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; }
.card-btn-watch  { background: var(--gray-100); color: var(--gray-700); }
.card-btn-enroll { background: var(--brand-blue); color: #fff; }
.card-btn-exam   { background: #fef9c3; color: #854d0e; }

/* ══════════════════════════════════════════════════════════
   16. SEARCH BAR
   ══════════════════════════════════════════════════════════ */
.search-bar { margin-bottom: 1rem; }
.search-bar input {
    padding: 9px 14px 9px 38px;
    border: 1.5px solid var(--card-border);
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    width: min(320px, 100%);
    outline: none;
    color: var(--gray-800);
    background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-bar input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ══════════════════════════════════════════════════════════
   17. SECTION HEADER
   ══════════════════════════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 8px;
}
.section-header h2 { font-size: 1rem; }
.link-muted { font-size: 0.82rem; color: var(--brand-blue); font-weight: 600; }
.link-muted:hover { text-decoration: none; opacity: 0.8; }

/* ══════════════════════════════════════════════════════════
   18. TABLE ACTION BUTTONS
   ══════════════════════════════════════════════════════════ */
.action-group { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }

.tbl-btn {
    padding: 5px 11px;
    border-radius: var(--r-xs);
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: opacity var(--t-fast), transform var(--t-fast);
    background: var(--gray-100);
    color: var(--gray-700);
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}
.tbl-btn:hover { opacity: 0.8; transform: translateY(-1px); text-decoration: none; }
.tbl-btn-success { background: #dcfce7; color: #15803d; }
.tbl-btn-warn    { background: #fef9c3; color: #854d0e; }
.tbl-btn-danger  { background: #fee2e2; color: #b91c1c; }

/* ══════════════════════════════════════════════════════════
   19. PROGRESS BARS (inline)
   ══════════════════════════════════════════════════════════ */
.progress-bar-sm {
    flex: 1;
    height: 6px;
    background: var(--gray-100);
    border-radius: var(--r-full);
    overflow: hidden;
}
.progress-fill-sm {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-pct  { font-size: 0.72rem; color: var(--gray-400); min-width: 34px; text-align: right; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   20. TEXT UTILITIES
   ══════════════════════════════════════════════════════════ */
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.text-muted { color: var(--gray-400); }
.text-sm    { font-size: 0.78rem; }
.text-xs    { font-size: 0.7rem; }
.text-green { color: #15803d; }
.text-red   { color: #b91c1c; }
.text-blue  { color: var(--brand-blue); }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-400);
    margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--brand-blue); }
.bc-sep { color: var(--gray-300); }

/* ══════════════════════════════════════════════════════════
   21. RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }
    .main-content { padding: 1.5rem 1.75rem; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .mobile-topbar { display: flex; }

    .main-content {
        margin-left: 0;
        padding: 72px 1rem 1.5rem;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .course-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 0.75rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 68px 0.75rem 1.5rem; }
}
