/* =============================================
   Special Seals Academy — Shared Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --navy: #0a1628;
  --navy2: #112240;
  --gold: #c9a84c;
  --gold2: #e8c96e;
  --teal: #1a9e8f;
  --teal2: #22c5b3;
  --red: #e05252;
  --white: #f5f7fa;
  --muted: #8a9ab5;
  --card: #162035;
  --border: rgba(201,168,76,0.18);
  --radius: 14px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --sidebar-w: 250px;
}

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

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .seal { font-size: 1.8rem; }
.sidebar-logo .name { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.sidebar-logo .role-tag { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section { margin-bottom: 24px; }
.nav-section-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 0 10px; margin-bottom: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  cursor: pointer; font-size: 0.88rem;
  color: var(--muted); transition: all 0.2s;
  margin-bottom: 2px; text-decoration: none;
}
.nav-item:hover { background: rgba(201,168,76,0.08); color: var(--white); }
.nav-item.active { background: rgba(201,168,76,0.12); color: var(--gold); font-weight: 500; }
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-badge { margin-left: auto; background: var(--teal); color: #fff; font-size: 0.68rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; }
.sidebar-user {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: var(--navy); flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.3rem; }
.user-info .name { font-size: 0.85rem; font-weight: 500; }
.user-info .role { font-size: 0.72rem; color: var(--muted); }
.logout-btn { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; transition: color 0.2s; }
.logout-btn:hover { color: var(--red); }

/* ── MAIN CONTENT ── */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; padding: 32px; }

