/* PWA Main Stylesheet */
:root {
  --bg-color: #0A090E;
  --bg-alt: #0A0C10;
  --bg-card: #010101;
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  
  /* Ambient Terracotta/Warm grey accent shadows */
  --ambient-shadow: rgba(0, 0, 0, 0.4);
  --ambient-hover: rgba(255, 255, 255, 0.04);
  --grid-color: rgba(255, 255, 255, 0.015);
  --border-color: #334155;
  
  /* HSL Color Palette */
  --accent-pink: hsl(345, 80%, 60%);
  --accent-orange: hsl(25, 90%, 55%);
  --accent-mint: hsl(150, 70%, 55%);
  --accent-purple: hsl(270, 80%, 65%);
  --accent-yellow: hsl(45, 95%, 55%);
  --accent-blue: hsl(220, 85%, 60%);
  --accent-teal: hsl(180, 80%, 50%);
  --accent-red: hsl(0, 85%, 60%);
  --accent-indigo: hsl(255, 85%, 65%);

  /* Pipeline specific accent variables */
  --receipts-accent: var(--accent-pink);
  --income-accent: var(--accent-mint);
  --mileage-accent: var(--accent-teal);
  --triage-accent: var(--accent-red);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
  
  /* Viewport virtual offset */
  --view-offset: 100; /* in % (0 for Settings, 100 for Ingestion center deck, 200 for Workbook) */
}

/* Light Theme: Nordic Fog and Aurora Glass Specification */
:root[data-theme="light"] {
  --bg-color: #D4DCE8; /* Base Workspace Canvas - Misty Steel Blue Tint */
  --bg-alt: #C3CBD9;
  --bg-card: rgba(255, 255, 255, 0.75); /* Frosted Structural Containers */
  --text-main: #0F172A; /* Primary Text Layer - High contrast deep slate */
  --text-muted: #64748B; /* Muted Secondary Labels - Slate grey */
  
  /* Ambient Lighting Accents */
  --ambient-shadow: rgba(15, 23, 42, 0.04);
  --ambient-hover: rgba(15, 23, 42, 0.05);
  --grid-color: rgba(15, 23, 42, 0.03);
  --border-color: rgba(15, 23, 42, 0.07);

  /* Pipeline Highlight Adaptation: Vibrant modern light mode accents */
  --receipts-accent: #E11D48; /* Rose crimson */
  --income-accent: #0D9488;   /* Mint emerald */
  --mileage-accent: #2563EB;  /* Ocean blue */
  --triage-accent: #7C3AED;   /* Royal violet */

  /* Overwrite HSL Accent values inside light mode so legacy inline styles map cleanly */
  --accent-pink: #E11D48;
  --accent-mint: #0D9488;
  --accent-teal: #2563EB;
  --accent-red: #EF4444;
}

/* Base Optimization for mobile PWA */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow: hidden; /* Lock scroll strictly to sub-containers to enable virtualization */
  position: relative;
  width: 100vw;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation; /* Disable double-tap zoom */
}

/* Background grid fallback */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: linear-gradient(var(--grid-color, rgba(255, 255, 255, 0.015)) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-color, rgba(255, 255, 255, 0.015)) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

/* Canvas layers */
#node-canvas-bg,
#node-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#node-canvas-bg {
  z-index: 0;
  filter: blur(4px);
  opacity: 0.25;
}

#node-canvas {
  z-index: 1;
  opacity: 0.4;
}

/* Horizontal Viewport Transform Engine (The Wrapper) */
.viewport-wrapper {
  display: flex;
  width: 200vw;
  height: 100vh;
  will-change: transform;
  /* Hardware accelerated transform with elastic snap profile */
  transform: translate3d(calc(var(--view-offset) * -1vw), 0, 0);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  z-index: 10;
}

/* Pane definitions */
.pane-view {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 90px; /* Safe padding for bottom navigation tab bar */
  -webkit-overflow-scrolling: touch; /* Elastic momentum scroll on iOS */
  position: relative;
}

.pane-container {
  max-width: 1450px;
  margin: 0 auto;
  padding: 0 20px 30px 20px; /* 0px top padding to lock header flush to viewport edge */
}

/* Sidebar / Pane headers */
.pane-header {
  margin-bottom: 25px;
}

.pane-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pane-title i {
  width: 24px;
  height: 24px;
}

.pane-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Bottom Navigation Tab Bar (Ensures standard mobile switching) */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 80px; /* Scaled up from 75px to 80px (~7% larger) for fat fingers */
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center; /* Centered layout with generous physical spacing */
  gap: 85px; /* Generous gap to completely eliminate fat-finger overlap */
  align-items: center;
  z-index: 100;
  padding: 0 20px;
}

.nav-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none; /* Changed from 1 to protect against overlap in the center */
  width: 75px; /* Fixed high-accuracy touch target width */
  height: 100%;
  transition: var(--transition-fast);
  position: relative;
  font-family: var(--font-sans);
}

.nav-tab-btn span {
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

/* Active navigation state */
.nav-tab-btn.active {
  color: var(--text-main);
}

/* Premium Dynamic Navigation Orb Container */
.nav-btn-orb {
  width: 38.5px; /* Scaled up by 5% from 36.5px to 38.5px */
  height: 38.5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  margin-bottom: 2px;
}

.nav-btn-orb i,
.nav-btn-orb svg {
  width: 22px !important; /* Scaled up by ~7% from 20.5px to 22px */
  height: 22px !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
  color: var(--text-muted);
  display: block;
}

/* Inactive button hover effects */
.nav-tab-btn:not(.active):hover .nav-btn-orb i,
.nav-tab-btn:not(.active):hover .nav-btn-orb svg {
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Active State: Workbook (Mint/Teal Orb) */
.nav-tab-btn.active#tab-btn-center .nav-btn-orb {
  width: 57px; /* Scaled up by ~5% from 54px to 57px */
  height: 57px;
  background: radial-gradient(circle at 30% 30%, var(--accent-teal), #0f766e);
  border-color: var(--accent-teal);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-top: -28px; /* Slightly adjusted for taller bar */
}

.nav-tab-btn.active#tab-btn-center .nav-btn-orb i,
.nav-tab-btn.active#tab-btn-center .nav-btn-orb svg {
  color: #0b1120 !important;
  transform: scale(1.1);
}

/* Active State: Settings (Compliance-Blue Orb) */
.nav-tab-btn.active#tab-btn-left .nav-btn-orb {
  width: 57px; /* Scaled up by ~5% from 54px to 57px */
  height: 57px;
  background: radial-gradient(circle at 30% 30%, #2F80ED, #1d4ed8);
  border-color: #2F80ED;
  box-shadow: 0 0 15px rgba(47, 128, 237, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-top: -28px; /* Slightly adjusted for taller bar */
}

.nav-tab-btn.active#tab-btn-left .nav-btn-orb i,
.nav-tab-btn.active#tab-btn-left .nav-btn-orb svg {
  color: #0b1120 !important;
  transform: scale(1.1);
}

/* Premium Solid/Opaque Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color, #334155);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 30px -10px var(--ambient-shadow);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.card-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  line-height: 1.4;
}

.sticky-header-deck {
  position: sticky;
  top: 0;
  background: var(--bg-color) !important;
  z-index: 10000;
  padding-top: 30px; /* Stationary header top breathing room */
  margin-top: 0;
}

/* Ingestion Deck Center Pane styling */
.app-navbar {
  display: flex;
  justify-content: center; /* Centered brand logo */
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 15px;
  margin-bottom: 25px;
  position: relative;
}

.theme-switch-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateY(-7.5px); /* Subtract 7.5px to align with bottom padding shift */
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.theme-switch-btn:hover {
  color: var(--text-main);
  background: var(--ambient-hover);
}

.theme-switch-btn i,
.theme-switch-btn svg {
  width: 18px;
  height: 18px;
}

.brand-logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--text-main);
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub-text {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-mint);
  animation: pulse-ring 2s infinite;
}

.status-text {
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.hero-block {
  margin-bottom: 25px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 650px;
  line-height: 1.4;
}

/* Brand Block and Landing Intro Animations */
.brand-block img {
  visibility: hidden; /* Start hidden to allow dynamic clone intro animation */
}

/* Relocated Center Content Fade-in container */
#pane-center-content {
  will-change: opacity;
}

#pane-center-content .intro-fade-element {
  opacity: 0;
  transition: opacity 0.4s ease-out;
  will-change: opacity;
}

#pane-center-content.intro-visible .intro-fade-element {
  opacity: 1;
}

#ledger-sections-container {
  margin-top: 24px;
  padding-bottom: 120px; /* Safe padding for bottom navigation */
}

#ledger-sections-container::-webkit-scrollbar {
  width: 6px;
}
#ledger-sections-container::-webkit-scrollbar-track {
  background: transparent;
}
#ledger-sections-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
#ledger-sections-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Floating Collapsible Sidebar Dock */
.sidebar-dock {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0; /* Protrudes over bottom section to maximize vertical space since bottom buttons are blurred anyway */
  width: 110px; /* Wider menubar! */
  background: rgba(10, 17, 30, 0.65);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Center the icons stack vertically! */
  padding: 15px 0;
  z-index: 990;
  
  /* Initial off-screen closed state */
  transform: translateX(110px); /* Shifted to 110px to match width */
  opacity: 1; /* Keep visible so the toggle handle sticks out! */
  will-change: transform;
}

