/* ============================================
   HLC E-Library — Light Cream + Gold Theme
   ============================================ */

:root {
  --gold: #B8922A;
  --gold-light: #D4AA45;
  --gold-dark: #8A6A18;

  --bg-page: #F5F0E8;
  --bg-surface: #FFFFFF;
  --bg-card: #FDFAF4;
  --bg-sidebar: #1E1A14;
  --bg-sidebar-mid: #2A2318;

  --border: rgba(185,146,42,0.22);
  --border-strong: rgba(185,146,42,0.45);
  --border-subtle: rgba(0,0,0,0.08);

  --text-primary: #1A1610;
  --text-secondary: #4A3F2A;
  --text-muted: #8A7A60;
  --text-sidebar: #E8DFC8;
  --text-sidebar-muted: #8A7A60;

  --success: #1A7A4A;
  --danger: #C0392B;
  --warning: #D68910;
  --info: #1A6EA8;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.14);
  --shadow-gold: 0 4px 20px rgba(185,146,42,0.18);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F5F0E8 0%, #EDE6D5 50%, #E4D9C0 100%);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(185,146,42,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(185,146,42,0.08) 0%, transparent 50%);
}

.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(185,146,42,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185,146,42,0.07) 1px, transparent 1px);
  background-size: 60px 60px;
}

.login-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 44px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md), 0 0 60px rgba(185,146,42,0.1);
  animation: slideUp 0.6s ease;
}

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

.login-logo-wrap { text-align: center; margin-bottom: 28px; }

.login-logo-img {
  width: 150px; height: 150px;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  border: 3px solid var(--gold);
  padding: 8px;
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(185,146,42,0.2), var(--shadow-gold);
  display: block;
  margin: 0 auto;
}

.login-logo-fallback {
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: var(--shadow-gold);
  font-size: 52px;
}

.login-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-dark);
  text-align: center;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.login-tabs {
  display: flex;
  background: var(--bg-page);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
  border: 1px solid var(--border);
}

.login-tab {
  flex: 1; padding: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: 'Crimson Pro', serif; font-size: 15px;
  border-radius: 6px; cursor: pointer; transition: var(--transition);
}

.login-tab.active { background: var(--gold); color: #fff; font-weight: 600; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 7px; letter-spacing: 1px; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
}

.form-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-page);
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px; color: var(--text-primary);
  font-family: 'Crimson Pro', serif; font-size: 16px;
  transition: var(--transition); outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185,146,42,0.12);
  background: #fff;
}

