/* ========================================= */
/* ========== [index.html] BASE THEME ====== */
/* ========================================= */
:root {
  --booki-red: #FF4338;
  --light-bg: #ffffff;
  --dark-bg: #202123;
  --dark-card: #2a2b2e;
  --light-text: #333;
  --dark-text: #f0f0f0;
  --section-bg: rgba(0, 0, 0, 0.04);
  --success-green: #4caf50;
  --warning-orange: #ff9800;
  --info-blue: #2196f3;
  --error-red: #c00;
  --muted-text: #888;
  --border-color: #ddd;
  --bg-secondary: #f5f5f5;
}

body.dark-mode {
  --section-bg: rgba(255, 255, 255, 0.04);
  --muted-text: #aaa;
  --border-color: #444;
  --bg-secondary: #2a2b2e;
}

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

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--light-bg);
  color: var(--light-text);
}

h1, h2, h3, .logo {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--booki-red);
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--light-text);
}

/* ===== [landing page: index.html] styles (from home.css) ===== */

body.landing {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

body.landing .booki-container {
  display: flex;
  height: 100vh;
  width: 100%;
  background-color: var(--dark-bg);
}

/* ── BOOK PANEL (Single Page Viewer) ──── */
body.landing .book-panel {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-right: 2px solid var(--booki-red);
  padding: 20px 30px;
  box-sizing: border-box;
  height: 100vh;
}

.page-viewer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding-top: 10px;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  justify-content: center;
  width: 100%;
  padding-top: 0;
}

.page-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--booki-red);
  margin-top: 0;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--booki-red);
  margin: 0;
  line-height: 1.2;
}

.page-image-wrap {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 6px;
}

.page-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-color, #ccc);
  margin: 0;
}

.page-nav {
  padding: 12px 0 8px;
  width: 100%;
}

.page-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}

.page-tabs::-webkit-scrollbar { display: none; }

.page-tab {
  background: none;
  border: none;
  color: var(--booki-red);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  opacity: 0.5;
  transition: opacity 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.page-tab:hover { opacity: 1; }

.page-tab.active { opacity: 1; font-weight: 700; }

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  cursor: pointer;
  transition: background 0.2s;
}

.page-dot.active {
  background: var(--booki-red);
}

body.landing .access-panel {
  width: 380px;
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 30px 20px 20px;
  box-sizing: border-box;
  height: 100vh;
  text-align: center;
  background-color: var(--dark-bg);
  color: var(--dark-text);
  border-left: 2px solid var(--booki-red);
  overflow: hidden;
}

/* ===== Compact Landing Header ===== */
body.landing .booki-header {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0 4px;
  background-color: var(--dark-bg);
}

/* Logo */
body.landing .logo {
  display: block;
  margin: 0 auto;
  font-family: Arial, Helvetica, sans-serif !important;
  font-style: normal !important;
  font-weight: 800 !important;
  font-size: 2.1em;
  color: var(--booki-red);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* Tagline */
body.landing .tagline {
  display: block;
  margin: 4px auto 0;          /* ✅ center tagline exactly under logo */
  font-size: 0.95em;
  color: var(--booki-red);
  line-height: 1.2;
}

body.landing .form-topbar {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  width: 100%;
  padding: 0 0 10px 0;
  transition: opacity 0.3s ease;
}

/* Hidden state */
body.landing .form-topbar.hidden {
  display: none;
}

body.landing .back-btn {
  grid-column: 1;
  background: none;
  border: none;
  color: var(--booki-red);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

body.landing .form-topbar h2 {
  grid-column: 2;
  text-align: center;
  margin: 0;
  color: var(--booki-red);
  font-size: 1.4em;
  font-weight: 700;
}

body.landing .scrollable-form {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 30px 0;
  margin: 0;
  justify-content: flex-start;
}

body.landing .scrollable-form::-webkit-scrollbar {
  width: 6px;
}
body.landing .scrollable-form::-webkit-scrollbar-thumb {
  background-color: rgba(255, 67, 56, 0.4);
  border-radius: 4px;
}

body.landing .scrollable-form > * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.landing .footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: none;
  width: 100%;
}

body.landing .footer-links a {
  color: var(--booki-red);
  text-decoration: none;
  font-weight: 500;
}

body.landing .footer-links a:hover {
  text-decoration: underline;
}

.footer-socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.social-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.social-link img:hover {
  opacity: 1;
}

body.landing .access-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 320px;
  margin: 20px auto;
  transition: opacity 0.5s ease, transform 0.4s ease;
}

body.landing .access-options.hidden {
  display: none;              /* ✅ KEY FIX: remove layout space */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

body.landing .main-tab {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--booki-red);
  color: var(--booki-red);
  background: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

body.landing .main-tab:hover {
  background-color: var(--booki-red);
  color: #fff;
}

body.landing .form-section {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  background-color: var(--dark-bg);
  flex-grow: 1;
  justify-content: flex-start;
  margin: 0 auto;
  animation: fadeIn 0.6s ease forwards;
}

body.landing .form-section.visible {
  display: flex;
}

body.landing form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 0;
  margin-bottom: 30px;
}

body.landing label {
  color: var(--booki-red);
  font-weight: 500;
  font-size: 0.9rem;
}

body.landing input,
body.landing select {
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #2b2b2b;
  color: var(--dark-text);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.landing input:focus,
body.landing select:focus {
  border-color: var(--booki-red);
  box-shadow: 0 0 4px rgba(255, 67, 56, 0.4);
}

/* ── Partner form layout ── */
body.landing #partner-signup-form {
  max-width: 100%;
  width: 100%;
}

/* Every text/email/password/tel/url/file input and select inside the
   partner form must be full-width and stacked — override inline-block default */
body.landing #partner-signup-form input:not([type="checkbox"]):not([type="file"]),
body.landing #partner-signup-form select {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

body.landing #partner-signup-form input[type="file"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  cursor: pointer;
  color: #ccc;
}