/* Apple spring-in bounce animation */
.sidebar-dock.spring-in {
  animation: spring-in 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Anticipatory wind-up and shoot-off close animation */
.sidebar-dock.windup-out {
  animation: windup-out 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Sidebar Open State (for manual toggle) */
.sidebar-dock.open {
  transform: translateX(0) !important;
  opacity: 1 !important;
}

/* Settings View lock - completely restrict access, hide handle, and force offscreen */
.sidebar-dock.settings-active {
  transform: translateX(110px) !important;
  pointer-events: none !important;
}

.sidebar-dock.settings-active .sidebar-toggle-handle {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Spring-in bounce keyframes */
@keyframes spring-in {
  0% {
    transform: translateX(110px);
  }
  60% {
    transform: translateX(-12px); /* Springs past 0 to the left! */
  }
  80% {
    transform: translateX(3px); /* Soft rebound right */
  }
  100% {
    transform: translateX(0);
  }
}

/* Anticipatory windup-out keyframes */
@keyframes windup-out {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-15px); /* Winding up slightly to the left! */
  }
  100% {
    transform: translateX(110px); /* Shooting rapidly offscreen right */
  }
}

/* Floating Swipe Hint Indicator */
.sidebar-swipe-hint {
  position: fixed;
  right: 0px; /* Shifted right by 10px (flush with screen edge) */
  bottom: calc(50% + 70px); /* Shifted up by 20px */
  z-index: 980;
  background: rgba(10, 17, 30, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  transform-origin: right bottom; /* Expand gracefully from above the pull-tab */
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Custom pop-in bounce animation */
.sidebar-swipe-hint.hint-pop {
  animation: hint-lifecycle 2.0s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sidebar-swipe-hint.hint-hidden {
  opacity: 0 !important;
  transform: scale(0) !important;
  pointer-events: none;
}

.sidebar-swipe-hint .hint-chevron {
  width: 12px;
  height: 12px;
  stroke: var(--accent-mint);
  animation: hint-arrow-pulse 1.25s infinite ease-in-out;
}

@keyframes hint-lifecycle {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  15% {
    opacity: 1;
    transform: scale(2.0); /* Zooms up to 2x size over 0.3s */
  }
  25% {
    opacity: 1;
    transform: scale(1.0); /* Settles to normal size over 0.2s */
  }
  75% {
    opacity: 1;
    transform: scale(1.0); /* Stays at full size for 1.0 seconds */
  }
  100% {
    opacity: 0;
    transform: scale(0); /* Zooms out to disappear over 0.5 seconds */
  }
}

@keyframes hint-arrow-pulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.6;
  }
  50% {
    transform: translateX(-3px);
    opacity: 1;
  }
}

/* Slim Vertical Pull-Tab Handle */
.sidebar-toggle-handle {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 80px;
  background: rgba(10, 17, 30, 0.65);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  outline: none;
  
  /* Start hidden at page load, show on first slide-in */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out, color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

/* Make toggle handle visible once sidebar is active */
.sidebar-dock.handle-active .sidebar-toggle-handle {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-toggle-handle:hover {
  color: var(--text-main);
  background: rgba(15, 25, 45, 0.85);
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar-toggle-handle i {
  width: 14px;
  height: 14px;
  transition: transform 0.4s ease;
}

.sidebar-title-container {
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  text-align: center;
}

.sidebar-dock-title {
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.sidebar-items-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around; /* Space items out elegantly to fit 95% of vertical space */
  width: 100%;
  height: 95%; /* occupy exactly 95% of vertical viewport height */
  overflow: hidden; /* Prevent overflow scrolls */
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  text-align: center;
}

.sidebar-icon-wrapper {
  width: 48px !important; /* Force a luxurious large 48px icon wrapper size on all standard viewports */
  height: 48px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-icon-wrapper i,
.sidebar-icon-wrapper svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  filter: drop-shadow(0 2px 8px var(--glow-shadow, rgba(255, 255, 255, 0.05)));
  transition: transform 0.3s ease;
}

.sidebar-label {
  font-size: 0.74rem; /* Scaled up text label to beautifully align with larger 48px icons */
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 5px;
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

/* Only scale down on extremely short screens to prevent vertical overflow */
@media (max-height: 480px) {
  .sidebar-icon-wrapper {
    width: 32px !important;
    height: 32px !important;
  }
  .sidebar-label {
    display: none; /* Hide label entirely on extremely short screens to conserve vertical height */
  }
}

/* Hover, Active, and Focus States on Sidebar Item */
.sidebar-item:hover .sidebar-icon-wrapper {
  transform: scale(1.15); /* Sleek micro-zoom directly on the transparent icon */
}

.sidebar-item:hover .sidebar-label {
  color: var(--text-main);
}

.sidebar-item:active .sidebar-icon-wrapper {
  transform: scale(0.92);
}




/* Symmetrical Ingestion tactile grid (2x4 on mobile, 4x2 on desktop) */
.ingest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.ingest-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.9rem 0.5rem; /* More compact on mobile viewports */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  outline: none;
  aspect-ratio: 1 / 1; /* Make buttons perfectly square like the images! */
}

/* Soft glow backing */
.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, var(--accent-color) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.ingest-card:hover .card-glow,
.ingest-card:focus .card-glow {
  opacity: 0.035; /* Subtle yet clearly luminous backing for a high-end luxury feel */
}

/* Subtle, premium outline and shadow matching the website's tech stack item */
.ingest-card:hover,
.ingest-card:focus {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glow-border, rgba(255, 255, 255, 0.08));
  box-shadow: 0 8px 24px var(--glow-shadow, rgba(255, 255, 255, 0.03));
  transform: translateY(-1.5px);
}

.ingest-card:active {
  transform: scale(0.97);
}

.card-icon-container {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px; /* Squeezed for mobile viewports */
  color: var(--accent-color);
  transition: var(--transition-smooth);
  z-index: 1;
}

.ingest-card:hover .card-icon-container {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glow-border, rgba(255, 255, 255, 0.12));
}

.card-icon-container i {
  width: 26px;
  height: 26px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-main);
  margin-bottom: 2px;
  z-index: 1;
}

.card-meta {
  display: none; /* Hidden on mobile to keep grid compact within viewport */
  font-size: 0.65rem;
  color: var(--text-muted);
  z-index: 1;
}

/* Blur background when workspace overlay is active */
body:has(#workspace-overlay.active) #viewport-wrapper {
  filter: blur(10px) brightness(0.7);
  transform: translate3d(calc(var(--view-offset) * -1vw), 0, 0) scale(0.97);
  pointer-events: none;
}
#viewport-wrapper {
  transition: filter 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==================== PREMIUM WORKSPACE OVERLAY PANEL ==================== */
.workspace-overlay {
  position: fixed; /* Locked relative to the viewport, stationary */
  top: 60px; /* Locked below the status bar / navbar area */
  left: 3%;
  width: 94%; /* Wider profile on mobile screen sizes */
  bottom: 12px; /* stretched right to the bottom of the screen */
  height: auto;
  max-height: calc(100vh - 85px); /* Height locked to viewport dimensions */
  transform: scale(0.05); /* Tiny closed state default */
  transform-origin: center center;
  overflow: hidden; /* Prevent horizontal stretching/overflow */
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top: 4px solid var(--panel-accent, var(--accent-pink));
  border-radius: 14px;
  z-index: 1000; /* Stays on top of everything, including bottom nav and sidebar */
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  /* Smooth back-out elastic transition mimicking OS X Genie bounce! */
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, visibility 0.4s;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75), 
              inset 0 0 40px rgba(255, 255, 255, 0.03), 
              0 0 50px var(--panel-accent-glow, rgba(255, 255, 255, 0.15));
}

.workspace-overlay.active {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

/* Colored Top Accent Bar */
.overlay-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--panel-accent, var(--accent-pink));
  box-shadow: 0 2px 10px var(--panel-accent, var(--accent-pink));
  display: none; /* Handled directly by overlay border-top! */
}

.overlay-glow-radial {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top center, var(--panel-accent-glow, rgba(255, 46, 147, 0.12)) 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.overlay-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
}

.overlay-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--panel-accent, var(--accent-pink));
  transform: rotate(90deg);
}

.overlay-close-btn i {
  width: 16px;
  height: 16px;
}

.overlay-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Allow scrolling when contents exceed panel max-height */
  overflow-x: hidden;
  scrollbar-width: none; /* Hide default Firefox scrollbar */
}
.overlay-content::-webkit-scrollbar {
  display: none; /* Hide default webkit scrollbars for premium look */
}

/* Stretch wizard containers and their glass-form-cards to the bottom */
#receipt-wizard-container,
#invoice-wizard-container,
#donation-wizard-container,
#w9-wizard-container,
#coi-wizard-container,
#utility-wizard-container,
#mileage-wizard-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#receipt-wizard-container .glass-form-card,
#invoice-wizard-container .glass-form-card,
#donation-wizard-container .glass-form-card,
#w9-wizard-container .glass-form-card,
#coi-wizard-container .glass-form-card,
#utility-wizard-container .glass-form-card,
#mileage-wizard-container .glass-form-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Custom Scrollbar for floating panel */
.overlay-content::-webkit-scrollbar {
  width: 6px;
}
.overlay-content::-webkit-scrollbar-track {
  background: transparent;
}
.overlay-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.overlay-content::-webkit-scrollbar-thumb:hover {
  background: var(--panel-accent, rgba(255, 255, 255, 0.2));
}


.overlay-header {
  margin-top: 10px;
  margin-bottom: 25px;
  text-align: center;
}

.overlay-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.overlay-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.overlay-layout-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
}

/* Ingest Drop zone styles */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.drop-zone-idle,
.drop-zone-loading {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  gap: 8px;
}

.drop-zone.dragover {
  border-color: var(--panel-accent, var(--accent-pink));
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 0 20px var(--panel-accent-glow, rgba(255, 46, 147, 0.12));
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: var(--panel-accent, var(--accent-pink));
  opacity: 0.7;
  margin-bottom: 15px;
  transition: transform 0.3s ease;
}

.drop-zone:hover .drop-icon {
  transform: translateY(-4px) scale(1.05);
  opacity: 1;
}

.drop-text-primary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drop-text-secondary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Spinner OCR loading animations */
.ocr-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--panel-accent, var(--accent-pink));
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  margin: 0 auto 15px auto;
  box-shadow: 0 0 10px var(--panel-accent-glow, rgba(255, 46, 147, 0.15));
}

.loading-text-primary {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-bottom: 4px;
}

.loading-text-secondary {
  font-size: 0.75rem;
  color: var(--panel-accent, var(--accent-pink));
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Form input elements */
.glass-form-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.form-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-title i {
  width: 18px;
  height: 18px;
  color: var(--panel-accent, var(--accent-pink));
}

.form-instructions {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  text-align: left;
}

.input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glass-input {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-sans);
  transition: var(--transition-fast);
  width: 100%;
}

.glass-input:focus {
  border-color: var(--panel-accent, var(--accent-pink));
  background: rgba(11, 17, 32, 0.8);
  box-shadow: 0 0 10px var(--panel-accent-glow, rgba(255, 46, 147, 0.1));
}

.glass-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.glass-input-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.form-placeholder-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.placeholder-icon {
  width: 36px;
  height: 36px;
  opacity: 0.3;
  margin-bottom: 10px;
}

.form-placeholder-state p {
  font-size: 0.85rem;
  max-width: 250px;
  line-height: 1.4;
}

