:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-main: #0a0f1d;
  --bg-panel: rgba(18, 26, 44, 0.75);
  --bg-panel-hover: rgba(26, 38, 64, 0.85);
  --bg-card: #131d31;
  --bg-input: #0e1526;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

@supports (overflow: clip) {

  html,
  body {
    overflow-x: clip;
  }
}

.app-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.8) 0%, #0a0f1d 100%);
  pointer-events: none;
  z-index: -1;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 15, 29, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

.brand-icon img,
.brand-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* ============================================================
   PWA Install Banner (full-width, top of page)
   ============================================================ */
.pwa-install-banner {
  position: relative;
  z-index: 1100;
  width: 100%;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.18) 0%, rgba(16, 185, 129, 0.14) 100%);
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.55rem 1rem;
  transition: transform 0.3s ease, opacity 0.3s ease, max-height 0.35s ease;
  overflow: hidden;
  max-height: 60px;
}

.pwa-install-banner.hidden {
  display: none;
}

.pwa-install-banner.dismissing {
  transform: translateY(-100%);
  opacity: 0;
  max-height: 0;
  padding: 0;
}

.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--accent-light, #67e8f9);
}

.pwa-banner-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-install-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.pwa-banner-install-btn:hover {
  background: rgba(16, 185, 129, 0.32);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  color: #fff;
}

.pwa-banner-dismiss-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.pwa-banner-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .pwa-banner-text {
    font-size: 0.78rem;
  }
  .pwa-install-banner {
    padding: 0.5rem 0.75rem;
  }
}

.push-notification-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.push-notification-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.push-notification-btn.btn-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.push-notification-btn.btn-active:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #ffffff;
}

.push-notification-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.6);
  pointer-events: none;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(18, 26, 44, 0.8);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Active Profile Pill / Header Actions */
.header-profile {
  display: flex;
  align-items: center;
  transition: opacity 0.15s ease;
}

.header-profile.is-loading {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* In desktop: never show 'Crear Perfil Fiscal' in header because landing hero already has CTA */
@media (min-width: 769px) {
  #btn-header-onboard {
    display: none !important;
  }
}

/* Anti-FOUC state visibility rules before JS hydration */
html.has-profile:not(.app-initialized) #screen-welcome {
  display: none !important;
}

html.has-profile:not(.app-initialized) #screen-history {
  display: block !important;
}

html.no-profile:not(.app-initialized) #screen-history {
  display: none !important;
}

html.no-profile:not(.app-initialized) #screen-welcome {
  display: block !important;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(18, 26, 44, 0.9);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-pill:hover {
  border-color: var(--border-hover);
  background: rgba(26, 36, 60, 0.95);
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.avatar-initials {
  display: none;
}

.avatar-icon {
  display: inline-block;
}

.btn-text-desktop {
  display: inline;
}

.btn-text-mobile {
  display: none;
}

.profile-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-rfc {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-light);
}

/* Main Container */
.main-container {
  max-width: 1280px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1 0 auto;
  box-sizing: border-box;
}

/* Screen Views */
.screen-view {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.screen-view.active {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   1. WELCOME / LANDING SCREEN (3D Interactive Receipt & Vertical How-It-Works)
   ========================================================================== */
.welcome-container {
  max-width: 1180px;
  margin: 1.5rem auto 4rem;
  padding: 0 1rem;
}

.welcome-header {
  text-align: center;
  max-width: 780px;
  margin: 1rem auto 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* 2-Column Grid Layout */
.welcome-showcase-grid {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 4.5rem;
}

/* --- Left Column: 3D Floating & Interactive Scanned Receipt --- */
.showcase-left-col {
  display: flex;
  justify-content: center;
  position: relative;
}

.receipt-3d-scene {
  perspective: 1200px;
  perspective-origin: 50% 45%;
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
  cursor: grab;
  user-select: none;
}

.receipt-3d-card {
  --hover-rx: 8deg;
  --hover-ry: -11deg;
  --scroll-rx: 0deg;
  --scroll-ry: 0deg;
  position: relative;
  width: 100%;
  max-width: 360px;
  transform-style: preserve-3d;
  transform: perspective(1200px) rotateX(calc(var(--hover-rx) + var(--scroll-rx))) rotateY(calc(var(--hover-ry) + var(--scroll-ry))) rotateZ(-1.5deg);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.75)) drop-shadow(0 40px 65px rgba(0, 0, 0, 0.5)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

/* Floating animation */
@keyframes floatReceiptAmbient {
  0% {
    transform: perspective(1200px) rotateX(calc(var(--hover-rx) + var(--scroll-rx))) rotateY(calc(var(--hover-ry) + var(--scroll-ry))) rotateZ(-1.5deg) translateY(0px);
  }
  50% {
    transform: perspective(1200px) rotateX(calc(var(--hover-rx) + var(--scroll-rx) - 2deg)) rotateY(calc(var(--hover-ry) + var(--scroll-ry) + 2deg)) rotateZ(-0.5deg) translateY(-10px);
  }
  100% {
    transform: perspective(1200px) rotateX(calc(var(--hover-rx) + var(--scroll-rx))) rotateY(calc(var(--hover-ry) + var(--scroll-ry))) rotateZ(-1.5deg) translateY(0px);
  }
}

.receipt-3d-card:not(:hover) {
  animation: floatReceiptAmbient 7s ease-in-out infinite;
}

/* Laser Scanner Beam */
.receipt-scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 25;
  pointer-events: none;
  transform: translateZ(20px);
  animation: laserScanMotion 3.8s ease-in-out infinite alternate;
}

@keyframes laserScanMotion {
  0% {
    top: 4%;
  }
  100% {
    top: 94%;
  }
}

.scan-beam-line {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #10b981 20%, #38bdf8 50%, #10b981 80%, transparent);
  box-shadow: 0 0 14px #10b981, 0 0 28px #38bdf8, 0 0 45px rgba(16, 185, 129, 0.7);
}

.scan-beam-glow {
  position: absolute;
  top: -24px;
  bottom: -24px;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.08) 35%, rgba(16, 185, 129, 0.22) 50%, rgba(56, 189, 248, 0.08) 65%, transparent 100%);
  pointer-events: none;
}

/* Floating Live OCR Status */
.receipt-ocr-status {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) translateZ(45px);
  z-index: 30;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: #34d399;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.ocr-status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 1.4s ease-in-out infinite;
}

/* Thermal Paper Styling (Wrinkled 3D Texture & Organic Hand-Torn Edges) */
.receipt-paper {
  background-color: #faf8f4;
  background-image:
    radial-gradient(ellipse at 78% 18%, rgba(255, 255, 255, 0.95) 0%, rgba(250, 248, 242, 0) 50%),
    radial-gradient(ellipse at 22% 65%, rgba(255, 255, 255, 0.75) 0%, rgba(245, 242, 235, 0) 60%),
    linear-gradient(132deg, 
      rgba(255, 255, 255, 0.95) 0%, 
      rgba(248, 246, 240, 0.9) 26%, 
      rgba(236, 232, 222, 0.72) 30%, 
      rgba(255, 255, 255, 0.9) 32%, 
      rgba(247, 245, 238, 0.95) 50%, 
      rgba(234, 229, 218, 0.68) 53%, 
      rgba(255, 255, 255, 0.88) 55%, 
      rgba(245, 243, 236, 0.95) 100%
    );
  color: #1e293b;
  position: relative;
  overflow: hidden;
  /* Organic hand-torn paper edge with naturally torn corners */
  clip-path: polygon(
    2.4% 1.2%, 5% 0.4%, 9.5% 0.9%, 14% 0.3%, 18.5% 0.8%, 23% 0.35%, 28% 0.75%, 33.5% 0.2%, 39% 0.65%, 44% 0.3%, 50% 0.8%, 55.5% 0.25%, 61.5% 0.7%, 67% 0.2%, 73% 0.75%, 78.5% 0.3%, 84.5% 0.65%, 89.5% 0.2%, 94% 0.7%, 97.2% 0.4%, 98.8% 1.4%, 99.4% 2.8%,
    99.1% 9%, 99.6% 18%, 99.2% 29%, 99.7% 41%, 99.3% 53%, 99.8% 66%, 99.3% 78%, 99.7% 89%, 99.2% 96%, 98.6% 98.2%,
    95% 99.5%, 90.5% 98.9%, 86% 99.6%, 81% 99.1%, 75% 99.7%, 69.5% 99.2%, 63% 99.6%, 57% 99.1%, 51% 99.8%, 45% 99.2%, 39% 99.6%, 33% 99.1%, 27% 99.7%, 21% 99.2%, 15% 99.6%, 9.5% 99.1%, 5% 99.5%, 1.8% 98.5%, 0.6% 97.2%,
    0.9% 89%, 0.4% 78%, 0.8% 66%, 0.3% 54%, 0.7% 42%, 0.3% 30%, 0.8% 18%, 0.4% 8%, 0.9% 3.2%
  );
}

