/* ============================================
   Harry's Reading List — Premium Modern UI
   Inspired by Linear, Apple, Notion
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f5f5;
  --color-border: rgba(0,0,0,0.06);
  --color-border-hover: rgba(0,0,0,0.12);
  --color-text: #1a1a1a;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-accent: #d97706;
  --color-accent-light: rgba(217,119,6,0.08);
  --color-star: #d97706;
  --color-star-empty: #e5e7eb;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 2rem 1.5rem;
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.header-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.reading-philosophy {
  color: var(--color-text-secondary);
  font-style: italic;
  font-size: 13px;
}

.about-details {
  margin-top: 0.5rem;
  font-size: 13px;
  color: var(--color-text-secondary);
  max-width: 640px;
  line-height: 1.6;
}

.about-details summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text-muted);
}

.about-details p {
  margin-top: 0.4rem;
  margin-bottom: 0.25rem;
}

/* Stats — compact inline bar */
.header-stats {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.stat-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ---- Toolbar ---- */
.toolbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.toolbar-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 300px;
}

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

.search-box input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  background: var(--color-surface-alt);
  transition: border-color var(--transition), background var(--transition);
  font-family: var(--font-sans);
  color: var(--color-text);
}

.search-box input::placeholder {
  color: var(--color-text-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-border-hover);
  background: var(--color-surface);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---- Filter Pills ---- */
.filter-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.filter-pill.active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.filter-pill .pill-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform var(--transition);
}

.filter-pill.open .pill-arrow {
  transform: rotate(180deg);
}

/* Filter dropdown menu */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: none;
  padding: 4px;
}

.filter-dropdown.open {
  display: block;
}

.filter-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.filter-dropdown-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.filter-dropdown-item.selected {
  color: var(--color-text);
  font-weight: 600;
}

.filter-dropdown-item.selected::before {
  content: '✓ ';
  color: var(--color-accent);
}

/* ---- Overflow Menu (... button) ---- */
.overflow-menu-container {
  position: relative;
}

.overflow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.overflow-btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.overflow-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: none;
  padding: 4px;
}

.overflow-dropdown.open {
  display: block;
}

.overflow-dropdown button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.overflow-dropdown button:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* ---- Buttons ---- */
.btn {
  padding: 0.45rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.25rem;
}

.btn-primary:hover {
  background: #333;
}

.btn-subtle {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-subtle:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid rgba(220,38,38,0.2);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

.btn-small {
  padding: 0.3rem 0.6rem;
  font-size: 12px;
}

/* ---- Main Content ---- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ---- Book Sections ---- */
.book-section {
  margin-bottom: 3.5rem;
}

.book-section.hidden {
  display: none;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}

/* ---- Book Grid ---- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.25rem;
}

.book-grid.empty::after {
  content: attr(data-empty-message);
  color: var(--color-text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
}

/* ---- Book Cards ---- */
.book-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-border-hover);
}

.book-card-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3f4f6;
}

/* Placeholder cover — gradient + book icon */
.book-card-cover .placeholder-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f0f0f0 0%, #e8e8e8 50%, #e0e0e0 100%);
}

.placeholder-cover .placeholder-icon {
  color: var(--color-text-muted);
  opacity: 0.35;
}

.book-card-info {
  padding: 0.85rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.book-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.15rem;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  align-self: stretch;
}

.book-card-author {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
  align-self: stretch;
}

.book-card-rating {
  margin-top: auto;
}

.stars {
  display: inline-flex;
  gap: 1px;
}

.star {
  color: var(--color-star-empty);
  font-size: 14px;
  line-height: 1;
}

.star.filled {
  color: var(--color-star);
}

.progress-bar {
  margin-top: 0.4rem;
  background: var(--color-surface-alt);
  border-radius: 3px;
  height: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width var(--transition);
}

.progress-text {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

.modal-form {
  max-width: 700px;
}

.modal-small {
  max-width: 500px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.modal h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* Book Detail Modal */
.detail-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-cover {
  width: 130px;
  flex-shrink: 0;
}

.detail-cover img,
.detail-cover .placeholder-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  object-fit: cover;
}

.detail-cover .placeholder-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
}

.detail-meta {
  flex: 1;
}

.detail-meta h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.detail-meta .detail-author {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 0.75rem;
}

.detail-meta .detail-rating {
  margin-bottom: 0.75rem;
}

.detail-meta .detail-rating .stars {
  font-size: 16px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.badge-accent {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: transparent;
}

.detail-field {
  margin-bottom: 0.75rem;
}

.detail-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.detail-field-value {
  font-size: 14px;
  color: var(--color-text);
}

.detail-notes {
  background: var(--color-surface-alt);
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.detail-status-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--color-surface);
  font-family: var(--font-sans);
  color: var(--color-text);
}

/* ---- Form Styles ---- */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.form-group {
  flex: 1;
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--color-surface);
  font-family: var(--font-sans);
  transition: border-color var(--transition);
  color: var(--color-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-text);
}