/* Button UI systems */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
  border: none;
  outline: none;
}

.cta-button i {
  width: 15px;
  height: 15px;
}

.primary-btn {
  background-color: var(--panel-accent, var(--accent-teal));
  color: #0b1120;
  box-shadow: 0 4px 15px var(--panel-accent-glow, rgba(0, 255, 255, 0.2));
}

.primary-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px var(--panel-accent-glow, rgba(0, 255, 255, 0.3));
}

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

.secondary-btn {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--panel-accent, var(--accent-pink));
}

.glass-btn {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-btn:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

/* ==================== WORKBOOK PANE ==================== */
.flex-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-actions {
  width: 100%;
}

.header-actions button {
  width: 100%;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ledger-table-wrapper {
  overflow-x: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.ledger-table th {
  background: rgba(15, 23, 42, 0.3);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.ledger-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 600 !important;
}

.ledger-table tbody tr {
  transition: var(--transition-fast);
}

.ledger-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.ledger-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.005);
}

.text-right {
  text-align: right;
}

.text-mono {
  font-family: var(--font-mono) !important;
  letter-spacing: -0.01em;
}

.ledger-val {
  font-weight: 500;
}

.val-positive {
  color: var(--accent-mint);
}

.val-negative {
  color: #ff5e9c;
}

/* Badge variants */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
}

.badge-verified {
  background-color: rgba(198, 255, 0, 0.06);
  color: var(--accent-mint);
  border: 1px solid rgba(198, 255, 0, 0.15);
}

.badge-pending {
  background-color: rgba(255, 138, 0, 0.06);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 138, 0, 0.15);
}

.badge-action {
  background-color: rgba(255, 46, 46, 0.06);
  color: var(--accent-red);
  border: 1px solid rgba(255, 46, 46, 0.15);
}

.ledger-loading-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* Modal Dialog Popups */
.modal-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  max-width: 440px;
  width: 100%;
}

.modal-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.export-options {
  background: rgba(11, 17, 32, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 15px;
}

.export-opt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.export-opt-label input {
  accent-color: var(--accent-teal);
}

/* SVG Line System for Dynamic curves */
.workflow-line-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.workflow-line-svg.active {
  opacity: 1;
}

#workflow-bezier-path {
  fill: none;
  stroke: var(--panel-accent, var(--accent-pink));
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
  animation: line-dash-flow 15s linear infinite;
  filter: drop-shadow(0 0 4px var(--panel-accent, var(--accent-pink)));
}

/* Settings view Specifics */
.grid-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.tenant-badge {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-teal);
  margin-bottom: 15px;
}

.tenant-badge i {
  width: 14px;
  height: 14px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 550;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent-indigo), var(--accent-teal));
  border-radius: 10px;
}

.radio-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.radio-label input {
  accent-color: var(--accent-teal);
}

/* Color styles */
.accent-indigo { color: var(--accent-indigo); }
.accent-mint { color: var(--accent-mint); }
.text-green { color: var(--accent-mint); }
.text-mono { font-family: var(--font-mono); }

/* Custom utility icons scaling */
.icon-sm {
  width: 16px !important;
  height: 16px !important;
}

/* General keyframe animations */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 229, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
  }
}

@keyframes spinner-ring {
  to {
    transform: rotate(360deg);
  }
}

@keyframes line-dash-flow {
  to {
    stroke-dashoffset: -100px;
  }
}

/* ==================== RESPONSIVE LAYOUT SCALING (TABLET & DESKTOP) ==================== */
@media (min-width: 600px) {
  .ingest-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-two-col {
    grid-template-columns: 1fr 1fr;
  }
  .radio-group {
    flex-direction: row;
  }
  .flex-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .header-actions {
    width: auto;
  }
  .header-actions button {
    width: auto;
  }
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  body {
    background-size: 50px 50px;
  }
  
  /* Centered layout by default (strictly app-driven, no marketing copy) */
  .deck-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    transition: var(--transition-smooth);
    position: relative;
    width: 100%;
    max-width: 980px; /* Slightly wider than the 920px grid to form a perfect outer frame! */
    margin: 0 auto;
    padding: 30px 24px; /* More generous framing padding */
  }

  .ingest-grid {
    grid-template-columns: repeat(4, 1fr) !important; /* Perfect centered 4x2 matrix! */
    gap: 24px !important;
    max-width: 920px;
    width: 100%;
    transition: var(--transition-smooth);
    margin-bottom: 0;
  }

  /* Make buttons nice and LARGE on desktop/laptop! */
  .ingest-card {
    padding: 2.8rem 1.8rem !important;
    border-radius: 14px;
  }

  .card-icon-container {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .card-icon-container i {
    width: 32px;
    height: 32px;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-meta {
    display: block !important; /* Visible on desktop screens */
    font-size: 0.75rem;
    margin-top: 2px;
  }

  /* Centered overlay floating card on desktop/laptop */
  .workspace-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.05); /* Centered but tiny initially */
    transform-origin: center center;
    width: 90%;
    max-width: 460px; /* Restored back to the original width */
    height: auto;
    min-height: 690px; /* Increased height by 70px to completely clear the vertical space */
    max-height: 95vh;
    margin: 0;
  }

  .workspace-overlay.active {
    transform: translate(-50%, -50%) scale(1);
    overflow: hidden !important;
  }

  /* Form and actions scrollable layout in compact overlay */
  .overlay-layout-split {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .drop-zone {
    min-height: 155px; /* Compact drop zone */
    padding: 20px;
  }

  .glass-form-card {
    padding: 15px;
  }

  .pane-container {
    padding: 0 30px 50px 30px;
  }

  .sticky-header-deck {
    padding-top: 50px;
  }

  .bottom-nav-bar {
    width: 390px; /* Scaled up from 360px to 390px to accommodate larger icons and padding */
    left: 50%;
    transform: translateX(-50%);
    border-radius: 40px;
    bottom: 20px;
    height: 70px; /* Scaled up from 65px to 70px (~8% larger) */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    gap: 75px; /* Generous physical button gap */
    padding: 0;
  }

  .nav-tab-btn.active .nav-btn-orb {
    margin-top: -24px; /* Adjusted for 70px height bar */
  }
}

/* ==================== MOBILE PORTRAIT FINE-TUNING (Width < 900px) ==================== */
@media (max-width: 899px) {
  .pane-container {
    padding: 0 12px 20px 12px !important; /* Slim side padding to let cards grow physically wider and larger by another ~2.5% */
  }

  .sticky-header-deck {
    padding-top: 20px;
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100vw !important;
    background-color: var(--bg-color) !important;
    background-image: 
      linear-gradient(var(--grid-color, rgba(255, 255, 255, 0.015)) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-color, rgba(255, 255, 255, 0.015)) 1px, transparent 1px) !important;
    background-size: 40px 40px, 40px 40px !important;
    background-attachment: fixed !important;
  }

  .deck-layout {
    padding: 24px 12px !important; /* Generous tray padding matching the reference photo */
    margin: 15px 0 !important;
  }

  .ingest-grid {
    gap: 20px !important; /* Spaced out card layout matching the reference photo exactly! */
  }

  .ingest-card {
    padding: 1.08rem 0.62rem !important; /* Visual padding balance adjustment */
    border-radius: 10.5px !important;
    aspect-ratio: 1 / 1 !important; /* Perfect squares so they become taller and fill the screen vertical space! */
  }

  .card-icon-container {
    width: 52px !important; /* Scale up by another 4px */
    height: 52px !important;
    margin-bottom: 7px !important;
  }

  .card-icon-container i {
    width: 29.5px !important; /* Scale up icon size by another 4px */
    height: 29.5px !important;
  }

  .card-title {
    font-size: 1.02rem !important; /* Scale up font size */
  }

  .workspace-overlay {
    top: 30px !important; /* Brought top up to the top of "Senes" word */
    left: 2% !important; /* A little bit wider (was left: 3%) */
    width: 96% !important; /* A little bit wider (was width: 94%) */
    bottom: 40px !important; /* set exactly to 40px as requested */
    height: auto !important;
    max-height: calc(100vh - 75px) !important;
    padding: 1.2rem 1rem 1rem 1rem !important; /* adjusted padding to prevent cutoff */
  }

  /* ==================== PORTRAIT MOBILE DYNAMIC TABLE SCALING & COLUMN LOOKUPS ==================== */
  #ledger-sections-container td,
  #ledger-sections-container th {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  /* Clients Table Mobile Columns */
  #clients-table > thead > tr > th:nth-child(3),
  #clients-table tr.main-row td:nth-child(3) {
    display: none !important;
  }

  /* Receipts (Expense) Table Mobile Columns */
  #expense_ledger-table > thead > tr > th:nth-child(1), #expense_ledger-table tr.main-row td:nth-child(1),
  #expense_ledger-table > thead > tr > th:nth-child(2), #expense_ledger-table tr.main-row td:nth-child(2),
  #expense_ledger-table > thead > tr > th:nth-child(6), #expense_ledger-table tr.main-row td:nth-child(6),
  #expense_ledger-table > thead > tr > th:nth-child(7), #expense_ledger-table tr.main-row td:nth-child(7),
  #expense_ledger-table > thead > tr > th:nth-child(8), #expense_ledger-table tr.main-row td:nth-child(8),
  #expense_ledger-table > thead > tr > th:nth-child(9), #expense_ledger-table tr.main-row td:nth-child(9),
  #expense_ledger-table > thead > tr > th:nth-child(10), #expense_ledger-table tr.main-row td:nth-child(10) {
    display: none !important;
  }

  @media (orientation: landscape) {
    #expense_ledger-table > thead > tr > th:nth-child(6),
    #expense_ledger-table tr.main-row td:nth-child(6) {
      display: table-cell !important;
    }
    .sticky-header-deck {
      position: static !important;
    }
    .bottom-nav-bar {
      display: none !important;
    }
    .pane-view {
      padding-bottom: 20px !important;
    }
    #ledger-sections-container {
      padding-bottom: 20px !important;
    }
  }

  /* Invoices (Income) Table Mobile Columns */
  #income_ledger-table > thead > tr > th:nth-child(1), #income_ledger-table tr.main-row td:nth-child(1),
  #income_ledger-table > thead > tr > th:nth-child(2), #income_ledger-table tr.main-row td:nth-child(2),
  #income_ledger-table > thead > tr > th:nth-child(6), #income_ledger-table tr.main-row td:nth-child(6),
  #income_ledger-table > thead > tr > th:nth-child(7), #income_ledger-table tr.main-row td:nth-child(7),
  #income_ledger-table > thead > tr > th:nth-child(8), #income_ledger-table tr.main-row td:nth-child(8) {
    display: none !important;
  }

  /* Donations Table Mobile Columns */
  #donation_ledger-table > thead > tr > th:nth-child(1), #donation_ledger-table tr.main-row td:nth-child(1),
  #donation_ledger-table > thead > tr > th:nth-child(2), #donation_ledger-table tr.main-row td:nth-child(2),
  #donation_ledger-table > thead > tr > th:nth-child(6), #donation_ledger-table tr.main-row td:nth-child(6),
  #donation_ledger-table > thead > tr > th:nth-child(7), #donation_ledger-table tr.main-row td:nth-child(7),
  #donation_ledger-table > thead > tr > th:nth-child(8), #donation_ledger-table tr.main-row td:nth-child(8) {
    display: none !important;
  }

  /* Utilities Table Mobile Columns */
  #utility_ledger-table > thead > tr > th:nth-child(1), #utility_ledger-table tr.main-row td:nth-child(1),
  #utility_ledger-table > thead > tr > th:nth-child(2), #utility_ledger-table tr.main-row td:nth-child(2),
  #utility_ledger-table > thead > tr > th:nth-child(4), #utility_ledger-table tr.main-row td:nth-child(4),
  #utility_ledger-table > thead > tr > th:nth-child(5), #utility_ledger-table tr.main-row td:nth-child(5) {
    display: none !important;
  }

  /* Vendor W9s Table Mobile Columns */
  #vendor_ledger-table > thead > tr > th:nth-child(1), #vendor_ledger-table tr.main-row td:nth-child(1),
  #vendor_ledger-table > thead > tr > th:nth-child(2), #vendor_ledger-table tr.main-row td:nth-child(2),
  #vendor_ledger-table > thead > tr > th:nth-child(4), #vendor_ledger-table tr.main-row td:nth-child(4),
  #vendor_ledger-table > thead > tr > th:nth-child(6), #vendor_ledger-table tr.main-row td:nth-child(6) {
    display: none !important;
  }

  /* Compliance Table Mobile Columns */
  #compliance_ledger-table > thead > tr > th:nth-child(1), #compliance_ledger-table tr.main-row td:nth-child(1),
  #compliance_ledger-table > thead > tr > th:nth-child(2), #compliance_ledger-table tr.main-row td:nth-child(2),
  #compliance_ledger-table > thead > tr > th:nth-child(4), #compliance_ledger-table tr.main-row td:nth-child(4),
  #compliance_ledger-table > thead > tr > th:nth-child(5), #compliance_ledger-table tr.main-row td:nth-child(5) {
    display: none !important;
  }

  /* Audit Trail Table Mobile Columns */
  #audit_trail-table > thead > tr > th:nth-child(1), #audit_trail-table tr.main-row td:nth-child(1),
  #audit_trail-table > thead > tr > th:nth-child(2), #audit_trail-table tr.main-row td:nth-child(2),
  #audit_trail-table > thead > tr > th:nth-child(4), #audit_trail-table tr.main-row td:nth-child(4) {
    display: none !important;
  }
}

