/* ═══════════════════════════════════════════════════
   DIGITAL LIBRARY - STYLE.CSS
   Green Theme | Modern | Responsive
═══════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --white: #ffffff;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --admin-color: #7c3aed;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-green: 0 4px 14px rgba(22,163,74,.35);

  --header-h: 68px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

.hidden { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 40px; }
.text-muted { color: var(--gray-500); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--green-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--green-500); }

/* ═══════════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════════ */
.text-gradient {
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--green-600);
  color: var(--white);
  border-color: var(--green-600);
}
.btn-primary:hover {
  background: var(--green-700);
  border-color: var(--green-700);
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--green-600);
  border-color: var(--green-600);
}
.btn-outline:hover {
  background: var(--green-50);
  transform: translateY(-1px);
}

.btn-admin {
  background: var(--admin-color);
  color: var(--white);
  border-color: var(--admin-color);
}
.btn-admin:hover {
  background: #6d28d9;
  box-shadow: 0 4px 14px rgba(124,58,237,.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-dark);
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background: #fef2f2;
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Tombol Export PDF ─── */
.btn-pdf {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(220,38,38,.25);
}
.btn-pdf:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 4px 14px rgba(220,38,38,.4);
  transform: translateY(-1px);
}
.btn-pdf:active { transform: translateY(0); }
.btn-pdf.loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}
.pdf-icon { font-size: 15px; }

/* ─── Admin Header Actions Group ─── */
.admin-page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-h);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--green-50);
  border: 1px solid var(--green-100);
}

.header-logo[src=""] { display: none; }

.header-libname {
  font-size: 18px;
  font-weight: 800;
  color: var(--green-700);
  letter-spacing: -0.4px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--green-700);
  background: var(--green-50);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-700);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--green-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-700);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

/* ═══════════════════════════════════════════════════
   PAGES (SPA Routing)
═══════════════════════════════════════════════════ */
.page { display: none; animation: fadeIn 0.3s ease; flex: 1; }
.page.active { display: block; }
#app-main { display: flex; flex-direction: column; flex: 1; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════════════ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-600) 100%);
  padding: 100px 0 80px;
  overflow: hidden;
}

.hero-bg-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.shape {
  position: absolute;
  border-radius: var(--radius-full);
  opacity: 0.12;
}
.shape-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #86efac, transparent);
  top: -100px; right: -100px;
  animation: float 8s ease-in-out infinite;
}
.shape-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #4ade80, transparent);
  bottom: -80px; left: -80px;
  animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #bbf7d0, transparent);
  top: 50%; left: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: white;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-search-wrap {
  max-width: 620px;
  margin: 0 auto 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-xl);
  gap: 10px;
}

.search-icon { font-size: 18px; flex-shrink: 0; }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--gray-800);
  min-width: 0;
}
.search-box input::placeholder { color: var(--gray-400); }

.search-btn { border-radius: var(--radius-lg) !important; padding: 10px 24px !important; }

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: white;
  display: block;
}
.stat-label {
  font-size: 13px;
  color: rgba(255,255,255,.72);
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.25);
}

