/* ============================================================
   EXAM BANK — style.css
   University Dashboard  |  RTL Hebrew
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800&display=swap');

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Palette */
  --blue:      #003d7a;
  --blue-mid:  #005299;
  --blue-l:    #dce8f5;
  --blue-xl:   #eef4fb;
  --accent:    #c8860a;        /* warm amber for stars / highlights */
  --accent-l:  #fdf3dc;
  --success:   #1a7c45;
  --success-l: #e3f5ec;
  --danger:    #b91c1c;
  --danger-l:  #fde8e8;
  --red:       var(--danger);
  --red-l:     var(--danger-l);

  /* Surfaces */
  --bg:        #f4f5f7;
  --bg2:       #eceef1;
  --card:      #ffffff;
  --card2:     #fafbfc;
  --border:    #d6dae1;
  --border-s:  #e8eaed;

  /* Text */
  --text:      #0f1923;
  --text-2:    #2c3e55;
  --muted:     #5a6576;
  --light:     #96a0ae;

  /* Primary alias → blue */
  --primary:   var(--blue);
  --primary-d: #002d5c;
  --primary-l: var(--blue-l);
  --primary-xl:var(--blue-xl);
  --secondary: var(--blue-mid);

  /* Shadows — almost imperceptible */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-s:  0 2px 6px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 14px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.05);
  --shadow-l:  0 12px 40px rgba(0,0,0,.14), 0 3px 10px rgba(0,0,0,.06);
  --sh0:       var(--shadow-xs);

  /* Geometry — 4 px everywhere */
  --r:    4px;
  --r-s:  4px;
  --r-xs: 3px;
  --rsm:  4px;

  /* Motion */
  --tr:   all .15s ease;
  --ease: all .15s ease;

  /* Admin */
  --sidebar-bg: #071929;
  --sidebar-w:  170px;
}

html { font-size: 16px; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  background: var(--blue);
  color: #fff;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr; /* force LTR so logo=left, actions=right on RTL pages */
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar-brand {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.05rem; font-weight: 700;
  cursor: pointer; color: #fff; text-decoration: none;
  letter-spacing: -.01em;
}
.navbar-brand .ni { font-size: 1.2rem; opacity: .9; }
.navbar-actions { display: flex; align-items: center; gap: .5rem; }
.navbar-message-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.32);
  background: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.16);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.navbar-message-btn:hover {
  background: linear-gradient(145deg, rgba(255,255,255,.3), rgba(255,255,255,.14));
  border-color: rgba(255,255,255,.5);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 5px 12px rgba(0,0,0,.2);
}
.navbar-message-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}
.navbar-message-btn:active {
  transform: translateY(0);
}
.navbar-message-icon {
  width: 19px;
  height: 19px;
}
.navbar-message-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  border: 1px solid rgba(255,255,255,.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1;
}
.navbar-user {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  padding: .28rem .75rem;
  font-size: .85rem;
}
.navbar-user .av {
  width: 24px; height: 24px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .48rem 1.1rem;
  border-radius: var(--r);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: var(--tr);
  text-decoration: none; white-space: nowrap;
  font-family: inherit; letter-spacing: .005em;
  line-height: 1.4;
}
.btn:active { opacity: .88; transform: scale(.99); }

.btn-primary {
  background: var(--blue); color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--primary-d);
  border-color: var(--primary-d);
  box-shadow: 0 2px 8px rgba(0,61,122,.25);
}
.btn-secondary {
  background: var(--blue-xl); color: var(--blue);
  border-color: var(--blue-l);
}
.btn-secondary:hover { background: var(--blue-l); }
.btn-ghost {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,.4);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #991b1b; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: .28rem .65rem; font-size: .8rem; }
.btn-lg { padding: .62rem 1.5rem; font-size: .95rem; }