body.landing #partner-signup-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  font-size: 1rem;
  background: #2b2b2b;
  color: #f0f0f0;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s;
  font-family: inherit;
  line-height: 1.5;
}

body.landing #partner-description:focus {
  border-color: var(--booki-red);
  box-shadow: 0 0 4px rgba(255, 67, 56, 0.4);
}

/* Email/Password block — flex column so labels and inputs stack vertically */
body.landing #partner-email-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Social media rows — icon on left, input stretches right */
body.landing .partner-social-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

body.landing .partner-social-row input[type="url"] {
  flex: 1;
  min-width: 0;
  width: auto; /* override the 100% rule above inside flex */
}

body.landing .btn-primary {
  background-color: var(--booki-red);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.landing .btn-primary:hover {
  background-color: var(--booki-red);
}

body.landing .separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: #999;
  font-size: 0.9rem;
}

body.landing .separator::before,
body.landing .separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 10px;
}

body.landing .g_id_signin {
  width: 100% !important;
  display: flex !important;
  justify-content: center;
  margin-bottom: 15px;
}

body.landing .g_id_signin iframe {
  width: 100% !important;
  min-width: 260px !important;
  border-radius: 6px !important;
}

body.landing .wallet-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

body.landing .wallet-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--booki-red);
  color: #111;
  background: #fff;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

body.landing .wallet-btn:hover {
  background-color: var(--booki-red);
  color: #fff;
}

body.landing .wallet-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

body.landing .wallet-label {
  display: block;
  color: var(--booki-red);
  line-height: 1;
}

body.landing .wallet-note {
  font-size: 0.85rem;
  color: var(--booki-red);
  margin-top: 10px;
  text-align: center;
}

/* Wallet section text color overrides */
#transactions-section h2,
#transactions-section h3,
#transactions-section h4,
#transactions-section h5,
#transactions-section label {
  color: var(--booki-red);
}

#transactions-section .sidebar-item {
  color: var(--booki-red);
}

body.landing .captcha-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--dark-text);
}

body.landing #email-login-fields.hidden,
body.landing #email-signup-fields.hidden {
  display: none;
}

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

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

@media (max-width: 900px) {
  body.landing .booki-container {
    flex-direction: column;
  }

  body.landing .book-panel {
    display: none;
  }

  body.landing .access-panel {
    width: 100%;
    height: 50%;
    border-left: none;
    border-top: 2px solid var(--booki-red);
  }

  body.landing .form-section,
  body.landing .access-options {
    max-width: 300px;
  }
}

/* ========== NAVIGATION ========== */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--light-bg);
  padding: 0 30px;
  height: 70px;
  border-bottom: 2px solid var(--booki-red);
}

body.dark-mode .nav-bar {
  background-color: var(--dark-bg);
  border-color: var(--booki-red);
}

.logo {
  font-family: Arial, Helvetica, sans-serif !important;
  font-style: normal !important;
  font-weight: 800 !important;
  font-size: 1.8em;
  color: var(--booki-red);
  letter-spacing: -0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 1;
}

/* ===== Final Pill Toggle Switch (No Text) ===== */
#theme-switch {
  width: 52px;
  height: 28px;
  background-color: #e0e0e0;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: background-color 0.3s ease;
  position: relative;
}

#theme-switch .pill-thumb {
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#theme-switch .pill-thumb img {
  width: 16px;
  height: 16px;
}

#theme-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

/* === Dark mode appearance === */
body.dark-mode #theme-switch {
  background-color: #1e1e1e;
}

body.dark-mode #theme-switch .pill-thumb {
  transform: translateX(24px);
  background-color: #2d2f31; /* Match navbar dark */
}

/* ========== END NAVIGATION ========== */


/* ========== [signup-Admin.html] ========== */
.under-construction {
  max-width: 600px;
  margin: 80px auto;
  padding: 40px;
  background: #fefefe;
  border: 2px dashed var(--booki-red);
  border-radius: 10px;
  text-align: center;
  color: var(--booki-red);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

body.dark-mode .under-construction {
  background: #2a2b2e;
  color: var(--booki-red);
}
/* ========== END [signup-Admin.html] ========== */

/* ========================================= */
/* ========== [profile.html] STYLES ========= */
/* ========================================= */

/* Main container and sections */
.main-content {
  padding: 20px;
  padding-top: 76px;
  padding-right: 20px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.content-section {
  margin-bottom: 40px;
}

.settings-group {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  width: 90%;
  max-width: 90%;
  box-sizing: border-box;
}

body.dark-mode .settings-group {
  background: #2a2a2a;
  border-color: #333;
}

#community-section .settings-group,
#community-section > * {
  max-width: 90%;
  box-sizing: border-box;
}

#community-section input[type="text"] {
  max-width: 90%;
  box-sizing: border-box;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--booki-red);
  margin: 0 0 16px;
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  background-color: white;
  border-bottom: 2px solid var(--booki-red);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  box-sizing: border-box;
}

body.dark-mode .nav-bar {
  background-color: var(--dark-card);
}

/* Navigation Sections */
.nav-center {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 100px; /* 👈 adds space from the logo */
  flex: 1;
  justify-content: flex-start;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Navigation Tabs */
.nav-tab {
  background: none;
  border: 1.5px solid var(--booki-red);
  color: var(--booki-red);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-tab:hover,
.nav-tab.active {
  background-color: var(--booki-red);
  color: #fff;
}

body.dark-mode .nav-tab {
  color: var(--booki-red);
  border-color: var(--booki-red);
}

body.dark-mode .nav-tab:hover,
body.dark-mode .nav-tab.active {
  background-color: var(--booki-red);
  color: #fff;
}

/* Profile Image – static */
.profile-photo {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 10px;
  border: 2px solid var(--booki-red);
  pointer-events: none; /* Prevent click */
}

/* Remove dropdown entirely */
.dropdown-menu {
  display: none !important;
}

/* Sticky Filter Wrapper (library) */
.library-filters-wrapper {
  position: sticky;
  top: 58px;
  z-index: 998;
  background-color: var(--light-bg);
  padding: 16px 20px;
  border-bottom: 1px solid transparent;
}

body.dark-mode .library-filters-wrapper {
  background-color: var(--dark-bg);
}

/* Sticky library heading */
.library-sticky-header {
  position: fixed;
  top: 71px;
  left: 0;
  right: 0;
  z-index: 150;
  background: transparent !important;
  padding: 10px 20px;
  box-sizing: border-box;
  box-sizing: border-box;
}

body.dark-mode .library-sticky-header {
  background: transparent !important;
}

.library-title {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

/* 🔥 REMOVED dropdown-menu styles (deprecated) */

/* Book & Copy Grid */
.book-grid, .copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 0;
  padding-top: 64px;
}

#book-copies-grid {
  padding-top: 12px;
}

#user-books,
#user-books-library-grid {
  padding-top: 12px;
}

