/* ==========================================================================
   Loot Page Styles (/loot)
   Visual overhaul with purple/black gradient, gold accents
   ========================================================================== */

.tier-hidden {
  display: none !important;
}

/* D&D Beyond themed button */
.btn-ddb {
  border-color: #5c1010;
  color: #8b1a1a;
  background-color: transparent;
}
.btn-ddb:hover {
  background-color: #5c1010;
  color: #fff;
}

:root {
  --loot-gold: #bd9a00;
  --loot-gold-light: #fad122;
  --loot-gold-dark: #8a7100;
  --loot-gold-rgb: 189, 154, 0;
  --loot-purple: #2d1230;
  --loot-purple-dark: #1a0a1c;
  --loot-bg-deep: #060606;
  --loot-card-bg: linear-gradient(
    145deg,
    rgba(20, 16, 6, 0.95),
    rgba(10, 8, 3, 0.97)
  );
}

/* ==========================================================================
   Background - Purple/black gradient with fairy lights (default theme)
   ========================================================================== */
body.index:not(.custom-theme) {
  background: linear-gradient(
    to bottom,
    var(--loot-bg-deep) 0%,
    var(--loot-purple) 10%,
    var(--loot-purple) 90%,
    var(--loot-bg-deep) 100%
  ) !important;
  min-height: 100vh;
}

/* Fairy light effects */
body.index:not(.custom-theme)::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 8% 25%,
      rgba(var(--loot-gold-rgb), 0.25) 0%,
      transparent 6%
    ),
    radial-gradient(
      circle at 92% 35%,
      rgba(var(--loot-gold-rgb), 0.2) 0%,
      transparent 8%
    ),
    radial-gradient(
      circle at 35% 55%,
      rgba(var(--loot-gold-rgb), 0.18) 0%,
      transparent 5%
    ),
    radial-gradient(
      circle at 75% 70%,
      rgba(var(--loot-gold-rgb), 0.22) 0%,
      transparent 7%
    ),
    radial-gradient(
      circle at 20% 80%,
      rgba(var(--loot-gold-rgb), 0.2) 0%,
      transparent 6%
    ) !important;
  background-image: none;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  animation: lootFloatGlow1 12s ease-in-out infinite;
}

body.index:not(.custom-theme)::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 65% 20%,
      rgba(var(--loot-gold-rgb), 0.2) 0%,
      transparent 7%
    ),
    radial-gradient(
      circle at 18% 45%,
      rgba(var(--loot-gold-rgb), 0.22) 0%,
      transparent 6%
    ),
    radial-gradient(
      circle at 85% 55%,
      rgba(var(--loot-gold-rgb), 0.18) 0%,
      transparent 5%
    ),
    radial-gradient(
      circle at 50% 85%,
      rgba(var(--loot-gold-rgb), 0.2) 0%,
      transparent 8%
    ) !important;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  animation: lootFloatGlow2 15s ease-in-out infinite;
}

@keyframes lootFloatGlow1 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(15px, -10px);
  }
  50% {
    transform: translate(-8px, 8px);
  }
  75% {
    transform: translate(10px, 15px);
  }
}

@keyframes lootFloatGlow2 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-18px, 8px);
  }
  50% {
    transform: translate(12px, -15px);
  }
  75% {
    transform: translate(-8px, -8px);
  }
}

/* ==========================================================================
   Typography - Inter Variable font throughout (except icons and special elements)
   ========================================================================== */
body.index,
body.index
  *:not(i):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(
    .sub-display-banner
  ):not(.cormorant) {
  font-family:
    "Inter Variable", "Inter Variable Placeholder", sans-serif !important;
}

/* Restore Font Awesome font family for icons */
body.index i[class*="fa-"],
body.index .fa,
body.index .fas,
body.index .far,
body.index .fab,
body.index .fa-solid,
body.index .fa-regular,
body.index .fa-brands {
  font-family:
    "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
  font-style: normal;
}

/* Subscription tier banner - keep original styling */
body.index .sub-display-banner,
body.index .cormorant {
  font-family: "Cormorant Unicase", serif !important;
  font-size: 1.2rem !important;
  font-weight: 600;
  white-space: nowrap;
  width: fit-content;
}

body.index h1,
body.index h2,
body.index h3 {
  font-weight: 600;
  color: var(--loot-gold-light);
}

/* ==========================================================================
   Header / Campaign Title Bar
   ========================================================================== */
#campaign-title {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Default header background when no custom theme */
body.index:not(.custom-theme) #campaign-title {
  background: linear-gradient(
    to bottom,
    rgba(6, 6, 6, 0.98) 0%,
    rgba(20, 10, 22, 0.95) 100%
  ) !important;
  backdrop-filter: blur(10px);
  padding: 0.75rem 1rem;
  min-height: auto;
}

/* Custom theme header - preserve banner image functionality */
body.index.custom-theme #campaign-title {
  background-size: cover;
  background-position: center;
  min-height: 150px;
  padding: 20px;
}

/* Theme darken overlay for custom banners */
#theme-darken {
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

#campaign-title-header {
  font-size: 3rem;
  font-weight: 700;
  color: var(--loot-gold-light) !important;
  margin: 0;
  position: relative;
  z-index: 1;
}

#campaign-description {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7) !important;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Ensure nav items are above the darken overlay */
#campaign-title .nav-item {
  position: relative;
  z-index: 1;
}

/* Settings button */
#settings-icon {
  background: var(--loot-card-bg) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.3) !important;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#settings-icon:hover {
  border-color: var(--loot-gold) !important;
  box-shadow: 0 0 15px rgba(var(--loot-gold-rgb), 0.3);
  transform: scale(1.05);
}

#settings-icon img {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#settings-gear {
  color: var(--loot-gold);
  transition: transform 0.3s ease;
}

#settings-icon:hover #settings-gear {
  transform: rotate(90deg);
  color: var(--loot-gold) !important;
}


/* ==========================================================================
   Main Container
   ========================================================================== */
.data-container {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */
#app-layout {
  display: flex;
  position: fixed;
  top: var(--header-height, 70px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

body.index #footer-container {
  margin-top: 0;
}

/* Sidebar */
.sidebar {
  width: 250px;
  min-width: 250px;
  background: linear-gradient(
    180deg,
    rgba(6, 6, 6, 0.98) 0%,
    rgba(20, 10, 22, 0.96) 50%,
    rgba(6, 6, 6, 0.98) 100%
  );
  border-right: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: hidden;
  z-index: 50;
  transition: transform 0.3s ease, width 0.3s ease, min-width 0.3s ease;
}

/* Lock body scroll when mobile sidebar is open */
body.sidebar-open {
  overflow: hidden;
}

#sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  overflow-y: hidden;
}

.sidebar-logout {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.15);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 2px;
}

/* Category labels */
.sidebar-category {
  margin-bottom: 0.25rem;
  width: 100%;
}

.sidebar-category-label {
  display: block;
  padding: 0.75rem 1.25rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(var(--loot-gold-rgb), 0.5);
  user-select: none;
}

/* What's New bell in navbar */
#whats-new-nav {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

#whats-new-nav #whats-new-btn {
  color: var(--loot-gold-light);
  font-size: 1.4rem;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  transform-origin: top center;
}

#whats-new-nav #whats-new-btn:hover {
  color: #fff;
  animation: bell-ring 0.6s ease;
}

