/* Exam Master Admin: same paper + ink palette as the student app, laid out for managing. */
@font-face { font-family: "EM Bangla"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(vendor/noto-sans-bengali.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC; }
:root {
  --bg: #F6F3EC; --surface: #FFFFFF; --surface-2: #EFEAE0; --ink: #1A1D29; --muted: #5E6272; --line: #E0D9CB;
  --accent: #FF5B35; --accent-press: #E8461F; --accent-ink: #FFFFFF; --accent-soft: #FFE7DF;
  --blue: #2950E8; --blue-soft: #E3E9FF; --ok: #17845A; --ok-soft: #DDF3E9; --warn: #9A6200; --warn-soft: #FFF1D6; --danger: #C8283A; --danger-soft: #FCE4E7;
  --shadow: 0 1px 2px rgba(26,29,41,.06), 0 8px 28px rgba(26,29,41,.08);
  --radius: 16px; --radius-sm: 10px;
  --sans: "EM Bangla", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0F1117; --surface: #171A23; --surface-2: #20242F; --ink: #F1EEE7; --muted: #A2A6B5; --line: #2A2F3C;
  --accent: #FF6A45; --accent-press: #FF8565; --accent-ink: #1A0F0B; --accent-soft: #3A2019;
  --blue: #8FA6FF; --blue-soft: #1C2340; --ok: #4CC994; --ok-soft: #13301F; --warn: #F2B84B; --warn-soft: #33270F; --danger: #FF6B7A; --danger-soft: #3A1A1F;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100vh; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; color: inherit; text-decoration: none; min-width: 0; }
.brand b { color: var(--accent); }
.brand .pill { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--ink); color: var(--bg); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); flex: none; display: grid; place-items: center; }
.logo i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: block; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { height: 36px; min-width: 36px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; }