/* ═══════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ─── PAGE MINI HERO ─── */
.page-hero-mini {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  padding: 48px 0;
  text-align: center;
}
.page-hero-title { font-size: 32px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.page-hero-sub { font-size: 15px; color: rgba(255,255,255,.75); margin-top: 6px; }

/* ═══════════════════════════════════════════════════
   BOOKS GRID & CARDS
═══════════════════════════════════════════════════ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.book-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.book-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--green-200);
}

.book-cover-wrap {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--gray-100);
  overflow: hidden;
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.book-card:hover .book-cover { transform: scale(1.04); }

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--green-50), var(--green-100));
  color: var(--green-600);
  font-size: 40px;
}
.book-cover-placeholder-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-700);
  text-align: center;
  padding: 0 10px;
}

.book-status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-available {
  background: var(--green-600);
  color: white;
}
.badge-unavailable {
  background: var(--gray-500);
  color: white;
}

.book-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.book-genre {
  font-size: 11px;
  color: var(--green-600);
  font-weight: 600;
  background: var(--green-50);
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  width: fit-content;
  margin-top: 2px;
}

.book-footer {
  padding: 0 14px 14px;
}

.book-card .btn {
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
}

/* ═══════════════════════════════════════════════════
   CTA BANNER
═══════════════════════════════════════════════════ */
.cta-banner {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  padding: 64px 0;
  margin-top: 20px;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-text h2 { font-size: 26px; font-weight: 800; color: white; letter-spacing: -0.4px; }
.cta-text p { color: rgba(255,255,255,.8); margin-top: 6px; font-size: 15px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-actions .btn-primary { background: white; color: var(--green-700); border-color: white; }
.cta-actions .btn-primary:hover { background: var(--green-50); box-shadow: none; }
.cta-actions .btn-outline { border-color: rgba(255,255,255,.6); color: white; }
.cta-actions .btn-outline:hover { background: rgba(255,255,255,.1); }

/* ═══════════════════════════════════════════════════
   CATALOG TOOLBAR
═══════════════════════════════════════════════════ */
.catalog-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.catalog-search { flex: 1; min-width: 280px; }
.catalog-search input { font-size: 14px; }

.filter-select {
  padding: 10px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: white;
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.filter-select:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }

/* ═══════════════════════════════════════════════════
   CATALOG 2-COLUMN LAYOUT + STATS SIDEBAR
═══════════════════════════════════════════════════ */

/* Wrapper utama: Stats Page */
.stats-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: flex-start;
}

/* ─── Stats Card ─── */
.stats-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.stats-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green-200);
}

.stats-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--gray-100);
  background: linear-gradient(135deg, var(--gray-50), white);
}
.stats-card-icon { font-size: 18px; }
.stats-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.2px;
}