/* Paper crumple surface lighting & 3D ambient shading */
.receipt-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(125deg, transparent 27%, rgba(0, 0, 0, 0.04) 29.5%, rgba(255, 255, 255, 0.42) 31%, transparent 33%),
    linear-gradient(177deg, transparent 50%, rgba(0, 0, 0, 0.035) 52%, rgba(255, 255, 255, 0.38) 53.5%, transparent 56%),
    linear-gradient(42deg, transparent 71%, rgba(0, 0, 0, 0.03) 73%, rgba(255, 255, 255, 0.35) 74.5%, transparent 77%),
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.6) 0%, rgba(240, 237, 230, 0.2) 22%, transparent 42%);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}

/* Thermal paper roll micro-fibers */
.receipt-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2.5px, rgba(15, 23, 42, 0.012) 2.5px, rgba(15, 23, 42, 0.012) 3.5px);
  pointer-events: none;
  z-index: 3;
  opacity: 0.75;
}

/* Wrinkles & Physical Fold Creases Layer */
.receipt-wrinkles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}

.paper-crease {
  position: absolute;
  pointer-events: none;
}

/* Major diagonal pocket fold */
.crease-diag-main {
  top: 31%;
  left: -15%;
  width: 130%;
  height: 3px;
  transform: rotate(-13.5deg);
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.92) 0%, 
    rgba(255, 255, 255, 0.78) 35%, 
    rgba(30, 35, 45, 0.12) 65%, 
    transparent 100%
  );
  filter: blur(0.3px);
  opacity: 0.9;
}

/* Horizontal fold across middle */
.crease-horiz-mid {
  top: 53%;
  left: -10%;
  width: 120%;
  height: 3px;
  transform: rotate(0.8deg);
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.88) 0%, 
    rgba(255, 255, 255, 0.7) 40%, 
    rgba(25, 30, 40, 0.1) 65%, 
    transparent 100%
  );
  filter: blur(0.35px);
  opacity: 0.85;
}

/* Secondary lower diagonal crumple */
.crease-diag-sub {
  bottom: 23%;
  left: -10%;
  width: 120%;
  height: 2.5px;
  transform: rotate(8.5deg);
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.85) 0%, 
    rgba(35, 40, 50, 0.08) 55%, 
    transparent 100%
  );
  opacity: 0.75;
}

/* Corner crumple at top right */
.crease-corner-crumple {
  top: 6%;
  right: -2%;
  width: 115px;
  height: 2.5px;
  transform: rotate(44deg);
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.9) 0%, 
    rgba(30, 35, 45, 0.09) 60%, 
    transparent 100%
  );
  opacity: 0.8;
}

/* Slightly folded dog-ear corner (top left) */
.paper-corner-dogear {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.1) 0%, 
    rgba(0, 0, 0, 0.03) 42%, 
    transparent 48%, 
    rgba(255, 255, 255, 0.82) 52%, 
    transparent 72%
  );
  pointer-events: none;
}

.receipt-content {
  position: relative;
  z-index: 5;
  padding: 1.35rem 1.45rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}

.receipt-header-info {
  text-align: center;
  margin-bottom: 0.65rem;
}

/* GoGas Station Branding */
.receipt-gogas-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.gogas-logo-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.15));
}

.gogas-brand-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #059669;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-shadow: 0 1px 1px rgba(16, 185, 129, 0.15);
}

.gogas-brand-name .brand-accent {
  color: #0284c7;
}

.receipt-station-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.receipt-station-legal {
  font-size: 0.65rem;
  font-weight: 700;
  color: #059669;
  letter-spacing: 0.05em;
  margin: 0.1rem 0;
  text-transform: uppercase;
}

.receipt-station-sub {
  font-size: 0.64rem;
  color: #64748b;
  margin: 0.1rem 0;
  font-family: monospace;
}

.receipt-rule-dashed {
  border-bottom: 1.5px dashed #cbd5e1;
  margin: 0.75rem 0;
}

.receipt-data-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.receipt-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #334155;
}

.row-label {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.row-value {
  color: #0f172a;
}

/* Highlight detected OCR fields */
.ocr-field-highlight {
  position: relative;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.5);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  margin: 0 -0.4rem;
  transition: all 0.25s ease;
}

.ocr-field-highlight:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
}

.ocr-badge-detected {
  font-size: 0.62rem;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-family: -apple-system, sans-serif;
  letter-spacing: 0.02em;
}

.ocr-badge-detected.badge-total {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

/* Products Table */
.receipt-items-table {
  width: 100%;
}

.receipt-items-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
  margin-bottom: 0.4rem;
}

.receipt-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  font-size: 0.73rem;
  align-items: center;
}

.item-desc strong {
  display: block;
  font-size: 0.74rem;
  color: #0f172a;
}

.item-desc small {
  display: block;
  font-size: 0.64rem;
  color: #64748b;
}

/* Totals */
.receipt-totals-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.receipt-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #475569;
}

.receipt-total-line.grand-total {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  border-top: 1.5px solid #0f172a;
  margin-top: 0.4rem;
  padding-top: 0.45rem;
}

.grand-total-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: #059669;
}

/* Barcode */
.receipt-barcode-section {
  text-align: center;
  margin: 0.85rem 0 0.35rem;
}

.barcode-stripes {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 30px;
  gap: 2px;
}

.b-bar {
  background: #0f172a;
}

.b-w1 { width: 1.5px; }
.b-w2 { width: 3px; }
.b-w3 { width: 4.5px; }
.b-w4 { width: 6px; }

.barcode-text {
  font-size: 0.64rem;
  color: #64748b;
  letter-spacing: 0.12em;
  display: block;
  margin-top: 0.25rem;
}

.receipt-tail-note {
  font-size: 0.62rem;
  text-align: center;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin: 0.5rem 0 0;
  font-family: monospace;
}

/* Floating 3D Chips around the card */
.floating-data-chip {
  position: absolute;
  z-index: 28;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.1);
  pointer-events: none;
}

.floating-data-chip.chip-station {
  top: 18%;
  left: -28px;
  transform: translateZ(48px);
}

.floating-data-chip.chip-sat {
  bottom: 12%;
  right: -24px;
  transform: translateZ(52px);
}

.chip-bubble {
  font-size: 1.1rem;
}

.chip-info {
  display: flex;
  flex-direction: column;
}

.chip-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.chip-status {
  font-size: 0.68rem;
  color: #34d399;
}

/* --- Right Column: Cómo Funciona (Vertical 3-Step Flow) --- */
.showcase-right-col {
  display: flex;
  flex-direction: column;
}

.how-it-works-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.how-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.6rem;
}

.how-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.how-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* Timeline */
.how-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.85rem;
}

.how-step-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.how-step-card:hover .step-circle {
  transform: scale(1.06);
}

