/* Modern sleek landing styles */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0,0,0,0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
img { max-width: 100%; height: auto; display: block; }

/* Header */
.site-header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1120px;
    margin: 0 auto;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.main-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
}
.main-nav a:hover { color: var(--primary); }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.6rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-lg { padding: 0.9rem 2.2rem; font-size: 1.05rem; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
    color: white;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    position: relative;
}
.badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    margin: 0 0 1rem;
    line-height: 1.15;
    font-weight: 800;
}
.hero .lead {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 1.75rem;
    max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-note { font-size: 0.9rem; opacity: 0.85; margin: 0; }
.hero-image img {
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Stats */
.stats {
    background: var(--bg-alt);
    padding: 2.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}
.stat strong {
    display: block;
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 800;
}
.stat span { color: var(--muted); font-size: 0.95rem; }

/* Sections */
section { padding: 5rem 0; }
h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    text-align: center;
    margin: 0 0 0.75rem;
    font-weight: 800;
}
.section-lead {
    text-align: center;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}
.section-cta { text-align: center; margin-top: 2.5rem; }

/* Features */
.features { background: var(--bg); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.feature-card {
    background: var(--bg-alt);
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}
.feature-icon { font-size: 2.2rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.feature-card p { margin: 0; color: var(--muted); }

/* How it works */
.how-it-works { background: var(--bg-alt); }
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}
.step { text-align: center; }
.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
}
.step h3 { margin: 0 0 0.5rem; }
.step p { margin: 0; color: var(--muted); }

/* Grades */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.grade-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.75rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    display: block;
}
.grade-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.grade-card h3 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.grade-card span { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* Testimonials */
.testimonials { background: linear-gradient(135deg, #0f766e, #0d9488); color: white; }
.testimonials h2 { color: white; }
.testimonial-slider { max-width: 680px; margin: 2rem auto 0; position: relative; }
.testimonial { display: none; text-align: center; }
.testimonial.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.testimonial blockquote {
    font-size: 1.25rem;
    font-style: italic;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}
.author strong { display: block; }
.author span { opacity: 0.85; font-size: 0.95rem; }
.slider-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.slider-controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
}
.slider-controls button:hover { background: rgba(255,255,255,0.35); }

/* FAQ */
.faq { background: var(--bg); }
.faq-list { max-width: 720px; margin: 2rem auto 0; }
.faq-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0;
}
.faq-item summary {
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 1rem 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--primary);
    transition: var(--transition);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
    margin: 0 0 1rem;
    color: var(--muted);
    padding-right: 1.5rem;
}

/* Final CTA */
.final-cta {
    background: var(--bg-alt);
    text-align: center;
    padding: 5rem 0;
}
.final-cta h2 { margin-bottom: 0.5rem; }
.final-cta p { color: var(--muted); margin-bottom: 1.5rem; font-size: 1.1rem; }

/* Footer */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 2.5rem 0;
    font-size: 0.95rem;
}
.site-footer p { margin: 0.3rem 0; }

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1.25rem;
        gap: 1rem;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: var(--shadow);
    }
    .main-nav.open { display: flex; }
    .hero-grid, .steps, .stats-grid { grid-template-columns: 1fr; }
    .hero { padding: 3.5rem 0; text-align: center; }
    .hero .lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* ========== Auth Pages ========== */
.auth-page {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 50%, #ecfeff 100%);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(13, 148, 136, 0.12);
    padding: 2.5rem 2rem;
    border: 1px solid #e2e8f0;
}
.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    color: var(--text);
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--muted);
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
}
.auth-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.auth-form .btn-block {
    width: 100%;
    margin-top: 0.5rem;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}
.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-links a:hover { text-decoration: underline; }
.auth-links p { margin: 0.4rem 0; }
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ============================================
   USER DASHBOARD & SIDEBAR
   ============================================ */
main:has(.user-sidebar) {
    display: flex;
    min-height: calc(100vh - 80px);
    background: #f8fafc;
}