/* ─── Stats Rows ─── */
.stats-list {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  transition: var(--transition);
  gap: 8px;
}
.stat-row:hover { background: var(--gray-50); }
.stat-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green   { background: var(--green-500); }
.dot-emerald { background: var(--green-400); }
.dot-red     { background: #ef4444; }
.dot-blue    { background: #3b82f6; }
.dot-purple  { background: #8b5cf6; }

.stat-row-label {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-row-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--gray-900);
  flex-shrink: 0;
}
.text-green { color: var(--green-600); }
.text-red   { color: #ef4444; }

/* ─── Availability Bar ─── */
.availability-bar-wrap { padding: 14px 16px 16px; }
.availability-bar {
  height: 10px;
  background: #fee2e2;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}
.availability-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.availability-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}
.avail-label-green { color: var(--green-600); }
.avail-label-red   { color: #ef4444; }

/* ─── Genre List ─── */
.genre-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 14px;
}
.genre-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.genre-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.genre-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.genre-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--green-600);
  flex-shrink: 0;
}
.genre-bar-bg {
  height: 5px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.genre-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ─── Top Books List ─── */
.top-books-list {
  display: flex;
  flex-direction: column;
  padding: 10px 0 6px;
}
.top-book-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.top-book-item:hover { background: var(--gray-50); }
.top-book-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-600);
  color: white;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.top-book-rank.rank-1 { background: #f59e0b; }
.top-book-rank.rank-2 { background: var(--gray-400); }
.top-book-rank.rank-3 { background: #cd7c3a; }
.top-book-thumb {
  width: 34px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: var(--green-50);
}
.top-book-thumb-placeholder {
  width: 34px;
  height: 46px;
  border-radius: 4px;
  background: var(--green-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.top-book-info { flex: 1; min-width: 0; }
.top-book-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.top-book-bookings {
  font-size: 10px;
  color: var(--green-600);
  font-weight: 700;
  margin-top: 2px;
}

/* ─── Responsive: Stats Page ─── */
@media (max-width: 768px) {
  .stats-page-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}


/* ═══════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 48px;
  flex-wrap: wrap;
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  width: 100%;
  max-width: 440px;
}

.admin-card { border-top: 4px solid var(--admin-color); }

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo-wrap { margin-bottom: 16px; }
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin: 0 auto;
  background: var(--green-50);
  border: 2px solid var(--green-100);
}
.auth-logo[src=""] { display: none; }
.auth-title { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.auth-sub { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

.admin-badge-icon { font-size: 48px; margin-bottom: 12px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--gray-600);
}
.auth-footer p { margin-top: 8px; }
.auth-admin-hint { color: var(--gray-400); font-size: 12px; }

/* ─── Forms ─── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.required { color: var(--danger); }
.optional { color: var(--gray-400); font-weight: 400; }

.form-input {
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-800);
  background: white;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 80px; }

.input-password-wrap { position: relative; }
.input-password-wrap .form-input { padding-right: 44px; }
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
  line-height: 1;
}
.toggle-password:hover { opacity: 1; }

.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}
.form-hint code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--admin-color);
}

.link-accent { color: var(--green-600); font-weight: 600; }
.link-accent:hover { color: var(--green-700); }
.link-muted { color: var(--gray-400); font-size: 12px; }
.link-muted:hover { color: var(--gray-600); }

/* Auth Decoration */
.auth-decoration {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deco-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
  animation: slideInRight 0.4s ease;
}
.deco-card-1 { transform: rotate(-2deg); }
.deco-card-2 { transform: rotate(1.5deg); }
.deco-card:hover { transform: rotate(0) translateY(-4px) !important; transition: var(--transition); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px) rotate(0); }
  to { opacity: 1; }
}

.deco-icon { font-size: 32px; }
.deco-label { font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; }
.deco-val { font-size: 24px; font-weight: 800; color: var(--green-600); }

.deco-quote {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 280px;
}
.quote-icon { font-size: 32px; margin-bottom: 12px; }
.deco-quote p { color: white; font-size: 15px; line-height: 1.7; font-style: italic; font-weight: 500; }

/* ═══════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════ */
#page-admin-dashboard.active { display: flex; }

.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  width: 100%;
}

.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,.04);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--admin-color), #6d28d9);
}
.sidebar-icon { font-size: 28px; }
.sidebar-title { font-size: 15px; font-weight: 700; color: white; }
.sidebar-sub { font-size: 12px; color: rgba(255,255,255,.7); }

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-btn.active {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 700;
}
.sb-icon { font-size: 18px; }

.sidebar-logout { padding: 16px 12px; border-top: 1px solid var(--gray-100); }

.admin-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--gray-50);
  min-width: 0;
}

.admin-tab { display: none; animation: fadeIn 0.25s ease; }
.admin-tab.active { display: block; }

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.admin-page-header h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.4px; }
.admin-page-header p { font-size: 14px; color: var(--gray-500); margin-top: 3px; }

/* ═══════════════════════════════════════════════════
   DASHBOARD CARDS
═══════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.dash-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.dash-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--green-200);
}
.dash-card-icon { font-size: 36px; }
.dash-card-num { font-size: 28px; font-weight: 800; color: var(--green-700); }
.dash-card-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }

/* ═══════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════ */
.table-wrap {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

.table-book-cover {
  width: 40px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-100);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-available { background: var(--green-100); color: var(--green-700); }
.status-booked { background: #fef3c7; color: #92400e; }
.status-borrowed { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: var(--green-100); color: var(--green-700); }

.table-actions { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════════ */
.settings-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-100);
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 4px 0;
}

.logo-preview-area {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray-50);
}

.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-preview-img[src=""] { display: none; }

.logo-preview-placeholder {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  animation: overlayIn 0.2s ease;
}
.modal-overlay.active { display: block; }

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px rgba(0,0,0,.2);
  z-index: 2100;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.modal.active { display: block; }
