/* =====================================================================
   SILATARA — gaya visual "buku tulis siswa"
   Kertas kotak-kotak, tinta biru pulpen, coretan stabilo, dan warna
   pembatas buku yang berbeda untuk tiap menu.
   Catatan: nama variabel lama (--teal, --amber, …) dipertahankan agar
   semua halaman tetap memakai token yang sama; nilainya sudah diganti.
   ===================================================================== */
:root {
  --paper: #f6f8fd;          /* kertas */
  --paper-2: #edf1fa;
  --grid: rgba(47, 91, 216, .055);
  --card: #ffffff;
  --ink: #24233d;            /* tinta */
  --ink-soft: #5e6483;
  --line: #dde3f0;
  --teal: #2f5bd8;           /* biru pulpen (warna utama) */
  --teal-dark: #2146ad;
  --teal-soft: #e6edfd;
  --amber: #ffb020;          /* kuning cerah (aksen) */
  --amber-soft: #fff3d6;
  --clay: #ef4f67;           /* koral */
  --clay-soft: #fde5ea;
  --plum: #8b68ee;
  --plum-soft: #efeafe;
  --blue: #1a9fe6;           /* biru langit */
  --blue-soft: #e0f2fd;
  --mint: #12a874;
  --mint-soft: #dcf5ea;
  --stabilo: #ffe45c;
  --radius: 16px;
  --edge: 0 3px 0 rgba(36, 35, 61, .07);
  --shadow: var(--edge);
  --font-body: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fredoka", "Lexend", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --sidebar-w: 260px;

  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-border-color: var(--line);
  --bs-primary: var(--teal);
  --bs-primary-rgb: 47, 91, 216;
  --bs-link-color: var(--teal);
  --bs-link-color-rgb: 47, 91, 216;
  --bs-link-hover-color: var(--teal-dark);
  --bs-border-radius: 12px;
}
/* Warna pembatas per menu */
.mc-biru   { --mc: #2f5bd8; --mc-soft: #e6edfd; }
.mc-hijau  { --mc: #12a874; --mc-soft: #dcf5ea; }
.mc-oranye { --mc: #f27a1a; --mc-soft: #fdebdc; }
.mc-ungu   { --mc: #8b68ee; --mc-soft: #efeafe; }
.mc-pink   { --mc: #e8457d; --mc-soft: #fde4ee; }
.mc-langit { --mc: #1a9fe6; --mc-soft: #e0f2fd; }
.mc-kuning { --mc: #d99a00; --mc-soft: #fff1c9; }

body { background-color: var(--paper); color: var(--ink); font-size: .94rem; line-height: 1.55; }
.app-body, .pub-body { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
h1, h2, h3, .display-font { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
h4, h5, h6 { font-weight: 600; }
a { text-decoration: none; }
.text-muted { color: var(--ink-soft) !important; }
.small-caps { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--stabilo); outline-offset: 2px; }

/* ---------- Tombol ---------- */
.btn { font-weight: 600; border-radius: 12px; transition: transform .06s, box-shadow .06s, background-color .15s; }
.btn:active { transform: translateY(2px); }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-active-bg: var(--teal-dark); --bs-btn-active-border-color: var(--teal-dark); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal); box-shadow: 0 3px 0 var(--teal-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--teal-dark); }
.btn-outline-primary { --bs-btn-color: var(--teal); --bs-btn-border-color: #bccbf3; --bs-btn-bg: #fff; --bs-btn-hover-color: var(--teal-dark); --bs-btn-hover-bg: var(--teal-soft); --bs-btn-hover-border-color: var(--teal); --bs-btn-active-color: var(--teal-dark); --bs-btn-active-bg: var(--teal-soft); --bs-btn-active-border-color: var(--teal); border-width: 1.5px; }
.btn-outline-secondary { --bs-btn-bg: #fff; --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--paper-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #c8d0e2; border-width: 1.5px; }
.btn-accent, .btn-warning { background: var(--amber); color: var(--ink); border-color: var(--amber); box-shadow: 0 3px 0 #d98e00; }
.btn-accent:hover, .btn-warning:hover { background: #ffa000; color: var(--ink); border-color: #ffa000; }
.btn-light { box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 1.2rem; color: var(--ink); }
.btn-icon:hover { background: var(--paper-2); }
.btn-user { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .5rem; }
.btn-user:hover { background: var(--paper-2); }
.form-control, .form-select { border-radius: 12px; border: 1.5px solid var(--line); background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 .22rem rgba(47, 91, 216, .16); }
.form-label { font-weight: 600; font-size: .87rem; margin-bottom: .3rem; }
.form-text { color: var(--ink-soft); }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }

/* ---------- Kerangka aplikasi ---------- */
.app-body { min-height: 100vh; }
.sidebar { background: #fff; color: var(--ink); width: var(--sidebar-w); display: flex; flex-direction: column; border-right: 1.5px solid var(--line); }
@media (min-width: 992px) {
  .sidebar.offcanvas-lg { position: fixed; inset: 0 auto 0 0; z-index: 1030; background-color: #fff !important; }
  .main { margin-left: var(--sidebar-w); }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: 276px; --bs-offcanvas-bg: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem; }
.sidebar-brand .btn-close { filter: none; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; }
.brand-logo-gen { display: inline-flex; align-items: center; justify-content: center; background: var(--amber); color: var(--ink); font-size: 1.3rem; box-shadow: 0 3px 0 #d98e00; transform: rotate(-4deg); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); line-height: 1; }
.brand-sub { font-size: .74rem; color: var(--ink-soft); margin-top: .2rem; }
.sidebar-nav { padding: .4rem .75rem .8rem; flex: 1; overflow-y: auto; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; padding: .42rem .55rem; border-radius: 12px; color: var(--ink-soft); font-weight: 500; font-size: .9rem; margin-bottom: 2px; }
.sidebar .nav-link i { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--mc-soft, var(--paper-2)); color: var(--mc, var(--ink-soft)); }
.sidebar .nav-link:hover { background: var(--paper); color: var(--ink); }
.sidebar .nav-link.active { background: var(--mc-soft, var(--teal-soft)); color: var(--ink); font-weight: 600; }
.sidebar .nav-link.active i { background: var(--mc, var(--teal)); color: #fff; }
.nav-section { font-family: var(--font-display); font-size: .86rem; color: var(--ink-soft); padding: 1rem .6rem .3rem; font-weight: 600; }
.sidebar-foot { padding: .6rem .75rem; border-top: 1.5px dashed var(--line); }

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem; padding: .55rem 1.25rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1.5px solid var(--line); }
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
@media (min-width: 992px) { .topbar-title { display: none; } }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--plum); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .82rem; flex-shrink: 0; font-family: var(--font-display); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.notif-dot { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--clay); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

.content { padding: 1.5rem 1.25rem 2rem; max-width: 1280px; }
@media (min-width: 992px) { .content { padding: 1.9rem 2.2rem 2.5rem; } }
.role-siswa .content { padding-bottom: 6rem; }
@media (min-width: 992px) { .role-siswa .content { padding-bottom: 2.5rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { display: inline; font-size: 1.85rem; line-height: 1.35; margin: 0; padding: 0 .15em; margin-left: -.15em;
  background: linear-gradient(176deg, transparent 56%, var(--stabilo) 56%, var(--stabilo) 90%, transparent 90%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.page-sub { color: var(--ink-soft); margin: .45rem 0 0; max-width: 70ch; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.app-foot { padding: 1rem 2.2rem 1.5rem; color: var(--ink-soft); font-size: .8rem; }
.kredit-tefa { display: block; font-size: .72rem; opacity: .8; margin-top: .15rem; }
.role-siswa .app-foot { padding-bottom: 5.5rem; }
@media (min-width: 992px) { .role-siswa .app-foot { padding-bottom: 1.5rem; } }

/* Navigasi bawah siswa (HP) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; display: flex; background: #fff; border-top: 1.5px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-soft); font-size: .68rem; font-weight: 600; padding: .25rem 0; border-radius: 12px; }
.bottom-nav a i { font-size: 1.2rem; width: 40px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.bottom-nav a.active { color: var(--ink); }
.bottom-nav a.active i { background: var(--mc, var(--teal)); color: #fff; }

/* ---------- Kartu ---------- */
.card { border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--edge); background: var(--card); }
.card-header { background: transparent; border-bottom: 1.5px dashed var(--line); padding: .9rem 1.15rem; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-header .small, .card-header small, .card-header a, .card-header form, .card-header .btn { font-family: var(--font-body); font-size: .82rem; }
.card-body { padding: 1.15rem; }
.card-title-sm { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin: 0; }

.stat-card { --tc: var(--teal); --ts: var(--teal-soft); display: flex; align-items: center; gap: .9rem; background: #fff; border: 2px solid var(--ts); border-radius: 18px; padding: 1rem 1.1rem; box-shadow: 0 4px 0 var(--ts); height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; background: var(--tc); color: #fff; }
.stat-value { font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: .82rem; color: var(--ink); font-weight: 500; }
.stat-note { font-size: .74rem; color: var(--ink-soft); }
.tone-teal { --tc: var(--teal); --ts: var(--teal-soft); }
.tone-amber { --tc: #f59e0b; --ts: var(--amber-soft); }
.tone-clay { --tc: var(--clay); --ts: var(--clay-soft); }
.tone-plum { --tc: var(--plum); --ts: var(--plum-soft); }
.tone-blue { --tc: var(--blue); --ts: var(--blue-soft); }
.tone-mint { --tc: var(--mint); --ts: var(--mint-soft); }

.hello-card { background-color: var(--teal); background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 24px 24px; color: #fff; border-radius: 20px; padding: 1.5rem; position: relative; overflow: hidden; box-shadow: 0 4px 0 var(--teal-dark); }
.hello-card > * { position: relative; z-index: 1; }
.hello-card .hello-deco { position: absolute; right: 10px; bottom: -26px; font-size: 8.5rem; opacity: .16; z-index: 0; line-height: 1; transform: rotate(-12deg); }
.hello-card h2 { font-size: 1.7rem; margin-bottom: .3rem; }
.hello-card p { color: #dfe7ff; margin: 0; }
.hello-card .btn-light { color: var(--teal-dark); }

/* ---------- Lencana / badge ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }
.badge-soft-success { background: var(--mint-soft); color: #0b6b4a; }
.badge-soft-warning { background: var(--amber-soft); color: #8a5300; }
.badge-soft-danger { background: var(--clay-soft); color: #a3203a; }
.badge-soft-info { background: var(--blue-soft); color: #0a5f8f; }
.badge-soft-secondary { background: #eceff6; color: #4c5270; }
.badge-soft-primary { background: var(--teal-soft); color: var(--teal-dark); }
.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .2rem .7rem; font-size: .76rem; font-weight: 600; background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--teal)); }

.medal { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; color: #fff; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.15); margin: 0 auto .6rem; }
.medal.locked { background: #d6dbe8; color: #fff; filter: grayscale(1); opacity: .7; }
.badge-tile { text-align: center; padding: 1.1rem .6rem; }
.badge-tile h6 { margin-bottom: .15rem; }

/* ---------- Sampul buku ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem; }
@media (max-width: 420px) { .book-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; } }
.book-card { display: flex; flex-direction: column; color: var(--ink); }
.book-card:hover .cover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(29,42,44,.18); }
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px 10px 10px 6px; box-shadow: 0 4px 12px rgba(29,42,44,.14); transition: .2s ease; background: var(--paper-2); }
.cover-gen { display: flex; flex-direction: column; justify-content: space-between; padding: 1rem .8rem; color: #fff; background: linear-gradient(160deg, var(--c) 0%, color-mix(in srgb, var(--c) 60%, #000) 100%); position: relative; overflow: hidden; }
.cover-gen::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.25); }
.cover-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.2; padding-left: .4rem; }
.cover-author { font-size: .72rem; opacity: .85; padding-left: .4rem; }
.book-meta { padding-top: .6rem; flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.book-meta > .d-flex { align-self: stretch; }
.book-title { font-weight: 700; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: .78rem; color: var(--ink-soft); }
.cover-sm { width: 52px; flex-shrink: 0; }
.cover-sm.cover-gen { padding: .35rem; }
.cover-sm .cover-title { font-size: .5rem; padding: 0; }
.cover-sm .cover-author, .cover-sm.cover-gen::before { display: none; }
.cover-md { width: 180px; max-width: 45vw; }

.reader-frame { width: 100%; height: 78vh; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---------- Tabel ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { font-size: .8rem; color: var(--ink-soft); font-weight: 600; background: var(--paper); white-space: nowrap; }
.table-hover tbody tr:hover > * { background: #f4f7ff; }

/* ---------- Peringkat ---------- */
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; gap: .8rem; padding: .65rem .2rem; border-bottom: 1px dashed var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-no { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; background: var(--paper-2); color: var(--ink-soft); flex-shrink: 0; }
.rank-1 .rank-no { background: #f5c542; color: #6b4e00; }
.rank-2 .rank-no { background: #d5dbe0; color: #3d4852; }
.rank-3 .rank-no { background: #e9b48a; color: #6b3410; }
.rank-me { background: var(--amber-soft); border-radius: 10px; }
.rank-pts { margin-left: auto; font-weight: 800; color: var(--teal); white-space: nowrap; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .6rem; padding: 1rem 0 0; }
.podium-item { text-align: center; flex: 1; max-width: 160px; }
.podium-bar { border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: .5rem; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #fff; }
.podium-1 .podium-bar { height: 120px; background: linear-gradient(#e0a919, #b8860b); }
.podium-2 .podium-bar { height: 90px; background: linear-gradient(#9aa6b2, #6f7c88); }
.podium-3 .podium-bar { height: 70px; background: linear-gradient(#cf8a57, #a35f2f); }
.podium-name { font-weight: 700; font-size: .85rem; line-height: 1.2; margin-top: .4rem; }
.podium-pts { font-size: .78rem; color: var(--ink-soft); margin-bottom: .4rem; }

/* ---------- Progres & lainnya ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--paper-2); }
.progress-bar { background: var(--mint); border-radius: 999px; }
.progress-bar.bg-amber { background: var(--amber); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty-state > i { font-size: 2.8rem; color: var(--amber); display: block; margin-bottom: .6rem; }
.empty-state h5 { color: var(--ink); }
.notif-item { display: flex; gap: .85rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif-item.unread { background: #f4f7ff; }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.word-counter { font-size: .8rem; font-weight: 600; }
.word-counter.ok { color: #16a34a; }
.word-counter.kurang { color: var(--clay); }
.prose { font-size: 1.02rem; line-height: 1.8; white-space: pre-line; }
.prose-poem { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; text-align: center; }
.quote-block { border-left: 4px solid var(--stabilo); background: #fffbe3; padding: .9rem 1.1rem; border-radius: 0 12px 12px 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.timer-pill { position: sticky; top: 64px; z-index: 5; display: inline-flex; align-items: center; gap: .4rem; background: var(--ink); color: #fff; border-radius: 999px; padding: .35rem .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-pill.warn { background: var(--clay); }
.soal-card .form-check { padding: .65rem .9rem .65rem 2.4rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .45rem; cursor: pointer; }
.soal-card .form-check:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.soal-card .form-check-input { margin-left: -1.5rem; }
.kunci-benar { color: #16a34a; font-weight: 700; }
.kunci-salah { color: var(--clay); text-decoration: line-through; }

/* ---------- Halaman login & publik ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.1fr 1fr; } }
.auth-art { display: none; background-color: var(--teal); background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 24px 24px; color: #fff; padding: 3rem; position: relative; overflow: hidden; }
@media (min-width: 992px) { .auth-art { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-art h1 { font-size: 2.6rem; line-height: 1.1; }
.auth-art .lead { color: #dfe7ff; }
.auth-art-books { position: absolute; right: -40px; bottom: -30px; display: flex; gap: 10px; transform: rotate(-8deg); opacity: .9; }
.auth-art-books span { width: 46px; border-radius: 4px 4px 0 0; display: block; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; }
.role-tabs .nav-link { color: var(--ink-soft); font-weight: 600; border-radius: 10px; }
.role-tabs .nav-link.active { background: var(--teal); color: #fff; }

.pub-nav { background: rgba(255,255,255,.94); border-bottom: 1.5px solid var(--line); backdrop-filter: blur(8px); }
.pub-nav .navbar-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.hero { background-color: var(--teal); background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 24px 24px; color: #fff; padding: 3.5rem 0 4rem; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; }
.hero .lead { color: #e3eaff; max-width: 560px; }
.hero-quote { background: var(--stabilo); color: var(--ink); border-radius: 4px 4px 18px 4px; padding: 1.5rem 1.5rem 1.3rem; transform: rotate(-2deg); box-shadow: 0 10px 0 rgba(0,0,0,.12); max-width: 440px; margin-left: auto; position: relative; }
.hero-quote::before { content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 24px; margin-left: -45px; background: rgba(255,255,255,.55); transform: rotate(3deg); }
.hero-quote .bi-quote { color: var(--teal) !important; }
.hero-quote blockquote { font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.35; margin: 0 0 .6rem; }
.hero-quote figcaption { color: var(--ink-soft); font-size: .85rem; font-weight: 600; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.8rem; margin-top: 2rem; }
.hero-stats strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 2rem; }
.hero-stats span { color: #d4defc; font-size: .82rem; }
.section { padding: 3rem 0; }
.section-title { font-size: 1.7rem; margin-bottom: .3rem; }
.section-alt { background: var(--paper-2); }
.karya-card { display: block; height: 100%; color: var(--ink); }
.karya-card:hover { border-color: var(--mc, var(--plum)); }
.karya-card .karya-excerpt { color: var(--ink-soft); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jenis-tag { display: inline-block; font-size: .74rem; font-weight: 600; color: #a3203a; background: var(--clay-soft); border-radius: 999px; padding: .1rem .6rem; text-transform: capitalize; }

/* ---------- Cetak ---------- */
.print-page { background: #fff; color: #000; font-family: "Times New Roman", serif; font-size: 12pt; }
.print-page .kop img { width: 100%; max-height: 130px; object-fit: contain; }
.print-page .kop { border-bottom: 3px double #000; padding-bottom: 6px; margin-bottom: 14px; }
.kop-text { text-align: center; }
.kop-nama { font-size: 18pt; font-weight: bold; text-transform: uppercase; }
.print-page table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.print-page th, .print-page td { border: 1px solid #000; padding: 4px 6px; }
.print-page th { background: #eee; }
.print-toolbar { position: sticky; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; display: flex; gap: .5rem; align-items: center; z-index: 10; font-family: var(--font-body); }
.ttd-blok { display: flex; justify-content: space-between; gap: 24px; margin-top: 24px; font-size: 11pt; break-inside: avoid; page-break-inside: avoid; }
.ttd-blok > div { width: 45%; }
.ttd-blok .ruang { height: 64px; }
.print-page thead { display: table-header-group; }
.print-page tr { break-inside: avoid; page-break-inside: avoid; }
@media print {
  .print-toolbar, .no-print { display: none !important; }
  body { background: #fff; }
  @page { margin: 1.5cm; }
}

/* Sertifikat penghargaan (A4 lanskap) */
.sertifikat { width: 297mm; height: 210mm; margin: 0 auto 20px; background: #fffdf8; position: relative; padding: 9mm; page-break-after: always; break-after: page; box-sizing: border-box; font-family: var(--font-body); color: #1d2a2c; overflow: hidden;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sertifikat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, rgba(217,119,6,.07), transparent 55%), repeating-linear-gradient(45deg, rgba(15,94,90,.025) 0 2px, transparent 2px 9px); }
.srt-bingkai { position: relative; height: 100%; border: 2.4mm solid #0b4441; outline: .5mm solid #c8962e; outline-offset: -4.2mm; padding: 8mm 24mm 6.5mm; display: flex; flex-direction: column; align-items: center; text-align: center; box-sizing: border-box; }
.srt-sudut { position: absolute; width: 30mm; height: 30mm; color: #c8962e; }
.srt-sudut svg { width: 100%; height: 100%; display: block; }
.srt-sudut.kiri-atas { left: 3.4mm; top: 3.4mm; }
.srt-sudut.kanan-atas { right: 3.4mm; top: 3.4mm; transform: scaleX(-1); }
.srt-sudut.kiri-bawah { left: 3.4mm; bottom: 3.4mm; transform: scaleY(-1); }
.srt-sudut.kanan-bawah { right: 3.4mm; bottom: 3.4mm; transform: scale(-1, -1); }
.srt-kop { display: flex; align-items: center; justify-content: center; gap: 6mm; width: 100%; }
.srt-logo { width: 15mm; height: 15mm; display: flex; align-items: center; justify-content: center; }
.srt-logo img, .srt-logo svg { max-width: 100%; max-height: 100%; }
.srt-instansi b { display: block; font-size: 13pt; letter-spacing: .14em; color: #0b4441; }
.srt-instansi span { font-size: 9.5pt; letter-spacing: .06em; color: #6b5a3a; }
.srt-judul { font-family: var(--font-serif); font-weight: 700; font-size: 38pt; letter-spacing: .1em; text-transform: uppercase; color: #0b4441; margin: 2mm 0 0; line-height: 1; }
.srt-sub { font-size: 13pt; font-weight: 700; letter-spacing: .55em; text-transform: uppercase; color: #b7791f; margin-top: 1.5mm; padding-left: .55em; }
.srt-sub::before, .srt-sub::after { content: ""; display: inline-block; width: 18mm; height: .4mm; background: #c8962e; vertical-align: middle; margin: 0 4mm; }
.srt-no { font-size: 9.5pt; color: #6b6b6b; margin-top: 1.5mm; }
.srt-teks { font-size: 11pt; margin: 1.5mm 0 0; color: #3b4a4c; }
.srt-nama { font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: 29pt; color: #b45309; line-height: 1.15; margin-top: 1mm; padding: 0 12mm 1.2mm; border-bottom: .4mm solid #c8962e; max-width: 220mm; }
.srt-id { font-size: 10pt; color: #555; margin-top: 1.5mm; }
.srt-predikat { font-size: 15pt; font-weight: 800; color: #0b4441; letter-spacing: .04em; text-transform: uppercase; margin-top: .5mm; }
.srt-isi { font-size: 10.5pt; line-height: 1.5; max-width: 205mm; margin: 2mm auto 0; color: #2c3a3c; }
.srt-stat { display: flex; justify-content: center; gap: 2.5mm; margin-top: 2.5mm; margin-bottom: 2mm; flex-wrap: wrap; }
.srt-stat span { border: .3mm solid #e2cfa3; background: rgba(253,231,194,.35); border-radius: 2mm; padding: 1.2mm 3.2mm; font-size: 8.5pt; color: #5b4a2a; }
.srt-stat b { font-size: 11pt; color: #0b4441; margin-right: 1.2mm; }
.srt-ttd { display: grid; grid-template-columns: 1fr 34mm 1fr; align-items: end; width: 100%; margin-top: auto; font-size: 10.5pt; gap: 4mm; }
.srt-ttd-blok { line-height: 1.45; }
.srt-ruang { height: 17mm; }
.srt-ttd-nama { font-weight: 700; text-decoration: underline; text-underline-offset: 1mm; }
.srt-medali svg { width: 27mm; display: block; margin: 0 auto 1mm; font-family: var(--font-body); }
.srt-kaki { font-size: 7pt; color: #9a8a6a; margin-top: 1.5mm; letter-spacing: .04em; }
@media print {
  @page sertifikat { size: A4 landscape; margin: 0; }
  .sertifikat-wrap { page: sertifikat; background: none; padding: 0; }
  .sertifikat { margin: 0; box-shadow: none; }
}
@media screen { .sertifikat-wrap { background: #e8e2d6; padding: 20px; overflow-x: auto; } .sertifikat { box-shadow: 0 6px 30px rgba(0,0,0,.15); } }

/* ---------- v2: perpustakaan ---------- */
.format-tag { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 3px; }
.format-tag i { background: rgba(255,255,255,.92); color: var(--teal-dark); border-radius: 6px; padding: 2px 5px; font-size: .78rem; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.stars.small { font-size: .75rem; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.6rem; color: #d8d2c6; cursor: pointer; transition: .1s; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: #f59e0b; }
.scan-input { font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.kios { max-width: 760px; margin: 0 auto; }
.kios .kios-input { font-size: 1.6rem; padding: .8rem 1.1rem; text-align: center; }
.keperluan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.keperluan-grid .btn { padding: .9rem .5rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.keperluan-grid .btn i { font-size: 1.5rem; }
.anggota-box { border: 2px solid var(--teal); border-radius: var(--radius); background: var(--teal-soft); }
.tr-telat > * { background: #fff3f2 !important; }

/* Kartu anggota & label barcode (cetak) */
.kartu-grid { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 6mm 8mm; justify-content: center; }
.kartu { width: 85.6mm; height: 54mm; border-radius: 3.2mm; overflow: hidden; position: relative; background: #fff; border: 1px solid #ddd; font-family: var(--font-body); color: var(--ink); break-inside: avoid; page-break-inside: avoid; display: flex; flex-direction: column; }
.kartu-head { background: linear-gradient(120deg, var(--teal) 0%, var(--teal-dark) 100%); color: #fff; padding: 2.4mm 3mm; display: flex; align-items: center; gap: 2.4mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.kartu-head img, .kartu-head .kartu-logo { width: 9mm; height: 9mm; border-radius: 2mm; background: #fff; object-fit: contain; padding: .4mm; }
.kartu-head .kartu-logo { display: flex; align-items: center; justify-content: center; background: var(--amber); color: #fff; font-size: 5mm; }
.kartu-head b { display: block; font-size: 3.1mm; letter-spacing: .04em; line-height: 1.1; }
.kartu-head small { font-size: 2.3mm; opacity: .85; }
.kartu-body { padding: 2mm 3mm 0; flex: 1; display: flex; flex-direction: column; }
.kartu-nama { font-family: var(--font-display); font-weight: 700; font-size: 4.1mm; line-height: 1.15; }
.kartu-info { font-size: 2.6mm; color: var(--ink-soft); }
.kartu svg { width: 100%; height: 13mm; margin-top: auto; }
.kartu-strip { height: 1.6mm; background: var(--amber); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.label-grid { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 33.9mm; gap: 0 2.5mm; justify-content: center; }
.label { border: 1px dashed #ccc; padding: 2mm 2.5mm; font-family: var(--font-body); display: flex; flex-direction: column; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.label .l-sekolah { font-size: 2.2mm; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.label .l-judul { font-size: 2.8mm; font-weight: 700; line-height: 1.15; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.label .l-judul.panjang { font-size: 2.3mm; }
.label .l-rak { font-size: 2.4mm; color: #333; }
.label svg { width: 100%; height: 17mm; margin-top: auto; }
/* Garis potong: kotak tipis di tepi tiap label, ikut tercetak */
.label-grid.bergaris .label { border: .25mm solid #6b7280; }
.label-grid:not(.bergaris) .label { border: 1px dashed #d1d5db; }
@media print { .label-grid:not(.bergaris) .label { border-color: transparent; } .kartu { border-color: #bbb; } }

/* Nomor panggil — pratinjau di form */
.np-blok { display: flex; gap: 1rem; align-items: flex-start; background: var(--teal-soft); border-radius: 12px; padding: .9rem; }
.np-pratinjau { flex: 0 0 74px; min-height: 104px; background: #fff; border: 2px solid #1f2937; border-radius: 6px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  font-family: "Courier New", ui-monospace, monospace; font-weight: 700; font-size: 15px; line-height: 1.15; padding: 6px 2px; }
.np-pratinjau .np-panjang { font-size: 11px; }
.np-pratinjau em { font-style: normal; color: #b45309; font-size: 12px; }
.np-teks { font-family: ui-monospace, "Courier New", monospace; font-weight: 600; letter-spacing: .02em; }

/* Label gabungan: punggung (nomor panggil) + badan (logo, nama perpustakaan, barcode) */
.label.label-gabung { flex-direction: row; padding: 0; }
.lg-punggung { flex: 0 0 18mm; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.6mm 1mm; border-right: .25mm dashed #9ca3af; position: relative; }
.lg-np { border: .35mm solid #111; border-radius: 1mm; width: 15mm; padding: 1.2mm .4mm; display: flex; flex-direction: column; align-items: center; gap: .3mm;
  font-family: "Courier New", ui-monospace, monospace; font-weight: 700; font-size: 3.4mm; line-height: 1.05; color: #000; text-align: center; }
.lg-np .np-panjang { font-size: 2.45mm; letter-spacing: -.02em; }
.lg-np .np-kosong { font-size: 2mm; color: #999; font-weight: 400; }
.lg-eks { font-size: 2.1mm; color: #333; margin-top: 1mm; font-family: var(--font-body); }
.lg-lipat { position: absolute; right: -1.6mm; top: .4mm; font-size: 1.7mm; color: #9ca3af; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .05em; }
.lg-badan { flex: 1; min-width: 0; padding: 1.6mm 1.8mm 1.4mm 2mm; display: flex; flex-direction: column; }
.lg-kop { display: flex; align-items: center; gap: 1.3mm; padding-bottom: .9mm; border-bottom: .3mm solid #0b4441; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lg-kop svg, .lg-kop .lg-logo { width: 5.4mm; height: 5.4mm; flex-shrink: 0; object-fit: contain; }
.lg-kop .lg-nama { line-height: 1.1; min-width: 0; flex: 1; }
.lg-kop .lg-baris1 { display: flex; align-items: baseline; justify-content: space-between; gap: 1mm; }
.lg-kop .lg-nama b { font-size: 2.05mm; letter-spacing: .09em; color: #0b4441; }
.lg-kop .lg-sekolah { display: block; font-size: 1.95mm; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; color: #111; }
.lg-app { font-size: 1.7mm; font-weight: 800; letter-spacing: .1em; color: #b45309; }
.lg-judul { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 2.3mm; font-weight: 600; line-height: 1.12; margin: .6mm 0 .5mm; color: #222; overflow: hidden; }
.lg-judul span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lg-judul small { font-size: 1.8mm; font-weight: 500; color: #555; margin-top: .3mm; }
.lg-judul.panjang { font-size: 2mm; }
.lg-judul.panjang span { -webkit-line-clamp: 4; }
.lg-judul.sangat-panjang { font-size: 1.75mm; }
.lg-judul.sangat-panjang span { -webkit-line-clamp: 5; }
.label.label-gabung svg.barcode { width: 100%; height: 12mm; margin-top: 0; flex-shrink: 0; }
@media print { .lg-punggung { border-right-color: #c7cbd1; } }

/* Pindai dengan kamera */
.kamera-modal video { display: block; width: 100%; max-height: 62vh; object-fit: cover; background: #000; }
.modal-fullscreen-sm-down .kamera-modal video { max-height: none; height: 100%; }
.kamera-modal .modal-body { min-height: 240px; overflow: hidden; }
.km-bingkai { position: absolute; left: 8%; right: 8%; top: 32%; bottom: 32%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.38); pointer-events: none; }
.km-garis { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: km-sapu 1.6s ease-in-out infinite alternate; }
@keyframes km-sapu { from { transform: translateY(-28px); } to { transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .km-garis { animation: none; } }
.km-hasil { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); background: #16a34a; color: #fff; font-family: ui-monospace, monospace; font-weight: 700; padding: .35rem .9rem; border-radius: 999px; font-size: 1.05rem; }
.btn-kamera.active, #kmSenter.active { background: #fde68a; }

/* Foto bukti membaca (jurnal) */
.foto-deret { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.foto-deret:empty { display: none; }
.foto-item { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: center; margin: 0; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; }
.foto-item .foto-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(17,24,39,.72); color: #fff; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.foto-item .foto-uk { position: absolute; left: 4px; bottom: 4px; background: rgba(17,24,39,.65); color: #fff; font-size: .62rem; padding: 0 .3rem; border-radius: 4px; }
.foto-lama { cursor: pointer; }
.foto-lama input { position: absolute; top: 6px; left: 6px; margin: 0; }
.foto-lama .foto-hapus-label { position: absolute; inset: auto 0 0 0; background: rgba(185,28,28,.85); color: #fff; font-size: .66rem; text-align: center; padding: 2px 0; display: none; }
.foto-lama.ditandai img { opacity: .35; }
.foto-lama.ditandai .foto-hapus-label { display: block; }
#fotoTombol label.disabled { opacity: .5; pointer-events: none; }
.foto-jurnal-deret { display: flex; flex-wrap: wrap; gap: .4rem; }
.foto-jurnal-mini { width: var(--uk, 64px); height: var(--uk, 64px); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: block; background: var(--paper); }
.foto-jurnal-mini img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.foto-jurnal-mini:hover img { transform: scale(1.06); }
.foto-lightbox .modal-content { background: #111; }
.foto-lightbox img { max-width: 100%; max-height: 82vh; display: block; margin: 0 auto; }

/* Pas foto siswa */
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; vertical-align: middle; }
.avatar-foto { overflow: hidden; background: var(--paper); }
.avatar-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.dropzone-foto { border: 2px dashed var(--line); border-radius: 14px; padding: 1.6rem 1rem; text-align: center; cursor: pointer; background: var(--paper); transition: .15s; }
.dropzone-foto:hover, .dropzone-foto:focus, .dropzone-foto.aktif { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.dropzone-foto.sibuk { opacity: .6; pointer-events: none; }
.fs-mini { width: 22px; height: 28px; object-fit: cover; border-radius: 3px; vertical-align: middle; }
.foto-siswa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.foto-siswa-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .6rem; display: flex; flex-direction: column; gap: .3rem; position: relative; }
.foto-siswa-item.memuat { opacity: .55; pointer-events: none; }
.foto-siswa-item .fs-foto { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; }
.foto-siswa-item .fs-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.foto-siswa-item .fs-inisial { font-family: var(--font-display); font-size: 2.2rem; color: var(--teal); opacity: .55; }
.foto-siswa-item .fs-nama { font-weight: 700; font-size: .86rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foto-siswa-item .fs-info { font-size: .72rem; color: var(--ink-soft); line-height: 1.35; }
.foto-siswa-item .fs-aksi { display: flex; gap: .35rem; margin-top: auto; }
.foto-siswa-item .fs-aksi .btn { flex: 1; }
/* Kartu anggota dengan pas foto */
.kartu-body.ada-foto { flex-direction: row; gap: 2.4mm; padding-bottom: 1.4mm; }
.kartu-foto { width: 17mm; height: 22.6mm; border-radius: 1.4mm; overflow: hidden; flex-shrink: 0; background: #eee; border: .3mm solid #ddd; }
.kartu-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.kartu-isi { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kartu-body.ada-foto svg { height: 10.5mm; }
.avatar-kotak.avatar-foto { border-radius: 10px; width: 52px; height: 68px; }

/* Laporan perpustakaan (akreditasi) */
.lap-bab { font-family: var(--font-display); font-size: 1.25rem; margin: 1.6rem 0 .3rem; padding-bottom: .35rem; border-bottom: 2px solid var(--teal-soft); color: var(--teal-dark); scroll-margin-top: 80px; }
.lap-bab:first-child { margin-top: 0; }
.lap-bab span { color: var(--amber); margin-right: .2rem; }
.lap-sub { font-size: .95rem; font-weight: 700; margin: 1.1rem 0 .4rem; }
.lap-ket { font-size: .85rem; color: var(--ink-soft); margin-bottom: .5rem; }
.lap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: .6rem 0 .4rem; }
.lap-grid > div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.lap-grid b { display: block; font-family: var(--font-display); font-size: 1.45rem; color: var(--teal-dark); line-height: 1.1; }
.lap-grid span { font-size: .75rem; color: var(--ink-soft); }
.lap-tabel { font-size: .86rem; }
.lap-tabel tbody tr.fw-bold td { border-top: 2px solid var(--line); }
.lap-nav { display: flex; flex-wrap: wrap; gap: .4rem; position: sticky; top: 64px; z-index: 5; background: var(--paper-2, #f7f3ea); padding: .4rem 0; }
.lap-cetak .lap-judul { text-align: center; font-size: 14pt; margin: 0; font-weight: bold; }
.lap-cetak .lap-periode { text-align: center; margin: 2px 0 12px; }
.lap-cetak .lap-bab { font-family: inherit; font-size: 12.5pt; color: #000; border-bottom: 1px solid #000; margin-top: 16px; break-after: avoid; }
.lap-cetak .lap-bab span { color: #000; }
.lap-cetak .lap-sub { font-size: 11pt; margin: 10px 0 4px; break-after: avoid; }
.lap-cetak .lap-ket { color: #000; font-size: 10.5pt; }
.lap-cetak .lap-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lap-cetak .lap-grid > div { background: none; border: 1px solid #000; border-radius: 0; padding: 4px 6px; break-inside: avoid; }
.lap-cetak .lap-grid b { color: #000; font-family: inherit; font-size: 14pt; }
.lap-cetak .lap-grid span { color: #000; font-size: 9pt; }
.lap-cetak .table-responsive { overflow: visible; }
.lap-cetak .lap-tabel { margin-bottom: 6px; font-size: 10pt; }
.lap-cetak .text-end { text-align: right; }

/* Buku paket: matriks pembagian */
.paket-wadah { max-height: 70vh; overflow: auto; }
.paket-tabel { font-size: .8rem; border-collapse: separate; border-spacing: 0; }
.paket-tabel thead th { position: sticky; top: 0; background: #fff; z-index: 2; vertical-align: bottom; border-bottom: 2px solid var(--line); }
.paket-tabel .pk-siswa { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 190px; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.paket-tabel thead .pk-siswa { z-index: 3; }
.paket-tabel .pk-buku { min-width: 92px; max-width: 120px; text-align: center; font-weight: 600; text-transform: none; letter-spacing: 0; }
.paket-tabel .pk-mapel { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; font-size: .74rem; color: var(--ink); }
.paket-tabel .pk-stok { display: block; font-weight: 400; font-size: .68rem; color: var(--ink-soft); margin-top: 2px; }
.paket-tabel .pk-sel { text-align: center; font-family: ui-monospace, monospace; font-size: .72rem; color: #c9c2b4; white-space: nowrap; }
.paket-tabel .pk-pegang { color: #0b4441; background: #e3f1ef; font-weight: 600; cursor: pointer; }
.paket-tabel .pk-lewat { background: #fde2e1; color: #9b1c1c; }
.paket-tabel .pk-baru { animation: pk-kedip 1.2s ease; }
@keyframes pk-kedip { 0% { background: #fcd34d; } 100% { background: #e3f1ef; } }
.paket-tabel tr.pk-target td { background: #fff7e6; }
.paket-tabel tr.pk-target td.pk-pegang { background: #e3f1ef; }
.paket-tabel tr.pk-target .pk-siswa { box-shadow: inset 4px 0 0 var(--amber); font-weight: 700; }
.paket-tabel.mode-tarik .pk-siswa { cursor: default; }
.paket-tabel tbody tr:hover td { filter: brightness(.98); }
.pk-legend { display: inline-block; padding: 0 .35rem; border-radius: 4px; font-family: ui-monospace, monospace; font-size: .72rem; }
.pk-legend.pk-pegang { background: #e3f1ef; color: #0b4441; }
.pk-legend.pk-lewat { background: #fde2e1; color: #9b1c1c; }
.paket-log { display: flex; flex-direction: column; gap: .25rem; min-height: 1.6rem; }
.pk-log { font-size: .85rem; padding: .3rem .6rem; border-radius: 8px; }
.pk-log.ok { background: #e3f1ef; color: #0b4441; }
.pk-log.gagal { background: #fde2e1; color: #9b1c1c; }
.pk-log:not(:first-child) { opacity: .6; font-size: .78rem; }

/* ---------- Kegiatan, program kerja & anggaran ---------- */
.foto-keg-lama { width: 120px; }
.foto-keg-lama .foto-item { width: 120px; height: 90px; }
.galeri-keg { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.galeri-keg a { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--paper); }
.galeri-keg img { width: 100%; height: 100%; object-fit: cover; }
.galeri-keg span { position: absolute; inset: auto 0 0 0; background: rgba(17,24,39,.66); color: #fff; font-size: .72rem; padding: .2rem .45rem; }
.pagu-meter { height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.pagu-meter > div { height: 100%; background: var(--teal); }
.pagu-meter > div.lewat { background: #b91c1c; }
.agenda-publik { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.agenda-item { display: flex; gap: .75rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; }
.agenda-tgl { flex: 0 0 52px; text-align: center; border-radius: 10px; background: var(--paper); padding: .3rem 0; line-height: 1.1; }
.agenda-tgl b { display: block; font-size: 1.35rem; }
.agenda-tgl small { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- OPAC (katalog publik) ---------- */
.pub-link { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 10px; color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.pub-link:hover, .pub-link.aktif { color: var(--teal-dark); background: var(--teal-soft); }
@media (max-width: 575px) { .pub-link span { display: none; } .pub-nav .pub-nama { display: none; } }
.opac-hero { background-color: var(--teal); background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 24px 24px; color: #fff; padding: 2rem 0 2.2rem; }
.opac-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 0 0 .3rem; }
.opac-hero p { color: #dfe7ff; }
.opac-cari { display: flex; gap: .5rem; max-width: 820px; }
.opac-cari .form-select { flex: 0 0 140px; }
.opac-cari .form-control { flex: 1 1 0; min-width: 0; font-size: 1.05rem; }
.opac-cari .btn { display: inline-flex; align-items: center; white-space: nowrap; }
.opac-pinjam { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); background: var(--paper-2); border-radius: 10px; padding: .6rem .8rem; }
@media (max-width: 575px) { .opac-cari { flex-wrap: wrap; } .opac-cari .form-select { flex: 1 1 100%; } }
.opac-faset a { color: var(--ink); text-decoration: none; }
.opac-faset a:hover { color: var(--teal); text-decoration: underline; }
.opac-faset li { padding: .15rem 0; }
.opac-hasil { display: flex; flex-direction: column; gap: .6rem; }
.opac-item { display: flex; gap: 1rem; align-items: flex-start; padding: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.opac-item:hover { border-color: var(--teal); box-shadow: var(--shadow); color: var(--ink); }
.opac-thumb { flex: 0 0 64px; width: 64px; min-width: 0; overflow: hidden; }
.opac-thumb .cover { width: 64px; }
.opac-thumb .cover { border-radius: 3px 6px 6px 3px; }
.opac-thumb .cover-gen .cover-title { font-size: .5rem; }
.opac-thumb .cover-gen .cover-author { display: none; }
.opac-judul { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.min-w-0 { min-width: 0; }
.opac-np-kecil, .opac-np { flex: 0 0 auto; text-align: center; border: 1px dashed var(--line); border-radius: 10px; padding: .35rem .6rem; background: var(--paper); line-height: 1.2; }
.opac-np-kecil span, .opac-np span { display: block; font-size: .7rem; color: var(--ink-soft); }
.opac-np-kecil b, .opac-np b { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.opac-np-kecil small, .opac-np small { color: var(--ink-soft); font-size: .7rem; }
.opac-np b { font-size: 1.15rem; }
@media (max-width: 575px) { .opac-np-kecil { display: none; } .opac-thumb, .opac-thumb .cover { flex-basis: 52px; width: 52px; } }
.opac-sampul { max-width: 240px; margin: 0 auto; }
.opac-biblio th { width: 32%; font-weight: 500; color: var(--ink-soft); }
.opac-kios .opac-hero { padding-top: 2.6rem; }
.auth-art .brand-name { color: #fff; }
.auth-art .brand-sub { color: #d4defc; }

/* Pengarang lebih dari satu */
.penulis-daftar .input-group-text.penulis-no { min-width: 2.2rem; justify-content: center; font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px 0 0 12px; }
.penulis-daftar .input-group > .btn { border-radius: 0 12px 12px 0; }
.penulis-tambah { font-size: .84rem; text-decoration: none; }

/* Logo SILATARA */
.app-logo { object-fit: contain; background: #fff; padding: 2px; }
.sidebar-brand .app-logo, .pub-nav .app-logo { box-shadow: 0 2px 0 var(--line); }
.logo-lengkap { width: 100%; max-width: 300px; height: auto; }
.logo-pita { margin: .55rem auto 0; max-width: 320px; }
.logo-pita span { display: inline-block; background: var(--teal-dark); color: #fff; font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .98rem; line-height: 1.25; padding: .35rem 1.1rem; border-radius: 6px; transform: skewX(-12deg); box-shadow: -5px 0 0 var(--amber); }
.logo-pita span::first-line { transform: skewX(12deg); }
.logo-ganti { width: 96px; height: 96px; object-fit: contain; }
.logo-ganti-nama { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; color: var(--teal-dark); line-height: 1.1; margin-top: .4rem; }
.kartu-head .kartu-app { width: 9mm; height: 9mm; border-radius: 2mm; background: #fff; object-fit: contain; padding: .4mm; flex-shrink: 0; }
.kios-logo { width: 72px; height: 72px; border-radius: 18px; }

/* Tebak DDC dengan AI */
.ai-saran { margin-top: .4rem; padding: .55rem .75rem; border-radius: 12px; background: var(--plum-soft); border: 1.5px solid #d9cdfb; }
.ai-saran .badge, .ai-saran-mini { font-weight: 600; }
.ai-saran .badge { background: #fff; color: #4a2fb0; border: 1px solid #d9cdfb; }
.ai-saran.ai-rendah { background: var(--amber-soft); border-color: #f4d58f; }
.ai-saran.ai-rendah .badge { color: #8a5300; border-color: #f4d58f; }
.ai-saran-mini { font-size: .76rem; color: #4a2fb0; }
.ai-saran-mini.ai-rendah { color: #8a5300; }
.ai-proses > td { background: #f5f1ff !important; }
.btn-ai { --bs-btn-color: #5b3fd6; --bs-btn-border-color: #cfc1fa; --bs-btn-bg: #fff; --bs-btn-hover-bg: var(--plum-soft); --bs-btn-hover-color: #4a2fb0; --bs-btn-hover-border-color: var(--plum); border-width: 1.5px; }

/* ---------- Penilaian mandiri akreditasi ---------- */
.akr-na-angka { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; font-weight: 600; color: var(--ink); }
.akr-predikat { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; transform: rotate(-4deg); box-shadow: var(--edge); }
.akr-komp-baris { display: grid; grid-template-columns: minmax(0, 1fr) 34% 4.2rem; gap: .75rem; align-items: center; padding: .45rem .5rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.akr-komp-baris:hover, .akr-komp-baris.aktif { background: var(--teal-soft); }
.akr-komp-nama { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akr-komp-bar { height: 10px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.akr-komp-bar span { display: block; height: 100%; border-radius: 6px; }
.akr-komp-nilai { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.akr-sub { font-size: 1.05rem; margin: 1.4rem 0 .6rem; color: var(--ink-soft); }
.akr-butir { scroll-margin-top: 80px; }
.akr-butir:target { outline: 3px solid var(--stabilo); }
.akr-kode { display: inline-block; min-width: 2.6rem; font-family: var(--font-display); font-weight: 600; color: var(--teal-dark); }
.akr-status { flex-shrink: 0; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); white-space: nowrap; }
.akr-status.isi-a { background: var(--mint-soft); color: #0b7350; }
.akr-status.isi-b { background: var(--teal-soft); color: var(--teal-dark); }
.akr-status.isi-c { background: var(--amber-soft); color: #8a5a00; }
.akr-status.isi-d { background: var(--clay-soft); color: #b02a41; }
.akr-opsi { display: grid; gap: .35rem; }
.akr-pilih { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .9rem; background: #fff; }
.akr-pilih input { position: absolute; opacity: 0; pointer-events: none; }
.akr-huruf { flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--paper-2); text-transform: uppercase; }
.akr-pilih:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.akr-pilih:has(input:checked) .akr-huruf { background: var(--teal); color: #fff; }
.akr-pilih:has(input:focus-visible) { outline: 3px solid var(--stabilo); }
.akr-pilih.disarankan .akr-huruf { box-shadow: 0 0 0 2px var(--amber); }
.akr-kosong { border-style: dashed; padding-top: .3rem; padding-bottom: .3rem; }
.akr-saran { background: var(--amber-soft); border-radius: 12px; padding: .6rem .75rem; }
.akr-bukti li { padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.akr-tambah { background: var(--paper); border: 1.5px dashed var(--line); border-radius: 12px; padding: .6rem; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.akr-butir-pilih { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; background: var(--paper); }
@media (max-width: 575px) { .akr-komp-baris { grid-template-columns: minmax(0, 1fr) 4rem; } .akr-komp-bar { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- Survei & usulan buku ---------- */
.survei-bar { display: grid; grid-template-columns: minmax(8rem, 34%) 1fr 2.5rem; gap: .6rem; align-items: center; margin-bottom: .3rem; }
.survei-bar-isi { height: 12px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.survei-bar-isi span { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.survei-teks li { padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.survei-qr { width: 120px; height: 120px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.survei-qr svg { width: 100%; height: 100%; }
.survei-skala { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.survei-skala label { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem .25rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; background: #fff; }
.survei-skala input { position: absolute; opacity: 0; pointer-events: none; }
.survei-angka { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1; }
.survei-label { font-size: .72rem; color: var(--ink-soft); line-height: 1.2; }
.survei-skala label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.survei-skala label:has(input:checked) .survei-angka { color: var(--teal-dark); }
.survei-skala label:has(input:focus-visible) { outline: 3px solid var(--stabilo); }
.survei-tanya { border: 0; }
.survei-tanya.salah { box-shadow: 0 0 0 2px var(--clay); }
.survei-tanya legend { float: none; width: auto; }
.tanya-baris { padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.tanya-no { flex-shrink: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-weight: 600; font-size: .85rem; margin-top: .3rem; }
.usulan-dukung .btn { min-width: 3.2rem; line-height: 1.1; padding: .35rem .4rem; }
.usulan-tanggapan { background: var(--amber-soft); border-radius: 8px; padding: .3rem .5rem; display: inline-block; }
@media (max-width: 575px) { .survei-label { font-size: .62rem; } .survei-bar { grid-template-columns: 1fr 2rem; } .survei-bar > span:first-child { grid-column: 1 / -1; } }

/* ---------- Enam literasi dasar, tugas baca, rapor ---------- */
.lit-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 500; padding: .2rem .6rem; border-radius: 999px; border: 1.5px solid transparent; line-height: 1.3; cursor: default; }
.lit-badge.kecil { font-size: .72rem; padding: .1rem .5rem; }
.lit-biru { background: var(--teal-soft); color: var(--teal-dark); }
.lit-ungu { background: var(--plum-soft); color: #5b3cc4; }
.lit-hijau { background: var(--mint-soft); color: #0b7350; }
.lit-langit { background: var(--blue-soft); color: #0f6fa3; }
.lit-kuning { background: var(--amber-soft); color: #8a5a00; }
.lit-oranye { background: var(--clay-soft); color: #b02a41; }
.lit-pilih { display: flex; flex-wrap: wrap; gap: .4rem; }
.lit-pilih .lit-badge { cursor: pointer; opacity: .55; background-color: #fff; border-color: var(--line); color: var(--ink-soft); }
.lit-pilih .btn-check:checked + .lit-badge { opacity: 1; border-color: currentColor; }
.lit-pilih .btn-check:checked + .lit-biru { background: var(--teal-soft); color: var(--teal-dark); }
.lit-pilih .btn-check:checked + .lit-ungu { background: var(--plum-soft); color: #5b3cc4; }
.lit-pilih .btn-check:checked + .lit-hijau { background: var(--mint-soft); color: #0b7350; }
.lit-pilih .btn-check:checked + .lit-langit { background: var(--blue-soft); color: #0f6fa3; }
.lit-pilih .btn-check:checked + .lit-kuning { background: var(--amber-soft); color: #8a5a00; }
.lit-pilih .btn-check:checked + .lit-oranye { background: var(--clay-soft); color: #b02a41; }
.lit-pilih .btn-check:focus-visible + .lit-badge { outline: 3px solid var(--stabilo); }
.lit-baris { display: grid; grid-template-columns: 11rem 1fr 2rem; gap: .6rem; align-items: center; margin-bottom: .45rem; }
.lit-bar { height: 12px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.lit-bar span { display: block; height: 100%; border-radius: 6px; filter: saturate(1.4); }
.lit-bar .lit-biru { background: var(--teal); } .lit-bar .lit-ungu { background: var(--plum); } .lit-bar .lit-hijau { background: var(--mint); }
.lit-bar .lit-langit { background: var(--blue); } .lit-bar .lit-kuning { background: var(--amber); } .lit-bar .lit-oranye { background: var(--clay); }
.tugas-kelas { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; background: var(--paper); }
@media (max-width: 575px) { .lit-baris { grid-template-columns: 1fr 2rem; } .lit-baris .lit-bar { grid-column: 1 / -1; grid-row: 2; } }
.lit-baris .lit-badge { justify-self: start; }

/* Pilihan warna tema di Pengaturan */
.tema-opsi { position: relative; cursor: pointer; }
.tema-opsi input { position: absolute; opacity: 0; }
.tema-opsi span:not(.visually-hidden) { display: block; width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tema-opsi input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.tema-opsi input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