.step-circle-1 {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.step-circle-2 {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.step-circle-3 {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.step-connector {
  width: 2px;
  flex: 1;
  min-height: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  margin: 0.35rem 0;
}

.step-body {
  flex: 1;
  padding-top: 0.15rem;
}

.step-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.step-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.step-tag-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.step-tag-pill.tag-instant {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.step-tag-pill.tag-once {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.step-tag-pill.tag-sat {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.step-description {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.how-cta-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.btn-start-glow {
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
  transition: all 0.25s ease;
}

.btn-start-glow:hover {
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.55);
  transform: translateY(-2px);
}

.how-frictionless-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* Floating Round Camera Action Button (FAB) — Hidden on desktop, mobile-only */
.mobile-camera-fab-container {
  display: none;
}

.mobile-camera-fab-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 45%, #06b6d4 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px -4px rgba(16, 185, 129, 0.55), 0 0 25px rgba(6, 182, 212, 0.35);
  position: relative;
  animation: fabZoomRotateShake 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-camera-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 36px -4px rgba(16, 185, 129, 0.65), 0 0 30px rgba(6, 182, 212, 0.45);
}

.mobile-camera-fab-btn:active {
  transform: scale(0.93);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.mobile-camera-fab-btn svg {
  color: #ffffff;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}

.mobile-camera-fab-btn:hover svg {
  transform: scale(1.08);
}

.fab-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.7);
  animation: cameraFabPulse 2.4s infinite cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

@keyframes cameraFabPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  60% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Fluid Zoom-in + Rotation + Soft Shake Entrance */
@keyframes fabZoomRotateShake {
  0% {
    opacity: 0;
    transform: scale(0.18) rotate(-110deg) translateY(32px);
  }
  42% {
    opacity: 1;
    transform: scale(1.15) rotate(14deg) translateY(-4px);
  }
  58% {
    transform: scale(0.96) rotate(-8deg) translateY(1px);
  }
  72% {
    transform: scale(1.04) rotate(4deg) translateY(-1px);
  }
  86% {
    transform: scale(0.99) rotate(-1.5deg) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
  }
}

/* Stations Section */
.stations-section {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.station-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.station-logo {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  flex: 0 0 48px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.station-card:hover .station-logo {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.station-logo svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.station-details {
  flex: 1;
  min-width: 0;
}

.station-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  margin-bottom: 0.2rem;
}

.station-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.station-badge {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.station-badge.active {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.station-badge.disabled {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Pulsing Live Dot */
.station-live-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
}

.station-live-core {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  z-index: 1;
}

.station-live-ping {
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  border-radius: 50%;
  background-color: #34d399;
  opacity: 0.8;
  animation: station-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes station-ping {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  70%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.station-card.station-card-disabled {
  opacity: 0.88;
  border-style: dashed;
}

.station-card.station-card-disabled:hover {
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.station-website-row {
  margin: 0.12rem 0 0.3rem;
  display: flex;
  align-items: center;
}

.station-website-text,
.station-website-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
  cursor: default;
}

.station-website-text svg,
.station-website-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  color: #64748b;
}

.station-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* 2. ONBOARDING / PROFILE FORM */
.form-container-card {
  max-width: 1000px;
  margin: 1.5rem auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

.form-card-header {
  margin-bottom: 2rem;
  text-align: left;
}

.step-indicator {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.form-card-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.form-card-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Pending Invoicing Banner on Profile Screen */
.profile-pending-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 2rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
  animation: fadeIn 0.3s ease;
}

.profile-pending-notice.hidden {
  display: none !important;
}

.pending-notice-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-light, #10b981);
  border-radius: var(--radius-md);
}

.pending-notice-body {
  flex: 1;
}

.pending-notice-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  margin-bottom: 0.35rem;
}

.pending-notice-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.pending-notice-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

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

.form-group-full {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .req {
  color: var(--accent-light);
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 15px;
  cursor: pointer;
}

.form-select option {
  background-color: #0c1527;
  color: #f8fafc;
  padding: 0.6rem 0.8rem;
}

.form-input:focus,
.form-select:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.input-with-icon {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.input-with-icon .form-input {
  padding-right: 2.6rem !important;
}

.field-status-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.field-status-icon svg {
  display: block;
}

.choice-check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.choice-check-icon svg {
  display: block;
}

.text-uppercase {
  text-transform: uppercase;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Dev Test Profile Helper (Localhost only) */
.dev-profile-container {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(245, 158, 11, 0.25);
  display: flex;
  justify-content: center;
}

.btn-dev-load {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dev-load:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  transform: translateY(-1px);
}

/* Notifications Zone: Profile Push Settings */
.profile-notifications-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.profile-notifications-zone.hidden {
  display: none !important;
}

.notifications-zone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: rgba(30, 58, 138, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.notifications-zone-info {
  flex: 1;
}

.notifications-zone-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.notifications-zone-title {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #93c5fd;
}

.push-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.push-status-badge.badge-active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.push-status-badge.badge-inactive {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.push-status-badge.badge-blocked {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.notifications-zone-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.notifications-zone-content .push-notification-btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .notifications-zone-content {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 1rem;
  }
  .notifications-zone-content .push-notification-btn {
    justify-content: center;
    width: 100%;
  }
}

/* Danger Zone: Delete Profile */
.profile-danger-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.profile-danger-zone.hidden {
  display: none !important;
}

.danger-zone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.danger-zone-info {
  flex: 1;
}

.danger-zone-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 0.25rem;
}

.danger-zone-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-danger-outline:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .danger-zone-content {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 1rem;
  }
  .btn-danger-outline {
    justify-content: center;
    width: 100%;
  }
}

/* Custom Confirmation Dialog: Delete Profile */
.delete-profile-modal-card {
  max-width: 480px;
  background: #0f172a;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.12);
  border-radius: var(--radius-lg);
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.delete-profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.5rem;
  border-bottom: none;
}

.danger-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.delete-profile-modal-card .delete-profile-modal-body {
  padding: 0.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}

.delete-profile-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.delete-profile-modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.delete-profile-rfc-tag {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
}

.delete-profile-safe-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 3.5px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

.safe-callout-icon {
  color: #34d399;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.safe-callout-text strong {
  display: block;
  font-size: 0.84rem;
  color: #34d399;
  margin-bottom: 0.2rem;
}

.safe-callout-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.delete-profile-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.2);
}

.btn-danger-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ef4444;
  color: #ffffff;
  border: 1px solid #dc2626;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger-solid:hover {
  background: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.btn-danger-solid:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .delete-profile-modal-footer {
    flex-direction: column-reverse;
    gap: 0.6rem;
  }
  .delete-profile-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ==========================================================================
   Real-Time Form Validation Feedback (RFC, Email, Código Postal)
   ========================================================================== */
.form-input.is-valid {
  border-color: #10b981;
}

.form-input.is-invalid {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05);
}

.form-input.is-invalid:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.validation-feedback {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  margin-top: 0.35rem;
  min-height: 0;
  line-height: 1.3;
  transition: all 0.2s ease;
}

.validation-feedback:empty {
  display: none !important;
}

/* Check is placed strictly inside on the right, not underneath */
.validation-feedback.is-valid {
  display: none !important;
}

.validation-feedback.is-invalid {
  color: #ef4444;
  font-weight: 500;
}

.validation-feedback.is-hint {
  color: var(--text-muted);
}

.validation-feedback svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Custom Accessible Searchable Select (Combobox) for Régimen Fiscal
   ========================================================================== */
.custom-select-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.custom-select-container select,
.custom-select-container select.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select-trigger {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1.5px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 44px;
}

.custom-select-trigger:hover {
  border-color: #34d399;
  background: rgba(26, 38, 64, 0.5);
}

.custom-select-container.open .custom-select-trigger,
.custom-select-trigger:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.custom-select-container.is-invalid .custom-select-trigger,
.custom-select-trigger.is-invalid,
.custom-datepicker-container.is-invalid .custom-datepicker-trigger,
.custom-datepicker-trigger.is-invalid {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.05);
}

.custom-select-container.is-invalid .custom-select-trigger:focus,
.custom-select-trigger.is-invalid:focus,
.custom-datepicker-container.is-invalid .custom-datepicker-trigger:focus,
.custom-datepicker-trigger.is-invalid:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.custom-select-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.custom-select-placeholder {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  display: block;
}

.custom-select-selected-value {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.custom-select-selected-value .regimen-code-tag {
  flex-shrink: 0;
}

.custom-select-selected-value .regimen-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
  flex: 1 1 0%;
}

.regimen-code-tag {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.custom-select-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.custom-select-clear {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.custom-select-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.custom-select-arrow {
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-container.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.portal-badge-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.portal-badge-logo svg,
.portal-badge-logo img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.custom-select-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Floating Dropdown Panel */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 999;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownAppear {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-select-search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-select-search-wrapper .search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.custom-select-search {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
}

.custom-select-search::placeholder {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.custom-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  flex-shrink: 0;
}

.custom-search-clear:hover {
  color: var(--text-primary);
}

.custom-select-filters {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: none;
}

.custom-select-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
  font-weight: 600;
}

.custom-select-options {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: rgba(16, 185, 129, 0.12);
}

.custom-select-option.is-selected {
  background: rgba(16, 185, 129, 0.18);
}

.option-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.option-desc {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.option-desc mark {
  background: rgba(245, 158, 11, 0.35);
  color: #fef08a;
  padding: 0.05rem 0.2rem;
  border-radius: 2px;
}

.option-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.persona-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.persona-tag.fisica {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.persona-tag.moral {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.persona-tag.ambas {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.uso-code-tag {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
}

.uso-recommended-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-left: auto;
  white-space: nowrap;
}

.option-check {
  color: var(--accent-light);
  display: flex;
  align-items: center;
}

.custom-select-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  gap: 0.5rem;
}

/* Custom Datepicker Component */
.custom-datepicker-container {
  position: relative;
  width: 100%;
}

.custom-datepicker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 295px;
  max-width: calc(100vw - 2rem);
  z-index: 1000;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 0.85rem;
  box-sizing: border-box;
  animation: dropdownAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding: 0 0.2rem;
}

.datepicker-month-year-title {
  font-size: 0.88rem;
  color: var(--text-primary);
  text-transform: capitalize;
}

.datepicker-quick-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.btn-dp-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dp-preset:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-light);
}

.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.datepicker-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.75rem;
}

.datepicker-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
  background: transparent;
  border: none;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.datepicker-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.datepicker-day.is-today {
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: var(--accent-light);
}

.datepicker-day.is-selected {
  background: var(--accent) !important;
  color: #0f172a !important;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.datepicker-day.is-other-month {
  color: rgba(255, 255, 255, 0.22);
}

.datepicker-time-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.datepicker-time-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.datepicker-time-inputs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dp-time-input {
  width: 38px;
  height: 28px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  text-align: center;
  font-size: 0.82rem;
  padding: 0;
  outline: none;
}

.dp-time-input:focus {
  border-color: var(--accent);
}

.dp-time-input::-webkit-outer-spin-button,
.dp-time-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.dp-time-input[type=number] {
  -moz-appearance: textfield;
}

.btn-dp-apply {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
}

/* 3. WORKBENCH / UPLOAD / REVIEW */
.workbench-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(14, 21, 38, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-icon-wrap {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent-light);
}

.dropzone-icon {
  width: 28px;
  height: 28px;
}

.dropzone-main-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.dropzone-main-text .highlight {
  color: var(--accent-light);
  text-decoration: underline;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Scanning Overlay */
.dropzone-scanning {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.95);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.scanning-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1rem;
}

.scanning-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Spinner */
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Review Section */
.review-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Review Navbar & Main Tabs */
.review-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.review-main-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(18, 26, 44, 0.85);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.review-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.review-tab:hover {
  color: var(--text-primary);
}

.review-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.review-pane {
  display: block;
}

/* Fullwidth Scanned Receipt Pane */
.fullwidth-receipt-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.scanned-image-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.fullwidth-image-wrapper {
  background: #080d1a;
  border: 1.5px solid #334155;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  overflow: hidden;
}

.fullwidth-scanned-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.review-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.review-actions-bar {
  display: flex;
  gap: 0.75rem;
}

.receipts-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Editable Receipt Card */
.receipt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.receipt-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.receipt-card.card-duplicate {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: rgba(239, 68, 68, 0.05) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25) !important;
}

.form-input.input-duplicate {
  border-color: rgba(239, 68, 68, 0.8) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.duplicate-warning-banner {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  margin-bottom: 1rem;
  color: #fca5a5;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.receipt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.receipt-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.receipt-index-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-light);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.receipt-card-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.receipt-card-fields .form-group-full {
  grid-column: 1 / -1;
}

/* Receipt Card Internal Tabs */
.receipt-card-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(10, 15, 29, 0.6);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.receipt-card-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.receipt-card-tab:hover {
  color: var(--text-primary);
}

.receipt-card-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.tab-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* Receipt Preview Container */
.receipt-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  background: rgba(10, 15, 29, 0.45);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  padding: 1.25rem;
}

.receipt-img-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: 100%;
}

.receipt-preview-img {
  max-width: 100%;
  max-height: 380px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.receipt-preview-img:hover {
  transform: scale(1.01);
}

.receipt-img-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-preview-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.placeholder-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.placeholder-text {
  font-size: 0.85rem;
}

.receipt-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Execution Bar */
.execution-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 2rem;
  position: sticky;
  bottom: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.execution-summary {
  display: flex;
  flex-direction: column;
}

.total-tickets-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.total-amount-sum {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-light);
}

/* 4. PROCESSING QUEUE */
.queue-layout {
  max-width: 900px;
  margin: 0 auto;
}

.queue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.queue-jobs-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.empty-queue-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-queue-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.empty-queue-state p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Job Card */
.job-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
}

.job-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
}

.job-card.failed {
  border-color: rgba(239, 68, 68, 0.4);
}

.job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.job-meta-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.job-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
}

.job-status-pill.waiting {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.job-status-pill.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.job-status-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.job-status-pill.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.job-progress-wrap {
  margin: 1.25rem 0;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.job-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.job-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.job-detail-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.job-detail-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.job-result-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* 5. HISTORIAL UNIFICADO */
.history-layout {
  max-width: 1000px;
  margin: 0 auto;
}

.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.history-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Active Jobs Section (Live BullMQ Jobs at the top of History) */
.active-jobs-section {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(18, 26, 44, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.08);
}

.active-jobs-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.live-pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px var(--accent);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.35);
    opacity: 0.7;
  }
}

.active-jobs-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.active-jobs-count {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-light);
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.completed-history-section {
  margin-top: 0.5rem;
}

.history-content {
  background: transparent;
  border: none;
  padding: 0;
}

.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.25rem;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.history-loading .spinner {
  margin: 0 auto;
  width: 44px;
  height: 44px;
  border-width: 3.5px;
  border-color: rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  flex-shrink: 0;
}

.history-loading p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
}

.history-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--text-muted);
}

/* Unified History Rows */
.history-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.history-row {
  background: #0d1527;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.history-row:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: #111a30;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

.history-row.status-waiting {
  border-color: rgba(245, 158, 11, 0.35);
}

.history-row.status-active {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.12);
}

.history-row.status-completed {
  border-color: rgba(16, 185, 129, 0.3);
}

.history-row.status-failed {
  border-color: rgba(239, 68, 68, 0.35);
}

.history-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-station-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.history-station-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  flex: 0 0 40px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.history-station-icon svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.history-station-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.history-station-name {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-ticket-code {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-status-wrap {
  flex-shrink: 0;
}

.history-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-waiting {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pill-active {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.pill-completed {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-failed {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pill-verified {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.spinner-xs {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(6, 182, 212, 0.25);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.history-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.history-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.history-progress-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.history-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-meta-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.history-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.history-amount-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.history-payment-pill {
  flex-shrink: 0;
  cursor: help;
}

.history-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.history-error-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: #fca5a5;
}

/* Lazy Fetch Skeleton Loader & Infinite Scroll */
.history-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.history-row-skeleton {
  background: #0d1527;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer-block {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: historySkeletonShimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

@keyframes historySkeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.history-skeleton-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-skeleton-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.history-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-skeleton-line-title {
  width: 140px;
  height: 15px;
}

.history-skeleton-line-sub {
  width: 90px;
  height: 12px;
}

.history-skeleton-pill {
  width: 85px;
  height: 26px;
  border-radius: 9999px;
}

.history-skeleton-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-skeleton-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-skeleton-tag {
  width: 80px;
  height: 22px;
  border-radius: 9999px;
}

.history-skeleton-tag-sm {
  width: 65px;
  height: 22px;
  border-radius: 9999px;
}

.history-scroll-sentinel {
  height: 20px;
  width: 100%;
  pointer-events: none;
  opacity: 0;
}

.history-end-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.7) !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon-xs {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.btn-icon-xs:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.btn-retry-history {
  color: #34d399;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-retry-history:hover {
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  transform: rotate(180deg);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-body img,
.modal-body video {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.drawer-handle-bar {
  display: none;
}

/* Round Floating Action Button (FAB) for New Receipt (Desktop & Mobile) */
.fab-container {
  position: fixed;
  bottom: 2.25rem;
  right: 2.25rem;
  z-index: 1020;
  display: flex;
  align-items: center;
}

.fab-container.hidden {
  display: none !important;
}

.fab-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 45%, #06b6d4 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px -4px rgba(16, 185, 129, 0.55), 0 0 25px rgba(6, 182, 212, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 36px -4px rgba(16, 185, 129, 0.65), 0 0 30px rgba(6, 182, 212, 0.45);
  color: #ffffff;
}

.fab-btn:active {
  transform: scale(0.93);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.fab-btn svg {
  color: #ffffff;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}

.fab-btn:hover svg {
  transform: scale(1.08);
}

.fab-label {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #0d1527;
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.fab-btn:hover .fab-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

#btn-refresh-history {
  display: none !important;
}

.btn-delete-history {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-delete-history:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Product Sticky Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: #080d19;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-brand-logo-img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.35));
}

.footer-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.footer-mission {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-disclaimer {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.footer-disclaimer strong {
  color: #cbd5e1;
}

.footer-col-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.1rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-legal-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.35rem 0;
  transition: all 0.2s ease;
  text-align: left;
}

.footer-legal-btn svg {
  color: var(--accent-light);
  flex-shrink: 0;
}

.footer-legal-btn:hover {
  color: #fff;
  transform: translateX(4px);
}

.footer-badges {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: fit-content;
}

.footer-badge svg {
  color: var(--accent);
}

.footer-security-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sub-footer bar: Directly below the footer */
.footer-subbar {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #050811;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.footer-subbar-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-copyright strong {
  color: #94a3b8;
}

.footer-powered {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Legal Modal Styling */
.legal-modal-card {
  max-width: 840px;
  max-height: 85vh;
  background: #0b1120;
}

.legal-modal-header {
  padding: 1.25rem 1.5rem;
  background: #0f172a;
}

.legal-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.legal-badge-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.legal-modal-tabs {
  display: flex;
  background: #090e1a;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.legal-modal-tabs::-webkit-scrollbar {
  display: none;
}

.legal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.legal-tab-btn:hover {
  color: var(--text-primary);
}

.legal-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.legal-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  max-height: 55vh;
}

.legal-pane {
  display: none;
}

.legal-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.legal-doc-content {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.7;
}

.legal-doc-content h4 {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  margin: 1.4rem 0 0.5rem;
}

.legal-doc-content h4:first-child {
  margin-top: 0;
}

.legal-doc-content p {
  margin-bottom: 0.85rem;
}

.legal-doc-content ul,
.legal-doc-content ol {
  padding-left: 1.35rem;
  margin-bottom: 0.9rem;
}

.legal-doc-content li {
  margin-bottom: 0.45rem;
}

.legal-doc-content strong {
  color: #fff;
}

.legal-callout {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.legal-callout strong {
  display: block;
  color: #f87171;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.legal-callout p {
  margin-bottom: 0;
  font-size: 0.82rem;
  color: #fecaca;
  line-height: 1.55;
}

.legal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #0f172a;
}

.legal-footer-update {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Fullscreen Scanner Overlay with Laser Light Beam */
.scanner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(5, 10, 20, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease;
}

.scanner-card {
  background: #0d1527;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 50px rgba(16, 185, 129, 0.18), 0 20px 50px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.scanner-header {
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 44, 0.85);
}

.scanner-beacon {
  width: 14px;
  height: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-beacon-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulseDot 1.2s infinite ease-in-out;
}

.scanner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.scanner-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.scanner-viewport {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070c17;
  padding: 1.5rem;
  min-height: 380px;
  max-height: 58vh;
}

.scanner-img {
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  filter: contrast(1.05);
}

/* Viewfinder Corners */
.scanner-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent-light);
  border-style: solid;
  pointer-events: none;
  z-index: 5;
}

.corner-tl {
  top: 1.25rem;
  left: 1.25rem;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 4px;
}

.corner-tr {
  top: 1.25rem;
  right: 1.25rem;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 4px;
}

.corner-bl {
  bottom: 1.25rem;
  left: 1.25rem;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 4px;
}

.corner-br {
  bottom: 1.25rem;
  right: 1.25rem;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 4px;
}

/* Animated Laser Light Bar Sweeping Vertically (Top to Bottom) */
.scanner-laser-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.85) 15%, #34d399 50%, #06b6d4 85%, transparent 100%);
  box-shadow: 0 0 16px #10b981, 0 0 32px #34d399, 0 0 50px #06b6d4;
  animation: laserSweepVertical 2.2s ease-in-out infinite alternate;
  z-index: 10;
  pointer-events: none;
}

@keyframes laserSweepVertical {
  0% {
    top: 3%;
  }

  100% {
    top: 96%;
  }
}

.laser-glow {
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 80px;
  width: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(16, 185, 129, 0.28) 50%, transparent 100%);
  pointer-events: none;
}

.scanner-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 44, 0.85);
}

.scanner-progress-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Screen reader / Programmatic-only hidden elements */
.sr-only,
select.sr-only,
#prof-regimen.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.6rem;
  z-index: 9999;
  pointer-events: none;
  width: auto;
  max-width: 90vw;
}

.toast {
  pointer-events: auto;
  background: rgba(18, 26, 44, 0.96);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  padding: 0.75rem 1.35rem;
  border-radius: 9999px;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.6), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
  max-width: 90vw;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(30, 15, 20, 0.95);
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(15, 30, 25, 0.95);
}

.toast.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(15, 25, 35, 0.95);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ==========================================================================
   Responsive & Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  @supports (overflow: clip) {

    html,
    body {
      overflow-x: clip;
    }
  }

  .main-container {
    padding: 0.75rem 0.85rem calc(95px + env(safe-area-inset-bottom, 0px));
  }

  /* 1. Header & Navigation */
  .app-header {
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0;
  }

  .header-container {
    padding: 0.5rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand {
    gap: 0.65rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  /* Eliminate redundant brand subtitle in mobile */
  .brand-subtitle {
    display: none !important;
  }

  /* Mobile Avatar Circle with Initials */
  .profile-pill {
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .profile-pill:active {
    transform: scale(0.92);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
  }

  .profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
  }

  .avatar-icon {
    display: none !important;
  }

  .avatar-initials {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
    user-select: none;
  }

  .profile-info-text {
    display: none !important;
  }

  #btn-edit-profile {
    display: none !important;
  }

  .profile-name {
    display: none !important;
  }

  .profile-rfc {
    display: none !important;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: space-around;
    padding: 0.2rem;
    gap: 0.2rem;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .nav-tab svg {
    width: 14px;
    height: 14px;
  }

  /* 2. Welcome Screen — Responsive Mobile Layout */
  .welcome-container {
    margin: 0.75rem auto 2rem;
    padding: 0 0.5rem;
  }

  .welcome-header {
    margin: 0.25rem auto 1.25rem;
    text-align: center;
    max-width: 320px;
  }

  .welcome-header .hero-badge {
    display: inline-flex !important;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.45rem;
  }

  .welcome-header .hero-title {
    font-size: 1.45rem;
    line-height: 1.22;
    margin-bottom: 0.4rem;
  }

  .welcome-header .hero-description {
    display: block !important;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0 auto;
    max-width: 300px;
  }

  .welcome-showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }

  /* Ample spacing above 3D ticket so it never overlaps the header text */
  .showcase-left-col {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
  }

  .receipt-3d-scene {
    max-width: 275px;
    padding: 1.25rem 0 0.5rem;
    margin: 0 auto;
  }

  .receipt-3d-card {
    max-width: 250px;
  }

  .receipt-ocr-status {
    top: -10px;
    padding: 0.22rem 0.65rem;
    font-size: 0.65rem;
  }

  .receipt-content {
    padding: 0.95rem 1.05rem;
  }

  .receipt-station-title {
    font-size: 0.78rem;
  }

  .receipt-station-sub {
    font-size: 0.6rem;
  }

  .receipt-gogas-brand {
    gap: 0.4rem;
    margin-bottom: 0.25rem;
  }

  .gogas-logo-symbol svg {
    width: 22px;
    height: 22px;
  }

  .gogas-brand-name {
    font-size: 1.05rem;
  }

  .receipt-station-legal {
    font-size: 0.58rem;
  }

  .receipt-data-row {
    font-size: 0.68rem;
  }

  .row-label {
    font-size: 0.62rem;
  }

  .ocr-badge-detected {
    font-size: 0.58rem;
    padding: 0.05rem 0.25rem;
  }

  .item-desc strong {
    font-size: 0.68rem;
  }

  .item-desc small {
    font-size: 0.58rem;
  }

  .receipt-item-row {
    font-size: 0.68rem;
  }

  .receipt-total-line {
    font-size: 0.7rem;
  }

  .receipt-total-line.grand-total {
    font-size: 0.8rem;
  }

  .grand-total-amount {
    font-size: 0.92rem;
  }

  .barcode-stripes {
    height: 24px;
  }

  .barcode-text {
    font-size: 0.58rem;
  }

  .floating-data-chip {
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    gap: 0.4rem;
  }

  .floating-data-chip.chip-station {
    left: -6px;
    top: 12%;
  }

  .floating-data-chip.chip-sat {
    right: -6px;
    bottom: 8%;
  }

  .chip-bubble {
    font-size: 0.85rem;
  }

  .chip-title {
    font-size: 0.68rem;
  }

  .chip-status {
    font-size: 0.58rem;
  }

  .how-it-works-container {
    padding: 1.5rem 1.25rem;
  }

  .how-main-title {
    font-size: 1.6rem;
  }

  .how-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.35rem;
  }

  .how-step-card {
    gap: 0.85rem;
  }

  .step-circle {
    width: 38px;
    height: 38px;
  }

  .step-heading {
    font-size: 0.96rem;
  }

  .step-description {
    font-size: 0.82rem;
  }

  /* Hide duplicate welcome button inside the step card on mobile */
  .how-cta-box {
    display: none !important;
  }

  /* Floating Round Camera Action Button Mobile Layout (Mobile-only) */
  .mobile-camera-fab-container {
    display: flex;
    position: fixed;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: 1.25rem;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }

  .mobile-camera-fab-container.hidden {
    display: none !important;
  }

  .mobile-camera-fab-btn {
    width: 58px;
    height: 58px;
  }

  /* Mobile stations section: remove container wrapper to occupy full width */
  .stations-section {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 1.75rem 0 1rem !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: 100% !important;
  }

  .section-title-wrap {
    margin-bottom: 0.85rem;
    text-align: left;
    padding: 0 0.15rem;
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }

  .section-subtitle {
    display: block !important;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
  }

  .stations-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .station-card {
    padding: 0.95rem 1rem;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
  }

  .station-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    flex: 0 0 44px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
  }

  .station-logo svg {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  .station-details h4 {
    font-size: 0.95rem;
  }

  .station-website-text,
  .station-website-link {
    font-size: 0.72rem;
  }

  .station-details p {
    font-size: 0.75rem;
  }

  .screen-view.active {
    animation: none !important;
    transform: none !important;
  }

  /* 3. Profile Screen — Clean, Compact & Fixed Bottom Action */
  .form-container-card {
    padding: 1.25rem 1rem calc(85px + env(safe-area-inset-bottom, 0px));
    margin: 0.5rem auto;
    border-radius: var(--radius-md);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg-card) !important;
  }

  .form-card-header {
    margin-bottom: 1rem;
    text-align: left;
  }

  .step-indicator {
    display: none !important;
  }

  .form-card-title {
    font-size: 1.3rem;
    margin-bottom: 0;
  }

  .form-card-subtitle {
    display: none !important;
  }

  .profile-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 0.75rem;
  }

  .form-group,
  .form-group-full {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 0.25rem;
  }

  .form-label {
    font-size: 0.8rem;
  }

  /* Eliminate verbose hints on mobile to save vertical space */
  .form-hint {
    display: none !important;
  }

  .form-input {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    border: 1.5px solid #10b981 !important;
    background-color: #0e1526 !important;
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    padding-right: 2.6rem !important;
    font-size: 16px;
    /* Prevents auto-zoom in mobile browsers */
    box-sizing: border-box !important;
  }

  .form-input.is-valid {
    border-color: #10b981 !important;
  }

  .form-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
  }

  .form-input:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
  }

  .form-input.is-invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  }

  .custom-select-trigger {
    border: 1.5px solid #10b981 !important;
    font-size: 15px;
    padding: 0.65rem 0.85rem;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .custom-select-content {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
  }

  .custom-select-selected-value {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
  }

  .custom-select-selected-value .regimen-name {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .custom-select-filters {
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
    gap: 0.35rem !important;
    padding: 0.45rem 0.65rem !important;
  }

  .filter-chip {
    flex: 0 0 auto !important;
    font-size: 0.72rem !important;
    padding: 0.28rem 0.6rem !important;
  }

  .custom-select-container.is-invalid .custom-select-trigger,
  .custom-select-trigger.is-invalid {
    border-color: #ef4444 !important;
  }

  .custom-select-option {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .custom-select-option .option-main {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .custom-select-option .option-meta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .dev-profile-container {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  /* Fixed Bottom Footer Bar for Profile Form */
  .form-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    background: #0d1424;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    justify-content: stretch;
  }

  #btn-save-profile {
    flex: 1;
    width: 100%;
    margin: 0;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .btn-text-desktop {
    display: none !important;
  }

  .btn-text-mobile {
    display: inline !important;
  }

  #btn-cancel-profile {
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }

  /* 4. Workbench & Receipt Review */
  .workbench-layout {
    gap: 1.25rem;
  }

  .panel {
    padding: 1.15rem 1rem;
    border-radius: var(--radius-md);
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
  }

  .panel-title {
    font-size: 1.2rem;
  }

  .panel-subtitle {
    display: none !important;
  }

  #btn-load-demo-receipt {
    align-self: flex-start;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Compact Dropzone */
  .dropzone {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-sm);
  }

  .dropzone-icon-wrap {
    width: 44px;
    height: 44px;
    margin-bottom: 0.5rem;
  }

  .dropzone-icon {
    width: 22px;
    height: 22px;
  }

  .dropzone-main-text {
    font-size: 0.88rem;
  }

  .dropzone-hint {
    display: none !important;
  }

  /* Review Section Mobile */
  .review-navbar {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  .review-main-tabs {
    width: 100%;
    display: flex;
  }

  .review-tab {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .scanned-image-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .scanned-image-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Fullwidth receipt pane on mobile */
  .fullwidth-receipt-container {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .fullwidth-image-wrapper {
    padding: 0.5rem;
  }

  .fullwidth-scanned-img {
    max-height: 60vh;
  }

  /* Scanner overlay on mobile */
  .scanner-overlay {
    padding: 1rem 0.75rem;
  }

  .scanner-card {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .scanner-viewport {
    min-height: 300px;
    max-height: 52vh;
    padding: 1rem;
  }

  .scanner-img {
    max-height: 46vh;
  }

  .review-header {
    display: none !important;
  }

  .receipts-list {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  /* Compact Receipt Cards */
  .receipt-card {
    padding: 0.9rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .receipt-card-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .receipt-card-fields {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .receipt-card-fields .form-group {
    grid-column: 1 / -1;
  }

  .receipt-card-fields .form-label {
    font-size: 0.78rem;
  }

  .receipt-card-fields .form-input,
  .receipt-card-fields .form-select {
    width: 100% !important;
    display: block !important;
    border: 1.5px solid #4a5568 !important;
    background-color: #0f172a !important;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.8rem;
    font-size: 15px;
  }

  .receipt-card-fields .form-input:focus,
  .receipt-card-fields .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
  }

  .receipt-index-badge {
    white-space: nowrap;
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  /* Fixed Bottom Footer Bar for Workbench Execution */
  .execution-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #0d1424;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .execution-bar .btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 0.6rem;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .execution-bar .btn svg {
    width: 16px;
    height: 16px;
  }

  /* Toast Notifications Mobile */
  .toast-container {
    top: auto;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 2rem), 420px);
    max-width: calc(100vw - 2rem);
    align-items: center;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-md);
  }

  /* 5. Queue Screen */
  .queue-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .queue-header .panel-subtitle {
    display: none !important;
  }

  .job-card {
    padding: 1.1rem 0.9rem;
    border-radius: var(--radius-md);
  }

  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .job-card-title-wrap {
    gap: 0.65rem;
  }

  .job-status-pill {
    align-self: flex-start;
  }

  /* 6. History Screen on Mobile */
  #screen-history .history-header {
    margin-bottom: 1.25rem;
  }

  #btn-new-from-history {
    display: none !important;
    /* Managed seamlessly by the floating FAB on mobile */
  }

  .fab-container {
    position: fixed;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: 1.25rem;
    z-index: 9999;
  }

  .fab-btn {
    width: 58px;
    height: 58px;
  }

  .fab-label {
    display: none !important;
  }

  /* Responsive Footer */
  .footer-container {
    padding: 2rem 1rem 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* In mobile: do not show footer logo & brand title */
  .footer-logo {
    display: none !important;
  }

  .footer-disclaimer {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-subbar {
    padding: 1rem 1rem calc(75px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-subbar-container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 0.6rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-copyright {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-powered {
    display: none !important;
  }


  /* Responsive Legal Modal */
  .legal-modal-card {
    max-height: 88vh;
    border-radius: var(--radius-md);
    max-width: 100%;
    box-sizing: border-box;
  }

  .legal-modal-tabs {
    padding: 0.35rem 0.5rem;
    flex-wrap: wrap;
    overflow-x: hidden;
    gap: 0.35rem;
  }

  .legal-tab-btn {
    font-size: 0.76rem;
    padding: 0.55rem 0.65rem;
    flex: 1 1 auto;
    text-align: center;
    white-space: normal;
  }

  .legal-modal-body {
    max-height: 50vh;
    padding: 1.25rem;
  }

  .history-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 3.5rem 1.25rem !important;
    gap: 1.25rem !important;
  }

  .history-loading .spinner {
    margin: 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
  }

  .history-loading p {
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
    font-size: 0.92rem !important;
    color: var(--text-secondary) !important;
  }

  .history-row {
    padding: 1rem;
    gap: 0.75rem;
  }

  .history-station-name {
    font-size: 0.92rem;
  }

  .history-status-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }

  .history-row-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .history-meta-group {
    flex-wrap: nowrap;
    gap: 0.35rem;
    width: 100%;
    overflow: hidden;
    justify-content: space-between;
    align-items: center;
  }

  .history-date {
    font-size: 0.72rem;
    gap: 0.2rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .history-date span {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .history-date svg {
    width: 11px;
    height: 11px;
  }

  .history-amount-pill {
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.15rem 0.35rem;
  }

  .history-payment-pill {
    padding: 0.15rem 0.4rem !important;
    flex-shrink: 0;
  }

  .history-row-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .history-row-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.5rem 0.6rem;
  }

  .history-row-actions .btn-delete-history,
  .history-row-actions .btn-retry-history {
    flex: 0 0 auto;
  }

  /* 7. Modal Bottom Drawer on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.85);
  }

  .modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    max-width: 100%;
    width: 100%;
    border-bottom: none;
    animation: drawerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y;
  }

  @keyframes drawerSlideUp {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  .drawer-handle-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0 0.25rem;
    cursor: grab;
    touch-action: none;
  }

  .drawer-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
  }

  #btn-close-modal {
    display: none !important;
  }

  .modal-header {
    padding: 0.75rem 1.25rem;
  }

  .modal-body {
    padding: 1rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ==========================================================================
   8. Fullscreen Receipt Viewer (Zoom, Rotate, Pan & Full-Page Canvas)
   ========================================================================== */
body.viewer-open {
  overflow: hidden !important;
}

.history-row {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.history-row:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.12);
  transform: translateY(-1px);
}

.btn-cancel-history {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-cancel-history:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.receipt-viewer-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  background: rgba(6, 10, 18, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: viewerFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes viewerFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.receipt-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  gap: 1rem;
}

.viewer-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.viewer-station-badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.viewer-station-badge svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.viewer-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer-title {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.viewer-btn-group {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.viewer-btn-group .viewer-btn {
  border: none;
  border-radius: 0;
  padding: 0.45rem 0.65rem;
}

.viewer-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.viewer-btn-group .viewer-btn:hover {
  background: rgba(71, 85, 105, 0.8);
}

.viewer-zoom-level {
  padding: 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  min-width: 52px;
  text-align: center;
  user-select: none;
}

.viewer-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 0.5rem 0.65rem;
}

.viewer-btn-close:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.7);
}

.receipt-viewer-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.receipt-viewer-canvas.is-dragging {
  cursor: grabbing;
}

.receipt-viewer-stage {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

.receipt-viewer-stage.no-transition {
  transition: none !important;
}

#receipt-viewer-img {
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
  user-select: none;
}

.receipt-viewer-footer {
  padding: 0.5rem 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.viewer-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .receipt-viewer-topbar {
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
  }

  .viewer-btn-text {
    display: none;
  }

  .viewer-btn {
    padding: 0.45rem 0.55rem;
  }

  .receipt-viewer-footer {
    display: none;
  }

  #receipt-viewer-img {
    max-width: 95vw;
    max-height: 86vh;
  }
}

/* ==========================================================================
   HISTORY NAVIGATION TABS & PAGINATION
   ========================================================================== */

.history-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.35rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 12px);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.history-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.history-tab-item:hover {
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
}

.history-tab-item.active {
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.history-tab-item svg {
  color: currentColor;
  opacity: 0.85;
}

.history-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #f8fafc);
  border-radius: var(--radius-full, 9999px);
}

.history-tab-item.active .history-tab-badge {
  background: var(--accent, #3b82f6);
  color: #ffffff;
}

.history-tab-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full, 9999px);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tab-label-desktop {
  display: inline;
}

.tab-label-mobile {
  display: none;
}

.history-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.history-tab-pane.hidden {
  display: none !important;
}

/* Pagination Controls */
.history-pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg, 12px);
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  font-family: var(--font-mono, monospace);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.page-num-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--text-secondary, #94a3b8);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-num-btn:hover {
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.06);
}

.page-num-btn.active {
  background: var(--accent, #3b82f6);
  color: #ffffff;
  border-color: var(--accent, #3b82f6);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   TRENDS & ANALYTICS DASHBOARD
   ========================================================================== */

.trends-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 12px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.trends-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}

.trends-range-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
  -webkit-overflow-scrolling: touch;
  padding: 3px 1px;
}

.trends-range-pills::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.range-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.range-pill:hover {
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.range-pill.active {
  background: var(--accent, #3b82f6);
  color: #ffffff;
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
  font-weight: 700;
}

.range-pill-label-desktop {
  display: inline;
}

.range-pill-label-mobile {
  display: none;
}

/* Active Custom Range Banner */
.trends-active-custom-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.25s ease-out;
}

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

.active-range-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
}

.btn-clear-range-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-clear-range-filter:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

/* Custom Range Modal */
.custom-range-modal-card {
  max-width: 420px;
  width: 100%;
}

.custom-range-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-subtitle-text {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.45;
}

.custom-range-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.custom-range-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  display: block;
}

.custom-range-input-full {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary, #f8fafc);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-range-input-full:focus {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* KPI Row */
.trends-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.kpi-icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.kpi-icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.kpi-icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary, #ffffff);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-hint {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}

/* Charts & Visual Cards */
.chart-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 14px);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  margin-bottom: 1.5rem;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin: 0 0 0.25rem 0;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary, #94a3b8);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full, 9999px);
}

