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

:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --accent: #f59e0b;
  --accent-light: #fcd34d;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26,58,92,0.08);
  --shadow-md: 0 8px 32px rgba(26,58,92,0.14);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ======= AUTH PAGE ======= */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f2240 0%, #1a3a5c 50%, #2563a8 100%);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(245,158,11,0.08);
  top: -200px; right: -100px;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(37,99,168,0.2);
  bottom: -100px; left: -50px;
}
.auth-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative; z-index: 1;
}
.auth-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.auth-brand h1 span { color: var(--accent); }
.auth-brand p { color: rgba(255,255,255,0.65); font-size: 1.05rem; max-width: 380px; }
.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.auth-feat {
  display: flex; align-items: center; gap: 14px;
  color: rgba(255,255,255,0.8);
}
.auth-feat-icon {
  width: 40px; height: 40px;
  background: rgba(245,158,11,0.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.1rem; flex-shrink: 0;
}
.auth-box {
  width: 440px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  position: relative; z-index: 1;
  box-shadow: -20px 0 60px rgba(0,0,0,0.2);
}
.auth-box h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.auth-box p { color: var(--text-muted); margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.form-control {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: #f8fafc;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,168,0.1); background: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d97706; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); background: rgba(26,58,92,0.04); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-info { background: var(--info); color: #fff; }

/* ======= LAYOUT ======= */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .3s;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--primary); font-weight: 800;
}
.sidebar-logo span { font-size: 1.1rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-logo small { display: block; font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 400; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: rgba(255,255,255,0.35);
  padding: 8px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-weight: 500; font-size: 13.5px;
  transition: all .2s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: var(--accent); color: var(--primary); font-weight: 700; }
.nav-item i { width: 18px; text-align: center; font-size: 1rem; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary); font-size: 14px;
}
.sidebar-user-info span { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-info small { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: capitalize; }

/* ======= MAIN CONTENT ======= */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.topbar-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 28px; flex: 1; }

/* ======= CARDS ======= */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 15px;
}
.card-body { padding: 24px; }

/* ======= STAT CARDS ======= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.stat-icon.green { background: rgba(16,185,129,0.12); color: #10b981; }
.stat-icon.yellow { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stat-icon.red { background: rgba(239,68,68,0.12); color: #ef4444; }
.stat-icon.purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ======= TABLE ======= */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #f8fafc; padding: 12px 16px;
  text-align: left; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); border-bottom: 2px solid var(--border);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ======= BADGES ======= */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.badge-primary { background: rgba(26,58,92,0.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-danger { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-info { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.badge-purple { background: rgba(139,92,246,0.12); color: #7c3aed; }

/* ======= ALERT ======= */
.alert {
  padding: 14px 18px; border-radius: 10px;
  margin-bottom: 20px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.alert-danger { background: rgba(239,68,68,0.1); color: #991b1b; border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: rgba(59,130,246,0.1); color: #1e40af; border: 1px solid rgba(59,130,246,0.2); }

/* ======= SEARCH ======= */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: #f1f5f9; border-radius: 10px;
  padding: 0 14px; border: 2px solid transparent;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary-light); background: #fff; }
.search-box i { color: var(--text-muted); }
.search-box input { background: none; border: none; outline: none; padding: 10px 4px; font-family: inherit; font-size: 14px; width: 220px; }

/* ======= BANK SOAL CARDS (Public) ======= */
.soal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.soal-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.soal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.soal-card-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 18px 20px; color: #fff;
}
.soal-card-header h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.soal-card-header small { font-size: 12px; opacity: 0.75; }
.soal-card-body { padding: 18px 20px; }
.soal-links { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.soal-link-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: all .2s; border: 2px solid;
}
.soal-link-kisi { border-color: #dbeafe; background: #eff6ff; color: #1d4ed8; }
.soal-link-kisi:hover { background: #dbeafe; }
.soal-link-soal { border-color: #dcfce7; background: #f0fdf4; color: #15803d; }
.soal-link-soal:hover { background: #dcfce7; }
.soal-link-pedoman { border-color: #fef3c7; background: #fffbeb; color: #b45309; }
.soal-link-pedoman:hover { background: #fef3c7; }

/* ======= HERO (Public) ======= */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 48px 28px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  color: #fff;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute;
  right: -40px; top: -40px;
  width: 250px; height: 250px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.hero h2 { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 8px; }
.hero p { opacity: .8; max-width: 500px; margin-bottom: 24px; }

/* ======= FILTER BAR ======= */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.filter-select {
  padding: 9px 36px 9px 14px;
  border: 2px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 13.5px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none;
  cursor: pointer; outline: none; color: var(--text);
  transition: border-color .2s;
}
.filter-select:focus { border-color: var(--primary-light); }

/* ======= MODAL ======= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 16px;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ======= UTILITIES ======= */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-3 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-13 { font-size: 13px; }
.w-100 { width: 100%; }

/* ======= EMPTY STATE ======= */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .4; display: block; }
.empty-state h4 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }

/* ======= RESPONSIVE ======= */
@media (max-width: 768px) {
  .auth-brand { display: none; }
  .auth-box { width: 100%; padding: 40px 28px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .soal-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ======= NO-SIDEBAR (Public) ======= */
.no-sidebar .main-content { margin-left: 0; }
.public-nav {
  background: var(--primary);
  padding: 0 32px;
  display: flex; align-items: center; gap: 20px;
  height: 64px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.public-nav-brand {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-weight: 700; font-size: 1.05rem;
  flex: 1;
}
.public-nav-brand .logo-icon {
  width: 38px; height: 38px; background: var(--accent);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--primary); font-size: 14px;
}
