/* Afrimaths Classroom — portal, admin and public site */
:root {
    --navy: #083c66;
    --green: #008b57;
    --green-dark: #00744a;
    --page: #f3f6f8;
    --line: #e3e9ed;
    --ink: #1f2d3a;
    --muted: #6b7a86;
}
body { background: var(--page); color: var(--ink); font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--navy); }
.btn-ame { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn-ame:hover, .btn-ame:focus { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

/* ---------- Portal / admin shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: linear-gradient(180deg, #083c66, #06304f); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin .side { background: linear-gradient(180deg, #1f2937, #111827); }
.side .brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.side-org { font-size: 12px; opacity: .7; margin: 4px 0 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: rgba(255,255,255,.82); text-decoration: none; padding: 9px 11px; border-radius: 9px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }
.side-foot a { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: none; }
.main { padding: 20px 26px 50px; min-width: 0; }
.main-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.main-head h1 { font-size: 22px; font-weight: 800; margin: 0; }

.card-x { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.card-x h2 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.card-x .sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.stat .note { font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: #e6eef7; margin-top: 8px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #2a78d6; border-radius: 6px; }
.meter.full > span { background: #d03b3b; }

table.tbl { width: 100%; font-size: 14px; }
table.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
table.tbl td { border-bottom: 1px solid #f0f3f5; padding: 10px; vertical-align: middle; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

.impersonate-bar { background: #fff3cd; border-bottom: 1px solid #ffe08a; padding: 8px 16px; font-size: 14px; text-align: center; }
.impersonate-bar a { margin-left: 10px; font-weight: 700; }

.start-lesson { background: linear-gradient(120deg, #083c66, #075777 55%, #008b57); color: #fff; border-radius: 16px; padding: 22px; margin-bottom: 16px; }
.start-lesson h2 { font-weight: 800; font-size: 20px; }
.start-lesson .form-control { border: 0; }

@media (max-width: 991px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .2s; }
    .side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .main { padding: 14px 14px 40px; }
}

/* ---------- Public site ---------- */
/* Public pages — same look as the Africa Maths Excellence main website */
.pub-nav { background: rgba(255,255,255,.96); border-bottom: 1px solid #e2e8f0; height: 80px; display: flex; align-items: center; position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); }
.pub-nav .brand { text-decoration: none; display: flex; gap: 12px; align-items: center; }
.pub-nav .brand img { height: 42px; width: auto; }
.pub-nav .brand-sub { padding-left: 12px; border-left: 1px solid #e2e8f0; font-size: 14px; font-weight: 800; color: var(--navy); }
.nav-link-pub { color: #334155; text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 10px; }
.nav-link-pub:hover { color: var(--green); }
.pub-nav .btn { border-radius: 12px; padding: 9px 16px; font-size: 14px; }
.btn-pub-outline { border: 1px solid rgba(8,60,102,.15); color: var(--navy); background: #fff; }
.btn-pub-outline:hover { background: #f8fafc; color: var(--navy); }
.hero { background: linear-gradient(145deg, #083c66 0%, #075777 48%, #008b57 100%); color: #fff; padding: 64px 0 90px; }
.hero h1 { font-weight: 800; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; }
.hero p.lead { opacity: .9; max-width: 640px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: -50px; }
.feature { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 10px 30px rgba(8,60,102,.10); }
.feature i { font-size: 24px; color: var(--green); }
.feature h3 { font-size: 16px; font-weight: 800; margin: 8px 0 4px; }
.feature p { font-size: 14px; color: var(--muted); margin: 0; }
.cycle-toggle .btn { min-width: 110px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--green); box-shadow: 0 12px 34px rgba(0,139,87,.14); }
.plan .name { font-weight: 800; font-size: 18px; }
.plan .price { font-size: 32px; font-weight: 800; margin: 8px 0 0; }
.plan .price { font-size: clamp(24px, 2.3vw, 32px); white-space: nowrap; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; font-size: 14px; }
.plan li { padding: 4px 0; display: flex; gap: 8px; }
.plan li i { color: var(--green); }
.pub-footer { background: #061d32; color: #fff; padding: 44px 0 26px; font-size: 14px; }
.pub-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.pub-footer a:hover { color: #fff; }
.pub-footer .foot-logo { height: 46px; width: auto; background: #fff; border-radius: 8px; padding: 4px; }
.pub-footer .foot-small { font-size: 12px; color: rgba(255,255,255,.45); }
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 40px 14px; }
.pub .auth-wrap {
    background-color: #083c66;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(135deg, #083c66 0%, #0a537f 50%, #008b57 100%);
    background-size: 34px 34px, 34px 34px, 100% 100%;
}
.pub .auth-card { border-radius: 28px; box-shadow: 0 25px 60px rgba(8,60,102,.25); }
.pub .btn-ame, .pub .btn-dark { border-radius: 12px; font-weight: 800; }
.auth-card { width: min(480px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(8,60,102,.12); padding: 28px; }
.auth-card.wide { width: min(640px, 100%); }