.dot-amount {
  background: var(--accent, #3b82f6);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.chart-body {
  position: relative;
  min-height: 220px;
  width: 100%;
}

.chart-body-auto,
#stations-chart-container,
#payments-chart-container {
  min-height: auto;
  height: auto;
}

/* Dual Grid for Gas Stations & Payments */
.trends-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Distribution Bars & Rows */
.dist-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.dist-item:last-child {
  margin-bottom: 0;
}

.dist-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.dist-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
}

.dist-amount {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.dist-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  position: relative;
}

.dist-bar-fill {
  height: 100%;
  border-radius: var(--radius-full, 9999px);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill-station {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.bar-fill-payment {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

/* SVG Timeline Chart Styles */
.svg-chart {
  width: 100%;
  height: 240px;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 4 4;
}

.chart-axis-label {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  fill: #64748b;
}

.chart-bar-rect {
  fill: url(#chart-bar-gradient);
  rx: 4;
  ry: 4;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chart-bar-rect:hover {
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -120%);
  white-space: nowrap;
  z-index: 20;
  transition: opacity 0.15s ease;
}

/* Empty & Loading States */
.trends-empty, .trends-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-lg, 12px);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.trends-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin: 0.75rem 0 0.35rem 0;
}

.trends-empty-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  max-width: 440px;
  margin: 0;
}

@media (max-width: 768px) {
  .history-pagination-container {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pagination-controls {
    justify-content: center;
  }

  .trends-filter-header {
    flex-direction: column;
    align-items: stretch;
  }

  .trends-range-pills {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .range-pill-label-desktop {
    display: none;
  }

  .range-pill-label-mobile {
    display: inline;
  }

  .trends-active-custom-range {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-lg, 12px);
    padding: 0.5rem 0.75rem;
  }

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

  .trends-dual-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-card {
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
  }

  .chart-body-auto,
  #stations-chart-container,
  #payments-chart-container {
    min-height: 0 !important;
    height: auto !important;
  }
}

@media (max-width: 640px) {
  .tab-label-desktop {
    display: none;
  }

  .tab-label-mobile {
    display: inline;
  }

  .history-nav-tabs {
    width: 100%;
    display: flex;
    box-sizing: border-box;
    padding: 0.25rem;
    gap: 0.35rem;
  }

  .history-tab-item {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
    gap: 0.35rem;
    white-space: nowrap;
  }

  .history-tab-tag {
    display: none !important;
  }

  .chart-body-auto,
  #stations-chart-container,
  #payments-chart-container {
    min-height: 0 !important;
    height: auto !important;
  }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   Only visible on mobile (≤ 640px). Hidden on desktop.
   ========================================================================== */

/* Hidden by default — only shown on mobile via media query below */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 640px) {

  /* ── Bar shell ── */
  .mobile-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 14, 26, 0.97);
    border-top: 1px solid rgba(16, 185, 129, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
      0 -4px 18px rgba(16, 185, 129, 0.3),
      0 -8px 36px rgba(16, 185, 129, 0.2),
      0 -1px 4px rgba(16, 185, 129, 0.5),
      0 -6px 32px rgba(0, 0, 0, 0.85);
    z-index: 10000;
  }

  /* ── Hide old top tabs on history screen in mobile ── */
  .history-nav-tabs {
    display: none !important;
  }

  /* ── Hide old floating FAB — replaced by center button ── */
  .mobile-camera-fab-container,
  #mobile-history-bar,
  .fab-container {
    display: none !important;
  }

  /* ── Add bottom padding to scrollable areas so content clears the bar ── */
  #screen-history .history-tab-pane,
  #pane-receipts,
  #pane-trends,
  #history-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Toast position fix to appear above the bottom bar */
  .toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Tab items (History / Trends) ── */
  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    color: rgba(255, 255, 255, 0.42);
    transition: color 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .mbn-item:active {
    color: rgba(255, 255, 255, 0.7);
  }

  .mbn-item.active {
    color: #10b981 !important;
    outline: none !important;
  }

  /* When user has no fiscal profile, hide history & trends tabs so only the center camera FAB is visible */
  html.no-profile .mobile-bottom-nav .mbn-item {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mbn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mbn-icon svg {
    display: block;
    transition: transform 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
  }

  .mbn-item.active .mbn-icon svg {
    stroke: #10b981 !important;
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8));
  }

  .mbn-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: color 0.2s ease, font-weight 0.2s ease, text-shadow 0.2s ease;
  }

  .mbn-item.active .mbn-label {
    color: #10b981 !important;
    font-weight: 700 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  }

  /* Notification badge */
  .mbn-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: 2px solid rgba(10, 14, 26, 0.97);
  }

  .mbn-badge.hidden {
    display: none;
  }

  /* ── Center FAB slot ── */
  .mbn-fab-wrap {
    flex: 0 0 80px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
  }

  /* ── The protruding camera button ── */
  .mbn-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow:
      0 -4px 20px rgba(16, 185, 129, 0.45),
      0 4px 16px rgba(0, 0, 0, 0.6);
    transform: translateY(-14px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mbn-fab:active {
    transform: translateY(-14px) scale(0.93);
    box-shadow:
      0 -2px 10px rgba(16, 185, 129, 0.3),
      0 2px 8px rgba(0, 0, 0, 0.5);
  }

  .mbn-fab svg {
    position: relative;
    z-index: 1;
  }

  /* Pulse ring animation */
  .mbn-fab-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.5);
    animation: mbnFabPulse 2.4s ease-out infinite;
  }

  @keyframes mbnFabPulse {
    0% {
      transform: scale(1);
      opacity: 0.6;
    }
    70% {
      transform: scale(1.5);
      opacity: 0;
    }
    100% {
      transform: scale(1.5);
      opacity: 0;
    }
  }

  /* The notch cutout effect for the bar behind the FAB */
  .mbn-fab-wrap::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 76px;
    height: 40px;
    background: transparent;
    border-top: none;
    pointer-events: none;
  }

  /* ── Auto-hide mobile bottom nav when ANY modal/overlay is open OR when reviewing scanned tickets ── */
  body:has(.modal-overlay:not(.hidden)) .mobile-bottom-nav,
  body:has(.scanner-overlay:not(.hidden)) .mobile-bottom-nav,
  body:has(.receipt-viewer-overlay:not(.hidden)) .mobile-bottom-nav,
  body:has(#screen-workbench.active) .mobile-bottom-nav,
  body:has(#screen-workbench:not(.hidden)) .mobile-bottom-nav,
  body:has(#review-section:not(.hidden)) .mobile-bottom-nav,
  body.viewer-open .mobile-bottom-nav,
  .mobile-bottom-nav.hidden {
    display: none !important;
  }

  /* ── Mobile Scanned Ticket Execution Bar (Decision between Send to Queue or Cancel) ── */
  .execution-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10005 !important;
    background: rgba(10, 14, 26, 0.98) !important;
    border-top: 1px solid rgba(16, 185, 129, 0.45) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow:
      0 -4px 18px rgba(16, 185, 129, 0.3),
      0 -8px 36px rgba(16, 185, 129, 0.2),
      0 -1px 4px rgba(16, 185, 129, 0.5),
      0 -6px 32px rgba(0, 0, 0, 0.85) !important;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
  }

  .execution-bar .btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 0.8rem 0.6rem !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md, 10px) !important;
  }

  /* Ensure bottom padding in review pane so cards are fully visible above execution bar */
  #pane-data,
  #pane-image,
  .receipts-list {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ── Custom Range Modal (Mobile Bottom Sheet) ── */
  #btn-close-custom-range-modal {
    display: none !important;
  }

  .custom-range-modal-card {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
  }

  .custom-range-modal-card .modal-footer {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 0.75rem !important;
    width: 100% !important;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px)) 1.25rem !important;
  }

  .custom-range-modal-card .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
  }
}