/* Book & Copy Cards */
.book-card, .copy-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, filter 0.2s ease;
  width: 100%;
  height: 220px;
}

.book-card:hover, .copy-card:hover {
  filter: brightness(0.85);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.book-card img, .copy-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay Information */
.book-info-overlay, .copy-info-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(32, 33, 36, 0.85);
  color: var(--booki-red);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 0.75rem;
  overflow-y: auto;
  pointer-events: none; /* ✅ This lets clicks pass through */
}

.book-card:hover .book-info-overlay,
.copy-card:hover .copy-info-overlay {
  opacity: 1;
}

.book-info-overlay p, .copy-info-overlay p {
  margin: 2px 0;
  font-weight: 600;
}

/* Dark Mode Cards */
body.dark-mode .book-card, body.dark-mode .copy-card {
  background-color: var(--dark-card);
  box-shadow: 0 4px 10px rgba(255,255,255,0.05);
}

body.dark-mode .book-info-overlay, body.dark-mode .copy-info-overlay {
  background: rgba(0, 0, 0, 0.85);
  color: var(--booki-red);
}

/* Details Section */
.details-section {
  margin-top: 30px;
  padding: 10px;
  border-top: 2px solid var(--booki-red);
}

.copy-details-card {
  display: flex;
  align-items: center;
  border: 1px solid var(--booki-red);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.copy-details-card img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  margin-right: 20px;
  border-radius: 4px;
}

.copy-details-info {
  flex: 1;
}

.copy-details-info h3 {
  margin-bottom: 10px;
  color: var(--booki-red);
}

body.dark-mode .copy-details-card {
  background-color: var(--dark-card);
  color: var(--dark-text);
}

body.dark-mode .copy-details-card img {
  border: 1px solid #444;
}

/* Responsive Cards */
@media (max-width: 600px) {
  .copy-details-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .copy-details-card img {
    margin-right: 0;
    margin-bottom: 12px;
  }
}

/* ========================================= */
/* ========== FILTER INPUTS & BUTTONS ====== */
/* ========================================= */

.floating-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}

.filters-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  overflow: visible;
  justify-content: flex-start;
  width: 100%;
}

input[type="text"],
input[type="number"],
select,
input[type="file"] {
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  padding: 6px 10px;
  background-color: transparent;
  color: inherit;
  font-size: 0.85rem;
  height: 34px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Style C — applied explicitly to all form inputs/selects */
.filter-input {
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
  height: 34px;
  font-size: 0.85rem;
  color: var(--booki-red);
  outline: none;
  min-width: 0;
  box-sizing: border-box;
}

body.dark-mode .filter-input {
  background: rgba(32, 33, 35, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#filter-tags-container:focus-within,
#add-book-tags-container:focus-within {
  border-color: var(--booki-red);
  box-shadow: 0 0 0 1px var(--booki-red);
}

#filter-tags-container::-webkit-scrollbar,
#add-book-tags-container::-webkit-scrollbar {
  display: none;
}
#filter-tags-container,
#add-book-tags-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tag-suggestion-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #FF4338;
  border-bottom: 1px solid #333;
  transition: background 0.15s;
  font-weight: 500;
}

.tag-suggestion-item:last-child {
  border-bottom: none;
}

.tag-suggestion-item:hover {
  background: rgba(255, 67, 56, 0.15);
  color: #FF4338;
  font-weight: bold;
}

#filter-tags-suggestions,
#add-book-tag-suggestions {
  background: var(--dark-card, #2a2b2e);
  border: 1px solid #FF4338;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-family: inherit;
}

/* Inside the library filter bar: distribute space evenly */
.filters-row .filter-input,
.filters-row .filter-wrap {
  flex: 0 0 auto;
  min-width: 0;
}

/* Inputs/selects inside a wrapper fill the wrapper width */
.filter-wrap { position: relative; }
.filter-wrap > .filter-input { width: 100%; }

/* Fixed widths for library filter bar inputs */
#filter-title         { flex: 0 0 124px !important; width: 124px !important; }
#filter-author        { flex: 0 0 124px !important; width: 124px !important; }
#filter-original-lang { flex: 0 0 134px !important; width: 134px !important; }
#filter-trans-lang    { flex: 0 0 109px !important; width: 109px !important; }
#filter-sort-by       { flex: 1 1 auto !important; min-width: 79px !important; max-width: 100px !important; }
#filter-auction-btn   { flex: 0 0 84px  !important; width: 84px  !important; margin-left: 0 !important; }
#apply-filters        { flex: 0 0 72px  !important; width: 72px  !important; }
.filters-row .location-filter-group { flex: 1 1 auto !important; min-width: 100px !important; }

.filters-row .filter-apply-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

#filter-sort-by-wrap { flex: 1 1 auto; min-width: 79px; max-width: 110px; }

#copies-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 8px;
  overflow: visible;
}

#copies-filter-row .location-filter-group {
  position: relative;
  overflow: visible;
}

/* Floating availability date picker */
#filter-copy-available {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  display: none;
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--booki-red);
  border-radius: 6px;
  padding: 8px;
  width: 160px;
  color: var(--booki-red);
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}