.modal-sm { max-width: 400px; }

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--gray-900); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Booking Success Modal */
.modal-booking { max-width: 440px; }
.booking-success-body { text-align: center; }
.booking-success-icon { font-size: 56px; margin-bottom: 8px; animation: bounceIn 0.5s ease; }
@keyframes bounceIn {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.booking-success-text { color: var(--gray-600); font-size: 14px; margin-bottom: 16px; }
.booking-code-display {
  background: linear-gradient(135deg, var(--green-50), var(--green-100));
  border: 2px solid var(--green-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 8px 0;
}
.booking-code-label { font-size: 11px; color: var(--green-700); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.booking-code {
  font-size: 32px;
  font-weight: 900;
  color: var(--green-700);
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
  margin-bottom: 12px;
}
.copy-btn { font-size: 13px; }
.booking-detail { font-size: 13px; color: var(--gray-500); margin-top: 8px; }

/* Warning Modal */
.modal-warning { max-width: 380px; }
.warning-body { text-align: center; padding: 36px 24px; }
.warning-icon { font-size: 56px; margin-bottom: 12px; }
.warning-body h3 { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.warning-body p { font-size: 14px; color: var(--gray-600); line-height: 1.7; margin-bottom: 20px; }
.warning-actions { display: flex; gap: 12px; justify-content: center; }
.modal-warning .modal-close { position: absolute; top: 16px; right: 16px; }
.modal-warning { position: fixed; }

/* ─── Upload Zone Cover Buku ─── */
.cover-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-upload-area:hover {
  border-color: var(--green-400);
  background: var(--green-50);
}
.cover-upload-area.drag-over {
  border-color: var(--green-500);
  background: var(--green-100);
  box-shadow: 0 0 0 4px rgba(22,163,74,.12);
  transform: scale(1.01);
}
.cover-upload-area.has-image {
  border-style: solid;
  border-color: var(--green-300);
  background: white;
}
.cover-upload-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
}
#cover-upload-label {
  flex: 1;
  text-align: center;
}
.upload-icon { font-size: 36px; margin-bottom: 6px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 3px; }
.upload-hint { font-size: 12px; color: var(--gray-400); }

/* Preview dalam zona upload */
.book-cover-preview {
  width: 80px;
  height: 110px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--green-200);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--green-500);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-fade { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.95); }
}

.toast-icon { font-size: 20px; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-400);
  padding: 2px;
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.site-footer {
  background: var(--gray-900);
  padding: 24px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: white;
}
.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.footer-logo[src=""] { display: none; }
.footer-copy { font-size: 13px; color: var(--gray-500); }