@keyframes bell-ring {
  0% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(14deg);
  }
  30% {
    transform: rotate(-12deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(4deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Menu list */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Sidebar links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-link:hover {
  color: var(--loot-gold-light);
  background: rgba(var(--loot-gold-rgb), 0.06);
  border-left-color: rgba(var(--loot-gold-rgb), 0.3);
}

.sidebar-link.active {
  color: var(--loot-gold-light);
  background: rgba(var(--loot-gold-rgb), 0.1);
  border-left-color: var(--loot-gold);
  font-weight: 600;
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--loot-gold);
  outline-offset: 2px;
  border-radius: 8px;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: inherit !important;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.sidebar-link:hover i {
  color: var(--loot-gold-light) !important;
  opacity: 1;
  animation: icon-bounce 0.4s ease;
}

.sidebar-link.active i {
  color: var(--loot-gold-light) !important;
  opacity: 1;
}

@keyframes icon-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-3px); }
  60%  { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

/* Hamburger toggle button */
#sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 18px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--loot-gold-light);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

#sidebar-toggle:hover .hamburger-icon span {
  background: var(--loot-gold);
}

/* Animate to X when sidebar is open or expanded */
#sidebar-toggle.active .hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#sidebar-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

#sidebar-toggle.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile sidebar overlay backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1040;
}

/* Main content area — only scrollable region */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#lootTabsContent {
  flex: 1;
  overflow-y: auto;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.index #footer-container {
  flex-shrink: 0;
}

body.index #footer-container .footer {
  min-height: auto;
  padding: 8px 1rem;
  font-size: 0.8rem;
}


/* Account cards */
.account-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.account-card:hover {
  background: rgba(var(--loot-gold-rgb), 0.08);
  border-color: rgba(var(--loot-gold-rgb), 0.3);
  transform: translateY(-1px);
}

.account-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--loot-gold-rgb), 0.1);
  border-radius: 8px;
  flex-shrink: 0;
}

.account-card-icon i {
  font-size: 1rem;
  color: var(--loot-gold-light) !important;
}

.account-card-body {
  flex: 1;
  min-width: 0;
}

.account-card .fa-chevron-right {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ==========================================================================
   Tabs Styling (hidden but kept for Bootstrap JS infrastructure)
   ========================================================================== */
#lootTabs {
  border-bottom: none;
  gap: 0.5rem;
  margin-bottom: 0;
}

/* Tab panes — transparent container, cards provide their own styling */
.main-content .tab-pane {
  padding: 1.5rem;
}

/* Desktop sidebar collapse */
@media (min-width: 992px) {
  .sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
    padding: 0;
  }
}

/* ==========================================================================
   Sidebar Responsive
   ========================================================================== */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    top: var(--header-height, 55px);
    left: 0;
    height: calc(100vh - var(--header-height, 55px));
    transform: translateX(-100%);
    z-index: 1050;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  #lootTabsContent {
    padding: 1rem;
  }
}

/* ==========================================================================
   Funds Display
   ========================================================================== */
.overall-funds {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
}

.overall-funds .fund {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--loot-card-bg);
  border-radius: 8px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  font-weight: 500;
  transition: all 0.3s ease;
}

.overall-funds .fund:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.overall-funds .fund span {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Currency colors */
.overall-funds .fund .plat,
.fa-coins.plat {
  color: #e5e4e2 !important;
  text-shadow: 0 0 8px rgba(229, 228, 226, 0.5);
}

.overall-funds .fund .gold,
.fa-coins.gold {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.overall-funds .fund .silver,
.fa-coins.silver {
  color: #c0c0c0 !important;
  text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.overall-funds .fund .copper,
.fa-coins.copper {
  color: #b87333 !important;
  text-shadow: 0 0 8px rgba(184, 115, 51, 0.5);
}

/* ==========================================================================
   Form Styling
   ========================================================================== */
body.index .form-control {
  background-color: rgba(15, 12, 8, 0.9) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.25) !important;
  color: #fff !important;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  transition: all 0.3s ease;
}

body.index .form-select {
  background-color: rgba(15, 12, 8, 0.9) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23bd9a00' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.25) !important;
  color: #fff !important;
  border-radius: 8px;
  padding: 0.6rem 2.25rem 0.6rem 0.9rem;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

body.index .form-control:focus {
  border-color: var(--loot-gold) !important;
  box-shadow:
    0 0 0 3px rgba(var(--loot-gold-rgb), 0.15),
    0 0 15px rgba(var(--loot-gold-rgb), 0.1) !important;
  outline: none;
}

body.index .form-select:focus {
  border-color: var(--loot-gold) !important;
  box-shadow:
    0 0 0 3px rgba(var(--loot-gold-rgb), 0.15),
    0 0 15px rgba(var(--loot-gold-rgb), 0.1) !important;
  outline: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fad122' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

body.index .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

body.index .form-select option {
  background-color: #1a1510;
  color: #fff;
}

#fundSearch,
#itemSearch {
  max-width: 220px;
}

#customValueType {
  max-width: 120px;
}

#fundsPerPage,
#itemsPerPage {
  width: auto;
}

body.index .form-label {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

/* Advanced options section */
#advancedOptionsSection {
  background: rgba(0, 0, 0, 0.55) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2) !important;
  border-radius: 12px !important;
}

/* ==========================================================================
   Button Styling
   ========================================================================== */
body.index .btn-primary {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--loot-gold-dark) 80%, transparent) 0%,
    color-mix(in srgb, var(--loot-gold) 80%, transparent) 100%
  ) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 400;
  letter-spacing: 0.5px;
  padding: 0.85rem 2.2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(var(--loot-gold-rgb), 0.2);
}

body.index .btn-primary:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--loot-gold-dark) 90%, transparent) 0%,
    color-mix(in srgb, var(--loot-gold-light) 90%, transparent) 100%
  ) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--loot-gold-rgb), 0.35);
}

body.index .btn-secondary:not(#settings-icon) {
  background: transparent !important;
  border: 1px solid var(--loot-gold) !important;
  color: var(--loot-gold) !important;
  font-weight: 400;
  letter-spacing: 0.5px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none;
}

