/* =====================================================================
   CALLEdA-DigiComm - Theme (Ungu & Pink Gradient)
   ===================================================================== */
:root {
  --primary-purple: #6023B8;
  --secondary-purple: #8B3DCC;
  --light-purple: #C052CF;
  --soft-pink: #F472B6;
  --bg: #F8F5FF;
  --white: #FFFFFF;
  --text-dark: #25143B;
  --gradient: linear-gradient(135deg, #6023B8 0%, #8B3DCC 45%, #F472B6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(96,35,184,.08), rgba(244,114,182,.08));
  --shadow-soft: 0 10px 30px rgba(96, 35, 184, .10);
  --shadow-card: 0 4px 20px rgba(37, 20, 59, .06);
  --sidebar-w: 260px;
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  margin: 0;
}

a { text-decoration: none; }

/* ---------------- Gradient utilities ---------------- */
.bg-gradient-cd { background: var(--gradient); }
.text-gradient-cd {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------- Buttons ---------------- */
.btn-cd {
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .6rem 1.4rem;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 18px rgba(139, 61, 204, .3);
}
.btn-cd:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(139, 61, 204, .4);
}
.btn-cd-outline {
  background: transparent;
  border: 2px solid var(--primary-purple);
  color: var(--primary-purple);
  border-radius: 12px;
  padding: .55rem 1.3rem;
  font-weight: 600;
  transition: all .2s ease;
}
.btn-cd-outline:hover {
  background: var(--primary-purple);
  color: #fff;
}

/* ---------------- Cards ---------------- */
.card-cd {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-cd:hover { box-shadow: var(--shadow-soft); }

.stat-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  background: var(--white);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 5px solid var(--light-purple);
}
.stat-card .stat-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.5rem; color: #fff;
  background: var(--gradient);
  flex: 0 0 auto;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #6b6479; font-size: .85rem; }

/* ---------------- Layout shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--gradient);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 1.25rem 1rem;
  overflow-y: auto;
  transition: transform .3s ease;
  z-index: 1040;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.15rem; color: #fff;
  padding: .3rem .5rem 1.2rem;
}
.sidebar .brand .logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 1.2rem;
}
.sidebar .nav-section {
  text-transform: uppercase;
  font-size: .68rem; letter-spacing: .08em;
  opacity: .7; padding: 1rem .8rem .4rem;
}
.sidebar .nav-link {
  color: rgba(255,255,255,.88);
  border-radius: 11px;
  padding: .65rem .8rem;
  margin-bottom: .15rem;
  display: flex; align-items: center; gap: .7rem;
  font-weight: 500;
  transition: background .2s ease;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }
.sidebar .nav-link i { font-size: 1.1rem; }

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex; flex-direction: column;
}

/* ---------------- Navbar ---------------- */
.topbar {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(37,20,59,.05);
  padding: .75rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1030;
}
.topbar .page-title { font-weight: 700; font-size: 1.15rem; margin: 0; }
.avatar-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem;
}

.content-area { padding: 1.5rem 1.4rem; }

/* ---------------- Progress ---------------- */
.progress-cd { height: 10px; border-radius: 20px; background: #ece6f7; }
.progress-cd .progress-bar { background: var(--gradient); border-radius: 20px; }

/* ---------------- Badges / pills ---------------- */
.badge-cd { background: var(--gradient-soft); color: var(--primary-purple); font-weight: 600; border-radius: 20px; padding: .35em .8em; }

/* ---------------- Tables ---------------- */
.table-cd thead th {
  background: var(--gradient-soft);
  color: var(--primary-purple);
  font-weight: 600;
  border: none;
}
.table-cd td, .table-cd th { vertical-align: middle; }

/* ---------------- Sidebar backdrop (mobile) ---------------- */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(37,20,59,.5);
  z-index: 1035; display: none;
}
.sidebar-backdrop.show { display: block; }