/* ============================================================
   Custom Confirm Modal & Mobile Bottom Drawer / Aside
   ============================================================ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: rgba(8, 12, 22, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-confirm-drawer {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(16, 185, 129, 0.08);
  width: 100%;
  max-width: 410px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.active .custom-confirm-drawer {
  transform: scale(1) translateY(0);
}

.drawer-handle-bar {
  display: none;
  justify-content: center;
  padding-bottom: 0.25rem;
}

.drawer-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
}

.confirm-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.confirm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.18);
  margin-bottom: 0.25rem;
}

.confirm-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin: 0;
}

.confirm-message {
  font-size: 0.88rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.confirm-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 0.72rem 1rem;
  font-weight: 600;
  border-radius: 12px;
  font-size: 0.92rem;
}

/* Mobile Bottom Sheet Drawer Layout */
@media (max-width: 640px) {
  .custom-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .drawer-handle-bar {
    display: flex;
  }

  .custom-confirm-drawer {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    transform: translateY(100%);
  }

  .custom-modal-overlay.active .custom-confirm-drawer {
    transform: translateY(0);
  }

  .confirm-actions {
    flex-direction: column-reverse;
    gap: 0.6rem;
  }

  .confirm-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
  }
}

/* ============================================================
   Upload Source Action Sheet (Camera vs Gallery)
   ============================================================ */