/* layout: bottom nav on phones, side nav on wide screens */
.layout { display: block; }
.side { display: none; }
main.page { padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px); max-width: 1100px; margin: 0 auto; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; min-width: 0; }
.bottom-nav a svg, .side a svg { width: 22px; height: 22px; stroke: currentColor; flex: none; }
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); position: sticky; top: 57px; height: calc(100vh - 57px); }
  .side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
  .side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .bottom-nav { display: none; }
  main.page { padding: 24px 28px 40px; width: 100%; }
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { font-size: 24px; }
.head p { margin: 2px 0 0; }
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card + .card, .card + .section-title, .grid + .card, .grid + .section-title, .card + .grid { margin-top: 14px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.section-title { font-size: 15px; font-weight: 700; margin: 22px 0 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 14px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.alert b { color: var(--danger); }

/* chart */
.chart { display: block; width: 100%; height: 150px; }
.chart rect { fill: var(--accent); }
.chart rect.zero { fill: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* tables become stacked rows on phones */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b, .row .grow .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow .wrap { white-space: normal; overflow-wrap: anywhere; }
.row .end { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
a.row { color: inherit; text-decoration: none; }
a.row:hover .grow b { text-decoration: underline; }
.chev { color: var(--muted); font-size: 20px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-press); }
.btn.outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: default; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search .input { flex: 1; min-width: 0; }

/* notice preview (same look as the student app banner) */
.notice { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--blue-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.success { background: var(--ok-soft); }
.notice b { display: block; }
.notice p { margin: 2px 0 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }

/* login */
.login { max-width: 400px; margin: 8vh auto 0; padding: 0 16px; }
.login .card { padding: 22px; }
.login h1 { font-size: 22px; margin: 14px 0 4px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 60; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10,12,18,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); }
@media (min-width: 600px) { .overlay { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h3 { font-size: 18px; margin-bottom: 6px; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tools a { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.tools a:first-child { border-top: 0; }
.tools a span.grow { flex: 1; min-width: 0; }
.tools a b { display: block; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.denied { max-width: 440px; margin: 10vh auto; padding: 0 16px; text-align: center; }

/* ===== App look (matches the student app's shell: answer-bubble logo, serif titles, blurred top bar, bottom nav) ===== */
:root { --serif: "EM Bangla", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif; --radius: 18px; --radius-sm: 12px; --nav-h: 64px; --safe-t: env(safe-area-inset-top, 0px); }
body { -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
.shell { min-height: 100vh; min-height: 100dvh; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background-color: var(--ink); position: relative; flex: none;
  background-image:
    radial-gradient(circle at 30% 34%, transparent 3.4px, var(--bg) 3.6px, var(--bg) 4.8px, transparent 5px),
    radial-gradient(circle at 70% 34%, var(--accent) 5px, transparent 5.2px),
    radial-gradient(circle at 30% 70%, transparent 3.4px, var(--bg) 3.6px, var(--bg) 4.8px, transparent 5px),
    radial-gradient(circle at 70% 70%, transparent 3.4px, var(--bg) 3.6px, var(--bg) 4.8px, transparent 5px); }
.brand { gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-t { white-space: nowrap; }
.brand b { font-weight: 700; }
.brand .pill { font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
html[lang="bn"] .brand .pill { letter-spacing: 0; font-size: 11.5px; font-weight: 700; }
.topbar { padding: calc(12px + var(--safe-t)) 16px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.tb-right { gap: 8px; }
.icon-btn { height: 38px; min-width: 38px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-weight: 700; }
.icon-btn:hover { background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; flex: none; padding: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; font-family: var(--serif); }
@media (max-width: 380px) { .tb-theme { display: none; } .topbar { padding-left: 14px; padding-right: 14px; } }
@media (max-width: 340px) { .brand .pill { display: none; } }

/* bottom nav: same as the student app */
.bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bottom-nav a { gap: 3px; font-size: 11.5px; font-weight: 600; position: relative; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
html[lang="bn"] .bottom-nav a { font-size: 11px; }

/* side nav on wide screens */
.side-h { margin: 14px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-h:first-child { margin-top: 2px; }
html[lang="bn"] .side-h { letter-spacing: 0; font-size: 12.5px; }
.side .ext, .me-list .ext { width: 14px !important; height: 14px !important; margin-left: auto; color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.side-foot button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--danger); cursor: pointer; text-align: left; }
.side-foot button svg { width: 22px; height: 22px; stroke: currentColor; flex: none; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 236px minmax(0, 1fr); }
  .side { top: 63px; height: calc(100vh - 63px); overflow-y: auto; padding: 14px 12px; background: var(--surface); }
  .side a { position: relative; font-weight: 600; color: var(--muted); }
  .side a:hover, .side-foot button:hover { background: var(--surface-2); }
  .side a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
  .side a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .side a[aria-current="page"] svg { color: var(--accent); }
  .topbar { padding-left: 24px; padding-right: 24px; }
}

/* titles, cards and buttons like the app */
.head h1 { font-family: var(--serif); font-size: 27px; letter-spacing: -.02em; }
.login h1, .denied h1, .sheet h3, .card h3 { font-family: var(--serif); letter-spacing: -.01em; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 10px; }
html[lang="bn"] .section-title { letter-spacing: 0; font-size: 14px; }
.stat b { font-family: var(--serif); font-size: 28px; }
.btn { border-radius: 14px; font-weight: 700; transition: transform .06s, background .15s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { border-radius: 12px; }
html[lang="bn"] .btn, html[lang="bn"] button { line-height: 1.3; }
.input, select.input, textarea.input { border: 1.5px solid var(--line); background: var(--bg); transition: border-color .15s, box-shadow .15s, background .15s; }
.input:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.seg button { border: 1.5px solid var(--line); background: var(--bg); font-weight: 600; }
.login .brand { margin-bottom: 4px; }
.sheet { border-radius: 22px 22px 0 0; }
@media (min-width: 600px) { .sheet { border-radius: 22px; } }

/* account sheet (avatar menu) */
.me-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-width: 0; }
.me-head .grow { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.me-head b { overflow-wrap: anywhere; }
.me-list { display: flex; flex-direction: column; }
.me-list a, .me-list button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; font-weight: 600; width: 100%; }
.me-list svg { width: 22px; height: 22px; stroke: currentColor; flex: none; }
.me-list .me-ic { width: 22px; text-align: center; font-weight: 700; flex: none; }
.me-list .danger { color: var(--danger); }
.toast { border-radius: 14px; }

/* Organization: grouped side menu and Menu page */
@media (min-width: 900px) { .side { overflow-y: auto; gap: 2px; } .side a { padding: 8px 12px; } }
.side-h:first-of-type { margin-top: 14px; }
.tools a .tool-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.tools a .tool-ic svg { width: 20px; height: 20px; stroke: currentColor; }

/* Student profile photos (or initials) in the students list and on a student's page */
.stu-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--surface-2, rgba(127,127,127,.15)); color: inherit; overflow: hidden; }
.stu-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stu-av.lg { width: 64px; height: 64px; font-size: 24px; }
.stu-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
