/* EduEx — LMS (student + instructor + admin) prototype.
   Focused indigo/lime academic identity — distinct from all other suites. */

.ed {
    --ed-indigo: #4338ca;
    --ed-indigo-2: #6366f1;
    --ed-lime: #a3e635;
    --ed-ink: #1e1b3a;
    --ed-bg: #f6f6fb;
    --ed-panel: var(--panel, #fff);
    --ed-line: #e6e6f5;
    --ed-muted: #6b6b85;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ed-ink);
}
.ed * { box-sizing: border-box; }

.ed-topbar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; background: var(--ed-panel); border-bottom: 1px solid var(--ed-line); position: sticky; top: 0; z-index: 20; }
.ed-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; }
.ed-brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--ed-indigo); display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.ed-brand small { display: block; font-weight: 600; color: var(--ed-muted); font-size: .66rem; }
.ed-nav { display: flex; gap: .3rem; margin-left: .5rem; }
.ed-navbtn { border: none; background: none; padding: .45rem .9rem; border-radius: 999px; font: 700 .8rem/1 inherit; color: var(--ed-muted); cursor: pointer; }
.ed-navbtn.active { background: var(--ed-indigo); color: #fff; }
.ed-top-actions { margin-left: auto; }
.ed-live-dot { font-size: .66rem; font-weight: 800; color: #65a30d; display: inline-flex; align-items: center; gap: .3rem; }
.ed-live-dot::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ed-lime); }

.ed-view { display: none; } .ed-view.active { display: block; }

