/* ---------- Flash ---------- */
  .books-view .alert {
    border-radius: 1.25rem;
    padding: 1rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
  }
  .books-view .alert-success {
    background: #e3f5ec;
    border: 1px solid #b3dfc9;
    color: #0b5232;
  }
  .books-view .alert-danger {
    background: #fde8e8;
    border: 1px solid #fccfcf;
    color: #8b1e1e;
  }

  /* ---------- Search bar ---------- */
  .books-view .search-wrapper {
    background: #fff;
    border-radius: 2rem;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    box-shadow: 0 8px 20px -8px rgba(0, 20, 30, 0.12), 0 0 0 1px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    transition: box-shadow 0.2s;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
  }
  
  .books-view .search-wrapper .search-icon {
    color: #7b98b3;
    font-size: 1.2rem;
    flex-shrink: 0;
  }
  .books-view .search-wrapper .form-control {
    border: none;
    background: transparent;
    padding: 0.85rem 0.5rem 0.85rem 0.6rem;
    font-size: 1.05rem;
    box-shadow: none !important;
    color: #0b2b4a;
    flex: 1;
    min-width: 0;
  }
  
  .books-view .search-wrapper .btn-primary {
    border-radius: 2rem !important;
    padding: 0.75rem 2rem;
    font-weight: 600;
    background: #0b2b4a;
    border: none;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
  }
  

  /* ---------- Section heading ---------- */
  .books-view .list-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
  }
  .books-view .list-header h4 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0b2b4a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  .books-view .list-header h4 i {
    font-size: 1.5rem;
    color: #3b7cbf;
  }
  .books-view .list-count {
    background: #e9f2fa;
    color: #0b2b4a;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 3rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* ---------- Book grid ---------- */
  .books-view .book-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
  @media (min-width: 768px) {
    .books-view .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (min-width: 1024px) {
    .books-view .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @media (min-width: 1280px) {
    .books-view .book-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  }
  @media (min-width: 1536px) {
    .books-view .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  }

  .books-view .book-card {
    background: #fff;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 20, 40, 0.05), 0 0 0 1px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  

  .books-view .book-cover {
    height: 200px;
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    background-color: #d9e5f0;
    cursor: pointer;
    position: relative;
    display: block;
    transition: filter 0.2s;
  }
  
  

  /* Floating badges on the cover */
  .books-view .cover-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    pointer-events: none;
    z-index: 2;
  }
  .books-view .cover-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
  }
  .books-view .cover-badge.assigned {
    background: rgba(255, 243, 224, 0.95);
    color: #b85c00;
    border: 1px solid #ffe0b5;
  }
  .books-view .cover-badge.all-reserved {
    background: rgba(238, 242, 246, 0.95);
    color: #5d7f9c;
    border: 1px solid #dde5ee;
  }

  .books-view .book-body {
    padding: 1.35rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .books-view .book-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: #0b2b4a;
    margin: 0 0 0.5rem 0;
  }
  .books-view .book-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s;
    word-break: break-word;
  }
  

  .books-view .book-desc {
    font-size: 0.9rem;
    color: #54738f;
    line-height: 1.55;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
  }

  /* Action button row */
  .books-view .book-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
  }

  .books-view .btn-add {
    flex: 1;
    border-radius: 2rem;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: #fff;
    color: #b85c00;
    border: 1.5px solid #ffe0b5;
    text-decoration: none;
    transition: all 0.18s ease;
    cursor: pointer;
    letter-spacing: -0.005em;
  }
  .books-view .btn-add:hover:not(.disabled) {
    background: #fff3e0;
    border-color: #f5c98a;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -10px rgba(184, 92, 0, 0.4);
    color: #9a4c00;
  }
  .books-view .btn-add.disabled,
  .books-view .btn-add[disabled] {
    background: #eef3f8;
    color: #8ba0b8;
    border-color: #e0e9f2;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
  }
  .books-view .btn-add.disabled i,
  .books-view .btn-add[disabled] i {
    color: #8ba0b8;
  }

  /* ---------- Empty state ---------- */
  .books-view .empty-state {
    background: #fff;
    border-radius: 2rem;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px -10px rgba(0, 20, 40, 0.08);
    border: 1px solid #e5edf5;
    color: #5d7f9c;
    margin-top: 2rem;
  }
  
  .books-view .empty-state h4 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0b2b4a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.015em;
  }
  .books-view .empty-state p {
    font-size: 0.98rem;
    color: #7b98b3;
    margin: 0;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 576px) {
    
    .books-view .search-wrapper { padding-left: 1rem; }
    
    .books-view .list-header h4 { font-size: 1.35rem; }
  }

