/* ============================================================
   teacher-dashboard.css
   Android Material Design – Compact & Refined
   ============================================================ */

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

:root {
    /* ----- Material Design Color Palette ----- */
    --md-primary: #1976D2;
    --md-primary-variant: #1565C0;
    --md-primary-light: #BBDEFB;
    --md-on-primary: #FFFFFF;
    --md-secondary: #0288D1;
    --md-success: #2E7D32;
    --md-success-light: #A5D6A7;
    --md-danger: #C62828;
    --md-danger-light: #EF9A9A;
    --md-warning: #F57C00;
    --md-warning-light: #FFE0B2;
    --md-bg: #F5F7FA;
    --md-surface: #FFFFFF;
    --md-text-primary: #212121;
    --md-text-secondary: #757575;
    --md-text-hint: #9E9E9E;
    --md-border: #E0E0E0;
    --md-shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --md-shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 1px 3px rgba(0,0,0,0.08);
    --md-shadow-3: 0 6px 12px rgba(0,0,0,0.20), 0 3px 6px rgba(0,0,0,0.08);
    --md-radius: 12px;
    --md-radius-sm: 6px;
    --md-radius-pill: 20px;
    --md-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 56px;
    --bottom-nav-height: 56px;
}

/* ----- Dark Theme Variables ----- */
[data-theme="dark"] {
    --md-bg: #121212;
    --md-surface: #1E1E1E;
    --md-text-primary: #E0E0E0;
    --md-text-secondary: #AAAAAA;
    --md-text-hint: #777777;
    --md-border: #333333;
    --md-shadow-1: 0 1px 3px rgba(0,0,0,0.4);
    --md-shadow-2: 0 3px 6px rgba(0,0,0,0.5);
    --md-shadow-3: 0 6px 12px rgba(0,0,0,0.6);
    --md-primary-light: #1A3A5A;
    --md-success-light: #1A3A2A;
    --md-danger-light: #3A1A1A;
    --md-warning-light: #3A2A1A;
}

/* ----- Reset & Base ----- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--md-bg);
    color: var(--md-text-primary);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

.mcq-td-wrapper {
    max-width: 100%;
    min-height: 100vh;
    background: var(--md-bg);
}

/* ----- Header (App Bar) ----- */
.mcq-td-header {
    background: var(--md-surface);
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--md-border);
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: var(--md-shadow-1);
}

.mcq-td-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--md-primary), var(--md-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.mcq-td-header p {
    font-size: 0.7rem;
    color: var(--md-text-secondary);
    margin: 0;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ----- Layout (Desktop Sidebar + Content) ----- */
.mcq-dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
}

.mcq-main-content {
    padding: 16px;
    flex: 1;
    animation: fadeIn 0.25s ease;
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

.mcq-desktop-sidebar {
    display: none;
    background: var(--md-surface);
    border-right: 1px solid var(--md-border);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    padding: 12px 12px 16px;
    overflow-y: auto;
    box-shadow: var(--md-shadow-1);
}

/* ----- Sidebar Navigation ----- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--md-text-secondary);
    text-decoration: none;
    border-radius: var(--md-radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    transition: background var(--md-transition);
}

.sidebar-item:hover { background: var(--md-bg); color: var(--md-primary); }
.sidebar-item.active {
    background: var(--md-primary-light);
    color: var(--md-primary);
}

.sidebar-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.sidebar-divider {
    height: 1px;
    background: var(--md-border);
    margin: 8px 0;
}

.sidebar-badge {
    background: var(--md-danger);
    color: white;
    font-size: 0.65rem;
    padding: 1px 8px;
    border-radius: var(--md-radius-pill);
    margin-left: auto;
    font-weight: 600;
}

/* ----- Credits Card (Material) ----- */
.credits-card {
    background: linear-gradient(135deg, #1976D2 0%, #1A237E 100%);
    border-radius: var(--md-radius);
    padding: 16px;
    margin-bottom: 16px;
    color: white;
    box-shadow: var(--md-shadow-2);
    position: relative;
    overflow: hidden;
}

.credits-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.credits-card h3 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    position: relative;
    z-index: 1;
}

.credit-item {
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(4px);
    border-radius: var(--md-radius-sm);
    border: 1px solid rgba(255,255,255,0.10);
}

.credit-icon {
    font-size: 16px;
    display: block;
    margin: 0 auto 2px;
    height: 16px;
    width: 16px;
}

.credit-value {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
}

.credit-label {
    font-size: 0.6rem;
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ----- Section Headers ----- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--md-text-primary);
    margin: 0;
}

/* ----- Cards (Course, Quiz, Request) ----- */
.courses-grid, .requests-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.course-card, .quiz-card, .request-item {
    background: var(--md-surface);
    border-radius: var(--md-radius);
    padding: 16px;
    box-shadow: var(--md-shadow-1);
    border: 1px solid var(--md-border);
    transition: all var(--md-transition);
    position: relative;
    overflow: hidden;
}

.course-card:hover, .quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--md-shadow-2);
    border-color: var(--md-primary-light);
}