/* Generic suggestion box (covers copies filter row dropdowns) */
.suggestion-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
}

.suggestion-box:not(:empty) { display: block; }

body.dark-mode .suggestion-box {
  background: #2c2c2c;
  border-color: var(--booki-red);
}

#book-copies-section .details-section {
  border-top: none;
}

.filter-clear-x {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--booki-red);
  font-size: 0.8rem;
  display: none;
  z-index: 10;
  background: transparent;
  border: none;
  padding: 0 2px;
}

textarea.filter-input {
  height: unset;
}

.filter-input::placeholder {
  color: rgba(255, 59, 48, 0.6);
}

input::placeholder {
  color: rgba(255, 60, 60, 0.6);
}

/* Select option text — inherits red from .filter-input */
.filter-input option {
  color: var(--booki-red);
  background: var(--light-bg);
}

body.dark-mode .filter-input option {
  background: var(--dark-card);
}

/* Library filter bar — scoped red overrides */
#booki-library-filters select,
#booki-library-filters input {
  color: var(--booki-red) !important;
}

#booki-library-filters select option {
  color: var(--booki-red) !important;
  background: var(--dark-bg);
}

#booki-library-filters input::placeholder {
  color: var(--booki-red) !important;
  opacity: 0.7;
}

body:not(.dark-mode) #booki-library-filters select option {
  background: white;
}

body:not(.dark-mode) #booki-library-filters .filter-input {
  background: #ffffff;
  color: var(--booki-red);
  border-color: var(--booki-red);
}

body:not(.dark-mode) #booki-library-filters .filter-input::placeholder {
  color: rgba(255, 67, 56, 0.5);
}

body:not(.dark-mode) #filter-tags-container {
  background: #ffffff;
}

input:focus,
select:focus,
input[type="file"]:focus {
  border-color: var(--booki-red);
  box-shadow: 0 0 3px 1px rgba(255, 60, 60, 0.5);
  outline: none;
}

/* Buttons like "Apply Filters" */
button,
button.small-btn {
  background-color: var(--booki-red);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover,
button.small-btn:hover {
  background-color: #e33;
}

/* Dark mode inputs */
body.dark-mode input,
body.dark-mode select,
body.dark-mode input[type="file"] {
  background-color: var(--dark-bg);
  color: white;
  border-color: var(--booki-red);
}

body.dark-mode .filter-input {
  color: var(--booki-red);
}

body.dark-mode input::placeholder {
  color: rgba(255, 60, 60, 0.6);
}

/* Location Autocomplete */
.location-filter-group {
  position: relative;
  flex: 1;
  min-width: 180px;
}

#location-suggestions,
#copy-location-suggestions,
#copy-book-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: white;
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

#location-suggestions:empty,
#copy-location-suggestions:empty,
#copy-book-suggestions:empty {
  display: none;
}

#book-not-found-msg {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-top: 6px;
}

/* Remove number spinner on Pages field */
#copy-pages::-webkit-outer-spin-button,
#copy-pages::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#copy-pages { -moz-appearance: textfield; }

/* Red text when typing in Add Copy form fields */
#add-copy-form input {
  color: var(--booki-red);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#add-copy-form #copy-isbn,
#add-copy-form #copy-edition,
#add-copy-form #copy-pages,
#add-copy-form #copy-publisher {
  box-sizing: border-box;
  overflow: hidden;
}

#add-copy-form .location-filter-group {
  box-sizing: border-box;
  overflow: visible; /* must not clip the autocomplete suggestion box */
}

/* Add Copy form — single stable nowrap row */
#add-copy-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

#add-copy-form #copy-book-search {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-width: none;
}

#add-copy-form #copy-isbn       { flex: 0 0 117px; min-width: 0; }
#add-copy-form #copy-edition    { flex: 0 0 65px;  min-width: 0; }
#add-copy-form #copy-pages      { flex: 0 0 85px;  min-width: 0; }
#add-copy-form #copy-publisher  { flex: 0 0 150px; min-width: 0; }

#add-copy-form .location-filter-group {
  flex: 0 0 180px;
  min-width: 0;
  position: relative;
}

/* City/Country input fills its group wrapper */
#add-copy-form .location-filter-group #copy-location {
  width: 100%;
  flex: none;
}

.add-cover-label {
  flex: 0 0 110px !important;
  display: inline-block;
  width: 110px;
  max-width: 110px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--booki-red);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  background: transparent;
  height: 34px;
}

.add-cover-label:hover {
  background: var(--booki-red);
  color: #fff;
}

body.dark-mode .add-cover-label {
  color: var(--booki-red);
  border-color: var(--booki-red);
}

#add-copy-form button[type="submit"] {
  flex-shrink: 0;
  white-space: nowrap;
}

.selected-book-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--booki-red);
  border-radius: 4px;
  background: transparent;
  font-size: 0.85rem;
}

.selected-book-card img {
  width: 40px;
  height: 54px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.selected-book-card strong {
  display: block;
  margin-bottom: 2px;
}

.selected-book-card p {
  margin: 0;
  color: #888;
  font-size: 0.8rem;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f3f3f3;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: var(--booki-red);
  color: #fff;
}

/* Dark Mode */
body.dark-mode #location-suggestions,
body.dark-mode #copy-location-suggestions,
body.dark-mode #copy-book-suggestions {
  background-color: #2c2c2c;
  border-color: var(--booki-red);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

body.dark-mode .suggestion-item {
  color: #ddd;
  border-bottom: 1px solid #444;
}

body.dark-mode .suggestion-item:hover {
  background-color: var(--booki-red);
  color: white;
}

.suggestion-item-new {
  font-style: italic;
  color: var(--booki-red);
  border-top: 1px solid rgba(255, 59, 48, 0.2);
}

#copy-suggest-form {
  flex-wrap: nowrap;
  gap: 8px;
}

#copy-suggest-form .filter-input,
#copy-suggest-form .location-filter-group {
  flex: 1;
  min-width: 0;
}

.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.copy-details-full {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  border: none;
  padding: 0;
  background-color: transparent;
}

