/* ==========================================================================
   Rekod Bacaan — PWA Styles
   Mobile-first, responsive, Bahasa Melayu
   Gaya: minimalis moden (rujukan Obsidian)
   ========================================================================== */

:root {
  --primary: #5b5bd6;
  --primary-dark: #4a4ac2;
  --primary-light: #eef0ff;
  --accent: #8b5cf6;
  --success: #10b981;
  --success-light: #e7f8f0;
  --warning: #f59e0b;
  --warning-light: #fef6e7;
  --danger: #ef4444;
  --danger-light: #fdecec;
  --fiksyen: #8b5cf6;
  --fiksyen-light: #f3effe;
  --nonfiksyen: #0ea5e9;
  --nonfiksyen-light: #e8f5fd;
  --text: #1f1f1f;
  --text-muted: #6e6e6e;
  --bg: #f7f6f3;
  --card-bg: #ffffff;
  --border: #e7e5e0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  padding-bottom: 96px; /* ruang untuk FAB */
}

.hidden {
  display: none !important;
}

/* ================= HEADER ================= */

.app-header {
  background: var(--card-bg);
  color: var(--text);
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ================= BUTANG ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid currentColor;
}

.btn-header {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-header:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-icon {
  font-size: 1rem;
}

/* ================= KONTAINER ================= */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px 0;
}

/* ================= DASHBOARD ================= */

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-total .stat-value {
  color: var(--primary);
}
.stat-reading .stat-value {
  color: var(--warning);
}
.stat-done .stat-value {
  color: var(--success);
}

/* ================= BAR KATEGORI ================= */

.category-bars {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.category-bars-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.category-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.category-bar-row:last-child {
  margin-bottom: 0;
}

.category-bar-label {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 78px;
}

.category-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.fill-fiksyen {
  background: var(--fiksyen);
}
.fill-nonfiksyen {
  background: var(--nonfiksyen);
}

.category-bar-count {
  font-size: 0.8rem;
  font-weight: 800;
  min-width: 24px;
  text-align: right;
  color: var(--text-muted);
}

/* ================= TOOLBAR ================= */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  flex: 1 1 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  opacity: 0.5;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-appearance: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
}

.filter-tab {
  flex: 1;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ================= SENARAI BUKU ================= */

.book-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .book-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.book-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: stretch;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  animation: cardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d8d5ee;
}

/* Cover buku */
.book-cover {
  flex: 0 0 72px;
  width: 72px;
  min-height: 104px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--primary-light), var(--fiksyen-light));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.book-cover.cover-fallback {
  background: linear-gradient(160deg, var(--primary-light), var(--fiksyen-light));
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-letter {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  opacity: 0.75;
}

/* Badan kad */
.book-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.book-title {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-fiksyen {
  background: var(--fiksyen-light);
  color: var(--fiksyen);
}

.badge-nonfiksyen {
  background: var(--nonfiksyen-light);
  color: var(--nonfiksyen);
}

.badge-status {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.64rem;
}

.badge-status.selesai {
  background: var(--success-light);
  color: var(--success);
}

.badge-status.membaca {
  background: var(--warning-light);
  color: #b45309;
}

.book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.book-rating {
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--warning);
}

.book-rating .no-rating {
  color: var(--border);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.book-dates {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.book-dates .date-range::before {
  content: "🗓 ";
}

.book-status-row {
  display: flex;
  align-items: center;
}

/* Tindakan ikon */
.book-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--bg);
}

.btn-icon-btn {
  width: 36px;
  height: 32px;
  padding: 0;
  font-size: 0.9rem;
  border-radius: 8px;
  flex: 0 0 auto;
}

.btn-edit {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-edit:hover {
  background: #e0e4ff;
}

.btn-export-single {
  background: var(--bg);
  color: var(--text-muted);
}

.btn-export-single:hover {
  background: #eceef0;
}

.btn-delete {
  background: var(--danger-light);
  color: var(--danger);
}

.btn-delete:hover {
  background: #fcdcdc;
}

/* ================= KEADAAN KOSONG ================= */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.empty-state h2 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 6px;
}

/* ================= FAB ================= */

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.9rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(91, 91, 214, 0.4);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.fab:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 10px 28px rgba(91, 91, 214, 0.5);
}

.fab:active {
  transform: scale(0.94);
}

.fab-icon {
  transition: transform 0.25s ease;
  line-height: 1;
}

/* ================= MODAL ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--card-bg);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overscroll-behavior: contain;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }

  .modal {
    border-radius: var(--radius);
    margin: 20px;
    box-shadow: var(--shadow-lg);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  background: var(--bg);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ================= FORM ================= */

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #b0b3c0;
}