/* Course accent line */
.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--md-primary);
    border-radius: 0 2px 2px 0;
}

.course-title, .quiz-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-text-primary);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.course-meta, .quiz-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--md-text-secondary);
    margin-bottom: 12px;
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.course-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--md-radius-pill);
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--md-success-light);
    color: var(--md-success);
}

.course-actions, .quiz-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.quiz-actions {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

/* ----- Request Item ----- */
.request-item {
    background: var(--md-surface);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.request-student {
    font-weight: 600;
    color: var(--md-text-primary);
    font-size: 0.9rem;
}

.request-time {
    font-size: 0.65rem;
    color: var(--md-text-hint);
    background: var(--md-bg);
    padding: 2px 8px;
    border-radius: var(--md-radius-pill);
}

.request-course {
    color: var(--md-primary);
    font-weight: 500;
    font-size: 0.8rem;
    margin-bottom: 12px;
    display: block;
}

.request-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ----- Buttons (Material Style) ----- */
.mcq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--md-radius-sm);
    font-weight: 500;
    font-size: 0.75rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--md-transition);
    outline: none;
    font-family: inherit;
    box-shadow: var(--md-shadow-1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.mcq-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}
.mcq-btn:active::after {
    width: 200px;
    height: 200px;
}

.mcq-btn-primary {
    background: var(--md-primary);
    color: var(--md-on-primary);
}
.mcq-btn-primary:hover { background: var(--md-primary-variant); }

.mcq-btn-success {
    background: var(--md-success);
    color: white;
}
.mcq-btn-success:hover { background: #1B5E20; }

.mcq-btn-danger {
    background: var(--md-danger);
    color: white;
}
.mcq-btn-danger:hover { background: #B71C1C; }

.mcq-btn-outline {
    background: transparent;
    border: 1px solid var(--md-border);
    color: var(--md-text-primary);
    box-shadow: none;
}
.mcq-btn-outline:hover {
    border-color: var(--md-primary);
    background: var(--md-primary-light);
    color: var(--md-primary);
}

.mcq-btn-small {
    padding: 4px 10px;
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
}

.mcq-btn-full { width: 100%; }

.desktop-only-btn { display: none; }

/* ----- Bottom Navigation (Android Style) ----- */
.mcq-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--md-surface);
    border-top: 1px solid var(--md-border);
    display: flex;
    justify-content: space-around;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.06);
    height: var(--bottom-nav-height);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--md-text-secondary);
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: var(--md-radius-sm);
    transition: all var(--md-transition);
    position: relative;
    min-width: 48px;
}

.nav-item .nav-icon {
    font-size: 20px;
    height: 20px;
    width: 20px;
    margin-bottom: 1px;
    transition: transform 0.2s;
}