/* ── TOPBAR ── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.topbar h1 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.topbar .actions { display: flex; gap: 10px; }

/* ── STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 50%; transform: translate(25px, -25px); }
.stat-card.gold::after { background: rgba(201,168,76,0.15); }
.stat-card.teal::after { background: rgba(26,158,143,0.15); }
.stat-card.red::after  { background: rgba(224,82,82,0.15); }
.stat-card.blue::after { background: rgba(100,140,230,0.15); }
.stat-icon { font-size: 1.4rem; margin-bottom: 12px; }
.stat-card.gold .stat-icon { color: var(--gold); }
.stat-card.teal .stat-icon { color: var(--teal2); }
.stat-card.red  .stat-icon { color: var(--red); }
.stat-card.blue .stat-icon { color: #648ce6; }
.stat-val { font-family: var(--font-head); font-size: 2rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.stat-change { font-size: 0.75rem; margin-top: 6px; color: var(--teal2); }

/* ── GRIDS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── CARD ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 10px 14px; color: var(--muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px; }
.badge-green { background: rgba(34,197,131,0.15); color: #22c583; }
.badge-gold  { background: rgba(201,168,76,0.15);  color: var(--gold2); }
.badge-red   { background: rgba(224,82,82,0.15);   color: #f07070; }
.badge-blue  { background: rgba(100,140,230,0.15); color: #8baff0; }
.badge-muted { background: rgba(138,154,181,0.15); color: var(--muted); }

/* ── PROGRESS ── */
.progress-bar  { background: rgba(255,255,255,0.07); border-radius: 4px; height: 6px; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--teal2)); transition: width 0.5s; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border: none; border-radius: 10px; cursor: pointer; font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; transition: all 0.2s; text-decoration: none; }
.btn-gold  { background: var(--gold); color: var(--navy); }
.btn-gold:hover  { background: var(--gold2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,0.35); }
.btn-teal  { background: var(--teal); color: #fff; }
.btn-teal:hover  { background: var(--teal2); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--white); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-red   { background: var(--red); color: #fff; }
.btn-full  { width: 100%; justify-content: center; }
.btn-sm    { padding: 8px 16px; font-size: 0.82rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; background: var(--navy2); border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 13px 16px; color: var(--white);
  font-family: var(--font-body); font-size: 0.95rem; transition: border-color 0.2s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group select option { background: var(--navy2); }

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 10px 20px; cursor: pointer; font-size: 0.85rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s; }
.tab:hover { color: var(--white); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 500; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 36px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal h2 { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }
.modal-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.modal-close:hover { color: var(--white); }

/* ── UPLOAD ── */
.upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; color: var(--muted); }
.upload-area:hover { border-color: var(--gold); color: var(--gold); }
.upload-area i { font-size: 2rem; margin-bottom: 10px; display: block; }

/* ── COURSE CARDS ── */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.course-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.2s; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); border-color: rgba(201,168,76,0.3); }
.course-thumb { height: 140px; background: linear-gradient(135deg, var(--navy2), var(--card)); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; position: relative; }
.course-thumb .price-tag { position: absolute; top: 12px; right: 12px; background: var(--gold); color: var(--navy); font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.course-body { padding: 18px; }
.course-body h3 { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.course-body p { color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.course-meta { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--muted); }
.course-meta span { display: flex; align-items: center; gap: 4px; }
.course-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ── PAYMENT CARD ── */
.payment-card { background: var(--navy2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 16px; }
.payment-card:hover, .payment-card.selected { border-color: var(--gold); background: rgba(201,168,76,0.06); }
.payment-icon { font-size: 1.8rem; }

/* ── CHAT ── */
.chat-messages { height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--navy); border-radius: 10px; margin-bottom: 12px; }
.msg { max-width: 80%; }
.msg.me { align-self: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 14px; font-size: 0.85rem; line-height: 1.5; }
.msg.other .msg-bubble { background: var(--navy2); color: var(--white); border-bottom-left-radius: 4px; }
.msg.me .msg-bubble { background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.msg-author { font-size: 0.7rem; color: var(--muted); margin-bottom: 3px; }
.chat-input { display: flex; gap: 8px; }
.chat-input .form-group { flex: 1; margin: 0; }

/* ── LECTURE ROOM ── */
.lecture-room { background: #000; border-radius: var(--radius); aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; margin-bottom: 16px; }
.lecture-room .video-placeholder { text-align: center; color: var(--muted); }
.lecture-room .video-placeholder i { font-size: 3rem; margin-bottom: 12px; color: var(--teal2); }
.lecture-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; background: var(--navy2); border-radius: 10px; }
.ctrl-btns { display: flex; gap: 8px; }
.ctrl-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.07); border: none; border-radius: 8px; color: var(--white); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.ctrl-btn:hover { background: var(--gold); color: var(--navy); }

/* ── CERTIFICATE ── */
.cert-preview { background: linear-gradient(135deg, #1a1a2e, #16213e); border: 3px solid var(--gold); border-radius: 12px; padding: 40px; text-align: center; position: relative; overflow: hidden; }
.cert-preview::before { content: '🦭'; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 3rem; opacity: 0.06; }
.cert-logo { font-size: 2rem; margin-bottom: 8px; }
.cert-academy { font-family: var(--font-head); font-size: 0.85rem; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }
.cert-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--gold2); margin-bottom: 16px; }
.cert-name { font-size: 1.8rem; font-weight: 300; margin-bottom: 12px; font-style: italic; }
.cert-course { color: var(--muted); font-size: 0.9rem; }
.cert-date { font-size: 0.8rem; color: var(--muted); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.cert-seal { position: absolute; bottom: 20px; right: 30px; font-size: 2.5rem; opacity: 0.5; }

/* ── STEP INDICATOR ── */
.step-indicator { display: flex; gap: 0; margin-bottom: 32px; }
.step { flex: 1; text-align: center; font-size: 0.75rem; padding: 10px; position: relative; color: var(--muted); }
.step::after { content: ''; position: absolute; top: 22px; right: -50%; width: 100%; height: 1px; background: var(--border); z-index: 0; }
.step:last-child::after { display: none; }
.step .step-num { width: 28px; height: 28px; background: var(--navy2); border: 2px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-weight: 700; font-size: 0.8rem; position: relative; z-index: 1; }
.step.done .step-num   { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.active .step-num { background: var(--gold); border-color: var(--gold); color: var(--navy); }

/* ── NOTIFICATION ── */
.notification { position: fixed; bottom: 24px; right: 24px; z-index: 9999; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; max-width: 320px; }
.notification.show { transform: translateY(0); opacity: 1; }
.notification.success { border-color: var(--teal); }
.notification.success .notif-icon { color: var(--teal2); }
.notification .notif-icon { font-size: 1.2rem; }
.notification .notif-text { font-size: 0.88rem; }

/* ── UTILITIES ── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-4  { margin-top: 16px; }
.text-muted { color: var(--muted); }
.text-sm    { font-size: 0.82rem; }
.text-gold  { color: var(--gold); }
.fw-700 { font-weight: 700; font-family: var(--font-head); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stats-row  { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px; }
  .stats-row  { grid-template-columns: 1fr 1fr; }
  .course-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   SSA BIOMETRIC AUTH STYLES — shared across all login pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Mode selector ── */
.bio-mode-title {
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  margin-bottom: 10px;
}
.bio-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.bio-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s;
  position: relative;
}
.bio-mode-btn:hover {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.3);
}
.bio-mode-btn.active {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.55);
}
.bio-mode-btn.bio-unavailable {
  opacity: 0.35;
  cursor: not-allowed;
}
.bio-mode-icon {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}
.bio-mode-btn.active .bio-mode-icon { color: var(--gold, #c9a84c); }
.bio-mode-btn:hover:not(.bio-unavailable) .bio-mode-icon { color: var(--gold, #c9a84c); }
.bio-mode-label {
  font-family: var(--font-head, 'Rajdhani', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.6);
}
.bio-mode-btn.active .bio-mode-label { color: var(--gold, #c9a84c); }
.bio-mode-sub {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.22);
  text-align: center;
  line-height: 1.3;
}

/* ── Biometric prompt panel ── */
.bio-form {
  text-align: center;
  padding: 8px 0 4px;
}
.bio-prompt-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(201,168,76,0.08);
  border: 2px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
  transition: all 0.3s;
}
.bio-prompt-ring.scanning {
  border-color: rgba(201,168,76,0.7);
  box-shadow: 0 0 0 0 rgba(201,168,76,0.4);
  animation: bioRingPulse 1.5s infinite;
}
.bio-prompt-ring.success {
  background: rgba(26,158,143,0.15);
  border-color: var(--teal2, #1a9e8f);
  box-shadow: 0 0 24px rgba(26,158,143,0.3);
}
.bio-prompt-ring.error {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.5);
  animation: bioShake 0.4s;
}
@keyframes bioRingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
  70%  { box-shadow: 0 0 0 14px rgba(201,168,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
}
@keyframes bioShake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-8px); }
  40%    { transform: translateX(8px); }
  60%    { transform: translateX(-5px); }
  80%    { transform: translateX(5px); }
}
.bio-prompt-icon {
  font-size: 2.4rem;
  color: rgba(201,168,76,0.7);
  transition: color 0.3s;
}
.bio-prompt-ring.scanning .bio-prompt-icon { color: var(--gold, #c9a84c); }
.bio-prompt-ring.success .bio-prompt-icon  { color: var(--teal2, #1a9e8f); }
.bio-prompt-ring.error .bio-prompt-icon    { color: #f87171; }

/* Scan line animation */
.bio-prompt-ring.scanning::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.8), transparent);
  border-radius: 2px;
  animation: bioScan 1.4s ease-in-out infinite;
}
@keyframes bioScan {
  0%   { top: 20%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 75%; opacity: 0; }
}

.bio-prompt-label {
  font-family: var(--font-head, 'Rajdhani', sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 4px;
}
.bio-prompt-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 18px;
  line-height: 1.5;
}
.bio-status {
  min-height: 28px;
  font-size: 0.8rem;
  margin-bottom: 14px;
  transition: all 0.2s;
}
.bio-status.error   { color: #f87171; }
.bio-status.success { color: var(--teal2, #1a9e8f); }
.bio-status.info    { color: var(--gold, #c9a84c); }

/* Biometric action button */
.bio-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, rgba(201,168,76,0.2), rgba(201,168,76,0.1));
  border: 1.5px solid rgba(201,168,76,0.45);
  border-radius: 10px;
  color: var(--gold, #c9a84c);
  font-family: var(--font-head, 'Rajdhani', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s;
  margin-bottom: 10px;
}
.bio-btn:hover {
  background: linear-gradient(135deg, rgba(201,168,76,0.3), rgba(201,168,76,0.15));
  border-color: rgba(201,168,76,0.7);
  transform: translateY(-1px);
}
.bio-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Register biometric link */
.bio-register-link {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-top: 12px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}
.bio-register-link:hover { color: rgba(201,168,76,0.7); }

/* Divider */
.bio-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: rgba(255,255,255,0.15);
  font-size: 0.72rem;
}
.bio-divider::before, .bio-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.09);
}

/* Device badge */
.bio-device-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
  font-family: var(--font-head, 'Rajdhani', sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Settings panel for biometric (in profile/dashboard) */
.bio-settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bio-settings-row:last-child { border-bottom: none; }
.bio-settings-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--gold, #c9a84c);
  flex-shrink: 0;
}
.bio-settings-info { flex: 1; min-width: 0; }
.bio-settings-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.bio-settings-sub   { font-size: 0.72rem; color: rgba(255,255,255,0.35); }
.bio-toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.bio-toggle input { opacity: 0; width: 0; height: 0; }
.bio-toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}
.bio-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}
.bio-toggle input:checked + .bio-toggle-slider { background: rgba(201,168,76,0.6); }
.bio-toggle input:checked + .bio-toggle-slider::before { transform: translateX(20px); background: var(--gold, #c9a84c); }



/* ═══════════════════════════════════════════════════════════
   PORTAL RESPONSIVE SYSTEM — All admin/student/instructor pages
   ═══════════════════════════════════════════════════════════ */

/* ── Safe area (notched phones) ── */
.main-content { padding-bottom: env(safe-area-inset-bottom, 16px); }

/* ── Fluid typography ── */
.card-title { font-size: clamp(0.8rem, 2vw, 1rem); }
h1, h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }

/* ── Tables ── */
.table-wrap, .student-table-wrap, .pay-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 500px; }
th, td { white-space: nowrap; }
td .btn-sm { white-space: nowrap; }

/* ── Stats grids ── */
.stats-row { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; }

/* ── 1024px ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .layout { grid-template-columns: var(--sidebar-w) 1fr !important; }
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .cert-canvas { max-width: 100%; transform: scale(0.9); transform-origin: top center; }
  /* modal */
  .mb.wide { max-width: 98vw; padding: 20px; }
  .mb.wide > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  #modal-cert-canvas { display: none; }
}

/* ── 768px ── */
@media (max-width: 768px) {
  /* Sidebar collapses */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
    transform: translateX(-100%); transition: transform 0.3s;
    width: 260px !important; box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .layout { grid-template-columns: 1fr !important; }
  .main-content { padding: 16px !important; }
  .topbar { padding: 0 16px; }
  /* Hamburger for portal */
  .portal-hamburger { display: flex !important; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 299; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  /* Stats */
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-card { padding: 14px 12px !important; }
  .stat-val  { font-size: 1.4rem !important; }
  /* Tables overflow */
  .student-table-wrap, .pay-table-wrap { border-radius: 8px; }
  /* Cards */
  .card { padding: 14px !important; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  /* Forms */
  .r2, .r3 { grid-template-columns: 1fr !important; }
  /* Login */
  .login-wrapper, .wrap { max-width: 100% !important; padding: 0 !important; }
  .panel { padding: 24px 18px !important; border-radius: 14px !important; }
  /* Bio */
  .bio-mode-grid { gap: 6px !important; }
}

/* ── 600px ── */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr !important; }
  .nav-section-label { font-size: 0.58rem; }
  .nav-item { padding: 9px 14px !important; font-size: 0.78rem !important; }
  .topbar h1, .page-title { font-size: 1rem !important; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn-sm { padding: 6px 10px; font-size: 0.7rem; }
  /* Tables: show fewer columns on mobile */
  .student-table th:nth-child(4),
  .student-table td:nth-child(4),
  .student-table th:nth-child(5),
  .student-table td:nth-child(5) { display: none; }
}

/* ── 480px ── */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .stat-card { padding: 12px 10px !important; }
  .stat-val  { font-size: 1.2rem !important; }
  .stat-label { font-size: 0.62rem !important; }
  .brand-name { font-size: 0.82rem !important; }
  /* Page tabs */
  .page-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ptab { white-space: nowrap; flex-shrink: 0; padding: 9px 14px; font-size: 0.68rem; }
  /* Forms */
  .fg label { font-size: 0.6rem; }
  .fg input, .fg select, .fg textarea { font-size: 16px !important; padding: 11px 12px !important; }
  /* Modal */
  .mo { align-items: flex-end; }
  .mb { border-radius: 16px 16px 0 0 !important; max-height: 90vh; overflow-y: auto; }
}

/* ── Touch targets ── */
@media (hover: none) and (pointer: coarse) {
  .btn, button { min-height: 42px; }
  input, select, textarea { font-size: 16px !important; }
  .nav-item { min-height: 44px; display: flex; align-items: center; }
  .ptab { min-height: 40px; display: flex; align-items: center; }
}

/* ── Print ── */
@media print {
  .sidebar, .topbar, #ssa-sync-bar, .notification { display: none !important; }
  .layout { display: block !important; }
  .main-content { padding: 0 !important; }
}

/* ── Sidebar hamburger (hidden by default) ── */
.portal-hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 8px;
}
.portal-hamburger span {
  width: 22px; height: 2px; background: var(--muted); border-radius: 2px; transition: all 0.2s;
}
.sidebar-overlay { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   PORTAL — Comprehensive responsive system
   All admin/instructor/student portal pages: 320px → 4K
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; min-width: 320px; }
img, video { max-width: 100%; height: auto; }
table { width: 100%; }

/* ── All tables scroll horizontally ──────────────────────────────────────── */
.table-wrap, .student-table-wrap, .pay-table-wrap,
div[style*="overflow-x:auto"], div[style*="overflow-x: auto"] { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

/* ── Cards never overflow ────────────────────────────────────────────────── */
.card { width: 100%; max-width: 100%; overflow: hidden; }

/* ── Modals responsive ───────────────────────────────────────────────────── */
.mo { padding: 16px; align-items: flex-start; }
.mb { width: 100%; max-width: min(880px, calc(100vw - 32px)); }
.mb.wide { max-width: min(1120px, calc(100vw - 32px)); }
.mb.slim { max-width: min(580px, calc(100vw - 32px)); }

/* ════════════════════ 1280px ═══════════════════════════════════════════════ */
@media (min-width: 1400px) {
  :root { --sidebar-w: 280px; }
  .main-content { padding: 32px 40px; }
}

/* ════════════════════ 1100px ═══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .exam-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .lec-grid  { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ════════════════════ 1024px — Tablet landscape ════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .exam-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .r2, .r3, .r4 { grid-template-columns: 1fr 1fr !important; }
  .exam-layout { grid-template-columns: 1fr !important; }
  .mb.wide > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ════════════════════ 768px — Tablet portrait ══════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar slides in */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
    transform: translateX(-100%); transition: transform 0.3s ease;
    width: 260px !important; box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .layout { grid-template-columns: 1fr !important; }
  .main-content { padding: 16px !important; margin-left: 0 !important; }
  .topbar { padding: 0 16px !important; height: 56px !important; }
  .topbar h1 { font-size: 1rem !important; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .stat-card { padding: 14px 12px !important; }

  /* Grids */
  .exam-grid { grid-template-columns: 1fr !important; }
  .lec-grid  { grid-template-columns: 1fr !important; }
  .r2, .r3   { grid-template-columns: 1fr !important; }

  /* Tables */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; display: block; }

  /* Modals full-width */
  .mb { padding: 24px 16px !important; }
  .mb.wide, .mb.slim { max-width: calc(100vw - 24px) !important; }
  .mo { padding: 12px; }

  /* Cards */
  .card { padding: 14px !important; border-radius: 10px !important; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .card-header .actions { flex-wrap: wrap; }

  /* Forms */
  .fg input, .fg select, .fg textarea { font-size: 16px !important; }

  /* Topbar actions */
  .topbar .actions { gap: 6px; }
  .topbar .actions .btn-sm { padding: 6px 10px !important; font-size: 0.7rem !important; }
  .topbar .actions .btn-outline { display: none; }
}

/* ════════════════════ 600px ════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .topbar .actions .btn-ghost { display: none; }
  .topbar h1 { font-size: 0.9rem !important; }
  .nav-item { padding: 9px 14px !important; font-size: 0.78rem !important; }
  /* Hide less important table columns */
  .hide-mobile { display: none !important; }
}

/* ════════════════════ 480px — Phone ════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .stat-val { font-size: 1.4rem !important; }
  .stat-label { font-size: 0.6rem !important; }

  /* Modal slides up from bottom on phone */
  .mo { align-items: flex-end; padding: 0; }
  .mb {
    border-radius: 16px 16px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 20px 14px !important;
  }

  /* Forms */
  .fg input, .fg select, .fg textarea {
    font-size: 16px !important;
    padding: 11px 12px !important;
  }
  .fg label { font-size: 0.6rem !important; }

  /* Page tabs */
  .page-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
  .ptab { white-space: nowrap; flex-shrink: 0; padding: 9px 12px !important; font-size: 0.66rem !important; }

  /* Topbar */
  .topbar { flex-wrap: wrap; height: auto !important; padding: 10px 14px !important; gap: 8px; }
  .topbar .actions .btn { padding: 6px 10px !important; font-size: 0.68rem !important; }
}

/* ════════════════════ 360px — Small phone ══════════════════════════════════ */
@media (max-width: 360px) {
  .stats-row { grid-template-columns: 1fr !important; }
  .stat-card { padding: 12px 10px !important; }
  .mb { padding: 16px 12px !important; }
}

/* ════════════════════ Touch targets ════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .btn, button { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; min-height: 44px; }
  .nav-item { min-height: 48px; display: flex; align-items: center; }
  .ptab { min-height: 44px; }
  /* Remove hover transforms on touch */
  .exam-card:hover, .card:hover { transform: none !important; }
}

/* ════════════════════ Landscape phone ══════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar { height: 100dvh; overflow-y: auto; }
  .mb { max-height: 80vh !important; overflow-y: auto; }
}

/* ════════════════════ Wide desktop ═════════════════════════════════════════ */
@media (min-width: 1400px) {
  .stats-row { grid-template-columns: repeat(4, 1fr) !important; }
  .exam-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .main-content { padding: 36px 48px !important; }
}
