/* ============================================================
   9b. KARTU PORTAL GURU & SISWA (SERAGAM DENGAN KARTU ADMIN)
   Kelas *-saas yang dipakai portal guru/siswa dan leaderboard.
   Mengikuti gaya .badge, .link-badge, dan .avatar-saas milik admin.
   ============================================================ */

/* --- Avatar berwarna --- */
.avatar-saas-primary { background: var(--primary-light); color: var(--primary); }
.avatar-saas-info    { background: var(--info-light);    color: var(--info); }
.avatar-saas-success { background: var(--success-light); color: var(--success); }
.avatar-saas-warning { background: var(--warning-light); color: #d97706; }
.avatar-saas-danger  { background: var(--danger-light);  color: var(--danger); }

/* --- Teks kartu --- */
.card-title-saas { margin: 0 0 4px 0; font-size: 15px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.card-subtitle-saas { margin: 0; font-size: 12px; color: var(--text-muted); }
.card-subtitle-saas strong { color: #475569; }
.text-price { font-size: 14px !important; font-weight: 800; color: var(--text-main) !important; }
.text-highlight { color: var(--primary) !important; font-weight: 600; }
.text-success { color: var(--success) !important; }
.card-meta-saas { margin-top: 14px; font-size: 12px; color: #475569; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.card-meta-saas strong { color: var(--text-main); }
.card-tags-saas { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-actions-saas { display: flex; align-items: center; gap: 8px; }
.mr-1 { margin-right: 4px; }

/* --- Badge (sama dengan .badge admin) --- */
.badge-saas { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.badge-saas-neutral { background: var(--primary-light); color: var(--primary-hover); }
.badge-saas-success { background: #dcfce7; color: #10b981; }
.badge-saas-warning { background: #fef3c7; color: #d97706; }
.badge-saas-danger  { background: #fee2e2; color: #ef4444; }

/* --- Tombol kartu (sama dengan .link-badge / tombol di kartu admin) --- */
.btn-saas { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-family: inherit; transition: all 0.2s ease; }
.btn-saas:hover { transform: translateY(-1px); }
.btn-saas-link { background: #e0e7ff; color: #4338ca !important; border-color: #c7d2fe; }
.btn-saas-link:hover { background: #c7d2fe; }
.btn-saas-primary-sm { background: var(--primary) !important; color: #fff !important; }
.btn-saas-primary-sm:hover { background: var(--primary-hover) !important; }
.btn-saas-success-sm { background: var(--success) !important; color: #fff !important; }
.btn-saas-success-sm:hover { background: #059669 !important; }

/* --- Leaderboard --- */
.leaderboard-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 14px; background: #fff; margin-bottom: 10px; }
.lb-user-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-nama { font-size: 14px; font-weight: 700; color: var(--text-main); text-transform: capitalize; }
.lb-sub { font-size: 12px; color: var(--text-muted); }
.lb-score { font-size: 18px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.lb-score span { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.rank-badge { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; flex-shrink: 0; background: #f1f5f9; color: #64748b; }
.rank-1 { background: #fef3c7; }
.rank-2 { background: #e2e8f0; }
.rank-3 { background: #ffedd5; }

/* --- Panel jadwal di dashboard admin --- */
.jadwal-time { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.jadwal-title { font-size: 13px; font-weight: 600; color: var(--text-main); }

/* --- Skeleton (bagian kartu) --- */
.skeleton-header { display: flex; align-items: center; gap: 14px; }
.skeleton-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* --- Badge promo di landing page --- */
.promo-badge-inline { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 50px; font-size: 12px; font-weight: 700; background: rgba(var(--primary-rgb), 0.12); color: var(--primary); border: 1px solid rgba(var(--primary-rgb), 0.25); margin-bottom: 14px; }
.promo-badge-inline.gold { background: #fef3c7; color: #b45309; border-color: #fcd34d; }

/* --- Mode gelap --- */
body.dark-mode .card-subtitle-saas strong, body.dark-mode .card-meta-saas { color: #cbd5e1; }
body.dark-mode .card-meta-saas strong, body.dark-mode .card-title-saas, body.dark-mode .text-price, body.dark-mode .lb-nama, body.dark-mode .jadwal-title { color: #f1f5f9 !important; }
body.dark-mode .badge-saas-neutral { background: var(--primary-deep); color: var(--primary-soft2); }
body.dark-mode .badge-saas-success { background: #064e3b; color: #6ee7b7; }
body.dark-mode .badge-saas-warning { background: #78350f; color: #fcd34d; }
body.dark-mode .badge-saas-danger  { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .btn-saas-link { background: #312e81; color: #c7d2fe !important; border-color: #4338ca; }
body.dark-mode .avatar-saas-primary, body.dark-mode .avatar-saas-info, body.dark-mode .avatar-saas-success, body.dark-mode .avatar-saas-warning, body.dark-mode .avatar-saas-danger { background: #334155; }
body.dark-mode .leaderboard-item { background: #1e293b; border-color: #334155; }
body.dark-mode .rank-badge { background: #334155; color: #cbd5e1; }
body.dark-mode .rank-1 { background: #78350f; } body.dark-mode .rank-2 { background: #475569; } body.dark-mode .rank-3 { background: #7c2d12; }
body.dark-mode .promo-badge-inline.gold { background: #78350f; color: #fcd34d; border-color: #92400e; }

/* Teks & kotak inline di panel dashboard agar terbaca di mode gelap */
body.dark-mode .info-panel [style*="color: #1e293b"], body.dark-mode .info-panel [style*="color: #0f172a"], body.dark-mode .info-panel [style*="color: var(--primary-deep)"] { color: #f1f5f9 !important; }
body.dark-mode .info-panel [style*="background: #f8fafc"] { background: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .info-panel [style*="color: #64748b"] { color: #94a3b8 !important; }
/* --- Pembahasan ujian & hasil tryout --- */
.bahas-ringkas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bahas-item { border: 1px solid var(--border-color); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.bahas-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.4px; }
.bahas-teks { font-size: 14px; font-weight: 600; color: var(--text-main); line-height: 1.6; margin-bottom: 10px; }
.bahas-opsi { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 6px; font-size: 13px; color: #334155; align-items: flex-start; }
.bahas-opsi.benar { border-color: #10b981; background: #ecfdf5; }
.bahas-opsi.salah { border-color: #ef4444; background: #fef2f2; }
.bahas-tag { font-size: 11px; font-weight: 800; white-space: nowrap; }
.bahas-note { margin-top: 10px; padding: 10px 12px; background: var(--primary-light); border: 1px solid var(--primary-soft2); border-radius: 10px; font-size: 12.5px; color: var(--primary-deep); line-height: 1.55; }
.hasil-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.hasil-row .nm { font-weight: 700; font-size: 13px; color: var(--text-main); }
.hasil-row .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
body.dark-mode .bahas-item, body.dark-mode .hasil-row { background: #1e293b; border-color: #334155; }
body.dark-mode .bahas-teks, body.dark-mode .hasil-row .nm { color: #f1f5f9; }
body.dark-mode .bahas-opsi { border-color: #334155; color: #cbd5e1; }
body.dark-mode .bahas-opsi.benar { background: #064e3b; border-color: #059669; }
body.dark-mode .bahas-opsi.salah { background: #7f1d1d; border-color: #b91c1c; }
body.dark-mode .bahas-note { background: var(--primary-deep); border-color: var(--primary-hover); color: var(--primary-soft); }
/* --- Dashboard siswa & pengumuman --- */
.dash-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; justify-content: flex-start; }
.dash-hero-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.panel-header-flex { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link-plain { width: auto !important; flex: 0 0 auto; background: none !important; border: none; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0 !important; white-space: nowrap; box-shadow: none !important; }
.link-plain:hover { text-decoration: underline; }
#container-leaderboard { display: flex; flex-direction: column; gap: 10px; }
.dash-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid #f1f5f9; }
.dash-item:last-child { border-bottom: none; }
.dash-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.dash-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.dash-ico.blue { background: var(--primary-light); color: var(--primary); }
.dash-ico.amber { background: #fef3c7; color: #d97706; }
.dash-ico.green { background: #ecfdf5; color: #059669; }
.dash-ico.red { background: #fee2e2; color: #ef4444; }
.di-title { font-size: 13px; font-weight: 700; color: var(--text-main); line-height: 1.35; }
.di-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dash-empty { padding: 22px 12px; text-align: center; color: #94a3b8; font-size: 12px; font-weight: 600; list-style: none; }
.btn-dash { width: auto !important; flex: 0 0 auto; margin: 0 !important; padding: 7px 14px; border-radius: 8px; font-size: 11px; font-weight: 700; border: none; cursor: pointer; text-decoration: none; background: var(--primary); color: #fff; white-space: nowrap; display: inline-block; }
.btn-dash:hover { background: var(--primary-hover); }
.btn-dash.soft { background: #e0e7ff; color: #4338ca; }
.btn-dash.soft:hover { background: #c7d2fe; }
.btn-dash.danger { background: #fee2e2; color: #ef4444; }
.pg-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-color); background: #f8fafc; margin-bottom: 10px; }
.pg-item:last-child { margin-bottom: 0; }
.pg-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; margin-bottom: 6px; background: var(--primary-soft); color: var(--primary-hover); }
.pg-item.penting { background: #fffbeb; border-color: #fde68a; }
.pg-item.penting .pg-tag { background: #fef3c7; color: #b45309; }
.pg-judul { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 3px; }
.pg-isi { font-size: 12px; color: #475569; line-height: 1.5; }
.pg-tgl { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
.lb-me { border-color: var(--primary); background: var(--primary-light); }
body.dark-mode .link-plain { color: var(--primary-soft3); }
body.dark-mode .dash-item { border-color: #334155; }
body.dark-mode .dash-ico.blue { background: var(--primary-deep); color: var(--primary-soft2); } body.dark-mode .dash-ico.amber { background: #78350f; color: #fcd34d; }
body.dark-mode .dash-ico.green { background: #064e3b; color: #6ee7b7; } body.dark-mode .dash-ico.red { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .pg-item { background: #0f172a; border-color: #334155; } body.dark-mode .pg-item.penting { background: #451a03; border-color: #92400e; }
body.dark-mode .pg-isi { color: #cbd5e1; } body.dark-mode .pg-judul { color: #f1f5f9; }
body.dark-mode .btn-dash.soft { background: #312e81; color: #c7d2fe; } body.dark-mode .btn-dash.danger { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .lb-me { background: var(--primary-deep); border-color: var(--primary-mid); }
body.dark-mode .di-title { color: #f1f5f9; } body.dark-mode .di-sub { color: #94a3b8; } body.dark-mode .di-sub strong { color: #e2e8f0; }
body.dark-mode .dash-empty { color: #94a3b8; }
body.dark-mode .panel-header { border-bottom-color: #334155; }
.btn-dash { box-shadow: none; }
.hasil-row .nm .badge-saas { margin-left: 8px; }

/* Filter mapel pada panel leaderboard */
.lb-filter { max-width: 150px; padding: 6px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; background: var(--bg-surface, #fff); color: var(--text-main, #0f172a); font-size: 12px; font-weight: 600; cursor: pointer; }
.lb-loading { margin: 0; padding: 18px 4px; font-size: 13px; color: var(--text-muted, #64748b); text-align: center; }
