/* ============================================================
   style.css — Perpustakaan Digital SD N Ngaliyan 01
   Aesthetic: Warm Academic — Teal + Amber + Cream
   Fonts: Merriweather (headings) + Nunito (body)
   ============================================================ */

/* ---- Root Variables ---- */
:root {
  --teal-900: #134e4a;
  --teal-800: #115e59;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-300: #fcd34d;
  --amber-100: #fef3c7;
  --amber-50:  #fffbeb;

  --cream:     #faf8f5;
  --cream-dark:#f0ede8;
  --brown-100: #d6c9b6;
  --brown-500: #78604a;
  --brown-800: #3d2b1f;

  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-600:  #4b5563;
  --gray-800:  #1f2937;
  --gray-900:  #111827;

  --success:   #059669;
  --danger:    #dc2626;
  --warning:   #d97706;
  --info:      #2563eb;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.14);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-head: 'Merriweather', Georgia, serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--gray-800);
  line-height: 1.7;
  font-size: 15px;
  padding-top: 72px; /* navbar height */
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--teal-900);
  line-height: 1.3;
}

a { color: var(--teal-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-800); }

img { max-width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
#mainNav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.08);
  padding: 0.65rem 0;
  transition: background var(--transition), box-shadow var(--transition);
}

#mainNav.scrolled {
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.14);
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
  color: white;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 1.1rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--teal-900);
}
.brand-sub { font-size: 0.7rem; color: var(--teal-600); font-weight: 600; }

.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--gray-700);
  padding: 0.4rem 0.9rem !important;
  border-radius: 8px;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--teal-700);
  background: var(--teal-50);
}

.btn-icon {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gray-600);
  transition: all var(--transition);
  position: relative;
}
.btn-icon:hover { background: var(--teal-50); color: var(--teal-600); }

.badge-notif {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid white;
}

.btn-user {
  background: var(--teal-50);
  border: 1.5px solid var(--teal-200, #99f6e4);
  border-radius: 50px;
  padding: 0.3rem 0.8rem 0.3rem 0.4rem;
  display: flex; align-items: center; gap: 8px;
  color: var(--gray-800);
  font-weight: 600; font-size: 0.85rem;
  transition: all var(--transition);
}
.btn-user:hover { background: var(--teal-100); border-color: var(--teal-400); }
.btn-user::after { content: none; }
.btn-user .dropdown-toggle::after { margin-left: 4px; }

.avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal-200, #99f6e4);
}

.dropdown-menu {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  min-width: 200px;
}
.dropdown-header {
  padding: 0.5rem 0.75rem;
  color: var(--gray-800);
}
.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--teal-50); color: var(--teal-700); }
.dropdown-item.text-danger:hover { background: #fee2e2; color: var(--danger); }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
  position: fixed;
  top: 82px; right: 16px;
  z-index: 9999;
  max-width: 380px;
  animation: slideInRight 0.4s ease;
}
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: 10px;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-900));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}
.btn-outline-primary {
  border-color: var(--teal-600);
  color: var(--teal-700);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--teal-600);
  color: white;
}
.btn-amber {
  background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
  border-color: transparent;
  color: var(--brown-800);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-amber:hover {
  background: linear-gradient(135deg, var(--amber-500), #d97706);
  transform: translateY(-1px);
  color: var(--brown-800);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 50%, #1e6e69 100%);
  color: white;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(20, 184, 166, 0.2) 0%, transparent 50%);
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 60px;
  background: var(--cream);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-300);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: white;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-title span {
  color: var(--amber-300);
  position: relative;
}

.hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex; gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }
.hero-stat-num {
  font-family: var(--font-head);
  font-size: 1.8rem; font-weight: 900;
  color: var(--amber-300);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.78rem; font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-illustration {
  position: relative;
  display: flex; justify-content: center; align-items: center;
}

.book-stack {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  perspective: 800px;
}

.book-card-mini {
  aspect-ratio: 3/4;
  border-radius: 8px;
  display: flex; align-items: flex-end;
  padding: 10px 8px;
  font-size: 0.65rem; font-weight: 700;
  color: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-lg);
  transform: rotateY(-8deg);
  transition: transform var(--transition);
  animation: floatBook 3s ease-in-out infinite;
}
.book-card-mini:nth-child(2) { animation-delay: 0.3s; transform: rotateY(-4deg) translateY(-8px); }
.book-card-mini:nth-child(3) { animation-delay: 0.6s; }
.book-card-mini:nth-child(4) { animation-delay: 0.9s; transform: translateY(-4px); }
.book-card-mini:nth-child(5) { animation-delay: 0.2s; transform: rotateY(4deg) translateY(-12px); }
.book-card-mini:nth-child(6) { animation-delay: 0.7s; }