/* ==================== DYNAMIC DATABASE LEDGER & SPREADSHEET WORKBOOK STYLES ==================== */
.mono {
  font-family: 'Roboto Mono', monospace !important;
}

.primary-identifier {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

.secondary-metadata {
  color: #94A3B8 !important;
  font-weight: 600 !important;
}

.tabular-numeric {
  font-family: var(--font-sans) !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.sortable-header:hover {
  color: #FACC15 !important;
}

#ledger-sections-container th {
  text-align: left;
  background: rgba(15, 23, 42, 0.8);
  padding: 10px;
  color: #888;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}

#ledger-sections-container td {
  padding: 8px 10px;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600 !important;
}

#ledger-sections-container tr.main-row {
  transition: background 0.15s ease;
}

#ledger-sections-container tr.main-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.grid-section {
  background: rgba(10, 17, 30, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 10px 15px; /* Tighter padding to reduce empty space above/below */
  margin-top: 16px; /* Slightly reduced margin-top */
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  overflow-x: auto;
}

/* Narrow the Client ID column */
table#clients-table th:first-child,
table#clients-table td:first-child {
  width: 70px !important;
  max-width: 70px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ledger-sections-container h2 {
  color: var(--accent-mint);
}

#ledger-sections-container h4 {
  color: #6ee7b7 !important; /* Soft premium emerald-mint green */
  opacity: 0.85;
  letter-spacing: 0.05em;
}

#ledger-sections-container button[id^="btn-sec-"] {
  color: var(--accent-mint) !important;
}

img.preview-doc {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

img.preview-doc:hover {
  transform: scale(1.03);
  border-color: var(--accent-mint) !important;
}

/* ==================== PORTRAIT MOBILE SPECIFIC BREAKOUT SUBTABLE SCALING ==================== */
@media (max-width: 899px) and (orientation: portrait) {
  /* Hide the 3rd column (Tax / TAX) in nested line-item breakout tables for Receipts and Invoices */
  tr[id^="child-expense_ledger-"] table th:nth-child(3),
  tr[id^="child-expense_ledger-"] table td:nth-child(3),
  tr[id^="child-income_ledger-"] table th:nth-child(3),
  tr[id^="child-income_ledger-"] table td:nth-child(3) {
    display: none !important;
  }
}

/* Dynamic slide-in animation for email input field */
#main-email-input.visible {
  width: 140px !important; /* Sleek compact width on mobile screens to prevent wrapping */
  opacity: 1 !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  border-width: 1px !important;
  margin-right: 8px !important; /* Elegant margin spacer only when email input is visible */
  pointer-events: auto !important;
}
@media (min-width: 640px) {
  #main-email-input.visible {
    width: 190px !important; /* Full width on larger screens */
  }
}

/* Remove mobile tap highlight and outline halos */
.cursor-pointer, button, [onclick] {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

/* Mobile-safe non-sticky hover background for folder headers */
@media (hover: hover) {
  .header-row-hover:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }
}


/* Smoked Glass Sidebar backdrop for blur and dim background effect */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 4, 6, 0.4); /* Dim */
  backdrop-filter: blur(8px); /* Blur */
  -webkit-backdrop-filter: blur(8px);
  z-index: 985; /* Behind sidebar (990) but in front of content and bottom nav */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Premium dark-mode styling for calendar pickers */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
  transition: opacity 0.2s ease;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) opacity(0.9);
}

/* Center select option dropdown text */
#master-client-select {
  text-align-last: center;
  text-align: center;
}
#master-client-select option {
  text-align: left;
}

/* UI Warning State: Continuous Red Warning Pulse Animation */
@keyframes warning-row-pulse {
  0% {
    background-color: rgba(136, 19, 55, 0.45); /* dark matte red */
  }
  50% {
    background-color: rgba(220, 38, 38, 0.7);  /* brighter warning red */
  }
  100% {
    background-color: rgba(136, 19, 55, 0.45);
  }
}

.warning-pulse-row {
  animation: warning-row-pulse 2s infinite ease-in-out !important;
}

/* ==================== HIGH-TECH HUD BOOT-UP LIGHTS SEQUENCING ==================== */

/* 0. Grid Section Wrapper Styles */
.grid-section {
  background: #0d111c;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  border-top: 1.5px solid var(--theme-color) !important;
  transition: border-top-color 0.4s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Lights Off (Dim/Grayscale Inactive State) */
.grid-section.lights-off {
  border-top-color: #162138 !important;
}

.grid-section.lights-off .header-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.02) !important;
  box-shadow: none !important;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.grid-section.lights-off .header-icon {
  color: #162138 !important; /* Extremely dark blue-slate */
  opacity: 0.25 !important;
  filter: grayscale(100%) drop-shadow(0 0 0 transparent) !important;
  transition: color 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
}

.grid-section.lights-off .header-title {
  color: #162138 !important; /* Extremely dark blue-slate */
  opacity: 0.25 !important;
  text-shadow: none !important;
  transition: color 0.4s ease, opacity 0.4s ease, text-shadow 0.4s ease;
}

.grid-section.lights-off [id^="badge-"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* 2. Lights On (Booting / Surge / Flicker Animations) */
.grid-section.lights-on {
  border-top-color: var(--theme-color) !important;
  animation: neon-flicker-border 0.45s ease-in-out forwards;
}

.grid-section.lights-on .header-icon-wrapper {
  background-color: var(--theme-bg) !important;
  box-shadow: 0 0 15px var(--theme-color-glow) !important;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.grid-section.lights-on .header-icon {
  color: var(--theme-color) !important;
  opacity: 1 !important;
  filter: grayscale(0%) drop-shadow(0 0 6px var(--theme-color-glow)) !important;
  animation: neon-flicker-icon 0.45s ease-in-out forwards;
}

.grid-section.lights-on .header-title {
  color: var(--accent-mint) !important;
  opacity: 1 !important;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
  animation: neon-flicker-text 0.45s ease-in-out forwards;
}

.grid-section.lights-on [id^="badge-"] {
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: grayscale(0%) !important;
  animation: neon-flicker-badge 0.45s ease-in-out forwards;
}

/* 3. Cybernetic Neon Flicker Keyframes */
@keyframes neon-flicker-border {
  0% {
    border-top-color: #162138 !important;
  }
  15% {
    border-top-color: var(--theme-color) !important;
  }
  30% {
    border-top-color: #162138 !important;
  }
  45% {
    border-top-color: var(--theme-color) !important;
  }
  65% {
    border-top-color: #162138 !important;
  }
  100% {
    border-top-color: var(--theme-color) !important;
  }
}

@keyframes neon-flicker-icon {
  0% {
    color: #162138 !important;
    opacity: 0.25;
    filter: grayscale(100%) drop-shadow(0 0 0 transparent);
  }
  15% {
    color: var(--theme-color) !important;
    opacity: 0.9;
    filter: grayscale(0%) drop-shadow(0 0 10px var(--theme-color-glow));
  }
  30% {
    color: #162138 !important;
    opacity: 0.25;
    filter: grayscale(100%) drop-shadow(0 0 0 transparent);
  }
  45% {
    color: var(--theme-color) !important;
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 14px var(--theme-color-glow));
  }
  65% {
    color: #162138 !important;
    opacity: 0.55;
    filter: grayscale(50%) drop-shadow(0 0 2px var(--theme-color-glow));
  }
  100% {
    color: var(--theme-color) !important;
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 8px var(--theme-color-glow));
  }
}

