/* ═══════════════════════════════════════════
   RRPCO EXAMINATION PORTAL — STYLESHEET
   File: rrpco-styles.css
═══════════════════════════════════════════ */

/* ── CSS VARIABLES ─────────────────────────── */
:root {
  --bg: #f0f4f8;
  --bg2: #e8edf5;
  --white: #ffffff;
  --card: #ffffff;
  --card2: #f7f9fc;
  --border: #dde3ee;
  --border2: #c8d1e0;
  --accent: #1d4ed8;
  --accent-light: #eff4ff;
  --accent2: #3b82f6;
  --accent-hover: #1e40af;
  --green: #059669;
  --green-light: #ecfdf5;
  --green2: #10b981;
  --red: #dc2626;
  --red-light: #fef2f2;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.1), 0 2px 6px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
}

/* ── RESET & BASE ───────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.hidden { display: none !important; }

/* ── ANIMATIONS ─────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { transform: scale(.93); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.fade-up   { animation: fadeUp  .35s ease both; }
.scale-in  { animation: scaleIn .25s ease both; }

/* ── BUTTONS ────────────────────────────────── */
.btn {
  cursor: pointer;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 11px 24px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(29,78,216,.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29,78,216,.35);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--white);
  color: var(--text);
  padding: 10px 20px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.btn-secondary:hover { border-color: var(--border2); background: var(--card2); }
