/* ==========================================
   BookHolder — Premium Design System
   ========================================== */

:root {
  /* Colors — Deep Navy + Gold accent */
  --bg-primary: #0f1923;
  --bg-secondary: #1a2734;
  --bg-card: #1e2d3d;
  --bg-card-hover: #243447;
  --bg-input: #152231;
  --bg-sidebar: #0d1520;

  --accent: #f0a500;
  --accent-hover: #ffc233;
  --accent-glow: rgba(240, 165, 0, 0.15);
  --accent-subtle: rgba(240, 165, 0, 0.08);

  --text-primary: #e8edf2;
  --text-secondary: #8899aa;
  --text-muted: #5a6d7e;
  --text-inverse: #0f1923;

  --danger: #e74c5e;
  --danger-hover: #ff6b7a;
  --success: #2ecc71;
  --info: #3498db;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(240, 165, 0, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(240, 165, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --topbar-height: 64px;

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

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ==========================================
   Auth Screen
   ========================================== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(240, 165, 0, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(52, 152, 219, 0.05) 0%, transparent 50%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.5s ease-out;
}

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

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px rgba(240, 165, 0, 0.3));
}

.auth-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(240, 165, 0, 0.3);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

.auth-form { animation: fadeIn 0.3s ease; }

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

/* ==========================================
   Form Elements
   ========================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238899aa'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
  min-height: 1.2em;
}

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

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e09400);
  color: var(--text-inverse);
  box-shadow: 0 2px 10px rgba(240, 165, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: 0 4px 15px rgba(240, 165, 0, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(231, 76, 94, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 94, 0.2);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  background: rgba(231, 76, 94, 0.1);
}

/* ==========================================
   Layout — App
   ========================================== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.logo-small { font-size: 1.5rem; }

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.sidebar-nav {
  padding: 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 450;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-create {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.nav-create:hover {
  color: var(--accent);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1.5rem;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-icon { font-size: 1.1rem; }

.user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.top-bar {
  height: var(--topbar-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-bar input {
  padding-left: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border-color: var(--border);
}

.search-bar input:focus {
  background: var(--bg-input);
}

.page-content {
  flex: 1;
  padding: 2rem;
  animation: pageEnter 0.3s ease;
}

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

/* ==========================================
   Page Headers
   ========================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ==========================================
   Filter Bar
   ========================================== */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  font-weight: 500;
}

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

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

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

.book-cover {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.book-card-body {
  padding: 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-author {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.book-card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.genre-tag {
  padding: 0.2rem 0.55rem;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ==========================================
   Book Detail Page
   ========================================== */
.book-detail {
  max-width: 800px;
}

.book-detail-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.book-detail-cover {
  width: 200px;
  min-width: 200px;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--text-muted);
  flex-shrink: 0;
  position: relative;
}

.book-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.cover-upload-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.cover-upload-btn:hover {
  background: var(--accent);
  color: var(--text-inverse);
}

.book-detail-info {
  flex: 1;
}

.book-detail-info h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.book-detail-info .author-link {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.book-detail-meta {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.meta-label {
  font-weight: 500;
  color: var(--text-muted);
  min-width: 110px;
}

.book-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Description sections */
.description-section {
  margin-bottom: 1.5rem;
}

.description-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-glow);
  margin-bottom: 0.75rem;
}

.description-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.description-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================
   Authors & Genres List
   ========================================== */
.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.list-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.list-table tr {
  transition: background var(--transition);
}

.list-table tbody tr:hover {
  background: var(--accent-subtle);
}

.list-table .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ==========================================
   Home / Dashboard
   ========================================== */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.recent-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

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

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

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

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

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem;
  color: var(--text-secondary);
}

/* ==========================================
   Themed Book Sections
   ========================================== */
.themed-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-glow);
  margin-bottom: 1rem;
}

/* ==========================================
   Google Books Import
   ========================================== */
.google-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.google-result-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.google-result-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.google-result-cover {
  width: 45px;
  height: 65px;
  min-width: 45px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.google-result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.google-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.google-result-info strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

/* ==========================================
   Checkbox Lists
   ========================================== */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 150px;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
}

.checkbox-list::-webkit-scrollbar {
  width: 6px;
}
.checkbox-list::-webkit-scrollbar-track {
  background: transparent;
}
.checkbox-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.checkbox-item:hover {
  background: var(--bg-card-hover);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close-btn { display: block; }
  .sidebar-toggle-btn { display: block; }

  .main-content {
    margin-left: 0;
  }

  .top-bar { padding: 0 1rem; }
  .page-content { padding: 1.25rem; }

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

  .book-detail-cover {
    width: 160px;
    height: 220px;
    min-width: 160px;
  }

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

  .dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .auth-container {
    padding: 1.5rem;
    margin: 1rem;
    border-radius: var(--radius-lg);
  }
}