body.index .btn-secondary:not(#settings-icon)::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

body.index .btn-secondary:not(#settings-icon):hover {
  background: var(--loot-gold) !important;
  color: #000 !important;
  box-shadow: 0 8px 25px rgba(var(--loot-gold-rgb), 0.4);
  transform: translateY(-3px);
}

body.index .btn-secondary:not(#settings-icon):hover::before {
  left: 100%;
}

body.index .btn-secondary:not(#settings-icon):active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(var(--loot-gold-rgb), 0.4);
}

body.index .btn-success {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%) !important;
  border: 1px solid rgba(45, 90, 61, 0.5) !important;
  color: #fff !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

body.index .btn-success:hover {
  background: linear-gradient(135deg, #236b3a 0%, #3d7a52 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(45, 122, 82, 0.3);
}

body.index .btn-danger {
  background: linear-gradient(135deg, #5a1a1a 0%, #8b2a2a 100%) !important;
  border: 1px solid rgba(139, 42, 42, 0.5) !important;
  color: #fff !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

body.index .btn-danger:hover {
  background: linear-gradient(135deg, #7a2525 0%, #a83535 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(168, 53, 53, 0.3);
}

body.index .btn-warning {
  background: linear-gradient(
    135deg,
    var(--loot-gold-dark) 0%,
    var(--loot-gold) 100%
  ) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.5) !important;
  color: #fff !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

body.index .btn-warning:hover {
  background: linear-gradient(135deg, #a88900 0%, #d4ad00 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(var(--loot-gold-rgb), 0.3);
}

body.index .btn-warning i {
  color: #fff !important;
}

body.index .btn-link {
  color: var(--loot-gold) !important;
  text-decoration: none;
}

body.index .btn-link:hover {
  color: var(--loot-gold-light) !important;
}

/* ==========================================================================
   Table Styling
   ========================================================================== */
body.index .table {
  --bs-table-bg: transparent !important;
  --bs-table-striped-bg: transparent !important;
  --bs-table-hover-bg: transparent !important;
  --bs-table-border-color: rgba(var(--loot-gold-rgb), 0.08) !important;
  background: rgba(15, 12, 8, 0.9) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.index .table thead {
  background: rgba(10, 8, 5, 0.95) !important;
}

body.index .table thead th {
  color: #fff !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.12) !important;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  position: relative;
  background: transparent !important;
}

body.index .table tbody tr {
  background: rgba(15, 12, 8, 0.9) !important;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

body.index .table tbody tr:nth-child(even) {
  background: rgba(25, 20, 14, 0.9) !important;
}

body.index .table tbody tr:hover {
  background: rgba(35, 28, 18, 0.9) !important;
  border-left: 3px solid var(--loot-gold);
}

body.index .table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.06) !important;
  color: #fff;
  vertical-align: middle;
  background: transparent !important;
}

/* Override Bootstrap table-dark/striped/hover cell backgrounds */
body.index .table-dark {
  --bs-table-bg: transparent !important;
  --bs-table-color: #fff !important;
}

body.index .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: transparent !important;
  background: transparent !important;
  color: #fff !important;
}

body.index .table-striped > tbody > tr:nth-of-type(even) > * {
  --bs-table-bg-type: transparent !important;
  background: transparent !important;
  color: #fff !important;
}

body.index .table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: transparent !important;
  background: transparent !important;
}

body.index .table tbody tr:last-child td {
  border-bottom: none !important;
}

/* Table action buttons */
body.index .table .btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

/* Item value display */
body.index #itemValueDisplay {
  background-color: transparent !important;
  border-bottom: none !important;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
#fundsPagination,
#itemsPagination {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.15);
}

#fundsPageInfo,
#itemsPageInfo {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* ==========================================================================
   Modal Styling
   ========================================================================== */
body.index .modal-backdrop {
  background-color: #000 !important;
}

body.index .modal-backdrop.show {
  opacity: 0.85 !important;
}

body.index .modal-content {
  background: rgb(35, 35, 38) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15) !important;
  border-radius: 16px !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

body.index .modal-header {
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.15) !important;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 16px 16px 0 0;
}

body.index .modal-header .modal-title {
  color: #fff;
}

body.index .modal-body {
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

body.index .modal-footer {
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.15) !important;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 0 0 16px 16px;
}

/* ==========================================================================
   Offcanvas (Settings Sidebar)
   ========================================================================== */
body.index .offcanvas {
  background: linear-gradient(
    180deg,
    rgba(6, 6, 6, 0.98) 0%,
    rgba(30, 15, 32, 0.98) 50%,
    rgba(6, 6, 6, 0.98) 100%
  ) !important;
  border-right: 1px solid rgba(var(--loot-gold-rgb), 0.2) !important;
}

body.index .offcanvas-header {
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  padding: 1.5rem;
}

body.index .offcanvas-body {
  padding: 1.5rem;
}

body.index .offcanvas .btn {
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   D&D 5e Search Section
   ========================================================================== */
#dnd5eSearchResults {
  min-height: 200px;
}

#dnd5eSearchResults .text-center {
  padding: 3rem;
  color: rgba(255, 255, 255, 0.5);
}

#dnd5eSearchResults .text-center i {
  color: var(--loot-gold);
  opacity: 0.5;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
body.index .alert {
  background: var(--loot-card-bg) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2) !important;
  border-radius: 12px;
  color: #fff !important;
}

body.index .alert-secondary {
  border-left: 4px solid var(--loot-gold) !important;
}

body.index .alert-danger {
  border-left: 4px solid #dc3545 !important;
}

/* ==========================================================================
   SRD Search Result Items
   ========================================================================== */
.srd-result-item {
  background: rgba(20, 16, 6, 0.95) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.srd-result-item:hover,
.srd-result-item:focus {
  background: rgba(var(--loot-gold-rgb), 0.1) !important;
  border-color: rgba(var(--loot-gold-rgb), 0.4) !important;
  color: #fff !important;
}

/* ==========================================================================
   Design System Utility Classes
   ========================================================================== */
.btn-outline-gold {
  border-color: var(--loot-gold) !important;
  color: var(--loot-gold) !important;
  background: transparent;
}

.btn-outline-gold:hover {
  background: rgba(var(--loot-gold-rgb), 0.15) !important;
  color: var(--loot-gold-light) !important;
}

/* ==========================================================================
   Badge Styling (design system overrides)
   ========================================================================== */
.badge-owner {
  background: rgba(var(--loot-gold-rgb), 0.15);
  color: var(--loot-gold-light);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.3);
}

.badge-role-dm {
  background: rgba(var(--loot-gold-rgb), 0.2);
  color: var(--loot-gold-light);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.4);
  font-size: 0.6em;
  vertical-align: middle;
}

.badge-role-player {
  background: rgba(40, 167, 69, 0.2);
  color: #5cb85c;
  border: 1px solid rgba(40, 167, 69, 0.3);
  font-size: 0.6em;
  vertical-align: middle;
}

.badge-tag {
  background: rgba(var(--loot-gold-rgb), 0.1);
  color: var(--loot-gold);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.25);
  font-weight: 400;
}

/* Unidentified item badge */
.badge-unidentified {
  background: rgba(138, 43, 226, 0.2);
  color: #d4b8ff;
  border: 1px solid rgba(138, 43, 226, 0.4);
  font-size: 0.65em;
  vertical-align: middle;
  animation: unidentified-pulse 2s ease-in-out infinite;
}

@keyframes unidentified-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Unidentified item row/card accent */
.item-card.unidentified {
  border-left: 3px solid rgba(138, 43, 226, 0.6);
}

.item-row.unidentified {
  border-left: 3px solid rgba(138, 43, 226, 0.6);
}

.item-list-row.unidentified {
  border-left: 3px solid rgba(138, 43, 226, 0.6);
}

/* DM hint text for unidentified items */
.item-card-unidentified-hint {
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(212, 184, 255, 0.6);
  margin-top: -2px;
  margin-bottom: 4px;
}

/* Purple identify button */
.btn-purple {
  background: rgba(138, 43, 226, 0.3);
  color: #d4b8ff;
  border: 1px solid rgba(138, 43, 226, 0.5);
}

.btn-purple:hover {
  background: rgba(138, 43, 226, 0.5);
  color: #e8d5ff;
  border-color: rgba(138, 43, 226, 0.7);
}

