/* =====================================================================
   LENTERA DELIMA — Sistem desain
   Ceria untuk anak, rapi untuk guru & orang tua, nyaman di HP.
   ===================================================================== */
:root {
  --ld-primary: #5b4cf0;
  --ld-primary-2: #8b5cf6;
  --ld-primary-dark: #3f31c9;
  --ld-accent: #f59e0b;
  --ld-pink: #ec4899;
  --ld-green: #10b981;
  --ld-sky: #0ea5e9;
  --ld-bg: #f4f5fb;
  --ld-card: #ffffff;
  --ld-text: #1e1b3a;
  --ld-muted: #6b6f86;
  --ld-line: #ebecf5;
  --ld-radius: 22px;
  --ld-radius-sm: 14px;
  --ld-shadow: 0 1px 2px rgba(30, 27, 58, .04), 0 8px 24px rgba(30, 27, 58, .06);
  --ld-shadow-lg: 0 18px 48px rgba(91, 76, 240, .18);
  --ld-grad: linear-gradient(135deg, #5b4cf0 0%, #8b5cf6 55%, #ec4899 110%);
  --ld-safe-b: env(safe-area-inset-bottom, 0px);
  --bs-primary: #5b4cf0;
  --bs-primary-rgb: 91, 76, 240;
  --bs-link-color: #5b4cf0;
  --bs-link-hover-color: #3f31c9;
  --bs-body-font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #1e1b3a;
  --bs-border-color: #e3e5f0;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--ld-bg);
  background-image: radial-gradient(circle at 0 0, rgba(139, 92, 246, .08) 0, transparent 35%), radial-gradient(circle at 100% 20%, rgba(236, 72, 153, .06) 0, transparent 30%);
  background-attachment: fixed;
  color: var(--ld-text); font-family: var(--bs-body-font-family); font-weight: 600;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, .fw-black { font-weight: 900 !important; letter-spacing: -.2px; }
.tiny { font-size: .72rem; }
.min-w-0 { min-width: 0; }
.text-primary { color: var(--ld-primary) !important; }
.bg-primary { background-color: var(--ld-primary) !important; }
::selection { background: #ddd6fe; }

/* ---------------- Tombol & formulir ---------------- */
.btn { border-radius: 14px; font-weight: 800; transition: transform .12s ease, box-shadow .2s ease, background .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-lg { border-radius: 16px; padding: .75rem 1.2rem; }
.btn-primary { background: var(--ld-grad); background-size: 140% 140%; border: 0; box-shadow: 0 6px 16px rgba(91, 76, 240, .3); }
.btn-primary:hover, .btn-primary:focus { background: var(--ld-grad); background-position: 100% 0; box-shadow: 0 10px 22px rgba(91, 76, 240, .38); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); border: 0; box-shadow: 0 6px 14px rgba(16, 185, 129, .3); }
.btn-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b); border: 0; color: #422006; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); border: 0; }
.btn-light { background: #f1f2f9; border-color: #f1f2f9; }
.btn-light:hover { background: #e7e8f5; }
.btn-outline-primary { border-color: #c9c3fb; color: var(--ld-primary); }
.btn-outline-primary:hover { background: var(--ld-primary); border-color: var(--ld-primary); }
.btn-icon { background: transparent; border: 0; padding: .45rem .6rem; border-radius: 14px; color: var(--ld-text); }
.btn-icon:hover { background: #eeeffa; }
.form-control, .form-select { border-radius: 14px; border: 1.5px solid #e3e5f0; padding: .6rem .85rem; font-weight: 600; background-color: #fff; }
.form-control-lg { border-radius: 16px; }
.form-control:focus, .form-select:focus { border-color: #a99ffb; box-shadow: 0 0 0 4px rgba(91, 76, 240, .12); }
.form-label { color: #44405f; }
.form-check-input:checked { background-color: var(--ld-primary); border-color: var(--ld-primary); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9a9cb4; font-size: 1.1rem; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.6rem; }
.btn-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8a8ca6; font-size: 1.2rem; padding: .3rem .6rem; border-radius: 10px; }
.btn-eye:hover { background: #f1f2f9; }
.alert { border: 0; border-radius: 16px; font-weight: 700; }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-danger { background: #ffe4e6; color: #881337; }
.alert-info { background: #e0f2fe; color: #0c4a6e; }
.alert-warning { background: #fef3c7; color: #78350f; }
.badge { font-weight: 800; border-radius: 8px; }
:focus-visible { outline: 3px solid rgba(91, 76, 240, .45); outline-offset: 2px; }

/* ---------------- Tata letak ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px; flex-shrink: 0; color: #fff; overflow-x: hidden;
  background: linear-gradient(170deg, #3b2fc9 0%, #5b4cf0 45%, #7c3aed 100%);
  display: flex; flex-direction: column;
}
.sidebar::before, .sidebar::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.sidebar::before { width: 260px; height: 260px; top: -90px; right: -120px; }
.sidebar::after { width: 200px; height: 200px; bottom: 60px; left: -110px; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar.offcanvas-lg { --bs-offcanvas-width: 286px; --bs-offcanvas-bg: #4b3ee0; }
.sidebar-brand { padding: 1.15rem 1.1rem .7rem; display: flex; align-items: center; position: relative; z-index: 1; }
.brand-logo { border-radius: 14px; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.brand-name { color: #fff; font-weight: 900; letter-spacing: .6px; line-height: 1.1; }
.brand-sub { color: rgba(255,255,255,.72); font-size: .72rem; }
.sidebar-user { display: flex; align-items: center; gap: .7rem; margin: .3rem .8rem .4rem; padding: .65rem .75rem; border-radius: 18px;
  background: rgba(255,255,255,.12); color: #fff; text-decoration: none; position: relative; z-index: 1; backdrop-filter: blur(6px); }
.sidebar-user:hover { background: rgba(255,255,255,.2); color: #fff; }
.avatar-md { width: 42px; height: 42px; border-radius: 14px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.45rem; flex-shrink: 0; }
.sidebar-nav { padding: .6rem .7rem; flex: 1; position: relative; z-index: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .8rem; color: rgba(255,255,255,.86);
  text-decoration: none; padding: .66rem .9rem; border-radius: 14px; font-weight: 800; margin-bottom: 3px; transition: background .15s, transform .15s;
}
.sidebar-nav a i { font-size: 1.12rem; width: 1.3rem; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.13); color: #fff; transform: translateX(3px); }
.sidebar-nav a.active { background: #fff; color: var(--ld-primary); box-shadow: 0 8px 20px rgba(20, 10, 80, .25); }
.sidebar-foot { padding: 1rem; position: relative; z-index: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; background: rgba(244, 245, 251, .82); backdrop-filter: saturate(160%) blur(14px);
  display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top, 0px));
}
.topbar-title { font-size: 1.2rem; font-weight: 900; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: .5rem 1rem 1.5rem; flex: 1; }
@media (min-width: 768px) { .content { padding: 1rem 1.75rem 2rem; } .topbar { padding-left: 1.75rem; padding-right: 1.75rem; } }
.footer-note { text-align: center; color: var(--ld-muted); font-size: .74rem; padding: 1rem 1rem calc(6.5rem + var(--ld-safe-b)); }
@media (min-width: 992px) { .footer-note { padding-bottom: 1.2rem; } }

.avatar-sm { width: 38px; height: 38px; border-radius: 13px; background: #fff; box-shadow: var(--ld-shadow); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.avatar-lg { width: 76px; height: 76px; border-radius: 24px; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; font-size: 2.7rem; flex-shrink: 0; }
.avatar-xl { width: 104px; height: 104px; border-radius: 32px; background: #fff; border: 5px solid #fff; box-shadow: var(--ld-shadow-lg); display: flex; align-items: center; justify-content: center; font-size: 3.6rem; margin-top: -52px; position: relative; }

.notif-dot { position: absolute; top: 3px; right: 3px; background: #f43f5e; color: #fff; border-radius: 99px; font-size: .62rem; font-weight: 900; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #f4f5fb; animation: denyut 2s infinite; }
@keyframes denyut { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.dropdown-menu { border: 0; border-radius: 18px; padding: .4rem; }
.dropdown-item { border-radius: 10px; font-weight: 700; padding: .5rem .8rem; }
.notif-menu { width: 340px; max-width: 92vw; padding: 0; overflow: hidden; }
#notifList { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: .7rem 1rem; border-bottom: 1px solid var(--ld-line); color: inherit; text-decoration: none; }
.notif-item:hover { background: #f8f8fe; }
.notif-item.unread { background: #f3f1ff; border-left: 3px solid var(--ld-primary); }

/* Navigasi bawah mengambang (HP) */
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--ld-safe-b)); z-index: 1030;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(16px);
  display: flex; padding: .35rem; border-radius: 24px; box-shadow: 0 12px 34px rgba(30, 27, 58, .18); border: 1px solid rgba(255,255,255,.8);
}
.bottom-nav a { flex: 1; text-align: center; color: #7b7e96; text-decoration: none; font-size: .68rem; font-weight: 800; padding: .4rem 0 .3rem; border-radius: 18px; position: relative; transition: color .2s, background .2s; }
.bottom-nav a i { display: block; font-size: 1.3rem; line-height: 1.2; transition: transform .2s; }
.bottom-nav a.active { color: #fff; background: var(--ld-grad); box-shadow: 0 6px 14px rgba(91, 76, 240, .35); }
.bottom-nav a.active i { transform: translateY(-1px) scale(1.08); }

/* ---------------- Kartu & komponen ---------------- */
.card { border: 1px solid rgba(235, 236, 245, .9); border-radius: var(--ld-radius); box-shadow: var(--ld-shadow); background: var(--ld-card); }
.card-header { background: transparent; border-bottom: 1px solid var(--ld-line); font-weight: 900; padding: .95rem 1.15rem; border-radius: var(--ld-radius) var(--ld-radius) 0 0 !important; }
.card-body { padding: 1.15rem; }
.list-group-item { border-color: var(--ld-line); }
.section-title { font-weight: 900; font-size: 1.1rem; margin: .5rem 0 .8rem; display: flex; align-items: center; gap: .5rem; }
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--ld-line), transparent); }

/* Animasi masuk halaman */
@keyframes naik { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.content > *, .content .row > [class*='col'] > .card, .content .row > [class*='col'] > .stat { animation: naik .45s cubic-bezier(.2, .7, .3, 1) both; }
.content .row > [class*='col']:nth-child(2) > * { animation-delay: .04s; }
.content .row > [class*='col']:nth-child(3) > * { animation-delay: .08s; }
.content .row > [class*='col']:nth-child(4) > * { animation-delay: .12s; }
.content .row > [class*='col']:nth-child(5) > * { animation-delay: .16s; }
.content .row > [class*='col']:nth-child(6) > * { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Hero / banner dashboard */
.hero {
  border-radius: 28px; color: #fff; padding: 1.4rem 1.4rem; position: relative; overflow: hidden;
  background: var(--ld-grad); box-shadow: var(--ld-shadow-lg); min-height: 150px;
}
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1.5px, transparent 1.5px); background-size: 18px 18px; opacity: .45; pointer-events: none; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: rgba(255,255,255,.12); border-radius: 50%; }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-weight: 900; font-size: 1.55rem; }
.hero .chip { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: .28rem .75rem; font-size: .78rem; font-weight: 800; display: inline-block; margin: .15rem .2rem .15rem 0; backdrop-filter: blur(4px); }
.hero-illu { position: absolute !important; right: 0; bottom: -6px; height: 112%; max-height: 230px; width: auto; z-index: 1; pointer-events: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,.18)); }
.hero.has-illu { padding-right: 42%; }
@media (max-width: 575px) {
  .hero.has-illu { padding-right: 1.4rem; padding-bottom: 150px; }
  .hero-illu { height: 160px; right: 50%; transform: translateX(50%); }
}
.hero-ungu { background: var(--ld-grad); }
.hero-biru { background: linear-gradient(135deg, #0ea5e9, #5b4cf0 70%); }
.hero-hijau { background: linear-gradient(135deg, #10b981, #0ea5e9 80%); }
.hero-oranye { background: linear-gradient(135deg, #f59e0b, #f97316 50%, #ec4899); }
.hero-pink { background: linear-gradient(135deg, #ec4899, #8b5cf6 80%); }
.hero-gelap { background: linear-gradient(135deg, #1e1b4b, #4338ca 80%); }

.stat {
  border-radius: var(--ld-radius); background: #fff; padding: .95rem 1rem; height: 100%;
  box-shadow: var(--ld-shadow); border: 1px solid rgba(235, 236, 245, .9); display: flex; gap: .8rem; align-items: center; transition: transform .15s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(30, 27, 58, .09); }
.stat-icon { width: 50px; height: 50px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-val { font-size: 1.45rem; font-weight: 900; line-height: 1.1; }
.stat-lbl { font-size: .76rem; color: var(--ld-muted); font-weight: 800; }
.bg-soft-primary { background: #eeebff; color: #5b4cf0; }
.bg-soft-success { background: #d9f8ea; color: #059669; }
.bg-soft-warning { background: #fff1d1; color: #d97706; }
.bg-soft-danger  { background: #ffe4e8; color: #e11d48; }
.bg-soft-info    { background: #dcf3ff; color: #0284c7; }
.bg-soft-pink    { background: #fde4f2; color: #db2777; }

/* Cincin progres */
.cincin { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cincin svg { transform: rotate(-90deg); }
.cincin .isi { position: absolute; text-align: center; line-height: 1; }
.cincin .isi b { display: block; font-size: 1.15rem; font-weight: 900; }
.cincin .isi small { font-size: .62rem; color: var(--ld-muted); font-weight: 800; }
.cincin circle.jalur { animation: isiCincin 1.1s cubic-bezier(.2,.7,.3,1) both; }
@keyframes isiCincin { from { stroke-dashoffset: var(--keliling); } }
.kartu-cincin { text-align: center; padding: 1rem .5rem; }
.kartu-cincin .lbl { font-weight: 900; margin-top: .4rem; font-size: .88rem; white-space: nowrap; }
@media (max-width: 400px) { .kartu-cincin .lbl { font-size: .78rem; } }
.kartu-cincin .sub { font-size: .72rem; color: var(--ld-muted); font-weight: 800; }

/* Ubin menu */
.menu-tile {
  display: block; text-decoration: none; color: var(--ld-text); background: #fff; border-radius: 22px; border: 1px solid rgba(235,236,245,.9);
  padding: 1rem .6rem; text-align: center; box-shadow: var(--ld-shadow); transition: transform .18s, box-shadow .18s; height: 100%; position: relative; overflow: hidden;
}
.menu-tile::before { content: ''; position: absolute; inset: auto -30% -60% auto; width: 90px; height: 90px; border-radius: 50%; background: var(--tile, #eeebff); opacity: .7; }
.menu-tile:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(91, 76, 240, .16); color: var(--ld-text); }
.menu-tile:active { transform: scale(.97); }
.menu-tile .emo { font-size: 2rem; width: 58px; height: 58px; border-radius: 18px; background: var(--tile, #eeebff); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .45rem; position: relative; }
.menu-tile .t { font-weight: 900; font-size: .9rem; position: relative; }
.menu-tile .s { font-size: .72rem; color: var(--ld-muted); position: relative; }

.progress { border-radius: 99px; background: #eceef7; }
.progress-bar { border-radius: 99px; background-image: linear-gradient(90deg, rgba(255,255,255,.2), transparent); }

.rek-item { display: flex; gap: .75rem; align-items: center; padding: .75rem .85rem; border-radius: 16px; background: #f7f7fd; margin-bottom: .55rem; text-decoration: none; color: inherit; border: 1px solid transparent; transition: all .15s; }
.rek-item:hover { background: #fff; border-color: #ddd8fe; color: inherit; transform: translateX(3px); box-shadow: var(--ld-shadow); }
.rek-item .emo { font-size: 1.4rem; width: 44px; height: 44px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.05); }

/* Target harian */
.target-item { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px dashed var(--ld-line); }
.target-item:last-child { border-bottom: 0; }
.target-cek { width: 28px; height: 28px; border-radius: 10px; border: 2px solid #d4d6e6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; }
.target-item.selesai .target-cek { background: #10b981; border-color: #10b981; color: #fff; }
.target-item.selesai .target-teks { text-decoration: line-through; color: var(--ld-muted); }

.kosong { text-align: center; padding: 2rem 1rem; color: var(--ld-muted); }
.kosong img { width: 160px; max-width: 60%; margin-bottom: .5rem; }

/* ---------------- E-book ---------------- */
.book-card { text-decoration: none; color: inherit; display: block; height: 100%; }
.book-cover {
  aspect-ratio: 3/4; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; padding: .8rem; text-align: center; position: relative; overflow: hidden;
  box-shadow: inset -10px 0 0 rgba(0,0,0,.08), 0 10px 22px rgba(30, 27, 58, .16); transition: transform .2s, box-shadow .2s;
}
.book-card:hover .book-cover { transform: translateY(-5px) rotate(-1.2deg); box-shadow: inset -10px 0 0 rgba(0,0,0,.08), 0 18px 30px rgba(30, 27, 58, .22); }
.book-cover .emo { font-size: 3rem; }
.book-cover .jdl { font-weight: 900; font-size: .9rem; line-height: 1.2; margin-top: .4rem; }
.book-cover .done { position: absolute; top: 8px; right: 8px; background: #fff; color: #059669; border-radius: 99px; font-size: .68rem; font-weight: 900; padding: .15rem .5rem; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.book-cover.has-img { padding: 0; justify-content: flex-end; }
.book-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover .cover-title { position: relative; width: 100%; padding: 2.4rem .65rem .75rem; background: linear-gradient(transparent, rgba(15, 10, 40, .78)); color: #fff; font-weight: 900; font-size: .88rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.reader { max-width: 760px; margin: 0 auto; }
.reader-page { background: #fffdf8; border-radius: 26px; padding: 1.4rem; min-height: 50vh; box-shadow: 0 10px 30px rgba(30, 27, 58, .08); border: 1px solid #f3eee0; }
.reader-img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 20px; margin-bottom: 1.1rem; background: #eef2f7; box-shadow: 0 6px 16px rgba(0,0,0,.08); animation: naik .4s both; }
.reader-illu { font-size: 4.5rem; text-align: center; letter-spacing: .3rem; margin-bottom: 1rem; }
.reader-text { line-height: 1.9; font-size: var(--fs, 1.2rem); font-weight: 700; color: #2b2747; }
.star-rating { font-size: 1.9rem; cursor: pointer; user-select: none; }
.star-rating span { color: #d6d8e6; transition: transform .1s; }
.star-rating span:hover { transform: scale(1.15); }
.star-rating span.on { color: #f59e0b; }

/* ---------------- Kuis / latihan ---------------- */
.quiz-box { max-width: 720px; margin: 0 auto; }
.quiz-q { font-size: 1.35rem; font-weight: 900; }
.quiz-illu { font-size: 1.6rem; white-space: pre-line; background: #f7f7fd; border-radius: 16px; padding: .8rem 1rem; margin: .75rem 0; line-height: 1.6; }
.opt-btn {
  display: block; width: 100%; text-align: left; border: 2px solid #e6e7f2; background: #fff; border-radius: 18px;
  padding: .9rem 1rem; font-weight: 800; font-size: 1.05rem; margin-bottom: .6rem; transition: all .12s; box-shadow: 0 2px 0 #e6e7f2;
}
.opt-btn:hover:not(:disabled) { border-color: #a99ffb; background: #f6f4ff; transform: translateY(-1px); }
.opt-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.opt-btn.correct { border-color: #10b981; background: #d9f8ea; box-shadow: 0 2px 0 #10b981; }
.opt-btn.wrong { border-color: #f43f5e; background: #ffe4e8; box-shadow: 0 2px 0 #f43f5e; animation: goyang .35s; }
.opt-btn.chosen { border-color: var(--ld-primary); background: #eeebff; }
.big-input { font-size: 1.8rem; font-weight: 900; text-align: center; border-radius: 18px; border-width: 2px; }
.urut-pool .btn, .urut-ans .btn { font-size: 1.3rem; min-width: 64px; margin: .2rem; }
.urut-ans { min-height: 64px; border: 2px dashed #c9c3fb; border-radius: 18px; padding: .4rem; }
.feedback { font-weight: 900; font-size: 1.1rem; }
.mult-q { font-size: 3.4rem; font-weight: 900; text-align: center; letter-spacing: 2px; background: linear-gradient(135deg, #5b4cf0, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; max-width: 320px; margin: 0 auto; }
.numpad button { font-size: 1.5rem; font-weight: 900; padding: .7rem 0; border-radius: 18px; box-shadow: 0 3px 0 rgba(30, 27, 58, .08); }
.timer-bar { height: 8px; }
.level-card { border-radius: 22px; padding: 1rem; color: #fff; text-decoration: none; display: block; height: 100%; position: relative; overflow: hidden; box-shadow: 0 10px 22px rgba(30, 27, 58, .15); transition: transform .18s; }
.level-card::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.15); }
.level-card:hover { color: #fff; transform: translateY(-3px); }
.level-card .lv { font-weight: 900; font-size: 1.2rem; }
.mult-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: .45rem; }
.mult-cell { border-radius: 14px; padding: .55rem .2rem; text-align: center; font-weight: 900; min-width: 0; overflow: hidden; }
.mult-cell .x { font-size: 1.15rem; }
.mult-cell .p { font-size: .68rem; }
.st-menguasai { background: #d9f8ea; color: #065f46; }
.st-latihan { background: #fff1d1; color: #92400e; }
.st-belum { background: #ffe4e8; color: #9f1239; }
@keyframes goyang { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------------- Badge & kategori ---------------- */
.badge-tile { text-align: center; padding: 1rem .5rem; border-radius: 22px; background: #fff; height: 100%; box-shadow: var(--ld-shadow); border: 1px solid rgba(235,236,245,.9); transition: transform .15s; }
.badge-tile:hover { transform: translateY(-3px) rotate(-1deg); }
.badge-tile .emo { font-size: 2.6rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.badge-tile.locked { filter: grayscale(1); opacity: .45; }
.kat { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .18rem .65rem; font-size: .74rem; font-weight: 900; }
.kat-hijau { background: #d9f8ea; color: #065f46; }
.kat-biru { background: #dbeafe; color: #1e40af; }
.kat-kuning { background: #fef6c3; color: #854d0e; }
.kat-merah { background: #ffe4e8; color: #9f1239; }
.kat-abu { background: #f1f2f6; color: #4b5563; }

/* ---------------- Grafik & tabel ---------------- */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.narasi p { margin-bottom: .6rem; line-height: 1.75; }
.kpi-delta { font-size: .72rem; font-weight: 900; }
.kpi-delta.up { color: #059669; }
.kpi-delta.down { color: #e11d48; }
.table { --bs-table-hover-bg: #f7f6ff; }
.table thead th { font-size: .74rem; text-transform: uppercase; color: var(--ld-muted); letter-spacing: .4px; border-bottom-width: 1px; font-weight: 900; background: #fafaff; }
.table td { vertical-align: middle; border-color: var(--ld-line); }

/* ---------------- Chat ---------------- */
.chat-wrap { height: calc(100vh - 240px); min-height: 380px; display: flex; flex-direction: column; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: #f6f6fc; background-image: radial-gradient(#e7e5fb 1px, transparent 1px); background-size: 16px 16px; }
.bubble { max-width: 78%; padding: .6rem .9rem; border-radius: 18px; margin-bottom: .5rem; line-height: 1.5; animation: naik .25s both; }
.bubble.me { background: var(--ld-grad); color: #fff; margin-left: auto; border-bottom-right-radius: 6px; }
.bubble.them { background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.bubble .tm { font-size: .66rem; opacity: .75; margin-top: .2rem; }
.contact { display: flex; gap: .6rem; align-items: center; padding: .75rem .9rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--ld-line); }
.contact.active, .contact:hover { background: #f3f1ff; color: inherit; }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(circle at 10% 10%, #d9d4ff 0, transparent 45%), radial-gradient(circle at 90% 90%, #ffd6ec 0, transparent 40%), #f4f5fb; }
.login-card { max-width: 1000px; width: 100%; border-radius: 32px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(91, 76, 240, .2); display: grid; grid-template-columns: 1.15fr 1fr; animation: naik .5s both; }
.login-art { position: relative; background: #bfe6ff; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.login-illu { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.login-brand { position: relative; display: flex; align-items: center; gap: .7rem; margin: 1.2rem; padding: .7rem .9rem; border-radius: 20px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); align-self: flex-start; color: var(--ld-text); box-shadow: var(--ld-shadow); }
.pilar-row { position: relative; gap: .35rem; flex-wrap: wrap; margin: 1rem; }
.pilar-row span { background: rgba(255,255,255,.9); border-radius: 99px; padding: .3rem .7rem; font-size: .72rem; font-weight: 900; box-shadow: var(--ld-shadow); }
.login-form { padding: 2.4rem 2.2rem; display: flex; flex-direction: column; justify-content: center; }
.login-aman { display: flex; gap: .6rem; align-items: flex-start; font-size: .76rem; color: var(--ld-muted); background: #f6f6fc; padding: .7rem .85rem; border-radius: 14px; }
.login-aman i { color: #10b981; font-size: 1.1rem; }
@media (max-width: 767px) {
  .login-wrap { padding: 0; align-items: stretch; }
  .login-card { grid-template-columns: 1fr; border-radius: 0; box-shadow: none; }
  .login-art { min-height: 240px; }
  .login-form { padding: 1.6rem 1.25rem 2rem; border-radius: 28px 28px 0 0; margin-top: -28px; background: #fff; position: relative; z-index: 2; }
}

/* ---------------- Layar kunci PIN / ganti sandi ---------------- */
.tata-polos { background: var(--ld-grad) fixed; }
.kunci-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.kunci-card { width: 100%; max-width: 380px; background: #fff; border-radius: 32px; padding: 1.6rem 1.4rem 1.2rem; text-align: center; box-shadow: 0 30px 70px rgba(20, 10, 80, .35); animation: naik .4s both; }
.kunci-illu { display: block; width: 150px; margin: -10px auto .3rem; }
.kunci-card .avatar-lg { display: flex; width: 64px; height: 64px; font-size: 2.2rem; border-radius: 20px; }
.pin-dots { display: flex; justify-content: center; gap: .7rem; margin: .4rem 0 1rem; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c9c3fb; transition: all .15s; }
.pin-dots span.isi { background: var(--ld-primary); border-color: var(--ld-primary); transform: scale(1.1); }
.pin-dots.goyang { animation: goyang .4s 2; }
.pin-pad button { background: #f4f3ff; color: var(--ld-text); }
.pin-pad button:hover { background: #e9e6ff; }
.pin-pad .btn-ok { background: var(--ld-grad); color: #fff; }

/* Kekuatan kata sandi */
.kekuatan { height: 6px; border-radius: 99px; background: #eceef7; overflow: hidden; }
.kekuatan > div { height: 100%; width: 0; border-radius: 99px; transition: width .25s, background .25s; }

/* Profil */
.profil-cover { height: 96px; border-radius: var(--ld-radius) var(--ld-radius) 0 0; background: var(--ld-grad); position: relative; overflow: hidden; }
.profil-cover::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.2) 1.5px, transparent 1.5px); background-size: 16px 16px; }
.avatar-pilih { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .4rem; }
.avatar-pilih label.btn { font-size: 1.5rem; padding: .25rem 0; border: 2px solid var(--ld-line); background: #fff; }
.avatar-pilih .btn-check:checked + label { border-color: var(--ld-primary); background: #eeebff; box-shadow: 0 0 0 3px rgba(91,76,240,.15); }
.perangkat-ikon { width: 42px; height: 42px; border-radius: 14px; background: #eeebff; color: var(--ld-primary); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.kartu-skor { background: linear-gradient(135deg, #fff, #f6f4ff); }

/* Sertifikat */
.sertifikat { max-width: 900px; margin: 0 auto; background: #fff; border: 14px solid #f59e0b; outline: 4px solid #5b4cf0; outline-offset: -26px; border-radius: 12px; padding: 3rem 2rem; text-align: center; }
.sertifikat h1 { font-weight: 900; color: #5b4cf0; font-size: 2.6rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }
.toast { border-radius: 16px; }

/* ---------------- Cetak (PDF) ---------------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .bottom-nav, .footer-note, .no-print, .toast-container { display: none !important; }
  .print-only { display: block !important; }
  .content { padding: 0 !important; }
  .content > *, .card, .stat { animation: none !important; }
  .card, .stat { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .chart-box { height: 240px !important; }
  .row > * { break-inside: avoid; }
  a { text-decoration: none !important; color: inherit !important; }
  .col-print-6 { flex: 0 0 auto; width: 50% !important; }
}

/* ---------------- Kartu akun (cetak) ---------------- */
.kartu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kartu-akun { border: 2px dashed #c9c3fb; border-radius: 18px; padding: 14px 16px; background: #fff; break-inside: avoid; position: relative; overflow: hidden; }
.kartu-akun.ortu { border-color: #fbc5e0; }
.kartu-akun::before { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: #f1eeff; }
.kartu-akun.ortu::before { background: #fde4f2; }
.ka-kepala { display: flex; align-items: center; gap: 8px; position: relative; }
.ka-kepala img { border-radius: 10px; }
.ka-kepala b { display: block; font-size: .8rem; letter-spacing: .5px; }
.ka-kepala small { display: block; font-size: .65rem; color: var(--ld-muted); }
.ka-peran { margin-left: auto; font-size: .68rem; font-weight: 900; background: var(--ld-grad); color: #fff; border-radius: 99px; padding: 2px 10px; }
.ka-nama { font-weight: 900; font-size: 1.1rem; margin-top: 10px; position: relative; }
.ka-ket { font-size: .75rem; color: var(--ld-muted); margin-bottom: 6px; }
.ka-baris { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--ld-line); padding: 6px 0; font-size: .8rem; }
.ka-baris code { font-size: 1rem; font-weight: 900; color: #1e1b3a; background: #f6f6fc; padding: 2px 8px; border-radius: 8px; }
.ka-kaki { font-size: .64rem; color: var(--ld-muted); margin-top: 6px; line-height: 1.4; }
@media print {
  .kartu-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kartu-akun { border-color: #999; }
}
.unggah-zona { display: flex; flex-direction: column; align-items: center; gap: .2rem; border: 2px dashed #c9c3fb; border-radius: 20px; padding: 1.4rem 1rem; background: #faf9ff; cursor: pointer; text-align: center; transition: background .15s; width: 100%; }
.unggah-zona:hover { background: #f3f1ff; }
.unggah-zona > i { font-size: 2.4rem; color: var(--ld-primary); }
.sticky-top { z-index: 2; }
@media print {
  body.cetak-sebagian .content > :not(.dicetak) { display: none !important; }
  body.cetak-sebagian .dicetak { border: 0 !important; margin: 0 !important; }
}