@keyframes floatBook {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-section {
  background: white;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-wrapper {
  position: relative;
  max-width: 600px;
}

.search-wrapper .form-control {
  padding: 0.75rem 1rem 0.75rem 3rem;
  border-radius: 50px;
  border: 2px solid var(--gray-200);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all var(--transition);
  background: var(--gray-50);
}
.search-wrapper .form-control:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
  background: white;
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.search-btn {
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  border-radius: 50px;
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-header {
  margin-bottom: 2rem;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--teal-900);
  margin-bottom: 0.25rem;
}
.section-subtitle {
  color: var(--gray-500, #6b7280);
  font-size: 0.95rem;
}
.section-line {
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--amber-400), var(--amber-300));
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* ============================================================
   CATEGORY PILLS
   ============================================================ */
.category-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.pill {
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700; font-size: 0.82rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-100);
  color: var(--gray-600);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.pill:hover, .pill.active {
  background: var(--teal-600);
  color: white;
  border-color: var(--teal-600);
}
.pill-kelas {
  background: var(--amber-50);
  color: var(--brown-500);
  border-color: var(--amber-200, #fde68a);
}
.pill-kelas:hover, .pill-kelas.active {
  background: var(--amber-400);
  color: var(--brown-800);
  border-color: var(--amber-400);
}

/* ============================================================
   BOOK CARDS
   ============================================================ */
.book-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.book-grid .book-card {
  flex: 0 0 calc(20% - 1rem);
  min-width: 160px;
  max-width: 220px;
}

.book-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  transition: all var(--transition);
  position: relative;
  display: flex; flex-direction: column;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-200, #99f6e4);
}

.book-cover-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--gray-100);
}
.book-cover-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.book-card:hover .book-cover-wrap img { transform: scale(1.05); }

.book-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--teal-700);
  color: white;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 50px;
  letter-spacing: 0.03em;
}
.book-badge.kelas { background: var(--amber-500); color: var(--brown-800); }

.book-overlay {
  position: absolute; inset: 0;
  background: rgba(13, 148, 136, 0.9);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}
.book-card:hover .book-overlay { opacity: 1; }