/* Star rating */
.star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star {
  background: none;
  border: none;
  font-size: 1.9rem;
  color: var(--border);
  cursor: pointer;
  padding: 0 2px;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.star:hover {
  transform: scale(1.15);
}

.star.active {
  color: var(--warning);
}

.rating-clear {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.rating-clear:hover {
  color: var(--danger);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions .btn {
  flex: 1;
  padding: 13px;
  font-size: 0.95rem;
}

.form-actions .btn-ghost {
  color: var(--text-muted);
}

/* ================= TOAST ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

/* ================= SOROTAN CARIAN ================= */

mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ================= SKRIN KECIL ================= */

@media (max-width: 380px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .btn-header {
    padding: 6px 9px;
    font-size: 0.75rem;
  }

  .book-cover {
    flex-basis: 60px;
    width: 60px;
    min-height: 90px;
  }
}

/* ================= DESKTOP DASHBOARD ================= */

.sidebar,
.desktop-page-heading {
  display: none;
}

.brand-icon svg,
.sidebar-brand-icon svg,
.stat-icon svg,
.btn-icon svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-label {
  display: none;
}

@media (min-width: 900px) {
  :root {
    --desktop-sidebar: 280px;
  }

  body {
    padding-bottom: 0;
    background: #f8f7f4;
  }

  .app-shell {
    display: flex;
    min-height: 100vh;
  }

  .sidebar {
    display: flex;
    flex: 0 0 var(--desktop-sidebar);
    flex-direction: column;
    min-height: 100vh;
    padding: 34px 22px 28px;
    background: rgba(248, 247, 244, 0.96);
    border-right: 1px solid var(--border);
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 0 16px;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .sidebar-brand-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #26344a;
  }

  .sidebar-brand-icon svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 38px;
  }

  .sidebar-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #3d414b;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }

  .sidebar-link:hover {
    background: #efedf9;
    color: var(--primary);
    transform: translateX(2px);
  }

  .sidebar-link.active {
    background: #ece9fb;
    color: var(--primary);
  }

  .sidebar-link-icon {
    display: inline-flex;
    width: 22px;
    align-items: center;
    justify-content: center;
    color: currentColor;
    font-size: 1.2rem;
    line-height: 1;
  }

  .sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .app-main {
    min-width: 0;
    flex: 1;
  }

  .app-header {
    position: static;
    padding: 30px 44px 0;
    border-bottom: 0;
    background: transparent;
  }

  .header-inner {
    max-width: none;
    margin: 0;
    justify-content: flex-end;
  }

  .app-header .brand {
    display: none;
  }

  .header-actions {
    gap: 10px;
  }

  .btn-header {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: #3d414b;
    font-size: 0.88rem;
    box-shadow: var(--shadow-sm);
  }

  .btn-header:hover {
    background: #fff;
    border-color: #c9c5ec;
    color: var(--primary);
    box-shadow: var(--shadow-md);
  }

  .container {
    max-width: none;
    padding: 0 44px 40px;
  }

  .desktop-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 14px 0 28px;
  }

  .page-kicker {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
  }

  .desktop-page-heading h2 {
    color: #20232b;
    font-size: clamp(2rem, 3vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
  }

  .page-count {
    padding-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
  }

  .dashboard {
    display: flex;
    align-items: stretch;
    min-height: 142px;
    margin-bottom: 22px;
    padding: 25px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
  }

  .stat-card {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 8px 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
  }

  .stat-card + .stat-card::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 1px;
    background: var(--border);
    content: "";
  }

  .stat-card:hover {
    transform: none;
    box-shadow: none;
  }

  .stat-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.4rem;
  }

  .stat-reading .stat-icon {
    background: var(--success-light);
    color: var(--success);
  }

  .stat-done .stat-icon {
    background: #eff0ff;
    color: var(--primary);
  }

  .stat-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-label {
    order: 0;
    margin: 0 0 4px;
    color: #45474e;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }

  .stat-value {
    order: 1;
    color: #252831 !important;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
  }

  .stat-note {
    order: 2;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
  }

  .category-bars {
    display: none;
  }

  .toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
  }

  .toolbar .search-box {
    flex: 0 1 380px;
  }

  .toolbar .filter-tabs {
    display: none;
  }

  .search-box input {
    min-height: 46px;
    border-radius: 11px;
    background: var(--card-bg);
  }

  .book-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
  }

  .book-card {
    position: relative;
    min-height: 184px;
    gap: 17px;
    padding: 17px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.86);
  }

  .book-card:hover {
    transform: translateY(-2px);
  }

  .book-cover {
    flex-basis: 96px;
    width: 96px;
    min-height: 148px;
    border-radius: 7px;
  }

  .book-body {
    padding-right: 94px;
    gap: 7px;
  }

  .book-card-header {
    display: block;
  }

  .book-title {
    font-size: 1rem;
  }

  .book-author {
    margin-top: 5px;
    font-size: 0.8rem;
  }

  .book-card-header > .badge {
    display: inline-block;
    margin-top: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.68rem;
  }

  .badge-nonfiksyen {
    background: var(--nonfiksyen-light) !important;
    color: var(--nonfiksyen) !important;
  }

  .book-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 5px;
  }

  .book-rating {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .book-dates {
    font-size: 0.72rem;
  }

  .book-status-row {
    display: none;
  }

  .book-actions {
    position: absolute;
    top: 28px;
    right: 14px;
    bottom: auto;
    display: flex;
    width: 82px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 0 0 0 14px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .book-actions .btn-icon-btn {
    display: inline-flex;
    width: 100%;
    height: 32px;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
  }

  .book-actions .btn-icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
  }

  .book-actions .btn-delete:hover {
    color: var(--danger);
  }

  .action-icon {
    display: inline-flex;
    width: 17px;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
  }

  .action-label {
    display: inline;
  }

  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 30px 0 8px;
  }

  .page-button {
    display: inline-flex;
    min-width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .page-button:hover:not(:disabled),
  .page-button.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  .page-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
  }

  .page-arrow {
    font-size: 1.4rem;
    font-weight: 400;
  }

  .page-ellipsis {
    min-width: 20px;
    color: var(--text-muted);
    text-align: center;
  }

  .fab {
    right: 38px;
    bottom: 34px;
  }
}

@media (min-width: 1200px) {
  .sidebar {
    flex-basis: 298px;
    padding-right: 26px;
    padding-left: 26px;
  }

  .container {
    padding-right: 58px;
    padding-left: 58px;
  }

  .app-header {
    padding-right: 58px;
    padding-left: 58px;
  }

  .book-card {
    min-height: 188px;
  }
}