.badge-quantity {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.badge-unassigned {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-equipped {
  background: rgba(40, 167, 69, 0.18);
  color: #5cb85c;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

/* ==========================================================================
   Analytics Card Styling
   ========================================================================== */
.analytics-card {
  background: var(--loot-card-bg);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  color: #fff;
}

/* Utility: gold text color from design tokens */
.text-gold {
  color: var(--loot-gold-light) !important;
}

/* Utility: gold spinner */
body.index .spinner-border {
  color: var(--loot-gold) !important;
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */
body.index::-webkit-scrollbar {
  width: 10px;
}

body.index::-webkit-scrollbar-track {
  background: var(--loot-bg-deep);
}

body.index::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--loot-gold-dark),
    var(--loot-purple)
  );
  border-radius: 5px;
}

body.index::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--loot-gold),
    var(--loot-purple-dark)
  );
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  /* ── Header ── */
  #campaign-title {
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem !important;
    min-height: auto !important;
  }

  #campaign-title-header {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45vw;
  }

  #campaign-description {
    display: none;
  }

  #campaign-title .nav-item:last-child {
    gap: 0.4rem !important;
    padding-right: 0.25rem !important;
  }

  /* Allow center nav-item (campaign title) to grow and shrink */
  #campaign-title .nav-item:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  /* Truncate active session indicator on tablets */
  #active-session-indicator .dropdown-toggle {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  nav .pla-logo {
    max-width: 40px;
    max-height: 40px;
  }

  #settings-icon {
    width: 34px;
    height: 34px;
  }

  #profile-icon {
    max-width: 34px;
    max-height: 34px;
  }

  /* ── Funds display ── */
  .overall-funds {
    flex-direction: column;
    padding: 0.6rem;
    gap: 0.5rem;
    margin: 0.5rem 0;
  }

  .overall-funds .fund {
    width: 100%;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
  }

  /* ── Main content ── */
  .main-content {
    padding: 0;
  }

  .main-content .tab-pane {
    padding: 0.5rem;
  }

  /* ── Tables ── */
  body.index .table thead th {
    padding: 0.5rem 0.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.3px;
  }

  body.index .table tbody td {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }

  /* ── Toolbar / filter bars ── */
  .d-flex.justify-content-between.align-items-center.flex-wrap {
    gap: 0.5rem;
  }

  .d-flex.align-items-center.gap-2 {
    gap: 0.35rem !important;
    flex-wrap: wrap;
  }

  #fundSearch,
  #itemSearch {
    flex: 1 1 100%;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    order: -1;
  }

  #fundsPerPage,
  #itemsPerPage {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }

  .view-toggle .btn {
    padding: 0.3rem 0.5rem;
  }

  /* ── Section headings ── */
  .tab-pane h2 {
    font-size: 1.1rem;
  }

  /* ── Pagination ── */
  #fundsPagination,
  #itemsPagination {
    font-size: 0.8rem;
  }

  #fundsPagination .btn,
  #itemsPagination .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  /* ── Action toolbars: stack rows ── */
  .tab-pane > .d-flex.justify-content-between.flex-wrap {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tab-pane > .d-flex.justify-content-between.flex-wrap > .d-flex {
    width: 100%;
    flex-wrap: wrap;
  }

  /* Keep view toggle horizontal */
  .view-toggle.btn-group {
    flex-direction: row !important;
  }

  /* ── Modals ── */
  .modal-dialog {
    margin: 0.5rem;
  }

  /* ── Export / Add button row ── */
  .tab-pane .d-flex.align-items-center.gap-2.mb-2:last-child {
    justify-content: flex-end;
  }

  /* ── Buttons: compact on mobile ── */
  body.index .btn-primary {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
  }

  body.index .btn-success,
  body.index .btn-danger,
  body.index .btn-warning,
  body.index .btn-secondary:not(#settings-icon),
  body.index .btn-outline-secondary,
  body.index .btn-outline-danger {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
  }

  body.index .btn-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  body.index .btn-lg {
    padding: 0.55rem 1.2rem !important;
    font-size: 0.9rem !important;
  }

  /* ── Header: hide clutter ── */
  #whats-new-nav {
    display: none !important;
  }

  nav .pla-logo {
    display: none !important;
  }

  /* ── Funds table → card layout ── */
  #fundsSection .table thead {
    display: none;
  }

  #fundsSection .table,
  #fundsSection .table tbody {
    display: block;
    width: 100%;
  }

  #fundsSection .table tbody tr {
    display: block;
    background: rgba(20, 16, 6, 0.7);
    border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    position: relative;
  }

  #fundsSection .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.3rem 0;
    border: none;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  #fundsSection .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--loot-gold, #bd9a00);
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 60px;
  }

  #fundsSection .table tbody td[data-label="Action"] {
    justify-content: flex-end;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    border-top: 1px solid rgba(var(--loot-gold-rgb), 0.1);
  }

  #fundsSection .table tbody td[data-label="Action"]::before {
    display: none;
  }

  #fundsSection .table tbody td .currency-breakdown {
    text-align: right;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #fundsSection .table tbody td .currency-breakdown .currency {
    white-space: nowrap;
  }

  /* ── Items table → card layout ── */
  #itemsSection .table thead {
    display: none;
  }

  #itemsSection .table,
  #itemsSection .table tbody {
    display: block;
    width: 100%;
  }

  #itemsSection .table tbody tr {
    display: block;
    background: rgba(20, 16, 6, 0.7);
    border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
  }

  #itemsSection .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border: none;
    font-size: 0.85rem;
  }

  #itemsSection .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--loot-gold, #bd9a00);
    flex-shrink: 0;
    margin-right: 0.75rem;
  }

  #itemsSection .table tbody td[data-label="Action"] {
    justify-content: flex-end;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    border-top: 1px solid rgba(var(--loot-gold-rgb), 0.1);
  }

  #itemsSection .table tbody td[data-label="Action"]::before {
    display: none;
  }

  /* ── Footer: scroll with content, not stuck at viewport bottom ── */
  .main-content {
    overflow-y: auto !important;
    overflow-x: hidden;
  }

  #lootTabsContent {
    flex: none;
    overflow-y: visible;
  }

  #footer-container .footer {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  #campaign-title-header {
    font-size: 0.9rem;
    max-width: 45vw;
  }

  body.index .table thead th {
    padding: 0.4rem 0.35rem;
    font-size: 0.6rem;
  }

  body.index .table tbody td {
    padding: 0.4rem 0.35rem;
    font-size: 0.75rem;
  }

  #fundSearch,
  #itemSearch {
    max-width: 100% !important;
  }

  .overall-funds .fund {
    font-size: 0.85rem;
  }

  .overall-funds .fund span {
    font-size: 0.95rem;
  }

  /* Further reduce active session indicator */
  #active-session-indicator .dropdown-toggle {
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
body.index .gold-border {
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
}

body.index .text-gold {
  color: var(--loot-gold-light) !important;
}

/* Dashboard clickable cards */
.dashboard-link {
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.dashboard-link:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   Modern Dashboard Cards
   ========================================================================== */

/* Stat cards (top row) */
.dash-stat-card {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
}

.dash-stat-card:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(var(--loot-gold-rgb), 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dash-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.15rem;
}

.dash-stat-icon-wrap i {
  color: inherit !important;
}

.dash-stat-warning {
  background: rgba(var(--loot-gold-rgb), 0.15);
  color: var(--loot-gold-light);
}

.dash-stat-info {
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
}

.dash-stat-primary {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.dash-stat-success {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
}

.dash-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.dash-stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

/* Active session banner */
.dash-active-session {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: rgba(var(--loot-gold-rgb), 0.06);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dash-active-session:hover {
  background: rgba(var(--loot-gold-rgb), 0.1);
  border-color: rgba(var(--loot-gold-rgb), 0.35);
}

.dash-active-session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  margin-right: 0.75rem;
  flex-shrink: 0;
  animation: dash-pulse 2s ease-in-out infinite;
}

@keyframes dash-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.dash-active-session i {
  color: var(--loot-gold) !important;
  font-size: 1.1rem;
}

.dash-active-session-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(var(--loot-gold-rgb), 0.7);
  font-weight: 600;
}

.dash-active-session-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.dash-active-session-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

/* Generic dashboard card */
.dash-card {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: all 0.25s ease;
}

.dash-card:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4);
}

.dash-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.dash-card-header i {
  color: var(--loot-gold) !important;
  font-size: 1rem;
}

/* Funds grid */
.dash-funds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.dash-fund-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--loot-card-bg);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.dash-fund-chip:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dash-fund-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  flex: 1;
}

.dash-fund-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

/* Activity feed */
.dash-activity-list {
  display: flex;
  flex-direction: column;
}

.dash-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.06);
}

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

.dash-activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.dash-activity-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dash-activity-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.dash-activity-user {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.dash-activity-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-activity-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.15);
}

.dash-activity-page-info {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.15rem;
}