/* ═══════════════════════════════════════════════════
   MEMBER DASHBOARD
═══════════════════════════════════════════════════ */
#page-member-dashboard.active { display: block; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET BESAR (max 1024px)
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }
  .admin-content {
    padding: 24px 20px;
  }
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
  }
  .hero { padding: 80px 0 64px; }
  .auth-decoration { display: none; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET (max 768px)
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ─── Header & Nav ─── */
  .header-nav { display: none; }
  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--header-h) + 10px);
    right: 20px;
    left: auto;
    width: max-content;
    min-width: 160px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 12px;
    gap: 6px;
    z-index: 999;
    box-shadow: var(--shadow-xl);
  }
  .header-nav.open .nav-link {
    padding: 10px 14px;
    font-size: 15px;
    text-align: right;
  }
  .header-nav.open .btn { width: 100%; justify-content: center; margin-top: 4px; }
  .hamburger { display: flex; }
  .header-libname { font-size: 16px; }
  .header-actions { gap: 6px; }
  .user-chip span:not(.user-avatar) { display: none; }
  .user-chip { padding: 6px; }

  /* ─── Hero ─── */
  .hero { padding: 64px 0 48px; }
  .hero-title { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .hero-subtitle { font-size: 15px; padding: 0 8px; }
  .hero-stats { gap: 16px; }
  .stat-divider { display: none; }
  .stat-num { font-size: 22px; }
  .search-box { padding: 5px 5px 5px 14px; }
  .search-btn { padding: 8px 16px !important; font-size: 13px !important; }

  /* ─── Auth ─── */
  .auth-decoration { display: none; }
  .auth-wrapper { padding: 24px 16px; }
  .auth-card { padding: 28px 20px; }

  /* ─── Admin Sidebar: icon-only collapse ─── */
  .admin-sidebar {
    width: 60px;
    position: fixed;
    left: 0;
    top: var(--header-h);
    z-index: 900;
    overflow: visible;
  }
  .sidebar-header { padding: 16px 10px; justify-content: center; }
  .sidebar-header > div { display: none; }
  .sidebar-icon { font-size: 24px; }
  .sidebar-btn {
    padding: 12px 0;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    color: var(--gray-500);
    position: relative;
  }
  .sidebar-btn .sb-icon { font-size: 22px; margin: 0; }
  /* Show short text label below icon */
  .sidebar-btn span:not(.sb-icon):not(.sidebar-badge) {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    max-width: 56px;
    text-overflow: ellipsis;
  }
  .sidebar-title, .sidebar-sub { display: none; }
  .sidebar-logout { padding: 8px 4px; }
  .sidebar-logout .btn span { display: none; }
  .sidebar-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
    padding: 0 3px;
    margin-left: 0;
  }
  .admin-content { padding: 20px 14px; margin-left: 60px; }

  /* ─── Admin page header ─── */
  .admin-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-page-header h1 { font-size: 20px; }

  /* ─── Dashboard Cards ─── */
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dash-card { padding: 16px; gap: 12px; }
  .dash-card-icon { font-size: 28px; }
  .dash-card-num { font-size: 22px; }

  /* ─── Books Grid ─── */
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  /* ─── CTA ─── */
  .cta-banner { padding: 48px 0; }
  .cta-inner { flex-direction: column; text-align: center; }
  .cta-actions { justify-content: center; }
  .cta-text h2 { font-size: 22px; }

  /* ─── Catalog toolbar ─── */
  .catalog-toolbar { flex-direction: column; gap: 10px; }
  .catalog-search { min-width: unset; width: 100%; }
  .filter-select { width: 100%; }

  /* ─── Settings ─── */
  .settings-card { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }

  /* ─── Section Header ─── */
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* ─── Table ─── */
  .table-actions .btn span { display: none; }
  .table-actions .btn { padding: 6px 8px; }
  .data-table th, .data-table td { padding: 10px 10px; font-size: 12px; }

  /* ─── Page Mini Hero ─── */
  .page-hero-mini { padding: 32px 0; }
  .page-hero-title { font-size: 24px; }

  /* ─── Modal ─── */
  .modal {
    width: 95%;
    max-height: 88vh;
  }
  .modal-body { padding: 16px; gap: 12px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer { padding: 12px 18px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — HANDPHONE KECIL (max 480px)
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ─── Container & Spacing ─── */
  .container { padding: 0 14px; }
  .section { padding: 40px 0; }

  /* ─── Header ─── */
  .header-libname { font-size: 14px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-logo { width: 30px; height: 30px; }

  /* ─── Hero ─── */
  .hero { padding: 56px 0 40px; }
  .hero-title { font-size: 1.65rem; letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 14px; margin-bottom: 28px; }
  .hero-badge { font-size: 12px; padding: 5px 12px; }
  .search-box { gap: 6px; padding: 4px 4px 4px 12px; }
  .search-box input { font-size: 13px; }
  .search-btn { padding: 8px 12px !important; font-size: 12px !important; }
  .hero-stats { flex-direction: column; gap: 12px; }
  .stat-item { display: flex; align-items: center; gap: 10px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 12px; }

  /* ─── Admin Sidebar: switch to bottom tab bar on mobile ─── */
  .admin-layout {
    flex-direction: column;
    min-height: unset;
  }
  .admin-sidebar {
    width: 100% !important;
    height: auto !important;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    right: 0;
    z-index: 900;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--gray-200);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar-header { display: none; }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    flex: 1;
  }
  .sidebar-btn {
    flex-direction: column;
    gap: 2px;
    padding: 10px 6px 8px;
    border-radius: 0;
    min-width: 54px;
    font-size: 9px;
    flex-shrink: 0;
    border-top: 2px solid transparent;
  }
  .sidebar-btn.active {
    border-top-color: var(--green-600);
    background: var(--green-50);
  }
  .sidebar-btn .sb-icon { font-size: 20px; }
  .sidebar-logout { display: none; }
  .admin-content {
    margin-left: 0 !important;
    padding: 16px 12px;
    margin-bottom: 70px; /* space for bottom bar */
  }

  /* ─── Dashboard Cards ─── */
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-card { padding: 14px 12px; gap: 10px; }
  .dash-card-icon { font-size: 24px; }
  .dash-card-num { font-size: 20px; }
  .dash-card-label { font-size: 11px; }

  /* ─── Books Grid ─── */
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .book-card { border-radius: var(--radius-md); }
  .book-body { padding: 10px; }
  .book-title { font-size: 12px; }
  .book-author { font-size: 11px; }
  .book-footer { padding: 0 10px 10px; }
  .book-card .btn { font-size: 11px; padding: 7px 8px; }
  .btn-return-card { font-size: 10px; padding: 7px 6px; }

  /* ─── Section ─── */
  .section-title { font-size: 20px; }

  /* ─── Auth ─── */
  .auth-card { padding: 22px 16px; border-radius: var(--radius-lg); }
  .auth-title { font-size: 19px; }

  /* ─── Modal ─── */
  .modal {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90vh;
    animation: modalSlideUp 0.3s ease forwards;
  }
  @keyframes modalSlideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
  }
  .modal-overlay { align-items: flex-end; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }
  .modal-sm { max-width: 100%; }
  .modal-body { padding: 14px 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-header h3 { font-size: 15px; }

  /* ─── Tables: hide non-essential columns on mobile ─── */
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  /* Admin Books: hide genre/year in small cell, hide ISBN */
  .table-book-cover { width: 32px; height: 46px; }
  .table-actions { flex-wrap: nowrap; gap: 4px; }
  .table-actions .btn { padding: 5px 7px; font-size: 11px; }

  /* ─── Form ─── */
  .form-row { grid-template-columns: 1fr; }
  .form-input { font-size: 13px; padding: 10px 12px; }
  .form-label { font-size: 12px; }

  /* ─── Settings ─── */
  .settings-card { padding: 16px; border-radius: var(--radius-lg); }

  /* ─── CTA ─── */
  .cta-inner { gap: 24px; }
  .cta-text h2 { font-size: 20px; }
  .cta-actions { flex-direction: column; width: 100%; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  /* ─── Catalog toolbar ─── */
  .catalog-toolbar { gap: 8px; }
  .filter-select { font-size: 13px; padding: 9px 12px; }

  /* ─── Page Mini Hero ─── */
  .page-hero-mini { padding: 24px 0; }
  .page-hero-title { font-size: 20px; }
  .page-hero-sub { font-size: 13px; }

  /* ─── Admin Page Header ─── */
  .admin-page-header { gap: 8px; }
  .admin-page-header h1 { font-size: 18px; }
  .admin-page-header p { font-size: 12px; }
  .btn-pdf { font-size: 11px; padding: 7px 12px; }
  .btn-pdf .pdf-icon { font-size: 13px; }

  /* ─── Book Detail Modal ─── */
  .book-detail-layout { flex-direction: column; align-items: center; }
  .book-detail-left { width: 110px; }
  .detail-book-right { width: 100%; text-align: center; }
  .detail-book-title { font-size: 18px; }
  .detail-book-meta { grid-template-columns: 1fr 1fr; text-align: left; }
  .detail-book-desc { text-align: left; }

  /* ─── Return modal ─── */
  .return-book-info { flex-direction: column; align-items: flex-start; }
  .return-code-input { font-size: 14px !important; letter-spacing: 2px; }

  /* ─── Toast ─── */
  .toast-container { bottom: 80px; right: 12px; max-width: calc(100vw - 24px); }
}


/* ═══════════════════════════════════════════════════
   FITUR PENGEMBALIAN BUKU
═══════════════════════════════════════════════════ */

/* ─── Tombol Kembalikan di kartu buku ─── */
.btn-return-card {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  border: none;
  width: 100%;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(217,119,6,.3);
  font-family: inherit;
}
.btn-return-card:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  box-shadow: 0 4px 12px rgba(217,119,6,.45);
  transform: translateY(-1px);
}

/* ─── Tombol Submit Pengembalian (modal) ─── */
.btn-return {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(217,119,6,.3);
}
.btn-return:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  box-shadow: 0 4px 14px rgba(217,119,6,.45);
  transform: translateY(-1px);
}