/* ---------------- Responsive ---------------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
}

/* ---------------- Dark mode ---------------- */
body.dark-mode {
  --bg: #17111f;
  --white: #221830;
  --text-dark: #ece6f7;
  --shadow-card: 0 4px 20px rgba(0,0,0,.3);
}
body.dark-mode .topbar { background: var(--white); }
body.dark-mode .table-cd td { color: var(--text-dark); }
body.dark-mode .text-muted { color: #a99fc0 !important; }

/* ---------------- Landing page ---------------- */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 6rem 0 7rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero h1 { font-weight: 800; font-size: 3rem; }
.navbar-landing { background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.feature-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 1rem;
}
.section-pad { padding: 4.5rem 0; }

/* =====================================================================
   Landing v2 - Human-Centered AI (clean, light, bold typography)
   ===================================================================== */
.lp2 {
  --ink: #0f0a1a;
  --muted: #6b6479;
  --line: #ece9f2;
  --surface: #f6f5fb;
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Navbar */
.lp2-nav {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.lp2-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.lp2-nav .nav-link { color: #3a3348 !important; font-weight: 500; font-size: .92rem; }
.lp2-nav .nav-link:hover { color: var(--primary-purple) !important; }
.btn-ink {
  background: #1b1430; color: #fff; border: none; border-radius: 10px;
  padding: .55rem 1.25rem; font-weight: 600; transition: all .2s ease;
}
.btn-ink:hover { background: var(--primary-purple); color: #fff; }
.btn-purple {
  background: var(--secondary-purple); color: #fff; border: none; border-radius: 10px;
  padding: .55rem 1.3rem; font-weight: 600; transition: all .2s ease;
  box-shadow: 0 8px 20px rgba(139,61,204,.3);
}
.btn-purple:hover { color:#fff; transform: translateY(-1px); filter: brightness(1.05); }

/* Hero */
.lp2-hero { background: linear-gradient(180deg,#faf9ff 0%, #ffffff 60%); padding: 4.5rem 0 5rem; }
.lp2-pill {
  display:inline-flex; align-items:center; gap:.4rem;
  background: #efeafc; color: var(--primary-purple);
  font-weight: 600; font-size: .78rem; border-radius: 30px; padding: .45rem 1rem;
}
.lp2-title {
  font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  font-size: clamp(2.6rem, 6vw, 4.4rem); color: var(--ink);
}
.lp2-sub { font-size: 1.25rem; color: #4a4360; font-weight: 500; }
.lp2-lead { color: var(--muted); max-width: 520px; }

/* Hero preview card */
.preview-card {
  background: #fff; border-radius: 22px; padding: 1rem;
  box-shadow: 0 30px 70px rgba(37,20,59,.14); border: 1px solid var(--line);
  position: relative;
}
.preview-dots span { width:11px;height:11px;border-radius:50%;display:inline-block;margin-right:5px; }
.preview-banner {
  background: linear-gradient(135deg, #f2eafc, #fdeef6);
  border-radius: 14px; padding: 1rem 1.1rem;
}
.metric-box { background:#fff; border:1px solid var(--line); border-radius:14px; padding:.9rem 1rem; }
.metric-box .val { font-size:1.6rem; font-weight:800; letter-spacing:-.02em; }
.metric-bar { height:6px; border-radius:20px; background:#eee; overflow:hidden; }
.metric-bar > span { display:block; height:100%; border-radius:20px; }
.float-badge {
  position:absolute; top:-18px; right:14px; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:.6rem .9rem; box-shadow:0 12px 30px rgba(37,20,59,.12);
  display:flex; align-items:center; gap:.6rem; font-size:.8rem;
}

/* Section headings */
.lp2-eyebrow { color: var(--secondary-purple); font-weight:700; letter-spacing:.12em; font-size:.75rem; text-transform:uppercase; }
.lp2-h2 { font-weight:800; letter-spacing:-.02em; font-size: clamp(1.8rem,3.5vw,2.6rem); }
.section-light { background: var(--surface); }

/* Step / dimension cards */
.lp2-card {
  background:#fff; border:1px solid var(--line); border-radius:18px; padding:1.6rem;
  height:100%; transition: transform .2s ease, box-shadow .2s ease; position:relative; overflow:hidden;
}
.lp2-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(37,20,59,.08); }
.lp2-card .ghost {
  position:absolute; right:14px; top:10px; font-weight:800; font-size:2.6rem; opacity:.12; letter-spacing:-.04em;
}
.lp2-ico {
  width:48px;height:48px;border-radius:13px;display:grid;place-items:center;font-size:1.3rem;margin-bottom:1rem;
}
.lp2-step-label { font-size:.72rem; font-weight:700; letter-spacing:.08em; color:var(--muted); text-transform:uppercase; }
.lp2-divider { border-top:1px solid var(--line); margin:1rem 0 .6rem; }

/* Collaboration banner */
.collab-banner { background: var(--gradient); border-radius: 26px; color:#fff; padding: 3rem; }
.collab-flag { font-size: 3.4rem; font-weight: 800; letter-spacing:-.02em; }
.collab-globe { width:54px;height:54px;border:1px solid rgba(255,255,255,.4);border-radius:50%;display:grid;place-items:center; }
.collab-logo-box {
  width: 64px; height: 64px; margin: 0 auto;
  background: transparent;
  display: grid; place-items: center;
}
.collab-logo-box img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.2));
}

/* HCAI */
.hcai-logo { width:70px;height:70px;border-radius:18px;background:var(--gradient);color:#fff;display:grid;place-items:center;font-size:1.8rem; }

/* =====================================================================
   Perpustakaan Modul (galeri cover + modal)
   ===================================================================== */
/* Kolom ke-5 custom untuk grid buku */
@media (min-width: 1200px) {
  .col-xl-2-4 { flex: 0 0 auto; width: 20%; }
}

.pill-cat {
  display: inline-block;
  padding: .5rem 1.2rem;
  border-radius: 30px;
  background: #fff;
  border: 1px solid var(--line, #ece9f2);
  color: #4a4360;
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s ease;
}
.pill-cat:hover { border-color: var(--light-purple); color: var(--primary-purple); }
.pill-cat.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(139,61,204,.3); }

.book-card { transition: transform .22s ease; }
.book-card:hover { transform: translateY(-6px); }
.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(37,20,59,.18);
  background: var(--gradient);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; color: #fff; text-align: center; padding: 1rem;
  background: var(--gradient);
}
.book-cover-fallback i { font-size: 2.5rem; }
.book-cover-fallback span { font-size: .78rem; opacity: .9; }
.book-pdf-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(220,53,69,.95); color: #fff;
  font-size: .68rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px;
}
.book-doc-badge { background: rgba(43,87,154,.95); }
.book-title {
  font-weight: 700; font-size: .85rem; line-height: 1.25;
  margin-top: .7rem; color: var(--text-dark);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.book-date { color: var(--soft-pink); font-size: .78rem; font-weight: 600; margin-top: .2rem; }

body.dark-mode .pill-cat { background: var(--white); color: var(--text-dark); border-color: rgba(255,255,255,.1); }
body.dark-mode .book-title { color: var(--text-dark); }

/* Overlay "Baca" pada thumbnail di modal detail */
#bmThumb .thumb-read-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; font-weight: 700; color: #fff;
  background: rgba(37,20,59,.55); border-radius: .75rem;
  opacity: 0; transition: opacity .2s ease;
}
#bmThumb:hover .thumb-read-overlay { opacity: 1; }

/* =====================================================================
   Tema per-peran (role-based theming)
   Admin  : ungu (default :root)
   Dosen  : biru / indigo
   Mahasiswa : teal / hijau
   Override hanya variabel warna inti; seluruh komponen ikut menyesuaikan.
   ===================================================================== */
.theme-instructor {
  --primary-purple: #1D4ED8;
  --secondary-purple: #3B82F6;
  --light-purple: #60A5FA;
  --soft-pink: #22D3EE;
  --bg: #F3F7FF;
  --gradient: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 45%, #22D3EE 100%);
  --gradient-soft: linear-gradient(135deg, rgba(29,78,216,.08), rgba(34,211,238,.08));
  --shadow-soft: 0 10px 30px rgba(29, 78, 216, .12);
}

.theme-student {
  --primary-purple: #0D9488;
  --secondary-purple: #14B8A6;
  --light-purple: #2DD4BF;
  --soft-pink: #4ADE80;
  --bg: #F1FBF8;
  --gradient: linear-gradient(135deg, #0D9488 0%, #14B8A6 45%, #4ADE80 100%);
  --gradient-soft: linear-gradient(135deg, rgba(13,148,136,.08), rgba(74,222,128,.08));
  --shadow-soft: 0 10px 30px rgba(13, 148, 136, .12);
}

/* Samakan warna tombol .btn-purple dengan tema aktif */
.theme-instructor .btn-purple,
.theme-student .btn-purple { background: var(--secondary-purple); }
.theme-instructor .lp2-pill,
.theme-student .lp2-pill { background: var(--gradient-soft); color: var(--primary-purple); }

/* =====================================================================
   Welcome ribbon (banner sambutan user login di halaman depan)
   ===================================================================== */
.welcome-ribbon {
  background: var(--gradient);
  color: #fff;
}
.welcome-ribbon .btn-light { border-radius: 10px; }
.welcome-ribbon .role-chip {
  display: inline-block;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .12rem .55rem;
  border-radius: 20px;
  vertical-align: middle;
}

/* =====================================================================
   Navbar landing — rapikan jarak & pemilih bahasa
   ===================================================================== */
.lp2-nav .navbar-nav .nav-link {
  padding-left: .55rem;
  padding-right: .55rem;
  white-space: nowrap;
}
/* Rapatkan sedikit di layar sedang agar menu tidak berdempetan */
@media (min-width: 992px) and (max-width: 1300px) {
  .lp2-nav .navbar-nav { gap: .15rem !important; }
  .lp2-nav .navbar-nav .nav-link { font-size: .85rem; padding-left: .4rem; padding-right: .4rem; }
}

/* Pemilih bahasa */
.lang-switch > .btn {
  background: var(--gradient-soft);
  color: var(--primary-purple);
  border: 1px solid rgba(96,35,184,.15);
  border-radius: 10px;
  padding: .4rem .7rem;
  font-size: .82rem;
}
.lang-switch > .btn:hover { filter: brightness(.97); }
.lang-switch .dropdown-menu { min-width: 190px; border-radius: 12px; padding: .35rem; }
.lang-switch .dropdown-item { border-radius: 8px; padding: .5rem .6rem; }
.lang-switch .dropdown-item.active { background: var(--gradient-soft); color: var(--primary-purple); }

/* Jaga tombol aksi kanan tidak terlalu rapat */
.lp2-nav .btn-purple { white-space: nowrap; }

/* =====================================================================
   Dashboard — kartu statistik gradient berwarna (gaya modern)
   ===================================================================== */
.stat-grad {
  border: none;
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .9rem;
  box-shadow: 0 10px 24px rgba(37,20,59,.12);
  position: relative;
  overflow: hidden;
  height: 100%;
}
.stat-grad::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 90px; height: 90px;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
}
.stat-grad .sg-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.22);
  display: grid; place-items: center;
  font-size: 1.4rem;
  flex: 0 0 auto;
}
.stat-grad .sg-val { font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat-grad .sg-label { font-size: .8rem; opacity: .92; }

.sg-1 { background: linear-gradient(135deg, #0D9488, #14B8A6); }
.sg-2 { background: linear-gradient(135deg, #2563EB, #38BDF8); }
.sg-3 { background: linear-gradient(135deg, #7C3AED, #A855F7); }
.sg-4 { background: linear-gradient(135deg, #F97316, #FBBF24); }

/* Header sambutan dashboard */
.welcome-hero {
  border-radius: 20px;
  padding: 1.6rem 1.8rem;
  background: var(--gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.welcome-hero::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -60px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}
.welcome-hero .wh-avatar {
  width: 54px; height: 54px; border-radius: 16px;
  background: rgba(255,255,255,.22);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem;
  flex: 0 0 auto;
}

/* Kartu rekomendasi modul (dashboard mahasiswa) */
.rec-card { transition: all .18s ease; }
.rec-card:hover { border-color: var(--light-purple) !important; box-shadow: var(--shadow-soft); transform: translateY(-2px); }

/* =====================================================================
   Kolaborasi — kartu logo lebih besar & menonjol (kontras di latar ungu)
   ===================================================================== */
.collab-banner { padding: 3rem 2rem 3.25rem; }
.collab-logo-card {
  width: 150px;
  height: 150px;
  background: #fff;
  border-radius: 24px;
  display: grid;
  place-items: center;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  transition: transform .25s ease, box-shadow .25s ease;
}
.collab-logo-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.collab-logo-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.collab-flag-txt {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* penghubung di tengah */
.collab-link { display: flex; align-items: center; justify-content: center; }
.collab-globe2 {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.5);
  color: #fff; font-size: 1.4rem;
}
@media (min-width: 768px) {
  .collab-link { position: relative; width: 120px; }
  .collab-link::before, .collab-link::after {
    content: ""; position: absolute; top: 50%;
    height: 2px; width: 32px;
    background: rgba(255,255,255,.45);
  }
  .collab-link::before { left: -4px; }
  .collab-link::after  { right: -4px; }
}
@media (max-width: 767.98px) {
  .collab-logo-card { width: 120px; height: 120px; }
  .collab-globe2 { transform: rotate(90deg); }
}

/* =====================================================================
   Galeri — thumbnail + lightbox dengan tombol slide
   ===================================================================== */
.gallery-thumb {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
}
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.gallery-thumb:hover img { transform: scale(1.07); }
.gallery-thumb .gallery-zoom {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(37,20,59,.35);
  color: #fff; font-size: 1.6rem;
  opacity: 0; transition: opacity .25s ease;
}
.gallery-thumb:hover .gallery-zoom { opacity: 1; }

/* Lightbox overlay */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,8,30,.92);
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem;
}
.gallery-lightbox.open { display: flex; }
.gallery-lightbox .gl-figure {
  margin: 0; max-width: 90vw; max-height: 86vh;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  position: relative;
}
.gallery-lightbox img {
  max-width: 90vw; max-height: 78vh;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.gallery-lightbox figcaption {
  color: #fff; font-size: .95rem; text-align: center; opacity: .9;
}
.gallery-lightbox .gl-counter {
  color: #fff; font-size: .8rem; opacity: .7;
}
.gallery-lightbox .gl-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.15);
  color: #fff; font-size: 1.5rem;
  display: grid; place-items: center;
  transition: background .2s ease, transform .2s ease;
}
.gallery-lightbox .gl-nav:hover { background: var(--secondary-purple); transform: translateY(-50%) scale(1.08); }
.gallery-lightbox .gl-prev { left: 2vw; }
.gallery-lightbox .gl-next { right: 2vw; }
.gallery-lightbox .gl-close {
  position: absolute; top: 1.2rem; right: 1.4rem;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.2rem;
  display: grid; place-items: center;
  transition: background .2s ease;
}
.gallery-lightbox .gl-close:hover { background: #e23; }
@media (max-width: 575.98px) {
  .gallery-lightbox .gl-nav { width: 44px; height: 44px; font-size: 1.2rem; }
}

/* =====================================================================
   Navbar — badge logo institusi (ID & PT berdampingan di kiri)
   ===================================================================== */
.nav-logo-badge {
  width: 42px; height: 42px;
  background: #fff;
  border-radius: 11px;
  display: grid; place-items: center;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(37,20,59,.12);
  border: 1px solid #eee;
  flex: 0 0 auto;
}
.nav-logo-badge img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Pasangan 2 logo + pemisah halus ke brand */
.nav-logo-pair {
  display: inline-flex; align-items: center; gap: 8px;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid #e7e3f0;
}
.navbar-brand .brand-name { font-size: 1.05rem; }

/* =====================================================================
   Hero gelap modern (gaya referensi)
   ===================================================================== */
.lp2-hero-dark {
  position: relative;
  background: #0b1020;
  color: #fff;
  overflow: hidden;
  padding-top: 5rem;
  padding-bottom: 5rem;
}
/* Gradient dasar bernuansa ungu-biru gelap */
.lp2-hero-dark::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 500px at 85% 20%, rgba(139,61,204,.35), transparent 60%),
    radial-gradient(900px 500px at 15% 80%, rgba(34,197,180,.18), transparent 55%),
    linear-gradient(135deg, #0b1020 0%, #16103a 60%, #241152 100%);
  z-index: 0;
}
/* Pola jaring (network) halus */
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 1; opacity: .5;
  background-image:
    radial-gradient(rgba(255,255,255,.12) 1px, transparent 1.6px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000);
}
.hero-glow {
  position: absolute; z-index: 1;
  right: 8%; top: 30%;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(244,114,182,.45), transparent 70%);
  filter: blur(40px);
}
/* Teks hero di latar gelap */
.lp2-hero-dark .lp2-title { color: #fff; }
.lp2-hero-dark .lp2-sub { color: #fff; opacity: .95; }
.lp2-hero-dark .lp2-lead { color: rgba(255,255,255,.72); }
.lp2-hero-dark .lp2-pill { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.lp2-hero-dark .text-muted { color: rgba(255,255,255,.6) !important; }
/* Tombol outline dark -> putih di latar gelap */
.lp2-hero-dark .btn-outline-dark {
  border-color: rgba(255,255,255,.5); color: #fff;
}
.lp2-hero-dark .btn-outline-dark:hover { background: #fff; color: #16103a; }
.lp2-hero-dark .text-dark { color: #fff !important; }
/* Preview card tetap terang agar kontras */
.lp2-hero-dark .preview-card { box-shadow: 0 30px 70px rgba(0,0,0,.45); }

/* =====================================================================
   Typografi modern untuk halaman publik (landing)
   ===================================================================== */
body.lp2 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.lp2 .brand-name {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -.03em;
  font-weight: 700;
}
body.lp2 .lp2-h2 {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -.03em;
  font-weight: 700;
}

/* Judul hero lebih besar, modern, dengan sedikit gradient tint */
.lp2-hero-dark .lp2-title {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.lp2-hero-dark .lp2-sub {
  font-weight: 600;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}
.lp2-hero-dark .lp2-pill {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: .02em;
}

/* Tombol hero lebih modern (sudut lebih bulat, bayangan halus) */
.lp2-hero-dark .btn-purple,
.lp2-hero-dark .btn-outline-dark {
  border-radius: 14px;
  padding: .7rem 1.5rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.lp2-hero-dark .btn-purple { box-shadow: 0 12px 30px rgba(139,61,204,.45); }

/* Angka statistik hero lebih tebal & modern */
.lp2-hero-dark .row.g-4 .fw-bold {
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #fff, #d7c4ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =====================================================================
   Preview card hero — versi modern (kontras jelas + animasi)
   ===================================================================== */
.preview-card-v2 {
  background: #fff;
  border-radius: 22px;
  padding: 1.1rem 1.2rem 1.3rem;
}

/* Banner progres utama: gradient penuh, teks putih kontras */
.pv-hero-banner {
  background: var(--gradient);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  color: #fff;
  box-shadow: 0 10px 24px rgba(139,61,204,.28);
}
.pv-hero-label { font-size: .74rem; font-weight: 600; opacity: .95; }
.pv-hero-title { font-weight: 700; font-size: 1rem; line-height: 1.25; margin-top: .15rem; }
.pv-hero-title span { opacity: .9; font-weight: 600; }

/* Bar progres (track + fill animasi) */
.pv-bar { height: 8px; border-radius: 20px; background: rgba(0,0,0,.08); overflow: hidden; }
.pv-hero-banner .pv-bar { background: rgba(255,255,255,.28); }
.pv-bar-fill {
  display: block; height: 100%; width: 0; border-radius: 20px;
  background: #fff;
  animation: pvGrow 1.1s cubic-bezier(.22,1,.36,1) forwards;
}
.pv-metric .pv-bar-fill { background: var(--primary-purple); }
@keyframes pvGrow { to { width: var(--w); } }

/* Kartu metrik */
.pv-metric {
  border: 1px solid #ececf3;
  border-radius: 14px;
  padding: .85rem .95rem;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}
.pv-metric:hover { box-shadow: 0 8px 20px rgba(37,20,59,.08); transform: translateY(-2px); }
.pv-metric-label { font-size: .72rem; color: #8a86a0; font-weight: 600; margin-bottom: .1rem; }
.pv-metric-val { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1; }

/* Banner AI Assistant — teks gelap kontras di latar lembut */
.pv-ai-banner {
  display: flex; align-items: center; gap: .7rem;
  background: var(--gradient-soft);
  border: 1px solid rgba(96,35,184,.12);
  border-radius: 14px;
  padding: .75rem .9rem;
}
.pv-ai-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
  background: var(--gradient);
}
.pv-ai-title { font-size: .86rem; color: var(--text-dark); font-weight: 700; display: block; }
.pv-ai-sub { font-size: .74rem; color: #6b6780; line-height: 1.25; }
.lh-sm { line-height: 1.25; }

/* =====================================================================
   Bendera negara di atas logo kampus (digambar via CSS, bukan emoji)
   ===================================================================== */
.flag-badge {
  display: block;
  width: 56px; height: 38px;
  margin-bottom: 12px;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  border: 2px solid #fff;
  position: relative;
}

/* Indonesia: merah di atas, putih di bawah */
.flag-id { display: flex; flex-direction: column; }
.flag-id .flag-stripe { flex: 1; width: 100%; display: block; }

/* Portugal: hijau (2/5) + merah (3/5) + lingkaran lambang di perbatasan */
.flag-pt { background: #da291c; }
.flag-pt .flag-pt-green { position: absolute; left: 0; top: 0; bottom: 0; width: 40%; background: #006600; }
.flag-pt .flag-pt-red   { position: absolute; right: 0; top: 0; bottom: 0; width: 60%; background: #da291c; }
.flag-pt .flag-pt-emblem {
  position: absolute; top: 50%; left: 40%;
  width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #ffcc00;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #da291c;
}

/* =====================================================================
   HAKI di footer — gambar sertifikat langsung, TANPA background putih
   ===================================================================== */
/* Sertifikat HAKI di footer — di samping kolom Kolaborasi */
.footer-haki {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .5rem;
  cursor: pointer;
  transition: transform .2s ease;
}
.footer-haki:hover { transform: translateY(-3px); }
.footer-haki img {
  height: 130px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: #fff;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.footer-haki-cap {
  font-size: .72rem; font-weight: 700; color: #fff;
  background: rgba(34,197,94,.95);
  padding: .25rem .7rem; border-radius: 20px;
}

/* Logo default pada sampul modul yang tidak punya cover */
.book-cover-fallback .book-cover-logo {
  width: 72px; height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  margin-bottom: .2rem;
}

/* ===== News Card ===== */
.news-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(96,35,184,.07);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(96,35,184,.13);
}
.news-card-img-wrap {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gradient-soft);
}
.news-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.news-card:hover .news-card-img-wrap img {
  transform: scale(1.04);
}
.news-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-purple);
  font-size: 2.5rem;
  background: var(--gradient-soft);
}
.news-card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card-badge {
  display: inline-block;
  background: rgba(96,35,184,.1);
  color: var(--primary-purple);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .22rem .75rem;
  border-radius: 50px;
  margin-bottom: .65rem;
}
.news-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.news-card-title a {
  color: #1a1a2e !important;
}
.news-card-title a:hover {
  color: var(--primary-purple) !important;
}
.news-card-link {
  color: var(--primary-purple);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: auto;
}
.news-card-link:hover {
  gap: .55rem;
  color: var(--primary-purple);
}

/* ===== News Article Body ===== */
.news-article-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #2d2d2d;
  text-align: justify;
}
.news-article-body p {
  margin-bottom: 1.4rem;
  text-align: justify;
}
.news-article-body h2,
.news-article-body h3,
.news-article-body h4 {
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.news-article-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.5rem 0;
}
.news-article-body ul,
.news-article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.news-article-body li {
  margin-bottom: .4rem;
}
.news-article-body blockquote {
  border-left: 4px solid var(--primary-purple);
  padding: .75rem 1.25rem;
  background: rgba(96,35,184,.06);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: #555;
}

/* ===== News Read Page ===== */
.news-read-cover {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  max-height: 420px;
}
.news-read-cover img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}
.news-read-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}

/* ===== Sidebar Berita Lainnya ===== */
.news-sidebar {
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  position: sticky;
  top: 80px;
}
.news-sidebar-head {
  padding: 1rem 1.2rem .75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #f59e0b;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.news-sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .15s;
}
.news-sidebar-item:hover {
  background: rgba(255,255,255,.06);
}
.news-sidebar-thumb {
  width: 72px;
  min-width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.1);
}
.news-sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-sidebar-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  font-size: 1.3rem;
}
.news-sidebar-info {
  flex: 1;
}
.news-sidebar-title {
  font-size: .85rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
  margin-bottom: .25rem;
}
.news-sidebar-date {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
}
.news-sidebar-footer {
  padding: 1rem 1.2rem;
}
.news-sidebar-btn {
  background: #0d9488;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  padding: .65rem;
  font-size: .9rem;
}
.news-sidebar-btn:hover {
  background: #0f766e;
  color: #fff;
}

/* ===== Floating Public AI Assistant ===== */
#pubAiWrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Tombol trigger */
#pubAiBtn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6023B8, #8B3DCC);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(96,35,184,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
#pubAiBtn:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(96,35,184,.55); }
#pubAiBtn.pub-ai-btn-active { background: linear-gradient(135deg, #4a1a9a, #6023B8); }

/* Pulse ring */
.pub-ai-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(96,35,184,.5);
  animation: pubPulse 2s ease-out infinite;
}
@keyframes pubPulse {
  0%   { transform: scale(1);   opacity: .8; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Chat box */
#pubAiBox {
  width: 360px;
  max-width: calc(100vw - 48px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(.97);
  transition: max-height .35s cubic-bezier(.4,0,.2,1),
              opacity .25s ease,
              transform .25s ease;
}
#pubAiBox.pub-ai-open {
  max-height: 520px;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Header */
.pub-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  background: linear-gradient(135deg, #6023B8, #8B3DCC);
  color: #fff;
}
.pub-ai-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.pub-ai-name { font-weight: 700; font-size: .9rem; }
.pub-ai-status { font-size: .72rem; opacity: .85; display: flex; align-items: center; gap: 4px; }
.pub-ai-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; display: inline-block;
  box-shadow: 0 0 6px #4ade80;
}
.pub-ai-header button {
  background: none; border: none; color: #fff;
  font-size: 1rem; cursor: pointer; opacity: .8; padding: 4px;
  border-radius: 6px; transition: opacity .15s, background .15s;
}
.pub-ai-header button:hover { opacity: 1; background: rgba(255,255,255,.15); }

/* Messages */
.pub-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  background: #f8f7fc;
  min-height: 220px;
  max-height: 300px;
}
.pub-ai-bubble {
  display: flex;
  max-width: 85%;
}
.pub-ai-bubble span {
  display: block;
  padding: .6rem .9rem;
  border-radius: 14px;
  font-size: .87rem;
  line-height: 1.55;
  word-break: break-word;
}
.pub-ai-bubble-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.pub-ai-bubble-user span {
  background: linear-gradient(135deg, #6023B8, #8B3DCC);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pub-ai-bubble-bot span {
  background: #fff;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}

/* Typing indicator */
.pub-ai-typing span {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: .7rem 1rem;
}
.pub-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  animation: pubBounce 1.2s infinite ease-in-out;
}
.pub-dot:nth-child(2) { animation-delay: .2s; }
.pub-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pubBounce {
  0%,80%,100% { transform: scale(.8); opacity: .5; }
  40%          { transform: scale(1.2); opacity: 1; }
}

/* Footer input */
.pub-ai-footer {
  padding: .7rem 1rem .8rem;
  border-top: 1px solid #ede9f8;
  background: #fff;
}
.pub-ai-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  background: #f3f0fc;
  border-radius: 14px;
  padding: .45rem .55rem .45rem .8rem;
}
.pub-ai-input-wrap textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: .88rem;
  line-height: 1.5;
  color: #1a1a2e;
  max-height: 100px;
  font-family: inherit;
}
.pub-ai-input-wrap button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6023B8, #8B3DCC);
  border: none;
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, opacity .15s;
}
.pub-ai-input-wrap button:hover { transform: scale(1.1); }
.pub-ai-input-wrap button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pub-ai-credit {
  text-align: center;
  font-size: .68rem;
  color: #a78bfa;
  margin-top: .4rem;
}

@media (max-width: 480px) {
  #pubAiWrap { bottom: 16px; right: 16px; }
  #pubAiBox { width: calc(100vw - 32px); }
}
