:root {
  --navy: #102b50;
  --navy-2: #173d6b;
  --ink: #172b4d;
  --muted: #66758b;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --line: #e4eaf1;
  --mint: #63d7bb;
  --mint-dark: #087c63;
  --blue: #4f8edb;
  --amber: #f6b84a;
  --coral: #f58278;
  --danger: #bd4d43;
  --shadow: 0 16px 45px rgba(16, 43, 80, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
.app-shell { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: .9fr 1.1fr; background: var(--canvas); }
.auth-only { grid-template-columns: 1fr; background: radial-gradient(circle at 50% -10%, rgba(99,215,187,.2), transparent 40%), var(--canvas); }
.auth-only .auth-panel { min-height: 100vh; }
.landing-page { min-height: 100vh; color: var(--ink); background: var(--canvas); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 1180px; margin: 0 auto; padding: 22px 28px; }
.landing-nav .wordmark { color: var(--navy); font-size: 13px; }
.landing-actions, .landing-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.landing-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(30px, 7vw, 92px); align-items: center; max-width: 1180px; margin: 0 auto; padding: clamp(62px, 10vw, 125px) 28px 96px; }
.landing-hero h1 { max-width: 720px; margin: 18px 0; font-size: clamp(48px, 7vw, 88px); line-height: .96; letter-spacing: -.065em; }
.landing-hero-copy > p { max-width: 610px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.landing-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted); font-size: 13px; font-weight: 750; }
.landing-proof span:before { content: '✓'; margin-right: 7px; color: var(--mint-dark); }
.landing-hero-card { padding: 32px; color: white; background: radial-gradient(circle at 100% 0%, rgba(99,215,187,.35), transparent 38%), linear-gradient(145deg, var(--navy), #0c4b65); border-radius: 28px; box-shadow: 0 24px 70px rgba(16,43,80,.2); }
.landing-hero-card > img { width: 74px; height: 74px; object-fit: contain; margin-bottom: 26px; border-radius: 16px; background: white; }
.landing-hero-card h2 { margin-top: 10px; font-size: 30px; color: white; }
.landing-mini-stat { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); color: #d8e9f0; line-height: 1.5; }
.landing-mini-stat strong { color: var(--mint); font-size: 18px; }
.landing-section { max-width: 1180px; margin: 0 auto; padding: 20px 28px 90px; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-feature { padding: 26px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.landing-feature p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border-radius: 12px; font-weight: 900; }
.mint-bg { color: var(--mint-dark); background: #e2faf3; }.blue-bg { color: #2764a9; background: #e6f0fc; }.coral-bg { color: #ae4943; background: #fff0ee; }
.landing-unit-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; max-width: 1180px; margin: 0 auto 70px; padding: 34px 28px; color: white; background: var(--navy); border-radius: 22px; }
.landing-unit-band h2 { margin-top: 8px; color: white; }.landing-unit-band p { max-width: 700px; margin-bottom: 0; color: #d8e9f0; line-height: 1.6; }
.landing-footer { display: flex; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 24px 28px 34px; color: var(--muted); font-size: 13px; }

.auth-visual { padding: clamp(28px, 6vw, 80px); color: white; background: radial-gradient(circle at 80% 10%, rgba(99,215,187,.32), transparent 34%), linear-gradient(145deg, var(--navy), #0c4b65); position: relative; overflow: hidden; }
.auth-visual:after { content: ""; position: absolute; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; right: -150px; bottom: -140px; box-shadow: 0 0 0 35px rgba(255,255,255,.04), 0 0 0 70px rgba(255,255,255,.03); }
.wordmark { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .08em; }
.brand-logo { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; border-radius: 10px; background: white; }
.auth-visual .brand-logo { width: 58px; height: 58px; flex-basis: 58px; border-radius: 14px; }
.monogram { display: grid; place-items: center; width: 38px; height: 38px; color: var(--navy); background: var(--mint); border-radius: 12px; font-weight: 900; letter-spacing: -.08em; }
.auth-visual h1 { max-width: 540px; margin: 22vh 0 18px; font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; }
.auth-visual p { max-width: 500px; color: #d8e9f0; line-height: 1.7; font-size: 17px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; color: #e9fff9; background: rgba(255,255,255,.08); font-size: 13px; }
.auth-panel { display: grid; place-items: center; padding: 28px; }
.auth-card-logo { display: block; width: 76px; height: 76px; object-fit: contain; margin: 0 auto 18px; border-radius: 16px; background: white; }
.auth-card { width: min(100%, 480px); padding: clamp(24px, 5vw, 48px); background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.eyebrow { color: var(--mint-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 8px; font-size: 25px; letter-spacing: -.035em; }
h3 { margin-bottom: 6px; font-size: 16px; }
.muted { color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; gap: 15px; margin-top: 25px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; padding: 13px 14px; color: var(--ink); background: #fbfcfe; border: 1px solid #d7e0eb; border-radius: 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(99,215,187,.2); }
textarea { min-height: 100px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 16px; color: white; background: var(--navy); border: 0; border-radius: 11px; font-weight: 800; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { color: var(--navy); background: #eaf0f7; }
.btn.mint { color: #083f35; background: var(--mint); }
.btn.amber { color: #5e3a00; background: var(--amber); }
.btn.ghost { color: var(--navy); background: transparent; border: 1px solid var(--line); }
.btn.danger { color: #fff; background: var(--danger); }
.btn.block { width: 100%; }
.switch-link { margin-top: 18px; color: var(--mint-dark); background: none; border: 0; text-decoration: underline; font-weight: 800; }
.alert { margin-top: 16px; padding: 11px 13px; border-radius: 10px; color: #70453e; background: #fff3ef; font-size: 14px; }
.alert.success { color: #17614f; background: #e8faf4; }
.demo-note { margin-top: 20px; padding: 12px; color: #526173; background: #f3f6fa; border-radius: 11px; font-size: 12px; }
.app-frame { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 30px; padding: 24px 18px; color: #d9e8f0; background: var(--navy); }
.sidebar .wordmark { color: white; font-size: 13px; }
.sidebar .monogram { width: 34px; height: 34px; }
.nav-list { display: grid; gap: 7px; }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 12px; color: #bbcede; text-align: left; background: transparent; border: 0; border-radius: 10px; font-weight: 700; }
.nav-btn:hover, .nav-btn.active { color: white; background: rgba(99,215,187,.15); }
.nav-icon { width: 22px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.profile-mini { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; padding: 12px; background: rgba(255,255,255,.07); border-radius: 12px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: var(--navy); background: var(--mint); border-radius: 50%; font-weight: 900; }
.profile-mini strong, .profile-mini small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini strong { max-width: 150px; color: white; font-size: 13px; }
.profile-mini small { max-width: 150px; color: #a8bacc; font-size: 11px; }
.content { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px clamp(20px, 4vw, 52px); background: rgba(255,255,255,.8); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.main-content { max-width: 1300px; margin: 0 auto; padding: clamp(20px, 4vw, 52px); }
.hero-card { display: flex; justify-content: space-between; gap: 30px; overflow: hidden; padding: clamp(24px, 4vw, 42px); color: white; background: radial-gradient(circle at 86% 20%, rgba(99,215,187,.3), transparent 26%), linear-gradient(135deg, var(--navy-2), #166275); border-radius: 20px; }
.hero-card h2 { max-width: 670px; margin: 10px 0 10px; font-size: clamp(28px, 4vw, 46px); color: white; }
.hero-card p { max-width: 660px; color: #dbeaf0; }
.hero-stat { align-self: center; min-width: 140px; padding: 18px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; text-align: center; }
.hero-stat strong { display: block; color: var(--mint); font-size: 33px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 36px 0 15px; }
.section-head h2 { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 20px rgba(16,43,80,.035); }
.cat-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 220px; }
.cat-card:before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--mint); }
.cat-card.blue:before { background: var(--blue); }.cat-card.coral:before { background: var(--coral); }.cat-card.amber:before { background: var(--amber); }
.cat-top { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.cat-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--navy); background: #e7faf5; border-radius: 12px; font-size: 23px; }.blue .cat-icon { background: #edf4ff; }.coral .cat-icon { background: #fff0ee; }.amber .cat-icon { background: #fff6df; }
.status-chip { display: inline-flex; align-items: center; padding: 5px 9px; color: var(--mint-dark); background: #e9faf5; border-radius: 99px; font-size: 11px; font-weight: 850; }.status-chip.locked { color: #7a5a11; background: #fff5d8; }
.cat-card p { min-height: 42px; margin-bottom: 14px; }
.cat-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }.price { color: var(--mint-dark); font-weight: 900; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }.stat-card strong { display: block; margin: 4px 0; font-size: 27px; letter-spacing: -.05em; }.stat-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.progress-track { height: 8px; overflow: hidden; background: #e8eef4; border-radius: 99px; }.progress-bar { height: 100%; background: var(--mint); border-radius: inherit; }
.table-wrap { overflow-x: auto; }.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }.data-table th, .data-table td { padding: 13px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }.data-table th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.quiz-shell { max-width: 850px; margin: 0 auto; }.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }.timer { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; color: var(--navy); background: #eaf0f7; border-radius: 10px; font-variant-numeric: tabular-nums; font-weight: 900; }.timer.warn { color: #913d2e; background: #fff0ed; }
.question-card { padding: clamp(23px, 5vw, 42px); background: white; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }.question-number { color: var(--mint-dark); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }.question-card h2 { margin: 14px 0 26px; font-size: clamp(23px, 3vw, 31px); line-height: 1.18; }.options { display: grid; gap: 11px; }.option { display: flex; align-items: start; gap: 12px; width: 100%; padding: 15px; color: var(--ink); background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; text-align: left; }.option:hover, .option.selected { background: #eafaf5; border-color: var(--mint); }.option-letter { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; color: var(--navy); background: #e7edf4; border-radius: 7px; font-size: 12px; font-weight: 900; }.selected .option-letter { color: #063f34; background: var(--mint); }.quiz-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 25px; }
.result-hero { display: grid; place-items: center; padding: 35px; color: white; background: linear-gradient(145deg, #173d6b, #166b78); border-radius: 18px; text-align: center; }.score-ring { display: grid; place-items: center; width: 150px; height: 150px; margin: 10px 0 20px; background: conic-gradient(var(--mint) var(--score), rgba(255,255,255,.16) 0); border-radius: 50%; }.score-ring:after { content: attr(data-score); display: grid; place-items: center; width: 116px; height: 116px; color: white; background: var(--navy-2); border-radius: 50%; font-size: 30px; font-weight: 900; }.review-list { display: grid; gap: 11px; margin-top: 18px; }.review-item { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }.review-item.correct { border-left: 4px solid var(--mint-dark); }.review-item.incorrect { border-left: 4px solid var(--coral); }.review-item strong { display: block; margin-bottom: 5px; }
.lock-card { text-align: center; padding: 35px 20px; }.lock-symbol { font-size: 40px; }.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(8,28,51,.58); }.modal { width: min(100%, 480px); max-height: 90vh; overflow: auto; padding: 25px; background: white; border-radius: 18px; box-shadow: var(--shadow); }.modal-head { display: flex; justify-content: space-between; gap: 15px; }.close { width: 34px; height: 34px; color: var(--muted); background: #f0f4f8; border: 0; border-radius: 9px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(380px, calc(100% - 44px)); padding: 14px 16px; color: white; background: var(--navy); border-radius: 11px; box-shadow: var(--shadow); }.toast.error { background: var(--danger); }
.empty { padding: 30px; color: var(--muted); text-align: center; border: 1px dashed #cbd7e4; border-radius: 14px; }.admin-form { display: grid; gap: 13px; }.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.noscript { max-width: 600px; margin: 80px auto; padding: 30px; background: white; border-radius: 15px; }

@media (max-width: 900px) { .landing-hero { grid-template-columns: 1fr; padding-top: 56px; }.landing-hero-card { max-width: 620px; }.landing-features { grid-template-columns: 1fr; }.landing-unit-band { align-items: flex-start; flex-direction: column; } }
@media (max-width: 600px) { .landing-nav { align-items: flex-start; flex-direction: column; padding: 16px 14px; }.landing-nav .landing-actions { width: 100%; }.landing-nav .landing-actions .btn { flex: 1; }.landing-hero { padding: 48px 14px 64px; }.landing-hero h1 { font-size: 52px; }.landing-section { padding: 10px 14px 60px; }.landing-unit-band { margin: 0 14px 44px; padding: 26px 20px; }.landing-footer { padding: 20px 14px 28px; } }
@media (max-width: 900px) { .auth-layout { grid-template-columns: 1fr; }.auth-visual { min-height: 390px; }.auth-visual h1 { margin-top: 100px; }.app-frame { grid-template-columns: 1fr; grid-template-rows: 1fr; }.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 180px; height: 100dvh; max-height: 100dvh; overflow: hidden; overscroll-behavior: contain; touch-action: pan-y; padding: 12px 10px 0; box-shadow: 8px 0 24px rgba(16,43,80,.18); transform: translateX(-105%); transition: transform .22s ease; }.sidebar.is-open { transform: translateX(0); }.sidebar .wordmark { flex: 0 0 auto; }.nav-list { display: grid; flex: 0 1 auto; min-height: 0; max-height: calc(100dvh - 190px); gap: 3px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }.nav-btn { display: flex; flex: 0 0 auto; flex-direction: row; gap: 10px; min-width: 0; padding: 9px 8px; text-align: left; font-size: 11px; }.nav-btn span:not(.nav-icon) { display: block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }.nav-icon { width: 22px; font-size: 18px; line-height: 1; }.sidebar-bottom { display: block; flex: 0 0 auto; margin-top: auto; padding-top: 8px; }.sidebar-bottom .profile-mini { margin-bottom: 8px; padding: 8px; }.sidebar-bottom .btn { min-height: 40px; }.mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; color: var(--navy); background: #eaf0f7; border: 0; border-radius: 10px; font-size: 20px; }.sidebar-scrim { position: fixed; inset: 0; z-index: 9; display: block; visibility: hidden; opacity: 0; background: rgba(8,28,51,.42); transition: opacity .2s ease, visibility .2s ease; }.sidebar-scrim.is-visible { visibility: visible; opacity: 1; }.content { grid-column: 1; min-height: 100vh; }.stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .auth-panel { padding: 14px; }.hero-card { display: block; }.hero-stat { margin-top: 20px; }.grid { grid-template-columns: 1fr; }.section-head { align-items: start; flex-direction: column; }.topbar { padding: 16px 12px; }.topbar-meta { display: none; }.main-content { padding: 20px 10px 24px; }.stats { gap: 9px; }.stat-card { padding: 14px; }.stat-card strong { font-size: 23px; }.two-col { grid-template-columns: 1fr; }.quiz-top { align-items: start; flex-direction: column; }.quiz-actions { flex-wrap: wrap; }.quiz-actions .btn { flex: 1; }.history-table { table-layout: fixed; }.history-table th, .history-table td { padding: 10px 4px; font-size: 11px; white-space: normal; word-break: break-word; }.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 27%; }.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 15%; }.history-table th:nth-child(3), .history-table td:nth-child(3) { width: 17%; }.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 23%; }.history-table th:nth-child(5), .history-table td:nth-child(5) { width: 18%; }.history-table .btn { min-height: 36px; padding: 7px 6px; font-size: 11px; }.assignment-list { grid-template-columns: 1fr; }.sidebar { width: 170px; } }

.assignment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 8px; }.assignment-item { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px; padding: 11px; background: #f7fafc; border: 1px solid var(--line); border-radius: 11px; }.assignment-item input { width: auto; margin-top: 3px; }.assignment-item span { display: grid; gap: 3px; }.assignment-item small { color: var(--muted); font-size: 11px; font-weight: 600; }.bulk-publish-card { margin-bottom: 16px; }.bulk-publish-card code { padding: 2px 4px; color: var(--navy); background: #edf3f8; border-radius: 4px; }

.mobile-nav-toggle, .sidebar-scrim { display: none; }

@media (max-width: 900px) { .mobile-nav-toggle { display: inline-flex; }.sidebar-scrim { display: block; } }

/* The sidebar owns the viewport height; the content column may scroll independently. */
@media (min-width: 901px) { .sidebar { position: sticky; top: 0; align-self: start; height: 100vh; max-height: 100vh; overflow: hidden; padding-bottom: 0; } }

.access-actions { display: grid; gap: 11px; margin-top: 24px; }
.access-card { max-width: 500px; }

.cat-group-card { margin-bottom: 18px; }
.cat-group-card .table-wrap { max-height: 560px; overflow: auto; }

.cat-settings-card { border: 2px solid rgba(99,215,187,.45); background: linear-gradient(135deg, #ffffff, #f1fffb); }