.user-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0 1rem;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}
.sidebar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: #2dd4bf;
    padding: 0 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem;
}
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.sidebar-link .icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-link.active {
    background: #0d9488;
    color: #fff;
}
.sidebar-admin { margin-top: 0.5rem; }
.sidebar-footer {
    padding: 0.75rem 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logout { color: #fca5a5; }
.sidebar-logout:hover { background: rgba(239,68,68,0.15); color: #fecaca; }

.dash-content,
main:has(.user-sidebar) > *:not(.user-sidebar) {
    flex: 1;
    padding: 2rem 2rem 3rem;
    max-width: 1100px;
    width: 100%;
}
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.dash-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}
.dash-sub { margin: 0; color: #64748b; }
.dash-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-admin {
    background: #7c3aed;
    color: #fff;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-admin:hover { background: #6d28d9; }
.btn-ghost {
    background: transparent;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-ghost:hover { background: #f1f5f9; }
.btn.full { width: 100%; margin-top: 1rem; }

.dash-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
    main:has(.user-sidebar) {
        flex-direction: column;
    }
    .user-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem 0.5rem;
        gap: 0.25rem;
    }
    .sidebar-brand { display: none; }
    .sidebar-nav, .sidebar-footer {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0;
        border: none;
    }
    .sidebar-link { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
    .dash-content { padding: 1.25rem 1rem 2rem; }
}

.dash-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ccfbf1;
}
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
}
.profile-identity h2 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}
.role-badge {
    display: inline-block;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1rem;
    margin: 0 0 0.5rem;
}
.profile-details dt {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.15rem;
}
.profile-details dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
    word-break: break-word;
}

.sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.sub-head h3 { margin: 0; font-size: 1.1rem; }
.status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-active { background: #dcfce7; color: #166534; }
.status-trial { background: #fef3c7; color: #92400e; }
.status-expired { background: #fee2e2; color: #991b1b; }

.plan-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}
.meta { margin: 0.25rem 0; color: #64748b; font-size: 0.9rem; }
.trial-progress { margin: 1rem 0 0.5rem; }
.trial-progress .bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.trial-progress .bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    border-radius: 4px;
}
.trial-progress small { color: #64748b; }

.section-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.action-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.1rem;
    text-decoration: none;
    color: #0f172a;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border-color: #0d9488;
}
.action-icon { font-size: 1.6rem; margin-bottom: 0.25rem; }
.action-card strong { font-size: 1rem; }
.action-card span { font-size: 0.85rem; color: #64748b; }
.action-danger:hover { border-color: #ef4444; }
.action-admin { border-color: #c4b5fd; }
.action-admin:hover { border-color: #7c3aed; }

/* ========== Subscription plans ========== */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) {
    .plans-grid { grid-template-columns: 1fr; }
}
.plan-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
.plan-card.featured {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(13,148,136,0.12);
}
.plan-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}
.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.plan-price .amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}
.plan-price .interval {
    color: #64748b;
    font-size: 0.9rem;
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
    flex: 1;
}
.plan-features li {
    padding: 0.35rem 0;
    font-size: 0.92rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.plan-features li:last-child { border-bottom: 0; }

/* ========== Lesson browser ========== */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
}
.class-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.2s;
}
.class-card:hover,
.class-card.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.subject-link {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    color: #334155;
    transition: all 0.2s;
}
.subject-link:hover,
.subject-link.active {
    background: var(--primary);
    color: #fff;
}
.term-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.scheme-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.scheme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 500;
    transition: background 0.15s;
}
.scheme-item:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
}
.scheme-item .arrow { color: var(--primary); font-weight: 700; }

/* ========== Note viewer ========== */
.restriction-banner {
    background: #fef3c7;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.note-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    line-height: 1.7;
    color: #1e293b;
}
.note-content.no-copy {
    user-select: none;
    -webkit-user-select: none;
}
.note-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}
.note-images img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Alerts */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

/* ========== Subscription management ========== */
.sub-manage .current-plan-hero {
    margin: 0.5rem 0 1.25rem;
}
.plan-price-lg {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.25rem 0 0;
}
.plan-price-lg span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}
.sub-details {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.detail-row > i {
    font-size: 1.25rem;
    color: var(--primary);
    margin-top: 0.15rem;
}
.detail-row .label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.detail-row strong { font-size: 1rem; }
.detail-row .muted { color: #64748b; font-size: 0.85rem; margin-left: 0.4rem; }
.sub-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}
.btn-danger:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.sub-head h3 i { margin-right: 0.4rem; }

/* ========== Lesson browser (responsive + icons) ========== */
.lesson-section { margin-bottom: 1.25rem; }
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1.1rem;
}
.section-title i { color: var(--primary); }

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.class-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.1rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.2s;
    text-align: center;
}
.class-card i { font-size: 1.4rem; color: var(--primary); }
.class-card:hover,
.class-card.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.class-card:hover i,
.class-card.active i { color: #fff; }

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
}
.subject-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 500;
    transition: all 0.2s;
}
.subject-card i { color: var(--primary); font-size: 1.1rem; }
.subject-card:hover,
.subject-card.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.subject-card:hover i,
.subject-card.active i { color: #fff; }

.term-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.term-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}
.term-btn:hover,
.term-btn.active {
    background: var(--primary);
    color: #fff;
}

