/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  font-family: Arial, sans-serif;
  width: 100%;
  min-height: 100vh;
}

/* --- Navigation (fixed colors) --- */
.nav-main {
  background-image: linear-gradient(to right, #104e93, #442396, #be1584);  /* fixed blue */
  border-bottom: 1px solid #2c2f33;
}
.nav-main .nav-link {
  color: #d1d5db !important;
  padding: 0.75rem 1rem;
  transition: color 0.2s, border-bottom 0.2s;
  border-bottom: 2px solid transparent;
}
.nav-main .nav-link:hover {
  color: #ffffff !important;
  border-bottom: 2px solid #22c55e;
}
.nav-main .navbar-brand {
  font-weight: 700;
  color: #ffffff !important;
  margin-right: 2rem;
}

/* --- Sub Bar (fixed dark grey) --- */
.sub-bar {
  background-color: #2b2d31 !important;
  font-size: 0.85rem;
  padding: 2px 0;
  border-bottom: 1px solid #1c1f23;
}
.sub-bar .nav-link {
  color: #e5e7eb !important;
  padding: 0.25rem 0.75rem;
}
.sub-bar .nav-link:hover {
  color: #ffffff !important;
}

/* --- Lock navbar and sub-bar sizes - prevent scaling --- */
.nav-main,
.nav-main *,
.sub-bar,
.sub-bar * {
  font-size: inherit !important;
}

/* --- Mobile-friendly navbar - everything visible, wraps into rows --- */
@media (max-width: 991px) {
  /* Hide hamburger menu - always show full nav */
  .nav-main .navbar-toggler {
    display: none !important;
  }
  
  /* Always show navbar items */
  .nav-main .navbar-collapse {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Stack main navigation and right side vertically */
  .nav-main .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin: 0.5rem 0 !important;
  }
  
  /* Make nav items compact but readable */
  .nav-main .nav-link {
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    white-space: nowrap !important;
  }
  
  /* Icon-only for nav links to save space */
  .nav-main .nav-link i {
    margin-right: 0.3rem !important;
  }
  
  /* Compact buttons */
  .nav-main .btn-sm {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.6rem !important;
  }
  
  /* Hide email text on mobile */
  .nav-main .navbar-text {
    display: none !important;
  }
  
  /* Center brand and make it full width */
  .nav-main .container-fluid {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  
  .nav-main .navbar-brand {
    font-size: 1rem !important;
    margin: 0 auto !important;
  }
  
  /* Smaller badge */
  .nav-main .badge.bg-success {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
  }
  
  /* Reduce overall navbar padding */
  .nav-main {
    padding: 0.5rem 0 !important;
  }
  
  .nav-main .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* --- Mobile-friendly sub-bar - wraps into multiple rows if needed --- */
@media (max-width: 991px) {
  .sub-bar {
    padding: 0.5rem 0 !important;
  }
  
  .sub-bar .container-fluid {
    justify-content: center !important;
  }
  
  .sub-bar .nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.25rem !important;
  }
  
  .sub-bar .nav-link,
  .sub-bar span.nav-link {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.5rem !important;
    white-space: nowrap !important;
  }
}

/* --- Mobile-friendly purchase history tables --- */
@media (max-width: 768px) {
  /* Hide table on mobile, show card layout instead */
  .dashboard-container .table-responsive table {
    display: none !important;
  }
  
  /* Create mobile card layout */
  .dashboard-container .table-responsive::after {
    content: '';
    display: block;
  }
}

/* Mobile purchase history card styles */
@media (max-width: 768px) {
  .mobile-purchase-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
  }
  
  .mobile-purchase-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
  
  .mobile-purchase-card strong {
    font-size: 1.05rem;
    display: block;
  }
  
  .mobile-purchase-card .badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
  
  .mobile-purchase-card .btn {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  
  .mobile-purchase-card .btn.w-100 {
    width: 100% !important;
  }
  
  .mobile-purchase-card .btn.flex-fill {
    flex: 1 1 0;
    min-width: 0;
  }
  
  .mobile-purchase-card .small {
    font-size: 0.875rem;
  }
  
  .mobile-purchase-card .text-primary {
    font-size: 1.1rem;
  }
  
  .mobile-purchase-card .d-flex.gap-2 {
    gap: 0.5rem !important;
  }
}

/* Dark mode support for mobile cards */
html.dark-mode .mobile-purchase-card,
body.dark-mode .mobile-purchase-card {
  background: #1e1e1e;
  border-color: #333;
}

/* Responsive listing action buttons (Add Listing / Add Lot) */
.listing-action-buttons {
  min-width: fit-content;
}

.listing-action-buttons .btn {
  white-space: nowrap;
  min-width: 120px;
}

@media (max-width: 576px) {
  /* On mobile, make buttons more compact */
  .listing-action-buttons {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .listing-action-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .listing-action-buttons .btn i {
    margin-right: 0.25rem;
    font-size: 0.9rem;
  }
  
  /* Center the header title on mobile */
  .card-header h5 {
    width: 100%;
    text-align: center;
  }
}

/* Ensure consistent badge sizing in nav tabs */
.nav-tabs .nav-link .badge {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  min-width: 1.5rem !important;
  text-align: center !important;
}

/* --- Custom padding class for series.html --- */
.px-50 {
  padding-left: 50px;
  padding-right: 50px;
}

/* --- Pokemon container with max-width --- */
.pokemon-container {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* --- Dashboard container with max-width --- */
.dashboard-container {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* --- Home container with max-width --- */
.home-container {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* Ensure hero-banner has proper styling when inside home-container */
.home-container .hero-banner {
  padding: 2rem;
  border-radius: 20px;
  margin-bottom: 3rem;
}

/* Newly listed section within home-container needs top spacing */
.home-container .section-title {
  margin-top: 0;
}

/* --- Profile container with max-width --- */
.profile-container {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* --- Reviews container with max-width --- */
.reviews-container {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* --- Review product images --- */
.review-product-image {
  max-height: 200px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.review-product-placeholder {
  width: 200px;
  height: 200px;
  min-width: 200px;
  min-height: 200px;
}

/* --- Custom 5-column grid for pokemon.html --- */
.col-lg-20percent {
  flex: 0 0 auto;
  width: 20%; /* 5 columns per row */
}

/* --- Series Grid --- */
.series-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0;
}
.series-column {
  /* Fixed width for uniform cards - max 5 per row */
  flex: 0 0 auto;
  width: calc(20% - 0.8rem); /* Exactly 5 per row accounting for gap */
  display: flex;
  justify-content: center;
}
.series-card {
  width: 100%;
  height: 280px; /* Fixed height for uniform cards */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.05);
  padding: 1rem;
}

/* --- Logo --- */
.logo-box {
  width: 100%;
  min-height: 80px; /* Flexible height instead of fixed */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.logo-box img {
  max-height: 100px;
  max-width: 90%;
  object-fit: contain;
}

/* === Mobile Responsive Grid === */
@media (max-width: 992px) {
  /* Reduce padding on medium screens (series.html only) */
  .px-50 {
    padding-left: 30px;
    padding-right: 30px;
  }
  
  /* pokemon.html, dashboard, home, profile, and reviews containers stay full width below max-width */
  .pokemon-container,
  .dashboard-container,
  .home-container,
  .profile-container,
  .reviews-container {
    max-width: 100%;
  }
  
  /* series.html - 2 columns on medium screens */
  .series-column {
    flex: 0 0 auto;
    width: calc(50% - 0.5rem); /* Exactly 2 per row */
  }
  .series-card {
    height: 260px; /* Fixed height for uniform cards */
    padding: 1.1rem;
  }
  .logo-box {
    min-height: 85px;
  }
  .logo-box img {
    max-height: 110px;
  }
}

/* pokemon.html - 2 columns on small screens (tablet: 576px - 991px) */
@media (min-width: 576px) and (max-width: 991px) {
  .col-lg-20percent {
    width: 50%; /* 2 columns */
  }
}

/* pokemon.html - 1 column on very small screens (mobile: < 576px) */
@media (max-width: 575px) {
  .col-lg-20percent {
    width: 100%; /* 1 column - full width */
  }
}

@media (max-width: 768px) {
  /* Reduce padding on tablets */
  .px-50 {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  /* Smaller review images on tablets */
  .review-product-image {
    max-height: 150px;
    max-width: 150px;
  }
  
  .review-product-placeholder {
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
  }
  
  /* Larger text for reviews on tablets */
  main .reviews-container,
  main .reviews-container * {
    font-size: 1.3rem !important;
  }
  
  main .reviews-container h2,
  main .reviews-container h2 * {
    font-size: 1.9rem !important;
  }
  
  main .reviews-container h3,
  main .reviews-container h3 *,
  main .reviews-container h4,
  main .reviews-container h4 * {
    font-size: 1.6rem !important;
  }
  
  main .reviews-container h5,
  main .reviews-container h5 * {
    font-size: 1.5rem !important;
  }
  
  main .reviews-container h6,
  main .reviews-container h6 * {
    font-size: 1.4rem !important;
  }
  
  main .reviews-container .card-title,
  main .reviews-container .card-title * {
    font-size: 1.4rem !important;
  }
  
  main .reviews-container p,
  main .reviews-container p * {
    font-size: 1.3rem !important;
  }
  
  main .reviews-container .btn,
  main .reviews-container .btn * {
    font-size: 1.2rem !important;
    padding: 0.6rem 1.2rem !important;
  }
  
  main .reviews-container .badge,
  main .reviews-container .badge * {
    font-size: 1.1rem !important;
    padding: 0.5rem 0.8rem !important;
  }
  
  main .reviews-container .small,
  main .reviews-container small,
  main .reviews-container small * {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container .text-muted,
  main .reviews-container .text-muted * {
    font-size: 1.2rem !important;
  }
  
  main .reviews-container .bi-star-fill,
  main .reviews-container .bi-star {
    font-size: 1.3rem !important;
  }
  
  main .reviews-container .card-body {
    padding: 1.3rem !important;
  }
  
  /* Override ALL utility classes */
  main .reviews-container [class*="mb-"],
  main .reviews-container [class*="mt-"],
  main .reviews-container [class*="text-muted"] {
    font-size: 1.3rem !important;
  }
  
  .series-column {
    flex: 0 0 auto;
    width: calc(50% - 0.5rem); /* Exactly 2 per row */
  }
  .series-card {
    height: 300px; /* Fixed height for uniform larger cards */
    padding: 1.2rem;
  }
  .logo-box {
    min-height: 90px;
  }
  .logo-box img {
    max-height: 120px;
  }
  .series-link {
    font-size: 1.05rem !important;
    padding: 0.5rem 0 !important;
  }
}

@media (max-width: 576px) {
  /* Minimal padding on mobile */
  .px-50 {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Even smaller review images on mobile */
  .review-product-image {
    max-height: 120px;
    max-width: 120px;
  }
  
  .review-product-placeholder {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
  }
  
  /* Larger text for reviews on mobile - readable but not huge */
  main .reviews-container,
  main .reviews-container * {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container h2,
  main .reviews-container h2 * {
    font-size: 1.6rem !important;
  }
  
  main .reviews-container h3,
  main .reviews-container h3 *,
  main .reviews-container h4,
  main .reviews-container h4 * {
    font-size: 1.4rem !important;
  }
  
  main .reviews-container h5,
  main .reviews-container h5 * {
    font-size: 1.3rem !important;
  }
  
  main .reviews-container h6,
  main .reviews-container h6 * {
    font-size: 1.2rem !important;
  }
  
  main .reviews-container .card-title,
  main .reviews-container .card-title * {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
  }
  
  main .reviews-container .card-text,
  main .reviews-container .card-text *,
  main .reviews-container p,
  main .reviews-container p * {
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
  }
  
  main .reviews-container .small,
  main .reviews-container .small *,
  main .reviews-container small,
  main .reviews-container small * {
    font-size: 0.95rem !important;
  }
  
  main .reviews-container .btn,
  main .reviews-container .btn * {
    font-size: 1rem !important;
    padding: 0.6rem 1.2rem !important;
  }
  
  main .reviews-container .badge,
  main .reviews-container .badge * {
    font-size: 0.95rem !important;
    padding: 0.5rem 0.8rem !important;
  }
  
  main .reviews-container .text-muted,
  main .reviews-container .text-muted * {
    font-size: 1rem !important;
  }
  
  /* Larger star ratings */
  main .reviews-container .bi-star-fill,
  main .reviews-container .bi-star {
    font-size: 1.1rem !important;
  }
  
  /* Increase card body padding for better readability */
  main .reviews-container .card-body {
    padding: 1.2rem !important;
  }
  
  /* Better spacing between elements */
  main .reviews-container .mb-1 {
    margin-bottom: 0.5rem !important;
  }
  
  main .reviews-container .mb-2 {
    margin-bottom: 0.75rem !important;
  }
  
  main .reviews-container .mb-3 {
    margin-bottom: 1rem !important;
  }
  
  /* Strong text */
  main .reviews-container strong {
    font-size: inherit !important;
  }
  
  /* Em text */
  main .reviews-container em {
    font-size: inherit !important;
  }
  
  /* Specific overrides for common small classes */
  main .reviews-container h6.mb-1,
  main .reviews-container h6.mb-1 * {
    font-size: 1.2rem !important;
  }
  
  main .reviews-container .text-muted.mb-1.small,
  main .reviews-container .text-muted.mb-1.small *,
  main .reviews-container p.text-muted.mb-1.small,
  main .reviews-container p.text-muted.mb-1.small * {
    font-size: 0.95rem !important;
  }
  
  main .reviews-container .mt-3,
  main .reviews-container .mt-3 * {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container .mt-3 strong {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container .mt-3 p,
  main .reviews-container .mt-3 p * {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container .mb-0.mt-1,
  main .reviews-container .mb-0.mt-1 *,
  main .reviews-container p.mb-0.mt-1,
  main .reviews-container p.mb-0.mt-1 * {
    font-size: 1.1rem !important;
  }
  
  main .reviews-container .text-muted.mb-0.mt-2,
  main .reviews-container .text-muted.mb-0.mt-2 *,
  main .reviews-container p.text-muted.mb-0.mt-2,
  main .reviews-container p.text-muted.mb-0.mt-2 * {
    font-size: 1rem !important;
  }
  
  main .reviews-container small.text-muted,
  main .reviews-container small.text-muted * {
    font-size: 0.95rem !important;
  }
  
  /* Override ALL combinations */
  main .reviews-container [class*="mb-"],
  main .reviews-container [class*="mt-"],
  main .reviews-container [class*="text-muted"] {
    font-size: 1.1rem !important;
  }
  
  .series-container {
    gap: 0.5rem;
    padding: 0;
  }
  .series-column {
    flex: 0 0 auto;
    width: 100%; /* Exactly 1 per row */
    max-width: 500px; /* Cap maximum width for very large phones */
  }
  .series-card {
    height: 320px; /* Fixed height for uniform large cards */
    padding: 1.5rem;
    font-size: 1.05rem; /* Larger text on mobile */
  }
  .logo-box {
    min-height: 120px; /* Larger logo area on mobile */
  }
  .logo-box img {
    max-height: 150px; /* Larger logos on mobile */
  }
  .series-link {
    font-size: 1.2rem !important; /* Larger links on mobile */
    padding: 0.7rem 0 !important;
  }
}

/* --- Sealed Grid --- */
.sealed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  justify-items: center;
}

/* --- Links --- */
.compact-list li {
  margin-bottom: 2px;
}
.series-link {
  font-size: 1.05rem;
  color: #6c757d;
  text-decoration: none;
}
.series-link:hover {
  color: #000;
}

/* --- Dark mode general adjustments --- */
html.dark-mode {
  background-color: #121212 !important;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
}

/* Override Bootstrap container margins - keep centering but remove outer margins */
html.dark-mode .container,
body.dark-mode .container {
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
}

html.dark-mode .container-fluid,
body.dark-mode .container-fluid {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
}

html.dark-mode,
body.dark-mode {
  background-color: #121212 !important;
  color: #e5e5e5;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
html.dark-mode .series-card,
body.dark-mode .series-card {
  background-color: #1e1e1e;
  border-color: #333;
}
html.dark-mode .series-link,
body.dark-mode .series-link {
  color: #aaa;
}
html.dark-mode .series-link:hover,
body.dark-mode .series-link:hover {
  color: #fff;
}
/* === Series Tiles (shared by home & series pages) === */
.series-logo {
  max-height: 100px; /* Flexible, not fixed */
  max-width: 100%;
  object-fit: contain;
}

.series-name {
  font-size: 0.9rem;
  color: #333;
}

.series-tile {
  background-color: #f8f9fa; /* Light mode */
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
  min-height: 140px; /* Flexible minimum instead of fixed */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.series-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.25rem rgba(0,0,0,.1);
}

/* Dark mode */
html.dark-mode,
body.dark-mode .series-tile {
  background-color: #2b2b2b;
  border: 1px solid #444;
}
html.dark-mode,
body.dark-mode .series-name {
  color: #e5e5e5;
}

.series-placeholder {
  min-height: 100px; /* Flexible, not fixed */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  border: 1px dashed #ddd;
  font-size: 0.85rem;
}
html.dark-mode,
body.dark-mode .series-placeholder {
  color: #bbb;
  border-color: #555;
}

/* === Mobile Responsive Series Tiles === */
@media (max-width: 992px) {
  .series-tile {
    min-height: 170px; /* Larger on medium screens */
    padding: 1.1rem;
  }
  .series-logo {
    max-height: 110px;
  }
  .series-placeholder {
    min-height: 110px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .series-tile {
    min-height: 200px; /* Larger on tablet */
    padding: 1.3rem;
  }
  .series-logo {
    max-height: 130px; /* Larger logos on tablet */
  }
  .series-placeholder {
    min-height: 130px;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .series-tile {
    min-height: 240px; /* Even larger on mobile - 2 per row */
    padding: 1.5rem;
  }
  .series-logo {
    max-height: 160px; /* Larger logos on mobile */
  }
  .series-placeholder {
    min-height: 160px;
    font-size: 1.05rem;
  }
  .series-name {
    font-size: 1.05rem; /* Larger text on mobile */
  }
}

@media (max-width: 390px) {
  /* Extra small phones like iPhone 12 Mini */
  .series-tile {
    min-height: 260px; /* Maximum size for smallest screens */
    padding: 1.6rem;
  }
  .series-logo {
    max-height: 180px;
  }
  .series-placeholder {
    min-height: 180px;
    font-size: 1.1rem;
  }
}

/* === Image Gallery for Listings === */
.image-gallery {
  width: 100%;
}

.main-image-container {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.1);
  background-color: #f8f9fa;
}

.main-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

.thumbnail-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}

.thumbnail-item {
  width: 80px;
  height: 80px;
  border-radius: 0.25rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  background-color: #f8f9fa;
}

.thumbnail-item:hover {
  border-color: #6c757d;
  transform: scale(1.05);
}

.thumbnail-item.active {
  border-color: #007bff;
  box-shadow: 0 0 0 1px #007bff;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark mode adjustments for image gallery */
html.dark-mode,
body.dark-mode .main-image-container {
  background-color: #1e1e1e;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.3);
}

html.dark-mode,
body.dark-mode .thumbnail-item {
  background-color: #1e1e1e;
  border-color: #333;
}

html.dark-mode,
body.dark-mode .thumbnail-item:hover {
  border-color: #aaa;
}

html.dark-mode,
body.dark-mode .thumbnail-item.active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 1px #0d6efd;
}

/* Add to Cart button styling */
.btn-lime {
  background-color: #32cd32 !important;
  border-color: #32cd32 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-lime:hover {
  background-color: #28a428 !important;
  border-color: #28a428 !important;
  transform: scale(1.05) !important;
}

/* Reserved button styling - matches btn-lime dimensions exactly */
.btn-reserved {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
  opacity: 0.6;
  cursor: not-allowed;
  /* Match btn-lime styling exactly */
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  transition: all 0.2s ease-in-out !important;
  border: none !important;
  text-align: center !important;
  width: 85px !important; /* Fixed width to accommodate "Add to Cart" */
  height: 28px !important; /* Fixed height for consistency */
  line-height: 1.2 !important; /* Optimized line-height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-reserved:hover,
.btn-reserved:focus,
.btn-reserved:active {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
  opacity: 0.6 !important;
  /* No transform on hover since it's disabled */
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  text-align: center !important;
  width: 85px !important; /* Fixed width to accommodate "Add to Cart" */
  height: 28px !important; /* Fixed height for consistency */
  line-height: 1.2 !important; /* Optimized line-height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important; /* Prevent any scaling */
}

/* Cooldown button styling - matches btn-reserved but with orange color */
.btn-cooldown {
  background-color: #fd7e14 !important;
  border-color: #fd7e14 !important;
  color: #ffffff !important;
  opacity: 0.8;
  cursor: not-allowed;
  /* Match btn-lime styling exactly */
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  transition: all 0.2s ease-in-out !important;
  border: none !important;
  text-align: center !important;
  width: 85px !important; /* Fixed width to accommodate "Add to Cart" */
  height: 28px !important; /* Fixed height for consistency */
  line-height: 1.2 !important; /* Optimized line-height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-cooldown:hover,
.btn-cooldown:focus,
.btn-cooldown:active {
  background-color: #fd7e14 !important;
  border-color: #fd7e14 !important;
  color: #ffffff !important;
  opacity: 0.8 !important;
  /* No transform on hover since it's disabled */
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  text-align: center !important;
  width: 85px !important; /* Fixed width to accommodate "Add to Cart" */
  height: 28px !important; /* Fixed height for consistency */
  line-height: 1.2 !important; /* Optimized line-height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important; /* Prevent any scaling */
}

/* Reserved by current user - shows countdown */
.btn-reserved-mine {
  background-color: #ffc107 !important;
  border-color: #ffc107 !important;
  color: #000000 !important;
  cursor: pointer;
  /* Match btn-lime styling exactly */
  font-weight: 600 !important;
  border-radius: 15px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  transition: all 0.2s ease-in-out !important;
  border: none !important;
  text-align: center !important;
  width: 85px !important; /* Fixed width to accommodate "Add to Cart" */
  height: 28px !important; /* Fixed height for consistency */
  line-height: 1.2 !important; /* Optimized line-height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-reserved-mine:hover {
  background-color: #e0a800 !important;
  transform: scale(1.05) !important;
}

/* Dark mode text improvements */
html.dark-mode,
body.dark-mode .text-muted {
  color: #adb5bd !important;
}

html.dark-mode,
body.dark-mode h2,
html.dark-mode,
body.dark-mode h3,
html.dark-mode,
body.dark-mode p,
html.dark-mode,
body.dark-mode strong {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .text-success {
  color: #198754 !important;
}

/* === SHARED LISTING ROW STYLES === */
/* Used by sealed.html, slabs.html, and cards.html */

.listing-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid #444;
  min-height: 42px; /* Increased height for better button accommodation */
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.1);
  margin-bottom: 2px;
  border-radius: 4px;
}

.listing-row:last-child {
  border-bottom: none;
}

.listing-row:hover {
  background: rgba(0,0,0,0.2);
}

.listing-row .row {
  margin: 0;
  width: 100%;
  align-items: center;
}

/* Column styling within listing rows */
.listing-row .col-6,
.listing-row .col-4,
.listing-row .col-3,
.listing-row .col-2,
.listing-row .col-1 {
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
}

/* Last column styling for button alignment */
.listing-row .col-6:last-child,
.listing-row .col-4:last-child,
.listing-row .col-3:last-child {
  padding-right: 0.8rem;
  justify-content: flex-end;
  gap: 8px; /* Space between View Listing and Add to Cart buttons */
}

/* Center alignment for middle columns */
.listing-row .col-2,
.listing-row .col-1,
.listing-row .col-3:not(:last-child),
.listing-row .col-4:not(:last-child) {
  justify-content: center;
}

/* --- Quantity Selector (Shared across all templates) --- */
.add-to-cart-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.add-to-cart-form .btn {
  white-space: nowrap;
  min-width: 110px; /* Fixed width to handle "Add 12 to Cart" */
  flex-shrink: 0;
  text-align: center;
}

.qty-selector {
  background-color: #2b2d31;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.25rem 0.3rem;
  font-size: 0.75rem;
  width: 55px;
  text-align: center;
}

.qty-selector:focus {
  outline: none;
  border-color: limegreen;
  box-shadow: 0 0 0 2px rgba(50, 205, 50, 0.2);
}

.qty-selector option {
  background-color: #2b2d31;
  color: #fff;
}

/* === Follow Star Button === */
.follow-star-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.follow-star-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
  color: #ffed4e;
}

.follow-star-btn.following {
  background: rgba(255, 215, 0, 0.9);
  color: #000;
}

.follow-star-btn.following:hover {
  background: rgba(255, 215, 0, 1);
  color: #000;
}

.follow-star-btn i {
  transition: all 0.3s ease;
}

.follow-star-btn.following i {
  transform: scale(1.2);
}

/* === Invoice and Message Board Styles === */
/* Additional styles for the new invoice-style order templates */

.invoice-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.invoice {
  position: relative;
}

.invoice-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #27ae60);
}


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced button styles */
.send-button {
  position: relative;
  overflow: hidden;
}

.send-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.send-button:hover::before {
  left: 100%;
}

/* Print styles for invoices */
@media print {
  .invoice-container {
    background: white !important;
    padding: 0 !important;
  }
  
  .invoice {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
  
  
  .back-button {
    display: none !important;
  }
  
}

/* === Card-based Layout Enhancements === */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Card hover effect removed for better form usability */
/*.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}*/

.invoice-container .card-header {
  position: relative;
  overflow: hidden;
}

.invoice-container .card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
}

/* Enhanced image containers - only for order detail pages */
.invoice-container .product-image-container,
.invoice-container .lot-item-image-container {
  position: relative;
  overflow: hidden;
}

.invoice-container .product-image-container::before,
.invoice-container .lot-item-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.invoice-container .product-image-container:hover::before,
.invoice-container .lot-item-image-container:hover::before {
  opacity: 1;
}

/* Compact spacing for one-page layout - only for order detail pages */
.invoice-container .cards-grid {
  margin-bottom: 0;
}

.invoice-container .card-body {
  padding: 15px 20px;
}

.invoice-container .card-header {
  padding: 12px 20px;
  font-size: 0.95rem;
}


/* Responsive improvements - only for order detail pages */
@media (max-width: 1024px) {
  .invoice-container .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .invoice-container .card-compact {
    grid-column: span 1;
  }
  
  .invoice-container .top-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .invoice-container .top-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .invoice-container .bottom-row {
    grid-template-columns: 1fr;
  }
  
  .invoice-container .bottom-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .invoice-container {
    padding: 8px;
  }
  
  .invoice-container .card-body {
    padding: 12px 15px;
  }
  
  .invoice-container .lot-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .invoice-container .lot-item-image-container {
    width: 50px;
    height: 50px;
  }
}

/* 4-column layout specific enhancements - only for order detail pages */
.invoice-container .top-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

.invoice-container .bottom-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 15px;
  align-items: start; /* Align cards to the top */
}

.invoice-container .items-list-card {
  /* Takes 3/4 of the width */
  height: 250px; /* Same height as top row cards */
  overflow: hidden; /* Prevent card overflow */
}

.invoice-container .items-list-card .card-body {
  height: calc(100% - 40px); /* Account for card header height */
  overflow-y: auto; /* Allow scrolling if content is too long */
  padding: 15px;
}

.invoice-container .product-image-card {
  /* Takes 1/4 of the width */
  height: 250px; /* Same height as top row cards */
  overflow: hidden; /* Prevent content overflow */
}

.invoice-container .bottom-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Fixed height cards - only for order detail pages */
.invoice-container .card {
  height: 250px;
  display: flex;
  flex-direction: column;
}

.invoice-container .card-wide {
  height: auto;
  min-height: 200px;
}

.invoice-container .card-header {
  flex-shrink: 0;
}

.invoice-container .card-body {
  flex: 1;
  overflow: hidden;
}

/* Enhanced image display - only for order detail pages */
.invoice-container .product-image-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(100% - 40px); /* Account for card header height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  transition: transform 0.3s ease;
}

.invoice-container .product-image-container:hover .product-image {
  transform: scale(1.05);
}

.no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  padding: 20px;
}

.no-image i {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* === DASHBOARD DARK MODE STYLES === */

/* Seller Dashboard Dark Mode */
html.dark-mode,
body.dark-mode .subscription-badge {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode,
body.dark-mode .subscription-badge:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Dashboard Cards Dark Mode */
html.dark-mode,
body.dark-mode .card {
  background-color: #1e1e1e;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-header {
  background-color: #2b2b2b;
  border-bottom-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-body {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-title {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-text {
  color: #adb5bd;
}

/* Dashboard Tables Dark Mode */
html.dark-mode,
body.dark-mode .table {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .table-hover tbody tr:hover {
  background-color: #2b2b2b;
}

html.dark-mode,
body.dark-mode .table thead th {
  background-color: #2b2b2b;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .table td {
  border-color: #333;
}

/* Dashboard Alerts Dark Mode */
html.dark-mode,
body.dark-mode .alert {
  background-color: #1e1e1e;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .alert-warning {
  background-color: #2d2419;
  border-color: #664d03;
  color: #ffda6a;
}

html.dark-mode,
body.dark-mode .alert-info {
  background-color: #0a2e38;
  border-color: #055160;
  color: #6edff6;
}

/* Dashboard Progress Bars Dark Mode */
html.dark-mode,
body.dark-mode .progress {
  background-color: #2b2b2b;
}

html.dark-mode,
body.dark-mode .progress-bar {
  background-color: #198754;
}

/* Dashboard Navigation Tabs Dark Mode */
html.dark-mode,
body.dark-mode .nav-tabs {
  border-bottom-color: #333;
}

html.dark-mode,
body.dark-mode .nav-tabs .nav-link {
  color: #adb5bd;
  border-color: transparent;
}

html.dark-mode,
body.dark-mode .nav-tabs .nav-link:hover {
  color: #e5e5e5;
  border-color: #333;
}

html.dark-mode,
body.dark-mode .nav-tabs .nav-link.active {
  background-color: #1e1e1e;
  border-color: #333 #333 #1e1e1e;
  color: #e5e5e5;
}

/* Dashboard Badges Dark Mode */
html.dark-mode,
body.dark-mode .badge {
  color: #fff;
}

/* Dashboard Buttons Dark Mode */
html.dark-mode,
body.dark-mode .btn-outline-secondary {
  color: #adb5bd;
  border-color: #6c757d;
}

html.dark-mode,
body.dark-mode .btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

html.dark-mode,
body.dark-mode .btn-outline-info {
  color: #6edff6;
  border-color: #0dcaf0;
}

html.dark-mode,
body.dark-mode .btn-outline-info:hover {
  background-color: #0dcaf0;
  border-color: #0dcaf0;
  color: #000;
}

/* Dashboard Empty States Dark Mode */
html.dark-mode,
body.dark-mode .text-center.py-4 {
  color: #adb5bd;
}

html.dark-mode,
body.dark-mode .text-center.py-4 h5 {
  color: #e5e5e5;
}

/* Dashboard Follow Star Button Dark Mode */
html.dark-mode,
body.dark-mode .follow-star-btn {
  background-color: #2b2b2b;
  border-color: #333;
  color: #ffc107;
}

html.dark-mode,
body.dark-mode .follow-star-btn:hover {
  background-color: #3d3d3d;
  border-color: #555;
}

html.dark-mode,
body.dark-mode .follow-star-btn.following {
  background-color: #ffc107;
  color: #000;
}

html.dark-mode,
body.dark-mode .follow-star-btn.following:hover {
  background-color: #ffca2c;
}

/* Dashboard Small Text Dark Mode */
html.dark-mode,
body.dark-mode .small {
  color: #adb5bd;
}

/* Dashboard Card Footer Dark Mode */
html.dark-mode,
body.dark-mode .card-footer {
  background-color: #2b2b2b;
  border-top-color: #333;
}

/* Dashboard Form Controls Dark Mode */
html.dark-mode,
body.dark-mode .form-control {
  background-color: #2b2b2b;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .form-control:focus {
  background-color: #2b2b2b;
  border-color: #0d6efd;
  color: #e5e5e5;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

html.dark-mode,
body.dark-mode .form-label {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .form-text {
  color: #adb5bd;
}

/* Dashboard Dropdown Dark Mode */
html.dark-mode,
body.dark-mode .dropdown-menu {
  background-color: #1e1e1e;
  border-color: #333;
}

html.dark-mode,
body.dark-mode .dropdown-item {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .dropdown-item:hover {
  background-color: #2b2b2b;
  color: #e5e5e5;
}

/* Dashboard Modal Dark Mode */
html.dark-mode,
body.dark-mode .modal-content {
  background-color: #1e1e1e;
  border-color: #333;
}

html.dark-mode,
body.dark-mode .modal-header {
  border-bottom-color: #333;
}

html.dark-mode,
body.dark-mode .modal-footer {
  border-top-color: #333;
}

/* Dashboard Pagination Dark Mode */
html.dark-mode,
body.dark-mode .pagination .page-link {
  background-color: #2b2b2b;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .pagination .page-link:hover {
  background-color: #3d3d3d;
  border-color: #555;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .pagination .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Dashboard List Group Dark Mode */
html.dark-mode,
body.dark-mode .list-group-item {
  background-color: #1e1e1e;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .list-group-item:hover {
  background-color: #2b2b2b;
}

/* Dashboard Accordion Dark Mode */
html.dark-mode,
body.dark-mode .accordion-item {
  background-color: #1e1e1e;
  border-color: #333;
}

html.dark-mode,
body.dark-mode .accordion-header .accordion-button {
  background-color: #2b2b2b;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .accordion-header .accordion-button:not(.collapsed) {
  background-color: #3d3d3d;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .accordion-body {
  background-color: #1e1e1e;
  color: #e5e5e5;
}

/* Additional Dashboard Specific Dark Mode Styles */

/* Dashboard Icons Dark Mode */
html.dark-mode,
body.dark-mode .bi {
  color: inherit;
}

/* Dashboard Links Dark Mode */
html.dark-mode,
body.dark-mode a {
  color: #6edff6;
}

html.dark-mode,
body.dark-mode a:hover {
  color: #9eeaf9;
}

/* Dashboard Text Colors Dark Mode */
html.dark-mode,
body.dark-mode .text-primary {
  color: #6edff6 !important;
}

html.dark-mode,
body.dark-mode .text-success {
  color: #75b798 !important;
}

html.dark-mode,
body.dark-mode .text-info {
  color: #6edff6 !important;
}

html.dark-mode,
body.dark-mode .text-warning {
  color: #ffc107 !important;
}

html.dark-mode,
body.dark-mode .text-danger {
  color: #f5c6cb !important;
}

/* Dashboard Button Groups Dark Mode */
html.dark-mode,
body.dark-mode .btn-group .btn {
  border-color: #333;
}

html.dark-mode,
body.dark-mode .btn-group .btn:not(:last-child) {
  border-right-color: #333;
}

/* Dashboard Spinner Dark Mode */
html.dark-mode,
body.dark-mode .spinner-border {
  color: #6edff6;
}

/* Dashboard Tooltip Dark Mode */
html.dark-mode,
body.dark-mode .tooltip .tooltip-inner {
  background-color: #2b2b2b;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .tooltip .tooltip-arrow::before {
  border-top-color: #2b2b2b;
}

/* Dashboard Popover Dark Mode */
html.dark-mode,
body.dark-mode .popover {
  background-color: #1e1e1e;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .popover .popover-header {
  background-color: #2b2b2b;
  border-bottom-color: #333;
  color: #e5e5e5;
}

/* Dashboard Toast Dark Mode */
html.dark-mode,
body.dark-mode .toast {
  background-color: #1e1e1e;
  border-color: #333;
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .toast .toast-header {
  background-color: #2b2b2b;
  border-bottom-color: #333;
  color: #e5e5e5;
}

/* === DASHBOARD LISTINGS SPECIFIC DARK MODE FIXES === */

/* JavaScript-generated table content dark mode */
html.dark-mode,
body.dark-mode .table tbody tr td strong {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .table tbody tr td small {
  color: #adb5bd;
}

/* Dashboard button groups in tables */
html.dark-mode,
body.dark-mode .btn-group-sm .btn {
  border-color: #333;
}

html.dark-mode,
body.dark-mode .btn-group-sm .btn:not(:last-child) {
  border-right-color: #333;
}

/* Dashboard outline buttons in tables */
html.dark-mode,
body.dark-mode .btn-outline-primary {
  color: #6edff6;
  border-color: #0dcaf0;
}

html.dark-mode,
body.dark-mode .btn-outline-primary:hover {
  background-color: #0dcaf0;
  border-color: #0dcaf0;
  color: #000;
}

html.dark-mode,
body.dark-mode .btn-outline-secondary {
  color: #adb5bd;
  border-color: #6c757d;
}

html.dark-mode,
body.dark-mode .btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

html.dark-mode,
body.dark-mode .btn-outline-warning {
  color: #ffc107;
  border-color: #ffc107;
}

html.dark-mode,
body.dark-mode .btn-outline-warning:hover {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #000;
}

html.dark-mode,
body.dark-mode .btn-outline-danger {
  color: #f5c6cb;
  border-color: #dc3545;
}

html.dark-mode,
body.dark-mode .btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* Dashboard badges in tables */
html.dark-mode,
body.dark-mode .badge.bg-primary {
  background-color: #0d6efd !important;
  color: #fff !important;
}

html.dark-mode,
body.dark-mode .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

html.dark-mode,
body.dark-mode .badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

html.dark-mode,
body.dark-mode .badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #000 !important;
}

html.dark-mode,
body.dark-mode .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

html.dark-mode,
body.dark-mode .badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

/* Dashboard table row default styling (matching hover state) */
html.dark-mode,
body.dark-mode .table tbody tr td {
  background-color: #2b2b2b;
}

html.dark-mode,
body.dark-mode .table tbody tr td strong {
  color: #fff;
}

html.dark-mode,
body.dark-mode .table tbody tr td small {
  color: #e5e5e5;
}

/* Specific styling for hover tables */
html.dark-mode,
body.dark-mode .table-hover tbody tr td {
  background-color: #2b2b2b;
}

html.dark-mode,
body.dark-mode .table-hover tbody tr td strong {
  color: #fff;
}

html.dark-mode,
body.dark-mode .table-hover tbody tr td small {
  color: #e5e5e5;
}

/* Dashboard table row hover effects (slightly lighter for contrast) */
html.dark-mode,
body.dark-mode .table-hover tbody tr:hover td {
  background-color: #3d3d3d;
}

html.dark-mode,
body.dark-mode .table-hover tbody tr:hover td strong {
  color: #fff;
}

html.dark-mode,
body.dark-mode .table-hover tbody tr:hover td small {
  color: #e5e5e5;
}

/* Dashboard empty state improvements */
html.dark-mode,
body.dark-mode #active-empty,
html.dark-mode,
body.dark-mode #sold-empty,
html.dark-mode,
body.dark-mode #completed-empty {
  color: #adb5bd;
}

html.dark-mode,
body.dark-mode #active-empty h5,
html.dark-mode,
body.dark-mode #sold-empty h5,
html.dark-mode,
body.dark-mode #completed-empty h5 {
  color: #e5e5e5;
}

/* Dashboard tab content dark mode */
html.dark-mode,
body.dark-mode .tab-content {
  background-color: transparent;
}

html.dark-mode,
body.dark-mode .tab-pane {
  background-color: transparent;
}

/* Dashboard table responsive wrapper */
html.dark-mode,
body.dark-mode .table-responsive {
  background-color: transparent;
}

/* Dashboard card body in listings */
html.dark-mode,
body.dark-mode .card-body .card-title {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-body .card-text {
  color: #adb5bd;
}

html.dark-mode,
body.dark-mode .card-body .card-text strong {
  color: #e5e5e5;
}

/* Dashboard card footer buttons */
html.dark-mode,
body.dark-mode .card-footer .btn {
  border-color: #333;
}

html.dark-mode,
body.dark-mode .card-footer .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

html.dark-mode,
body.dark-mode .card-footer .btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* Dashboard section headers */
html.dark-mode,
body.dark-mode .card-header h5 {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .card-header h6 {
  color: #e5e5e5;
}

/* Dashboard nav tabs in listings */
html.dark-mode,
body.dark-mode .nav-tabs .nav-link i {
  color: inherit;
}

/* Dashboard badge counts in nav tabs */
html.dark-mode,
body.dark-mode .nav-tabs .badge {
  color: #fff !important;
}

/* Dashboard table cell content */
html.dark-mode,
body.dark-mode .table td {
  vertical-align: middle;
}

/* Dashboard button icons */
html.dark-mode,
body.dark-mode .btn i {
  color: inherit;
}

/* Dashboard small text in various contexts */
html.dark-mode,
body.dark-mode small {
  color: #adb5bd;
}

html.dark-mode,
body.dark-mode .text-muted {
  color: #adb5bd !important;
}

/* === PURCHASE HISTORY DARK MODE STYLING === */

/* Purchase history table specific styling */
html.dark-mode,
body.dark-mode .purchase-history .table tbody tr td {
  background-color: #2b2b2b;
}

html.dark-mode,
body.dark-mode .purchase-history .table tbody tr td strong {
  color: #fff;
}

html.dark-mode,
body.dark-mode .purchase-history .table tbody tr td small {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .purchase-history .table tbody tr:hover td {
  background-color: #3d3d3d;
}

/* Purchase history badges */
html.dark-mode,
body.dark-mode .purchase-history .badge {
  color: #fff !important;
}

/* Purchase history empty state */
html.dark-mode,
body.dark-mode .purchase-history .text-center {
  color: #adb5bd;
}

html.dark-mode,
body.dark-mode .purchase-history .text-center h4 {
  color: #e5e5e5;
}

html.dark-mode,
body.dark-mode .purchase-history .text-center p {
  color: #adb5bd;
}

/* === ADDITIONAL TABLE STYLING IMPROVEMENTS === */

/* Ensure all table cells have consistent padding and alignment */
html.dark-mode,
body.dark-mode .table td {
  padding: 0.75rem;
  vertical-align: middle;
}

/* Table row alternating pattern (subtle) */
html.dark-mode,
body.dark-mode .table tbody tr:nth-child(even) td {
  background-color: #2a2a2a;
}

html.dark-mode,
body.dark-mode .table tbody tr:nth-child(odd) td {
  background-color: #2b2b2b;
}

/* Hover state overrides alternating pattern */
html.dark-mode,
body.dark-mode .table-hover tbody tr:hover td {
  background-color: #3d3d3d !important;
}

/* Ensure table borders are visible in dark mode */
html.dark-mode,
body.dark-mode .table {
  border-color: #333;
}

html.dark-mode,
body.dark-mode .table td,
html.dark-mode,
body.dark-mode .table th {
  border-color: #333;
}

/* Table header styling consistency */
html.dark-mode,
body.dark-mode .table thead th {
  background-color: #2b2b2b;
  border-bottom-color: #333;
  color: #e5e5e5;
  font-weight: 600;
}

/* Table responsive wrapper styling */
html.dark-mode,
body.dark-mode .table-responsive {
  border-color: #333;
}

/* Ensure all text in table cells is properly colored */
html.dark-mode,
body.dark-mode .table td,
html.dark-mode,
body.dark-mode .table th {
  color: #e5e5e5;
}

/* Specific styling for table links */
html.dark-mode,
body.dark-mode .table td a {
  color: #6edff6;
}

html.dark-mode,
body.dark-mode .table td a:hover {
  color: #9eeaf9;
}