.btn-green {
  background: var(--green);
  color: #fff;
  padding: 11px 24px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(5,150,105,.2);
}
.btn-green:hover { background: #047857; transform: translateY(-1px); }
.btn-red {
  background: var(--red);
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  transition: all .18s;
}
.btn-red:hover { background: #b91c1c; }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  padding: 8px 14px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  transition: all .18s;
}
.btn-ghost:hover { border-color: var(--accent2); color: var(--accent); }
.btn-google {
  background: var(--white);
  color: var(--text);
  padding: 13px 24px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  width: 100%;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-google:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn-google:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── TAGS / BADGES ──────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.tag-blue   { background: var(--accent-light); color: var(--accent); }
.tag-green  { background: var(--green-light);  color: var(--green);  }
.tag-amber  { background: var(--amber-light);  color: var(--amber);  }
.tag-red    { background: var(--red-light);    color: var(--red);    }
.tag-purple { background: var(--purple-light); color: var(--purple); }

/* ── FORM ELEMENTS ──────────────────────────── */
input, select, textarea {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: all .18s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
select option { background: white; }
label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.form-group  { margin-bottom: 16px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr;       gap: 14px; }
.form-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 14px; }
.divider-line { height: 1px; background: var(--border); margin: 24px 0; }
.form-section-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ── APP LOADER ─────────────────────────────── */
#app-loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loader-logo { display: flex; align-items: center; gap: 14px; }
.loader-emblem {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(29,78,216,.3);
}
.loader-logo h1 { font-size: 28px; font-weight: 800; color: var(--text); }
.loader-logo h1 span { color: var(--accent); }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loader-msg { font-size: 13px; color: var(--text3); }

/* ── LANDING ────────────────────────────────── */
#screen-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
#screen-landing::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29,78,216,.06), transparent 65%);
  pointer-events: none;
}
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(29,78,216,.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: .5px;
}
.landing-title {
  font-size: 46px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -1.5px;
  max-width: 580px;
  margin-bottom: 12px;
}
.landing-title span { color: var(--accent); }
.landing-sub {
  font-size: 16px;
  color: var(--text2);
  text-align: center;
  max-width: 420px;
  line-height: 1.7;
  margin-bottom: 48px;
}
.portal-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.portal-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  width: 260px;
  cursor: pointer;
  transition: all .25s;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.portal-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity .2s;
}
.student-card::after { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.teacher-card::after { background: linear-gradient(90deg, var(--amber), #f97316); }
.portal-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.portal-card:hover::after { opacity: 1; }
.pcard-icon { font-size: 44px; margin-bottom: 14px; }
.portal-card h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.portal-card p  { font-size: 13px; color: var(--text2); line-height: 1.65; }
.pcard-cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ── LOGIN ──────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.login-back {
  position: absolute;
  top: 20px; left: 20px;
  background: var(--card2);
  border: 1.5px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.login-back:hover { border-color: var(--accent2); color: var(--accent); }
.login-header { text-align: center; margin-bottom: 28px; }
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.student-badge { background: var(--accent-light); color: var(--accent); }
.teacher-badge { background: var(--amber-light);  color: var(--amber);  }
.login-header h2 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.login-header p  { font-size: 13px; color: var(--text2); margin-top: 6px; line-height: 1.6; }
.role-note {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
}
.role-note strong { color: var(--text); display: block; margin-bottom: 4px; }
.setup-guide {
  background: var(--white);
  border: 1.5px solid var(--amber);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 16px;
}
.setup-guide h3  { font-size: 15px; font-weight: 800; color: var(--amber); margin-bottom: 10px; }
.setup-guide ol  { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.setup-guide li  { font-size: 13px; color: var(--text2); line-height: 1.6; }
.setup-guide code {
  background: var(--card2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-emblem {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.topbar-logo span  { font-size: 17px; font-weight: 800; }
.topbar-logo small { font-size: 11px; color: var(--text3); font-weight: 600; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 24px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip-name { font-size: 13px; font-weight: 700; }
.user-chip-role { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.logout-btn {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--red-light);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all .18s;
}
.logout-btn:hover { background: #fee2e2; }

/* ── SHARED PAGE LAYOUT ─────────────────────── */
.page-body { max-width: 1120px; margin: 0 auto; padding: 32px 24px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; }
.page-sub   { font-size: 14px; color: var(--text2); margin-bottom: 28px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }

/* ── STAT CARDS ─────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.s-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .6px; }
.s-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -1px; }
.s-sub   { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ── SEARCH BAR ─────────────────────────────── */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-bar-inner {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.search-bar-inner input { padding-left: 40px; border-radius: 10px; }
.search-bar-inner .sb-ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text3);
  pointer-events: none;
}
.search-filter-select { width: 160px; }

/* ── DASH TABS ──────────────────────────────── */
.dash-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  width: fit-content;
  margin-bottom: 24px;
}
.dash-tab {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text2);
  transition: all .18s;
}
.dash-tab.active { background: var(--white); color: var(--accent); box-shadow: var(--shadow); }
.dash-tab:hover:not(.active) { color: var(--text); }

/* ── EXAM CARDS (Student) ───────────────────── */
.exams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.exam-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  transition: all .25s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.exam-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.ec-blue::before   { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.ec-green::before  { background: linear-gradient(90deg, #10b981, #06b6d4); }
.ec-amber::before  { background: linear-gradient(90deg, #f59e0b, #f97316); }
.ec-purple::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.exam-card:hover { transform: translateY(-3px); border-color: var(--accent2); box-shadow: var(--shadow-lg); }
.exam-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.exam-card h3   { font-size: 16px; font-weight: 800; line-height: 1.3; flex: 1; padding-right: 8px; }
.exam-meta      { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.exam-meta-row  { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.exam-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.start-btn {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all .18s;
}
.start-btn:hover { background: var(--accent-hover); }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  background: var(--white);
  border-radius: 16px;
  border: 1.5px dashed var(--border);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }

/* ── TABLES ─────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table-wrap th {
  background: var(--card2);
  padding: 12px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.table-wrap td { padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--border); }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: rgba(59,130,246,.02); }
.score-bar  { height: 5px; border-radius: 3px; background: var(--bg2); margin-top: 5px; overflow: hidden; width: 80px; }
.score-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--green)); }
.data-table { background: var(--white); border: 1.5px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); overflow-x: auto; }
.data-table table { width: 100%; border-collapse: collapse; min-width: 700px; }
.data-table th { background: var(--card2); padding: 12px 18px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1.5px solid var(--border); white-space: nowrap; }
.data-table td { padding: 13px 18px; font-size: 13px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(59,130,246,.02); }
.mini-bar  { height: 4px; border-radius: 2px; background: var(--bg2); margin-top: 4px; width: 70px; overflow: hidden; }
.mini-fill { height: 100%; border-radius: 2px; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 34px; width: 220px; }
.search-wrap .s-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }

/* ── OMR EXAM SCREEN ────────────────────────── */
#screen-exam { background: var(--bg); min-height: 100vh; }
.exam-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow);
}
.exam-topbar .exam-title { font-size: 15px; font-weight: 800; flex: 1; }
.timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--amber-light);
  border: 1.5px solid rgba(217,119,6,.25);
  border-radius: 10px;
}
.timer-val { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600; color: var(--amber); }
.timer-val.danger { color: var(--red); animation: blink 1s infinite; }
.exam-progress-bar  { position: fixed; top: 60px; left: 0; right: 0; z-index: 999; height: 3px; background: var(--border); }
.exam-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .3s; }
.exam-body {
  max-width: 1160px;
  margin: 0 auto;
  padding: 88px 24px 120px;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 20px;
}
.question-panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.q-num  { font-size: 11px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.q-text { font-size: 19px; font-weight: 700; line-height: 1.55; margin-bottom: 16px; }
.q-image-wrap {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--card2);
}
.q-image-wrap img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.q-type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 14px;
}
.q-type-single   { background: var(--accent-light); color: var(--accent); }
.q-type-multi    { background: var(--purple-light);  color: var(--purple); }
.omr-options { display: flex; flex-direction: column; gap: 10px; }
.omr-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--card2);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.omr-option:hover  { border-color: var(--accent2); background: var(--accent-light); }
.omr-option.selected { border-color: var(--accent); background: var(--accent-light); }
.omr-option.selected-multi { border-color: var(--purple); background: var(--purple-light); }
.omr-bubble {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
  transition: all .18s;
  background: var(--white);
  color: var(--text2);
}
.omr-bubble-check {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all .18s;
  background: var(--white);
}
.omr-option.selected .omr-bubble       { background: var(--accent); border-color: var(--accent); color: #fff; }
.omr-option.selected-multi .omr-bubble-check { background: var(--purple); border-color: var(--purple); color: #fff; }
.omr-option-text { font-size: 15px; font-weight: 500; flex: 1; }
.multi-hint { font-size: 12px; color: var(--purple); font-weight: 600; margin-bottom: 12px; background: var(--purple-light); padding: 8px 12px; border-radius: 8px; }
.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.q-nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 9px;
  background: var(--white);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  transition: all .18s;
}
.q-nav-btn:hover:not(:disabled) { border-color: var(--accent2); color: var(--accent); }
.q-nav-btn:disabled { opacity: .4; cursor: not-allowed; }
.palette-panel { position: sticky; top: 80px; }
.palette-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.palette-box h4 { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.palette-q {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  border: 1.5px solid var(--border);
  background: var(--card2);
  color: var(--text2);
}
.palette-q.answered { background: var(--accent); color: #fff; border-color: var(--accent); }
.palette-q.answered-multi { background: var(--purple); color: #fff; border-color: var(--purple); }
.palette-q.current  { border-color: var(--amber); color: var(--amber); background: var(--amber-light); }
.palette-legend { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.palette-legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text3); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.submit-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--white);
  border-top: 1.5px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 12px rgba(15,23,42,.07);
}
.submit-info { font-size: 14px; color: var(--text2); }
.submit-info span { color: var(--text); font-weight: 800; }

/* ── RESULT SCREEN ──────────────────────────── */
#screen-result { background: var(--bg); min-height: 100vh; }
.result-body { max-width: 800px; margin: 0 auto; padding: 40px 24px; }
.result-hero {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.result-circle {
  width: 160px; height: 160px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.result-circle svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.score-num   { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.score-total { font-size: 13px; color: var(--text3); margin-top: 2px; }
.result-hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; }
.result-badges { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.result-badge {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  text-align: center;
  min-width: 90px;
}
.rb-val { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.rb-lbl { font-size: 11px; color: var(--text3); font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }
.ans-review { background: var(--white); border: 1.5px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.ans-review-head { padding: 18px 22px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.ans-review-head h3 { font-size: 15px; font-weight: 800; }
.ans-item { padding: 14px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: flex-start; }
.ans-item:last-child { border-bottom: none; }
.ans-num {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.ans-correct { background: var(--green-light); color: var(--green); }
.ans-wrong   { background: var(--red-light);   color: var(--red);   }
.ans-skip    { background: var(--card2);        color: var(--text3); }
.ans-partial { background: var(--amber-light);  color: var(--amber); }
.ans-detail  { flex: 1; }
.ans-q       { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.ans-row     { display: flex; gap: 16px; font-size: 12px; color: var(--text2); flex-wrap: wrap; }
.result-footer { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ── TEACHER DASHBOARD ──────────────────────── */
#screen-teacher-dash { background: var(--bg); min-height: 100vh; }
.teacher-layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar {
  width: 230px;
  background: var(--white);
  border-right: 1.5px solid var(--border);
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-section { padding: 16px 12px 8px; font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .7px; }
.snav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.snav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  transition: all .18s;
}
.snav-item:hover  { background: var(--card2); color: var(--text); }
.snav-item.active { background: var(--accent-light); color: var(--accent); }
.sn-ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--border); }
.teacher-content { flex: 1; padding: 28px 32px; overflow-x: auto; min-width: 0; }

/* ── EXAM LIST ITEMS (Teacher) ──────────────── */
.exam-list-item {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  transition: all .18s;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.exam-list-item:hover { border-color: var(--accent2); box-shadow: var(--shadow-md); }
.eli-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.eli-info { flex: 1; min-width: 140px; }
.eli-info h4 { font-size: 14px; font-weight: 800; }
.eli-info p  { font-size: 12px; color: var(--text2); margin-top: 3px; }
.eli-stats { display: flex; gap: 20px; }
.eli-stat .esv { font-size: 18px; font-weight: 800; }
.eli-stat .esl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; }

/* ── CREATE EXAM FORM ───────────────────────── */
.create-form {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.q-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--accent-light);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-left: 10px;
}

/* ── QUESTION BUILDER ───────────────────────── */
.q-builder-item {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
}
.q-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.q-item-label  { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.q-type-toggle { display: flex; gap: 6px; }
.q-type-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all .18s;
}
.q-type-btn.active-single { background: var(--accent-light); color: var(--accent); border-color: var(--accent2); }
.q-type-btn.active-multi  { background: var(--purple-light);  color: var(--purple); border-color: var(--purple);  }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.option-input { display: flex; align-items: center; gap: 8px; }
.option-input input[type=radio],
.option-input input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.option-input input[type=checkbox] { accent-color: var(--purple); border-radius: 4px; }
.opt-letter { font-size: 12px; font-weight: 700; color: var(--text3); width: 14px; flex-shrink: 0; }

/* Image Upload */
.img-upload-area {
  margin-top: 12px;
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  background: var(--white);
  position: relative;
}
.img-upload-area:hover { border-color: var(--accent2); background: var(--accent-light); }
.img-upload-area.has-image { border-style: solid; border-color: var(--green); background: var(--green-light); }
.img-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0;
}
.img-upload-label { font-size: 12px; color: var(--text3); font-weight: 600; pointer-events: none; }
.img-upload-label span { display: block; font-size: 22px; margin-bottom: 4px; }
.img-preview-wrap { margin-top: 10px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); }
.img-preview-wrap img { width: 100%; max-height: 200px; object-fit: contain; display: block; }
.img-clear-btn {
  margin-top: 8px;
  font-size: 11px;
  color: var(--red);
  cursor: pointer;
  font-weight: 700;
  border: none;
  background: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.img-clear-btn:hover { text-decoration: underline; }

.remove-q-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  font-size: 13px;
  transition: all .18s;
  flex-shrink: 0;
}
.remove-q-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.add-q-btn {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  font-weight: 700;
  transition: all .18s;
}
.add-q-btn:hover { border-color: var(--accent2); color: var(--accent); background: var(--accent-light); }

/* ── STUDENT DETAIL VIEW ────────────────────── */
#screen-student-detail { background: var(--bg); min-height: 100vh; }
.student-detail-body { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.student-profile-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.student-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.student-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-profile-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.student-profile-info p  { font-size: 13px; color: var(--text2); }
.student-profile-stats { margin-left: auto; display: flex; gap: 24px; flex-wrap: wrap; }
.sp-stat { text-align: center; }
.sp-stat .spv { font-size: 24px; font-weight: 800; }
.sp-stat .spl { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.exam-detail-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.edc-info { flex: 1; min-width: 160px; }
.edc-info h4 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.edc-info p  { font-size: 12px; color: var(--text2); }
.edc-score { text-align: right; min-width: 100px; }
.edc-score .escore { font-size: 26px; font-weight: 800; }
.edc-score .efull  { font-size: 12px; color: var(--text3); }
.perf-bar-wrap { flex: 1; min-width: 120px; }
.perf-bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.perf-bar-fill { height: 100%; border-radius: 4px; }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  max-width: 860px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--card2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  font-size: 14px;
  transition: all .18s;
}
.modal-close:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* ── CONFIRM DIALOG ─────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.confirm-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  max-width: 400px;
  width: 100%;
  margin: 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.confirm-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.confirm-box p  { color: var(--text2); font-size: 14px; line-height: 1.7; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

/* ── TOAST ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 18px;
  display: flex; align-items: center; gap: 10px;
  z-index: 9999;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
  max-width: 320px;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red);   }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 900px) {
  .exam-body { grid-template-columns: 1fr; }
  .palette-panel { position: static; }
  .teacher-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1.5px solid var(--border); }
  .snav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .sidebar-bottom { border-top: none; padding: 8px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .teacher-content { padding: 20px 16px; }
  .options-grid { grid-template-columns: 1fr; }
  .student-profile-stats { margin-left: 0; }
}
@media (max-width: 600px) {
  .landing-title { font-size: 30px; }
  .exam-body { padding: 80px 14px 110px; }
  .page-body { padding: 20px 16px; }
  .result-body { padding: 20px 16px; }
  .login-box { padding: 32px 20px; }
  .topbar { padding: 0 16px; }
  .teacher-content { padding: 16px 12px; }
}