@keyframes neon-flicker-text {
  0% {
    color: #162138 !important;
    opacity: 0.25;
    text-shadow: none;
  }
  20% {
    color: var(--accent-mint) !important;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  }
  35% {
    color: #162138 !important;
    opacity: 0.25;
    text-shadow: none;
  }
  50% {
    color: var(--accent-mint) !important;
    opacity: 1;
    text-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
  }
  65% {
    color: #162138 !important;
    opacity: 0.55;
    text-shadow: none;
  }
  100% {
    color: var(--accent-mint) !important;
    opacity: 1;
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.2);
  }
}

@keyframes neon-flicker-badge {
  0% {
    opacity: 0.15;
    filter: grayscale(100%);
  }
  15% {
    opacity: 0.9;
    filter: grayscale(0%);
  }
  30% {
    opacity: 0.15;
    filter: grayscale(100%);
  }
  45% {
    opacity: 1;
    filter: grayscale(0%);
  }
  60% {
    opacity: 0.5;
    filter: grayscale(50%);
  }
  100% {
    opacity: 1;
    filter: grayscale(0%);
  }
}




/* ==================== BESPOKE RECEIPT INGESTION WIZARD SYSTEM ==================== */

.receipts-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.ocr-pulse-banner {
  background: rgba(255, 42, 95, 0.06);
  border: 1px solid rgba(255, 42, 95, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: banner-pulse 2s ease-in-out infinite alternate;
}

.ocr-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 42, 95, 0.2);
  border-top-color: #FF2A5F;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.ocr-pulse-text {
  font-size: 0.78rem;
  color: #ff5e9c;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(255, 42, 95, 0.05);
    background: rgba(255, 42, 95, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(255, 42, 95, 0.15);
    background: rgba(255, 42, 95, 0.08);
  }
}

/* Search bar styling */
.wizard-search-box {
  width: 100%;
  margin-bottom: 12px;
  position: relative;
}

.wizard-search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.wizard-search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 10px 15px 10px 40px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.3s ease;
}

.wizard-search-input:focus {
  border-color: #FF2A5F;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 12px rgba(255, 42, 95, 0.15);
}

/* Client Card Selection Grid */
.client-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 10px;
}

.client-selection-grid::-webkit-scrollbar {
  width: 5px;
}
.client-selection-grid::-webkit-scrollbar-track {
  background: transparent;
}
.client-selection-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.client-selection-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 42, 95, 0.3);
}

.client-selection-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.client-selection-card:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 42, 95, 0.3);
  transform: translateY(-2px);
}

.client-selection-card.selected {
  background: rgba(255, 42, 95, 0.05);
  border-color: #FF2A5F;
  box-shadow: 0 0 18px rgba(255, 42, 95, 0.2);
}

.client-selection-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #FF2A5F;
}

.client-card-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #FF2A5F;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.client-card-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.client-card-owner {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.client-card-owner i, 
.client-card-owner svg {
  width: 11px;
  height: 11px;
}

/* Pin Client switch block */
.pin-client-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 15px;
  margin-bottom: 5px;
  text-align: left;
}

.pin-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pin-icon-wrap {
  width: 32px;
  height: 32px;
  background: rgba(255, 42, 95, 0.04);
  border: 1px solid rgba(255, 42, 95, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF2A5F;
  flex-shrink: 0;
}

.pin-icon-wrap i {
  width: 14px;
  height: 14px;
}

.pin-text-group {
  display: flex;
  flex-direction: column;
}

.pin-title-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.pin-desc-text {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Sleek Toggle Switch slider */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

.custom-switch input:checked + .custom-slider {
  background-color: rgba(255, 42, 95, 0.15);
  border-color: rgba(255, 42, 95, 0.4);
}

.custom-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #FF2A5F;
  box-shadow: 0 0 8px rgba(255, 42, 95, 0.5);
}

/* Custom Ingesting checklist progress */
.ingesting-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 25px auto 10px auto;
  text-align: left;
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
  padding: 18px;
  border-radius: 12px;
}

.checklist-title {
  font-size: 0.65rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.checklist-item.active {
  color: #ff5e9c;
  font-weight: 550;
}

.checklist-item.completed {
  color: var(--accent-mint);
}

.checklist-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-icon i,
.checklist-icon svg {
  width: 100%;
  height: 100%;
}

.checklist-icon .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #FF2A5F;
  box-shadow: 0 0 8px #FF2A5F;
  animation: pulse-dot 1s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Premium Verify Checkbox System */
.premium-verify-block {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 20px;
  margin-bottom: 15px;
  text-align: left;
  transition: border-color 0.3s ease;
}

.premium-verify-block:hover {
  border-color: rgba(255, 42, 95, 0.2);
}

.premium-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  user-select: none;
}

.premium-checkbox-label input {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.checkbox-custom-orb {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-top: 1px;
}

.premium-checkbox-label:hover .checkbox-custom-orb {
  border-color: #FF2A5F;
  background: rgba(255, 42, 95, 0.05);
}

.premium-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #FF2A5F;
  border-color: #FF2A5F;
  box-shadow: 0 0 10px rgba(255, 42, 95, 0.35);
}

.checkbox-custom-orb i,
.checkbox-custom-orb svg {
  color: #0b1120;
  width: 14px;
  height: 14px;
  stroke-width: 3.5px;
  display: none;
}

.premium-checkbox-label input:checked + .checkbox-custom-orb i,
.premium-checkbox-label input:checked + .checkbox-custom-orb svg {
  display: block;
}

.premium-checkbox-label input:checked ~ .checkbox-text-msg {
  color: var(--text-main);
}

/* Mapped Line Items list styles */
.mapped-lines-box {
  margin-top: 15px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 15px;
}

.mapped-lines-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mapped-lines-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.line-item-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px;
  gap: 10px;
  align-items: center;
  background: rgba(11, 17, 32, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 6px;
}

.line-item-account-input {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  text-align: center;
  padding: 2px;
}

.line-item-account-input:focus {
  background: rgba(15, 23, 42, 0.5);
  box-shadow: 0 0 0 1px currentColor;
  border-radius: 4px;
}

.line-item-account {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #FF2A5F;
}

.line-item-desc {
  font-size: 0.78rem;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
  padding: 2px 4px;
  width: 100%;
}

.line-item-desc:focus {
  background: rgba(15, 23, 42, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 42, 95, 0.2);
  border-radius: 4px;
}

.line-item-amount {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  background: transparent;
  border: none;
  outline: none;
  padding: 2px 4px;
  width: 100%;
}

.line-item-amount:focus {
  background: rgba(15, 23, 42, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 42, 95, 0.2);
  border-radius: 4px;
}

/* Math Discrepancy warning banner */
.math-discrepancy-banner {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #f87171;
  font-weight: 550;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.math-discrepancy-banner i,
.math-discrepancy-banner svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Success Card check circle */
.success-card-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  border: 2px solid var(--accent-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-mint);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  margin: 15px auto 20px auto;
  animation: success-pulse 1.8s ease-in-out infinite alternate;
}

.success-card-circle i,
.success-card-circle svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.5px;
}

/* ==================== BESPOKE INVOICE INGESTION WIZARD SYSTEM ==================== */

.invoices-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.invoice-pulse-banner {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: invoice-banner-pulse 2s ease-in-out infinite alternate;
}

.invoice-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-top-color: #10B981;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.invoice-pulse-text {
  font-size: 0.78rem;
  color: #34d399;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes invoice-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.05);
    background: rgba(16, 185, 129, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.08);
  }
}

/* Client Selection Card for Invoices */
.invoice-client-card.selected {
  background: rgba(16, 185, 129, 0.05);
  border-color: #10B981;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.2);
}

.invoice-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #10B981;
}

/* Toggle Switch slider for Invoices */
.invoice-switch input:checked + .custom-slider {
  background-color: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.invoice-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.invoice-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for Invoices */
.invoice-verify-block:hover {
  border-color: rgba(16, 185, 129, 0.2);
}

.invoice-checkbox-label:hover .checkbox-custom-orb {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.05);
}

.invoice-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #10B981;
  border-color: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ==================== BESPOKE DONATION INGESTION WIZARD SYSTEM ==================== */

.donations-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.donation-pulse-banner {
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: donation-banner-pulse 2s ease-in-out infinite alternate;
}

.donation-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(168, 85, 247, 0.2);
  border-top-color: #A855F7;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.donation-pulse-text {
  font-size: 0.78rem;
  color: #c084fc;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes donation-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.05);
    background: rgba(168, 85, 247, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
    background: rgba(168, 85, 247, 0.08);
  }
}

/* Client Selection Card for Donations */
.donation-client-card.selected {
  background: rgba(168, 85, 247, 0.05);
  border-color: #A855F7;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
}

.donation-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #A855F7;
}

/* Toggle Switch slider for Donations */
.donation-switch input:checked + .custom-slider {
  background-color: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
}

.donation-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #A855F7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.donation-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #A855F7;
  box-shadow: 0 0 8px #A855F7;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for Donations */
.donation-verify-block:hover {
  border-color: rgba(168, 85, 247, 0.2);
}

.donation-checkbox-label:hover .checkbox-custom-orb {
  border-color: #A855F7;
  background: rgba(168, 85, 247, 0.05);
}

.donation-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #A855F7;
  border-color: #A855F7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

/* ==================== BESPOKE W-9 ONBOARDING WIZARD SYSTEM ==================== */

.w9s-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.w9-pulse-banner {
  background: rgba(247, 223, 30, 0.06);
  border: 1px solid rgba(247, 223, 30, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: w9-banner-pulse 2s ease-in-out infinite alternate;
}

.w9-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(247, 223, 30, 0.2);
  border-top-color: #F7DF1E;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.w9-pulse-text {
  font-size: 0.78rem;
  color: #fef08a;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes w9-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(247, 223, 30, 0.05);
    background: rgba(247, 223, 30, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(247, 223, 30, 0.15);
    background: rgba(247, 223, 30, 0.08);
  }
}

/* Client Selection Card for W9 */
.w9-client-card.selected {
  background: rgba(247, 223, 30, 0.05);
  border-color: #F7DF1E;
  box-shadow: 0 0 18px rgba(247, 223, 30, 0.2);
}