.book-body {
  padding: 0.85rem;
  flex: 1;
  display: flex; flex-direction: column;
}
.book-title {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.book-author {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
  font-weight: 600;
  margin-bottom: 8px;
}
.book-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.68rem; color: var(--gray-500, #6b7280);
  margin-top: auto;
}
.book-meta i { color: var(--teal-500); }

.rating-stars { color: var(--amber-400); font-size: 0.7rem; }

/* ============================================================
   SCHOOL PROFILE SECTION
   ============================================================ */
.school-profile-section {
  background: linear-gradient(160deg, var(--teal-900), var(--teal-800));
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.school-profile-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2314b8a6' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.visi-misi-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.vm-icon {
  width: 48px; height: 48px;
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-300);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* ============================================================
   QUOTE / SLOGAN BANNER
   ============================================================ */
.quote-banner {
  background: var(--amber-50);
  border: 1px solid var(--amber-200, #fde68a);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.quote-banner::before {
  content: '"';
  position: absolute;
  top: -20px; left: 16px;
  font-family: var(--font-head);
  font-size: 10rem; font-weight: 900;
  color: rgba(245, 158, 11, 0.12);
  line-height: 1;
  pointer-events: none;
}
.quote-text {
  font-family: var(--font-head);
  font-size: 1.35rem; font-weight: 700;
  color: var(--teal-900);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.quote-source {
  font-size: 0.85rem; color: var(--brown-500); font-weight: 600;
}

/* ============================================================
   TOP BOOKS / POPULAR
   ============================================================ */
.popular-rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.9rem;
  flex-shrink: 0;
}
.rank-1 { background: #fef3c7; color: #92400e; border: 2px solid var(--amber-400); }
.rank-2 { background: #f3f4f6; color: #374151; border: 2px solid #d1d5db; }
.rank-3 { background: #fde8d8; color: #7c2d12; border: 2px solid #fb923c; }
.rank-other { background: var(--teal-50); color: var(--teal-700); border: 2px solid var(--teal-200, #99f6e4); }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
  font-family: var(--font-body);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  transition: all var(--transition);
  background: var(--gray-50);
  font-size: 0.92rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
  background: white;
  outline: none;
}
.form-label {
  font-weight: 700; font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}
.input-group-text {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  color: var(--gray-500, #6b7280);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
  min-height: calc(100vh - 72px);
  display: flex; align-items: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(20, 184, 166, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
    var(--cream);
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--cream-dark);
  width: 100%; max-width: 440px;
  margin: 2rem auto;
}

.auth-logo {
  text-align: center; margin-bottom: 2rem;
}
.auth-logo .logo-circle {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
  border-radius: var(--radius);
  display: grid; place-items: center;
  margin: 0 auto 1rem;
  font-size: 2rem; color: white;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

/* ============================================================
   DASHBOARD (ADMIN + USER)
   ============================================================ */
.dashboard-layout {
  display: flex; min-height: calc(100vh - 72px);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--cream-dark);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  position: sticky; top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-label {
  font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-400);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-weight: 600; font-size: 0.88rem;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}
.sidebar-link:hover { background: var(--teal-50); color: var(--teal-700); }
.sidebar-link.active {
  background: linear-gradient(135deg, var(--teal-50), rgba(20, 184, 166, 0.1));
  color: var(--teal-700);
  font-weight: 700;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--teal-600);
  border-radius: 3px;
}
.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; }

/* Main Content */
.dashboard-content {
  flex: 1;
  padding: 2rem;
  background: var(--gray-50);
  overflow-x: hidden;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--cream-dark);
}
.page-title {
  font-size: 1.6rem; font-weight: 900;
  color: var(--teal-900);
  margin-bottom: 0.25rem;
}
.page-breadcrumb {
  font-size: 0.82rem; color: var(--gray-400);
}
.page-breadcrumb a { color: var(--teal-600); font-weight: 600; }

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-num {
  font-family: var(--font-head);
  font-size: 1.8rem; font-weight: 900;
  color: var(--teal-900);
  line-height: 1;
  margin-bottom: 2px;
}
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--gray-500, #6b7280); }
.stat-change {
  font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
}
.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }

/* Data Table */
.data-table {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
  overflow: hidden;
}
.data-table .table {
  margin-bottom: 0;
  font-size: 0.875rem;
}
.data-table .table th {
  background: var(--gray-50);
  font-weight: 800; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
  padding: 0.9rem 1rem;
}
.data-table .table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  color: var(--gray-700);
  border-color: var(--cream-dark);
}
.data-table .table tbody tr:hover { background: var(--teal-50); }

.table-cover {
  width: 40px; height: 52px;
  object-fit: cover; border-radius: 6px;
  border: 1px solid var(--gray-200);
}

/* Status Badges */
.badge {
  font-family: var(--font-body);
  font-weight: 700; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 50px;
}
.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-user  { background: var(--teal-50); color: var(--teal-700); }

/* ============================================================
   BOOK DETAIL PAGE
   ============================================================ */
.book-detail-cover {
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 280px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 3px solid white;
}

.book-detail-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-dark);
}