@media (max-width: 768px) {
  .dash-funds-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-active-session {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .dash-active-session-date {
    width: 100%;
    padding-left: 2.75rem;
  }

  .dash-stat-card {
    padding: 0.75rem 0.5rem;
  }

  .dash-stat-icon-wrap {
    width: 36px;
    height: 36px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
  }

  .dash-stat-value {
    font-size: 1.3rem;
  }

  .dash-stat-label {
    font-size: 0.65rem;
  }

  .dash-card {
    padding: 0.75rem;
  }

  .dash-card-header {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }
}

/* Session tag badge (inline in tables/cards) */
.session-tag-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(var(--loot-gold-rgb), 0.15);
  color: var(--loot-gold-light);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.session-tag-badge:hover {
  background: rgba(var(--loot-gold-rgb), 0.3);
}

/* Tab navigation link (shown after actions) */
.tab-nav-link {
  color: var(--loot-gold-light);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}
.tab-nav-link:hover {
  color: var(--loot-gold);
}

/* Magic item badge */
.badge-magic {
  background-color: #7c3aed;
  color: #fff;
}

/* ==========================================================================
   Icons - Ensure ALL Font Awesome icons are visible
   ========================================================================== */

/* Base icon visibility - ensure all icons display */
body.index i[class*="fa-"],
body.index .fa,
body.index .fas,
body.index .far,
body.index .fab,
body.index .fa-solid,
body.index .fa-regular,
body.index .fa-brands {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Default icon color - gold */
body.index i[class*="fa-"],
body.index .fa,
body.index .fas,
body.index .far,
body.index .fab,
body.index .fa-solid,
body.index .fa-regular {
  color: var(--loot-gold-light);
}

/* Icons in buttons - inherit button text color */
body.index .btn i,
body.index .btn .fa-solid,
body.index .btn .fa-regular,
body.index .btn .fas,
body.index .btn .far {
  display: inline-block !important;
  margin-right: 0.4rem;
  color: inherit !important;
}

/* Icons in tabs */
body.index .nav-link i,
body.index .nav-link .fa-solid,
body.index .nav-link .fa-regular {
  display: inline-block !important;
  margin-right: 0.5rem;
  color: inherit;
}

/* Icons in table cells */
body.index .table i,
body.index .table .fa-solid,
body.index .table .fa-regular {
  display: inline-block !important;
}

/* Icons in modals */
body.index .modal i,
body.index .modal .fa-solid,
body.index .modal .fa-regular {
  display: inline-block !important;
}

/* Icons in offcanvas */
body.index .offcanvas i,
body.index .offcanvas .fa-solid,
body.index .offcanvas .fa-regular {
  display: inline-block !important;
}

body.index .item-card .item-card-watermark {
  opacity: 0.1 !important;
}

/* Item filter panel */
.item-filter-panel {
  min-width: 220px;
  background: #2a2a2a;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
}
.item-filter-panel .form-label {
  color: rgba(255, 255, 255, 0.7);
}
.item-filter-panel .form-select {
  background-color: #1a1a1a;
  color: #fff;
  border-color: rgba(var(--loot-gold-rgb), 0.2);
}
.item-filter-panel .form-select:focus {
  border-color: var(--loot-gold);
  box-shadow: 0 0 0 0.2rem rgba(var(--loot-gold-rgb), 0.25);
}

/* Icons in alerts */
body.index .alert i {
  display: inline-block !important;
  margin-right: 0.5rem;
}

/* Currency coin icons - specific colors */
body.index .fa-coins.plat,
body.index i.plat {
  color: #e5e4e2 !important;
  text-shadow: 0 0 8px rgba(229, 228, 226, 0.5);
}
body.index .fa-coins.gold,
body.index i.gold {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
body.index .fa-coins.silver,
body.index i.silver {
  color: #c0c0c0 !important;
  text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}
body.index .fa-coins.copper,
body.index i.copper {
  color: #b87333 !important;
  text-shadow: 0 0 8px rgba(184, 115, 51, 0.5);
}

/* Action button icons */
body.index .btn-success i {
  color: #fff !important;
}
body.index .btn-danger i {
  color: #fff !important;
}
body.index .btn-primary i {
  color: #fff !important;
}
body.index .btn-secondary:not(#settings-icon) i {
  color: var(--loot-gold) !important;
}
body.index .btn-secondary:not(#settings-icon):hover i {
  color: #000 !important;
}

/* Link button icons */
body.index .btn-link i {
  color: var(--loot-gold) !important;
}

/* Close button icon */
body.index .btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Checkbox/form icons */
body.index .form-check-input:checked {
  background-color: var(--loot-gold);
  border-color: var(--loot-gold);
}

/* ==========================================================================
   View Toggle Buttons
   ========================================================================== */
.view-toggle .btn {
  padding: 0.4rem 0.7rem;
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
  color: var(--loot-gold) !important;
  background: transparent !important;
}

.view-toggle .btn:hover {
  background: rgba(var(--loot-gold-rgb), 0.15) !important;
  border-color: var(--loot-gold) !important;
}

.view-toggle .btn.active {
  background: var(--loot-gold) !important;
  border-color: var(--loot-gold) !important;
  color: #000 !important;
}

.view-toggle .btn i {
  color: inherit !important;
}

/* ==========================================================================
   Card View Styles
   ========================================================================== */
.items-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 1rem;
}

.item-card {
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.item-card:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: rgba(var(--loot-gold-rgb), 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.item-card-watermark {
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 10rem;
  color: rgba(74, 74, 74, 0.25);
  pointer-events: none;
  z-index: 0;
}
.item-card > *:not(.item-card-watermark):not(.item-card-expand) {
  position: relative;
  z-index: 1;
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.item-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  flex: 1;
  padding-right: 0.5rem;
}

.item-card-quantity {
  background: rgba(var(--loot-gold-rgb), 0.2);
  color: var(--loot-gold-light);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.item-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.item-card-rarity {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Rarity colors */
.rarity-common {
  background: rgba(158, 158, 158, 0.2);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}
.rarity-uncommon {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.rarity-rare {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}
.rarity-very-rare {
  background: rgba(156, 39, 176, 0.2);
  color: #9c27b0;
  border: 1px solid rgba(156, 39, 176, 0.3);
}
.rarity-legendary {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}
.rarity-artifact {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.item-card-type {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
}

.item-card-type i {
  font-size: 0.65rem;
  color: var(--loot-gold) !important;
}

.item-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.item-card-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-card-detail i {
  width: 16px;
  text-align: center;
  color: var(--loot-gold) !important;
  font-size: 0.8rem;
}

.item-card-detail span {
  color: rgba(255, 255, 255, 0.9);
}

.item-card-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.item-card-value .value-text,
.item-list-value .value-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.item-card-value .value-text.gold,
.item-list-value .value-text.gold {
  color: #ffd700;
}

.item-card-value .value-text.silver,
.item-list-value .value-text.silver {
  color: #c0c0c0;
}

.item-card-value .value-text.copper,
.item-list-value .value-text.copper {
  color: #b87333;
}

.item-card-value .value-text.plat,
.item-list-value .value-text.plat {
  color: #e5e4e2;
}

.item-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-card-description {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.item-card-spacer {
  flex: 1;
}

.item-card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  margin-top: auto;
}

.item-card-actions .btn,
.item-card-actions .action-btn {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

/* Expand button for viewing full details */
.item-card-expand {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.3);
  color: var(--loot-gold);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.item-card-expand:hover {
  background: var(--loot-gold);
  color: #000;
}

/* Card action button colors */
.item-card-actions .btn-outline-secondary {
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

.item-card-actions .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(var(--loot-gold-rgb), 0.5) !important;
  color: #fff !important;
}

.item-card-actions .btn-outline-primary {
  border-color: rgba(33, 150, 243, 0.5) !important;
  color: #2196f3 !important;
}

.item-card-actions .btn-outline-primary:hover {
  background: rgba(33, 150, 243, 0.2) !important;
}

.item-card-actions .btn-outline-warning {
  border-color: var(--loot-gold) !important;
  color: var(--loot-gold-light) !important;
}

.item-card-actions .btn-outline-warning:hover {
  background: linear-gradient(
    135deg,
    var(--loot-gold-dark) 0%,
    var(--loot-gold) 100%
  ) !important;
  border-color: var(--loot-gold) !important;
  color: #fff !important;
}

.item-card-actions .btn-outline-success {
  border-color: rgba(45, 90, 61, 0.7) !important;
  color: #4caf50 !important;
}

.item-card-actions .btn-outline-success:hover {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%) !important;
  border-color: rgba(45, 90, 61, 0.7) !important;
  color: #fff !important;
}

.item-card-actions .btn-outline-danger {
  border-color: rgba(139, 42, 42, 0.7) !important;
  color: #dc3545 !important;
}

.item-card-actions .btn-outline-danger:hover {
  background: linear-gradient(135deg, #5a1a1a 0%, #8b2a2a 100%) !important;
  border-color: rgba(139, 42, 42, 0.7) !important;
  color: #fff !important;
}

/* Item details row in table view */
.item-details-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.2);
}

.item-details-row .item-details {
  padding: 1rem !important;
  border-radius: 8px;
}

.item-details-row h6 {
  color: var(--loot-gold-light);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.item-details-row p {
  margin-bottom: 0.75rem;
}

.item-details-row .badge {
  margin-right: 0.5rem;
}

/* Toggle details button */
body.index .toggle-details {
  padding: 0.25rem 0.5rem;
  color: var(--loot-gold) !important;
}

body.index .toggle-details:hover {
  color: var(--loot-gold-light) !important;
}

body.index .toggle-details i {
  transition: transform 0.2s ease;
}

/* Item details modal styling */
#itemDetailsModal .text-gold {
  color: var(--loot-gold) !important;
}

.item-full-description {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.item-full-description p {
  margin-bottom: 0.5rem;
}

/* Edit Item Modal - Form Styling */
#editItemModal .form-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

#editItemModal .form-control,
#editItemModal .form-select {
  background-color: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  color: #fff;
}

#editItemModal .form-control:focus,
#editItemModal .form-select:focus {
  background-color: rgba(0, 0, 0, 0.4);
  border-color: rgba(var(--loot-gold-rgb), 0.3);
  box-shadow: 0 0 0 0.2rem rgba(var(--loot-gold-rgb), 0.15);
}

#editItemModal .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#editItemModal .text-gold {
  color: var(--loot-gold) !important;
}

#editItemModal h6.text-gold {
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  padding-bottom: 0.5rem;
}

.input-group-text {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   List View Styles
   ========================================================================== */
.items-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 1rem;
}

.item-list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  border-radius: 8px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.item-list-row:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: rgba(var(--loot-gold-rgb), 0.2);
  border-left: 3px solid var(--loot-gold);
}

.item-list-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--loot-gold-rgb), 0.15);
  border-radius: 8px;
  color: var(--loot-gold);
  font-size: 1.1rem;
}

