:root{
  --bg:#f6f8fb;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --text:#172033;
  --muted:#667085;
  --line:#e6eaf0;
  --primary:#123a63;
  --primary-2:#0f2f50;
  --primary-soft:#edf4fb;
  --success:#16805d;
  --success-bg:#eaf8f2;
  --danger:#c34a4a;
  --danger-bg:#fff0f0;
  --warning:#9a6700;
  --warning-bg:#fff8e6;
  --shadow:0 12px 32px rgba(15,23,42,.06);
  --radius:18px;
  --radius-sm:12px;
  --wrap:1180px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
button,a,select,input{outline:none}
img{max-width:100%;display:block}
.wrap{width:min(calc(100% - 40px),var(--wrap));margin-inline:auto}

/* HEADER */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid rgba(230,234,240,.9);
  backdrop-filter:blur(14px);
}
.nav{height:72px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{display:inline-flex;align-items:center;gap:12px;min-width:0}
.brandmark{
  width:42px;height:42px;border:1px solid var(--line);border-radius:12px;
  background:#fff;display:grid;place-items:center;overflow:hidden;flex:none;
  box-shadow:0 4px 14px rgba(15,23,42,.05)
}
.brandmark img{width:32px;height:32px;object-fit:contain}
.brand b{display:block;font-size:14px;letter-spacing:.02em;color:#14233b}
.brand small{display:block;margin-top:1px;color:var(--muted);font-size:12px}


.portal-link{
  display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid var(--line);
  border-radius:11px;background:#fff;color:#27364d;font-weight:650;font-size:13px;
  transition:.2s ease
}
.portal-link:hover{border-color:#c9d5e2;background:var(--surface-soft);transform:translateY(-1px)}

/* HERO */
.hero{
  background:
    radial-gradient(circle at 85% 20%,rgba(83,139,190,.10),transparent 26%),
    linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  border-bottom:1px solid var(--line)
}
.hero-inner{padding:70px 0 48px;text-align:center}
.eyebrow{
  display:inline-flex;align-items:center;gap:8px;color:#55708c;font-size:11px;font-weight:750;
  letter-spacing:.14em;text-transform:uppercase
}
.hero h1{
  max-width:760px;margin:12px auto 12px;font-size:clamp(34px,5vw,58px);line-height:1.08;
  letter-spacing:-.035em;color:#10233c;font-weight:780
}
.hero> .wrap > p,.hero-inner>p{max-width:650px;margin:0 auto;color:var(--muted);font-size:16px}
.searchbox{
  max-width:780px;margin:30px auto 0;padding:6px;display:flex;gap:8px;background:#fff;
  border:1px solid #dfe5ec;border-radius:16px;box-shadow:0 16px 34px rgba(15,23,42,.07)
}
.searchbox input{
  min-width:0;flex:1;border:0;background:transparent;padding:13px 14px;color:var(--text)
}
.searchbox input::placeholder{color:#9aa5b4}
.searchbox button,
.filters button{
  border:0;border-radius:11px;background:var(--primary);color:#fff;font-weight:700;cursor:pointer;
  transition:.2s ease
}
.searchbox button{padding:0 22px;white-space:nowrap}
.searchbox button:hover,.filters button:hover{background:var(--primary-2);transform:translateY(-1px)}
.stats{
  max-width:900px;margin:32px auto 0;display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.86);
  border:1px solid var(--line);border-radius:16px;overflow:hidden
}
.stats>div{padding:17px 18px;position:relative}
.stats>div+div:before{content:"";position:absolute;left:0;top:18px;bottom:18px;width:1px;background:var(--line)}
.stats strong{display:block;font-size:20px;color:#152c48;line-height:1.2}
.stats span{display:block;margin-top:4px;color:var(--muted);font-size:12px}

/* CONTENT */
.content{padding:42px 0 64px}
.section{margin-bottom:54px}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:20px}
.section-head h2{margin:4px 0 0;font-size:25px;line-height:1.25;letter-spacing:-.02em;color:#14233b}
.section-head p{margin:5px 0 0;color:var(--muted);font-size:13px}

/* BOOK CARDS */
.bookgrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}
.bookcard{
  min-width:0;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.02);
  transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease
}
.bookcard:hover{border-color:#d7dee8;box-shadow:var(--shadow);transform:translateY(-3px)}
.book-status-header{
  min-height:42px;padding:0 16px;display:flex;align-items:center;gap:9px;
  border-bottom:1px solid var(--line);font-size:12px;font-weight:750;letter-spacing:.01em
}
.book-status-header.available{background:var(--success-bg);color:var(--success);border-bottom-color:#d5eee4}
.book-status-header.borrowed{background:var(--danger-bg);color:var(--danger);border-bottom-color:#f2d9d9}
.book-status-dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none;box-shadow:0 0 0 3px rgba(255,255,255,.7)}
.book-status-header strong{font-size:12px;font-weight:800}
.bookcover{
  height:118px;display:grid;place-items:center;background:linear-gradient(145deg,#eef4fa,#f8fafc);
  border-bottom:1px solid var(--line)
}
.bookcover span{
  width:54px;height:68px;border-radius:7px 11px 11px 7px;background:#fff;color:#244d75;
  display:grid;place-items:center;font-size:26px;font-weight:800;border:1px solid #dce5ee;
  box-shadow:5px 6px 0 #dbe6f0
}
.popularcover{background:linear-gradient(145deg,#fff9e8,#f9fbfd)}
.popularcover span{box-shadow:none;background:#fffdf7;color:#a77712;border-color:#f1dfb2}
.bookbody{padding:16px;display:flex;flex-direction:column;min-height:190px}
.status,.popbadge{
  align-self:flex-start;display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border-radius:999px;
  font-size:10px;font-weight:750;letter-spacing:.02em
}
.status.available{background:var(--success-bg);color:var(--success)}
.status.borrowed{background:var(--danger-bg);color:var(--danger)}
.popbadge{background:var(--warning-bg);color:var(--warning)}
.bookbody h3{margin:10px 0 5px;font-size:14px;line-height:1.45;font-weight:760;color:#16263d}
.bookbody h3 a{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.bookbody h3 a:hover{color:var(--primary)}
.bookbody p{margin:0;color:#67758a;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bookbody small{display:block;margin-top:8px;color:#8a96a5;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.code{
  margin-top:auto;padding-top:12px;color:#536174;font-size:11px;font-weight:700;letter-spacing:.03em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.catalog-section{margin-bottom:0;padding-top:4px}

/* FILTER */
.filters{
  display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) auto auto;gap:10px;align-items:center;
  margin-bottom:20px;padding:12px;background:#fff;border:1px solid var(--line);border-radius:15px
}
.filters select{
  width:100%;min-width:0;height:42px;padding:0 38px 0 12px;border:1px solid var(--line);border-radius:10px;
  background:#fff;color:#344054;cursor:pointer
}
.filters select:focus,.searchbox:focus-within{border-color:#aebfd1;box-shadow:0 0 0 3px rgba(26,77,126,.07)}
.filters button{height:42px;padding:0 16px}
.reset{
  height:42px;display:inline-flex;align-items:center;justify-content:center;padding:0 15px;border:1px solid var(--line);
  border-radius:10px;color:#59677a;font-size:13px;font-weight:650;background:#fff
}
.reset:hover{background:var(--surface-soft);color:#27364d}
.empty{
  padding:44px 20px;text-align:center;color:var(--muted);background:#fff;border:1px dashed #d8dee7;border-radius:16px
}

/* PAGINATION */
.pagination{display:flex;justify-content:center;align-items:center;gap:7px;margin-top:28px}
.pagination a{
  min-width:38px;height:38px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);border-radius:10px;background:#fff;color:#526173;font-size:13px;font-weight:700;
  transition:.2s ease
}
.pagination a:hover{border-color:#cbd5e1;background:#f8fafc;color:#1e3650}
.pagination a.active{background:var(--primary);border-color:var(--primary);color:#fff}
.page-arrow{font-size:20px!important;font-weight:500!important}

/* FOOTER */
footer{border-top:1px solid var(--line);background:#fff}
footer .wrap{min-height:76px;display:flex;align-items:center;justify-content:center;color:#7b8796;font-size:12px}

/* RESPONSIVE */
@media (max-width:1050px){
  .bookgrid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:820px){
  .hero-inner{padding-top:52px}
  .bookgrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .filters{grid-template-columns:1fr 1fr}
  .filters button,.reset{width:100%}
}
@media (max-width:620px){
  .wrap{width:min(calc(100% - 24px),var(--wrap))}
  .nav{height:64px}.brandmark{width:38px;height:38px}.brandmark img{width:29px;height:29px}
  .brand small{display:none}.portal-link{padding:9px 11px}.portal-link span{display:none}
  .hero-inner{padding:42px 0 34px}.hero h1{font-size:36px}.hero-inner>p{font-size:14px;padding-inline:8px}
  .searchbox{margin-top:22px;display:grid;grid-template-columns:1fr;padding:7px;border-radius:14px}
  .searchbox input{height:46px;padding:0 12px}.searchbox button{height:44px}
  .stats{grid-template-columns:1fr 1fr;margin-top:24px}.stats>div{padding:14px}
  .stats>div+div:before{display:none}.stats>div:nth-child(odd){border-right:1px solid var(--line)}
  .stats>div:nth-child(n+3){border-top:1px solid var(--line)}
  .content{padding-top:30px}.section{margin-bottom:42px}.section-head h2{font-size:22px}
  .bookgrid{grid-template-columns:1fr 1fr;gap:11px}.bookcover{height:100px}.bookcover span{width:46px;height:59px;font-size:22px}
  .bookbody{padding:13px;min-height:178px}.bookbody h3{font-size:13px}
  .filters{grid-template-columns:1fr;padding:10px}
}
@media (max-width:380px){
  .bookgrid{grid-template-columns:1fr}
  .bookcard{display:grid;grid-template-columns:95px 1fr}.bookcover{height:100%;min-height:170px;border-bottom:0;border-right:1px solid var(--line)}
}

/* =========================================================
   DETAIL BUKU — CLEAN PROFESSIONAL
   ========================================================= */
.back-link{
  display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 13px;
  border:1px solid var(--line);border-radius:10px;background:#fff;color:#415269;
  font-size:13px;font-weight:700;transition:.2s ease
}
.back-link:hover{background:var(--surface-soft);border-color:#cbd5e1;color:var(--primary);transform:translateY(-1px)}

.detailwrap{padding-top:34px;padding-bottom:64px}
.detail-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:16px;color:#8a96a5;font-size:12px}
.detail-breadcrumb a{color:#5c6d82;font-weight:650}
.detail-breadcrumb a:hover{color:var(--primary)}

.detailcard{
  display:grid;grid-template-columns:300px minmax(0,1fr);gap:0;background:#fff;
  border:1px solid var(--line);border-radius:22px;overflow:hidden;
  box-shadow:0 18px 45px rgba(15,23,42,.06)
}
.detailvisual{
  padding:34px 28px;background:linear-gradient(180deg,#f7fafe 0%,#f2f6fa 100%);
  border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;justify-content:center
}
.detailcover{
  width:180px;aspect-ratio:3/4;display:grid;place-items:center;border-radius:12px 20px 20px 12px;
  background:linear-gradient(145deg,#fff,#f9fbfd);border:1px solid #dbe4ed;
  box-shadow:12px 14px 0 #dfe9f2,0 16px 32px rgba(29,52,78,.10);position:relative
}
.detailcover:before{
  content:"";position:absolute;left:13px;top:0;bottom:0;width:1px;background:#e5ebf1
}
.detailcover span{font-size:64px;line-height:1;font-weight:800;color:#294f76;letter-spacing:-.04em}
.detailcover-note{width:100%;margin-top:28px;text-align:center}
.detailcover-note span{display:block;color:#8995a5;font-size:11px;text-transform:uppercase;letter-spacing:.1em;font-weight:750}
.detailcover-note strong{display:block;margin-top:5px;color:#3f5065;font-size:12px;word-break:break-word}

.detailbody{min-width:0;padding:38px 42px 40px}
.detailtopline{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.detail-id{color:#98a2b3;font-size:11px;font-weight:650;letter-spacing:.03em}
.detailbody>.status,.detailtopline .status{font-size:11px;padding:5px 10px}
.detailbody h1{
  margin:0;max-width:850px;color:#12243c;font-size:clamp(28px,3.2vw,42px);line-height:1.16;
  letter-spacing:-.03em;font-weight:780
}
.detailbody .author{margin:12px 0 0;color:#66758a;font-size:15px}

.metadata-title{margin-top:32px;margin-bottom:10px;color:#33465d;font-size:12px;font-weight:780;letter-spacing:.08em;text-transform:uppercase}
.metadata{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);
  border-radius:15px;overflow:hidden;background:#fff
}
.metadata>div{min-width:0;padding:15px 17px;background:#fff}
.metadata>div:nth-child(odd){border-right:1px solid var(--line)}
.metadata>div:nth-child(n+3){border-top:1px solid var(--line)}
.metadata span{display:block;margin-bottom:5px;color:#8a96a5;font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase}
.metadata strong{display:block;color:#34465c;font-size:13px;line-height:1.45;font-weight:700;overflow-wrap:anywhere}

.book-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px;padding-top:24px;border-top:1px solid var(--line)}
.btn-copy-code,.btn-borrow-book{
  min-height:44px;padding:0 16px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;
  gap:8px;font-weight:750;font-size:13px;cursor:pointer;transition:.2s ease
}
.btn-copy-code{border:1px solid var(--line);background:#fff;color:#405268}
.btn-copy-code:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px)}
.btn-copy-code.copied{background:var(--success-bg);border-color:#ccecdf;color:var(--success)}
.btn-borrow-book{border:1px solid var(--primary);background:var(--primary);color:#fff}
.btn-borrow-book:hover{background:var(--primary-2);border-color:var(--primary-2);transform:translateY(-1px)}
.action-icon{font-size:16px;line-height:1}

.loaninfo,.availablebox{
  margin-top:16px;padding:14px 16px;border-radius:12px;font-size:12px;line-height:1.55
}
.loaninfo{display:grid;gap:3px;background:var(--danger-bg);border:1px solid #f5d8d8;color:#8e4141}
.loaninfo b{color:#7f3333}
.availablebox{background:var(--success-bg);border:1px solid #cfeadf;color:#39725e;font-weight:650}

.copy-toast{
  position:fixed;right:24px;bottom:24px;z-index:100;display:flex;align-items:center;gap:11px;
  min-width:260px;max-width:calc(100vw - 32px);padding:13px 15px;background:#17263a;color:#fff;
  border-radius:13px;box-shadow:0 18px 40px rgba(15,23,42,.22);opacity:0;visibility:hidden;
  transform:translateY(12px);transition:.22s ease
}
.copy-toast.show{opacity:1;visibility:visible;transform:translateY(0)}
.copy-toast-icon{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:rgba(255,255,255,.12);font-weight:800}
.copy-toast strong{display:block;font-size:12px}
.copy-toast small{display:block;margin-top:1px;color:#cbd5e1;font-size:10px}

@media (max-width:850px){
  .detailcard{grid-template-columns:240px minmax(0,1fr)}
  .detailvisual{padding:28px 22px}.detailcover{width:145px}.detailcover span{font-size:52px}
  .detailbody{padding:30px 28px 32px}
}
@media (max-width:680px){
  .detailwrap{padding-top:22px;padding-bottom:44px}
  .detailcard{grid-template-columns:1fr;border-radius:18px}
  .detailvisual{border-right:0;border-bottom:1px solid var(--line);padding:28px 22px}
  .detailcover{width:130px}.detailcover span{font-size:46px}.detailcover-note{margin-top:22px}
  .detailbody{padding:24px 20px 26px}.detailbody h1{font-size:29px}
  .metadata{grid-template-columns:1fr}.metadata>div:nth-child(odd){border-right:0}.metadata>div+div{border-top:1px solid var(--line)}
  .book-actions{display:grid;grid-template-columns:1fr}.btn-copy-code,.btn-borrow-book{width:100%}
  .back-link{width:40px;padding:0}.back-link span:last-child{display:none}
  .copy-toast{right:16px;bottom:16px;left:16px;min-width:0}
}


/* =========================================================
   KATALOG TANPA COVER HURUF / IKON DEKORATIF
   ========================================================= */
.bookcard{
  display:block;
}
.bookcard .bookcover{
  display:none !important;
}
.bookcard .bookbody{
  width:100%;
  min-height:190px;
}
@media (max-width:640px){
  .bookcard{
    display:block;
    grid-template-columns:none;
  }
  .bookcard .bookbody{
    min-height:auto;
  }
}


/* Status kartu katalog ditempatkan sebagai header penuh */
.bookcard>.bookbody>.status{display:none}
@media (max-width:640px){
  .book-status-header{min-height:40px;padding:0 13px}
}