/* Owner 4-column grid layout — single row, no scroll */
.copy-owner-grid {
  display: grid;
  grid-template-columns: 175px 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 130px);
  overflow: hidden;
}

.copy-col {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}

.copy-col-top {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.copy-col-bottom {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.copy-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--booki-red);
  flex-shrink: 0;
}

.copy-section-box {
  background: var(--section-bg);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.maps-icon-btn {
  background: transparent;
  border: 1px solid var(--booki-red);
  color: var(--booki-red);
  height: 24px;
  width: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maps-icon-btn:hover {
  background: var(--booki-red);
  color: #fff;
}

.copy-owner-input {
  height: 26px;
  font-size: 0.78rem;
  padding: 2px 4px;
  box-sizing: border-box;
  width: 100%;
}

.service-row { flex-shrink: 0; }

.copy-section-title {
  font-size: 0.65rem;
  color: var(--booki-red);
  opacity: 0.7;
  letter-spacing: 0.05em;
  margin: 4px 0 2px 0;
}

.copy-section-divider {
  border: none;
  border-top: 1px solid rgba(255, 59, 48, 0.3);
  margin: 4px 0;
}

.copy-delete-btn {
  background: transparent;
  border: 1px solid var(--booki-red);
  color: var(--booki-red);
  font-size: 0.78rem;
  padding: 4px 0;
  border-radius: 3px;
  cursor: pointer;
  flex: 1;
}

.copy-delete-btn:hover {
  background: var(--booki-red);
  color: #fff;
}

.copy-owner-link {
  text-decoration: none;
  color: var(--booki-red);
}

.svc-rate-badge {
  font-size: 0.7rem;
  color: var(--booki-red);
  opacity: 0.75;
  white-space: nowrap;
}

.svc-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--booki-red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-note {
  font-size: 0.78rem;
  color: #999;
}

.copy-currency-badge {
  font-size: 0.72rem;
  color: var(--booki-red);
  font-weight: 600;
  width: 32px;
  text-align: left;
}

/* Remove number input spinners inside copy detail grid */
.copy-owner-grid input[type=number]::-webkit-outer-spin-button,
.copy-owner-grid input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.copy-owner-grid input[type=number] {
  -moz-appearance: textfield;
}

/* Placeholder color for all inputs in copy detail grid */
.copy-owner-grid input::placeholder {
  color: rgba(255, 59, 48, 0.5);
}


.copy-detail-field {
  width: 100%;
  box-sizing: border-box;
  height: 24px;
  font-size: 0.78rem;
}

.copy-compact-calendar {
  width: 100%;
  flex-shrink: 0;
}

.copy-compact-calendar .cal-day {
  font-size: 0.75rem;
  padding: 3px;
}

.copy-fields-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
  flex-wrap: nowrap;
}


.copy-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,59,48,0.15);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .copy-owner-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .copy-col { height: auto; min-height: unset; }
  .copy-col-top, .copy-col-bottom { overflow: visible; height: auto; flex: none; }
}

.copy-owner-col1 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  overflow: hidden;
}

.copy-image-large {
  overflow: hidden;
  flex-shrink: 0;
}

.copy-add-photo-btn {
  width: 100%;
  height: 32px;
  background: transparent;
  border: 1px dashed var(--booki-red);
  color: var(--booki-red);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
}

.copy-add-photo-btn:hover {
  background: rgba(255, 59, 48, 0.08);
}

.copy-thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  overflow: hidden;
}

.copy-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.copy-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
}

.copy-thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--booki-red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.copy-image-large img {
  width: 175px;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

body.dark-mode .copy-details-full {
  background-color: transparent;
  color: var(--dark-text);
}

body.dark-mode .copy-details-info a {
  color: var(--booki-red);
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.transaction-table th,
.transaction-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}
.transaction-table th {
  background-color: #f9f9f9;
}

/* ===== Add Book/Copy Two-Column Layout ===== */
.add-form-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.add-form-grid .form-box {
  flex: 1 1 45%;
  background-color: var(--light-bg);
  padding: 20px;
  border: 1.5px solid var(--booki-red);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body.dark-mode .add-form-grid .form-box {
  background-color: var(--dark-card);
  border-color: var(--booki-red);
}

.add-form-grid h3 {
  color: var(--booki-red);
  margin-bottom: 10px;
}
/* =========================================
   LANDING: Email login/signup inputs alignment
   (paste at END of CSS file so it overrides older rules)
   ========================================= */

body.landing #email-login-fields,
body.landing #email-signup-fields {
  margin-top: 14px;
}

body.landing #email-login-fields form,
body.landing #email-signup-fields form {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

body.landing #email-login-fields label,
body.landing #email-signup-fields label {
  display: block;
  width: 100%;
  text-align: left;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95em;
  margin: 0;
}

body.landing #email-login-fields input,
body.landing #email-signup-fields input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 67, 56, 0.55);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  outline: none;
}

body.landing #email-login-fields input:focus,
body.landing #email-signup-fields input:focus {
  border-color: var(--booki-red);
  box-shadow: 0 0 0 2px rgba(255, 67, 56, 0.18);
}

/* Buttons inside email blocks */
body.landing #email-login-fields button,
body.landing #email-signup-fields button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 10px;
}

/* Optional: make button full width like inputs */
body.landing #email-login-fields button,
body.landing #email-signup-fields button {
  width: 100%;
}

/* =========================================
   PHASE 2: COPY DETAIL — TYPE BADGES
   ========================================= */

.type-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.type-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #ccc;
  color: #888;
  opacity: 0.5;
}

.type-badge.active {
  opacity: 1;
  color: #fff;
  border-color: transparent;
}