/* ── Phone frame ─────────────────────────────────────────────────── */
.ed-app-wrap { background: var(--ed-bg); min-height: calc(100vh - 56px); display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.ed-phone { width: 100%; max-width: 360px; background: #14112a; border-radius: 2.1rem; padding: .55rem; box-shadow: 0 40px 80px -30px rgba(67, 56, 202, .35); }
.ed-phone-screen { background: var(--ed-panel); border-radius: 1.7rem; overflow: hidden; position: relative; height: 700px; display: flex; flex-direction: column; }
.ed-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 22px; background: #14112a; border-radius: 0 0 14px 14px; z-index: 5; }
.ed-statusbar { display: flex; justify-content: space-between; padding: .5rem 1.1rem .2rem; font-size: .72rem; font-weight: 700; flex: none; }
.ed-screen-scroll { flex: 1; overflow-y: auto; padding-bottom: 4.4rem; }

.ed-app-hd { display: flex; align-items: center; justify-content: space-between; padding: .3rem 1.1rem .7rem; }
.ed-app-hd b { font-size: 1.05rem; font-weight: 800; }
.ed-sect-hd { padding: 0 1.1rem .5rem; } .ed-sect-hd h4 { font-size: .9rem; font-weight: 800; }

.ed-course-card { margin: 0 1.1rem .8rem; background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: 1rem; padding: .9rem; cursor: pointer; }
.ed-course-card .hd { display: flex; gap: .7rem; margin-bottom: .6rem; }
.ed-course-card .ic { width: 40px; height: 40px; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: none; color: #fff; }
.ed-course-card .t { font-weight: 800; font-size: .84rem; }
.ed-course-card .meta { font-size: .7rem; color: var(--ed-muted); }
.ed-course-card .bar { height: 7px; background: var(--ed-line); border-radius: 4px; overflow: hidden; margin-bottom: .3rem; }
.ed-course-card .bar i { display: block; height: 100%; background: var(--ed-indigo-2); }
.ed-course-card .pct { font-size: .7rem; font-weight: 700; color: var(--ed-indigo); }

.ed-back-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 1.1rem .8rem; }
.ed-back-row .back { font-size: 1.1rem; cursor: pointer; }
.ed-back-row b { font-size: .95rem; font-weight: 800; flex: 1; text-align: center; margin-right: 1.5rem; }

.ed-progress-ring-row { display: flex; justify-content: center; padding: .5rem 0 1rem; }
.ed-lesson-card { margin: 0 1.1rem .6rem; background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: .9rem; padding: .7rem .85rem; display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.ed-lesson-card.done { background: #f7fee7; border-color: #d9f99d; }
.ed-lesson-card .ic { font-size: 1.2rem; }
.ed-lesson-card .t { font-weight: 700; font-size: .8rem; }
.ed-lesson-card .meta { font-size: .68rem; color: var(--ed-muted); }
.ed-lesson-card .check { margin-left: auto; font-size: 1.1rem; color: #65a30d; }

.ed-quiz-card { margin: 0 1.1rem; background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: 1rem; padding: 1rem; }
.ed-quiz-card .q { font-weight: 800; font-size: .9rem; margin-bottom: .9rem; }
.ed-quiz-opt { display: block; width: 100%; text-align: left; background: var(--ed-bg); border: 1px solid var(--ed-line); border-radius: .8rem; padding: .6rem .8rem; font-size: .82rem; font-weight: 600; margin-bottom: .5rem; cursor: pointer; }
.ed-quiz-opt.correct { background: #f7fee7; border-color: var(--ed-lime); }
.ed-quiz-opt.wrong { background: #fef2f2; border-color: #fecaca; }

.ed-cert-card { margin: 2rem 1.4rem; text-align: center; }
.ed-cert-ic { font-size: 2.6rem; margin-bottom: .5rem; }
.ed-cert-card h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.ed-score { font-size: 2.4rem; font-weight: 800; color: var(--ed-indigo); margin-bottom: .5rem; }
.ed-cert-card p { font-size: .8rem; color: var(--ed-muted); margin-bottom: 1.2rem; }
.ed-primary-btn { width: 100%; background: var(--ed-indigo); color: #fff; border: none; border-radius: .8rem; padding: .75rem; font-weight: 800; font-size: .85rem; cursor: pointer; }

.ed-bottomnav { position: absolute; bottom: 0; left: 0; right: 0; background: var(--ed-panel); border-top: 1px solid var(--ed-line); display: flex; padding: .6rem 0 .7rem; }
.ed-bottomnav button { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .62rem; font-weight: 700; color: var(--ed-muted); cursor: pointer; }
.ed-bottomnav button.active { color: var(--ed-indigo); }
.ed-bottomnav .ic { font-size: 1.15rem; }

.ed-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ed-ink); color: #fff; padding: .5rem 1rem; border-radius: 999px; font-size: .74rem; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.ed-toast.show { opacity: 1; }

/* ── Instructor app extras ───────────────────────────────────────── */
.ed-earn-card { margin: 0 1.1rem 1rem; background: var(--ed-ink); color: #fff; border-radius: 1rem; padding: 1rem; display: flex; justify-content: space-around; }
.ed-earn-card small { display: block; opacity: .7; font-size: .68rem; margin-bottom: .2rem; } .ed-earn-card b { font-size: 1.2rem; color: var(--ed-lime); }
.ed-grade-card { margin: 0 1.1rem .7rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 1rem; padding: .8rem .9rem; }
.ed-grade-card .t { font-weight: 800; font-size: .82rem; } .ed-grade-card .meta { font-size: .7rem; color: var(--ed-muted); margin: .2rem 0 .6rem; }
.ed-grade-card button { background: var(--ed-indigo); color: #fff; border: none; border-radius: .6rem; padding: .4rem .8rem; font-weight: 800; font-size: .74rem; cursor: pointer; }
.ed-announce-box { margin: 0 1.1rem; }
.ed-announce-box textarea { width: 100%; border: 1px solid var(--ed-line); border-radius: .8rem; padding: .7rem; font-size: .8rem; font-family: inherit; min-height: 70px; resize: vertical; margin-bottom: .5rem; }
.ed-announce-box button { width: 100%; background: var(--ed-indigo); color: #fff; border: none; border-radius: .8rem; padding: .65rem; font-weight: 800; font-size: .8rem; cursor: pointer; }

/* ── Admin ────────────────────────────────────────────────────────── */
.ed-admin { display: flex; min-height: calc(100vh - 56px); background: var(--ed-bg); }
.ed-admin-side { width: 220px; flex: none; background: var(--ed-ink); color: #c1bfe0; padding: 1rem .6rem; }
.ed-admin-side .brand { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem 1.1rem; color: #fff; font-weight: 800; }
.ed-admin-side .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ed-indigo-2); display: flex; align-items: center; justify-content: center; font-size: .78rem; }
.ed-admin-side .brand small { display: block; font-weight: 600; color: #7c78a3; font-size: .66rem; }
.ed-admin-nav { display: flex; flex-direction: column; }
.ed-admin-nav button { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .5rem .6rem; border-radius: .6rem; font: 700 .8rem/1 inherit; color: #c1bfe0; background: none; border: none; cursor: pointer; margin-bottom: .1rem; }
.ed-admin-nav button:hover { background: rgba(255,255,255,.06); }
.ed-admin-nav button.active { background: var(--ed-indigo-2); color: #fff; }
.ed-admin-main { flex: 1; padding: 1.4rem 1.8rem; overflow-x: auto; }
.ed-admin-hd h2 { font-size: 1.2rem; font-weight: 800; } .ed-admin-hd p { font-size: .8rem; color: var(--ed-muted); }
.ed-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin: 1.1rem 0; }
.ed-stat { background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: .9rem; padding: .9rem 1rem; }
.ed-stat .ic { width: 34px; height: 34px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .95rem; margin-bottom: .5rem; }
.ed-stat .v { font-size: 1.3rem; font-weight: 800; } .ed-stat .k { font-size: .72rem; color: var(--ed-muted); font-weight: 700; }
.ed-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.ed-chart-card { background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: 1rem; padding: 1rem; }
.ed-chart-card h4 { font-size: .84rem; font-weight: 800; margin-bottom: .7rem; }
.ed-chart-card svg { width: 100%; height: 180px; display: block; }

@media (max-width: 860px) {
    .ed-admin { flex-direction: column; }
    .ed-admin-side { width: 100%; display: flex; overflow-x: auto; padding: .6rem; }
    .ed-admin-side .brand { display: none; }
    .ed-admin-nav { flex-direction: row; gap: .3rem; }
    .ed-admin-nav button { white-space: nowrap; }
    .ed-charts { grid-template-columns: 1fr; }
}