.item-list-info {
  flex: 1;
  min-width: 0;
}

.item-list-name {
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-list-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 1rem;
  margin-top: 0.2rem;
}

.item-list-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.item-list-value {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--loot-gold-light);
  font-weight: 600;
  min-width: 80px;
  justify-content: flex-end;
}

.item-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.item-list-actions .btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}

/* List view action button colors - same as card view */
.item-list-actions .btn-outline-secondary {
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

.item-list-actions .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(var(--loot-gold-rgb), 0.5) !important;
  color: #fff !important;
}

.item-list-actions .btn-outline-primary {
  border-color: rgba(33, 150, 243, 0.5) !important;
  color: #2196f3 !important;
}

.item-list-actions .btn-outline-primary:hover {
  background: rgba(33, 150, 243, 0.2) !important;
}

.item-list-actions .btn-outline-warning {
  border-color: var(--loot-gold) !important;
  color: var(--loot-gold-light) !important;
}

.item-list-actions .btn-outline-warning:hover {
  background: linear-gradient(
    135deg,
    var(--loot-gold-dark) 0%,
    var(--loot-gold) 100%
  ) !important;
  border-color: var(--loot-gold) !important;
  color: #fff !important;
}

.item-list-actions .btn-outline-success {
  border-color: rgba(45, 90, 61, 0.7) !important;
  color: #4caf50 !important;
}

.item-list-actions .btn-outline-success:hover {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%) !important;
  border-color: rgba(45, 90, 61, 0.7) !important;
  color: #fff !important;
}

.item-list-actions .btn-outline-danger {
  border-color: rgba(139, 42, 42, 0.7) !important;
  color: #dc3545 !important;
}

.item-list-actions .btn-outline-danger:hover {
  background: linear-gradient(135deg, #5a1a1a 0%, #8b2a2a 100%) !important;
  border-color: rgba(139, 42, 42, 0.7) !important;
  color: #fff !important;
}

/* ==========================================================================
   Action Buttons (consistent across all views)
   ========================================================================== */
.action-btn {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem !important;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn i {
  font-size: 0.9rem;
}

/* Table view action buttons */
.action-buttons .d-flex {
  gap: 0.5rem;
  width: 100%;
}

.action-buttons .d-flex .action-btn {
  flex: 1;
}

/* List view action buttons */
.item-list-actions {
  display: flex;
  gap: 0.5rem;
  min-width: 200px;
}

.item-list-actions .action-btn {
  flex: 1;
}

/* ==========================================================================
   Responsive Card/List View
   ========================================================================== */
@media (max-width: 768px) {
  /* Force card-only view on mobile — hide table/list toggles */
  #tableViewBtn,
  #listViewBtn {
    display: none !important;
  }

  #itemsTableView,
  #itemsListView {
    display: none !important;
  }

  .items-card-container {
    grid-template-columns: 1fr;
  }

  /* Item card min-height: let cards collapse to natural content height on mobile */
  .item-card {
    min-height: auto;
  }

  /* Safety net: list view layout if CSS override is bypassed */
  .item-list-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .item-list-info {
    flex: 1 1 calc(100% - 56px);
  }

  .item-list-meta {
    flex-direction: column;
    gap: 0.3rem;
  }

  .item-list-badges {
    width: 100%;
    order: 3;
    margin-top: 0.25rem;
  }

  .item-list-value {
    min-width: auto;
    order: 4;
  }

  .item-list-actions {
    min-width: 0;
    width: 100%;
    order: 5;
  }

  .item-list-actions .action-btn {
    flex: 1;
  }

  /* Analytics: reduce chart height on mobile */
  #analyticsContent canvas {
    max-height: 220px;
  }

  /* Expand button: increase touch target on mobile */
  .item-card-expand {
    width: 40px;
    height: 40px;
  }
}

/* Empty state for views */
.items-empty-state {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.5);
}

.items-empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--loot-gold);
  opacity: 0.5;
}

/* ==========================================================================
   D&D Beyond Section
   ========================================================================== */
.dndbeyond-card {
  position: relative;
  background: var(--loot-card-bg);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dndbeyond-card:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dndbeyond-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.15);
}

.dndbeyond-card-header h5 {
  color: var(--loot-gold-light);
  margin: 0;
}

.dndbeyond-card-body {
  padding: 1rem 1.25rem;
}

.dndbeyond-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.dndbeyond-currency {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.dndbeyond-coin {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
}

#dndbeyondSection .dndbeyond-sync-btn:hover {
  background: rgba(var(--loot-gold-rgb), 0.2);
  border-color: var(--loot-gold);
  color: var(--loot-gold-light);
}