.type-badge.type-sell.active  { background-color: #2e7d32; }
.type-badge.type-rent.active  { background-color: #1565c0; }
.type-badge.type-swap.active  { background-color: #6a1b9a; }

/* =========================================
   PHASE 2: COPY DETAIL — DEPOSIT INFO
   ========================================= */

.deposit-info {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--booki-red);
  background: rgba(255, 67, 56, 0.06);
  border-radius: 0 4px 4px 0;
  font-size: 0.88rem;
}

body.dark-mode .deposit-info {
  background: rgba(255, 67, 56, 0.12);
}

/* =========================================
   PHASE 2: REQUEST BUTTON
   ========================================= */

.request-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 20px;
  background-color: var(--booki-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.request-btn:hover {
  background-color: #e33;
  transform: translateY(-1px);
}

/* =========================================
   PHASE 2: AVAILABILITY SECTION + CALENDAR
   ========================================= */

.availability-section {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--booki-red);
  border-radius: 8px;
  background-color: var(--light-bg);
}

.availability-section h4 {
  margin-bottom: 12px;
  color: var(--booki-red);
  font-size: 1rem;
}

body.dark-mode .availability-section {
  background-color: var(--dark-card);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-name {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--booki-red);
  padding: 4px 0;
}

.cal-day {
  text-align: center;
  padding: 6px 2px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease;
  user-select: none;
}

.cal-day:not(.empty):not(.past):hover {
  background-color: rgba(255, 67, 56, 0.10);
  border-color: var(--booki-red);
}

.cal-day.empty {
  cursor: default;
}

.cal-day.past {
  color: #bbb;
  cursor: not-allowed;
}

.cal-day.today {
  border: 1px solid var(--booki-red) !important;
  font-weight: 700;
  background: transparent;
}

/* Available days (owner-marked) — GREEN */
.cal-day.available {
  background-color: rgba(46, 125, 50, 0.15);
  color: #2e7d32;
  border-color: #66bb6a;
  cursor: pointer;
}

.cal-day.available:hover {
  background-color: rgba(46, 125, 50, 0.28);
}

/* Booked ranges (reserved by a user) — RED */
.cal-day.booked {
  background-color: rgba(211, 47, 47, 0.18);
  color: #c62828;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Selected range — darker green */
.cal-day.selected {
  background-color: rgba(46, 125, 50, 0.35);
  border-color: #2e7d32;
  color: #1b5e20;
  font-weight: 700;
}

body.dark-mode .cal-day.past     { color: #666; }
body.dark-mode .cal-day.available { background-color: rgba(46, 125, 50, 0.25); }
body.dark-mode .cal-day.booked    { background-color: rgba(211, 47, 47, 0.25); }
body.dark-mode .cal-day.selected  { background-color: rgba(46, 125, 50, 0.40); }

.cal-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
}

/* =========================================
   ===== SECTION BARS + QUEUE HEADINGS =====
   ========================================= */

.section-bar-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: var(--booki-red);
  font-weight: 600;
}

.queue-heading {
  margin: 20px 0 10px 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--booki-red);
  padding-bottom: 4px;
}

/* =========================================
   ===== PENDING COPY REQUESTS GRID ========
   ========================================= */

.pending-copies-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pending-copy-card {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex: 0 0 calc(33% - 12px);
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--booki-red);
  border-radius: 6px;
  padding: 10px;
  background: var(--light-bg);
}

.pending-copy-cover {
  width: 80px;
  min-width: 80px;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: 4px;
  align-self: flex-start;
}

.pending-copy-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 3px;
  font-size: 0.82rem;
}

.pending-copy-details h3 {
  color: var(--booki-red);
  font-size: 0.88rem;
  margin: 0 0 2px 0;
}

.pending-copy-details p {
  color: var(--booki-red);
  margin: 0;
}

.pending-copy-details .request-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.new-book-badge {
  display: inline-block;
  background: var(--booki-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.new-book-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.new-book-fields label {
  font-size: 0.75rem;
  color: var(--booki-red);
  margin-bottom: 0;
}

body.dark-mode .pending-copy-card {
  background: var(--dark-card);
}

/* Commission Rate Manager Table */
#commission-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 75vh;
  border: 1px solid var(--booki-red);
  border-radius: 6px;
  background: var(--light-bg);
}

#commission-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.82rem;
}

#commission-table thead th {
  background: var(--light-bg);
  color: var(--booki-red);
  border: 1px solid var(--booki-red);
  padding: 6px 4px;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

#commission-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

#commission-table thead tr:nth-child(1) th {
  position: static;
  background: var(--light-bg);
  border-bottom: 1px solid var(--booki-red);
}

#commission-table thead tr:nth-child(2) th {
  position: static;
  background: var(--light-bg);
  border-bottom: 2px solid var(--booki-red);
}

body.dark-mode #commission-table thead tr:nth-child(1) th,
body.dark-mode #commission-table thead tr:nth-child(2) th {
  background: var(--dark-card);
}

#commission-table .cr-sublabel {
  color: var(--booki-red);
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
}

#commission-table tbody tr {
  background: var(--light-bg);
}

#commission-table tbody tr:hover {
  background: rgba(255, 59, 48, 0.06);
}

body.dark-mode #commission-table-wrapper {
  background: var(--dark-card);
}

body.dark-mode #commission-table thead th {
  background: var(--dark-card);
}

body.dark-mode #commission-table tbody tr {
  background: var(--dark-bg);
}

body.dark-mode #commission-table tbody tr:hover {
  background: rgba(255, 59, 48, 0.1);
}

#commission-table tbody td {
  border: 1px solid rgba(255, 59, 48, 0.25);
  padding: 4px 4px;
  text-align: center;
  vertical-align: middle;
}

#commission-table .cr-country {
  color: var(--booki-red);
  font-weight: 500;
  text-align: left;
  padding-left: 10px;
  white-space: nowrap;
}

#commission-table .cr-currency {
  color: var(--booki-red);
  font-weight: 500;
  text-align: center;
}

.cr-input {
  background: transparent;
  border: 1px solid var(--booki-red);
  border-radius: 3px;
  color: var(--booki-red);
  font-size: 0.78rem;
  padding: 2px 3px;
  width: 46px;
  text-align: center;
  box-sizing: border-box;
}

