/* ============================================================
   SIPKIPK — Sistem Informasi Seleksi Beasiswa KIP-K
   Perbanas Institute | Complete Design System
   ============================================================ */

/* ─── CUSTOM FONTS FALLBACK ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800;900&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  /* Brand Colors */
  --primary:       #0b4c8c; /* Perbanas Blue */
  --primary-dark:  #083a6b;
  --primary-light: #1e40af;
  --gold:          #00984a; /* Perbanas Green */
  --gold-dark:     #007639;
  --gold-light:    #10b981;

  /* Backgrounds */
  --bg:            #f3f4f6; /* Light gray background */
  --bg-2:          #ffffff; /* White background for cards/topbar/sidebar/modals */
  --surface:       #ffffff; /* Card backgrounds */
  --surface-2:     #f1f5f9; /* Form inputs, inactive tabs background */
  --surface-hover: #e2e8f0;

  /* Borders */
  --border:        #e2e8f0;
  --border-2:      #cbd5e1;

  /* Text */
  --text:          #0f172a; /* Slate 900 */
  --text-2:        #475569; /* Slate 600 */
  --text-3:        #94a3b8; /* Slate 400 */

  /* Semantic */
  --success:       #10b981;
  --success-bg:    #ecfdf5;
  --warning:       #f59e0b;
  --warning-bg:    #fffbeb;
  --danger:        #ef4444;
  --danger-bg:     #fef2f2;
  --info:          #3b82f6;
  --info-bg:       #eff6ff;

  /* Typography */
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    18px;
  --radius-xl:    24px;

  /* Shadows */
  --shadow:       0 4px 20px rgba(11, 76, 140, 0.05), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg:    0 12px 36px rgba(11, 76, 140, 0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-red:   0 8px 32px rgba(11, 76, 140, 0.15);
  --shadow-gold:  0 8px 32px rgba(0, 152, 74, 0.12);

  /* Sidebar */
  --sidebar-w:    260px;

  /* Transitions */
  --t:            0.22s ease;
  --t-fast:       0.12s ease;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-body); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  animation: fadeInScreen 0.5s ease;
}
.loading-content { text-align: center; }
.loading-logos-row {
  display: flex; justify-content: center; align-items: center;
  gap: 16px; margin: 0 auto 24px;
}
.loading-logo-box {
  background: #ffffff; padding: 6px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  height: 54px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.loading-logo-box img {
  height: 40px; width: auto; object-fit: contain;
}
.loading-title {
  font-family: var(--font-head); font-size: 28px; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px; margin-bottom: 6px;
}
.loading-sub { font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.loading-inst { font-size: 11px; color: var(--text-3); margin-bottom: 28px; letter-spacing: 1px; text-transform: uppercase; }
.loading-bar-wrap { width: 200px; height: 3px; background: var(--surface-2); border-radius: 99px; margin: 0 auto; overflow: hidden; }
.loading-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 99px; animation: loadingBar 1.8s ease-in-out infinite; }

/* ============================================================
   AUTH PAGES (Login / Register / Verify)
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  position: relative; overflow: hidden;
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } }

/* Left branding panel */
.auth-brand {
  background: linear-gradient(160deg, #0b4c8c 0%, #083a6b 60%, #00984a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px; position: relative; overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  top: -100px; right: -100px; pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  bottom: -50px; left: -50px; pointer-events: none;
}
.brand-logo-row {
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 24px; position: relative; z-index: 1;
}
.brand-logo-box {
  background: #ffffff; padding: 6px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  height: 50px; box-shadow: var(--shadow);
}
.brand-logo-box img {
  height: 36px; width: auto; object-fit: contain;
}
.brand-tagline {
  font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 10px; position: relative; z-index: 1;
}
.brand-title {
  font-family: var(--font-head); font-size: 38px; font-weight: 900; color: #fff;
  line-height: 1.15; text-align: center; margin-bottom: 16px; position: relative; z-index: 1;
}
.brand-title span { display: block; color: var(--gold); }
.brand-desc { font-size: 14px; color: rgba(255,255,255,0.65); text-align: center; max-width: 320px; line-height: 1.7; position: relative; z-index: 1; margin-bottom: 32px; }
.brand-features { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; position: relative; z-index: 1; }
.brand-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09);
}
.brand-feature .feat-icon { font-size: 20px; flex-shrink: 0; }
.brand-feature p { font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 500; }