.form-input::placeholder { color: #B0A090; }
.form-input[readonly] { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none; border-radius: 8px; color: #fff;
  font-family: 'Playfair Display', serif; font-size: 17px;
  font-weight: 700; cursor: pointer; transition: var(--transition);
  letter-spacing: 0.5px; margin-top: 8px;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(185,146,42,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.login-error {
  background: rgba(192,57,43,0.08);
  border: 1px solid rgba(192,57,43,0.25);
  color: #C0392B; padding: 10px 14px;
  border-radius: 8px; font-size: 14px;
  margin-top: 12px; text-align: center; display: none;
}

.login-footer { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 13px; }

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(185,146,42,0.18);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100; transition: var(--transition);
}

.sidebar-header { padding: 24px 20px 20px; border-bottom: 1px solid rgba(185,146,42,0.15); }

.sidebar-logo { display: flex; align-items: center; gap: 12px; }

.sidebar-logo-img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: contain;
  border: 1px solid rgba(185,146,42,0.4);
  background: #1E1A14;
  padding: 4px;
}

.sidebar-logo-fallback {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-sidebar-mid); border: 1px solid rgba(185,146,42,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.sidebar-brand { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700; color: var(--gold-light); line-height: 1.2; }
.sidebar-brand-sub { font-size: 11px; color: var(--text-sidebar-muted); font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; }

.sidebar-user { padding: 16px 20px; border-bottom: 1px solid rgba(185,146,42,0.12); background: var(--bg-sidebar-mid); }
.sidebar-user-role { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold-light); font-family: 'JetBrains Mono', monospace; margin-bottom: 2px; }
.sidebar-user-name { font-size: 15px; color: #E8DFC8; font-weight: 500; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-label { padding: 16px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-sidebar-muted); font-family: 'JetBrains Mono', monospace; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: #C0B090; cursor: pointer;
  transition: var(--transition); font-size: 15px;
  border-left: 3px solid transparent; margin: 1px 0;
}

.nav-item:hover { background: rgba(185,146,42,0.08); color: #E8DFC8; }
.nav-item.active { background: rgba(185,146,42,0.14); color: var(--gold-light); border-left-color: var(--gold-light); font-weight: 500; }
.nav-icon { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(185,146,42,0.12); }

.btn-logout {
  width: 100%; padding: 10px;
  background: rgba(192,57,43,0.12); border: 1px solid rgba(192,57,43,0.3);
  border-radius: 8px; color: #E88070; cursor: pointer;
  font-family: 'Crimson Pro', serif; font-size: 15px;
  transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-logout:hover { background: rgba(192,57,43,0.22); }

.main-content { margin-left: 260px; flex: 1; min-height: 100vh; background: var(--bg-page); }

.topbar {
  background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.topbar-title { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--text-primary); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-search {
  display: flex; align-items: center;
  background: var(--bg-page); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 14px; gap: 8px;
}
.topbar-search input { background: transparent; border: none; outline: none; color: var(--text-primary); font-family: 'Crimson Pro', serif; font-size: 15px; width: 200px; }
.topbar-search input::placeholder { color: #B0A090; }

.page-content { padding: 28px; }

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }

.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 24px; position: relative;
  overflow: hidden; transition: var(--transition); box-shadow: var(--shadow);
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.stat-icon { font-size: 28px; margin-bottom: 12px; display: block; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 36px; font-weight: 700; color: var(--gold); line-height: 1; margin-bottom: 6px; }
.stat-label { color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* ============================================
   SECTION CARDS & TABLES
   ============================================ */
.section-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; box-shadow: var(--shadow); }

.section-header { padding: 16px 24px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); }

.section-title { font-family: 'Playfair Display', serif; font-size: 17px; color: var(--gold-dark); display: flex; align-items: center; gap: 10px; font-weight: 700; }

.section-body { padding: 24px; }
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
thead tr { background: var(--bg-page); border-bottom: 2px solid var(--border); }
thead th { padding: 12px 16px; text-align: left; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
tbody tr { border-bottom: 1px solid rgba(0,0,0,0.05); transition: var(--transition); }
tbody tr:hover { background: rgba(185,146,42,0.04); }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.badge-gold   { background: rgba(185,146,42,0.12); color: #7A5A10; border: 1px solid rgba(185,146,42,0.3); }
.badge-green  { background: rgba(26,122,74,0.1);   color: #145A30; border: 1px solid rgba(26,122,74,0.25); }
.badge-blue   { background: rgba(26,110,168,0.1);  color: #0D4A7A; border: 1px solid rgba(26,110,168,0.25); }
.badge-red    { background: rgba(192,57,43,0.1);   color: #8B2010; border: 1px solid rgba(192,57,43,0.25); }
.badge-purple { background: rgba(100,60,140,0.1);  color: #4A2070; border: 1px solid rgba(100,60,140,0.2); }
.badge-orange { background: rgba(214,137,16,0.1);  color: #7A4A00; border: 1px solid rgba(214,137,16,0.25); }

/* ============================================
   BUTTONS
   ============================================ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer; font-family: 'Crimson Pro', serif; font-size: 15px; transition: var(--transition); font-weight: 600; }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; font-weight: 700; }
.btn-gold:hover { box-shadow: 0 4px 16px rgba(185,146,42,0.3); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-dark); background: rgba(185,146,42,0.05); }
.btn-danger { background: rgba(192,57,43,0.08); border: 1px solid rgba(192,57,43,0.25); color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,0.15); }
.btn-success { background: rgba(26,122,74,0.1); border: 1px solid rgba(26,122,74,0.25); color: var(--success); }
.btn-success:hover { background: rgba(26,122,74,0.18); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,15,8,0.55); backdrop-filter: blur(6px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: #FFFFFF; border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md), 0 0 60px rgba(185,146,42,0.12);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-lg { max-width: 720px; }
@keyframes modalIn { from { opacity:0; transform: scale(0.92) translateY(20px); } to { opacity:1; transform: scale(1) translateY(0); } }

.modal-header { padding: 20px 26px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold-dark); font-weight: 700; }
.modal-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; transition: var(--transition); border-radius: 6px; }
.modal-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.06); }
.modal-body { padding: 26px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-select {
  width: 100%; padding: 12px 16px;
  background: var(--bg-page); border: 1.5px solid var(--border-subtle);
  border-radius: 8px; color: var(--text-primary);
  font-family: 'Crimson Pro', serif; font-size: 16px;
  outline: none; cursor: pointer; transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23B8922A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-select:focus { border-color: var(--gold); }
.form-select option { background: #fff; color: var(--text-primary); }

.form-textarea { width: 100%; padding: 12px 16px; background: var(--bg-page); border: 1.5px solid var(--border-subtle); border-radius: 8px; color: var(--text-primary); font-family: 'Crimson Pro', serif; font-size: 16px; outline: none; resize: vertical; min-height: 90px; transition: var(--transition); }
.form-textarea:focus { border-color: var(--gold); }

.modal-footer { padding: 16px 26px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg-card); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

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

.book-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; transition: var(--transition); cursor: pointer; box-shadow: var(--shadow); }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); border-color: var(--border); }

.book-cover { height: 160px; background: linear-gradient(135deg, #EDE6D5, #DDD0B8); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.book-cover-img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-icon { font-size: 48px; opacity: 0.5; }
.book-cover-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.15)); }

.book-info { padding: 14px; }
.book-title { font-family: 'Playfair Display', serif; font-size: 15px; color: var(--text-primary); margin-bottom: 5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.book-author { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }

/* Search Bar */
.search-bar { display: flex; align-items: center; background: var(--bg-surface); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 18px; gap: 10px; margin-bottom: 24px; box-shadow: var(--shadow); }
.search-bar input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: 'Crimson Pro', serif; font-size: 17px; }
.search-bar input::placeholder { color: #B0A090; }
.search-icon { color: var(--gold); font-size: 18px; }

.filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip { padding: 6px 16px; border: 1.5px solid var(--border); border-radius: 20px; background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; font-size: 14px; font-family: 'Crimson Pro', serif; transition: var(--transition); font-weight: 500; }
.filter-chip:hover, .filter-chip.active { border-color: var(--gold); color: var(--gold-dark); background: rgba(185,146,42,0.08); }

/* File Upload */
.file-upload-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 28px; text-align: center; cursor: pointer; transition: var(--transition); background: var(--bg-page); }
.file-upload-zone:hover { border-color: var(--gold); background: rgba(185,146,42,0.04); }
.file-upload-icon { font-size: 36px; margin-bottom: 10px; }
.file-upload-text { color: var(--text-secondary); font-size: 15px; font-weight: 500; }
.file-upload-hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 15px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #FFFFFF; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 380px; box-shadow: var(--shadow-md); animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }
.toast-icon { font-size: 20px; }
.toast-msg { font-size: 15px; color: var(--text-primary); }

/* Book Detail */
.book-detail { display: flex; gap: 28px; align-items: flex-start; }
.book-detail-cover { width: 160px; flex-shrink: 0; background: var(--bg-page); border-radius: 10px; overflow: hidden; border: 1px solid var(--border-subtle); }
.book-detail-cover img { width: 100%; }
.book-detail-cover-placeholder { width: 160px; height: 200px; display: flex; align-items: center; justify-content: center; font-size: 56px; opacity: 0.5; }
.book-detail-info { flex: 1; }
.book-detail-title { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--text-primary); margin-bottom: 8px; font-weight: 700; }
.book-detail-meta { color: var(--text-secondary); font-size: 15px; margin-bottom: 16px; line-height: 1.8; }
.book-detail-desc { color: var(--text-secondary); font-size: 16px; line-height: 1.7; margin-bottom: 20px; }

/* Loading */
.loading-spin { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hamburger */
.hamburger { display: none; background: transparent; border: none; color: var(--text-primary); font-size: 22px; cursor: pointer; padding: 6px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90; }

/* Info boxes */
.info-box { padding: 14px; border-radius: 10px; font-size: 14px; margin-top: 16px; }
.info-box-blue { background: rgba(26,110,168,0.08); border: 1px solid rgba(26,110,168,0.2); color: #0D4A7A; }
.info-box-gold { background: rgba(185,146,42,0.07); border: 1px solid var(--border); color: var(--text-muted); }
.info-box-green { background: rgba(26,122,74,0.08); border: 1px solid rgba(26,122,74,0.2); color: #145A30; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 14px; }
  .topbar { padding: 12px 14px; }
  .topbar-search { display: none; }
  .login-card { padding: 28px 20px 24px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .book-detail { flex-direction: column; }
  .modal { max-height: 95vh; }
  .form-row { grid-template-columns: 1fr; }
  .section-body { padding: 14px; }
  .section-header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }

  /* Mobile Table — Card Layout */
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr { display: block; width: 100%; }

  .table-wrap thead { display: none; }

  .table-wrap tbody tr {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .table-wrap tbody tr:hover { background: var(--bg-surface); }

  .table-wrap tbody td {
    padding: 5px 0;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }

  .table-wrap tbody td:last-child { border-bottom: none; padding-bottom: 0; }

  .table-wrap tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
    padding-top: 2px;
    font-family: 'JetBrains Mono', monospace;
  }

  /* Action buttons on mobile */
  .table-wrap tbody td .btn { padding: 5px 10px; font-size: 12px; }

  /* Stats grid full on very small */
  .stat-card { padding: 16px; }
  .stat-value { font-size: 28px; }
}

/* ============================================
   LIBRARY CARD PRINT
   ============================================ */
@media print {
  .sidebar, .topbar, .hamburger, .sidebar-overlay,
  .btn, .info-box, .nav-item { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff !important; }
  #hlc-card {
    box-shadow: none !important;
    max-width: 85.6mm;
    margin: 0 auto;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
