t* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #58cc02;
    --primary-dark: #46a302;
    --primary-light: #7ee32e;
    --secondary: #1cb0f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #2b2b2b;
    --light: #f7f7f7;
    --white: #ffffff;
    --border: #e2e8f0;
    --text-muted: #64748b;
    --gradient: linear-gradient(135deg, #58cc02 0%, #1cb0f6 100%);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --sidebar-width: 260px;
    --top-nav-height: 70px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.lesson-pager { display:flex; align-items:center; gap:.5rem; }
.lesson-page { font-weight:800; color: var(--text-muted); min-width: 48px; text-align:center; }

.lesson-content{
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  padding: 1rem;
  min-height: 160px;
  max-height: 320px;
  overflow: auto;
  line-height: 1.65;
}

.lesson-content h3, .lesson-content h4 {
  margin: .2rem 0 .6rem;
}
.lesson-content p { margin: 0 0 .75rem; color: var(--dark); font-weight: 600; }
.lesson-content .muted { color: var(--text-muted); font-weight: 700; }


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(88, 204, 2, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(28, 176, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== TOP NAVBAR ========== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(88, 204, 2, 0.1);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    letter-spacing: -0.02em;
    transition: all 0.3s;
}

.logo::before {
    content: none;
    display: none;
}

.logo .logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.logo:hover .logo-img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.upload-quick-btn {
    background: var(--gradient);
    color: var(--white);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(88, 204, 2, 0.2);
}

.upload-quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.35);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-greeting i {
    color: var(--primary);
    font-size: 1.2rem;
}

.user-greeting strong {
    color: var(--dark);
}

.logout-btn {
    background: var(--light);
    color: var(--danger);
    padding: 0.7rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.logout-btn:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
    transform: scale(1.05);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: var(--top-nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--top-nav-height));
    background: var(--white);
    border-right: 1px solid var(--border);
    z-index: 900;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
    overflow-y: auto;
}