/* Right form panel */
.auth-form-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px; background: var(--bg-2);
  overflow-y: auto;
}
@media (max-width: 900px) { .auth-brand { display: none; } }

.auth-form-card {
  width: 100%; max-width: 460px;
  animation: slideUp 0.4s ease;
}
.auth-form-header { margin-bottom: 28px; }
.auth-form-header h2 {
  font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.auth-form-header p { font-size: 14px; color: var(--text-2); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-group label .req { color: var(--primary); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-weight: 400;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(11,76,140,0.15);
}
.form-input::placeholder { color: var(--text-3); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-2); color: var(--text); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-input.error, .form-select.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* Input with icon */
.input-wrap { position: relative; }
.input-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--text-3); pointer-events: none; }
.input-wrap .form-input { padding-left: 40px; }
.input-wrap .input-eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-3); font-size: 16px; background: none; border: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--t); border: none; outline: none;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(11,76,140,0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(11,76,140,0.35); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(0, 152, 74, 0.25);
}
.btn-gold:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0, 152, 74, 0.35); }

.btn-secondary {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-2); }

.btn-danger {
  background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

.btn-success {
  background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.25);
}
.btn-success:hover:not(:disabled) { background: rgba(34,197,94,0.2); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.spinner-sm {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--surface-2);  color: var(--text-2); }
.badge-gold    { background: rgba(245,166,35,0.15); color: var(--gold); }

/* ============================================================
   LAYOUT — MAIN APP (Student)
   ============================================================ */
.app-layout {
  display: flex; flex-direction: column; min-height: 100vh;
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo {
  width: 38px; height: 38px; border-radius: 8px;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  border: 1px solid var(--border);
}
.topbar-logo-img {
  width: 100%; height: 100%; object-fit: contain;
}
.topbar-name { font-weight: 800; font-size: 16px; color: var(--text); }
.topbar-name small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }

.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all var(--t); cursor: pointer; background: none; border: none;
}
.topbar-nav-link:hover { background: var(--surface); color: var(--text); }
.topbar-nav-link.active { background: rgba(11,76,140,0.08); color: var(--primary); }
.topbar-nav-link .nav-icon { font-size: 16px; }

.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.topbar-user-info { line-height: 1.3; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar-user-role { font-size: 11px; color: var(--text-3); }
.topbar-logout { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--danger); background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.2); cursor: pointer; transition: all var(--t); }
.topbar-logout:hover { background: rgba(239,68,68,0.2); }

/* Page Content */
.page-content { flex: 1; padding: 32px 28px; max-width: 1200px; margin: 0 auto; width: 100%; }
.page-header { margin-bottom: 28px; }
.page-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-2); }