.btn-icon {
  width: 32px; height: 32px; padding: 0;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; cursor: pointer; border: 1px solid var(--border);
  transition: var(--tr); flex-shrink: 0;
  background: var(--card); color: var(--muted);
}
.btn-icon:active { transform: scale(.94); }
.btn-icon.star { background: var(--accent-l); color: var(--accent); border-color: #e8d0a0; }
.btn-icon.star.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-icon.star:hover { background: var(--accent); color: #fff; }
.btn-icon.copy-btn { background: var(--blue-xl); color: var(--blue); border-color: var(--blue-l); }
.btn-icon.copy-btn:hover { background: var(--blue); color: #fff; }
.btn-icon.btn-remove-intro { background: var(--danger-l); color: var(--danger); font-size: .7rem; padding: 0 .3rem; line-height: 1.4; border: none; }
.btn-icon.btn-remove-intro:hover { background: var(--danger); color: #fff; }

.user-inbox-card {
  width: min(94vw, 680px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.user-inbox-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.user-inbox-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: .75rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.user-inbox-item-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
}
.user-inbox-unread-dot {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: .05rem .4rem;
  font-size: .68rem;
  font-weight: 700;
}
.user-inbox-orig {
  font-size: .8rem;
  color: var(--muted);
  background: #f9fafb;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: .45rem .6rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.user-inbox-reply {
  font-size: .88rem;
  color: var(--text);
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: .55rem .7rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .775rem; font-weight: 600;
  color: var(--muted); margin-bottom: .32rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: .58rem .85rem;
  border: 1px solid var(--border); border-radius: var(--r);
  font-size: .9rem; font-family: inherit;
  color: var(--text); background: var(--card);
  transition: var(--tr); direction: rtl;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,61,122,.1);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-error {
  background: var(--danger-l); color: var(--danger);
  padding: .6rem .9rem; border-radius: var(--r);
  font-size: .84rem; margin-bottom: .9rem; display: none;
  border: 1px solid rgba(185,28,28,.15);
}
.form-error.show { display: block; }

/* ── CARDS (generic) ─────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--r);
  padding: 1.25rem; box-shadow: var(--shadow-xs);
  border: 1px solid var(--border); transition: var(--tr);
}
.card:hover { box-shadow: var(--shadow-s); }

/* ── AUTH ────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: #0b1f35; padding: 1.2rem;
}
.auth-card {
  background: #fff; border-radius: 6px;
  padding: 2.25rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-l);
}
.auth-logo { text-align: center; margin-bottom: 1.6rem; }
.auth-logo .icon { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .7; }
.auth-logo h1 { font-size: 1.35rem; color: var(--blue); font-weight: 800; }
.auth-logo p { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.auth-tabs {
  display: flex; background: var(--bg);
  border-radius: 4px; padding: .2rem;
  margin-bottom: 1.5rem; gap: .2rem;
}
.auth-tab {
  flex: 1; padding: .5rem; text-align: center;
  border-radius: 3px; cursor: pointer;
  font-weight: 600; font-size: .86rem; color: var(--muted);
  transition: var(--tr); border: none; background: transparent;
}
.auth-tab.active { background: #fff; color: var(--blue); box-shadow: var(--shadow-xs); }

/* ── Password field with toggle eye ─────────────────────── */
.pass-wrap {
  position: relative;
}
.pass-wrap input {
  padding-left: 2.6rem !important; /* room for the eye button (RTL → left side) */
}
.pass-eye {
  position: absolute;
  left: .55rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color .15s;
  border-radius: 4px;
}
.pass-eye:hover { color: var(--blue); }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .8rem;
}
.page-title { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: .875rem; margin-top: .1rem; }

/* ── COURSE GRID ─────────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.course-card {
  background: var(--card); border-radius: var(--r);
  padding: 1.35rem; border: 1px solid var(--border);
  cursor: pointer; transition: var(--tr); text-align: center;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.course-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--blue);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.course-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); border-color: #d0d3d8; }
.course-card:hover::after { transform: scaleX(1); }
.analytics-card {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: #c7d2fe;
}
.analytics-card .ci { opacity: 1; }
.analytics-card::after { background: #6366f1; }
.analytics-card.disabled {
  filter: grayscale(1);
  opacity: .55;
  cursor: not-allowed;
  background: var(--card);
  border-color: var(--border);
}
.analytics-card.disabled:hover { box-shadow: var(--shadow-xs); border-color: var(--border); }
.analytics-card.disabled:hover::after { transform: scaleX(0); }

/* Home page: keep extras (analytics + contact) pinned to bottom of viewport */
.home-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
}
.home-extras-row {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}
.home-extras-row > .course-card {
  width: 220px;
  box-sizing: border-box;
}
.ci { font-size: 2.2rem; margin-bottom: .6rem; display: block; opacity: .85; }
.cn { font-size: .97rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.cc {
  font-size: .76rem; color: var(--muted); background: var(--bg);
  padding: .15rem .5rem; border-radius: 3px; display: inline-block;
  border: 1px solid var(--border-s);
}
.cm { font-size: .76rem; color: var(--light); margin-top: .4rem; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .14rem .48rem; border-radius: 3px;
  font-size: .70rem; font-weight: 500; letter-spacing: .01em;
  border: 1px solid #e5e7eb;
  background: #f3f4f6; color: #4b5563;
}
/* All color variants unified — keep class names for JS compatibility */
.b-blue, .b-green, .b-purple, .b-orange, .b-gray, .b-red {
  background: #f3f4f6; color: #4b5563; border-color: #e5e7eb;
}

/* ── FILTERS ─────────────────────────────────────────────── */
.filters-bar {
  display: flex; flex-wrap: nowrap; gap: .75rem;
  background: var(--card);
  padding: .9rem 1.1rem;
  border-radius: var(--r); border: 1px solid var(--border);
  margin-bottom: 1.25rem; align-items: flex-end;
  box-shadow: var(--shadow-xs);
}
.filters-bar .form-group {
  margin-bottom: 0; flex: 1; min-width: 100px;
}
.filters-bar .form-group label {
  font-size: .72rem;
}
.filters-bar .form-group input,
.filters-bar .form-group select {
  padding: .45rem .7rem; font-size: .875rem;
}

/* ── TABS ────────────────────────────────────────────────── */
.tabs-bar {
  display: flex; gap: 0;
  background: var(--bg2);
  padding: 0;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  width: fit-content;
  border: 1px solid var(--border);
  overflow: hidden;
}
.tab-btn {
  padding: .48rem 1rem; border-radius: 0; border: none;
  background: transparent; font-size: .86rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: var(--tr);
  display: flex; align-items: center; gap: .35rem;
  font-family: inherit; border-left: 1px solid var(--border);
}
.tab-btn:last-child { border-left: none; }
.tab-btn:first-child { border-left: none; }
.tab-btn.active {
  background: var(--card); color: var(--blue);
  box-shadow: inset 0 -2px 0 var(--blue);
}

/* ── EXAM LIST ───────────────────────────────────────────── */
.exam-list { display: flex; flex-direction: column; gap: .45rem; }
.exam-item {
  background: #fff;
  border: 1px solid #e9eaec;
  border-radius: var(--r);
  padding: .85rem 1rem;
  display: flex; align-items: center;
  justify-content: space-between;
  cursor: pointer; transition: var(--tr); gap: .8rem;
  box-shadow: none;
}
.exam-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  border-color: #d0d3d8;
}
.exam-title { font-weight: 700; font-size: .93rem; color: var(--text); }
.exam-meta-row {
  display: flex; align-items: center; gap: .55rem;
  flex-wrap: wrap; margin-top: .3rem;
}
.exam-meta-row .badge { font-weight: 500; }
.exam-badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.exam-arrow { color: #c0c4cc; font-size: .85rem; }

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  margin-bottom: 1.25rem; font-size: .85rem; color: var(--muted);
}
.breadcrumb a { color: var(--blue); text-decoration: none; cursor: pointer; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--light); }

/* ── TOAST ───────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; bottom: 1.25rem; left: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .4rem;
}
.toast {
  background: var(--text); color: #fff;
  padding: .6rem 1rem; border-radius: 4px;
  font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
  box-shadow: var(--shadow); max-width: 300px;
  animation: slideUp .2s ease; font-family: inherit;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--blue); }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── COPY TIP ────────────────────────────────────────────── */
.copy-tip {
  position: fixed; background: var(--text); color: #fff;
  padding: .28rem .65rem; border-radius: 3px;
  font-size: .77rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 9998;
}
.copy-tip.show { opacity: 1; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ei { font-size: 2.5rem; margin-bottom: .75rem; display: block; opacity: .5; }
.empty h3 { font-size: 1rem; font-weight: 700; color: var(--text-2); margin-bottom: .3rem; }
.empty p { font-size: .86rem; }

/* ── SPINNER ─────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .6s linear infinite;
  margin: 1.8rem auto; display: block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PAGE LOADER ─────────────────────────────────────────── */
.page-loader {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 1rem; gap: .9rem; width: 100%;
}
.page-loader p { color: var(--muted); font-size: .88rem; }

/* ─────────────────────────────────────────────────────────
   AI SPINNER OVERLAY
───────────────────────────────────────────────────────── */
.ai-spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(7,25,41,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.ai-spinner-overlay.visible { opacity: 1; pointer-events: all; }
.ai-spinner-card {
  background: #fff; border-radius: 6px;
  padding: 2.2rem 2.8rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.1rem;
  box-shadow: var(--shadow-l); min-width: 240px; text-align: center;
}
.ai-spinner-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--blue-l); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.ai-spinner-msg {
  font-size: .94rem; font-weight: 600; color: var(--text);
  max-width: 200px; line-height: 1.5;
}
.ai-spinner-abort {
  margin-top: .5rem;
  background: var(--danger); color: #fff;
  border: none; border-radius: 6px;
  padding: .4rem 1.2rem; cursor: pointer;
  font-size: .85rem; font-weight: 600;
  transition: opacity .15s;
}
.ai-spinner-abort:hover { opacity: .85; }

/* ═══════════════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════════════ */
#adm-login {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: #071929; padding: 1.2rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
  background: var(--sidebar-bg);
  padding: 0;
  color: #fff;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,.05);
  display: flex; flex-direction: column;
}
.sidebar-logo {
  font-size: 1rem; font-weight: 700;
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: .6rem;
  padding: 1.1rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #fff;
}
.sidebar-logo svg { opacity: .85; flex-shrink: 0; }
.sidebar-section-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 1rem 1.2rem .4rem;
}
.admin-nav {
  display: flex; flex-direction: column;
  gap: .05rem; padding: .4rem .6rem;
  flex: 1;
}
.admin-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .58rem .75rem;
  border-radius: 3px;
  color: rgba(255,255,255,.58); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: var(--tr); cursor: pointer;
}
.admin-nav a svg { flex-shrink: 0; opacity: .7; }
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a:hover svg { opacity: 1; }
.admin-nav a.active {
  background: rgba(255,255,255,.1); color: #fff;
  font-weight: 600; border-right: 2px solid #5b9dd4;
}
.admin-nav a.active svg { opacity: 1; }
.admin-nav .nav-divider {
  height: 1px; background: rgba(255,255,255,.07);
  margin: .6rem 0;
}