.sidebar-nav-label {
    padding: 0.85rem 2rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    opacity: 1;
    border-bottom: 1px solid rgba(88, 204, 2, 0.2);
    margin: 0 0.5rem 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav-label::before {
    content: "";
    width: 4px;
    height: 1rem;
    background: linear-gradient(180deg, var(--primary), rgba(88, 204, 2, 0.5));
    border-radius: 2px;
}

.sidebar-classes {
    margin-bottom: 0.5rem;
}

.sidebar-classes .nav-item {
    padding-left: 2.5rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar-classes .nav-item:hover {
    border-left-color: rgba(88, 204, 2, 0.4);
}

.sidebar-classes .nav-item.active {
    border-left-color: var(--primary);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    position: relative;
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(88, 204, 2, 0.1) 0%, transparent 100%);
    border-left-color: var(--primary);
    font-weight: 700;
}

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

.sidebar-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-version i {
    color: var(--primary);
    font-size: 1rem;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--top-nav-height);
    min-height: calc(100vh - var(--top-nav-height));
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    display: none;
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-content.active {
    display: block;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card.primary .stat-icon {
    background: linear-gradient(135deg, #58cc02 0%, #46a302 100%);
}

.stat-card.success .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.warning .stat-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card.info .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    color: var(--dark);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    font-family: 'Space Mono', monospace;
}

/* ========== DASHBOARD SECTIONS ========== */
.dashboard-section {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.section-header h2 {
    color: var(--dark);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.section-header h2 i {
    color: var(--primary);
}

.link-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-btn:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

/* ========== ACTIVITY LIST ========== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.activity-item:hover {
    border-color: var(--primary);
    background: var(--white);
    transform: translateX(5px);
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.3rem;
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.2rem;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    color: var(--dark);
    font-size: 1rem;
}

.action-card i {
    font-size: 2.5rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.action-card:hover {
    background: var(--gradient);
    color: var(--white);
    border-color: transparent;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(88, 204, 2, 0.3);
}

.action-card:hover i {
    color: var(--white);
    transform: scale(1.2);
}

/* ========== COURSES GRID ========== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.course-card.locked {
    opacity: 0.6;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.course-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.8rem;
}

.course-card.locked .course-icon {
    background: var(--text-muted);
}

.course-badge {
    background: var(--success);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.course-badge:not(.active) {
    background: var(--text-muted);
}

.course-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.course-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.course-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 10px;
    background: var(--light);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 50px;
    transition: width 0.5s;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ========== RESULTS ========== */
.results-container {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}

.result-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(88, 204, 2, 0.15);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.result-id {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.result-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fb-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border-left: 6px solid var(--primary);
    padding: 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.fb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.fb-box {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.fb-box:hover {
    border-color: var(--primary);
}

.fb-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--dark);
}

.fb-title i {
    color: var(--primary);
}

.fb-list {
    padding-left: 1.2rem;
}

.fb-list li {
    margin-bottom: 0.5rem;
    color: var(--dark);
    line-height: 1.5;
}

.fb-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fb-metric {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s;
}

.fb-metric:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.fb-metric-k {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.fb-metric-v {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    font-family: 'Space Mono', monospace;
}

.fb-details {
    border-top: 2px dashed var(--border);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.fb-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.2s;
    padding: 0.5rem;
    border-radius: 8px;
}

.fb-details summary:hover {
    color: var(--primary);
    background: var(--light);
}

.fb-details-inner {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.fb-subdetails {
    background: var(--light);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.fb-subdetails summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--dark);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.fb-subdetails summary:hover {
    background: var(--white);
    color: var(--primary);
}

.fb-pre {
    margin-top: 1rem;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.muted {
    color: var(--text-muted);
}

/* ========== UPLOAD SECTION ========== */
.upload-container {
    display: grid;
    gap: 2rem;
}

.upload-card {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px dashed var(--border);
    text-align: center;
}

.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    border-radius: 16px;
    background: var(--light);
    border: 2px dashed var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 2rem;
}

.upload-drop:hover {
    background: rgba(88, 204, 2, 0.05);
    border-color: var(--primary-dark);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
}

.upload-drop h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.upload-drop p {
    color: var(--text-muted);
    font-weight: 500;
}

.upload-drop small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.upload-status {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
}

.upload-tips {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border-left: 6px solid var(--primary);
    padding: 2rem;
    border-radius: 16px;
}

.upload-tips h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.upload-tips h3 i {
    color: var(--warning);
}

.upload-tips ul {
    list-style: none;
    padding: 0;
}

.upload-tips li {
    padding: 0.7rem 0;
    color: var(--dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.upload-tips li i {
    color: var(--success);
    font-size: 1.1rem;
}

/* Camera recording section */
.camera-record-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.camera-record-header h3 {
    margin: 0 0 0.35rem 0;
}

.camera-record-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.camera-preview-wrap {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.camera-preview {
    width: 100%;
    max-height: 320px;
    border-radius: 16px;
    border: 2px solid var(--border);
    object-fit: cover;
    background: #000;
}

.camera-note {
    font-size: 0.85rem;
}

.upload-limit-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    color: var(--dark);
}
.upload-limit-banner i {
    font-size: 1.25rem;
    color: var(--warning);
    flex-shrink: 0;
}
.upload-limit-banner a {
    color: var(--primary);
    font-weight: 600;
}
.upload-card.upload-limit-reached .upload-drop {
    pointer-events: none;
    opacity: 0.6;
}
.upload-card.upload-limit-reached .camera-record-controls button {
    pointer-events: none;
    opacity: 0.6;
}

/* ========== SETTINGS ========== */
.settings-container {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.settings-card {
    display: grid;
    gap: 1.5rem;
}

.setting-item {
    display: grid;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 700;
    color: var(--dark);
    font-size: 0.9rem;
}

.input-field {
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.1);
}

.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: var(--light);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.setting-toggle strong {
    color: var(--dark);
    font-size: 1rem;
    display: block;
    margin-bottom: 0.2rem;
}

.setting-toggle p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.4s;
    border-radius: 50px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--gradient);
}

input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.data-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: var(--light);
    border-radius: 12px;
    font-weight: 600;
}

.data-stat strong {
    color: var(--primary);
    font-size: 1.2rem;
}

/* ========== BUTTONS ========== */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.9rem 2rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(88, 204, 2, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* Modal overlay for settings (change password, email, delete) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
}
.modal-close:hover {
    color: var(--dark);
}
.modal-body {
    padding: 1.5rem;
}
.modal-body .setting-item {
    margin-bottom: 1rem;
}
.modal-body .btn-primary,
.modal-body .btn-danger {
    margin-top: 0.5rem;
    width: 100%;
}

.btn-large {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
}

/* ========== LOADING & EMPTY STATES ========== */
.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.loading-state i,
.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.loading-state p,
.empty-state p {
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* ========== FOOTER ========== */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
    margin-left: var(--sidebar-width);
    border-top: 4px solid var(--primary);
}

.footer-content {
    text-align: center;
    padding: 0 2rem;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.footer-content i.fa-heart {
    color: #ff6b6b;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .footer {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fb-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .btn-text {
        display: none;
    }

    .upload-quick-btn {
        padding: 0.7rem;
        width: 40px;
        justify-content: center;
    }

    .user-greeting span {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fb-grid,
    .fb-metrics {
        grid-template-columns: 1fr;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .main-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

       .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section,
    .settings-section,
    .upload-card {
        padding: 1.5rem;
    }
}

/* ========== CLASS PAGE (STUDENT) ========== */
.class-stats-grid {
    margin-bottom: 2rem;
}
.stat-value .stat-suffix {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.85;
}
.class-page-section .section-header.class-page-header {
    margin-bottom: 1.5rem;
}
.class-block-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.class-assignments-block {
    margin-top: 1.5rem;
}
.class-assignment-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.class-assignment-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.class-assignment-card.submitted {
    border-left: 4px solid #10b981;
}
.class-assignment-header {
    margin-bottom: 0.75rem;
}
.class-assignment-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.class-assignment-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #58cc02 0%, #46a302 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.class-assignment-card.submitted .class-assignment-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.class-assignment-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
.class-assignment-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}
.class-assignment-badge.submitted {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.class-assignment-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}
.class-assignment-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.class-assignment-body {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.class-assignment-desc {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.class-assignment-attachments {
    margin: 0.5rem 0;
}
.class-assignment-attachments .class-att-btn {
    margin-right: 0.35rem;
    margin-top: 0.25rem;
}
.class-assignment-feedback {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    font-size: 0.9rem;
}
.class-assignment-readonly {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    font-size: 0.9rem;
}
.class-assignment-mytext {
    margin-top: 0.5rem;
    white-space: pre-wrap;
}
.class-assignment-submit textarea {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    display: block;
    width: 100%;
}
.class-assignment-submit input[type="file"] {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}
.class-assignment-actions {
    margin-top: 0.5rem;
}
.class-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.class-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .class-stats-grid.stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 520px) {
    .class-stats-grid.stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== UTILITY ========== */
html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--primary);
    color: var(--white);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 50px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Stats grid: 4 in a row on large screens, 2x2 on smaller (e.g. 14"), 1 col on mobile */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Billing / Subscription helpers */
.btn-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:12px;
}
.inline-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:600;
  font-size:12px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.12);
}


/* ===== small button helper (added) ===== */
.btn-small{
  padding: .55rem .85rem;
  font-size: .85rem;
  line-height: 1.1;
}

/* ===== Full-window course view (keeps top navbar + sidebar) ===== */
.course-overlay{
  position: fixed;
  top: var(--top-nav-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
  overflow: auto;
}

.course-overlay-inner{
  max-width: 1200px;
  margin: 0 auto;
}

.course-overlay-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.course-overlay-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px){
  .course-overlay{ left: 0; }
  .course-overlay-grid{ grid-template-columns: 1fr; }
}


/* ===== COURSES GRID + TASKS (added) ===== */
#myCoursesGrid{
  display:grid;
  gap:1.5rem;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
}

.course-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:1rem;
}

.course-icon{
  width:56px;
  height:56px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--gradient);
  color: var(--white);
  font-size:1.4rem;
}

.course-progress{
  margin:.5rem 0 1rem;
  color: var(--text-muted);
  font-weight:700;
}

.task-item{
  padding:.8rem;
  border:2px solid var(--border);
  border-radius:14px;
  background: var(--white);
  margin-bottom:.8rem;
}

.task-row{
  display:flex;
  align-items:center;
  gap:.7rem;
  font-weight:800;
}

.task-title.done{
  text-decoration:line-through;
  opacity:.7;
}

.task-desc{
  margin-left:1.9rem;
  margin-top:.25rem;
  color: var(--text-muted);
  font-weight:600;
  font-size:.95rem;
}



/* ========== COACH REPORT (v2) ========== */
.coach-report{
  margin-top: .75rem;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(88,204,2,0.06) 0%, rgba(28,176,246,0.06) 100%);
  padding: 1rem;
}

.coach-section{
  background: var(--white);
  border: 1px solid rgba(226,232,240,0.9);
  border-radius: 16px;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.coach-section-title{
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: .5rem;
}

.coach-section-body p{
  margin: 0 0 .6rem;
  color: var(--dark);
  font-weight: 600;
}

.coach-cards{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .75rem;
}

@media (max-width: 980px){
  .coach-cards{ grid-template-columns: 1fr; }
}

.coach-card{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .85rem;
  background: var(--light);
}

.coach-card-h{
  display:flex;
  gap:.5rem;
  align-items:center;
  margin-bottom:.5rem;
  flex-wrap: wrap;
}

.coach-pill{
  font-family: 'Space Mono', monospace;
  font-weight: 800;
  font-size: .85rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(28,176,246,0.25);
  background: rgba(28,176,246,0.08);
  color: var(--dark);
}

.coach-card-title{
  font-weight: 800;
}

.coach-quote{
  font-style: italic;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .35rem;
}

.coach-text{
  color: var(--dark);
  font-weight: 600;
  margin-bottom: .35rem;
}

.coach-rewrite{
  margin-top: .35rem;
  padding: .5rem .65rem;
  border-radius: 12px;
  background: rgba(88,204,2,0.10);
  border: 1px solid rgba(88,204,2,0.18);
  font-weight: 700;
}

.coach-timeline-item{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .75rem;
  background: var(--light);
  margin-bottom: .6rem;
}

.coach-timeline-time{
  font-family: 'Space Mono', monospace;
  font-weight: 900;
  margin-bottom: .45rem;
}

.coach-timeline-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:.75rem;
}

@media (max-width: 1100px){
  .coach-timeline-grid{ grid-template-columns: 1fr; }
}

.coach-mini-title{
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
  margin-bottom: .25rem;
}

.coach-list{
  margin: .35rem 0 0 1.2rem;
  font-weight: 700;
}

.coach-focus{
  border-radius: 18px;
  padding: .9rem 1rem;
  background: var(--gradient);
  color: var(--white);
}

.coach-focus-title{
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: .45rem;
}

.coach-focus .coach-text{
  color: var(--white);
  opacity: .95;
}

.coach-focus .coach-list{
  margin-top: .4rem;
}
