* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: #f4f7fa;
  color: #333;
  font-size: 13.5px;
  line-height: 1.4;
}

.container {
  max-width: 1400px;
  margin: 0.75rem auto;
  padding: 0 1rem;
}

/* Header Flex Container */
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .btn-back {
    align-self: flex-start;
  }

  .header-center {
    text-align: center;
  }

  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-actions .btn-action {
    flex: 1;
    margin: 0.25rem;
  }
}

.btn-back {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  background-color: #ef4444;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-back:hover {
  background-color: #dc2626;
}

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-logo img {
  width: 85px;
  height: auto;
}

.header-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 1.25rem;
  color: #1f2937;
}

.header-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.header-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-action {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-action:hover {
  opacity: 0.9;
}

.btn-pinjam {
  background-color: #3b82f6;
  width: 100%;
}

/* biru */
.btn-kembali {
  background-color: #facc15;
  color: #333;
  width: 100%;
}

/* kuning */
.btn-kunjungan {
  background-color: #10b981;
  width: 100%;
}

/* hijau */

/* Search */
.search-wrapper {
  position: relative;
  max-width: 700px;
  margin: 0 auto 1.25rem;
}

.search-wrapper input {
  width: 100%;
  padding: 0.7rem 1.25rem 0.7rem 3rem;
  border-radius: 50px;
  border: none;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.search-wrapper input:focus {
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.search-wrapper .icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  opacity: 0.6;
}

/* Book Grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .book-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .book-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1600px) {
  .book-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

.book-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.card-image img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.card-content {
  padding: 0.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.book-author {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.book-meta {
  font-size: 0.75rem;
  color: #4b5563;
  margin-bottom: 0.2rem;
}

.book-qty {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: auto;
  margin-bottom: 0.4rem;
}

.btn-borrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem;
  font-size: 0.75rem;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-borrow:hover {
  opacity: 0.9;
}

.btn-borrow .icon-btn {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}