/* ============================================================
   LAYOUT — ADMIN (Sidebar)
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-2); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 200; overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.sidebar-logo-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
}
.sidebar-logo-img {
  width: 100%; height: 100%; object-fit: contain;
}
.sidebar-logo-text h3 { font-size: 15px; font-weight: 800; color: var(--text); }
.sidebar-logo-text p  { font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; }
.sidebar-admin-card {
  background: rgba(11,76,140,0.05); border: 1px solid rgba(11,76,140,0.12);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-admin-info p { font-size: 12px; font-weight: 600; color: var(--text); }
.sidebar-admin-info small { font-size: 11px; color: var(--gold); }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-section { margin-bottom: 20px; }
.sidebar-section-label { font-size: 10px; font-weight: 700; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; padding: 0 8px; margin-bottom: 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all var(--t); cursor: pointer; background: none; border: none; width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-link.active { background: rgba(11,76,140,0.08); color: var(--primary); font-weight: 600; }
.sidebar-link .s-icon { font-size: 17px; flex-shrink: 0; }
.sidebar-link .s-badge { margin-left: auto; font-size: 11px; background: var(--gold); color: #fff; padding: 1px 7px; border-radius: 99px; }

.sidebar-footer { padding: 12px 12px 20px; border-top: 1px solid var(--border); }
.sidebar-logout { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--danger); background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.15); cursor: pointer; transition: all var(--t); width: 100%; }
.sidebar-logout:hover { background: rgba(239,68,68,0.2); }

.admin-main { margin-left: var(--sidebar-w); flex: 1; padding: 32px 32px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-topbar h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.admin-topbar p { font-size: 14px; color: var(--text-2); margin-top: 2px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  backdrop-filter: blur(8px);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title .ct-icon { font-size: 18px; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: all var(--t); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:hover::before { opacity: 1; }
.stat-card.red   { border-color: rgba(11,76,140,0.15); }
.stat-card.red::before { background: radial-gradient(ellipse at top left, rgba(11,76,140,0.05), transparent 60%); }
.stat-card.gold  { border-color: rgba(0,152,74,0.15); }
.stat-card.gold::before { background: radial-gradient(ellipse at top left, rgba(0,152,74,0.05), transparent 60%); }
.stat-card.green { border-color: rgba(34,197,94,0.15); }
.stat-card.green::before { background: radial-gradient(ellipse at top left, rgba(34,197,94,0.05), transparent 60%); }
.stat-card.blue  { border-color: rgba(59,130,246,0.15); }
.stat-card.blue::before { background: radial-gradient(ellipse at top left, rgba(59,130,246,0.05), transparent 60%); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  position: relative; z-index: 1;
}
.stat-card.red   .stat-icon { background: rgba(11,76,140,0.08); color: var(--primary); }
.stat-card.gold  .stat-icon { background: rgba(0,152,74,0.08); color: var(--gold); }
.stat-card.green .stat-icon { background: rgba(34,197,94,0.08); color: var(--success); }
.stat-card.blue  .stat-icon { background: rgba(59,130,246,0.08); color: var(--info); }

.stat-info { position: relative; z-index: 1; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-2); }
thead th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
tbody tr { border-top: 1px solid var(--border); transition: background var(--t); }
tbody tr:hover { background: var(--surface-hover); }
tbody td { padding: 13px 16px; font-size: 14px; color: var(--text); vertical-align: middle; }
tbody td.muted { color: var(--text-2); font-size: 13px; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.18s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 28px;
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; position: relative;
  animation: slideUp 0.22s ease; box-shadow: var(--shadow-lg);
}
.modal-close-btn {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t); cursor: pointer; border: none;
}
.modal-close-btn:hover { background: var(--surface-hover); color: var(--text); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg); min-width: 280px; max-width: 380px;
  animation: toastIn 0.3s ease; pointer-events: all;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.45; }
.toast.success { border-color: rgba(34,197,94,0.35); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   { border-color: rgba(239,68,68,0.35); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning { border-color: rgba(245,158,11,0.35); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    { border-color: rgba(59,130,246,0.35); }
.toast.info    .toast-icon { color: var(--info); }

/* ============================================================
   PROGRESS INDICATOR (profile steps)
   ============================================================ */
.steps-wrap { display: flex; align-items: center; margin-bottom: 28px; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; top: 16px; left: 50%; width: 100%;
  height: 2px; background: var(--border-2); z-index: 0;
}
.step-item.done:not(:last-child)::after { background: var(--primary); }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-2);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-3); z-index: 1; transition: all var(--t);
}
.step-item.active .step-dot { border-color: var(--primary); background: rgba(11,76,140,0.08); color: var(--primary); }
.step-item.done .step-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-label { font-size: 11px; color: var(--text-3); margin-top: 6px; font-weight: 500; text-align: center; }
.step-item.active .step-label { color: var(--primary); }
.step-item.done .step-label { color: var(--primary); }