.w9-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #F7DF1E;
}

/* Toggle Switch slider for W9 */
.w9-switch input:checked + .custom-slider {
  background-color: rgba(247, 223, 30, 0.15);
  border-color: rgba(247, 223, 30, 0.4);
}

.w9-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #F7DF1E;
  box-shadow: 0 0 8px rgba(247, 223, 30, 0.5);
}

.w9-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #F7DF1E;
  box-shadow: 0 0 8px #F7DF1E;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for W9 */
.w9-verify-block:hover {
  border-color: rgba(247, 223, 30, 0.2);
}

.w9-checkbox-label:hover .checkbox-custom-orb {
  border-color: #F7DF1E;
  background: rgba(247, 223, 30, 0.05);
}

.w9-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #F7DF1E;
  border-color: #F7DF1E;
  box-shadow: 0 0 10px rgba(247, 223, 30, 0.4);
}

/* ==================== BESPOKE COI COMPLIANCE WIZARD SYSTEM ==================== */

.cois-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.coi-pulse-banner {
  background: rgba(47, 128, 237, 0.06);
  border: 1px solid rgba(47, 128, 237, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: coi-banner-pulse 2s ease-in-out infinite alternate;
}

.coi-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(47, 128, 237, 0.2);
  border-top-color: #2F80ED;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.coi-pulse-text {
  font-size: 0.78rem;
  color: #79a6fe;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes coi-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(47, 128, 237, 0.05);
    background: rgba(47, 128, 237, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(47, 128, 237, 0.15);
    background: rgba(47, 128, 237, 0.08);
  }
}

/* Client Selection Card for COI */
.coi-client-card.selected {
  background: rgba(47, 128, 237, 0.05);
  border-color: #2F80ED;
  box-shadow: 0 0 18px rgba(47, 128, 237, 0.2);
}

.coi-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #2F80ED;
}

/* Toggle Switch slider for COI */
.coi-switch input:checked + .custom-slider {
  background-color: rgba(47, 128, 237, 0.15);
  border-color: rgba(47, 128, 237, 0.4);
}

.coi-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #2F80ED;
  box-shadow: 0 0 8px rgba(47, 128, 237, 0.5);
}

.coi-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #2F80ED;
  box-shadow: 0 0 8px #2F80ED;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for COI */
.coi-verify-block:hover {
  border-color: rgba(47, 128, 237, 0.2);
}

.coi-checkbox-label:hover .checkbox-custom-orb {
  border-color: #2F80ED;
  background: rgba(47, 128, 237, 0.05);
}

.coi-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #2F80ED;
  border-color: #2F80ED;
  box-shadow: 0 0 10px rgba(47, 128, 237, 0.4);
}

/* ==================== BESPOKE UTILITIES INGESTION WIZARD SYSTEM ==================== */

.utilities-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background OCR Processing Pulse bar */
.utility-pulse-banner {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: utility-banner-pulse 2s ease-in-out infinite alternate;
}

.utility-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(249, 115, 22, 0.2);
  border-top-color: #F97316;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.utility-pulse-text {
  font-size: 0.78rem;
  color: #fdba74;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes utility-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(249, 115, 22, 0.05);
    background: rgba(249, 115, 22, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
    background: rgba(249, 115, 22, 0.08);
  }
}

/* Client Selection Card for Utility */
.utility-client-card.selected {
  background: rgba(249, 115, 22, 0.05);
  border-color: #F97316;
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.2);
}

.utility-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #F97316;
}

/* Toggle Switch slider for Utility */
.utility-switch input:checked + .custom-slider {
  background-color: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.4);
}

.utility-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #F97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.utility-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #F97316;
  box-shadow: 0 0 8px #F97316;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for Utility */
.utility-verify-block:hover {
  border-color: rgba(249, 115, 22, 0.2);
}

.utility-checkbox-label:hover .checkbox-custom-orb {
  border-color: #F97316;
  background: rgba(249, 115, 22, 0.05);
}

.utility-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #F97316;
  border-color: #F97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

/* ==================== BESPOKE MILEAGE INGESTION WIZARD SYSTEM ==================== */

.mileage-wizard-active .overlay-layout-split {
  display: flex !important;
  flex-direction: column !important;
  max-width: 620px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-bottom: 30px;
}

/* Background Ingestion Pulse bar */
.mileage-pulse-banner {
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  animation: mileage-banner-pulse 2s ease-in-out infinite alternate;
}

.mileage-pulse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 245, 212, 0.2);
  border-top-color: #00F5D4;
  border-radius: 50%;
  animation: spinner-ring 0.8s linear infinite;
  flex-shrink: 0;
}

.mileage-pulse-text {
  font-size: 0.78rem;
  color: #00F5D4;
  font-weight: 550;
  letter-spacing: 0.01em;
}

@keyframes mileage-banner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 245, 212, 0.05);
    background: rgba(0, 245, 212, 0.04);
  }
  100% {
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.15);
    background: rgba(0, 245, 212, 0.08);
  }
}

/* Client Selection Card for Mileage */
.mileage-client-card.selected {
  background: rgba(0, 245, 212, 0.05);
  border-color: #00F5D4;
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.2);
}

.mileage-client-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #00F5D4;
}

/* Toggle Switch slider for Mileage */
.mileage-switch input:checked + .custom-slider {
  background-color: rgba(0, 245, 212, 0.15);
  border-color: rgba(0, 245, 212, 0.4);
}

.mileage-switch input:checked + .custom-slider:before {
  transform: translateX(20px);
  background-color: #00F5D4;
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.5);
}

.mileage-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #00F5D4;
  box-shadow: 0 0 8px #00F5D4;
  animation: pulse-dot 1s infinite alternate;
}

/* Premium Verify Checkbox System for Mileage */
.mileage-verify-block:hover {
  border-color: rgba(0, 245, 212, 0.2);
}

.mileage-checkbox-label:hover .checkbox-custom-orb {
  border-color: #00F5D4;
  background: rgba(0, 245, 212, 0.05);
}

.mileage-checkbox-label input:checked + .checkbox-custom-orb {
  background-color: #00F5D4;
  border-color: #00F5D4;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* Landscape-Only Table Inline Editing Visual Cues */
@media (orientation: landscape) {
  td.editable-cell {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }
  td.editable-cell[contenteditable="true"] {
    -webkit-user-select: text !important;
    user-select: text !important;
    cursor: text;
    transition: background-color 0.2s ease, border-bottom 0.2s ease;
    outline: none !important;
  }
  td.editable-cell[contenteditable="true"]:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
  }
  td.editable-cell[contenteditable="true"]:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-bottom: 2px solid var(--accent-mint, #10b981) !important;
  }
  
  /* Rapid Green Flash Keyframes & Class */
  @keyframes rapid-green-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.35); }
  }
  .rapid-flash-success {
    animation: rapid-green-flash 0.2s ease-in-out infinite;
  }
  
  /* Rapid Red Flash Keyframes & Class (Alarm-shade of Red) */
  @keyframes rapid-red-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(239, 68, 68, 0.45); }
  }
  .rapid-flash-failure {
    animation: rapid-red-flash 0.2s ease-in-out infinite;
  }
}

/* ==================== COMMON LOCATIONS SYSTEM STYLES ==================== */
.common-loc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 20px;
  justify-content: flex-end; /* Align to the right */
}

.loc-pill-btn {
  background: rgba(0, 245, 212, 0.05);
  border: 1px solid rgba(0, 245, 212, 0.15);
  color: #00F5D4;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.loc-pill-btn:hover {
  background: rgba(0, 245, 212, 0.15);
  border-color: rgba(0, 245, 212, 0.35);
  transform: translateY(-1px);
}

.loc-pill-btn:active {
  transform: translateY(0) scale(0.95);
}

.loc-pill-btn.active {
  background: rgba(0, 245, 212, 0.22) !important;
  border-color: #00F5D4 !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

/* Multi-destination wizard stops */
.dest-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dest-input-wrap {
  flex: 1;
  min-width: 0;
}
.btn-dest-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto; /* aligns nicely with the bottom-aligned input */
  margin-bottom: 2px;
}
.btn-dest-action:hover {
  background: rgba(0, 245, 212, 0.1);
  border-color: #00F5D4;
  color: #00F5D4;
}
.btn-dest-action.btn-dest-remove:hover {
  background: rgba(255, 42, 95, 0.1);
  border-color: #ff2a5f;
  color: #ff2a5f;
}

/* Settings Pane: Common Locations Manager List */
.settings-loc-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
  border-radius: 8px;
  background: rgba(11, 17, 32, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-loc-list::-webkit-scrollbar {
  width: 4px;
}
.settings-loc-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.settings-loc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.settings-loc-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  margin-right: 10px;
}

.settings-loc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-loc-addr {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-loc-delete {
  background: transparent;
  border: none;
  color: #ef4444;
  opacity: 0.7;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-loc-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

/* Auto-detect Location Suggestion Banner */
.suggest-location-banner {
  background: rgba(0, 245, 212, 0.03);
  border: 1px dashed rgba(0, 245, 212, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: left;
  animation: fadeIn 0.3s ease-out;
}

.suggest-banner-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #00F5D4;
  margin-bottom: 4px;
}

.suggest-banner-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 10px;
}

.suggest-banner-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.suggest-banner-inputs .glass-input {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* ==========================================================================
   Nordic Fog & Aurora Glass Light Mode Theme Overrides
   ========================================================================== */
:root[data-theme="light"] {
  --border-glass: rgba(15, 23, 42, 0.08);
  --bg-input: rgba(255, 255, 255, 0.85);
}

:root[data-theme="light"] body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 20% 35%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(13, 148, 136, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 40%, rgba(225, 29, 72, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 85% 35%, rgba(56, 189, 248, 0.15) 0%, transparent 45%),
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

/* Light mode specific scrollbars */
:root[data-theme="light"] #ledger-sections-container::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
}
:root[data-theme="light"] #ledger-sections-container::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.2);
}

/* Sticky Header Deck adaptation: Frosted glass on desktop, solid background on mobile to prevent text leakage */
@media (min-width: 900px) {
  :root[data-theme="light"] .sticky-header-deck {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    border: none !important;
    box-shadow: none !important;
  }
}
@media (max-width: 899px) {
  :root[data-theme="light"] .sticky-header-deck {
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100vw !important;
    background-color: var(--bg-color) !important;
    background-image: 
      radial-gradient(circle at 20% 35%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(13, 148, 136, 0.12) 0%, transparent 50%),
      radial-gradient(circle at 50% 40%, rgba(225, 29, 72, 0.08) 0%, transparent 60%),
      radial-gradient(circle at 85% 35%, rgba(56, 189, 248, 0.15) 0%, transparent 45%),
      linear-gradient(var(--grid-color) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-color) 1px, transparent 1px) !important;
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px !important;
    background-attachment: fixed !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Client Select & Date Pill inputs */
:root[data-theme="light"] #master-client-select {
  background-color: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}
:root[data-theme="light"] #date-range-btn {
  background-color: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

/* Date range modal popover */
:root[data-theme="light"] #date-range-modal,
:root[data-theme="light"] #global-date-range-modal {
  background-color: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] #date-range-modal h3,
