/* ==================================
   Base Reset & Global Styles
================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ==================================
   Shared Logo Styles
================================== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img-wrapper {
    background: #0ea5e9;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text .title {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.logo-text .subtitle {
    font-size: 10px;
    color: #ffffff;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ==================================
   Header (Landing Page)
================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 80px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.sign-in {
    text-decoration: none;
    color: #0d70bb;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 24px;
    border: 1.5px solid #0d70bb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sign-in:hover {
    background: #f0f9ff;
}

/* ==================================
   Landing View Styles 
================================== */
main {
    flex: 1;
}

.hero {
    background: linear-gradient(263.66deg, #0c71bd 1.54%, #009de0 98.46%);
    color: #ffffff;
    padding: 150px 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 28px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.hero h1 u {
    text-decoration: none;
    border-bottom: 3px solid #ffffff;
    padding-bottom: 2px;
}

.hero p {
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    max-width: 680px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #ffffff;
    color: #0c71bd;
}

.btn-primary:hover {
    background: #f1f5f9;
}

.btn-secondary {
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    color: #ffffff;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    color: #b91c1c;
    cursor: pointer;
}

.btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
    color: #991b1b;
}

.features {
    background: #f8fafc;
    padding: 80px 80px;
    text-align: center;
}

.features-header {
    max-width: 750px;
    margin: 0 auto 56px auto;
}

.features-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.features-header p {
    font-size: 15px;
    color: #64748b;
    line-height: 1.5;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #ffffff;
    padding: 36px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.card-icon {
    color: #0c71bd;
    font-size: 28px;
    margin-bottom: 24px;
    background: #f0f9ff;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
}

.card p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

footer {
    text-align: center;
    padding: 32px 80px;
    font-size: 13px;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ==================================
   Sign In Split Container Styles 
================================== */
#signin-view {
    height: 100vh;
    overflow: hidden;
}

.split-container {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.left-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100vh;
    flex: none;
    background: linear-gradient(263.66deg, #0c71bd 1.54%, #009de0 98.46%);
    color: #ffffff;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    z-index: 1;
}

.left-panel .logo .logo-img-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.left-panel-content {
    max-width: 520px;
}

.left-panel-content h1 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.left-panel-content p {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 28px;
}

.topics-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.left-panel-footer {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.right-panel {
    flex: 1;
    margin-left: 50%;
    width: 50%;
    height: 100vh;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow-y: auto;
    overflow-x: hidden;
}

.form-container {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    flex-shrink: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #0c71bd;
}

.form-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.form-header p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 28px;
}

.role-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}

.role-card {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-card.active {
    border-color: #0c71bd;
    background: #f0f9ff;
}

.role-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.role-card-inner i {
    font-size: 20px;
    color: #0c71bd;
    margin-top: 2px;
}

.role-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.role-desc {
    font-size: 12px;
    color: #64748b;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    transition: border 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #0c71bd;
    background: #ffffff;
}

.form-group input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.form-group input[readonly]:focus {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.btn-submit {
    width: 100%;
    background: #0c71bd;
    color: #ffffff;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.btn-submit:hover {
    background: #095894;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #f8fafc;
    color: #0f172a;
}

.field-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

#reg-join-code {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.join-method-toggle {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.join-method-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

.class-switcher-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.class-switcher-wrap label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.class-switcher {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #0f172a;
    max-width: 280px;
}

.dash-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.inst-class-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.inst-class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.inst-class-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.inst-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.inst-class-card h3 {
    font-size: 18px;
    color: #0f172a;
    margin-bottom: 4px;
}

.inst-class-meta {
    font-size: 13px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.join-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #0284c7;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.inst-empty-class-banner {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    text-align: center;
}

.inst-empty-class-banner h2 {
    margin-bottom: 8px;
}

.inst-empty-class-banner p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.inst-empty-class-banner .inst-btn-add {
    background: #ffffff;
    color: #0284c7;
}

/* ==================================
   Dashboard Layout (Shared)
================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc;
}

.sidebar {
    width: 260px;
    background-color: #0b1527;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky; /* Added: Fix layout scrolling */
    top: 0;           /* Added: Fix layout scrolling */
    height: 100vh;    /* Added: Fix layout scrolling */
    z-index: 10;      /* Added: Keep sidebar in front of main content */
}

.sidebar-top {
    padding: 24px;
}

.sidebar .logo .title {
    color: #ffffff;
}

.sidebar .logo .subtitle {
    color: rgba(255, 255, 255, 0.6);
}

.nav-menu {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background-color: #0ea5e9;
    color: #ffffff;
}

.sidebar-bottom {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    padding: 8px;
    margin-left: -8px;
    margin-right: -8px;
    transition: background-color 0.2s ease;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: #0ea5e9;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.user-role {
    font-size: 12px;
    color: #94a3b8;
}

.sign-out {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.sign-out:hover {
    color: #ffffff;
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dash-header {
    background-color: #ffffff;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.dash-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.dash-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-instructor {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-campus {
    font-size: 13px;
    color: #64748b;
}

.dash-content {
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* View Sections */
.view-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 15px;
    color: #64748b;
}

/* ==================================
   Student Dashboard Components
================================== */
.welcome-banner {
    background: linear-gradient(to right, #0072b5, #009f9f);
    border-radius: 16px;
    padding: 40px;
    color: #ffffff;
    margin-bottom: 32px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.banner-text .greeting {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.banner-text h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.welcome-class-info {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.banner-text .status-msg {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 24px;
    max-width: 600px;
    line-height: 1.5;
}

.btn-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    color: #0072b5;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-banner:hover {
    background-color: #f1f5f9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 12px;
    color: #94a3b8;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Utility Color Classes */
.bg-blue-light { background-color: #e0f2fe; }
.text-blue { color: #0284c7; }
.bg-green-light { background-color: #dcfce7; }
.text-green { color: #16a34a; }
.bg-teal-light { background-color: #ccfbf1; }
.text-teal { color: #0d9488; }
.bg-indigo-light { background-color: #e0e7ff; }
.text-indigo { color: #4f46e5; }
.bg-red-light { background-color: #fee2e2; }
.text-red { color: #ef4444; }

/* Modules Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.view-all {
    font-size: 14px;
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-all:hover {
    text-decoration: underline;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.module-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.module-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.module-code {
    font-size: 12px;
    font-weight: 600;
    color: #0284c7;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
}

.badge-competent {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-developing {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-beginner {
    background-color: #fee2e2;
    color: #ef4444;
}

.module-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 24px;
    line-height: 1.4;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #0ea5e9;
    border-radius: 3px;
}

/* AI Focus Card */
.ai-focus-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ai-focus-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0284c7;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.ai-focus-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.ai-focus-card p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

.open-module-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0284c7;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.open-module-link:hover {
    text-decoration: underline;
}

/* ==================================
   Learning Modules List View 
================================== */
.learning-modules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lm-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease;
}

.lm-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.lm-card-left {
    flex: 1;
    padding-right: 40px;
}

.lm-card-right {
    flex: 0 0 350px;
}

.lm-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.lm-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.lm-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.lm-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.lm-meta i {
    margin-right: 6px;
    color: #94a3b8;
}

.lm-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
    font-size: 13px;
}

.lm-pct {
    color: #64748b;
    font-weight: 500;
}

.lm-score {
    color: #64748b;
    font-weight: 500;
}

/* ==================================
   Assessments View
================================== */
.assessments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.assessment-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease;
}

.assessment-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.ac-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ac-content {
    flex: 1;
}

.ac-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.assessment-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.ac-meta {
    font-size: 13px;
    color: #64748b;
}

.ac-action {
    flex-shrink: 0;
}

.btn-retake {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #0ea5e9;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-retake:hover {
    background-color: #0284c7;
}

.btn-retake--disabled {
    background-color: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.btn-study-module--disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.btn-study-module--disabled:hover {
    background: #f1f5f9;
}

.ai-rec-pending {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Partial content notice */
.partial-content-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.partial-content-notice i {
    color: #d97706;
    flex-shrink: 0;
}

.partial-content-notice-sm {
    margin-bottom: 16px;
    font-size: 12px;
    padding: 10px 14px;
}

/* Study module button */
.btn-study-module {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-study-module:hover {
    background: #e0f2fe;
}

.lm-card-right .btn-study-module {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}

/* Module viewer & quiz modals */
.content-modal {
    max-width: 640px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    margin: 24px auto;
}

.content-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.content-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 6px;
}

.viewer-lesson-count {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.viewer-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viewer-lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}

.viewer-lesson-item:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.viewer-lesson-item.completed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.viewer-lesson-num {
    width: 28px;
    height: 28px;
    background: #0ea5e9;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.viewer-lesson-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.viewer-lesson-item i.fa-chevron-right {
    color: #94a3b8;
    font-size: 12px;
}

.viewer-lesson-detail h4 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.lesson-objectives-label {
    font-size: 13px;
    margin-bottom: 6px;
}

.lesson-objectives {
    margin: 0 0 16px 20px;
    font-size: 13px;
    color: #475569;
}

.lesson-body {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 20px;
}

.lesson-body ul, .lesson-body ol {
    margin: 8px 0 8px 20px;
}

.lesson-body code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Word-like document viewer */
.module-viewer-modal.document-view-mode {
    max-width: min(960px, 96vw);
    width: 96%;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}

.module-viewer-modal.document-view-mode #module-viewer-header {
    display: none;
}

.module-viewer-modal.document-view-mode .viewer-lesson-detail {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lesson-document-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 70vh;
    background: #525659;
}

.lesson-doc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #2b579a;
    color: #fff;
    flex-shrink: 0;
}

.lesson-doc-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lesson-doc-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lesson-doc-toolbar-center {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

.lesson-doc-close {
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.lesson-document-canvas {
    flex: 1;
    overflow: auto;
    padding: 32px 24px 40px;
    background: #525659;
}

.lesson-document-page {
    max-width: 816px;
    min-height: 1056px;
    margin: 0 auto;
    padding: 96px 96px 112px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 12px 32px rgba(0, 0, 0, 0.18);
    color: #000000;
    font-family: Calibri, 'Segoe UI', Candara, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    text-align: left;
}

.lesson-doc-header {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d9d9d9;
}

.lesson-doc-module {
    font-size: 10pt;
    color: #595959;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lesson-doc-title {
    font-family: 'Calibri Light', Calibri, 'Segoe UI', sans-serif;
    font-size: 28pt;
    font-weight: 300;
    line-height: 1.15;
    color: #2b579a;
    margin: 0 0 10px;
}

.lesson-doc-meta {
    font-size: 10pt;
    color: #7f7f7f;
    margin: 0;
}

.lesson-doc-objectives {
    margin: 0 0 28px;
    padding: 16px 20px;
    background: #f2f6fc;
    border-left: 4px solid #2b579a;
}

.lesson-doc-objectives h2 {
    font-size: 13pt;
    font-weight: 700;
    color: #2b579a;
    margin: 0 0 10px;
}

.lesson-doc-objectives ul {
    margin: 0;
    padding-left: 22px;
}

.lesson-doc-objectives li {
    margin-bottom: 6px;
    color: #262626;
}

.lesson-doc-body {
    color: #000000;
    font-size: 11pt;
    line-height: 1.5;
}

.lesson-doc-body p {
    margin: 0 0 12pt;
    text-align: justify;
}

.lesson-doc-body h1,
.lesson-doc-body h2,
.lesson-doc-body h3 {
    font-family: 'Calibri Light', Calibri, 'Segoe UI', sans-serif;
    color: #2b579a;
    margin: 18pt 0 8pt;
    line-height: 1.2;
}

.lesson-doc-body h1 { font-size: 20pt; font-weight: 300; }
.lesson-doc-body h2 { font-size: 16pt; font-weight: 300; }
.lesson-doc-body h3 { font-size: 13pt; font-weight: 700; }

.lesson-doc-body ul,
.lesson-doc-body ol {
    margin: 0 0 12pt 36pt;
    padding: 0;
}

.lesson-doc-body li {
    margin-bottom: 4pt;
}

.lesson-doc-body strong,
.lesson-doc-body b {
    font-weight: 700;
}

.lesson-doc-body em,
.lesson-doc-body i {
    font-style: italic;
}

.lesson-doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12pt 0;
}

.lesson-doc-body th,
.lesson-doc-body td {
    border: 1px solid #bfbfbf;
    padding: 6px 8px;
    text-align: left;
}

.lesson-doc-body th {
    background: #f2f2f2;
    font-weight: 700;
}

.lesson-doc-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #3f4245;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-download-lesson {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-download-lesson:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lesson-doc-actions .btn-mark-read {
    background: #2b579a;
    border: none;
}

.lesson-doc-actions .btn-mark-read:hover {
    background: #1e3f72;
}

.module-viewer-modal.document-view-mode--native {
    max-width: min(1120px, 98vw);
    width: 98%;
}

.module-viewer-modal.document-view-mode--native .lesson-document-view--native {
    min-height: 78vh;
}

.lesson-document-canvas--native {
    padding: 20px 12px 28px;
    background: #525659;
}

.lesson-pdf-render {
    width: 100%;
}

.lesson-pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.lesson-pdf-page {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 12px 32px rgba(0, 0, 0, 0.18);
}

.lesson-docx-loading {
    color: #fff;
    text-align: center;
    padding: 40px 16px;
    font-size: 14px;
}

.lesson-doc-body--word p {
    margin: 0 0 10pt;
    text-align: left;
}

.lesson-doc-body--word table {
    width: 100%;
    border-collapse: collapse;
    margin: 10pt 0 14pt;
    font-size: 11pt;
}

.lesson-doc-body--word th,
.lesson-doc-body--word td {
    border: 1px solid #000;
    padding: 4px 6px;
    vertical-align: top;
}

.lesson-doc-body--word strong {
    font-weight: 700;
}

.lesson-doc-body--word em {
    font-style: italic;
}

.lesson-doc-body--word ul,
.lesson-doc-body--word ol {
    margin: 0 0 10pt 24pt;
    padding-left: 18pt;
}

.lesson-doc-body--word td > ol,
.lesson-doc-body--word th > ol {
    margin: 0;
    padding-left: 18pt;
}

.lesson-doc-body--word td > ul,
.lesson-doc-body--word th > ul {
    margin: 0;
    padding-left: 18pt;
}

.lesson-doc-body--word td ol ol,
.lesson-doc-body--word td ul ol {
    margin-top: 4pt;
    margin-bottom: 4pt;
}

.lesson-doc-body--word h1,
.lesson-doc-body--word h5 {
    margin: 0 0 6pt;
    font-size: inherit;
}

.lesson-doc-body--word h1 strong {
    color: #2b579a;
    font-size: 14pt;
}

.lesson-doc-body--word img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10pt 0;
}

@media (max-width: 768px) {
    .lesson-document-page {
        padding: 48px 32px 64px;
        min-height: auto;
    }

    .lesson-doc-title {
        font-size: 22pt;
    }

    .lesson-document-canvas {
        padding: 16px 12px 24px;
    }
}

.btn-back-lessons {
    background: none;
    border: none;
    color: #0ea5e9;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-mark-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-mark-read:hover {
    background: #0284c7;
}

.content-empty {
    text-align: center;
    color: #64748b;
    padding: 32px 16px;
    font-size: 14px;
}

/* Quiz */
.quiz-question {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.quiz-q-text {
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 12px;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: border-color 0.2s;
}

.quiz-option:has(input:checked) {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.quiz-option input {
    margin-top: 2px;
    flex-shrink: 0;
}

.quiz-submit-btn {
    width: 100%;
    margin-top: 8px;
}

.quiz-score-card {
    text-align: center;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 16px;
}

.quiz-score-value {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.quiz-score-msg {
    text-align: center;
    font-size: 14px;
    color: #475569;
    margin-bottom: 20px;
}

.quiz-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.quiz-feedback-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.quiz-feedback-item.correct {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.question-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.question-fields-section.hidden {
    display: none;
}

.question-matching-pairs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-matching-row {
    margin-bottom: 0;
}

.question-image-upload input[type="file"] {
    width: 100%;
    font-size: 13px;
}

.quiz-picture-wrap {
    margin-bottom: 14px;
    text-align: center;
}

.quiz-picture-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    background: #f8fafc;
}

.quiz-matching-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-matching-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.quiz-matching-left {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.quiz-matching-arrow {
    color: #64748b;
    font-size: 12px;
}

.quiz-matching-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #334155;
}

@media (max-width: 640px) {
    .quiz-matching-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .quiz-matching-arrow {
        display: none;
    }
}

.quiz-feedback-item.incorrect {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.content-modal-wide {
    max-width: 720px;
}

.form-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 12px;
}

.btn-secondary-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-manage-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.btn-manage-content:hover {
    background: #e0f2fe;
}

.content-manager-list {
    margin-bottom: 20px;
    max-height: 240px;
    overflow-y: auto;
}

.content-manager-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.content-manager-item-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.content-manager-item-info p {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-manager-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.content-manager-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.content-manager-form h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

.content-manager-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.content-manager-form .form-group input,
.content-manager-form .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.lesson-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.lesson-upload-zone.drag-over {
    border-color: #0284c7;
    background: #e0f2fe;
}

.lesson-upload-icon {
    font-size: 32px;
    color: #0284c7;
    margin-bottom: 4px;
}

.lesson-upload-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.lesson-upload-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px;
}

.lesson-file-name {
    font-size: 13px;
    font-weight: 600;
    color: #0284c7;
    margin: 4px 0 0;
    min-height: 18px;
}

.lesson-upload-status {
    font-size: 13px;
    margin: 10px 0 0;
    min-height: 18px;
}

.lesson-upload-status.success {
    color: #16a34a;
}

.lesson-upload-status.error {
    color: #dc2626;
}

.lesson-upload-status.loading {
    color: #0284c7;
}

/* ==================================
   AI Coach View
================================== */
.ai-coach-banner {
    background-color: #008f9c;
    color: #ffffff;
    border-radius: 12px;
    padding: 32px 40px;
    margin-bottom: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.banner-icon-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.ai-coach-banner h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ai-coach-banner p {
    font-size: 15px;
    opacity: 0.9;
}

.ai-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-rec-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease;
}

.ai-rec-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.ai-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-rec-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
}

.ai-rec-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-rec-items li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
}

.ai-rec-items li i {
    color: #0ea5e9;
    font-size: 14px;
    margin-top: 3px;
}

.ai-coach-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.ai-coach-banner--instructor {
    background: linear-gradient(135deg, #0f766e 0%, #008f9c 100%);
}

.ai-refresh-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.ai-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-source-badge {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
}

.ai-coach-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .ai-coach-grid {
        grid-template-columns: 1fr;
    }
}

.ai-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #008f9c;
}

.ai-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.ai-panel-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 16px;
}

.ai-focus-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ai-strength-improve {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .ai-strength-improve {
        grid-template-columns: 1fr;
    }
}

.ai-si-block h4 {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-si-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.ai-si-block ul li {
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ai-progress-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.ai-progress-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-progress-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.ai-study-plan h4 {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-study-plan ol {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.ai-rec-section-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-rec-loading {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.ai-rec-priority {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
}

.ai-rec-priority--high {
    background: #fef2f2;
    color: #dc2626;
}

.ai-rec-priority--medium {
    background: #fffbeb;
    color: #d97706;
}

.ai-rec-priority--low {
    background: #ecfdf5;
    color: #059669;
}

.ai-quiz-ai-feedback {
    margin-top: 16px;
    padding: 16px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 10px;
}

.ai-quiz-ai-feedback h4 {
    font-size: 14px;
    font-weight: 700;
    color: #0f766e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-quiz-ai-feedback ul {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.ai-trends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-trend-item {
    font-size: 13px;
    color: #475569;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #008f9c;
}

.ai-interventions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-intervention-card {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.ai-intervention-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.ai-intervention-card p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.ai-coach-landing {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.ai-coach-landing-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.ai-coach-landing-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin: 16px 0 12px;
    line-height: 1.25;
}

.ai-coach-landing-header p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
}

.ai-coach-landing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ai-coach-landing-grid {
        grid-template-columns: 1fr;
    }
}

.ai-coach-landing-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.ai-coach-landing-card--instructor {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.ai-coach-landing-card .acl-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ecfeff;
    color: #008f9c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.ai-coach-landing-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

.ai-coach-landing-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-coach-landing-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ai-coach-landing-card ul li i {
    color: #10b981;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ==================================
   Instructor Dashboard Views
================================== */
.student-list-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.sl-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.sl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.sl-item:last-child {
    border-bottom: none;
}

.sl-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-light {
    background-color: #e0f2fe;
    color: #0284c7;
}

.sl-info {
    display: flex;
    flex-direction: column;
}

.sl-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.sl-email {
    font-size: 12px;
    color: #64748b;
}

.sl-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 320px;
    justify-content: flex-end;
}

.sl-pct {
    font-size: 13px;
    color: #64748b;
    width: 35px;
    text-align: right;
}

.sl-bar {
    width: 130px;
}

.sl-stats .badge {
    width: 90px;
}

.inst-mod-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.inst-mod-left {
    display: flex;
    flex-direction: column;
}

.im-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.im-val {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

/* ==================================
   Instructor - Students View
================================== */
.search-bar-container {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.search-bar-container i {
    color: #94a3b8;
    margin-right: 12px;
    font-size: 16px;
}

.search-bar-container input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
}

.search-bar-container input::placeholder {
    color: #94a3b8;
}

/* Students Table */
.students-table-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 900px;
}

.students-table th {
    background-color: #f8fafc;
    padding: 16px 24px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.students-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.students-table tr:last-child td {
    border-bottom: none;
}

.st-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

.st-email {
    font-size: 12px;
    color: #64748b;
}

.st-overall {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 140px;
}

.st-overall .progress-bar {
    flex: 1;
}

.st-pct {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    width: 32px;
}

.st-score {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.badge-excellent {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-active {
    background-color: #e0f2fe;
    color: #0284c7;
}

.badge-at-risk {
    background-color: #fee2e2;
    color: #ef4444;
}

/* ==================================
   Instructor - Competencies View
================================== */
.competencies-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comp-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comp-code {
    font-size: 13px;
    font-weight: 500;
    color: #0284c7;
}

.comp-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 24px;
}

.comp-body {
    display: flex;
    align-items: center;
    gap: 40px;
}

.comp-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.comp-label {
    font-size: 13px;
    color: #64748b;
    width: 100px;
}

.comp-progress-container .progress-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
}

.comp-pct {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    width: 35px;
    text-align: right;
}

.comp-stats-blocks {
    display: flex;
    gap: 12px;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    min-width: 80px;
}

.stat-block .sb-val {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-block .sb-label {
    font-size: 12px;
    font-weight: 500;
}

.block-green {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.block-yellow {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.block-red {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

/* Instructor: Form Input Grid Layout */
.form-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ==================================
   Modal Overlays and Layout
================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 100%;
    max-width: 650px;
    margin: 24px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #0f172a;
}

.signout-modal {
    max-width: 420px;
    text-align: center;
}

.signout-modal-body {
    padding: 8px 0 24px;
}

.signout-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.signout-modal h3 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.signout-modal p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.signout-modal-actions {
    display: flex;
    gap: 12px;
}

.btn-signout-cancel,
.btn-signout-confirm {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, color 0.2s;
}

.btn-signout-cancel {
    background: #f1f5f9;
    color: #334155;
}

.btn-signout-cancel:hover {
    background: #e2e8f0;
}

.btn-signout-confirm {
    background: #dc2626;
    color: #ffffff;
}

.btn-signout-confirm:hover {
    background: #b91c1c;
}

.app-dialog-modal .signout-modal-actions.app-dialog-actions-single {
    justify-content: center;
}

.app-dialog-modal .app-dialog-actions-single .btn-dialog-primary,
.app-dialog-modal .app-dialog-actions-single .btn-signout-confirm {
    flex: 0 1 auto;
    min-width: 120px;
}

.btn-dialog-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-dialog-primary:hover {
    background: #1d4ed8;
}

.dialog-icon-info {
    background: #eff6ff;
    color: #2563eb;
}

.dialog-icon-success {
    background: #f0fdf4;
    color: #16a34a;
}

.dialog-icon-warning {
    background: #fffbeb;
    color: #d97706;
}

.dialog-icon-error,
.dialog-icon-danger {
    background: #fef2f2;
    color: #dc2626;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================================
   Instructor - Edit Modules View
================================== */
.inst-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.inst-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #0ea5e9;
    color: #ffffff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.35);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.inst-btn-add:hover {
    background-color: #0284c7;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.inst-btn-add:active {
    transform: translateY(1px);
}

.inst-modules-stats {
    margin-bottom: 28px;
}

.inst-modules-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.inst-module-search {
    flex: 1;
    margin-bottom: 0;
}

.inst-modules-result-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.inst-modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.inst-module-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.inst-module-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.inst-module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.inst-module-card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.inst-module-card-header .module-code {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.inst-module-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.inst-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.inst-icon-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background-color: #f0f9ff;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.12);
}

.inst-icon-btn-danger:hover {
    border-color: #fca5a5;
    color: #dc2626;
    background-color: #fef2f2;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.1);
}

.inst-module-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    margin: 0;
}

.inst-module-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.inst-module-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.inst-module-meta span i {
    margin-right: 6px;
    color: #94a3b8;
}

.inst-modules-empty .inst-btn-add {
    margin: 0 auto;
}

/* ==================================
   Profile Settings View
================================== */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    align-items: flex-start;
}

.profile-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 32px;
}

.profile-card-summary {
    text-align: center;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 28px;
    margin: 0 auto 16px;
}

.profile-card-summary h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.profile-card-summary p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
}

.profile-role-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
}

.profile-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
    gap: 16px;
}

.profile-details-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.profile-details-header p {
    font-size: 12px;
    color: #64748b;
}

.profile-edit-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-fields label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}

.profile-fields input[readonly] {
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    width: 100%;
    box-sizing: border-box;
}

.field-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    display: block;
}

.profile-modal {
    max-width: 500px;
}

.profile-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 8px;
}

.profile-modal-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.profile-modal-tab:hover {
    color: #334155;
}

.profile-modal-tab.active {
    background: #ffffff;
    color: #0ea5e9;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.profile-modal-tab-panel {
    min-height: 180px;
}

.profile-tab-intro {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

.profile-modal h3 {
    margin-bottom: 20px;
    color: #0f172a;
}

.profile-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-form-fields label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}

.profile-form-fields input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.profile-form-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 8px 0;
}

.profile-form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.profile-summary-stats {
    margin-top: 20px;
    font-size: 13px;
    color: #64748b;
}

.profile-sidebar-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-sidebar-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
}

.profile-sidebar-btn.active {
    background-color: #0284c7;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.profile-manage-link-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.profile-manage-link-btn:hover {
    background: #eff6ff;
    border-color: #bae6fd;
}

.profile-summary-stats strong {
    color: #0f172a;
    font-weight: 700;
}

.profile-stat-divider {
    margin: 0 8px;
    color: #cbd5e1;
}

.profile-section-block {
    border-top: 1px solid #e2e8f0;
    margin-top: 28px;
    padding-top: 28px;
}

.profile-section-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.profile-manage-link {
    font-size: 13px;
    font-weight: 600;
    color: #0ea5e9;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-manage-link:hover {
    color: #0284c7;
}

.profile-join-code-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.profile-join-code-row input[readonly] {
    flex: 1;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.profile-copy-btn {
    flex-shrink: 0;
    padding: 0 16px;
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.profile-copy-btn:hover {
    background: #dbeafe;
}

.profile-teaching-empty {
    text-align: center;
    padding: 24px 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

.profile-teaching-empty i {
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.profile-teaching-empty h4 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px;
}

.profile-teaching-empty p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
}

.profile-teaching-empty p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
}

.profile-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-secondary-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.profile-secondary-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.profile-pref-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-pref-list .form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
}

.profile-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.profile-pref-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-pref-info strong {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.profile-pref-info span {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.profile-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.profile-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.profile-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
}

.profile-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.profile-toggle input:checked + .profile-toggle-slider {
    background: #0ea5e9;
}

.profile-toggle input:checked + .profile-toggle-slider::before {
    transform: translateX(20px);
}

.profile-save-prefs-btn {
    margin-top: 20px;
    margin-bottom: 0;
    background-color: #16a34a;
    border: none;
    padding: 12px 24px;
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-save-prefs-btn:hover {
    background-color: #15803d;
}

.inst-notify-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.inst-notify-banner.hidden {
    display: none;
}

.inst-notify-banner-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.inst-notify-banner-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.inst-notify-banner i {
    margin-top: 2px;
    flex-shrink: 0;
}

.inst-notify-banner button {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0 4px;
    font-size: 16px;
}

.inst-notify-banner button:hover {
    opacity: 1;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.inst-notify-bell-wrap {
    position: relative;
}

.inst-notify-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.inst-notify-bell-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.inst-notify-bell-btn i {
    font-size: 18px;
}

.inst-notify-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #ffffff;
}

.inst-notify-badge.hidden {
    display: none;
}

.inst-notify-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    z-index: 200;
    overflow: hidden;
}

.inst-notify-dropdown.hidden {
    display: none;
}

.inst-notify-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.inst-notify-dropdown-header strong {
    font-size: 14px;
    color: #0f172a;
}

.inst-notify-mark-all {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.inst-notify-mark-all:hover:not(.disabled) {
    color: #0369a1;
    text-decoration: underline;
}

.inst-notify-mark-all.disabled {
    color: #94a3b8;
    cursor: default;
}

.inst-notify-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.inst-notify-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
}

.inst-notify-item:last-child {
    border-bottom: none;
}

.inst-notify-item:hover {
    background: #f8fafc;
}

.inst-notify-item.is-read {
    opacity: 0.72;
}

.inst-notify-item-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eff6ff;
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inst-notify-item-body {
    flex: 1;
    min-width: 0;
}

.inst-notify-item-title {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
}

.inst-notify-item-title strong {
    color: #0f172a;
}

.inst-notify-item-section {
    color: #0284c7;
    font-weight: 600;
}

.inst-notify-item-meta {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inst-notify-unread-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: #0284c7;
}

.inst-notify-empty {
    padding: 32px 20px;
    text-align: center;
    color: #64748b;
}

.inst-notify-empty i {
    font-size: 28px;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.inst-notify-empty p {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.inst-notify-empty span {
    font-size: 12px;
    line-height: 1.5;
}

.profile-save-btn {
    margin-bottom: 0;
    margin-top: 24px;
    background-color: #0ea5e9;
    border: none;
    padding: 12px 24px;
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.inst-modules-empty {
    text-align: center;
    padding: 64px 24px;
    background-color: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin-bottom: 40px;
}

.inst-modules-empty i {
    font-size: 40px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.inst-modules-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.inst-modules-empty p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    #signin-view,
    .split-container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    .split-container { flex-direction: column; }
    .left-panel {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 350px;
        padding: 40px;
    }
    .right-panel {
        margin-left: 0;
        width: 100%;
        height: auto;
        min-height: auto;
        overflow-y: visible;
        padding: 40px 20px;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modules-grid { grid-template-columns: 1fr; }
    .inst-modules-grid { grid-template-columns: 1fr; }
    .inst-page-header { flex-direction: column; align-items: stretch; }
    .inst-modules-toolbar { flex-direction: column; align-items: stretch; }
    .profile-layout { grid-template-columns: 1fr; }
    .lm-card { flex-direction: column; align-items: flex-start; gap: 24px; }
    .lm-card-left { padding-right: 0; }
    .lm-card-right { width: 100%; flex: auto; }
    
    .comp-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
    
    .form-input-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header, .hero, .features, footer { padding: 24px; }
    .hero h1 { font-size: 36px; }
    .cards { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .split-container { flex-direction: column; }
    .left-panel { display: none; }
    .right-panel {
        margin-left: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        padding: 40px 24px;
    }
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .dash-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 24px; }
    .dash-header-actions { margin-left: 0; width: 100%; justify-content: space-between; }
    .dash-content { padding: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
    .sl-item { flex-direction: column; align-items: flex-start; gap: 16px; }
    .sl-stats { width: 100%; justify-content: space-between; }
    
    .sl-item { position: relative; padding-bottom: 60px; }
    .sl-actions { position: absolute; bottom: 16px; right: 24px; }
}

/* Interactive Lessons */
.lesson-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.lesson-type-read { background: #f1f5f9; color: #64748b; }
.lesson-type-quiz { background: #dbeafe; color: #2563eb; }
.lesson-type-video { background: #ccfbf1; color: #0d9488; }
.lesson-type-simulation { background: #ede9fe; color: #7c3aed; }
.lesson-type-activity { background: #dcfce7; color: #16a34a; }

.viewer-lesson-item {
    flex-wrap: wrap;
    gap: 8px;
}

.viewer-lesson-item .lesson-type-badge {
    margin-left: auto;
}

.interactive-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.interactive-lessons-grid > .content-empty,
.modules-grid > .content-empty {
    grid-column: 1 / -1;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.interactive-lessons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.interactive-lesson-card-student {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.interactive-lesson-card-student:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
}

.interactive-lesson-card-student.completed {
    border-color: #86efac;
    background: #f0fdf4;
}

.interactive-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.interactive-lesson-card-student h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.interactive-card-module {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.interactive-card-desc {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.5;
}

.interactive-lesson-view {
    padding: 0 0 24px;
}

.interactive-lesson-meta {
    font-size: 12px;
    color: #64748b;
    padding: 0 24px 12px;
}

.interactive-intro {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    padding: 0 24px 20px;
    margin: 0;
}

.interactive-video-wrap {
    padding: 0 24px 20px;
}

.interactive-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    background: #0f172a;
}

.interactive-video-player {
    width: 100%;
    border-radius: 8px;
    background: #0f172a;
}

.interactive-quiz-questions {
    padding: 0 24px;
}

.simulation-scenario {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 24px 20px;
}

.simulation-scenario h4 {
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 8px;
}

.simulation-scenario p {
    font-size: 14px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.simulation-progress {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simulation-step {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s, border-color 0.2s;
}

.simulation-step.active {
    opacity: 1;
    pointer-events: auto;
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.simulation-step.completed {
    opacity: 0.7;
    pointer-events: none;
    border-color: #86efac;
    background: #f0fdf4;
}

.simulation-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.simulation-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0ea5e9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.simulation-step.completed .simulation-step-num {
    background: #16a34a;
}

.simulation-step p {
    font-size: 13px;
    color: #475569;
    margin: 0 0 8px;
    line-height: 1.5;
}

.simulation-action {
    font-size: 12px;
    color: #0ea5e9;
    font-weight: 600;
}

.activity-checklist {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-task-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.activity-task-item:has(input:checked) {
    border-color: #86efac;
    background: #f0fdf4;
}

.activity-task-item input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
    flex-shrink: 0;
}

.activity-task-content strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 4px;
}

.activity-task-content p {
    font-size: 13px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.activity-hint {
    display: block;
    font-size: 12px;
    color: #d97706;
    margin-top: 6px;
}

.interactive-form {
    padding: 0 4px;
}

.interactive-form .form-group input,
.interactive-form .form-group textarea,
.interactive-form .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition: border 0.2s, background 0.2s;
    box-sizing: border-box;
}

.interactive-form .form-group textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

.interactive-form .form-group input:focus,
.interactive-form .form-group textarea:focus,
.interactive-form .form-group select:focus {
    outline: none;
    border-color: #0c71bd;
    background: #ffffff;
}

.interactive-form .form-input-grid .form-group.form-group-full {
    grid-column: 1 / -1;
}

.interactive-fields-section .form-group input,
.interactive-fields-section .form-group textarea,
.interactive-fields-section .form-group select,
.interactive-dynamic-item input,
.interactive-dynamic-item textarea,
.interactive-dynamic-item select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border 0.2s, background 0.2s;
    box-sizing: border-box;
}

.interactive-dynamic-item textarea,
.interactive-fields-section .form-group textarea {
    min-height: 72px;
    resize: vertical;
    line-height: 1.5;
}

.interactive-dynamic-item input:focus,
.interactive-dynamic-item textarea:focus,
.interactive-dynamic-item select:focus,
.interactive-fields-section .form-group input:focus,
.interactive-fields-section .form-group textarea:focus,
.interactive-fields-section .form-group select:focus {
    outline: none;
    border-color: #0c71bd;
    background: #ffffff;
}

.interactive-dynamic-item .form-group label,
.interactive-fields-section .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.interactive-dynamic-item .form-group {
    margin-bottom: 12px;
}

.interactive-fields-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.interactive-fields-section h4 {
    font-size: 15px;
    color: #0f172a;
    margin-bottom: 8px;
}

.interactive-dynamic-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.interactive-dynamic-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.interactive-dynamic-item-header strong {
    font-size: 13px;
    color: #0f172a;
}

.dept-inbox-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#dept-inbox-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dept-inbox-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    min-height: 520px;
}

.dept-inbox-list-wrap,
.dept-inbox-detail-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.dept-inbox-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 13px;
    color: #64748b;
}

.dept-inbox-list {
    max-height: 560px;
    overflow-y: auto;
}

.dept-inbox-empty,
.dept-inbox-detail-empty {
    padding: 48px 24px;
    text-align: center;
    color: #94a3b8;
}

.dept-inbox-detail-empty i {
    font-size: 42px;
    margin-bottom: 12px;
}

.dept-inbox-item {
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    padding: 14px 16px;
    cursor: pointer;
}

.dept-inbox-item:hover,
.dept-inbox-item.is-active {
    background: #f0f9ff;
}

.dept-inbox-item.is-unread {
    background: #eff6ff;
}

.dept-inbox-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.dept-inbox-item-top strong {
    font-size: 14px;
    color: #0f172a;
}

.dept-inbox-item-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.dept-inbox-item-subject {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

.dept-inbox-item-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.dept-inbox-item-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.dept-inbox-item-status-approved {
    background: #dcfce7;
    color: #166534;
}

.dept-inbox-item-status-rejected,
.dept-inbox-item-status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.dept-inbox-detail {
    padding: 24px;
}

.dept-inbox-detail-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.dept-inbox-detail-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.dept-inbox-detail-body {
    margin: 24px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.6;
}

.dept-inbox-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dept-inbox-detail-actions .btn-secondary,
.dept-db-accounts-table .btn-secondary {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

.dept-inbox-detail-actions .btn-secondary:hover,
.dept-db-accounts-table .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.dept-inbox-detail-actions .btn-danger,
.dept-db-accounts-table .btn-danger {
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    color: #b91c1c;
}

.dept-inbox-detail-actions .btn-danger:hover,
.dept-db-accounts-table .btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
    color: #991b1b;
}

.dept-inbox-detail-note {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
}

.dept-db-accounts {
    margin-top: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.dept-db-accounts-note {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

.dept-db-accounts-content h3 {
    margin: 16px 0 8px;
    font-size: 16px;
}

.dept-db-accounts-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.dept-db-accounts-table th,
.dept-db-accounts-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

.dept-db-accounts-table th {
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 960px) {
    .dept-inbox-layout {
        grid-template-columns: 1fr;
    }
}

/* Completion Certificate */
.certificate-modal-wrap {
    max-width: min(980px, 96vw);
    width: 96%;
    padding: 0;
    overflow: hidden;
    background: #eef1f4;
}

.certificate-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.btn-certificate-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-certificate-download:hover {
    background: #0284c7;
}

.certificate-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 6px;
}

.btn-certificate-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #c9a227 0%, #e8c547 50%, #b8860b 100%);
    color: #1a1208;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}

.btn-certificate-view:hover {
    filter: brightness(1.05);
}

.quiz-results-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.completion-certificate {
    position: relative;
    margin: 20px;
    aspect-ratio: 1.414 / 1;
    min-height: 420px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.cert-frame {
    position: absolute;
    inset: 18px 110px 18px 18px;
    border: 2px solid #c9a227;
    pointer-events: none;
}

.cert-corner-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #d4af37 0%, #f5e6a8 40%, #b8860b 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    opacity: 0.95;
}

.cert-corner-ribbon::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: inset 0 0 0 4px rgba(184, 134, 11, 0.35);
}

.cert-side-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 92px;
    height: 100%;
    background: #111;
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.cert-side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #d4af37, #f5e6a8, #b8860b);
}

.cert-seal {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a2a2a, #0a0a0a);
    border: 4px solid #d4af37;
    box-shadow: 0 0 0 3px #111, 0 0 0 6px #c9a227;
    z-index: 2;
}

.cert-seal::after {
    content: '★';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4af37;
    font-size: 28px;
}

.cert-curl {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e8c547 0%, #b8860b 100%);
    clip-path: polygon(0 100%, 100% 100%, 0 0);
    opacity: 0.85;
}

.cert-waves {
    position: absolute;
    left: 24px;
    right: 120px;
    bottom: 28px;
    height: 40px;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(201, 162, 39, 0.15) 18px, rgba(201, 162, 39, 0.15) 20px),
        linear-gradient(180deg, transparent, rgba(201, 162, 39, 0.08));
    pointer-events: none;
}

.cert-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 120px 56px 56px;
}

.cert-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #111;
    margin: 0;
    line-height: 1.1;
}

.cert-subheading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 700;
    letter-spacing: 0.35em;
    color: #111;
    margin: 6px 0 20px;
}

.cert-presented {
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    margin: 0 0 10px;
}

.cert-recipient {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(36px, 5vw, 56px);
    color: #c9a227;
    margin: 0 0 8px;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.cert-name-line {
    width: min(320px, 70%);
    height: 2px;
    background: linear-gradient(90deg, transparent, #888, transparent);
    margin: 0 auto 20px;
}

.cert-body {
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: clamp(12px, 1.6vw, 15px);
    line-height: 1.65;
    color: #222;
    max-width: 520px;
    margin: 0;
}

.cert-meta {
    margin-top: 16px;
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 12px;
    color: #666;
    letter-spacing: 0.04em;
}

@media (max-width: 720px) {
    .completion-certificate {
        margin: 12px;
        min-height: 360px;
    }

    .cert-frame {
        inset: 12px 72px 12px 12px;
    }

    .cert-side-panel {
        width: 56px;
    }

    .cert-seal {
        width: 56px;
        height: 56px;
        right: 8px;
    }

    .cert-seal::after {
        font-size: 18px;
    }

    .cert-content {
        padding: 36px 72px 44px 32px;
    }
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
}

.sidebar-backdrop.hidden {
    display: none;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(88vw, 320px);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 1000;
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-top {
        padding: 20px 16px;
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
    }

    .nav-menu {
        margin-top: 24px;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 15px;
    }

    .sidebar-bottom {
        padding: 16px;
    }

    .dashboard-main {
        width: 100%;
        min-width: 0;
    }

    .dash-header {
        position: sticky;
        top: 0;
        z-index: 20;
        background: #f8fafc;
        padding: 12px 16px;
        gap: 10px;
    }

    .dash-content {
        padding: 16px;
    }

    .dash-title {
        font-size: 18px;
    }

    .dash-campus,
    .dash-instructor {
        font-size: 12px;
    }

    .class-switcher-wrap {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .class-switcher {
        max-width: none;
        width: 100%;
    }

    .dash-header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .stats-grid,
    .modules-grid,
    .interactive-lessons-grid,
    .interactive-lessons-list,
    .ai-coach-grid,
    .ai-strength-improve {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        padding: 20px;
    }

    .welcome-banner h1 {
        font-size: 24px;
    }

    .modal-content,
    .modal-box {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        margin: 12px;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }

    .dept-inbox-layout {
        grid-template-columns: 1fr;
    }

    .dept-inbox-list-wrap,
    .dept-inbox-detail-wrap {
        min-height: auto;
    }

    .dept-db-accounts-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .inst-class-card-header,
    .inst-class-card-actions,
    .dept-inbox-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .btn-submit,
    .btn-secondary-outline,
    .btn-danger {
        min-height: 44px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .class-switcher {
        font-size: 16px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #certificate-modal,
    #certificate-modal * {
        visibility: visible;
    }

    #certificate-modal {
        position: fixed;
        inset: 0;
        background: #fff;
        display: block !important;
        z-index: 99999;
    }

    .certificate-modal-toolbar {
        display: none !important;
    }

    .certificate-modal-wrap {
        max-width: none;
        width: 100%;
        box-shadow: none;
    }

    .completion-certificate {
        margin: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* System admin API control */
.admin-control-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-control-shell {
    width: min(640px, 100%);
}

.admin-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    color: #f8fafc;
}

.admin-control-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-control-brand i {
    font-size: 28px;
    color: #38bdf8;
}

.admin-control-brand h1 {
    margin: 0;
    font-size: 24px;
}

.admin-control-brand p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

.admin-control-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}

.admin-control-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}

.admin-control-status.is-off {
    background: #fef2f2;
    color: #b91c1c;
}

.admin-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.admin-control-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #0f172a;
}

.admin-control-desc,
.admin-control-note,
.admin-control-warning {
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

.admin-control-warning {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
}

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 28px 0 12px;
}

.admin-toggle-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.admin-toggle-label.off { color: #ef4444; }
.admin-toggle-label.on { color: #16a34a; }

.admin-toggle-switch {
    position: relative;
    display: inline-block;
    width: 84px;
    height: 44px;
}

.admin-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ef4444;
    transition: 0.25s;
    border-radius: 999px;
}

.admin-toggle-slider:before {
    position: absolute;
    content: "";
    height: 34px;
    width: 34px;
    left: 5px;
    bottom: 5px;
    background: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.admin-toggle-switch input:checked + .admin-toggle-slider {
    background: #16a34a;
}

.admin-toggle-switch input:checked + .admin-toggle-slider:before {
    transform: translateX(40px);
}

.api-disabled-banner {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #991b1b;
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
}

.api-disabled-banner i {
    margin-right: 8px;
}