/* bump ?v=N in layout on change */

/* Catalog surfaces remain intentionally quiet so titles and availability scan quickly. */
.books-view { padding-top: 1rem; padding-bottom: 2.5rem; }
.books-view .search-wrapper {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--paper-shadow);
  padding: 0.35rem 0.45rem 0.35rem 1.15rem;
  transition: all 0.2s ease;
  margin-top: 0.25rem;
  margin-bottom: 0.85rem;
}
.books-view .search-wrapper:focus-within {
  box-shadow: 0 0 0 3px var(--primary-glow), var(--paper-shadow-hover);
  border-color: var(--primary);
  background: var(--surface);
}
.books-view .search-wrapper input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.books-view .search-wrapper input::placeholder {
  color: var(--subtle);
}
.books-view .search-wrapper .search-icon {
  color: var(--muted);
  font-size: 1.05rem;
  margin-right: 0.75rem;
  transition: color 0.15s ease;
}
.books-view .search-wrapper:focus-within .search-icon {
  color: var(--primary);
}
.books-view .search-wrapper .btn-primary {
  border-radius: var(--radius-pill) !important;
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
  outline: none !important;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px var(--primary-glow);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.books-view .search-wrapper .btn-primary:hover {
  background: var(--primary-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.books-view .search-wrapper .btn-primary:active {
  transform: translateY(0);
}
.books-view .book-card { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--paper-shadow); background: var(--surface); }
.books-view .book-card:hover { transform: translateY(-2px); box-shadow: var(--paper-shadow-hover); }
.books-view .book-actions { border-top-color: var(--line); }
.books-view .btn-add { border-radius: 8px; color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.books-view .btn-add:hover:not(.disabled) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-hover); transform: none; box-shadow: none; }
.books-view .list-count, .books-view .badge-stats { border-radius: 8px; background: var(--primary-soft); color: var(--primary); }

/* Ramping & seimbang: toolbar filter serasi dengan search bar */
.catalog-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.5rem 0 1.25rem;
  padding: 0.4rem 0.2rem;
  border: none;
  background: transparent;
  box-shadow: none;
}
.catalog-category-select,
.tag-filter-dropdown summary,
.catalog-filters .btn-add {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
  min-width: 140px;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--paper-shadow);
  transition: all 0.15s ease;
}
.catalog-category-select {
  cursor: pointer;
  padding-right: 1.5rem;
}
.tag-filter-dropdown {
  position: relative;
  width: auto;
  min-width: 130px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
}
.tag-filter-dropdown summary {
  position: relative;
  justify-content: flex-start;
  cursor: pointer;
  list-style: none;
  text-align: left;
}
.tag-filter-dropdown summary::-webkit-details-marker { display: none; }
.tag-filter-dropdown summary::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  width: 0;
  height: 0;
  border-top: 0.32rem solid currentColor;
  border-right: 0.25rem solid transparent;
  border-left: 0.25rem solid transparent;
}
.tag-filter-dropdown[open] summary {
  border-color: var(--primary);
  border-bottom-left-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}
.catalog-category-select:focus,
.tag-filter-dropdown[open] summary,
.catalog-filters .btn-add:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.catalog-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.catalog-filters .btn-add {
  min-width: auto;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
}
.catalog-filters .btn-add:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.catalog-filters button[type="submit"].btn-add {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.catalog-filters button[type="submit"].btn-add:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.tag-filter-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  gap: 0.35rem;
  width: 14rem;
  max-height: 15rem;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--paper-shadow-hover);
}
.tag-filter-options label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.tag-filter-options input {
  accent-color: var(--primary);
}
.catalog-classification, .book-classification {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.catalog-category, .catalog-tag {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}
.catalog-tag {
  background: var(--surface-muted);
  color: var(--muted);
}
.catalog-ebook-badge {
  display: inline-flex;
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.books-view .mybook-loan-status {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  color: var(--ink);
}
.books-view .mybook-loan-status small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.books-view .mybook-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}
.books-view .mybook-status-badge.is-pending {
  background: var(--accent-soft);
  color: var(--accent);
}
.books-view .book-actions form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}
.books-view .btn-secondary-action {
  color: var(--muted);
  border-color: var(--line);
  border-radius: 8px;
}
.books-view .btn-secondary-action:hover:not(.disabled) {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}