.cr-input:focus {
  outline: none;
  background: rgba(255, 59, 48, 0.08);
}

.cr-input::-webkit-outer-spin-button,
.cr-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cr-input { -moz-appearance: textfield; }

/* =========================================== */
/* ===== OPERATIONS TABLE (matches commission table) ===== */
/* =========================================== */

#ops-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 75vh;
  border: 1px solid var(--booki-red);
  border-radius: 6px;
  background: var(--light-bg);
}

#ops-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.82rem;
}

#ops-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

#ops-table thead th {
  background: var(--light-bg);
  color: var(--booki-red);
  border: 1px solid var(--booki-red);
  padding: 6px 10px;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--booki-red);
}

#ops-table tbody tr {
  background: var(--light-bg);
}

#ops-table tbody tr:hover {
  background: rgba(255, 59, 48, 0.06);
}

#ops-table tbody td {
  border: 1px solid rgba(255, 59, 48, 0.25);
  padding: 6px 10px;
  vertical-align: middle;
  color: var(--booki-red);
}

body.dark-mode #ops-table-wrapper {
  background: var(--dark-card);
}

body.dark-mode #ops-table thead th {
  background: var(--dark-card);
}

body.dark-mode #ops-table tbody tr {
  background: var(--dark-bg);
}

body.dark-mode #ops-table tbody tr:hover {
  background: rgba(255, 59, 48, 0.1);
}

.ops-type-badge {
  display: inline-block;
  color: #fff;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* =========================================== */
/* ===== PARTNER SETTINGS GROUP THEMING ====== */
/* =========================================== */

/* Light mode base */
#partner-settings-group label,
#partner-settings-group p,
#partner-settings-group span:not([style*="background"]) {
  color: var(--light-text);
}

#partner-settings-group h4 {
  color: var(--booki-red);
}

#partner-settings-group input,
#partner-settings-group select {
  background: #fff;
  color: var(--light-text);
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* Dark mode overrides */
body.dark-mode #partner-settings-group label,
body.dark-mode #partner-settings-group p,
body.dark-mode #partner-settings-group span:not([style*="background"]) {
  color: var(--dark-text);
}

body.dark-mode #partner-settings-group h4 {
  color: var(--booki-red);
}

body.dark-mode #partner-settings-group input,
body.dark-mode #partner-settings-group select {
  background: var(--dark-bg);
  color: var(--dark-text);
  border-color: var(--booki-red);
}

body.dark-mode #partner-settings-group input::placeholder {
  color: rgba(255, 60, 60, 0.6);
}

body.dark-mode #partner-settings-group .partner-location-row {
  background: var(--dark-card);
  border-color: #444;
}

/* ===== LIVE LOCATION MAP ===== */
.live-location-map {
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid #e0e0e0;
}

.proximity-status {
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  margin: 8px 0;
}

.proximity-near {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.proximity-far {
  background: rgba(255, 152, 0, 0.1);
  color: #ff9800;
  border: 1px solid #ff9800;
}

.share-location-btn {
  background: var(--booki-red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
}

.share-location-btn.active {
  background: #4caf50;
}

/* PARTNER badge — always white on red, visible in both modes */
#partner-settings-group .partner-role-badge {
  background: var(--booki-red);
  color: #fff;
}

/* Partner location autocomplete suggestion box */
.partner-location-suggestions {
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.partner-location-suggestions .suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid #f3f3f3;
  color: var(--light-text);
}

.partner-location-suggestions .suggestion-item:last-child {
  border-bottom: none;
}

.partner-location-suggestions .suggestion-item:hover {
  background-color: var(--booki-red);
  color: #fff;
}

body.dark-mode .partner-location-suggestions {
  background: var(--dark-card);
  border: 1px solid var(--booki-red);
  box-shadow: 0 4px 12px rgba(255,255,255,0.08);
}

body.dark-mode .partner-location-suggestions .suggestion-item {
  color: var(--dark-text);
  border-bottom: 1px solid #444;
}

body.dark-mode .partner-location-suggestions .suggestion-item:hover {
  background-color: var(--booki-red);
  color: #fff;
}

/* Partner location row — maps link input + pin button */
.partner-maps-input {
  background: transparent;
  border: 1px solid #ddd;
  color: var(--light-text);
  border-radius: 6px;
  padding: 6px 10px;
  flex: 1;
  min-width: 0;
}

body.dark-mode .partner-maps-input {
  background: var(--dark-bg);
  border-color: var(--booki-red);
  color: var(--dark-text);
}

body.dark-mode .partner-maps-input::placeholder {
  color: rgba(255, 60, 60, 0.6);
}

.partner-maps-btn {
  background: var(--booki-red);
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================================== */
/* ===== COPY GUARANTEE SECTION ============== */
/* =========================================== */

.guarantee-section {
  padding: 12px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 12px 0;
}

.guarantee-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--booki-red);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.guarantee-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #888;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

.guarantee-input,
.guarantee-select {
  background: #fff;
  color: var(--light-text);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 8px;
}

/* Dark mode */
body.dark-mode .guarantee-section {
  border-color: #333;
}

body.dark-mode .guarantee-note {
  color: #aaa;
}

body.dark-mode .guarantee-input,
body.dark-mode .guarantee-select {
  background: var(--dark-bg);
  color: var(--dark-text);
  border-color: var(--booki-red);
}

body.dark-mode #guarantee-info {
  background: #2a2a2a;
  color: #ccc;
}

/* =========================================== */
/* ===== FACE TO FACE DELIVERY SUB-FIELDS ==== */
/* =========================================== */

.delivery-sub-opts {
  padding: 8px 10px;
  background: #fafafa;
  border-left: 2px solid #e0e0e0;
  border-radius: 0 6px 6px 0;
  margin-left: 4px;
}

body.dark-mode .delivery-sub-opts {
  background: var(--dark-card);
  border-left-color: var(--booki-red);
}

body.dark-mode #ftf-fee-info {
  background: #2a2a2a;
  color: #ccc;
}