/* ─── Modal ukuran ─── */
.modal-return { max-width: 520px; }
.modal-photo-viewer { max-width: 700px; }

/* ─── Info Buku di modal return ─── */
.return-book-info {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.return-book-cover {
  width: 52px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid #fcd34d;
  flex-shrink: 0;
  background: #fef9c3;
}
.return-book-cover-placeholder {
  width: 52px;
  height: 70px;
  border-radius: var(--radius-sm);
  background: #fef9c3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.return-book-meta { flex: 1; min-width: 0; }
.return-book-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
  margin-bottom: 3px;
}
.return-book-author { font-size: 12px; color: var(--gray-500); }
.return-book-badge {
  background: #d97706;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 5px;
  display: inline-block;
}

/* ─── Kode Booking Input ─── */
.return-code-input {
  font-family: 'Courier New', monospace !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green-700) !important;
}

/* ─── Upload Foto Pengembalian ─── */
.return-photo-upload {
  border: 2px dashed #fcd34d;
  border-radius: var(--radius-lg);
  background: #fffbeb;
  cursor: pointer;
  transition: var(--transition);
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.return-photo-upload:hover { border-color: #f59e0b; background: #fef3c7; }
.return-photo-upload.drag-over {
  border-color: #d97706;
  background: #fef3c7;
  box-shadow: 0 0 0 4px rgba(217,119,6,.12);
  transform: scale(1.01);
}
.return-photo-upload.has-photo {
  border-style: solid;
  border-color: #f59e0b;
  background: white;
  display: block;
}
.return-photo-preview-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.return-photo-label { text-align: center; padding: 20px; }

/* ─── Sidebar Badge (notifikasi pending return) ─── */
.sidebar-badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
  animation: pulse 2s ease-in-out infinite;
}

/* ─── Thumbnail foto di tabel admin ─── */
.return-photo-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  transition: var(--transition);
  display: block;
  margin: 0 auto;
}
.return-photo-thumb:hover {
  border-color: var(--green-400);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* ─── Status pills pengembalian ─── */
.status-return-pending  { background: #fef3c7; color: #92400e; font-weight:700; }
.status-return-approved { background: var(--green-100); color: var(--green-800); font-weight:700; }
.status-return-rejected { background: #fee2e2; color: #991b1b; font-weight:700; }

/* ─── Pending badge di kartu buku ─── */
.return-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  width: 100%;
  justify-content: center;
  cursor: default;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

/* ═══════════════════════════════════════════════════
   DETAIL BUKU (MODAL)
═══════════════════════════════════════════════════ */

.modal-book-detail { max-width: 600px; }
.book-detail-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.book-detail-left {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.detail-book-cover {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.detail-book-placeholder {
  width: 140px;
  height: 200px;
  background: var(--green-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 1px solid var(--gray-200);
}
.detail-book-right {
  flex: 1;
  min-width: 0;
}
.detail-book-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
  line-height: 1.2;
}
.detail-book-author {
  font-size: 15px;
  color: var(--gray-600);
  margin-bottom: 16px;
}
.detail-book-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--gray-50);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-label {
  color: var(--gray-500);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detail-book-desc {
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
}
.desc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.desc-text {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .book-detail-layout { flex-direction: column; align-items: center; }
  .book-detail-left { width: 120px; }
  .detail-book-right { width: 100%; text-align: center; }
  .detail-book-meta { text-align: left; }
  .detail-book-desc { text-align: left; }
}