.meta-row {
  display: flex; gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 0.88rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-key { font-weight: 700; color: var(--gray-600); min-width: 120px; }
.meta-val { color: var(--gray-800); }

.rating-display {
  display: flex; align-items: center; gap: 8px;
}
.rating-big {
  font-family: var(--font-head);
  font-size: 2.5rem; font-weight: 900;
  color: var(--teal-900);
}
.stars-row { color: var(--amber-400); font-size: 1.2rem; }
.rating-count { font-size: 0.82rem; color: var(--gray-500, #6b7280); }

/* Comment Card */
.comment-card {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}
.comment-avatar {
  width: 38px; height: 38px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--teal-200, #99f6e4);
}

/* ============================================================
   PDF VIEWER
   ============================================================ */
.pdf-viewer-container {
  background: #525659;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.pdf-toolbar {
  background: #3d4043;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  color: white;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--teal-900);
  color: rgba(255,255,255,0.8);
  margin-top: 5rem;
}

.footer-top { padding: 3.5rem 0 2.5rem; }

.footer-brand {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  color: white;
}

.footer-desc { font-size: 0.88rem; color: rgba(255,255,255,0.65); line-height: 1.6; }

.footer-title {
  color: var(--amber-300);
  font-weight: 800; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem; font-weight: 500;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--amber-300); }

.footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-contact li {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 10px;
  font-size: 0.88rem; color: rgba(255,255,255,0.65);
}
.footer-contact i { color: var(--amber-300); margin-top: 2px; flex-shrink: 0; }

.social-links { display: flex; gap: 8px; }
.social-links a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: all var(--transition);
}
.social-links a:hover { background: var(--amber-400); color: var(--brown-800); }

.footer-bottom {
  background: rgba(0,0,0,0.2);
  padding: 1rem 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.bg-teal-50  { background: var(--teal-50) !important; }
.bg-amber-50 { background: var(--amber-50) !important; }
.bg-cream    { background: var(--cream) !important; }

.text-teal   { color: var(--teal-600) !important; }
.text-amber  { color: var(--amber-500) !important; }

.card-custom {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
}

.section-pad { padding: 5rem 0; }

.img-book-thumb {
  width: 56px; height: 74px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-400);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h5 { color: var(--gray-600); font-family: var(--font-head); }

/* Spinner */
.spinner-teal {
  border-color: var(--teal-200, #99f6e4);
  border-top-color: var(--teal-600);
}

/* Progress bar */
.progress { border-radius: 50px; background: var(--gray-200); }
.progress-bar {
  background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
  border-radius: 50px;
}

/* Scroll to top */
#scrollTop {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  background: var(--teal-700);
  color: white; border: none;
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: none; place-items: center;
  cursor: pointer; z-index: 999;
  transition: all var(--transition);
  font-size: 1rem;
}
#scrollTop.show { display: grid; }
#scrollTop:hover { background: var(--teal-900); transform: translateY(-3px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .sidebar { display: none; }
  .dashboard-layout { flex-direction: column; }
  .dashboard-content { padding: 1.25rem; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 767px) {
  body { padding-top: 66px; }
  .auth-card { padding: 1.75rem 1.25rem; border-radius: var(--radius-lg); }
  .hero-section { padding: 3.5rem 0 3rem; }
  .section-pad { padding: 3rem 0; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .hero-stats { gap: 1rem; }
  .stat-card { padding: 1rem; }
}

@media (max-width: 480px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

.pulse-teal {
  animation: pulseTeal 2s ease-in-out infinite;
}
@keyframes pulseTeal {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.3); }
  50%       { box-shadow: 0 0 0 10px rgba(13, 148, 136, 0); }
}