:root[data-theme="light"] #global-date-range-modal h3 {
  color: #0f172a;
}
:root[data-theme="light"] #date-range-modal input[type="date"],
:root[data-theme="light"] #global-date-range-modal input[type="date"] {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.1);
}

/* App Navbar borders */
:root[data-theme="light"] .app-navbar {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

/* Brand logo styling fallback/text */
:root[data-theme="light"] .brand-logo-text {
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass Inputs in Settings Forms */
:root[data-theme="light"] .glass-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}
:root[data-theme="light"] .glass-input::placeholder {
  color: #94a3b8;
}
:root[data-theme="light"] .glass-input:focus {
  border-color: var(--accent-mint);
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.15);
}

/* Dropdown settings background adjustments */
:root[data-theme="light"] #settings-startup-range {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
:root[data-theme="light"] #settings-startup-range option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Bottom Nav bar */
:root[data-theme="light"] .bottom-nav-bar {
  background: rgba(241, 245, 249, 0.85);
  border-top-color: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
:root[data-theme="light"] .nav-tab-btn {
  color: #64748b;
}
:root[data-theme="light"] .nav-tab-btn.active {
  color: #0f172a;
}

/* Active buttons in navigation */
:root[data-theme="light"] .nav-tab-btn:not(.active):hover .nav-btn-orb i,
:root[data-theme="light"] .nav-tab-btn:not(.active):hover .nav-btn-orb svg {
  color: #0f172a;
}

/* active settings button blue orb */
:root[data-theme="light"] .nav-tab-btn.active#tab-btn-left .nav-btn-orb {
  background: radial-gradient(circle at 30% 30%, #3B82F6, #1D4ED8);
  border-color: #3B82F6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 4px 15px rgba(0, 0, 0, 0.08);
}
/* active workbook button mint orb */
:root[data-theme="light"] .nav-tab-btn.active#tab-btn-center .nav-btn-orb {
  background: radial-gradient(circle at 30% 30%, #10B981, #059669);
  border-color: #10B981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Floating Sidebar Ingestion Deck menu */
:root[data-theme="light"] .sidebar-dock {
  background: rgba(241, 245, 249, 0.85);
  border-left-color: rgba(15, 23, 42, 0.08);
  box-shadow: -10px 0 35px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}
:root[data-theme="light"] .sidebar-toggle-handle {
  background: rgba(241, 245, 249, 0.85);
  border-color: rgba(15, 23, 42, 0.08);
  border-right: none;
}
:root[data-theme="light"] .sidebar-toggle-handle:hover {
  background: #ffffff;
}

/* Glass structural cards */
:root[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(15, 23, 42, 0.07) !important;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
}

/* Ingest cards inside central deck */
:root[data-theme="light"] .ingest-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .ingest-card:hover,
:root[data-theme="light"] .ingest-card:focus {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] .card-icon-container {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.05);
}

/* Common Locations items */
:root[data-theme="light"] .settings-loc-list {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .settings-loc-item {
  border-bottom-color: rgba(15, 23, 42, 0.05);
}

/* Workspace modal overlay styling */
:root[data-theme="light"] .workspace-overlay {
  background-color: #f1f5f9 !important;
}
:root[data-theme="light"] .overlay-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .overlay-close-btn {
  background-color: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}
:root[data-theme="light"] .overlay-close-btn:hover {
  background-color: #f8fafc;
}

/* Table header adaptation */
:root[data-theme="light"] .grid-section-header {
  border-bottom-color: rgba(15, 23, 42, 0.12);
}
:root[data-theme="light"] .grid-header-cell {
  color: #64748b;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .grid-row {
  border-bottom-color: rgba(15, 23, 42, 0.05);
}
:root[data-theme="light"] .grid-row:hover {
  background: rgba(15, 23, 42, 0.02);
}
:root[data-theme="light"] .grid-row.selected {
  background: rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] .grid-cell {
  color: #0f172a;
}
:root[data-theme="light"] .text-dim {
  color: #64748b !important;
}

/* Modals */
:root[data-theme="light"] .modal-dialog-overlay {
  background: rgba(241, 245, 249, 0.8) !important;
  backdrop-filter: blur(12px);
}
:root[data-theme="light"] .modal-dialog {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .modal-dialog h3 {
  color: #0f172a;
}
:root[data-theme="light"] .modal-text {
  color: #64748b;
}
:root[data-theme="light"] .export-opt-label {
  border-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
:root[data-theme="light"] .export-opt-label input[type="radio"]:checked + span {
  color: #0d9488;
}

/* Interactive elements default text colors in light mode */
:root[data-theme="light"] button.glass-btn {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
}
:root[data-theme="light"] button.glass-btn:hover {
  background: rgba(15, 23, 42, 0.03);
}

/* General form elements text inputs */
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] select {
  color: #0f172a;
}

/* Override tailwind background styles for specific light theme containers */
:root[data-theme="light"] .bg-[#0f131c] {
  background-color: rgba(255, 255, 255, 0.8) !important;
}
:root[data-theme="light"] .border-[#2d3748] {
  border-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .border-[#162138] {
  border-color: rgba(15, 23, 42, 0.06) !important;
}
:root[data-theme="light"] .text-white {
  color: #0f172a !important;
}
:root[data-theme="light"] .text-[#94a3b8] {
  color: #64748b !important;
}
:root[data-theme="light"] .bg-[#162138] {
  background-color: rgba(255, 255, 255, 0.7) !important;
}
:root[data-theme="light"] .border-[#334155] {
  border-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .bg-slate-800 {
  background-color: rgba(15, 23, 42, 0.03) !important;
  color: #0f172a !important;
}
:root[data-theme="light"] .bg-slate-800:hover {
  background-color: rgba(15, 23, 42, 0.06) !important;
}
:root[data-theme="light"] .text-[#cbd5e1] {
  color: #0f172a !important;
}
:root[data-theme="light"] .bg-\[\#0f172a\] {
  background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Premium Light-mode Data Pills (Badges) with high-contrast pastel backgrounds and colored borders */
:root[data-theme="light"] .bg-\[\#881337\] {
  background-color: #FEE2E2 !important;
  color: #991B1B !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}
:root[data-theme="light"] .bg-\[\#064e3b\] {
  background-color: #D1FAE5 !important;
  color: #065F46 !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
:root[data-theme="light"] .bg-\[\#1e293b\] {
  background-color: #F1F5F9 !important;
  color: #334155 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}
:root[data-theme="light"] .bg-\[\#7c2d12\] {
  background-color: #FFEDD5 !important;
  color: #9A3412 !important;
  border-color: rgba(249, 115, 22, 0.25) !important;
}
:root[data-theme="light"] .bg-\[\#0f766e\] {
  background-color: #CCFBF1 !important;
  color: #0F766E !important;
  border-color: rgba(20, 184, 166, 0.25) !important;
}
:root[data-theme="light"] .bg-\[\#f59e0b\] {
  background-color: #FEF3C7 !important;
  color: #92400E !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}

/* Also style the export email input in light mode */
:root[data-theme="light"] #main-email-input {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
}


/* Brand logo color adjustment in light mode (invert logo white to black) */
:root[data-theme="light"] .brand-block img,
:root[data-theme="light"] .intro-logo-clone {
  filter: invert(1) brightness(0.15);
}

/* Individual Table Backgrounds and Headers Adaptation */
:root[data-theme="light"] .ledger-table-wrapper {
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
:root[data-theme="light"] .ledger-table {
  background: transparent !important;
  color: #0f172a !important;
}
:root[data-theme="light"] .ledger-table th {
  background: rgba(226, 232, 240, 0.8) !important;
  color: #0f172a !important;
  border-bottom: 2px solid rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .ledger-table td {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
}
:root[data-theme="light"] .ledger-table tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.02) !important;
}
:root[data-theme="light"] .ledger-table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.01) !important;
}

/* Explicit high-specificity overrides for elements inside the ledger container */
:root[data-theme="light"] #ledger-sections-container td {
  color: #0f172a !important;
  border-bottom-color: rgba(15, 23, 42, 0.05) !important;
}
:root[data-theme="light"] #ledger-sections-container th {
  color: #0f172a !important;
  background: rgba(226, 232, 240, 0.8) !important;
}
:root[data-theme="light"] #ledger-sections-container tr.main-row:hover {
  background: rgba(15, 23, 42, 0.02) !important;
}

/* Override utility color classes in sub-tables / child details */
:root[data-theme="light"] .text-slate-300 {
  color: #0f172a !important;
}
:root[data-theme="light"] .text-slate-400 {
  color: #64748b !important;
}
:root[data-theme="light"] .text-slate-200 {
  color: #0f172a !important;
}
:root[data-theme="light"] .text-slate-500 {
  color: #64748b !important;
}

/* Border and background overrides for sub-tables */
:root[data-theme="light"] .border-slate-800,
:root[data-theme="light"] .border-slate-800\/60,
:root[data-theme="light"] .border-slate-800\/50,
:root[data-theme="light"] .border-slate-700\/50 {
  border-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .bg-slate-950\/60,
:root[data-theme="light"] .bg-slate-950\/70,
:root[data-theme="light"] .bg-slate-950\/20,
:root[data-theme="light"] .bg-slate-900\/20,
:root[data-theme="light"] .bg-slate-900\/30,
:root[data-theme="light"] .bg-slate-900\/40,
:root[data-theme="light"] .bg-slate-900\/10,
:root[data-theme="light"] .bg-slate-800\/80 {
  background-color: rgba(15, 23, 42, 0.02) !important;
  color: #0f172a !important;
}

/* Table detail expanded child rows */
:root[data-theme="light"] .child-row {
  background-color: rgba(15, 23, 42, 0.01) !important;
}
:root[data-theme="light"] .child-row h4 {
  color: #0f172a !important;
}
:root[data-theme="light"] .child-row td {
  border-left-width: 4px;
}
:root[data-theme="light"] .child-row .ledger-table th {
  background: rgba(226, 232, 240, 0.9) !important;
  color: #0f172a !important;
}
:root[data-theme="light"] .child-row .bg-slate-900\/40 {
  background-color: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Override the inline background style of grid-section cards in light mode */
:root[data-theme="light"] .grid-section {
  background: rgba(255, 255, 255, 0.75) !important;
  border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

:root[data-theme="light"] .grid-section.lights-on {
  border-top: 4px solid var(--theme-color) !important;
}

:root[data-theme="light"] .grid-section.lights-off {
  border-top: 4px solid rgba(15, 23, 42, 0.08) !important;
}

/* Ensure section titles do not use neon text-shadow / blur filter in light mode */
:root[data-theme="light"] .grid-section.lights-on .header-title {
  text-shadow: none !important;
  color: #0f172a !important;
}

:root[data-theme="light"] .grid-section.lights-off .header-title {
  color: #64748b !important;
  opacity: 0.6 !important;
}

:root[data-theme="light"] .grid-section.lights-off .header-icon {
  color: #64748b !important;
  opacity: 0.6 !important;
  filter: grayscale(100%) !important;
}

/* Local search input override inside cards */
:root[data-theme="light"] #receipts-local-search {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02) !important;
}
:root[data-theme="light"] #receipts-local-search::placeholder {
  color: #94a3b8 !important;
}
:root[data-theme="light"] #receipts-local-search + span i,
:root[data-theme="light"] #receipts-local-search + span svg {
  color: #64748b !important;
}

/* Pagination row separators and labels */
:root[data-theme="light"] .grid-section div.border-b.border-slate-800\/50 {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] [id^="page-info-"] {
  color: #64748b !important;
}

/* Prev/Next buttons styling overrides */
:root[data-theme="light"] .grid-section button[onclick^="changePage"] {
  background-color: rgba(15, 23, 42, 0.03) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .grid-section button[onclick^="changePage"]:hover {
  background-color: rgba(15, 23, 42, 0.06) !important;
}
:root[data-theme="light"] .grid-section .bg-slate-950\/40 {
  background-color: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* View limit dropdown styling overrides inside cards */
:root[data-theme="light"] .grid-section select[onchange^="updateLimit"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Sortable table header text adjustment in light mode (make it readable charcoal) */
:root[data-theme="light"] .sortable-header {
  color: #64748b !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .ledger-table th.sortable-header {
  color: #64748b !important;
}

/* Light mode expanded table detail heading contrast fix */
:root[data-theme="light"] #ledger-sections-container h4 {
  color: #0f172a !important;
}

/* Light mode sidebar icon shading accessibility adjustments */
:root[data-theme="light"] #btn-w9s {
  --accent-color: #B59A00 !important; /* Darker golden amber for light mode readability */
}
:root[data-theme="light"] #btn-mileage {
  --accent-color: #008B7A !important; /* Darker teal/cyan for light mode visibility */
}

/* Light mode card container (Ingestion, Settings, etc.) overrides */
:root[data-theme="light"] .glass-form-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

/* Ingestion Drop Zone override in light mode */
:root[data-theme="light"] .drop-zone {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
:root[data-theme="light"] .drop-zone.dragover {
  background: rgba(15, 23, 42, 0.04) !important;
}

/* Settings Form Select inputs background and text overrides in light mode */
:root[data-theme="light"] select,
:root[data-theme="light"] select.glass-input,
:root[data-theme="light"] .glass-form-card select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
:root[data-theme="light"] select option,
:root[data-theme="light"] select.glass-input option,
:root[data-theme="light"] .glass-form-card select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Hide background particle animation in light mode to keep background clean */
:root[data-theme="light"] #node-canvas-bg,
:root[data-theme="light"] #node-canvas {
  display: none !important;
}

/* Save Preferences button text color override in light mode */
:root[data-theme="light"] #btn-save-prefs {
  color: #ffffff !important;
}

/* Light theme overrides for dynamic ingestion sub-containers */
:root[data-theme="light"] .pin-client-block {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
:root[data-theme="light"] .ingesting-checklist {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}
:root[data-theme="light"] .checklist-title {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
:root[data-theme="light"] .line-item-row {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Light mode overrides for mapped lines box and premium verify block in Ingestion */
:root[data-theme="light"] .mapped-lines-box,
:root[data-theme="light"] .premium-verify-block {
  background: rgba(15, 23, 42, 0.03) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}
:root[data-theme="light"] .premium-verify-block:hover {
  border-color: rgba(225, 29, 72, 0.3) !important;
}

/* Light mode override for discrepancy error banners */
:root[data-theme="light"] .math-discrepancy-banner {
  color: #e11d48 !important;
  background: rgba(225, 29, 72, 0.04) !important;
  border-color: rgba(225, 29, 72, 0.15) !important;
}

/* Accessibility icon color overrides for light mode */
:root[data-theme="light"] #btn-receipts { --accent-color: #E11D48 !important; }
:root[data-theme="light"] #btn-invoices { --accent-color: #0D9488 !important; }
:root[data-theme="light"] #btn-donations { --accent-color: #7C3AED !important; }
:root[data-theme="light"] #btn-w9s { --accent-color: #A16207 !important; }
:root[data-theme="light"] #btn-cois { --accent-color: #2563EB !important; }
:root[data-theme="light"] #btn-utilities { --accent-color: #EA580C !important; }
:root[data-theme="light"] #btn-mileage { --accent-color: #0F766E !important; }
:root[data-theme="light"] #btn-triage { --accent-color: #EF4444 !important; }

/* Light theme overrides for mobile badges */
:root[data-theme="light"] [id^="badge-"] {
  background-color: #ffffff !important;
  font-weight: 700 !important;
}
:root[data-theme="light"] #badge-expense_ledger {
  background-color: #ffe4e6 !important;
  color: #b91c1c !important;
  border: 1.5px solid #fca5a5 !important;
}
:root[data-theme="light"] #badge-income_ledger {
  background-color: #d1fae5 !important;
  color: #047857 !important;
  border: 1.5px solid #6ee7b7 !important;
}
:root[data-theme="light"] #badge-donation_ledger {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1.5px solid #d8b4fe !important;
}
:root[data-theme="light"] #badge-utility_ledger {
  background-color: #ffedd5 !important;
  color: #c2410c !important;
  border: 1.5px solid #fdba74 !important;
}
:root[data-theme="light"] #badge-mileage_ledger {
  background-color: #ccfbf1 !important;
  color: #0f766e !important;
  border: 1.5px solid #5eead4 !important;
}
:root[data-theme="light"] #badge-vendor_ledger {
  background-color: #fef9c3 !important;
  color: #a16207 !important;
  border: 1.5px solid #fde047 !important;
}
:root[data-theme="light"] #badge-compliance_ledger {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
  border: 1.5px solid #93c5fd !important;
}