.nav-item.active {
    color: var(--md-primary);
}
.nav-item.active .nav-icon {
    transform: translateY(-1px);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 16px;
    height: 2px;
    background: var(--md-primary);
    border-radius: 2px 2px 0 0;
}

.nav-badge {
    position: absolute;
    top: -2px;
    right: 2px;
    background: var(--md-danger);
    color: white;
    font-size: 0.55rem;
    padding: 1px 5px;
    border-radius: var(--md-radius-pill);
    min-width: 16px;
    text-align: center;
    font-weight: 600;
}

/* ----- Floating Action Button (FAB) ----- */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 12px);
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--md-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--md-shadow-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 99;
    transition: all var(--md-transition);
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.92); }

/* ----- Notifications (Material Dropdown) ----- */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background var(--md-transition);
}
.notification-bell:hover { background: var(--md-bg); }

.notification-dropdown {
    display: none;
    position: absolute;
    top: 42px;
    right: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--md-surface);
    border-radius: var(--md-radius);
    box-shadow: var(--md-shadow-3);
    border: 1px solid var(--md-border);
    z-index: 1000;
    animation: slideUp 0.2s ease;
}

.notification-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--md-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--md-text-primary);
    margin: 0;
}

.notification-clear {
    background: none;
    border: none;
    color: var(--md-primary);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--md-border);
    transition: background var(--md-transition);
    cursor: pointer;
    font-size: 0.85rem;
}
.notification-item:hover { background: var(--md-bg); }
.notification-item.unread { background: var(--md-primary-light); }

/* ----- Modals (Bottom Sheet on Mobile) ----- */
.mcq-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mcq-modal-content {
    background: var(--md-surface);
    width: 100%;
    max-width: 440px;
    border-radius: var(--md-radius);
    padding: 20px;
    position: relative;
    box-shadow: var(--md-shadow-3);
    animation: slideUp 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.mcq-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    line-height: 1;
    color: var(--md-text-secondary);
    cursor: pointer;
    background: var(--md-bg);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--md-transition);
}
.mcq-modal-close:hover { background: var(--md-border); }

.mcq-modal-title {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--md-text-primary);
}

/* ----- Form Elements ----- */
.mcq-form-group { margin-bottom: 16px; }
.mcq-form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--md-text-secondary);
    font-size: 0.8rem;
}

.mcq-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--md-border);
    border-radius: var(--md-radius-sm);
    font-size: 0.95rem;
    color: var(--md-text-primary);
    background: var(--md-bg);
    transition: border var(--md-transition);
    font-family: inherit;
}
.mcq-form-input:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 3px var(--md-primary-light);
}

.mcq-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* ----- Empty State ----- */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--md-text-secondary);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--md-text-hint);
    display: block;
    height: 48px;
    width: 48px;
    margin-left: auto;
    margin-right: auto;
}

/* ----- Utility Classes ----- */
.text-center { text-align: center; }
.text-muted { color: var(--md-text-secondary); }
.text-primary { color: var(--md-primary); }
.text-success { color: var(--md-success); }
.text-danger { color: var(--md-danger); }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px !important; }
.mb-2 { margin-bottom: 12px !important; }
.mb-3 { margin-bottom: 18px !important; }
.mt-2 { margin-top: 12px; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ----- Animations ----- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DESKTOP BREAKPOINT (≥1024px)
   ============================================================ */
@media (min-width: 1024px) {
    .mcq-dashboard-layout {
        flex-direction: row;
    }

    .mcq-desktop-sidebar {
        display: block;
    }

    .mcq-mobile-nav,
    .fab {
        display: none !important;
    }

    .mobile-only { display: none !important; }
    .desktop-only-btn { display: inline-flex !important; }

    .mcq-main-content {
        padding: 24px 32px 24px 24px;
        max-width: calc(100% - var(--sidebar-width));
    }

    /* Grid for cards – 2 columns on desktop */
    .courses-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .requests-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Course actions – full width buttons */
    .course-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Quiz card horizontal layout */
    .quiz-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
    }
    .quiz-card .quiz-title,
    .quiz-card .quiz-meta {
        margin: 0;
    }
    .quiz-actions {
        grid-template-columns: repeat(2, auto);
        margin-left: auto;
        gap: 8px;
    }

    .notification-dropdown {
        top: 40px;
        right: 0;
    }
}