/* ============================================================
   CBT EXAM
   ============================================================ */
.cbt-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cbt-layout { grid-template-columns: 1fr; } }

.cbt-main-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px;
}
.cbt-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: gap 12px; }
.cbt-q-counter { font-size: 13px; color: var(--text-2); }
.cbt-q-counter strong { color: var(--text); font-size: 15px; }
.cbt-category { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 11px; font-weight: 600; background: rgba(11,76,140,0.08); color: var(--primary); }

.cbt-timer-card {
  background: linear-gradient(135deg, #0b4c8c, #083a6b);
  border: 1px solid rgba(11,76,140,0.15); border-radius: var(--radius-lg); padding: 20px;
  text-align: center; margin-bottom: 16px; box-shadow: var(--shadow-red);
}
.cbt-timer-label { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.cbt-timer {
  font-size: 36px; font-weight: 900; font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #fff, #e0f2fe);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.cbt-timer.warning { -webkit-text-fill-color: var(--warning); }
.cbt-timer.danger  { -webkit-text-fill-color: var(--danger); animation: pulse 0.8s ease infinite; }
.cbt-timer-desc { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px; }

.cbt-question { margin-bottom: 24px; }
.cbt-q-text { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.6; margin-bottom: 20px; }
.cbt-options { display: flex; flex-direction: column; gap: 10px; }
.cbt-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface);
  transition: all var(--t); user-select: none;
}
.cbt-option:hover { border-color: rgba(11,76,140,0.3); background: rgba(11,76,140,0.03); }
.cbt-option.selected { border-color: var(--primary); background: rgba(11,76,140,0.06); }
.cbt-option-key {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text-2); transition: all var(--t);
}
.cbt-option.selected .cbt-option-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.cbt-option-text { font-size: 14px; color: var(--text); flex: 1; line-height: 1.5; }

/* CBT Navigation dots */
.cbt-nav-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px;
  position: sticky; top: 84px;
}
.cbt-nav-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.cbt-dots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cbt-dot {
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: all var(--t-fast);
}
.cbt-dot:hover { border-color: var(--border-2); color: var(--text); }
.cbt-dot.answered { background: rgba(11,76,140,0.08); border-color: rgba(11,76,140,0.25); color: var(--primary); }
.cbt-dot.current  { background: var(--primary); border-color: var(--primary); color: #fff; }

.cbt-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; margin-bottom: 16px; }
.cbt-legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-dot.answered { background: rgba(11,76,140,0.4); }
.legend-dot.unanswered { background: var(--surface-2); border: 1px solid var(--border); }
.legend-dot.current { background: var(--primary); }

.cbt-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.cbt-progress-bar { height: 4px; background: var(--surface-2); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.cbt-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 99px; transition: width 0.3s ease; }

/* ============================================================
   ANNOUNCEMENT
   ============================================================ */