/* ── Main area ── */
.admin-main {
  padding: 1.5rem 2.5rem;
  background: var(--bg);
  overflow-y: auto; min-height: 100vh;
  max-width: 100%;
}

/* ── Admin sections ── */
.adm-section { display: none; }
.adm-section.active { display: block; animation: fadeIn .18s ease; }
#sec-add-exam.active { min-width: calc(100vw - var(--sidebar-w) - 5rem); }
#sec-broadcast.active { min-width: calc(100vw - var(--sidebar-w) - 5rem); }
#sec-broadcast.active .ac { max-width: 760px; }

/* Broadcast audience selector */
.bc-audience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.bc-audience-card {
  position: relative;
  display: block;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .85rem .95rem;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.bc-audience-card:hover {
  border-color: #a5b4fc;
  background: #fafbff;
}
.bc-audience-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.bc-audience-card:has(input[type="radio"]:checked) {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.bc-audience-body {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.bc-audience-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.bc-audience-text { flex: 1; min-width: 0; }
.bc-audience-title {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  margin-bottom: .15rem;
}
.bc-audience-desc {
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 600px) {
  .bc-audience-grid { grid-template-columns: 1fr; }
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

/* ── Section header ── */
.sec-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 1.4rem;
}
.sec-title {
  font-size: 1.2rem; font-weight: 800;
  color: var(--text); letter-spacing: -.02em;
}

/* ── Admin cards (ac) ── */
.ac {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.ac-title {
  font-size: .78rem; font-weight: 700;
  color: var(--muted);
  padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: .5rem;
  background: var(--card2);
  border-bottom: 1px solid var(--border-s);
  letter-spacing: .06em; text-transform: uppercase;
}
.ac-title svg { flex-shrink: 0; opacity: .7; }
.ac > *:not(.ac-title):not(.upload-zone):not(.progress-bar-wrap):not(.import-area):not(.parse-row):not(#upload-status):not(.or-divider) {
  padding-left: 1.25rem; padding-right: 1.25rem;
}
.ac > .form-group:first-of-type { padding-top: 1.1rem; }
.ac > .form-group:last-of-type  { padding-bottom: 1.1rem; }
.ac > .form-row:first-of-type   { padding-top: 1.1rem; }
.ac > .form-row { padding-left: 1.25rem; padding-right: 1.25rem; }
.ac > .preview-grid { padding-bottom: 1rem; }
.ac-body { padding: 1.25rem; }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .85rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card); border-radius: var(--r);
  padding: 1.1rem; border: 1px solid var(--border);
  text-align: center; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden; transition: var(--tr);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--blue);
}
.stat-card:hover { box-shadow: var(--shadow-s); }
.stat-val {
  font-size: 1.85rem; font-weight: 800;
  color: var(--blue); letter-spacing: -.03em;
  line-height: 1.2; margin-top: .3rem;
}
.stat-lbl {
  font-size: .74rem; color: var(--muted); font-weight: 600;
  margin-top: .3rem; text-transform: uppercase; letter-spacing: .05em;
}

/* ── Table ── */
.tbl { width: 100%; border-collapse: collapse; font-size: .865rem; }
.tbl th,
.tbl td { text-align: right; padding: .65rem .9rem; border-bottom: 1px solid var(--border-s); }
.tbl th {
  font-weight: 700; color: var(--muted); background: var(--card2);
  font-size: .73rem; text-transform: uppercase; letter-spacing: .06em;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--blue-xl); }

/* ── Upload zone ── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 2.2rem 1.2rem; text-align: center;
  cursor: pointer; transition: all .2s;
  background: var(--card2);
  position: relative; user-select: none;
  margin: 0 1.25rem;
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--blue);
  background: var(--blue-xl);
  box-shadow: 0 0 0 3px rgba(0,61,122,.08);
}
.upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}
.upload-zone .uz-icon {
  font-size: 2rem; margin-bottom: .6rem; display: block; opacity: .55;
}
.upload-zone .uz-text {
  font-size: .93rem; font-weight: 700; color: var(--text-2); margin-bottom: .25rem;
}
.upload-zone .uz-sub { font-size: .79rem; color: var(--muted); }

/* ── Progress bar ── */
.progress-bar-wrap {
  background: var(--bg2); border-radius: 2px;
  height: 4px; overflow: hidden; margin: 0 1.25rem .4rem;
}
.progress-bar {
  height: 100%; background: var(--blue);
  border-radius: 2px; transition: width .3s ease;
}

/* ── Import area ── */
.import-area {
  margin: 0 1.25rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
}
.import-area textarea {
  border: none; background: transparent; resize: vertical;
  min-height: 280px; font-family: 'Courier New', monospace; font-size: .82rem;
  width: 100%; padding: .75rem; direction: ltr; text-align: left; display: block;
}
.import-area textarea:focus { outline: none; }