/* --- D&D Class-Themed Cards --- */
.dndbeyond-card[style*="--class-color"] {
  background: linear-gradient(
    145deg,
    rgba(var(--class-color), 0.15) 0%,
    rgba(30, 25, 10, 0.9) 40%,
    rgba(15, 12, 5, 0.95) 100%
  );
  border-color: rgba(var(--class-color), 0.3);
}
.dndbeyond-card[style*="--class-color"]:hover {
  border-color: rgba(var(--class-color), 0.5);
  box-shadow: 0 6px 20px rgba(var(--class-color), 0.15);
}
.dndbeyond-card[style*="--class-color"] .dndbeyond-card-header {
  border-bottom-color: rgba(var(--class-color), 0.2);
}
.dndbeyond-card[style*="--class-color"] .dndbeyond-card-footer {
  border-top-color: rgba(var(--class-color), 0.15);
  background: rgba(var(--class-color), 0.05);
}

i.dndbeyond-class-watermark {
  position: absolute;
  bottom: -15px;
  right: -10px;
  font-size: 12rem;
  color: rgba(180, 180, 180, 0.2);
  pointer-events: none;
  z-index: 0;
}
img.dndbeyond-class-watermark {
  position: absolute;
  top: -30px;
  right: -10px;
  width: 70%;
  height: auto;
  object-fit: contain;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  filter: grayscale(100%) invert(1) brightness(0.5);
}
.dndbeyond-card-header,
.dndbeyond-card-body,
.dndbeyond-card-footer {
  position: relative;
  z-index: 1;
}
.dndbeyond-card .table-dark,
.dndbeyond-card .table-dark th,
.dndbeyond-card .table-dark td {
  background-color: transparent !important;
}
.ddb-inventory-toggle {
  padding: 0.5rem 1rem !important;
}
.ddb-chevron {
  transition: transform 0.3s ease;
}
.ddb-inventory-toggle[aria-expanded="true"] .ddb-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   DM-Only Elements (hidden by default, shown via JS for DM role)
   ========================================================================== */
.dm-only:not(.dm-active) {
  display: none;
}

/* ==========================================================================
   DM Staging Section
   ========================================================================== */
.staged-item-card {
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.staged-item-card:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: rgba(var(--loot-gold-rgb), 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.staged-item-card .staged-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.staged-item-card .staged-badge.released {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border-color: rgba(76, 175, 80, 0.3);
}

.staged-funds-card {
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.staged-funds-card:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: rgba(var(--loot-gold-rgb), 0.2);
}

.staged-fund-coins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.staged-fund-coin {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.staging-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.2);
}

.staging-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#srdSearchResults {
  max-height: 300px;
  overflow-y: auto;
}

.staging-section-header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.release-btn {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
  border: 1px solid rgba(45, 90, 61, 0.5);
  color: #fff;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.release-btn:hover {
  background: linear-gradient(135deg, #236b3a 0%, #3d7a52 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(45, 122, 82, 0.3);
  color: #fff;
}

.staged-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 1rem;
}

.staged-item-check {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}

.staged-item-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.staged-assign-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

/* ==========================================================================
   Sessions Timeline
   ========================================================================== */
.sessions-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 2rem;
}

/* Vertical timeline line */
.sessions-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(var(--loot-gold-rgb), 0.5),
    rgba(var(--loot-gold-rgb), 0.1)
  );
}

.session-card {
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

/* Timeline dot */
.session-card::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 1.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--loot-gold);
  border: 2px solid rgba(45, 45, 45, 0.9);
  z-index: 1;
  margin-left: -4px;
}

.session-card:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.15);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-number {
  background: rgba(var(--loot-gold-rgb), 0.2);
  color: var(--loot-gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.session-title {
  flex: 1;
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
}

.session-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  white-space: nowrap;
}

.session-card-body {
  padding: 1rem;
}

.session-notes {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.session-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  font-size: 0.85rem;
}

.session-stats span {
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
}

.session-stats i {
  color: var(--loot-gold) !important;
}

.session-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.session-item-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
}

/* Rarity colors apply to session item badges too */
.session-item-badge.rarity-common {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border-color: rgba(158, 158, 158, 0.25);
}
.session-item-badge.rarity-uncommon {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border-color: rgba(76, 175, 80, 0.25);
}
.session-item-badge.rarity-rare {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
  border-color: rgba(33, 150, 243, 0.25);
}
.session-item-badge.rarity-very-rare {
  background: rgba(156, 39, 176, 0.15);
  color: #9c27b0;
  border-color: rgba(156, 39, 176, 0.25);
}
.session-item-badge.rarity-legendary {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border-color: rgba(255, 152, 0, 0.25);
}
.session-item-badge.rarity-artifact {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border-color: rgba(244, 67, 54, 0.25);
}

/* Expandable session detail */
.session-expandable {
  cursor: pointer;
}
.session-expandable:hover {
  background: rgba(189, 154, 0, 0.12);
}
.session-expand-icon {
  font-size: 0.7rem;
  color: var(--loot-gold);
  transition: transform 0.2s ease;
}
.session-detail {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(var(--loot-gold-rgb), 0.08);
}
.session-detail-section {
  margin-top: 0.75rem;
}
.session-detail-section h6 {
  color: var(--loot-gold);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.session-detail-table {
  font-size: 0.8rem;
  margin-bottom: 0;
}
.session-detail-table th {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom-color: rgba(var(--loot-gold-rgb), 0.12);
}
.session-detail-table td {
  border-bottom-color: rgba(var(--loot-gold-rgb), 0.06);
  vertical-align: middle;
}

@media (max-width: 768px) {
  .sessions-timeline {
    padding-left: 1.5rem;
  }
  .session-card::before {
    left: -1.5rem;
  }
  .session-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .session-detail-table {
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   Loot Generator
   ========================================================================== */
.loot-generator-container {
  padding: 0.5rem 0;
}

.loot-results {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(var(--loot-gold-rgb), 0.2);
  border-radius: 12px;
  padding: 1.25rem;
}

.loot-results h5 {
  color: var(--loot-gold-light);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.loot-results .badge {
  font-weight: 500;
}

.loot-results .card {
  transition: all 0.2s ease;
}

.loot-results .card:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.4) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   Analytics Dashboard
   ========================================================================== */
#analyticsContent .card {
  background: rgba(30, 30, 30, 0.8) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.15) !important;
  border-radius: 12px !important;
  transition: all 0.3s ease;
}

#analyticsContent .card:hover {
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
}

#analyticsContent .card h5,
#analyticsContent .card h6 {
  color: var(--loot-gold-light);
}

#analyticsContent .card .fs-2 {
  font-weight: 700;
  color: var(--loot-gold-light) !important;
}

#analyticsContent canvas {
  max-height: 300px;
}

/* ==========================================================================
   Export Buttons
   ========================================================================== */
.export-dropdown .btn {
  border-color: rgba(var(--loot-gold-rgb), 0.3) !important;
  color: var(--loot-gold) !important;
  background: transparent !important;
  font-size: 0.8rem;
}

.export-dropdown .btn:hover {
  background: rgba(var(--loot-gold-rgb), 0.15) !important;
  border-color: var(--loot-gold) !important;
}

.export-dropdown .dropdown-menu {
  background: rgba(35, 35, 38, 0.98) !important;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.3) !important;
  border-radius: 8px;
}

.export-dropdown .dropdown-item {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.85rem;
}

.export-dropdown .dropdown-item:hover {
  background: rgba(var(--loot-gold-rgb), 0.15) !important;
  color: var(--loot-gold-light) !important;
}

.export-dropdown .dropdown-item i {
  color: var(--loot-gold) !important;
  width: 20px;
  text-align: center;
}

/* ==========================================================================
   Inline Account Settings (replaces /profile page)
   ========================================================================== */

.settings-inline {
  display: flex;
  gap: 0;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  border: 1px solid rgba(var(--loot-gold-rgb), 0.12);
  overflow: hidden;
  min-height: 500px;
}