.announce-card {
  border-radius: var(--radius-xl); padding: 40px; text-align: center; max-width: 600px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.announce-card.passed {
  background: linear-gradient(160deg, rgba(16,185,129,0.08), rgba(255,255,255,0.6));
  border: 1px solid rgba(16,185,129,0.25);
}
.announce-card.failed {
  background: linear-gradient(160deg, rgba(239,68,68,0.08), rgba(255,255,255,0.6));
  border: 1px solid rgba(239,68,68,0.25);
}
.announce-card.pending {
  background: var(--surface); border: 1px solid var(--border);
}
.announce-icon { font-size: 72px; margin-bottom: 20px; display: block; }
.announce-title { font-family: var(--font-head); font-size: 32px; font-weight: 900; margin-bottom: 10px; }
.announce-card.passed .announce-title { color: var(--success); }
.announce-card.failed .announce-title { color: var(--danger); }
.announce-card.pending .announce-title { color: var(--text-2); }
.announce-subtitle { font-size: 15px; color: var(--text-2); margin-bottom: 24px; line-height: 1.7; }
.announce-info-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.announce-info-item { text-align: center; padding: 16px 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.announce-info-item .info-val { font-size: 24px; font-weight: 800; color: var(--text); }
.announce-info-item .info-lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ============================================================
   CERTIFICATE PREVIEW
   ============================================================ */
.cert-preview {
  background: #ffffff;
  border: 2px solid var(--primary); border-radius: var(--radius-xl);
  padding: 40px; text-align: center; max-width: 680px; margin: 0 auto 28px;
  box-shadow: var(--shadow-lg); position: relative;
}
.cert-preview::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid rgba(11,76,140,0.2); border-radius: calc(var(--radius-xl) - 4px);
  pointer-events: none;
}
.cert-header { margin-bottom: 24px; }
.cert-header h2 { font-family: var(--font-head); font-size: 28px; font-weight: 900; color: var(--primary); }
.cert-header p { font-size: 12px; color: var(--text-2); letter-spacing: 2px; text-transform: uppercase; }
.cert-divider { height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); margin: 16px 0; }
.cert-body { margin-bottom: 24px; }
.cert-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.cert-name { font-family: var(--font-head); font-size: 32px; font-weight: 900; color: var(--text); margin-bottom: 16px; }
.cert-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.cert-info-item { text-align: center; padding: 14px; background: var(--surface-2); border: 1px solid rgba(11,76,140,0.15); border-radius: var(--radius-sm); }
.cert-info-val { font-size: 20px; font-weight: 800; color: var(--primary); }
.cert-info-lbl { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cert-footer { font-size: 12px; color: var(--text-3); }

/* ============================================================
   VERIFY EMAIL PAGE
   ============================================================ */
.verify-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.verify-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 48px 40px; text-align: center;
  max-width: 480px; width: 100%; animation: slideUp 0.4s ease;
}
.verify-icon { font-size: 64px; margin-bottom: 20px; display: block; }
.verify-title { font-family: var(--font-head); font-size: 28px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.verify-desc { font-size: 14px; color: var(--text-2); margin-bottom: 24px; line-height: 1.7; }
.verify-link-box {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 14px; margin-bottom: 20px;
  word-break: break-all; font-size: 13px; color: var(--primary); text-align: left;
  cursor: pointer;
}

/* ============================================================
   PROFILE FORM
   ============================================================ */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 20px;
}
.profile-section-title {
  font-size: 14px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer; transition: all var(--t);
  background: var(--surface);
}
.upload-area:hover { border-color: var(--primary); background: rgba(11,76,140,0.03); }
.upload-area.has-file { border-color: var(--success); background: var(--success-bg); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area p { font-size: 14px; color: var(--text-2); }
.upload-area small { font-size: 12px; color: var(--text-3); }
.upload-area input[type="file"] { display: none; }

/* Dashboard info card (student) */
.info-card {
  background: linear-gradient(135deg, rgba(11,76,140,0.08), rgba(255,255,255,0.8));
  border: 1px solid rgba(11,76,140,0.15); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 20px;
}
.info-card-icon { font-size: 40px; flex-shrink: 0; }
.info-card h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.info-card p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* Timeline (dashboard status) */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding: 12px 0; position: relative; }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 44px; bottom: 0; width: 2px; background: var(--border); }
.timeline-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; border: 2px solid var(--border); background: var(--surface); transition: all var(--t); }
.timeline-item.done .timeline-dot { border-color: var(--success); background: var(--success); color: #fff; }
.timeline-item.active .timeline-dot { border-color: var(--primary); background: rgba(11,76,140,0.08); color: var(--primary); animation: pulse 2s ease infinite; }
.timeline-item.locked .timeline-dot { opacity: 0.5; }
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.timeline-desc { font-size: 12px; color: var(--text-2); }
.timeline-item.locked .timeline-title,
.timeline-item.locked .timeline-desc { opacity: 0.5; }

/* Admin — question form */
.q-option-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-option-label { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.q-option-row .form-input { flex: 1; }

/* Answer review */
.review-q { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.review-q-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.review-answers { display: flex; flex-direction: column; gap: 6px; }
.review-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.review-opt.correct { background: var(--success-bg); border: 1px solid rgba(34,197,94,0.25); color: var(--success); }
.review-opt.student-wrong { background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }
.review-opt.neutral { background: var(--surface); color: var(--text-2); }

/* Score circle */
.score-circle {
  width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 3px solid var(--primary); background: rgba(11,76,140,0.05);
}
.score-circle .sc-val { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1; }
.score-circle .sc-lbl { font-size: 11px; color: var(--text-2); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: 14px; color: var(--text-3); }

/* Alert boxes */
.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: -1px; }
.alert.alert-info    { background: var(--info-bg);    border: 1px solid rgba(59,130,246,0.25); color: var(--info); }
.alert.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.25); color: var(--warning); }
.alert.alert-success { background: var(--success-bg); border: 1px solid rgba(34,197,94,0.25); color: var(--success); }
.alert.alert-danger  { background: var(--danger-bg);  border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* Search bar */
.search-bar { position: relative; }
.search-bar .form-input { padding-left: 36px; }
.search-bar::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; z-index: 1; }