/* ── Or divider ── */
.or-divider {
  text-align: center; color: var(--light); font-size: .8rem;
  margin: .6rem 1.25rem; padding: .4rem 0; position: relative;
}
.or-divider::before,
.or-divider::after {
  content: ''; position: absolute; top: 50%; width: 36%;
  height: 1px; background: var(--border-s);
}
.or-divider::before { right: 0; }
.or-divider::after  { left: 0; }

/* ── Parse button row ── */
.parse-row { margin: .75rem 1.25rem 1.1rem; display: flex; gap: .65rem; align-items: center; }

/* ── Preview cards ── */
.preview-grid {
  display: flex; flex-direction: column; gap: .7rem;
  max-height: none;
  padding: .1rem; scroll-behavior: smooth;
}
.pq-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; transition: var(--ease);
  box-shadow: var(--shadow-xs);
}
.pq-card:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,61,122,.08);
}
.pq-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem;
  background: var(--card2);
  border-bottom: 1px solid var(--border-s);
}
.pq-num { color: var(--blue); font-weight: 700; font-size: .88rem; flex: 1; }
.pq-actions { display: flex; gap: .35rem; }
.pq-textarea {
  width: 100%; border: none; border-top: 1px solid var(--border-s);
  padding: .75rem .6rem; font-size: .9rem; font-family: 'Courier New', monospace;
  direction: rtl; text-align: right; resize: vertical; min-height: 200px;
  background: var(--card2); color: var(--text); transition: var(--ease); display: block;
  line-height: 1.7;
}
.pq-textarea:focus { outline: none; background: #fff; }
.pq-textarea.pq-drop-active {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #93c5fd;
}
.pq-image-tools {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .55rem .9rem .35rem;
}
.pq-upload-btn {
  position: relative;
  overflow: hidden;
}
.pq-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.pq-align-row {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin: .15rem .9rem .45rem;
}
.pq-align-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}
.pq-align-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  font-size: .74rem;
  padding: .14rem .52rem;
  cursor: pointer;
}
.pq-align-btn.active {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.pq-image-preview-wrap {
  margin: 0 .9rem .6rem;
  border: 1px solid var(--border-s);
  border-radius: 6px;
  background: #fff;
  padding: .35rem;
}
.pq-image-preview-wrap.align-left { text-align: left; }
.pq-image-preview-wrap.align-center { text-align: center; }
.pq-image-preview-wrap.align-right { text-align: right; }
.pq-image-preview {
  display: inline-block;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}
.pq-image-status {
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--muted);
}
.pq-image-status-inline {
  margin: 0 .9rem .45rem;
  font-size: .74rem;
  color: var(--muted);
  min-height: 1em;
}
.pq-inline-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .45rem;
  margin: .35rem .95rem .65rem;
}
.pq-inline-image-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: .35rem;
}
.pq-inline-image-remove {
  position: absolute;
  top: .3rem;
  left: .3rem;
  width: 24px;
  height: 24px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff5f5;
  color: #b91c1c;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
}
.pq-inline-image-remove:hover {
  background: #fee2e2;
}
.pq-inline-image-thumb {
  width: 100%;
  height: 92px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-s);
  background: #fafafa;
}
.pq-inline-image-meta {
  margin-top: .25rem;
  font-size: .68rem;
  color: var(--muted);
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pq-inline-image-status {
  margin-top: .15rem;
  font-size: .7rem;
  color: #0f766e;
}
.pq-inline-image-status.ok { color: #166534; }
.pq-inline-image-status.error { color: #b91c1c; }
.sub-preview {
  background: var(--bg); padding: .6rem .8rem;
  display: flex; flex-direction: column; gap: .45rem;
  border-top: 1px solid var(--border-s);
}
.sub-preview-item {
  display: flex; flex-direction: column; gap: .38rem;
  background: #fff; border: 1px solid var(--border); border-radius: 3px; overflow: hidden;
}
.sub-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .55rem .2rem;
}
.sub-preview-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.sub-preview-lbl {
  font-weight: 700; color: var(--blue); font-size: .87rem;
  flex-shrink: 0; min-width: 32px; text-align: center;
}
.sub-pq-textarea {
  min-height: 130px;
  border-top: 1px solid var(--border-s);
}

/* ── Multi-lecturer widget ── */
.lecturers-list {
  display: flex; flex-wrap: wrap; gap: .35rem;
  min-height: 36px; padding: .32rem .55rem;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0; border-bottom: none;
}
.lecturer-empty {
  font-size: .8rem; color: var(--light); align-self: center; padding: .1rem .3rem;
}
.lecturer-tag {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--blue-l); color: var(--blue);
  border-radius: 3px; padding: .2rem .55rem;
  font-size: .8rem; font-weight: 600; line-height: 1;
  border: 1px solid #b0ccdf;
}
.lecturer-tag-name { white-space: nowrap; }
.lecturer-tag-rm {
  background: none; border: none; cursor: pointer;
  color: var(--blue); opacity: .5; font-size: .72rem; padding: 0;
  line-height: 1; transition: opacity .12s;
}
.lecturer-tag-rm:hover { opacity: 1; }
.lecturer-add-row { display: flex; gap: .45rem; align-items: stretch; }
.lecturer-add-row input {
  flex: 1; border-radius: 0 0 var(--r) var(--r); border-top: none;
}
.lecturer-add-row .btn {
  border-radius: 0 0 var(--r) 0; align-self: stretch; white-space: nowrap;
}

/* ── Upload status ── */
#upload-status {
  font-size: .82rem; color: var(--blue);
  margin: .4rem 1.25rem; text-align: center;
}