/* ============================================================
   MOBILE ADJUSTMENTS (Bottom Sheet Modals)
   ============================================================ */
@media (max-width: 767px) {
    .mcq-modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }
    .mcq-modal-content {
        border-radius: var(--md-radius) var(--md-radius) 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        animation: slideUpBottom 0.25s ease;
    }
    @keyframes slideUpBottom {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .mcq-modal-close {
        top: 10px;
        right: 10px;
    }
}

/* ============================================================
   DARK MODE (system preference fallback)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --md-bg: #121212;
        --md-surface: #1E1E1E;
        --md-text-primary: #E0E0E0;
        --md-text-secondary: #AAAAAA;
        --md-text-hint: #777777;
        --md-border: #333333;
        --md-shadow-1: 0 1px 3px rgba(0,0,0,0.4);
        --md-shadow-2: 0 3px 6px rgba(0,0,0,0.5);
        --md-shadow-3: 0 6px 12px rgba(0,0,0,0.6);
        --md-primary-light: #1A3A5A;
        --md-success-light: #1A3A2A;
        --md-danger-light: #3A1A1A;
        --md-warning-light: #3A2A1A;
    }
}


/* 3.5.0: Course IDs, course-level student management, messaging and reliable uploads */
.mcq-builder-course-code,.course-id-chip,.cc-course-id{display:inline-flex;align-items:center;gap:5px;margin-top:4px;padding:4px 8px;border-radius:7px;background:rgba(79,70,229,.08);color:#4338ca;font-size:11px;font-weight:650;letter-spacing:.01em}
.mcq-builder-course-code strong,.course-id-chip strong,.cc-course-id strong{font-variant-numeric:tabular-nums;letter-spacing:.08em}
.course-hero-copy .hero-code{margin:2px 0 8px}
.mcq-course-students-panel{width:100%;color:var(--text-main,#1f2937)}
.mcq-students-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px;padding:16px 18px;border:1px solid rgba(148,163,184,.22);border-radius:16px;background:linear-gradient(135deg,rgba(79,70,229,.08),rgba(14,165,233,.04))}
.mcq-students-header h3{margin:0 0 4px;font-size:18px;font-weight:800}.mcq-students-header p{margin:0;color:#64748b;font-size:12px}
.mcq-students-count{display:flex;align-items:center;gap:7px;padding:8px 12px;border-radius:12px;background:#fff;border:1px solid #e2e8f0;color:#334155}.mcq-students-count strong{font-size:19px;color:#4f46e5}.mcq-students-count span{font-size:11px}
.mcq-students-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}.mcq-students-toolbar input{flex:1;min-width:220px;max-width:560px;border:1px solid #cbd5e1;border-radius:10px;padding:10px 12px;font-size:13px;background:#fff;color:#0f172a}.mcq-students-toolbar>span{font-size:11px;color:#64748b;padding:7px 10px;border-radius:8px;background:#f8fafc}.mcq-students-toolbar b{font-variant-numeric:tabular-nums;letter-spacing:.06em;color:#4338ca}
.mcq-course-student-row{display:grid;grid-template-columns:44px minmax(140px,1fr) auto auto;gap:12px;align-items:center;padding:13px 14px;margin-bottom:8px;background:#fff;border:1px solid #e2e8f0;border-radius:13px;box-shadow:0 2px 8px rgba(15,23,42,.035)}
.mcq-course-student-avatar img{width:44px;height:44px;border-radius:50%;object-fit:cover}.mcq-course-student-info{min-width:0;display:flex;flex-direction:column;gap:2px}.mcq-course-student-info strong{font-size:13px;color:#0f172a;overflow-wrap:anywhere}.mcq-course-student-info span,.mcq-course-student-info small{font-size:11px;color:#64748b;overflow-wrap:anywhere}.mcq-student-status{white-space:nowrap;font-size:10px;font-weight:750;padding:5px 8px;border-radius:999px;background:#f1f5f9;color:#475569}.mcq-student-status.status-enrolled{background:#dcfce7;color:#166534}.mcq-student-status.status-pending{background:#fef3c7;color:#92400e}.mcq-student-status.status-rejected,.mcq-student-status.status-removed,.mcq-student-status.status-left{background:#fee2e2;color:#991b1b}.mcq-student-status.status-invited{background:#dbeafe;color:#1d4ed8}
.mcq-course-student-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.mcq-course-student-actions .button{min-height:30px;padding:5px 9px;font-size:11px;line-height:1.25;border-radius:8px;border:1px solid #dbe3ee;background:#fff;color:#334155;cursor:pointer}.mcq-course-student-actions .approve-pending{background:#ecfdf5;color:#047857;border-color:#a7f3d0}.mcq-course-student-actions .reject-pending,.mcq-course-student-actions .remove-student{color:#b91c1c}.mcq-course-student-actions button:disabled{opacity:.55;cursor:wait}.mcq-student-empty{padding:28px 16px;text-align:center;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;color:#64748b;font-size:12px}.mcq-student-action-note{font-size:11px;color:#64748b}
.mcq-live-chat-layout{display:grid;grid-template-columns:minmax(220px,290px) minmax(0,1fr);gap:0;min-height:520px;border:1px solid #e2e8f0;border-radius:18px;overflow:hidden;background:#fff;box-shadow:0 12px 38px rgba(15,23,42,.07)}.mcq-live-chat-layout .chat-list-panel{background:#f8fafc;border-right:1px solid #e2e8f0;min-width:0}.mcq-live-chat-layout .cl-header{padding:17px 16px;border-bottom:1px solid #e2e8f0;display:flex;flex-direction:column;gap:4px}.mcq-live-chat-layout .cl-header strong{font-size:14px;color:#0f172a}.mcq-live-chat-layout .cl-header small{font-size:11px;color:#64748b}.mcq-live-chat-layout .cl-items{padding:8px;display:flex;flex-direction:column;gap:5px}.mcq-live-chat-layout .cl-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:1px solid transparent;border-radius:12px;background:transparent;text-align:left;cursor:pointer}.mcq-live-chat-layout .cl-item:hover,.mcq-live-chat-layout .cl-item.active{background:#fff;border-color:#dbeafe;box-shadow:0 3px 10px rgba(15,23,42,.045)}.mcq-live-chat-layout .cl-avatar{width:40px;height:40px;flex:0 0 40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e0e7ff;color:#4338ca;font-weight:800;overflow:hidden}.mcq-live-chat-layout .cl-details{min-width:0;display:flex;flex-direction:column;gap:3px;flex:1}.mcq-live-chat-layout .cl-name{font-weight:750;font-size:12px;color:#0f172a}.mcq-live-chat-layout .cl-msg{font-size:10px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mcq-live-chat-layout .cl-time{font-size:9px;color:#64748b}.mcq-live-chat-layout .chat-box-panel{min-width:0;display:flex;flex-direction:column;background:#fff}.mcq-live-chat-layout .cb-header{display:flex;align-items:center;gap:10px;min-height:67px;padding:12px 16px;border-bottom:1px solid #e2e8f0}.mcq-live-chat-layout .cb-header>span:last-child{display:flex;flex-direction:column;gap:3px}.mcq-live-chat-layout .cb-header strong{font-size:13px;color:#0f172a}.mcq-live-chat-layout .cb-header small{font-size:10px;color:#64748b}.mcq-live-chat-layout .cl-avatar.small{width:34px;height:34px;flex-basis:34px}.mcq-live-chat-layout .cl-avatar.small img,.mcq-live-chat-layout .cb-header img{width:34px;height:34px;border-radius:50%;object-fit:cover}.mcq-live-chat-layout .cb-messages{flex:1;min-height:290px;max-height:530px;overflow:auto;display:flex;flex-direction:column;gap:10px;padding:18px;background:linear-gradient(#fff,#fbfdff)}.mcq-live-chat-layout .chat-message{display:flex;flex-direction:column;max-width:min(80%,560px);gap:4px}.mcq-live-chat-layout .chat-message.me{align-self:flex-end;align-items:flex-end}.mcq-live-chat-layout .chat-message.them{align-self:flex-start;align-items:flex-start}.mcq-live-chat-layout .message-bubble{padding:10px 13px;border-radius:15px;background:#f1f5f9;color:#1e293b;font-size:12px;line-height:1.5;overflow-wrap:anywhere}.mcq-live-chat-layout .chat-message.me .message-bubble{background:#4f46e5;color:#fff;border-bottom-right-radius:5px}.mcq-live-chat-layout .chat-message.them .message-bubble{border-bottom-left-radius:5px}.mcq-live-chat-layout .message-time{font-size:9px;color:#94a3b8}.mcq-live-chat-layout .cb-input-area{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid #e2e8f0;background:#fff}.mcq-live-chat-layout .cb-input-area textarea{flex:1;min-width:0;resize:vertical;min-height:42px;max-height:120px;border:1px solid #cbd5e1;border-radius:12px;padding:11px 12px;font:inherit;font-size:12px;color:#0f172a}.mcq-live-chat-layout .cb-input-area button{width:42px;height:42px;flex:0 0 42px;border:0;border-radius:12px;background:#4f46e5;color:#fff;cursor:pointer}.mcq-live-chat-layout .cb-input-area button:disabled{opacity:.5;cursor:not-allowed}.student-chat-status{padding:0 12px 10px;min-height:12px;font-size:11px;color:#b45309}.chat-empty-state{margin:auto;text-align:center;color:#94a3b8;font-size:12px}.chat-empty-state .dashicons{font-size:28px;width:28px;height:28px;color:#a5b4fc}.mcq-course-finder-heading{display:flex;align-items:center;gap:12px}.mcq-course-finder-heading>.dashicons{font-size:25px;width:25px;height:25px;color:#4f46e5}.mcq-course-search-form{display:flex;gap:8px;margin:14px 0}.mcq-course-search-form input{flex:1;min-width:0;border:1px solid #cbd5e1;border-radius:10px;padding:10px 12px;font-size:13px}.mcq-course-search-form button,.mcq-course-join-btn{border:0;border-radius:9px;background:#4f46e5;color:#fff;padding:9px 13px;font-size:11px;font-weight:750;cursor:pointer}.mcq-course-search-result{display:flex;align-items:center;gap:12px;padding:13px;margin:8px 0;border:1px solid #e2e8f0;border-radius:13px;background:#fff}.mcq-course-search-icon{width:38px;height:38px;flex:0 0 38px;display:flex;align-items:center;justify-content:center;background:#eef2ff;color:#4f46e5;border-radius:11px}.mcq-course-search-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.mcq-course-search-copy>strong{font-size:13px;color:#0f172a}.mcq-course-search-copy p{margin:0;color:#64748b;font-size:11px}.mcq-course-search-copy small{color:#64748b;font-size:10px}.mcq-course-id-label{font-size:10px;color:#64748b}.mcq-course-id-label b{color:#4338ca;letter-spacing:.08em}.mcq-course-state{font-size:10px;font-weight:750;padding:6px 9px;border-radius:999px;white-space:nowrap}.mcq-course-state.enrolled{background:#dcfce7;color:#166534}.mcq-course-state.pending{background:#fef3c7;color:#92400e}.mcq-course-search-empty{padding:24px;text-align:center;border:1px dashed #cbd5e1;border-radius:12px;color:#64748b}.chat-window-modern{z-index:100100!important;border:1px solid rgba(148,163,184,.4)!important;border-radius:18px!important;box-shadow:0 24px 80px rgba(15,23,42,.25)!important;overflow:hidden}.chat-window-modern .chat-header{background:#4f46e5!important;color:white!important}.chat-window-modern .chat-messages{background:#f8fafc!important;gap:10px!important}.chat-window-modern .chat-message .message-bubble{max-width:100%;font-size:12px;line-height:1.55}.chat-window-modern .chat-input-area{background:#fff!important;border-top:1px solid #e2e8f0!important}.chat-window-modern #chatMessageInput{border-radius:11px!important;border:1px solid #cbd5e1!important;padding:10px 12px!important;font-size:12px!important}.chat-window-modern .chat-send-status{padding:6px 12px;font-size:10px;color:#b45309;background:#fff;min-height:0}
@media(max-width:720px){.mcq-students-header{align-items:flex-start;padding:13px}.mcq-course-student-row{grid-template-columns:38px minmax(0,1fr);gap:8px;padding:11px}.mcq-course-student-avatar img{width:38px;height:38px}.mcq-student-status{grid-column:2;justify-self:start}.mcq-course-student-actions{grid-column:1/-1;justify-content:flex-start;padding-top:3px}.mcq-live-chat-layout{grid-template-columns:1fr;min-height:0}.mcq-live-chat-layout .chat-list-panel{border-right:0;border-bottom:1px solid #e2e8f0}.mcq-live-chat-layout .cl-items{flex-direction:row;overflow-x:auto}.mcq-live-chat-layout .cl-item{width:auto;min-width:205px}.mcq-live-chat-layout .cb-messages{min-height:250px;max-height:55vh;padding:12px}.mcq-course-search-result{align-items:flex-start;flex-wrap:wrap}.mcq-course-search-action{margin-left:50px}.mcq-course-search-copy{max-width:calc(100% - 52px)}.mcq-course-search-form{flex-direction:column}.mcq-course-search-form button{width:100%}}

.mcq-student-invite-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 14px;padding:12px;border:1px solid #dbeafe;background:#f8fbff;border-radius:12px}.mcq-student-invite-form label{font-size:11px;font-weight:800;color:#334155;white-space:nowrap}.mcq-student-invite-form input[type=email]{flex:1;min-width:200px;border:1px solid #cbd5e1;border-radius:8px;padding:9px 10px;font-size:12px;background:#fff}.mcq-student-invite-form button{border:0;border-radius:8px;background:#4f46e5;color:#fff;padding:9px 12px;font-size:11px;font-weight:750;cursor:pointer}.mcq-student-invite-form button:disabled{opacity:.6;cursor:wait}.mcq-student-invite-status{flex-basis:100%;font-size:11px;color:#047857}

/* 3.5.1: group-aware roster controls, stable sorting, and theme-safe roster cards */
.mcq-course-students-panel{--mcq-roster-surface:#fff;--mcq-roster-muted:#64748b;--mcq-roster-text:#0f172a;--mcq-roster-border:#e2e8f0;min-width:0;}
.mcq-students-toolbar{display:grid!important;grid-template-columns:minmax(210px,1fr) auto auto;align-items:center;gap:10px!important;width:100%;}
.mcq-student-search-wrap{min-width:0;width:100%;}
.mcq-student-search-wrap .mcq-student-search{display:block;width:100%;max-width:none!important;min-width:0!important;min-height:42px;}
.mcq-students-filter-controls{display:flex;align-items:center;gap:8px;min-width:0;}
.mcq-students-filter-controls select{width:auto;max-width:190px;min-width:135px;min-height:42px;padding:9px 30px 9px 10px;border:1px solid #cbd5e1;border-radius:10px;background-color:#fff;color:#0f172a;font:inherit;font-size:12px;}
.mcq-students-toolbar .mcq-student-course-code{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:11px;color:#64748b;padding:7px 10px;border-radius:8px;background:#f8fafc;border:1px solid #e2e8f0;}
.mcq-students-toolbar .mcq-student-course-code b{color:#4338ca;letter-spacing:.08em;font-variant-numeric:tabular-nums;}
.mcq-course-student-row[hidden]{display:none!important;}
.mcq-student-management-list{min-width:0;}
.mcq-student-invite-form input[type=email]:focus,.mcq-students-toolbar input:focus,.mcq-students-filter-controls select:focus{outline:2px solid rgba(79,70,229,.28);outline-offset:1px;}
[data-theme="dark"] .mcq-course-students-panel,[data-theme="dark"] .mcq-course-students-panel *{color-scheme:dark;}
[data-theme="dark"] .mcq-course-students-panel{--mcq-roster-surface:#1e293b;--mcq-roster-muted:#a8b5c7;--mcq-roster-text:#f1f5f9;--mcq-roster-border:#334155;color:var(--mcq-roster-text);}
[data-theme="dark"] .mcq-course-students-panel .mcq-students-header{background:linear-gradient(135deg,rgba(99,102,241,.16),rgba(14,165,233,.08));border-color:#334155;}
[data-theme="dark"] .mcq-course-students-panel .mcq-students-header p,[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-info span,[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-info small,[data-theme="dark"] .mcq-course-students-panel .mcq-student-action-note{color:var(--mcq-roster-muted);}
[data-theme="dark"] .mcq-course-students-panel .mcq-students-count,[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-row{background:var(--mcq-roster-surface);border-color:var(--mcq-roster-border);color:var(--mcq-roster-text);}
[data-theme="dark"] .mcq-course-students-panel .mcq-students-count span,[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-info strong{color:var(--mcq-roster-text);}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-search,[data-theme="dark"] .mcq-course-students-panel .mcq-students-filter-controls select,[data-theme="dark"] .mcq-course-students-panel .mcq-student-invite-form input[type=email]{background:#0f172a!important;color:#f8fafc!important;border-color:#475569!important;}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-search::placeholder,[data-theme="dark"] .mcq-course-students-panel .mcq-student-invite-form input::placeholder{color:#94a3b8;opacity:1;}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-course-code{background:#0f172a;border-color:#334155;color:#cbd5e1;}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-invite-form{background:#111c2d;border-color:#334155;}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-invite-form label{color:#e2e8f0;}
[data-theme="dark"] .mcq-course-students-panel .mcq-student-empty{background:#111c2d;border-color:#475569;color:#cbd5e1;}
[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-actions .button{background:#0f172a;color:#e2e8f0;border-color:#475569;}
[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-actions .approve-pending{background:#064e3b;color:#d1fae5;border-color:#047857;}
[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-actions .reject-pending,[data-theme="dark"] .mcq-course-students-panel .mcq-course-student-actions .remove-student{color:#fca5a5;}
@media(max-width:900px){
  .mcq-students-toolbar{grid-template-columns:minmax(0,1fr) auto!important;}
  .mcq-students-filter-controls{grid-column:1/-1;grid-row:2;}
  .mcq-students-toolbar .mcq-student-course-code{grid-column:2;grid-row:1;justify-self:end;}
  .mcq-students-filter-controls select{flex:1;max-width:none;min-width:0;}
}
@media(max-width:600px){
  .mcq-students-toolbar{grid-template-columns:minmax(0,1fr)!important;gap:9px!important;}
  .mcq-student-search-wrap{grid-column:1;grid-row:1;}
  .mcq-students-filter-controls{grid-column:1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:100%;}
  .mcq-students-filter-controls select{width:100%;min-width:0;max-width:none;font-size:12px;padding:9px 24px 9px 9px;}
  .mcq-students-toolbar .mcq-student-course-code{grid-column:1;grid-row:3;justify-self:start;}
  .mcq-course-students-panel .mcq-students-header{flex-direction:column;gap:9px;}
  .mcq-course-students-panel .mcq-students-count{align-self:flex-start;}
  .mcq-course-student-actions .button{min-height:36px;padding:7px 10px;}
}