.scheme-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.scheme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}
.scheme-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.scheme-left i { color: var(--primary); font-size: 1.15rem; }
.scheme-arrow { color: var(--primary); font-size: 1.1rem; }
.scheme-item:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .class-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .subject-grid {
        grid-template-columns: 1fr;
    }
    .term-grid {
        grid-template-columns: 1fr;
    }
    .term-btn {
        border-radius: 12px;
    }
    .sub-actions {
        flex-direction: column;
    }
    .sub-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .plans-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Learning Resources (pill design) ========== */
.lesson-page { max-width: 920px; }

.lr-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 60%, #115e59 100%);
    color: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.25);
}
.lr-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.lr-banner h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.lr-banner p {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.lr-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.15rem 1.25rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.lr-card-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}
.lr-card-head i {
    color: var(--primary);
    font-size: 1.15rem;
}
.lr-card-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
}
.resource-count {
    background: #f0fdfa;
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.scheme-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.scheme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}
.scheme-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.scheme-left i {
    color: var(--primary);
    font-size: 1.1rem;
}
.scheme-arrow {
    color: var(--primary);
    font-size: 1rem;
}
.scheme-item:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

@media (max-width: 640px) {
    .lr-banner {
        padding: 1rem 1.1rem;
    }
    .lr-banner h1 { font-size: 1.2rem; }
    .pill {
        padding: 0.4rem 0.85rem;
        font-size: 0.85rem;
    }
    .lr-card { padding: 1rem; }
}

/* ========== Force Learning Resources styles over global section/h2 ========== */
.dash-content.lesson-page section.lr-card,
section.lr-card {
    padding: 1.15rem 1.25rem 1.25rem !important;
    margin-bottom: 1rem;
}
.lr-card-head h2 {
    font-size: 1.05rem !important;
    text-align: left !important;
    margin: 0 !important;
    font-weight: 700 !important;
}
.pill-row a.pill {
    text-decoration: none !important;
}
.lr-banner h1 {
    text-align: left;
    font-size: 1.45rem;
}

