/* =========================================================
   Sistem Informasi Perpustakaan Damaschus Anugerah Saragih
   Palet: Navy tua + Gold/Emas (elegan, klasik-modern)
   ========================================================= */
:root {
  --clr-primary: #14284D;
  --clr-primary-dark: #0B1F3A;
  --clr-primary-light: #EEF1F7;
  --clr-accent: #C9A227;
  --clr-accent-light: #F6ECC9;
  --clr-bg: #F7F6F2;
  --clr-surface: #FFFFFF;
  --clr-text: #1C1F26;
  --clr-muted: #6B7280;
  --clr-border: #E4E1D8;
  --sidebar-width: 258px;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(11,31,58,0.08);
  --shadow-md: 0 10px 28px rgba(11,31,58,0.12);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  margin: 0;
}

h1, h2, h3, h4, h5, .brand-font {
  font-family: 'Playfair Display', 'Poppins', serif;
  font-weight: 700;
}

/* ---------- LAYOUT ---------- */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(201,162,39,0.25);
}

.sidebar .brand {
  padding: 20px 18px;
  font-size: 1.02rem;
  border-bottom: 1px solid rgba(201,162,39,0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Playfair Display', serif;
}
.sidebar .brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 2px; }
.sidebar .brand span { line-height: 1.15; }
.sidebar .brand small { display: block; font-size: 0.62rem; letter-spacing: .08em; color: var(--clr-accent); font-family: 'Inter', sans-serif; }

.sidebar .nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.5);
  padding: 16px 20px 6px;
}

.sidebar .nav-link {
  color: rgba(255,255,255,0.85);
  padding: 10px 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.sidebar .nav-link i { font-size: 1.02rem; width: 20px; text-align: center; color: var(--clr-accent); }
.sidebar .nav-link:hover {
  background: rgba(201,162,39,0.10);
  color: #fff;
}
.sidebar .nav-link.active {
  background: rgba(201,162,39,0.16);
  color: #fff;
  border-left-color: var(--clr-accent);
  font-weight: 600;
}

.sidebar .user-box {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(201,162,39,0.25);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar .menu-toggle {
  display: none;
  background: var(--clr-primary-light);
  border: none;
  color: var(--clr-primary-dark);
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 1.1rem;
}

.page-body { padding: 24px; }

/* ---------- CARDS ---------- */
.card {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  font-weight: 700;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .2s ease;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-icon {
  position: absolute;
  right: 14px; top: 14px;
  font-size: 2.4rem;
  opacity: 0.28;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; font-family: 'Playfair Display', serif; }
.stat-card .stat-label { font-size: 0.82rem; opacity: 0.92; }

.bg-grad-navy   { background: linear-gradient(135deg, #0B1F3A, #1D3B66); }
.bg-grad-gold   { background: linear-gradient(135deg, #A9821F, #D4AF37); }
.bg-grad-plum   { background: linear-gradient(135deg, #5B3A5E, #7A4F7E); }
.bg-grad-forest { background: linear-gradient(135deg, #2E5339, #3F7350); }

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--clr-primary-dark);
  border-color: var(--clr-primary-dark);
}
.btn-accent {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
  color: #1C1F26;
  font-weight: 600;
}
.btn-accent:hover { background: #b6911f; color: #1C1F26; }
.btn-outline-accent {
  border-color: var(--clr-accent);
  color: var(--clr-accent-dark, #8a6c14);
}
.btn-outline-accent:hover { background: var(--clr-accent); color: #1C1F26; }

/* ---------- TABLES ---------- */
.table thead th {
  background: var(--clr-primary-light);
  color: var(--clr-primary-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: none;
  white-space: nowrap;
}
.table td { vertical-align: middle; font-size: 0.9rem; }
.table-hover tbody tr:hover { background: var(--clr-primary-light); }

.badge-status { padding: 5px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }

/* ---------- KATALOG / BOOK CARD ---------- */
.book-card {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.book-cover-wrap { aspect-ratio: 2/3; overflow: hidden; background: var(--clr-primary-light); }
.book-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display:block; }
.book-card-body { padding: 12px 14px; flex: 1; display:flex; flex-direction:column; }
.book-card-title { font-size: 0.92rem; font-weight: 700; line-height:1.3; margin-bottom:2px; font-family:'Playfair Display',serif;}
.book-card-author { font-size: 0.78rem; color: var(--clr-muted); margin-bottom:8px; }
.book-card-cat { font-size: 0.66rem; letter-spacing:.04em; text-transform:uppercase; color: var(--clr-accent); font-weight:700; margin-bottom:6px;}
.book-card-footer { margin-top:auto; display:flex; gap:6px; }

.ebook-badge {
  position:absolute; top:8px; left:8px; background: var(--clr-accent); color:#1C1F26;
  font-size:.62rem; font-weight:700; padding:3px 8px; border-radius:20px; letter-spacing:.03em;
  box-shadow:0 2px 6px rgba(0,0,0,.25);
}
.book-cover-wrap { position:relative; }

/* ---------- LOGIN PAGE (nuansa fantasi ringan, tetap ringan diakses) ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 15%, #1D3B66 0%, #0B1F3A 55%, #060F1F 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-card {
  background: var(--clr-surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  max-width: 900px;
  width: 100%;
  display: flex;
  position: relative;
  z-index: 2;
}
.login-visual {
  flex: 1;
  background: linear-gradient(160deg, #0B1F3A, #14284D 60%, #1D3B66);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(201,162,39,0.14);
  right: -80px; bottom: -80px;
}
.login-visual .quote {
  margin-top: 22px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--clr-accent-light);
  border-left: 2px solid var(--clr-accent);
  padding-left: 14px;
  line-height: 1.5;
}
.login-form-side {
  flex: 1;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-icon-badge {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.login-icon-badge img { width: 44px; height: 44px; }

/* dekorasi bintang ringan (CSS-only, tanpa gambar/video berat) */
.stars-layer { position:absolute; inset:0; z-index:1; pointer-events:none; }
.star {
  position:absolute; width:3px; height:3px; background:var(--clr-accent); border-radius:50%;
  opacity:.7; animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.6); }
}
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(14px); }
  to { opacity:1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .5s ease both; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar .menu-toggle { display: inline-flex; align-items:center; justify-content:center; }
  .login-card { flex-direction: column; }
  .login-visual { display: none; }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1025;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 575.98px) {
  .page-body { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
}

/* ---------- PUBLIC NAVBAR (katalog tanpa login) ---------- */
.public-navbar {
  background: linear-gradient(90deg, var(--clr-primary-dark), var(--clr-primary));
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top:0; z-index: 1020;
  box-shadow: var(--shadow-sm);
}
.public-navbar .brand { color:#fff; display:flex; align-items:center; gap:10px; font-family:'Playfair Display',serif; font-weight:700; }
.public-navbar .brand img { width:34px; height:34px; border-radius:50%; background:#fff; padding:2px; }
.public-hero {
  background: linear-gradient(135deg, #0B1F3A, #14284D);
  color:#fff;
  padding: 46px 24px;
  text-align:center;
}
.public-hero h1 { font-size: 1.8rem; }
.public-hero p { opacity:.85; max-width:560px; margin:10px auto 0; }