.settings-inline-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.25rem 0.75rem;
  min-width: 220px;
  background: rgba(15, 15, 18, 0.7);
  border-right: 1px solid rgba(var(--loot-gold-rgb), 0.12);
}

.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 450;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.settings-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.settings-nav-link.active {
  background: rgba(var(--loot-gold-rgb), 0.1);
  color: var(--loot-gold-light);
  border-left-color: var(--loot-gold);
  font-weight: 600;
}

.settings-nav-link i {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.settings-nav-link.active i {
  opacity: 1;
  color: var(--loot-gold-light);
}

.settings-inline-content {
  flex: 1;
  padding: 1.75rem 2rem;
  min-width: 0;
}

.settings-inline-content h3 {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--loot-gold-light);
  margin-bottom: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.12);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .settings-inline {
    flex-direction: column;
  }

  .settings-inline-nav {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid rgba(var(--loot-gold-rgb), 0.12);
    padding: 0.75rem;
    gap: 4px;
  }

  .settings-nav-link {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .settings-nav-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--loot-gold);
  }

  .settings-nav-link span {
    display: none;
  }

  .settings-inline-content {
    padding: 1.25rem 1rem;
  }
}

/* ==========================================================================
   Onboarding Wizard Step Indicators
   ========================================================================== */
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wizard-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  transition: background 0.2s, color 0.2s;
}

.wizard-step-number.active {
  background: var(--loot-gold, #bd9a00);
  color: #000;
}

.wizard-step-number.completed {
  background: #198754;
  color: #fff;
}

.wizard-step-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}

.wizard-step-label.active {
  color: var(--loot-gold, #bd9a00);
  font-weight: 600;
}

.wizard-step-label.completed {
  color: #198754;
}

.wizard-step-line {
  flex: 1;
  height: 2px;
  min-width: 40px;
  max-width: 80px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 8px;
  align-self: center;
  margin-bottom: 18px;
}

/* Onboarding wizard mobile */
@media (max-width: 768px) {
  #onboardingWizardModal .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  #onboardingWizardModal .modal-body {
    padding: 0.75rem;
  }

  #wizard-step-3 .row .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #wizard-step-3 .row .col-6 .p-3 {
    padding: 0.75rem !important;
  }

  .wizard-step-number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .wizard-step-line {
    min-width: 24px;
    max-width: 50px;
  }

  #wizard-theme-grid {
    max-height: 150px;
    overflow-y: auto;
  }
}

/* ==========================================================================
   Mobile Optimization — Comprehensive
   Appended rules; existing desktop styles are NOT modified.
   ========================================================================== */

/* ---------- 1. Base mobile rules (no breakpoint) ---------- */
body.index {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- 2. Portrait Tablet (769px – 1024px) ---------- */
@media (max-width: 1024px) and (min-width: 769px) {
  #campaign-title-header {
    font-size: 2rem;
  }

  .main-content {
    padding: 1rem;
  }

  #fundSearch,
  #itemSearch {
    max-width: 180px !important;
  }

  .overall-funds {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .overall-funds .fund {
    width: auto;
  }

  body.index .item-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .modal-lg,
  .modal-xl {
    max-width: 90%;
  }

  .dash-stat-value {
    font-size: 1.4rem;
  }

  .dash-stat-label {
    font-size: 0.7rem;
  }
}

/* ---------- 3. Mobile (max-width: 768px) — New Rules ---------- */
@media (max-width: 768px) {
  /* 3a. iOS zoom prevention — force 16px on all form inputs */
  body.index input[type="text"],
  body.index input[type="search"],
  body.index input[type="email"],
  body.index input[type="password"],
  body.index input[type="number"],
  body.index input[type="tel"],
  body.index input[type="url"],
  body.index input[type="date"],
  body.index textarea,
  body.index select,
  body.index .form-control,
  body.index .form-select {
    font-size: 16px !important;
  }

  /* 3b. Toolbar restructure */
  #fundSearch,
  #itemSearch {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100%;
    order: -1;
  }

  .view-toggle .btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 3c. Touch targets — 44px minimum (WCAG 2.5.8) */
  body.index .btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Action buttons inside table cards — 44px touch target */
  body.index .table tbody td .btn,
  body.index .table tbody td .btn-sm {
    min-height: 44px;
    min-width: 44px;
  }

  #settings-icon {
    width: 44px !important;
    height: 44px !important;
  }

  .sidebar-link {
    min-height: 44px;
  }

  #fundsPagination .btn,
  #itemsPagination .btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.index .form-check-input {
    width: 1.25em;
    height: 1.25em;
  }

  body.index .form-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* 3d. Modals → full-screen sheets */
  body.index .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
  }

  body.index .modal-content {
    border-radius: 0;
    min-height: 100dvh;
  }

  body.index .modal-header {
    padding: 0.75rem 1rem;
  }

  body.index .modal-body {
    padding: 0.75rem 1rem;
  }

  body.index .modal-footer {
    padding: 0.5rem 1rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  #srdSearchResults,
  #merchantSrdResults {
    max-height: 40vh !important;
  }

  /* 3e. Filter panel overflow fix */
  .item-filter-panel {
    min-width: unset !important;
    width: calc(100vw - 2rem);
    max-width: 320px;
    right: 0;
  }

  /* 3f. Session detail tables → card layout */
  .session-detail-table thead {
    display: none;
  }

  .session-detail-table,
  .session-detail-table tbody {
    display: block;
    width: 100%;
  }

  .session-detail-table tbody tr {
    display: block;
    background: rgba(20, 16, 6, 0.7);
    border: 1px solid rgba(var(--loot-gold-rgb), 0.15);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
  }

  .session-detail-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border: none;
    font-size: 0.85rem;
  }

  .session-detail-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--loot-gold, #bd9a00);
    flex-shrink: 0;
    margin-right: 0.75rem;
  }

  /* 3g. Safe area insets (iPhone notch / home indicator) */
  #campaign-title {
    padding-left: max(0.5rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.5rem, env(safe-area-inset-right)) !important;
  }

  #footer-container .footer {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
}

/* ---------- 4. Extra-small (max-width: 480px) ---------- */
@media (max-width: 480px) {
  #fundSearch,
  #itemSearch {
    max-width: 100% !important;
  }

  body.index .btn-primary[data-bs-toggle="modal"],
  body.index [id$="AddBtn"] {
    flex: 1 1 auto;
  }

  body.index .modal-body {
    padding: 0.75rem;
  }

  #srdSearchResults,
  #merchantSrdResults {
    max-height: 35vh !important;
  }

  .item-filter-panel {
    width: calc(100vw - 1rem);
    max-width: 100%;
  }
}

/* ---------- 5. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.index *,
  body.index *::before,
  body.index *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  /* Remove hover transforms */
  body.index .btn:hover,
  body.index .dashboard-link:hover,
  body.index .dash-stat-card:hover,
  body.index .sidebar-link:hover i {
    transform: none !important;
  }

  /* Disable fairy light glow animations */
  body.index:not(.custom-theme)::before,
  body.index:not(.custom-theme)::after {
    animation: none !important;
  }
}

/* ===== DDB Import Modal ===== */
#ddbImportModal .modal-body .form-control,
#ddbImportModal .modal-body .form-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(var(--loot-gold-rgb), 0.2);
  color: #f0f0f0;
}

#ddbImportModal .modal-body .form-control:focus,
#ddbImportModal .modal-body .form-select:focus {
  border-color: var(--loot-gold);
  box-shadow: 0 0 0 0.15rem rgba(var(--loot-gold-rgb), 0.25);
}

#ddbPreviewState .form-label {
  color: rgba(var(--loot-gold-rgb), 0.7);
}

#ddbPreviewDesc {
  font-size: 0.85rem;
  line-height: 1.5;
}