/* Tab bar */
.tab-bar { display: flex; gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; border: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 8px 14px; border-radius: calc(var(--radius) - 4px); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all var(--t); background: none; border: none; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(11,76,140,0.25); }

/* Grade input */
.grade-override { display: flex; align-items: center; gap: 8px; }
.grade-override .form-input { width: 80px; text-align: center; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loadingBar { 0% { width: 0; transform: translateX(-100%); } 50% { width: 60%; } 100% { width: 100%; transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInScreen { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); max-height: 0; padding: 0; margin: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Input shake on error */
.shake { animation: shake 0.35s ease; }

/* Page animation */
.page-animate { animation: slideUp 0.35s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .page-content { padding: 20px 16px; }
  .admin-main { margin-left: 0; padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .topbar-nav { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .cbt-layout { grid-template-columns: 1fr; }
  .cert-info-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .announce-info-row { flex-direction: column; align-items: center; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   EPIC ANNOUNCEMENT VIDEO OVERLAY
   ============================================================ */
.video-overlay {
  position: fixed; inset: 0;
  background: #000000; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.8s ease;
  overflow: hidden; color: #ffffff;
}
.video-overlay.fade-out {
  opacity: 0; pointer-events: none;
}
.entrance-gate {
  text-align: center; z-index: 2;
  animation: fadeInScreen 1s ease;
  padding: 24px;
}
.entrance-title {
  font-family: var(--font-head); font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px; margin-bottom: 8px;
}
.entrance-subtitle {
  font-size: 14px; color: var(--text-3);
  margin-bottom: 36px; max-width: 420px; line-height: 1.6;
}
.btn-entrance {
  background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
  color: #ffffff; border: none; padding: 16px 36px;
  font-size: 16px; font-weight: 700; border-radius: 99px;
  cursor: pointer; box-shadow: 0 0 24px rgba(11, 76, 140, 0.4);
  transition: all 0.3s ease; animation: pulse-glow 2s infinite;
}
.btn-entrance:hover {
  transform: scale(1.05);
  box-shadow: 0 0 32px rgba(11, 76, 140, 0.6), 0 0 16px rgba(0, 152, 74, 0.4);
}
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(11, 76, 140, 0.5); }
  70% { box-shadow: 0 0 0 20px rgba(11, 76, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 76, 140, 0); }
}
.video-wrapper {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: none; background: #000000;
}
.video-player {
  width: 100%; height: 100%; object-fit: cover;
}
.btn-skip-video {
  position: absolute; top: 24px; right: 24px;
  background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px);
  color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px; font-size: 13px; font-weight: 600;
  border-radius: 99px; cursor: pointer; z-index: 10;
  transition: all 0.2s ease;
}
.btn-skip-video:hover {
  background: rgba(255, 255, 255, 0.35); transform: translateY(-1px);
}