.action-sheet-drawer {
  max-width: 440px;
  padding: 1.35rem 1.25rem 1.5rem;
  gap: 1.1rem;
}

.action-sheet-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.action-sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin: 0;
}

.action-sheet-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  line-height: 1.4;
}

.action-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

.action-sheet-opt-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
}

.action-sheet-opt-btn.hidden {
  display: none !important;
}

.action-sheet-opt-btn:hover,
.action-sheet-opt-btn:active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.action-sheet-opt-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-sheet-opt-icon.opt-camera {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.action-sheet-opt-icon.opt-gallery {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.action-sheet-opt-text {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
  min-width: 0;
}

.action-sheet-opt-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
}

.action-sheet-opt-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.action-sheet-opt-arrow {
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.action-sheet-opt-btn:hover .action-sheet-opt-arrow {
  transform: translateX(2px);
  color: #10b981;
}

.action-sheet-footer {
  width: 100%;
}

.action-sheet-footer .btn {
  width: 100%;
  border-radius: 12px;
  padding: 0.72rem;
  font-size: 0.92rem;
  font-weight: 600;
}

/* ============================================================
   Unavailable Gas Station Banner & WhatsApp Action
   ============================================================ */
.unavailable-warning-banner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md, 10px);
  padding: 0.8rem 1rem;
  margin-bottom: 0.85rem;
}

.unavailable-warning-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.83rem;
  color: #fbbf24;
  line-height: 1.45;
}

.unavailable-warning-header svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #f59e0b;
}

.btn-whatsapp {
  background: #25d366 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25) !important;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #20ba5a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35) !important;
}

.btn-disabled-notice {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}

/* ==========================================================================
   Grouped Profile Form Sections (Fiscal, Address, Contact)
   ========================================================================== */
.profile-form-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.profile-form-section:hover {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.02);
}

.profile-section-header {
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.section-badge-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  border: 1.5px solid #10b981;
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.profile-form-section .form-grid {
  margin-top: 0.25rem;
}