/* Janbazi Academy panel — mobile-first RTL styles */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --brand: #4f46e5;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-600: #4338ca;
  --brand-2: #a855f7;
  --brand-shadow: rgba(79, 70, 229, 0.3);
  --bg: #f5f6fa;
  --card: #fff;
  --text: #0f172a;
  --text2: #334155;
  --muted: #64748b;
  --line: #e6e8ef;
  --green: #059669;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --gray-bg: #f1f5f9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
  --side: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; }
h4 { margin: 18px 0 8px; font-size: 15px; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.green { color: var(--green); }
.red { color: var(--red); }
.amber { color: var(--amber); }
.grow { flex: 1; }
.strong { font-weight: 700; }
[dir='ltr'] { unicode-bidi: plaintext; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  text-decoration: none; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px var(--brand-shadow); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: var(--card); color: var(--text2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-ghost { background: var(--card); color: var(--red); border-color: #fecaca; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--text2); cursor: pointer; flex-shrink: 0; position: relative;
}
.icon-btn:hover { background: var(--gray-bg); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red-bg); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-weight: 500; }
.link-btn.red { color: var(--red); }
.link { font-weight: 600; font-size: 13px; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spin-sm { width: 16px; height: 16px; border-width: 2px; }
.btn-primary .spin { border-color: rgba(255,255,255,0.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 0; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-label { font-weight: 600; font-size: 13.5px; color: var(--text2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-err { font-size: 12.5px; color: var(--red); }
.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; outline: none; transition: border-color 0.15s, box-shadow 0.15s; font-size: 15px;
}
textarea.input { resize: vertical; min-height: 80px; line-height: 1.8; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input:disabled { background: var(--gray-bg); color: var(--muted); }
.input.num, .num-cell { font-feature-settings: 'tnum'; letter-spacing: 0.5px; }
.input.num { text-align: right; }
.input.num::placeholder { text-align: right; }
.input-sm { min-height: 36px; padding: 4px 10px; font-size: 14px; border-radius: 10px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; padding-left: 32px; }
input[type='color'].input { padding: 4px; height: 44px; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline.wrap { flex-wrap: wrap; margin-bottom: 12px; }
.row-inline.end { justify-content: flex-end; margin: 12px 0; }
.row-inline.between { justify-content: space-between; }
.row-inline > .input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.grid-3, .grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 44px; height: 26px; border-radius: 99px; background: #cbd5e1; position: relative; flex-shrink: 0; transition: background 0.2s; margin-top: 2px; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: right 0.2s; }
.toggle input:checked + .toggle-ui { background: var(--brand); }
.toggle input:checked + .toggle-ui::after { right: 21px; }
.toggle input:focus-visible + .toggle-ui { box-shadow: 0 0 0 4px var(--brand-100); }
.toggle-text { display: flex; flex-direction: column; }
.toggle-text small { color: var(--muted); font-size: 12.5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; user-select: none; }
.chip input { display: none; }
.chip.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 600; }
.seg { display: flex; background: var(--gray-bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.seg-sm { margin: 0; }
.seg-sm button { padding: 4px 10px; font-size: 13px; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-left: 46px; }
.pass-wrap .icon-btn { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; color: var(--muted); }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--gray-bg); padding: 10px 12px; border-radius: 10px; margin: 6px 0 14px; }
.indent { padding: 0 56px 6px 0; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; }
.side {
  position: fixed; top: 0; bottom: 0; right: 0; width: var(--side); background: var(--card); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 60; transform: translateX(105%); transition: transform 0.25s ease; padding-bottom: var(--safe-b);
}
.side.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,0.15); }
.side-back { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 55; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.side-brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 800; flex-shrink: 0; }
.side-brand b { display: block; font-size: 15px; line-height: 1.4; }
.side-brand small { color: var(--muted); font-size: 12.5px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text2); font-weight: 500; margin-bottom: 2px; border: 0; background: none; width: 100%; cursor: pointer; text-align: right; }
.nav-item:hover { background: var(--gray-bg); }
.nav-item.on { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.nav-item .soon { margin-right: auto; font-style: normal; font-size: 11px; background: var(--amber-bg); color: var(--amber); padding: 0 8px; border-radius: 99px; }
.side-logout { margin: 8px 10px 12px; width: auto; color: var(--red); }
.main { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(68px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(245,246,250,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.top-title { font-weight: 800; font-size: 16px; }
.top-greet { font-weight: 600; color: var(--text2); }
.top-actions { margin-right: auto; display: flex; align-items: center; gap: 6px; }
.bell .dot { position: absolute; top: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; line-height: 1; font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-100); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.content { padding: 8px 14px 24px; width: 100%; max-width: 1200px; margin: 0 auto; }
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: flex; background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
}
.bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 4px 0; border: 0; background: none; cursor: pointer; font-weight: 600; }
.bottom .on { color: var(--brand); }
.only-desktop { display: none; }
.only-mobile-flex { display: inline-flex; }

/* ---------- Page / cards ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 16px; }
.page-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.page-title h1 { font-size: 20px; font-weight: 800; }
.page-title p { margin: 0; color: var(--muted); font-size: 13.5px; }
.back { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--text2); background: var(--card); border: 1px solid var(--line); flex-shrink: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 14px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; }
.card-head h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 14px 16px 16px; }
.card.pinned { border-color: #fecaca; }
.sec-title { font-size: 15px; margin: 18px 0 10px; }
.narrow { max-width: 780px; margin: 0 auto; }
.grid-main { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stats.sm .stat { padding: 10px; }
.stat { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-v { font-size: 19px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.stat-l { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-purple { background: var(--purple-bg); color: var(--purple); }
.tone-gray { background: var(--gray-bg); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.8; }
.badge-gray { background: var(--gray-bg); color: var(--muted); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-brand { background: var(--brand-50); color: var(--brand); }
.alert { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.alert > b { width: 100%; }
.alert p { margin: 4px 0 0; }
.alert-green { background: var(--green-bg); color: #065f46; }
.alert-red { background: var(--red-bg); color: #991b1b; }
.alert-amber { background: var(--amber-bg); color: #92400e; }
.alert-gray { background: var(--gray-bg); color: var(--text2); }
.alerts { display: grid; gap: 8px; margin-bottom: 8px; }
.alerts .alert { margin: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.empty-ic.red { background: var(--red-bg); color: var(--red); }
.empty-title { font-weight: 700; color: var(--text2); }
.empty-text { font-size: 13.5px; max-width: 360px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1.5px solid var(--line); background: var(--card); padding: 6px 14px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab-count { background: rgba(0,0,0,0.08); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.tab.on .tab-count { background: rgba(255,255,255,0.25); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); min-width: 0; }
.card.list .list-item { padding: 12px 16px; }
.list-item:last-child { border-bottom: 0; }
.li-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.li-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main small { color: var(--muted); font-size: 12.5px; }
.mini-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mini-rows > div:last-child { border-bottom: 0; }
.mini-rows span { color: var(--muted); }
.mini-rows.two { display: grid; grid-template-columns: 1fr; gap: 0 20px; margin-bottom: 10px; }
.res-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.hover tr:hover td { background: #fafbff; }
.table.sm td, .table.sm th { padding: 7px 10px; font-size: 13px; }
.table .chk { width: 36px; }
.table input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--brand); }
.row-err td { background: var(--red-bg); }
.muted-row td { opacity: 0.55; }
.clickable { cursor: pointer; }
.hide-sm { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0; font-size: 14px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters > * { flex: 1 1 160px; min-width: 0; }
.filters .search { flex: 2 1 220px; position: relative; }
.filters .search .ic { position: absolute; right: 12px; top: 13px; color: var(--muted); }
.filters .search .input { padding-right: 38px; }
.bulkbar { position: sticky; top: 60px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.bulkbar .link-btn { color: #fff; opacity: 0.85; }
.plain { padding-right: 18px; margin: 6px 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; color: var(--red); }
.checklist li.ok { color: var(--green); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up 0.2s ease-out; padding-bottom: var(--safe-b); }
@keyframes up { from { transform: translateY(30px); opacity: 0.6; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.confirm-text { font-size: 15px; margin: 6px 0; line-height: 1.9; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; left: 12px; right: 12px; top: calc(64px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; max-width: 520px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); opacity: 0; transform: translateY(-10px); transition: all 0.25s; pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast-err { background: #b91c1c; }

/* ---------- Notifications ---------- */
.drop-back { position: fixed; inset: 0; z-index: 70; }
.notif-panel { position: fixed; z-index: 75; top: 60px; left: 10px; right: 10px; max-height: 70vh; background: var(--card); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; }
.notif { display: flex; flex-direction: column; text-align: right; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 11px 16px; cursor: pointer; }
.notif.unread { background: var(--brand-50); }
.notif b { font-size: 14px; }
.notif span { font-size: 13px; color: var(--text2); }
.notif small { font-size: 12px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--brand-100); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; color: var(--brand); }
.banner > div { flex: 1; display: flex; flex-direction: column; color: var(--text); }
.banner small { color: var(--muted); font-size: 12.5px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-side { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; padding: 34px 20px 64px; position: relative; overflow: hidden; }
.auth-brand { position: relative; z-index: 1; text-align: center; }
.auth-brand h1 { font-size: 22px; font-weight: 800; margin-top: 12px; }
.auth-brand p { margin: 4px 0 0; opacity: 0.85; font-size: 14px; }
.auth-mark { width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,0.18); display: grid; place-items: center; font-size: 34px; font-weight: 800; margin: 0 auto; backdrop-filter: blur(4px); }
.auth-logo { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; background: #fff; }
.auth-math { position: absolute; inset: 0; pointer-events: none; }
.auth-math span { position: absolute; font-size: 40px; opacity: 0.12; font-weight: 800; font-family: Georgia, serif; }
.auth-math span:nth-child(1) { top: 10%; right: 8%; }
.auth-math span:nth-child(2) { top: 55%; left: 10%; font-size: 56px; }
.auth-math span:nth-child(3) { bottom: 8%; right: 30%; }
.auth-math span:nth-child(4) { top: 18%; left: 28%; font-size: 30px; }
.auth-math span:nth-child(5) { bottom: 22%; right: 6%; font-size: 34px; }
.auth-math span:nth-child(6) { top: 6%; left: 6%; font-size: 26px; }
.auth-main { flex: 1; padding: 0 14px 30px; margin-top: -40px; position: relative; z-index: 2; }
.auth-card { background: var(--card); border-radius: 22px; box-shadow: 0 10px 40px rgba(15,23,42,0.1); padding: 22px 18px; max-width: 480px; margin: 0 auto; }
.auth-card h2 { font-size: 19px; font-weight: 800; margin-bottom: 16px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-support { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 16px; }
.otp-input { font-size: 22px; letter-spacing: 8px; text-align: center !important; font-weight: 700; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.step b { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-bg); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.step.on { color: var(--brand); font-weight: 700; }
.step.on b { background: var(--brand); color: #fff; }
.step.done b { background: var(--green-bg); color: var(--green); }
.seg-3 button { padding: 10px; }
.choice-list { display: grid; gap: 8px; margin-bottom: 8px; }
.choice { text-align: right; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.choice small { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.choice.on { border-color: var(--brand); background: var(--brand-50); }
.choice:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Student home ---------- */
.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 20px; padding: 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.hero h1 { font-size: 20px; font-weight: 800; }
.hero p { margin: 0; opacity: 0.9; font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.18); padding: 3px 12px; border-radius: 99px; font-size: 13px; }
.ns { display: flex; gap: 14px; margin-bottom: 12px; }
.ns-date { width: 64px; height: 70px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.ns-date b { font-size: 24px; line-height: 1.2; }
.ns-date span { font-size: 12px; }
.ns-info { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ns-info span { display: flex; gap: 6px; align-items: center; color: var(--text2); }
.ann { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ann:last-child { border: 0; }
.ann small { color: var(--muted); margin-right: auto; font-size: 12px; }

/* ---------- Homework ---------- */
.hw-card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); transition: border-color 0.15s, transform 0.1s; }
.hw-card:hover { border-color: var(--brand-100); }
.hw-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hw-top b { font-size: 15px; }
.hw-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.hw-meta span { display: inline-flex; align-items: center; gap: 4px; }
.hw-score b { color: var(--brand); font-size: 15px; }
.hw-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.hw-rules span { display: inline-flex; align-items: center; gap: 4px; }
.cd-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--brand); background: var(--brand-50); padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.cd-inline.urgent { color: var(--red); background: var(--red-bg); }
.cd-inline.done { color: var(--muted); background: var(--gray-bg); }
.countdown { background: var(--card); border: 1px solid var(--brand-100); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; text-align: center; box-shadow: var(--shadow); }
.countdown.urgent { border-color: #fecaca; background: #fffafa; }
.countdown.urgent .cd-box b { color: var(--red); }
.countdown.done { color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 600; background: var(--gray-bg); }
.cd-label { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.cd-boxes { display: flex; justify-content: center; gap: 8px; direction: rtl; }
.cd-box { min-width: 62px; background: var(--brand-50); border-radius: 12px; padding: 6px 4px; display: flex; flex-direction: column; }
.cd-box b { font-size: 24px; font-weight: 800; color: var(--brand); line-height: 1.3; font-feature-settings: 'tnum'; }
.cd-box small { font-size: 12px; color: var(--muted); }
.files { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.file-thumb, .file-ic { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: var(--gray-bg); color: var(--muted); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; direction: ltr; text-align: right; }
.file-name small { color: var(--muted); font-size: 12px; }
.upload-zone { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 14px; border: 2px dashed var(--brand-100); border-radius: 14px; background: var(--brand-50); }
.upload-zone small { width: 100%; }
.upq { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; background: var(--gray-bg); border-radius: 10px; }
.upq.err { background: var(--red-bg); }
.upq-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; direction: ltr; }
.progress { flex: 1; height: 22px; background: #e2e8f0; border-radius: 99px; overflow: hidden; position: relative; }
.progress-bar { height: 100%; background: var(--brand); transition: width 0.2s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text); }
.progress-line { height: 6px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.progress-line div { height: 100%; background: var(--green); border-radius: 99px; }
.answer-text { margin-top: 16px; }
.grade-card { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--blue-bg); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.grade-card > div:last-child { flex: 1; }
.ring { position: relative; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--gray-bg); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 0.6s; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.rich { white-space: pre-wrap; word-break: break-word; line-height: 1.95; }
.rich a { word-break: break-all; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.gallery img { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--gray-bg); }
.gal-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 160px; border: 1px solid var(--line); border-radius: 12px; background: var(--gray-bg); color: var(--text2); padding: 8px; text-align: center; font-size: 12.5px; word-break: break-all; }
.answer-box { background: var(--gray-bg); padding: 12px; border-radius: 12px; margin-bottom: 14px; }
.quick-scores { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }

/* ---------- Sessions / attendance ---------- */
.class-info { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; }
.class-info span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.session-card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); font-size: 14px; }
.session-card.live { border-color: var(--red); }
.session-card span { display: flex; align-items: center; gap: 6px; }
.sc-top { display: flex; justify-content: space-between; gap: 8px; }
.att-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.roster { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rost { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.15s; }
.rost.st-present { border-color: #a7f3d0; }
.rost.st-online { border-color: #bfdbfe; }
.rost.st-late { border-color: #fde68a; }
.rost.st-absent { border-color: #fecaca; background: #fffafa; }
.rost.st-excused { border-color: #cbd5e1; }
.rost.left { opacity: 0.65; }
.rost-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rost-name small { font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.rn { width: 24px; height: 24px; border-radius: 8px; background: var(--gray-bg); display: grid; place-items: center; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.att-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.att-b { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 2px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.att-b.on.tone-green { background: var(--green); border-color: var(--green); color: #fff; }
.att-b.on.tone-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-b.on.tone-amber { background: #d97706; border-color: #d97706; color: #fff; }
.att-b.on.tone-red { background: var(--red); border-color: var(--red); color: #fff; }
.att-b.on.tone-gray { background: #64748b; border-color: #64748b; color: #fff; }
.rost-note { max-width: 100%; }
.savebar { position: sticky; bottom: calc(70px + var(--safe-b)); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 10px 10px; margin: 10px 0 16px; box-shadow: 0 10px 30px rgba(15,23,42,0.12); font-size: 13.5px; color: var(--muted); }
.savebar.dirty { border-color: var(--brand); }
.mini-badges { display: flex; gap: 4px; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--gray-bg); padding: 8px; border-radius: 12px; font-size: 13px; }
.slot .input { width: auto; min-width: 74px; min-height: 38px; }
.class-card { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); font-size: 14px; }
.class-card.archived { opacity: 0.6; }
.class-card > span { display: flex; align-items: center; gap: 6px; color: var(--text2); }
.cc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cc-top small { display: block; color: var(--muted); }
.cc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); align-items: center; }

/* ---------- Calendar ---------- */
.dp-btn { display: flex; align-items: center; gap: 8px; text-align: right; cursor: pointer; }
.dp-btn.muted { color: var(--muted); }
.dp-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.cal-title { display: flex; gap: 6px; }
.cal-title .input { width: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-wd.fri, .cal-d.fri { color: var(--red); }
.cal-d { aspect-ratio: 1; border: 0; background: transparent; border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 500; }
.cal-d:hover { background: var(--brand-50); }
.cal-d.today { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand); font-weight: 700; }
.cal-d.on { background: var(--brand); color: #fff !important; font-weight: 700; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-time { display: flex; align-items: center; gap: 4px; direction: rtl; }
.cal-time .input { width: 70px; }
.cal-sel { margin-top: 10px; text-align: center; background: var(--brand-50); color: var(--brand); padding: 8px; border-radius: 10px; font-weight: 600; font-size: 14px; }

/* ---------- Exams ---------- */
.exam-bar { position: sticky; top: 58px; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.exam-bar small { display: block; color: var(--muted); font-size: 12.5px; }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.q-body { display: flex; gap: 6px; margin-bottom: 10px; font-size: 15.5px; }
.q-img { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin: 0 auto 10px; border: 1px solid var(--line); }
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; align-items: center; gap: 10px; text-align: right; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 15px; }
.q-opt.on { border-color: var(--brand); background: var(--brand-50); font-weight: 600; }
.q-opt.static { cursor: default; }
.q-opt.correct { border-color: var(--green); background: var(--green-bg); }
.q-opt.wrong { border-color: var(--red); background: var(--red-bg); }
.q-n { width: 28px; height: 28px; border-radius: 8px; background: var(--gray-bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; border: 0; cursor: pointer; }
.q-opt.on .q-n { background: var(--brand); color: #fff; }
.q-exp { margin-top: 10px; background: var(--blue-bg); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.q-edit { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; background: #fcfcfd; }
.q-edit-head { display: flex; align-items: center; gap: 6px; }
.q-opts-edit { display: grid; gap: 6px; }
.q-oe { display: flex; gap: 6px; align-items: center; }
.q-oe.correct .q-n { background: var(--green); color: #fff; }
.q-oe.correct .input { border-color: var(--green); }
.q-img-wrap { text-align: center; }
.qstats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; align-items: flex-end; }
.qs { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); min-width: 28px; }
.qs-bar { width: 18px; height: 80px; background: var(--gray-bg); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.qs-bar div { width: 100%; background: var(--green); }
.qs-bar div.low { background: var(--red); }
.result { text-align: center; padding: 30px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.result.ok .result-ic { background: var(--green-bg); color: var(--green); }
.result.fail .result-ic { background: var(--red-bg); color: var(--red); }

/* ---------- Report, leaderboard ---------- */
.report-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.report-head > div { display: flex; flex-direction: column; }
.report-head span { color: var(--muted); font-size: 13.5px; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 14px; }
.pod { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; text-align: center; display: flex; flex-direction: column; box-shadow: var(--shadow); font-size: 13px; min-width: 0; }
.pod b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod span { color: var(--muted); font-size: 12px; }
.pod-1 { order: 2; padding-top: 22px; border-color: #fde68a; background: linear-gradient(#fffbeb, #fff); }
.pod-2 { order: 1; }
.pod-3 { order: 3; }
.pod.me { box-shadow: 0 0 0 2px var(--brand); }
.pod-medal { font-size: 30px; line-height: 1.2; }
.board { list-style: none; margin: 0; padding: 6px 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.board li:last-child { border: 0; }
.board li.me { background: var(--brand-50); font-weight: 700; }
.board .rk { width: 28px; height: 28px; border-radius: 8px; background: var(--gray-bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.big-num { font-size: 40px; font-weight: 900; text-align: center; color: var(--brand); }
.plog { list-style: none; margin: 0; padding: 0; }
.plog li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.plog li span { display: flex; flex-direction: column; }
.plog small { color: var(--muted); font-size: 11.5px; }

/* ---------- Courses ---------- */
.course-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.course { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.course.archived { opacity: 0.6; }
.course img, .course-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); color: var(--brand); display: grid; place-items: center; }
.course-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-body > b { font-size: 15.5px; }
.course-desc { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.course-meta span { background: var(--gray-bg); font-size: 12px; padding: 1px 8px; border-radius: 99px; color: var(--text2); }
.course-buy { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { display: flex; flex-direction: column; }
.price del { color: var(--muted); font-size: 12.5px; }
.price b { color: var(--brand); }
.license { display: flex; align-items: center; gap: 8px; background: var(--gray-bg); border-radius: 12px; padding: 10px; margin: 12px 0; flex-wrap: wrap; }
.license code { flex: 1; word-break: break-all; font-size: 13px; min-width: 0; }
.steps-list { padding-right: 20px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* ---------- Tickets ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.msg small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.msg.mine { align-self: flex-start; background: var(--brand-50); border-color: var(--brand-100); border-top-right-radius: 4px; }
.msg.theirs { align-self: flex-end; border-top-left-radius: 4px; }
.composer .input { margin-bottom: 8px; }

/* ---------- Admin misc ---------- */
.sd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.sd-head > div:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.sd-head span { font-size: 13.5px; color: var(--text2); }
.sd-actions { display: flex; gap: 6px; }
.grant { background: var(--gray-bg); border-radius: 12px; padding: 12px; margin-top: 8px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 2px dashed var(--brand-100); border-radius: 16px; background: var(--brand-50); color: var(--brand); cursor: pointer; text-align: center; }
.mod-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pattern { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.pattern-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pattern-head code { background: var(--gray-bg); padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.pattern-text { white-space: pre-wrap; background: var(--gray-bg); padding: 10px; border-radius: 10px; margin: 0 0 8px; font-family: inherit; font-size: 13.5px; line-height: 1.9; direction: rtl; }
.sms-text { min-width: 220px; max-width: 320px; font-size: 12.5px; white-space: pre-wrap; color: var(--text2); }

/* ---------- Desktop ---------- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .hide-sm { display: table-cell; }
  .modal-back { align-items: center; padding: 20px; }
  .modal { border-radius: 22px; max-height: 88vh; }
  .modal-sm { max-width: 440px; }
  .modal-md { max-width: 640px; }
  .modal-lg { max-width: 920px; }
  .mini-rows.two { grid-template-columns: 1fr 1fr; }
  .rost { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .rost-name { flex: 1 1 180px; }
  .att-seg { flex: 0 0 auto; display: flex; }
  .att-b { padding: 7px 12px; }
  .rost-note { flex: 0 1 180px; }
  .toasts { left: 24px; right: auto; top: auto; bottom: 24px; align-items: flex-start; }
  .notif-panel { left: 20px; right: auto; width: 380px; }
  .report-head { flex-direction: row; justify-content: space-between; text-align: right; }
}
@media (min-width: 1024px) {
  .side { transform: none; box-shadow: none; }
  .side-back, .only-mobile, .bottom { display: none !important; }
  .only-desktop { display: block; }
  .only-mobile-flex { display: none; }
  .main { margin-right: var(--side); padding-bottom: 0; }
  .top { padding: 14px 28px; }
  .content { padding: 8px 28px 40px; }
  .grid-main { grid-template-columns: 1.6fr 1fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .course-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .savebar { bottom: 16px; }
  .bulkbar { top: 70px; }
  .exam-bar { top: 70px; }
  .auth { flex-direction: row; }
  .auth-side { flex: 1; display: grid; place-items: center; padding: 40px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-main { flex: 1; margin: 0; display: flex; flex-direction: column; justify-content: center; padding: 40px; }
  .page-title h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  .side, .top, .bottom, .page-actions, .savebar, .toasts { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- Call parents ---------- */
.calls { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.calls.compact { width: auto; justify-content: flex-end; }
.call-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 13px; border: 1px solid #a7f3d0; white-space: nowrap; }
.call-btn small { font-weight: 500; opacity: 0.85; }
.call-btn.sms { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; padding: 6px 9px; }
.call-btn:active { transform: scale(0.97); }
.call-none { font-size: 12.5px; color: var(--amber); }
.absent-row { flex-wrap: wrap; }
.absent-row .li-main b { display: flex; gap: 6px; align-items: center; }
@media (min-width: 640px) { .rost .calls { width: auto; flex: 1 1 100%; } }

/* ---------- Course page ---------- */
.course-cover { position: relative; display: block; }
.course-badge { position: absolute; top: 10px; right: 10px; background: #f59e0b; color: #fff; font-size: 12.5px; font-weight: 700; padding: 2px 12px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.course-title { color: var(--text); font-weight: 700; font-size: 15.5px; }
.course-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; background: var(--brand-50); display: block; }
.course-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.course-buy.big { padding-top: 0; flex-wrap: wrap; gap: 10px; }
.course-buy.big .price { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.course-buy.big .price b { font-size: 20px; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-el { width: 100%; border-radius: var(--radius); margin-bottom: 14px; background: #000; }
.syllabus { margin: 0; padding-right: 22px; list-style: persian; }
.syllabus li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.syllabus li:last-child { border: 0; }
.cover-pick { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cover-pick img, .cover-pick .course-ph { width: 200px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.cover-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- Floating file viewer ---------- */
.pv { position: fixed; inset: 0; z-index: 300; background: #0b0d14; display: flex; flex-direction: column; color: #fff; animation: fade 0.15s; }
.pv-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: rgba(0, 0, 0, 0.35); }
.pv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-title b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title small { font-size: 12px; opacity: 0.7; }
.pv-tools { display: flex; align-items: center; gap: 2px; }
.pv-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 0; background: transparent; color: #fff; cursor: pointer; }
.pv-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pv-zoom { min-width: 44px; text-align: center; font-size: 12.5px; opacity: 0.85; }
.pv-body { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pv-img { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pv-img-in { display: flex; align-items: center; justify-content: center; margin: auto; min-width: 100%; min-height: 100%; }
.pv-img img { display: block; object-fit: contain; transition: transform 0.2s; user-select: none; background: #fff; }
.pv-pdf { position: absolute; inset: 0; overflow: auto; padding: 12px 8px 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pv-page { background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); flex-shrink: 0; }
.pv-page canvas { display: block; }
.pv-msg { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px; color: #e2e8f0; }
.pv-video { max-width: 100%; max-height: 100%; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.pv-nav:hover { background: rgba(255, 255, 255, 0.25); }
.pv-prev { right: 10px; }
.pv-next { left: 10px; }
.pv-strip { display: flex; gap: 6px; padding: 8px 10px calc(8px + var(--safe-b)); overflow-x: auto; background: rgba(0, 0, 0, 0.35); }
.pv-th { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 11px; font-weight: 700; padding: 0; cursor: pointer; opacity: 0.65; }
.pv-th.on { border-color: #fff; opacity: 1; }
.pv-th img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .pv-nav { width: 38px; height: 38px; } .pv-zoom { display: none; } }

/* ---------- Math ---------- */
.mt { white-space: pre-wrap; overflow-wrap: anywhere; }
.math { direction: ltr; unicode-bidi: isolate; display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding: 1px 0; }
.math-block { display: block; text-align: center; margin: 8px 0; }
.math .katex { font-size: 1.12em; }
.mf { margin-bottom: 12px; position: relative; }
.mf-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mf-tbtn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; color: var(--text2); }
.mf-tbtn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.mf-tbtn-abs { position: absolute; left: 6px; top: 6px; z-index: 2; padding: 3px 6px; }
.mf-compact textarea { resize: none; overflow: hidden; min-height: 42px; padding-left: 38px; }
.mf-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--gray-bg); border-radius: 12px; margin-bottom: 6px; }
.mf-tools button { min-width: 36px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; direction: ltr; padding: 0 6px; }
.mf-tools button:hover { border-color: var(--brand); color: var(--brand); }
.mf-tools small { width: 100%; font-size: 12px; margin-top: 2px; }
.mf-preview { margin-top: 6px; padding: 8px 12px; border: 1px dashed var(--brand-100); background: var(--brand-50); border-radius: 10px; font-size: 14.5px; }
.mf-preview > small { color: var(--muted); font-size: 11.5px; display: block; }

/* ---------- Exam editor ---------- */
.exam-editor { padding-bottom: 10px; }
.img-pick { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 12px; cursor: pointer; color: var(--muted); font-size: 13.5px; background: #fff; margin-bottom: 10px; }
.img-pick:hover { border-color: var(--brand); color: var(--brand); }
.img-pick.sm { padding: 0; width: 42px; height: 42px; justify-content: center; margin: 0; flex-shrink: 0; }
.img-pick.has { position: relative; padding: 0; border-style: solid; overflow: hidden; cursor: default; }
.img-pick.has img { display: block; max-height: 180px; max-width: 100%; }
.img-pick.has.sm img { width: 42px; height: 42px; object-fit: cover; }
.img-pick.has .icon-btn { position: absolute; top: 4px; left: 4px; background: rgba(255,255,255,0.92); width: 28px; height: 28px; }
.img-pick.has.sm .icon-btn { top: -2px; left: -2px; width: 22px; height: 22px; }
.qe-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.qe-head h3 { margin: 0; font-size: 16px; }
.qe-head h3 small { font-weight: 500; font-size: 13px; }
.qe-bulk { display: flex; align-items: center; gap: 6px; }
.qe-bulk .input { width: 70px; min-height: 34px; }
.qe { margin-bottom: 10px; padding: 0; overflow: visible; }
.qe-warn { border-color: #fca5a5; }
.qe-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; flex-wrap: wrap; }
.qe-sum { flex: 1 1 160px; min-width: 0; color: var(--text2); font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qe-sum .mt { white-space: nowrap; }
.qe-acts { display: flex; gap: 2px; }
.qe-acts .icon-btn { width: 32px; height: 32px; }
.qe-chev { transition: transform 0.2s; color: var(--muted); }
.qe-chev.open { transform: rotate(180deg); }
.flip { transform: rotate(180deg); }
.qe-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.qe-body > .seg { margin-top: 12px; }
.qe-opts { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.qe-opt { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: 12px; border: 1.5px solid transparent; }
.qe-opt.correct { border-color: var(--green); background: var(--green-bg); }
.qe-opt .q-n { margin-top: 5px; cursor: pointer; border: 0; }
.qe-opt.correct .q-n { background: var(--green); color: #fff; }
.qe-opt .mf { margin: 0; }
.qe-opt .img-pick, .qe-opt .icon-btn { margin-top: 0; }
.qe-exp { margin-top: 4px; }
.qe-exp summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text2); padding: 6px 0; }
.qe-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.qe-add .btn { flex: 1; min-height: 48px; border-style: dashed; }
.seg-wide button { white-space: normal; line-height: 1.5; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.chips-row .chip { padding: 4px 11px; font-size: 13px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-lg { min-height: 52px; font-size: 16px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; background: var(--gray-bg); color: var(--text2); font-size: 12px; font-weight: 600; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.red { background: var(--red-bg); color: var(--red); }
.alert-blue { background: var(--blue-bg); color: #1e40af; }
.exam-admin-card { padding: 0; display: flex; flex-direction: column; }
.ea-main { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 10px; color: inherit; flex: 1; }
.ea-actions { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ea-actions .icon-btn { margin-inline-start: auto; }
.foot-inline { display: inline-flex; align-items: center; gap: 4px; }
.foot-inline .input { width: 64px; min-height: 40px; }

/* ---------- Exam: questions & runner ---------- */
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.q-num { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: 14px; }
.q-body { font-size: 16px; line-height: 2; margin-bottom: 12px; }
.q-body .q-img { display: block; margin: 8px auto 0; max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.q-otext { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; line-height: 1.9; }
.q-oimg { max-width: 100%; max-height: 200px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; align-self: flex-start; background: #fff; }
.q-opts.with-img { grid-template-columns: repeat(2, 1fr); }
.q-opts.with-img .q-opt { align-items: flex-start; }
.q-opt { min-height: 52px; transition: border-color 0.12s, background 0.12s; color: var(--text); }
.q-opt:hover:not(:disabled):not(.static) { border-color: var(--brand-100); }
.q-opt:disabled { opacity: 0.7; cursor: not-allowed; }
.q-opt.mine { box-shadow: inset 0 0 0 1px var(--brand-100); }
.q-tag { margin-inline-start: auto; font-size: 11.5px; padding: 2px 8px; border-radius: 8px; background: var(--brand-50); color: var(--brand); white-space: nowrap; align-self: center; }
.q-tag.ok { background: var(--green); color: #fff; }
.q-card.run { padding: 16px; }
.q-card.flagged { border-color: #fcd34d; box-shadow: 0 0 0 2px #fef3c7; }
.q-card.q-correct { border-right: 4px solid var(--green); }
.q-card.q-wrong, .q-card.q-partial { border-right: 4px solid var(--red); }
.q-card.q-pending { border-right: 4px solid var(--amber); }
.flag-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.flag-btn.on { background: #fef3c7; border-color: #fcd34d; color: #92400e; font-weight: 700; }
.essay-box textarea { margin-bottom: 8px; line-height: 1.9; }
.essay-ans { display: flex; flex-direction: column; gap: 8px; }
.essay-text { padding: 10px 12px; border-radius: 12px; background: var(--gray-bg); }
.grade-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: end; padding: 10px; border-radius: 12px; background: var(--amber-bg); }
.grade-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.exam-desc { margin-bottom: 10px; line-height: 1.9; }
.rules { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text2); line-height: 1.8; }
.exam-card.hot { border-color: var(--brand-100); box-shadow: 0 0 0 2px var(--brand-50), var(--shadow); }
.exam-bar { flex-wrap: nowrap; }
.exam-bar.urgent { border-color: #fca5a5; }
.eb-title { min-width: 0; flex: 1; }
.eb-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-timer { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: var(--brand-50); color: var(--brand); font-size: 18px; direction: ltr; font-variant-numeric: tabular-nums; }
.eb-timer.urgent { background: var(--red-bg); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.65; } }
.exam-layout { display: block; }
.exam-main { min-width: 0; }
.exam-nav { position: fixed; z-index: 65; bottom: 0; left: 0; right: 0; max-height: 75vh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 14px 14px calc(14px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,0.18); transform: translateY(105%); transition: transform 0.22s ease; }
.exam-nav.open { transform: none; }
.en-back { z-index: 62; }
.en-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.en-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-bottom: 10px; }
.en-cell { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; color: var(--text2); position: relative; }
.en-cell.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.en-cell.flag { border-color: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.en-cell.cur { outline: 2px solid var(--text); outline-offset: 1px; }
.en-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--line); vertical-align: middle; margin-inline-end: 4px; background: #fff; }
.lg.done { background: var(--brand); border-color: var(--brand); }
.lg.flag { border-color: #f59e0b; background: #fef3c7; }
.lg.me { background: var(--brand); border-color: var(--brand); border-radius: 50%; }
.lg.avg { background: transparent; border: 0; border-top: 2px dashed var(--muted); border-radius: 0; height: 0; width: 16px; }
.q-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 16px; }
.eb-nav { flex-shrink: 0; }

/* ---------- Report card ---------- */
.rc { display: flex; flex-direction: column; gap: 14px; }
.rc > .grid-2 { gap: 14px; }
.rc-hero { padding: 18px; background: linear-gradient(135deg, var(--brand-50), #fff 60%); }
.rc-who { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.rc-who b { font-size: 17px; }
.rc-who span { color: var(--text2); font-weight: 600; }
.rc-who small { color: var(--muted); }
.rc-main { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rc-kpis { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; min-width: 220px; }
.rc-kpis > div { background: rgba(255,255,255,0.8); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.rc-kpis small { display: block; color: var(--muted); font-size: 12px; }
.rc-kpis b { font-size: 20px; }
.rc-kpis em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 500; }
.rc-note { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.rc-note.amber { color: var(--amber); }
.rc-stats { grid-template-columns: repeat(3, 1fr) !important; margin: 0; }
.stat.kpi { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; }
.stat.kpi > b { font-size: 20px; font-weight: 800; line-height: 1.3; }
.stat.kpi > b small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat.kpi > b.small { font-size: 14px; }
.stat.kpi > span { font-size: 12.5px; color: var(--muted); }
.stat.kpi.green > b { color: var(--green); }
.stat.kpi.red > b { color: var(--red); }
.stat.kpi.blue > b { color: var(--blue); }
.stat.kpi.purple > b { color: var(--purple); }
.rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rec { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.9; }
.rec .ic { flex-shrink: 0; margin-top: 4px; }
.rec.red { background: var(--red-bg); color: #991b1b; }
.rec.amber { background: var(--amber-bg); color: #92400e; }
.rec.green { background: var(--green-bg); color: #065f46; }
.rec.blue { background: var(--blue-bg); color: #1e40af; }
.pbar { position: relative; height: 10px; background: var(--gray-bg); border-radius: 99px; overflow: visible; flex: 1; min-width: 60px; }
.pbar-fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.4s; }
.pbar-fill.green { background: var(--green); }
.pbar-fill.amber { background: #f59e0b; }
.pbar-fill.red { background: var(--red); }
.pbar-fill.gray { background: #94a3b8; }
.pbar-fill.brand { background: var(--brand); }
.pbar-avg { position: absolute; top: -4px; bottom: -4px; width: 0; border-right: 2px dashed var(--text2); transform: translateX(50%); }
.avg-dot { display: inline-block; width: 14px; border-top: 2px dashed var(--text2); vertical-align: middle; margin-inline-end: 4px; }
.cmp { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cmp-row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; font-size: 13.5px; }
.cmp-row b { text-align: left; }
.rc-h5 { margin: 6px 0 8px; font-size: 13.5px; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 16px; }
.hist-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.hist-col small { font-size: 11px; color: var(--muted); }
.hist-bar { width: 100%; max-width: 38px; background: #cbd5e1; border-radius: 6px 6px 2px 2px; }
.hist-col.me .hist-bar { background: var(--brand); }
.hist-col.me span { color: var(--brand); font-weight: 800; }
.hist-col span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.tp-list { display: flex; flex-direction: column; gap: 12px; }
.tp-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.tp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.trend { margin-bottom: 12px; }
.trend svg { width: 100%; height: 160px; display: block; }
.tr-grid { stroke: var(--line); stroke-width: 1; }
.tr-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-avg { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.tr-dot { fill: #fff; stroke: var(--brand); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.tr-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }

/* ---------- Results analysis ---------- */
.qa-list { display: flex; flex-direction: column; }
.dist { display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) minmax(70px, 1fr) 90px; gap: 8px; align-items: center; font-size: 13px; padding: 4px; border-radius: 10px; }
.dist-row.ok { background: var(--green-bg); }
.dist-row.ok .q-n { background: var(--green); color: #fff; }
.dist-t { min-width: 0; overflow: hidden; }
.dist-t .q-oimg { max-height: 60px; }
.dist-row small { color: var(--muted); white-space: nowrap; }

@media (min-width: 640px) {
  .rc-kpis { grid-template-columns: repeat(4, 1fr); }
  .rc-stats { grid-template-columns: repeat(5, 1fr) !important; }
}
@media (max-width: 520px) {
  .q-opts.with-img { grid-template-columns: 1fr; }
  .dist-row { grid-template-columns: 26px minmax(0, 1fr) 70px; }
  .dist-row .pbar { display: none; }
  .grade-row { grid-template-columns: 1fr; }
  .eb-timer { font-size: 16px; padding: 5px 9px; }
  .exam-bar .eb-title small { font-size: 11.5px; }
}
@media (min-width: 1024px) {
  .exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
  .exam-nav { position: sticky; top: 140px; transform: none; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); max-height: calc(100vh - 160px); z-index: 1; order: 2; }
  .exam-nav .en-head .icon-btn, .eb-nav, .en-back { display: none; }
  .exam-run .exam-bar { top: 70px; }
}
@media print {
  .tabs, .page-head .btn, .ea-actions, .chips-row { display: none !important; }
  .rc-hero { background: #fff; }
  .q-card { break-inside: avoid; box-shadow: none; }
}
.sms-group { margin: 18px 0 8px; font-size: 14px; color: var(--brand); border-top: 1px solid var(--line); padding-top: 14px; }
.q-card .q-body { display: block; }
.q-opt .katex, .dist-t .katex { font-size: 1.3em; }
.q-body .katex { font-size: 1.22em; }
.exam-nav { visibility: hidden; transition: transform 0.22s ease, visibility 0.22s; }
.exam-nav.open { visibility: visible; }
@media (min-width: 1024px) { .exam-nav { visibility: visible; } }
.mf-ta { unicode-bidi: plaintext; text-align: start; }
.mf-compact .mf-preview { padding: 4px 10px; margin-top: 4px; }
.mf-compact .mf-preview > small { display: none; }
.tp-row .pbar { flex: none; width: 100%; }
.hw-state-big { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; } .hw-state-big.green { background: var(--green-bg); color: var(--green); } .hw-state-big.amber { background: var(--amber-bg); color: var(--amber); }
.hw-comp button.on.complete { color: var(--green); }
.hw-comp button.on.incomplete { color: var(--amber); }
.hw-comp button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cls-multi { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cm-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cm-g { font-size: 12.5px; color: var(--muted); min-width: 64px; }
.cls-multi .note { margin: 0; }
.cmp-row.cls-cmp { grid-template-columns: minmax(110px, 160px) 1fr 44px; }
.cmp-row.cls-cmp.mine { background: var(--brand-50); border-radius: 10px; padding: 4px 6px; }
.brand-t { color: var(--brand); font-weight: 700; }
@media (min-width: 640px) { .rc-kpis:has(> div:nth-child(5)) { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Monitoring & dashboard ---------- */
.mon-card { text-align: right; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 8px; }
.mon-card:hover { border-color: var(--brand-100); }
.mon-kpi { display: grid; grid-template-columns: 90px 1fr 46px; gap: 8px; align-items: center; font-size: 13px; }
.mon-kpi b { text-align: left; }
.mon-risk { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--red-bg); border-radius: 10px; font-size: 12.5px; color: #991b1b; }
.mon-row-k { display: grid; grid-template-columns: 90px 44px; gap: 6px; align-items: center; font-size: 13px; }
.dash-hw .names { color: var(--red); font-size: 12px; margin-top: 2px; white-space: normal; }
.dash-cls { display: flex; flex-direction: column; }
.dc-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px 48px 48px 34px; gap: 6px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--line); color: var(--text); font-size: 13.5px; }
.dc-row:last-child { border-bottom: 0; }
.dc-row span { display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; }
.dc-row span small { font-weight: 500; color: var(--muted); font-size: 10.5px; }
.only-mobile-inline { display: block; }
@media (min-width: 640px) { .only-mobile-inline { display: none; } }
@media (max-width: 640px) { .list-item .mini-badges { flex-wrap: wrap; } .mon-row-k { display: none; } }
@media (min-width: 640px) { .stats.dash-stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .stats.dash-stats { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) { .stats.mon-stats { grid-template-columns: repeat(4, 1fr); } }
.fu-done { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 9px; background: var(--green-bg); color: var(--green); font-size: 12.5px; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fu-done small { font-weight: 500; }
.fu-btn { white-space: nowrap; }
.fu-reasons { margin: 0 0 12px; padding-inline-start: 18px; font-size: 13.5px; color: var(--text2); line-height: 1.9; }
.rost-fu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fu-hint { margin: -4px 0 10px; }
.fu-list { display: flex; flex-direction: column; }
.fu-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.fu-row:last-child { border-bottom: 0; }
.fu-main { flex: 1; min-width: 0; }
.fu-name { display: flex; gap: 8px; align-items: baseline; color: var(--text); flex-wrap: wrap; }
.fu-name small { color: var(--muted); font-size: 12px; }
.fu-why { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.fu-why li a { color: inherit; }
.fu-why li::before { content: '•'; margin-inline-end: 6px; }
.fu-why li.red { color: #b91c1c; } .fu-why li.amber { color: var(--amber); } .fu-why li.purple { color: var(--purple); }
.fu-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.fu-x { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.fu-x:hover { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.fu-donelist { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.fu-donelist summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.setup-box summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) { .fu-row { flex-wrap: wrap; } .fu-acts { width: 100%; justify-content: flex-end; } }
.fu-hist li { margin-bottom: 6px; font-size: 13.5px; }
.dash-cls .dc-row { grid-template-columns: minmax(0, 1fr) 52px 52px 52px; }

/* ===== 3.7: grouped menu, badges ===== */
.nav-group { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 14px 12px 4px; letter-spacing: 0; }
.nav-group:empty { padding: 6px 0; border-top: 1px solid var(--line); margin: 8px 12px 4px; }
.nav-badge { margin-right: auto; font-style: normal; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-item.on .nav-badge { background: var(--brand); }
.bottom a { position: relative; }
.bn-dot { position: absolute; top: 2px; left: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }
.tone-gray { background: var(--gray-bg); color: var(--muted); }
.narrow-wide { max-width: 980px; margin: 0 auto; }

/* ===== 3.7: admin dashboard ===== */
.dash { max-width: 980px; margin: 0 auto; }
.today { margin-bottom: 14px; }
.today-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.tday { flex: 0 0 auto; min-width: 170px; scroll-snap-align: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
.tday b { font-size: 20px; font-weight: 800; }
.tday span { font-weight: 700; }
.tday small { color: var(--muted); font-size: 12.5px; }
.tday em { font-style: normal; margin-top: 8px; align-self: flex-start; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.tday.ok { border-color: #a7f3d0; }
.tday.live { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.today-none { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
.tasks-card .list-item.task { gap: 10px; }
.task-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; }
.task-acts { display: flex; gap: 6px; flex-shrink: 0; }
.task-n { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 99px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.list-item.task .li-main small { white-space: normal; }
.list-item.task.more { justify-content: center; color: var(--brand); font-weight: 600; background: none; border: 0; width: 100%; cursor: pointer; font-family: inherit; font-size: 13.5px; }
.todo-done { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: var(--green); }
.todo-done div { display: flex; flex-direction: column; color: var(--text); }
.todo-done small { color: var(--muted); }
.dc-row.dc-head { color: var(--muted); font-size: 11.5px; padding-top: 0; border-bottom: 1px solid var(--line); }
.dc-row.dc-head span { font-weight: 600; font-size: 11.5px; }
.dc-row b { display: flex; flex-direction: column; min-width: 0; }
.dc-row b small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.push-stat { display: flex; align-items: center; gap: 6px; justify-content: center; }
.noatt-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--gray-bg); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; font-size: 13.5px; color: var(--text2); }
@media (max-width: 560px) {
  .task-acts .btn { padding-inline: 10px; }
}

/* ===== 3.7: student home ===== */
.hero.hero-sm { flex-direction: row; align-items: center; padding: 14px 18px; }
.hero.hero-sm h1 { font-size: 18px; }
.hero.hero-sm p { font-size: 13px; }
.todo-card .li-main small.red { color: var(--red); }
.next-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; }
.next-row.live { border-color: var(--red); }
.next-row .ns-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.next-row .ns-info span { font-size: 13px; color: var(--text2); }
.my-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .my-status { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ms { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
.ms span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ms b { font-size: 22px; font-weight: 800; }
.ms b em { font-style: normal; font-size: 14px; color: var(--muted); font-weight: 600; }
.ms small { font-size: 12px; color: var(--muted); }
.ann { display: flex; align-items: center; gap: 8px; padding: 8px 0; color: var(--text); }
.ann b { flex: 1; font-weight: 600; }
.ann small { color: var(--muted); }

/* ===== 3.7: student homework ===== */
.hw-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.hs { border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; }
.hs b { font-size: 20px; font-weight: 800; }
.hw-card { border-inline-start: 4px solid var(--line); }
.hw-card.hw-red { border-inline-start-color: var(--red); }
.hw-card.hw-amber { border-inline-start-color: #f59e0b; }
.hw-card.hw-green { border-inline-start-color: var(--green); }
.hw-card.hw-blue { border-inline-start-color: var(--blue); }
.hw-line { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; margin: 6px 0 4px; }
.hw-line.red { color: var(--red); } .hw-line.amber { color: var(--amber); } .hw-line.green { color: var(--green); } .hw-line.blue { color: var(--blue); }
.upq .upq-retry { margin-inline-start: 4px; }

/* ===== 3.7: notifications setup ===== */
.nsetup { display: flex; flex-direction: column; gap: 12px; }
.nstate { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--gray-bg); color: var(--text2); }
.nstate div { display: flex; flex-direction: column; gap: 2px; }
.nstate small { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.nstate.on { background: var(--green-bg); color: var(--green); }
.nstate.amber { background: var(--amber-bg); color: var(--amber); }
.nstate.red { background: var(--red-bg); color: var(--red); }
.nstate b { color: var(--text); }
.nsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nsteps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.nsteps li b { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; font-size: 12.5px; }
.ninstall { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--brand-100); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--brand); }
.ninstall span { flex: 1; color: var(--text2); }
.push-strip { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: var(--amber-bg); color: var(--amber); padding: 8px 14px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: right; }

/* ===== 3.7: error report ===== */
.err-item { cursor: pointer; align-items: flex-start; }
.err-item .li-main small { white-space: normal; }
.err-item code { font-size: 11px; background: var(--gray-bg); padding: 1px 6px; border-radius: 6px; }
.err-detail { background: var(--gray-bg); border-radius: 8px; padding: 8px; font-size: 11.5px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; text-align: left; }
.dc-row b small span { display: inline; font-weight: 600; font-size: 11.5px; }
.side-nav .nav-item { padding-block: 8px; }
.list-item.task .li-main b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.6; }