/* ==================== TRIAGE ROOM WORKSPACE CUSTOM SYSTEM ==================== */

.workspace-overlay.triage-wizard-active {
  background: rgba(48, 4, 15, 0.95) !important;
  border-top-color: #EF4444 !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 
              inset 0 0 40px rgba(239, 68, 68, 0.05), 
              0 0 50px rgba(239, 68, 68, 0.2) !important;
  transition: all 0.4s ease;
}

.workspace-overlay.triage-wizard-active.triage-wizard-staging-active {
  background: rgba(4, 15, 48, 0.95) !important;
  border-top-color: #2A66F7 !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 
              inset 0 0 40px rgba(42, 102, 247, 0.05), 
              0 0 50px rgba(42, 102, 247, 0.2) !important;
}

.triage-wizard-active .overlay-layout-split {
  display: none !important;
}

.triage-tabs-container {
  display: flex;
  gap: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
  justify-content: center;
}

.triage-tab-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.triage-tab-btn:hover {
  color: #f8fafc;
}

.triage-tab-btn.active {
  color: #EF4444;
  border-bottom-color: #EF4444;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.triage-wizard-staging-active .triage-tab-btn.active {
  color: #60A5FA !important;
  border-bottom-color: #3B82F6 !important;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.6) !important;
}

.triage-split-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex: 1;
  min-height: 480px;
  max-width: 100%;
}

@media (max-width: 900px) {
  .triage-split-layout {
    flex-direction: column;
  }
  .triage-left-panel, .triage-right-panel {
    max-height: none !important;
  }
}

.triage-left-panel {
  flex: 1.2;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow: hidden;
  max-height: calc(100vh - 280px);
  position: relative;
  min-height: 300px;
}

.triage-left-panel img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.triage-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 5px;
}

.triage-right-panel::-webkit-scrollbar {
  width: 6px;
}
.triage-right-panel::-webkit-scrollbar-track {
  background: transparent;
}
.triage-right-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.neon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 50 !important;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 6px;
  line-height: 1;
  box-shadow: 0 0 10px #EF4444, 0 0 20px #EF4444;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: neon-badge-pulse 2s infinite alternate;
}

.neon-badge-blue {
  position: absolute;
  top: -5px;
  left: -5px;
  z-index: 50 !important;
  background: #2A66F7;
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 6px;
  line-height: 1;
  box-shadow: 0 0 10px #2A66F7, 0 0 20px #2A66F7;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: neon-badge-pulse-blue 2s infinite alternate;
}

@keyframes neon-badge-pulse {
  0% {
    box-shadow: 0 0 6px #EF4444, 0 0 12px #EF4444;
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 12px #EF4444, 0 0 24px #EF4444;
    transform: scale(1.08);
  }
}

@keyframes neon-badge-pulse-blue {
  0% {
    box-shadow: 0 0 6px #2A66F7, 0 0 12px #2A66F7;
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 12px #2A66F7, 0 0 24px #2A66F7;
    transform: scale(1.08);
  }
}

.triage-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.triage-queue-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.triage-queue-item:hover, .triage-queue-item.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.triage-queue-item.active {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
}

.triage-field-group {
  margin-bottom: 12px;
}

.triage-field-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.triage-field-group input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 12px;
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.triage-field-group input:focus {
  border-color: #EF4444;
  outline: none;
  background: rgba(15, 23, 42, 0.8);
}

#pwa-titlebar {
  display: none;
}