.form-group textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--color-text);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Open Library Search */
.ol-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ol-search input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--color-text);
}

.ol-search input:focus {
  outline: none;
  border-color: var(--color-text);
}

.ol-results {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.ol-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.ol-result-item:hover {
  background: var(--color-surface-alt);
}

.ol-result-item img {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--color-surface-alt);
}

.ol-result-info {
  flex: 1;
  min-width: 0;
}

.ol-result-title {
  font-size: 13px;
  font-weight: 500;
}

.ol-result-author {
  font-size: 12px;
  color: var(--color-text-muted);
}

.ol-result-year {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Import Modal */
#importModal textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  resize: vertical;
  margin-top: 0.5rem;
  color: var(--color-text);
}

#importModal input[type="file"] {
  margin: 0.75rem 0;
  font-size: 13px;
}

.import-options {
  margin: 0.75rem 0;
}

/* ---- Amazon Link ---- */
.amazon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: color var(--transition);
  flex-shrink: 0;
}

.amazon-link:hover {
  color: #1a1a1a;
}

.book-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
}

.book-card-bottom-left {
  flex: 1;
  min-width: 0;
}

.detail-amazon-link {
  margin-left: auto;
  text-decoration: none;
}

/* ---- List View Amazon Column ---- */
.book-list-col-amazon {
  width: 36px;
  text-align: center;
}

/* ---- Genre Tag on Cards ---- */
.book-card-genre {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 0.3rem;
}

/* ---- Rating Legend ---- */
.rating-legend-container {
  position: relative;
}

.rating-legend-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.rating-legend-toggle:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-secondary);
}

.rating-legend {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: none;
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.rating-legend.open {
  display: block;
}

/* ---- View Toggle ---- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-surface);
  cursor: pointer;
  color: #9ca3af;
  font-size: 16px;
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.view-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.view-toggle-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.view-toggle-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.view-toggle-btn.active {
  background: var(--color-text);
  color: #ffffff;
}

/* ---- List View ---- */

/* Override grid layout when showing list view */
.book-grid.list-view-active {
  display: block;
}

.book-list-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.book-list-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.book-list-table th {
  background: var(--color-surface);
  padding: 0.6rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border-hover);
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  white-space: nowrap;
}

.book-list-table th:hover {
  color: var(--color-text);
}

.book-list-table th.sort-active {
  color: var(--color-text);
}

.book-list-table td {
  padding: 0.6rem 0.75rem;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  line-height: 1.4;
}

.book-list-table tr.book-list-row {
  cursor: pointer;
  transition: background var(--transition);
  min-height: 46px;
}

.book-list-table tr.book-list-row:hover {
  background: var(--color-surface-alt);
}

.book-list-table tr.book-list-row:nth-child(even) {
  background: #fafafa;
}

.book-list-table tr.book-list-row:nth-child(even):hover {
  background: var(--color-surface-alt);
}

/* Column widths — proportional via percentages */
.book-list-col-title { width: 28%; font-weight: 500; }
.book-list-col-author { width: 19%; color: var(--color-text-secondary); }
.book-list-col-genre { width: 15%; color: var(--color-text-secondary); }
.book-list-col-rating { width: 14%; }
.book-list-col-status { width: 10%; }
.book-list-col-format { width: 10%; color: var(--color-text-secondary); font-size: 12px; }

.book-list-status-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* ---- Section Count ---- */
.section-count {
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

.clear-filters-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.clear-filters-link:hover {
  text-decoration: underline;
}

/* ---- Admin / Public Mode ---- */
.public-mode #addBookBtn,
.public-mode .overflow-menu-container {
  display: none;
}

.admin-indicator {
  display: none;
}

.admin-mode .admin-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 500;
}

.admin-indicator svg {
  width: 12px;
  height: 12px;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--color-text);
  color: white;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 2000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  box-shadow: var(--shadow-md);
}

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

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

/* Loading spinner */
.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .site-header {
    padding: 1.5rem 1rem 1.25rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .header-stats {
    gap: 1rem;
  }

  .toolbar {
    padding: 0.75rem 1rem;
  }

  .toolbar-content {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .toolbar-actions {
    flex-wrap: wrap;
  }

  .filter-group {
    width: 100%;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.75rem;
  }

  .main-content {
    padding: 1.5rem 1rem 3rem;
  }

  .modal {
    padding: 1.25rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-cover {
    width: 110px;
  }

  .detail-badges {
    justify-content: center;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .book-list-col-genre,
  .book-list-col-format,
  .book-list-col-amazon {
    display: none;
  }

  .book-list-col-title { width: 35%; }
  .book-list-col-author { width: 25%; }
  .book-list-col-rating { width: 20%; }
  .book-list-col-status { width: 20%; }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 1.35rem;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .filter-pill {
    font-size: 12px;
    padding: 0.3rem 0.6rem;
  }
}