/* ========================================= */
/* ========== DELIVERY PARTNER CARDS ======= */
/* ========================================= */
.partner-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.partner-delivery-card {
  transition: border-color .15s, background .15s;
}

.partner-delivery-card:hover {
  border-color: var(--booki-red) !important;
  background: rgba(230, 57, 70, 0.04);
}

.partner-delivery-card.selected-delivery {
  border-color: var(--booki-red) !important;
  background: rgba(230, 57, 70, 0.05);
}

body.dark-mode .partner-delivery-card {
  border-color: #444 !important;
  background: var(--dark-card);
  color: var(--dark-text);
}

body.dark-mode .partner-delivery-card:hover,
body.dark-mode .partner-delivery-card.selected-delivery {
  border-color: var(--booki-red) !important;
  background: rgba(255, 67, 56, 0.08);
}

#cost-breakdown {
  background: #fafafa;
  color: var(--light-text);
}

body.dark-mode #cost-breakdown {
  background: var(--dark-card);
  color: var(--dark-text);
  border-color: #444;
}

body.dark-mode #cost-breakdown [style*="border-top"] {
  border-color: #555 !important;
}

#bd-funds-status .request-btn {
  width: 100%;
  margin-top: 4px;
}

.delivery-type-section + .delivery-type-section {
  border-top: 1px solid #eee;
  padding-top: 12px;
}

body.dark-mode .delivery-type-section + .delivery-type-section {
  border-top-color: #444;
}

/* ========================================= */
/* ========== TRANSACTION TIMELINE ========= */
/* ========================================= */

.tx-step-badge {
  font-size: 11px;
  background: rgba(230, 57, 70, 0.12);
  color: var(--booki-red);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
}

.tx-card-header:hover {
  background: rgba(0,0,0,0.02);
  border-radius: 8px 8px 0 0;
}

.tx-timeline-container {
  margin-top: 0;
}

.timeline-wrapper {
  display: flex;
  flex-direction: column;
}

.timeline-step {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-step.complete .step-dot {
  background: var(--booki-red);
}

.timeline-step.current .step-dot {
  background: var(--booki-red);
  animation: pulse 1.5s infinite;
}

.timeline-step.pending .step-dot {
  border: 2px solid #888;
  background: transparent;
}

.step-connector {
  width: 2px;
  flex: 1;
  min-height: 16px;
  background: #ddd;
  margin-top: 4px;
  margin-bottom: 4px;
}

.timeline-step.complete .step-connector {
  background: var(--booki-red);
}

.timeline-step.current .step-connector {
  background: linear-gradient(to bottom, var(--booki-red), #ddd);
}

.step-content {
  flex: 1;
  padding-bottom: 20px;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.step-title {
  font-weight: bold;
  font-size: 14px;
}

.timeline-step.pending .step-title {
  color: #888;
  font-weight: 600;
}

.step-time {
  font-size: 11px;
  color: #aaa;
}

.step-desc {
  font-size: 12px;
  color: #777;
  margin: 3px 0 6px;
}

.timeline-step.pending .step-desc {
  color: #aaa;
}

.step-approvals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.approval-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.approval-tag.approved {
  background: #e8f5e9;
  color: #2e7d32;
}

.approval-tag.waiting {
  background: #fff8e1;
  color: #f57c00;
}

.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.step-approve-btn {
  background: var(--booki-red);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.step-approve-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.step-wrong-copy-btn {
  background: transparent;
  border: 1px solid #f57c00;
  color: #f57c00;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
}

/* Dark mode overrides */
body.dark-mode .tx-card {
  background: var(--dark-card);
  border-color: #444;
}

body.dark-mode .tx-card-header:hover {
  background: rgba(255,255,255,0.04);
}

body.dark-mode .tx-timeline-container {
  border-top-color: #444;
}

body.dark-mode .step-connector {
  background: #555;
}

body.dark-mode .timeline-step.complete .step-connector {
  background: var(--booki-red);
}

body.dark-mode .step-desc {
  color: #999;
}

body.dark-mode .timeline-step.pending .step-title {
  color: #666;
}

body.dark-mode .timeline-step.pending .step-desc {
  color: #555;
}

body.dark-mode .approval-tag.approved {
  background: #1a3a1a;
  color: #4caf50;
}

body.dark-mode .approval-tag.waiting {
  background: #3a2a00;
  color: #ffa000;
}

body.dark-mode .step-time {
  color: #666;
}

/* =========================================== */
/* ========== COMMUNITY / PROFILE REDESIGN === */
/* =========================================== */

.profile-section { margin-bottom: 20px; }
.profile-section-title { font-size: 1rem; font-weight: 600; color: var(--booki-red); margin-bottom: 8px; }
.profile-copies-row { display: flex; gap: 12px; overflow: visible; }
.profile-pagination { display: flex; gap: 4px; align-items: center; margin-top: 8px; }
.profile-friends-grid { display: grid; grid-template-rows: repeat(3, 1fr); grid-auto-flow: column; gap: 8px; height: 180px; overflow: hidden; }
.friend-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid transparent; }
.friend-avatar:hover { border-color: var(--booki-red); }
.stat-card { background: var(--section-bg); border-radius: 6px; padding: 12px; text-align: center; flex: 1; }
.stat-card .stat-number { font-size: 1.4rem; font-weight: 700; color: var(--booki-red); }
.stat-card .stat-label { font-size: 0.72rem; color: var(--booki-red); opacity: 0.7; margin-top: 4px; }
.stats-row { display: flex; gap: 12px; }
.partner-map-modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:1000; width:600px; height:520px; background:var(--card-bg,#1a1a1a); border:1px solid var(--booki-red); border-radius:8px; display:flex; flex-direction:column; padding:12px; gap:8px; }
.partner-map-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); z-index:999; }
.partner-map-container { flex:1; border-radius:6px; overflow:hidden; }
.partner-map-filter { display:flex; align-items:center; gap:8px; font-size:0.82rem; color:var(--booki-red); }
.partner-map-filter input { width:70px; height:26px; }