/* ── Difficulty rating buttons (inline in qv-head) ── */
.diff-btn {
  display: inline-flex; align-items: center;
  padding: .22rem .58rem;
  border: 1px solid #e2e5ea; border-radius: 3px;
  background: #f4f5f7; color: #8a94a0;
  font-size: .75rem; font-weight: 500;
  cursor: pointer; transition: all .12s;
  font-family: inherit; white-space: nowrap; line-height: 1.4;
}
.diff-btn:hover { border-color: #b8c0cc; color: #2c3e55; background: #eceef1; }

/* Active states per level */
.diff-btn.diff-easy.active    { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 700; }
.diff-btn.diff-medium.active  { background: #fff7ed; border-color: #fdba74; color: #9a3412; font-weight: 700; }
.diff-btn.diff-hard.active    { background: #fee2e2; border-color: #fca5a5; color: #991b1b; font-weight: 700; }
.diff-btn.diff-unsolved.active { background: #1f2937; border-color: #1f2937; color: #fff; font-weight: 700; }

/* Separator between diff buttons and star/copy */
.qv-actions-sep {
  width: 1px; height: 20px;
  background: #e2e5ea; margin: 0 .2rem;
  flex-shrink: 0;
}

/* ── Admin difficulty stats badge ── */
.diff-stat-badge {
  display: inline-flex; align-items: center;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 3px; padding: .15rem .45rem;
  font-size: .75rem; color: #4b5563;
  margin-left: .25rem; white-space: nowrap;
}
.diff-stat-badge strong { color: #1f2937; margin-right: .2rem; }
.votes-cell { font-size: .8rem; }

/* ── MathJax ── */
.MathJax { font-size: 1em !important; direction: ltr; display: inline-block; }
mjx-container { direction: ltr; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { height: auto; position: static; }
  .admin-main { padding: 1.25rem; }
  #sec-add-exam.active { min-width: auto; }
}
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .courses-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .filters-bar { flex-wrap: wrap; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .navbar { padding: 0 1rem; }
  .upload-zone { margin: 0 .85rem; }
  .progress-bar-wrap { margin: 0 .85rem .4rem; }
  .import-area { margin: 0 .85rem 1rem; }
  .parse-row { margin: .75rem .85rem 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════
   EXAM VIEWER  (student-facing, mostly unchanged logic)
═══════════════════════════════════════════════════════════ */
.ev-wrap { min-height: 100vh; background: #f4f5f7; }
.ev-topbar {
  background: #fff; border-bottom: 1px solid #dde1e7;
  padding: .65rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ev-back {
  background: none; border: 1px solid #d0d5dc; border-radius: 4px;
  padding: .38rem .9rem; font-size: .875rem;
  font-family: 'Heebo', inherit; cursor: pointer;
  color: #2c3e55; transition: background .12s; font-weight: 600;
}
.ev-back:hover { background: #f4f5f7; }
.ev-topbar-meta {
  color: #5a6576; font-size: .86rem; font-weight: 500;
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem;
}
.ev-banner {
  background: #fff; border-bottom: 1px solid #dde1e7;
  padding: 1.35rem 1.5rem 1.2rem; text-align: center;
  position: relative;
}
.ev-banner-text { width: 100%; }
.ev-banner-status {
  position: absolute;
  top: 50%;
  left: 1.25rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: .4rem;
  align-items: center;
  z-index: 1;
}
.ev-banner-status .inprogress-toggle-btn,
.ev-banner-status .done-toggle-btn {
  margin-left: 0;
}
@media (max-width: 600px) {
  .ev-banner { padding: 1rem 1rem .9rem; }
  .ev-banner-status {
    position: static;
    transform: none;
    justify-content: center;
    margin-bottom: .7rem;
  }
}
.ev-banner-title {
  font-size: 1.35rem; font-weight: 800; color: #0f1923;
  margin: 0 0 .3rem; letter-spacing: -.025em;
}
.ev-banner-meta { color: #5a6576; font-size: .93rem; margin: 0; }
.ev-body {
  max-width: 800px; margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex; flex-direction: column; gap: .9rem;
}
.qv-card {
  background: #fff; border-radius: 4px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: none;
  transition: box-shadow .14s, border-color .14s;
}
.qv-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: #cfd3d9; }
.qv-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .72rem 1.2rem; border-bottom: 1px solid #eef0f3;
  background: #fafbfc;
}
.qv-head-right { display: flex; align-items: center; gap: .7rem; }
.qv-num { font-weight: 800; font-size: 1rem; color: #0f1923; letter-spacing: -.02em; }
.qv-pts { font-size: .86rem; color: #5a6576; font-weight: 500; }
.qv-actions { display: flex; gap: .25rem; align-items: center; }
.qv-btn {
  background: transparent; border: 1px solid #d8dde5; border-radius: 3px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .12s; padding: 0;
}
.qv-btn:hover { background: #f0f2f5; border-color: #b8c0cc; }
.qv-btn.on { background: var(--accent-l); border-color: #e0c070; }
.qv-btn:active { transform: scale(.93); }
.qv-text {
  padding: 1.1rem 1.2rem; font-size: .975rem; line-height: 1.9;
  color: #1a2635; border-bottom: 1px solid #edf0f4; direction: rtl;
}
.qv-parts { padding: .45rem 1.2rem .7rem; }
.qv-part { padding: .7rem 0; border-bottom: 1px solid #edf0f4; }
.qv-part:last-child { border-bottom: none; }
.qv-part-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: .45rem;
}
.qv-part-lbl {
  font-weight: 800; font-size: .975rem; color: var(--blue);
  flex-shrink: 0; min-width: 2rem;
}
.qv-part-text {
  font-size: .95rem; line-height: 1.9;
  color: #1a2635; direction: rtl; padding-right: .2rem;
}
.qv-image-wrap {
  padding: .65rem 1.2rem 1rem;
  border-bottom: 1px solid #edf0f4;
}
.qv-image-wrap.align-left { text-align: left; }
.qv-image-wrap.align-center { text-align: center; }
.qv-image-wrap.align-right { text-align: right; }
.qv-image-wrap-sub {
  padding: .35rem 0 .15rem;
  border-bottom: none;
}
.qv-image {
  display: inline-block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.qv-inline-image {
  margin: .45rem 0;
}
.qv-inline-image.align-left { text-align: left; }
.qv-inline-image.align-center { text-align: center; }
.qv-inline-image.align-right { text-align: right; }

/* ── Display math blocks ($$...$$) ── */
.math-display {
  display: block;
  direction: ltr;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .55rem .5rem;
  margin: .3rem 0;
  /* subtle scroll hint on mobile */
  -webkit-overflow-scrolling: touch;
}

/* MathJax inline stays inline; display math block fills width */
.qv-text .MathJax_Display,
.qv-part-text .MathJax_Display,
.math-display .MathJax_Display {
  margin: 0 !important;
  direction: ltr;
  display: block !important;
}
.qv-text .MathJax,
.qv-part-text .MathJax { direction: ltr; display: inline-block; }

@media (max-width: 600px) {
  .ev-banner-title { font-size: 1.1rem; }
  .ev-body { padding: 1rem .5rem 2rem; }
  .qv-head { padding: .7rem .9rem; }
  .qv-text, .qv-parts { padding-right: .9rem; padding-left: .9rem; }
}

/* ── LECTURER SEPARATOR ─────────────────────────────────────── */
.lec-sep { color: var(--muted); margin: 0 .1rem; }

/* ── NAVBAR TAU LOGO ────────────────────────────────────────── */
.navbar-tau-logo {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; vertical-align: middle; margin-top: -2px;
  flex-shrink: 0;
}

/* ── DONE EXAM ──────────────────────────────────────────────── */
.exam-item.exam-done { background: #f0fdf4; border-color: #86efac; }
.exam-item.exam-done .exam-title { color: #166534; }
.done-check { color: #16a34a; font-weight: 700; font-size: 1rem; }
.badge.b-done {
  background: #dcfce7; color: #166534;
  border: 1px solid #86efac; font-weight: 600;
}
.done-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #d1d5db; background: transparent;
  color: #9ca3af; font-size: 1rem; cursor: pointer;
  transition: all .18s; flex-shrink: 0; margin-left: .5rem;
}
.done-toggle-btn:hover { border-color: #16a34a; color: #16a34a; }
.done-toggle-btn.done-active {
  border-color: #16a34a; background: #16a34a; color: #fff; font-weight: 700;
}

/* ── IN-PROGRESS EXAM ───────────────────────────────────────── */
.exam-item.exam-inprogress { background: #fff7ed; border-color: #fdba74; }
.exam-item.exam-inprogress .exam-title { color: #9a3412; }
.inprogress-check { color: #ea580c; font-size: 1rem; }
.badge.b-inprogress {
  background: #ffedd5; color: #9a3412;
  border: 1px solid #fdba74; font-weight: 600;
}
.inprogress-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #d1d5db; background: transparent;
  color: #9ca3af; font-size: 1rem; cursor: pointer;
  transition: all .18s; flex-shrink: 0; margin-left: .5rem;
}
.inprogress-toggle-btn:hover { border-color: #ea580c; color: #ea580c; }
.inprogress-toggle-btn.inprogress-active {
  border-color: #ea580c; background: #ea580c; color: #fff; font-weight: 700;
}

/* ── PDF DOWNLOAD BUTTON (exam list) ────────────────────────── */
.pdf-download-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #d1d5db; background: transparent;
  color: #9ca3af; cursor: pointer;
  transition: all .18s; flex-shrink: 0; margin-left: .5rem;
  text-decoration: none;
}
.pdf-download-btn:hover { border-color: #1d4ed8; color: #1d4ed8; }

/* ── SOLUTION DOWNLOAD BUTTON (exam list) ───────────────────── */
.sol-download-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #d1d5db; background: transparent;
  color: #9ca3af; cursor: pointer;
  transition: all .18s; flex-shrink: 0; margin-left: .5rem;
  text-decoration: none; font-size: .6rem; font-weight: 700;
  letter-spacing: -.02em;
}
.sol-download-btn:hover { border-color: #eab308; color: #eab308; }

/* ── PDF DOWNLOAD UPLOAD ROW (admin) ────────────────────────── */
.pdf-download-upload-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .4rem .55rem;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r);
}

/* ── AVG DIFFICULTY BADGE ───────────────────────────────────── */
.diff-avg-badge {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .72rem; font-weight: 600; padding: .18rem .55rem;
  border-radius: 20px; margin-right: .4rem; opacity: .9;
  cursor: default; white-space: nowrap;
}
.diff-avg-easy   { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.diff-avg-medium { background:#fef9c3; color:#854d0e; border:1px solid #fcd34d; }
.diff-avg-hard   { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }

/* ── BONUS QUESTION — student view ─────────────────────────── */
.qv-card-bonus {
  border: 2px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 60%);
  box-shadow: 0 2px 12px rgba(245,158,11,.15);
}
.qv-head-bonus {
  background: linear-gradient(90deg, #fef3c7, #fffbeb);
  border-bottom: 1px solid #fcd34d;
}
.qv-bonus-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 700;
  color: #92400e; background: #fef3c7;
  border: 1.5px solid #f59e0b; border-radius: 20px;
  padding: .18rem .65rem; margin-right: .5rem;
  white-space: nowrap;
}

/* ── BONUS QUESTION — admin preview ────────────────────────── */
.pq-bonus {
  border: 2px solid #f59e0b !important;
  background: #fffbeb !important;
}
.bonus-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .8rem; font-weight: 700; color: #92400e;
  background: #fef3c7; border: 1.5px solid #f59e0b;
  border-radius: 20px; padding: .15rem .6rem;
}
.bonus-chk-label {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 600; color: var(--muted);
  cursor: pointer; user-select: none;
}
.bonus-chk-label input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }

/* ── Terms checkbox ─────────────────────────────────────────── */
.terms-check-label {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .75rem 1rem;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  direction: rtl;
}
.terms-check-label:hover {
  background: #dcfce7;
  border-color: #4ade80;
}
.terms-check-label--checked {
  background: #dcfce7;
  border-color: #16a34a;
}
.terms-check-label--error {
  background: #fef2f2;
  border-color: #f87171;
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}
.terms-check-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: .18rem;
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}
.terms-check-text {
  font-size: .875rem;
  line-height: 1.55;
  color: #166534;
  font-weight: 500;
}

/* disabled state for terms accept button */
#terms-accept-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ── Survey modal ───────────────────────────────────────────── */
.survey-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.survey-modal-box {
  background: #fff;
  border-radius: 18px;
  width: min(92vw, 780px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  overflow: hidden;
  direction: rtl;
}
.survey-modal-header {
  padding: 1.2rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-s, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.survey-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 .2rem;
}
.survey-modal-sub {
  font-size: .8rem;
  color: #64748b;
  margin: 0;
}
.survey-iframe-wrap {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.survey-iframe {
  width: 100%;
  height: 100%;
  min-height: 55vh;
  border: none;
  display: block;
}
.survey-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-s, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.survey-mandatory-note {
  width: 100%;
  font-size: .82rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: .55rem .9rem;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════
   COURSE STATUS BUTTONS (Admin Panel)
══════════════════════════════════════════════════════════ */
.status-btn-group {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.status-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.status-btn.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.status-btn.active:first-child {
  background: #dcfce7;
  color: #166534;
}

.status-btn.active:nth-child(2) {
  background: #fef3c7;
  color: #92400e;
}

.status-btn.active:nth-child(3) {
  background: #f1f5f9;
  color: #475569;
}

@media (max-width: 900px) {
  .status-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
}

/* ── Contact type scroll-select ─────────────────────────────── */
.contact-scroll-list {
  display: flex; flex-direction: column; gap: .4rem;
  max-height: 180px; overflow-y: auto;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: .35rem;
  scroll-behavior: smooth;
}
.contact-scroll-list::-webkit-scrollbar { width: 4px; }
.contact-scroll-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.contact-scroll-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem; border-radius: 8px;
  cursor: pointer; transition: background .13s;
  font-size: .9rem; font-weight: 500; color: var(--text);
  border: 1.5px solid transparent; user-select: none;
}
.contact-scroll-item:hover { background: var(--bg, #f3f4f6); }
.contact-scroll-item.selected {
  background: rgba(102,126,234,.08);
  border-color: var(--primary, #667eea);
  color: var(--primary, #667eea);
}
.contact-scroll-item .csi-icon { font-size: 1.15rem; flex-shrink: 0; }
.contact-scroll-item .csi-radio {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); margin-right: auto; flex-shrink: 0;
  background: #fff; transition: all .13s;
}
.contact-scroll-item.selected .csi-radio {
  border-color: var(--primary, #667eea);
  background: var(--primary, #667eea);
  box-shadow: inset 0 0 0 3px #fff;
}

/* ── Report bug button (exam list) ─────────────────────────── */
.report-exam-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #d1d5db; background: transparent;
  color: #9ca3af; font-size: .85rem; cursor: pointer;
  transition: all .18s; flex-shrink: 0; margin-left: .5rem;
}
.report-exam-btn:hover { border-color: #d97706; color: #d97706; }

/* ── Generic modal overlay / card ───────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: #fff; border-radius: 16px;
  width: min(94vw, 520px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  direction: rtl; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--muted); padding: .2rem .4rem;
  border-radius: 6px; transition: background .15s;
}
.modal-close:hover { background: var(--bg2, #f3f4f6); }

/* ── Contact type buttons ────────────────────────────────────── */
.contact-type-btn {
  flex: 1; padding: .5rem .75rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; font-family: inherit; font-size: .85rem;
  font-weight: 600; cursor: pointer; color: var(--muted);
  transition: all .15s;
}
.contact-type-btn.active {
  background: var(--primary, #667eea); color: #fff; border-color: var(--primary, #667eea);
}
.contact-type-btn:hover:not(.active) { border-color: var(--primary, #667eea); color: var(--primary, #667eea); }

/* ── Folder filter tabs (home page) ─────────────────────────── */
.save-course-btn {
  position: absolute; top: .5rem; left: .5rem;
  background: rgba(255,255,255,.85); border: none; cursor: pointer;
  font-size: .78rem; color: var(--muted, #aaa);
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; transition: background .15s, color .15s;
  z-index: 2; font-weight: 700;
}
.save-course-btn:hover { background: #fee2e2; color: #b91c1c; }
.save-course-btn.saved { background: #fee2e2; color: #b91c1c; }

.picker-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; border-radius: 10px;
  border: 1.5px solid var(--border); cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.picker-item:hover { border-color: var(--primary, #667eea); background: #f5f3ff; }
.picker-item.added { border-color: #6ee7b7; background: #f0fdf4; }
.picker-check {
  font-size: .95rem; font-weight: 700; min-width: 1.4rem; text-align: center;
  color: var(--muted);
}
.picker-item.added .picker-check { color: #059669; }

.folder-tabs {
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin-bottom: 1.25rem;
}
.folder-tab {
  padding: .45rem 1.1rem;
  border: 1.5px solid var(--border); border-radius: 20px;
  background: #fff; font-family: inherit; font-size: .88rem;
  font-weight: 600; cursor: pointer; color: var(--muted);
  transition: all .15s;
}
.folder-tab:hover { border-color: var(--primary, #667eea); color: var(--primary, #667eea); }
.folder-tab.active {
  background: var(--primary, #667eea); color: #fff;
  border-color: var(--primary, #667eea);
}

/* Gemini AI button — uses standard .qv-btn, no extra class needed */

/* ── Gemini modal ──────────────────────────────────────────── */
.gemini-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 1rem;
  backdrop-filter: blur(2px);
}
.gemini-modal {
  background: #fff; border-radius: 16px;
  width: min(94vw, 560px); max-height: 85vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  direction: rtl; overflow: hidden;
  display: flex; flex-direction: column;
}
.gemini-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
}
.gemini-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #6d28d9; }
.gemini-modal-body {
  padding: 1.25rem; overflow-y: auto; flex: 1;
  font-size: .92rem; line-height: 1.7; color: var(--text);
}
.gemini-modal-body .gemini-result { font-size: .95rem; }
.gemini-modal-body .gemini-result .math-display {
  direction: ltr; text-align: center; margin: .6rem 0;
  overflow-x: auto; padding: .4rem 0;
}
.gemini-modal-body .gemini-result .MathJax { direction: ltr; }
.gemini-modal-body .gemini-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem; padding: 2rem 0; color: var(--muted);
}
.gemini-modal-body .gemini-loading .spinner {
  width: 36px; height: 36px; border: 3px solid #e5e7eb;
  border-top-color: #7c3aed; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gemini-modal-footer {
  display: flex; gap: .75rem; justify-content: flex-end;
  padding: .85rem 1.25rem; border-top: 1px solid var(--border);
}
.gemini-modal-footer .btn-gemini {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #fff; border: none; padding: .45rem 1rem;
  border-radius: 8px; font-weight: 600; font-size: .85rem;
  cursor: pointer; font-family: inherit; transition: opacity .15s;
}
.gemini-modal-footer .btn-gemini:hover { opacity: .88; }
.gemini-modal-footer .btn-gemini:disabled { opacity: .5; cursor: not-allowed; }

/* ── AI questions tab card ─────────────────────────────────── */
.ai-q-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem;
  margin-bottom: .75rem; position: relative;
}
.ai-q-card .ai-q-source {
  font-size: .78rem; color: var(--muted); margin-bottom: .5rem;
}
.ai-q-card .ai-q-text {
  font-size: .92rem; line-height: 1.7; color: var(--text); white-space: pre-wrap;
}
.ai-q-card .ai-q-actions {
  display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem;
}

/* ── Consent Modal ────────────────────────────────────────────── */
.consent-card {
  background: #fff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  direction: rtl;
  text-align: right;
}
.consent-check-label {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: .5rem;
  user-select: none;
}
.consent-check-label input[type="checkbox"] {
  margin-top: .2rem;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary, #6c63ff);
  cursor: pointer;
}
.consent-check-label input[type="checkbox"]:disabled {
  cursor: default;
  opacity: .7;
}
.consent-check-label--checked {
  border-color: var(--primary, #6c63ff);
  background: #f5f3ff;
}
.consent-check-label--error {
  border-color: #dc2626;
  background: #fef2f2;
  animation: consent-shake .3s ease;
}
.consent-check-text {
  font-size: .88rem;
  line-height: 1.6;
  color: #334155;
}
@keyframes consent-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

/* ── NAV MENU (hamburger + dropdown) ─────────────────────── */
.nav-menu-btn {
  padding: .34rem .56rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 32px;
  border-radius: 8px;
  position: relative; /* anchor for dropdown positioning */
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 232px;
  background: #fff;
  color: #1e293b; /* reset — overrides navbar's inherited color:#fff */
  border: 1px solid #e2e8f0;
  border-top: 3px solid #2563eb;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .2);
  z-index: 500;
  overflow: hidden;
  padding: .34rem 0;
  transform-origin: top left;
  animation: nav-dropdown-in .16s ease-out;
}
/* caret triangle */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 14px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #2563eb;
}
@keyframes nav-dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes nav-dropdown-out {
  from { opacity: 1; transform: translateY(0)   scale(1); }
  to   { opacity: 0; transform: translateY(-6px) scale(.98); }
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: .52rem .88rem;
  font-size: .8rem;
  color: var(--fg);
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  direction: rtl;
  font-family: inherit;
  font-weight: 600;
  transition: background .12s ease;
  border-radius: 0;
}
.nav-dropdown-item:hover {
  background: #f8fafc;
}
.nav-dropdown-item.danger { color: #dc2626; }
.nav-dropdown-divider { height: 1px; background: #e2e8f0; margin: .28rem .62rem; }

/* ── PRIVACY PAGE ───────────────────────────────────────────── */
.privacy-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.privacy-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 .75rem;
}
.privacy-section p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 .75rem;
}

/* ── Video explanation modal (Bunny.net player) ─────────────── */
.video-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 10500; padding: 1rem;
  backdrop-filter: blur(3px);
  animation: fadeIn .15s ease;
}
.video-modal-card {
  background: #1a1a2e;
  border-radius: 16px;
  width: min(94vw, 920px);
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.1rem;
  background: #16213e;
  border-bottom: 1px solid rgba(255,255,255,.08);
  direction: rtl;
}
.video-modal-title {
  font-size: .9rem; font-weight: 700; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-modal-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.video-modal-open {
  background: rgba(99,102,241,.16);
  border: 1px solid rgba(99,102,241,.38);
  color: #c7d2fe;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 700;
  padding: .22rem .48rem;
  border-radius: 6px;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.video-modal-open:hover {
  background: rgba(99,102,241,.28);
  border-color: rgba(129,140,248,.62);
  color: #eef2ff;
}
.video-modal-report {
  background: rgba(245,158,11,.14);
  border: 1px solid rgba(245,158,11,.35);
  color: #fde68a;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  padding: .22rem .45rem;
  border-radius: 6px;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.video-modal-report:hover {
  background: rgba(245,158,11,.25);
  border-color: rgba(245,158,11,.55);
  color: #fef3c7;
}
.video-modal-close {
  background: rgba(255,255,255,.08); border: none; cursor: pointer;
  color: #cbd5e1; font-size: 1rem; font-weight: 700;
  padding: .25rem .55rem; border-radius: 6px; line-height: 1;
  transition: background .15s; flex-shrink: 0; margin-right: .5rem;
}
.video-modal-close:hover { background: rgba(255,255,255,.18); color: #fff; }
.video-modal-player {
  position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 */
  height: 0; background: #000;
}
.video-modal-player iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Video play button in question card */
.qv-video-btn {
  color: #6366f1 !important;
  background: rgba(99,102,241,.08) !important;
  border-color: rgba(99,102,241,.28) !important;
  padding: .28rem .38rem !important;
  border-radius: 7px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.qv-video-btn:hover {
  background: rgba(99,102,241,.18) !important;
  color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.qv-video-btn svg { display: block; }

/* Admin attach button */
.qv-video-admin-btn {
  background: rgba(245,158,11,.12) !important;
  color: #d97706 !important;
  border-color: rgba(245,158,11,.3) !important;
  font-size: .85rem;
}
.qv-video-admin-btn:hover { background: rgba(245,158,11,.22) !important; }

/* ══ Step 6: Admin activity log modal + consent badges ══ */

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .15s ease;
}
.admin-modal {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  width: min(520px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  direction: rtl;
  animation: slideDown .18s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.activity-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: .5rem .75rem;
  transition: background .12s;
}
.activity-row:hover { background: #f1f5f9; }
.consent-badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.consent-badge-yes {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.consent-badge-no {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.consent-badge-pending {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

/* ══ Videos tab — collapsed list of question videos in a course ══ */
.vt-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: .25rem 0 .55rem;
}
.vt-toggle-all {
  font-size: .85rem;
  padding: .35rem .85rem;
}
.vt-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: .5rem;
}
.vt-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: box-shadow .15s, border-color .15s;
}
.vt-item[open] {
  border-color: #c4b5fd;
  box-shadow: 0 4px 14px rgba(99,102,241,.10);
}
.vt-summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 600;
  color: #1e293b;
}
.vt-summary::-webkit-details-marker { display: none; }
.vt-summary:hover { background: #f8fafc; }
.vt-title {
  flex: 1 1 auto;
  font-size: .95rem;
}
.vt-subtitle {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  margin-inline-start: .5rem;
}
.vt-chev {
  font-size: 1rem;
  color: #6366f1;
  transition: transform .18s;
  flex-shrink: 0;
}
.vt-item[open] .vt-chev { transform: rotate(180deg); }
.vt-body {
  border-top: 1px solid #eef2f7;
  background: #fff;
  padding: .9rem 1rem 1.1rem;
}
.vt-body .qv-card {
  margin: 0;
  box-shadow: none;
  border: none;
}
.vt-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
}
.vt-player iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ?? Lecturer "My Exams" rows ?????????????????????????????? */
.lec-exam-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  flex-wrap: wrap;
}
.lec-exam-row:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
  border-color: #cbd5e1;
}
.lec-exam-row.is-hidden {
  background: #fafafa;
  border-style: dashed;
  border-color: #d4d4d8;
}
.lec-exam-row.is-hidden .lec-exam-title { color: #52525b; }

.lec-exam-info { flex: 1; min-width: 220px; }
.lec-exam-title {
  font-weight: 600;
  font-size: 1rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}
.lec-exam-flag {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.lec-exam-meta {
  margin-top: .35rem;
  font-size: .82rem;
  color: #64748b;
}

.lec-exam-actions { display: flex; gap: .45rem; flex-wrap: wrap; }

.lec-btn {
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .45rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  line-height: 1.2;
  white-space: nowrap;
}
.lec-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

.lec-btn-primary {
  background: #0f172a;
  color: #fff;
}
.lec-btn-primary:hover { background: #1e293b; }

.lec-btn-ghost {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}
.lec-btn-ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.lec-btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}
.lec-btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

@media (max-width: 540px) {
  .lec-exam-row { align-items: stretch; }
  .lec-exam-actions { width: 100%; }
  .lec-btn { flex: 1; text-align: center; }
}