/* ========== Prevent note content from stretching the layout ========== */
main:has(.user-sidebar) {
    overflow-x: hidden;
}
.dash-content {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
.note-content {
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.note-content table {
    max-width: 100% !important;
    width: 100% !important;
    table-layout: auto;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}
.note-content img,
.note-content video,
.note-content iframe,
.note-content div,
.note-content p,
.note-content span,
.note-content table,
.note-content td,
.note-content th {
    max-width: 100% !important;
    box-sizing: border-box;
}
.note-content img {
    height: auto !important;
}
.note-content table td,
.note-content table th {
    word-break: break-word;
    padding: 0.4rem 0.5rem;
    border: 1px solid #e2e8f0;
}
.note-wrap {
    max-width: 100%;
    overflow-x: auto;
}

/* ========== Admin UI ========== */
.admin-sidebar .sidebar-link i { margin-right: 0.4rem; width: 1.2rem; }
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.stat-card i { color: var(--primary); font-size: 1.4rem; }
.stat-card strong { font-size: 1.6rem; font-weight: 800; }
.stat-card span { color: #64748b; font-size: 0.9rem; }
.admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.admin-search, .admin-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.admin-search input, .admin-filters input, .admin-filters select,
.admin-form input, .admin-form select, .admin-form textarea {
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
}
.admin-form { display: flex; flex-direction: column; gap: 0.85rem; }
.admin-form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }

.table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.admin-table th, .admin-table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.92rem;
}
.admin-table th { background: #f8fafc; font-weight: 600; }
.admin-table .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.inline-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.inline-form select { padding: 0.3rem 0.5rem; border-radius: 6px; border: 1px solid #e2e8f0; }
.check { font-size: 0.85rem; display: flex; align-items: center; gap: 0.25rem; }

.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 0.4rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}
.editor-toolbar button {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}
.editor-toolbar button:hover { background: #f0fdfa; }
.editor-area {
    min-height: 280px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    background: #fff;
    outline: none;
    line-height: 1.6;
}
.note-images-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.img-thumb {
    width: 120px;
    text-align: center;
}
.img-thumb img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.35rem;
}

.editor-toolbar .sep {
    width: 1px;
    background: #e2e8f0;
    margin: 0 0.25rem;
}
.editor-area blockquote {
    border-left: 3px solid var(--primary);
    margin: 0.75rem 0;
    padding: 0.4rem 0.9rem;
    color: #475569;
    background: #f8fafc;
}
.editor-area table,
.note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
}
.editor-area table th,
.editor-area table td,
.note-content table th,
.note-content table td {
    border: 1px solid #e2e8f0;
    padding: 0.45rem 0.6rem;
}
.editor-area table th,
.note-content table th { background: #f8fafc; }
.editor-area .math,
.note-content .math {
    font-family: "Times New Roman", serif;
    font-style: italic;
    background: #f0fdfa;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}
.editor-area img { max-width: 100%; height: auto; }

/* Editor.js */
.editorjs-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    min-height: 320px;
}
.ce-block__content, .ce-toolbar__content { max-width: 100%; }
.note-content figure { margin: 1rem 0; }
.note-content figure img { max-width: 100%; height: auto; border-radius: 8px; }
.note-content blockquote {
    border-left: 3px solid var(--primary);
    margin: 0.75rem 0;
    padding: 0.4rem 0.9rem;
    background: #f8fafc;
}
.note-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* ========== App dashboard layout ========== */
.app-body { background: #f4f7fb; }
.app-body main { display: block; min-height: calc(100vh - 80px); }

.app-nav {
    background: #fff;
    border-bottom: 1px solid #e8eef5;
    padding: 0.75rem 1.25rem;
}
.app-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 0.45rem 0.6rem 0.45rem 0.45rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.app-nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.app-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.92rem;
}
.app-link:hover { background: #f8fafc; }
.app-link.active { background: #ccfbf1; color: #0f766e; }
.app-nav-actions { display: flex; gap: 0.5rem; }
.btn-app-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #7c3aed;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 50px;
}
.btn-app-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
}

.dash-page { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.dash-hello h1 { margin: 0; font-size: 2rem; font-weight: 800; color: #0f172a; text-align: left; }
.dash-hello p { margin: 0.25rem 0 1.5rem; color: #64748b; }

.dash-cards {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.ui-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 18px;
    padding: 1.35rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.profile-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.profile-top .avatar {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
    border: 3px solid #ccfbf1;
}
.profile-top h2 { margin: 0 0 0.35rem; font-size: 1.35rem; text-align: left; }
.role-badge {
    display: inline-block;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    letter-spacing: 0.04em;
}
.profile-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.5rem;
    margin-bottom: 1.25rem;
}
.profile-meta .label {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.profile-meta strong { font-size: 0.95rem; color: #0f172a; }
.btn-edit-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1.5px solid #0d9488;
    color: #0d9488;
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem;
    border-radius: 50px;
}
.btn-edit-profile:hover { background: #f0fdfa; }

.sub-card .sub-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sub-card h2 { margin: 0; font-size: 1.35rem; text-align: left; }
.sub-card h3 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.btn-upgrade {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    background: #0d9488;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 0.85rem;
    border-radius: 50px;
}
.btn-upgrade:hover { background: #0f766e; }

.quick-card h3 { margin: 0 0 1rem; font-size: 1.05rem; display: flex; align-items: center; gap: 0.4rem; }
.quick-card h3 i { color: #f59e0b; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.quick-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.92rem;
}
.quick-item .bi-chevron-right { margin-left: auto; color: #94a3b8; }
.qi {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.qi-teal { background: #ccfbf1; color: #0d9488; }
.qi-amber { background: #fef3c7; color: #d97706; }
.qi-blue { background: #dbeafe; color: #2563eb; }
.qi-purple { background: #ede9fe; color: #7c3aed; }

@media (max-width: 800px) {
    .dash-cards, .quick-grid { grid-template-columns: 1fr; }
    .app-nav-inner { flex-direction: column; align-items: stretch; }
    .app-nav-actions { justify-content: flex-end; }
}
