/* ===== COHESIVE DESIGN SYSTEM - FMD REP PORTAL ===== */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-dark: #5a5fcf;
  --secondary-color: #6b7280;
  --secondary-dark: #4b5563;
  --success-color: #10b981;
  --success-dark: #059669;
  --danger-color: #ef4444;
  --danger-dark: #dc2626;
  --warning-color: #f59e0b;
  --warning-dark: #d97706;
  
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #fafbfc;
  --bg-tertiary: #f3f4f6;
  --bg-accent: #f8fafc;
  
  /* Text */
  --text-primary: #1f2937;
  --text-secondary: #374151;
  --text-tertiary: #6b7280;
  --text-light: #9ca3af;
  
  /* Borders */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --border-focus: var(--primary-color);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  
  /* Typography */
  --font-primary: "Roboto", sans-serif;
  --font-secondary: "Inter", sans-serif;
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  
  /* Mobile Breakpoints */
  --mobile-breakpoint: 768px;
  --tablet-breakpoint: 1024px;
}

/* ===== GLOBAL STYLES ===== */
* {
  box-sizing: border-box;
  font-family: var(--font-primary);
}



body {
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: 1.5;
}

/* ===== REMOVE PORTRAIT OVERLAY COMPLETELY ===== */
.portrait-overlay {
  display: none !important;
}



/* ===== PAGE TRANSITIONS ===== */
#header-container {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  position: relative;
  z-index: 99999999 !important;
}

#header-container.loaded {
  opacity: 1;
  transform: translateY(0);
}

#nav-bar-container {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease-out 0.1s, transform 0.3s ease-out 0.1s;
}

#nav-bar-container.loaded {
  opacity: 1;
  transform: translateY(0);
}

.welcome-buttons-section {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.3s ease-out 0.2s, transform 0.3s ease-out 0.2s;
}

.welcome-buttons-section.loaded {
  opacity: 1;
  transform: translateY(0);
}

.cms-section {
  opacity: 1;
  transform: none;
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f3f4f6;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: -80px;
}

.logo-title-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  width: 300px;
  gap: 20px;
}

.login-logo {
  width: 70px;
  height: 47px;
}

.rep-portal-title {
  font-size: 1.25rem;
  color: #1f2a44;
  font-weight: 600;
  margin: 0;
text-align: center !important; /* Change from left to center */
    margin-right: 0 !important; /* Remove right margin */
    flex: 1 !important; /* Take up remaining space */
}

.login-container {
  display: flex;
  justify-content: center;
}

.login-form {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 300px;
  text-align: center;
}

/* Login form title styling - Keep Roboto */
.login-form h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #1f2a44;
  margin: 0 0 16px 0;
  text-align: center;
  letter-spacing: 0.5px;
}

.powered-by-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  width: 300px;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
}

.powered-by-text {
  font-size: 12px;
  color: #4b5563;
}

.powered-by-login-logo {
  width: 85px;
  height: 25px;
}

.desktop-only {
  display: block;
}

.logout-text {
  font-size: 10px;
  color: #4b5563;
  text-decoration: none;
  margin-left: 10px;
  display: none;
}

.logout-text:hover {
  text-decoration: underline;
}

/* ===== HEADER STYLES ===== */
.header-bar {
  background: #e6f3ff;
  margin: 20px 20px 10px 40px;
  padding: 10px 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
  border-radius: var(--radius-lg);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 var(--space-xl);
}

.header-link {
  text-decoration: none;
  color: inherit;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-logo {
  width: 90px;
  height: 60px;
  margin-right: var(--space-md);
}

.header2-logo {
  width: 125px;
  height: 34px;
  margin: 0 0 -20px 10px;
}

.powered-by {
  display: flex;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  gap: var(--space-xs);
  justify-content: flex-end;
  margin: 10px 40px 10px 0;
}

.powered-by img {
  height: 25px;
  width: auto;
}

.cms-section .powered-by {
  margin: var(--space-xl) var(--space-xl) var(--space-lg) 0;
}

/* ===== PASSWORD CHANGE MODAL STYLES ===== */

/* Modal Overlay */
.password-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* Modal Content */
.password-modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 85%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

/* Modal Header */
.password-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: 2px solid var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.password-modal-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-family: var(--font-primary);
}

.password-modal-close {
  background: none;
  border: none;
  color: var(--bg-primary);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Modal Body */
.password-modal-body {
  padding: var(--space-lg) var(--space-xl);
}

.password-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Form Groups */
.password-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.password-form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Password Input Group */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  padding-right: 45px; /* Space for toggle button */
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: var(--font-primary);
  transition: all 0.2s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
  box-sizing: border-box;
  height: 40px;
}

.password-form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background: var(--bg-primary);
}

.password-form-input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

/* Password Toggle Button */
.password-toggle-btn {
  position: absolute;
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-tertiary);
}

.password-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Password Requirements */
.password-requirements {
  background: var(--bg-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xs) 0;
  border-left: 4px solid var(--primary-color);
}

/* Form Actions */
.password-form-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

/* Password Buttons */
.password-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  min-height: 36px;
  min-width: 100px;
  box-sizing: border-box;
}

.password-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary Password Button */
.password-btn-primary {
  background: var(--primary-gradient);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
}

.password-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.password-btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Secondary Password Button */
.password-btn-secondary {
  background: var(--bg-primary);
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.password-btn-secondary:hover:not(:disabled) {
  background: var(--secondary-color);
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Loading State */
.password-loading {
  position: relative;
  pointer-events: none;
}

.password-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: password-spin 1s linear infinite;
}

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

/* Password Messages */
.password-message {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  border: 1px solid;
  font-family: var(--font-primary);
}

.password-message-success {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.password-message-error {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.password-message-warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Success Modal Specific Styles */
.password-success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
}

.password-success-icon {
  margin-bottom: var(--space-md);
  animation: password-bounce 0.6s ease;
}

@keyframes password-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.password-success-message {
  width: 100%;
}

/* ===== MOBILE RESPONSIVE - PASSWORD MODAL ===== */
@media (max-width: 768px) {
  .password-modal-content {
    max-width: 90%;
    margin: var(--space-md);
    max-height: 80vh;
  }

  .password-modal-header {
    padding: var(--space-md) var(--space-lg) var(--space-sm);
  }

  .password-modal-header h2 {
    font-size: var(--font-size-base);
  }

  .password-modal-body {
    padding: var(--space-md) var(--space-lg);
  }

  .password-form-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .password-btn {
    width: 100%;
    min-height: 40px; /* Touch-friendly */
    font-size: var(--font-size-sm);
  }

  .password-form-input {
    padding: var(--space-md);
    font-size: var(--font-size-sm);
    min-height: 40px; /* Touch-friendly */
  }

  .password-toggle-btn {
    right: var(--space-md);
    width: 28px;
    height: 28px;
    font-size: var(--font-size-base);
  }

  .password-requirements {
    padding: var(--space-lg);
  }

  .password-success-content {
    padding: var(--space-xl);
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.password-btn:focus,
.password-form-input:focus,
.password-toggle-btn:focus,
.password-modal-close:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .password-modal-content {
    border: 3px solid var(--text-primary);
  }
  
  .password-form-input {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .password-btn,
  .password-toggle-btn,
  .password-modal-close,
  .password-success-icon {
    transition: none;
    animation: none;
  }
  
  .password-btn:hover {
    transform: none;
  }
}

/* ===== NAVIGATION STYLES ===== */
.nav-block {
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 20px 10px 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
  font-family: "Huninn", sans-serif;
}

.nav-btn {
  background: var(--secondary-color);
  color: var(--bg-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  will-change: box-shadow, background;
  backface-visibility: hidden;
}

/* Base button styling - no hover effects yet */
.nav-btn {
  position: relative;
  border: none;
  font-weight: 500;
  transition: all 0.15s ease-out;
  cursor: pointer;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Non-active button base state */
.nav-btn:not(.active) {
  background: var(--secondary-color);
  color: var(--bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Non-active button hover - simple color change only */
.nav-btn:not(.active):hover {
  background: var(--secondary-dark);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active button base state */
.nav-btn.active {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4) !important;
  border: 2px solid rgba(34, 197, 94, 0.3) !important;
  font-weight: 600 !important;
}

/* Active button hover - simple enhancement */
.nav-btn.active:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.5) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
}

/* Focus states for accessibility */
.nav-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Pressed state - minimal change */
.nav-btn:active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  transition: box-shadow 0.05s ease !important;
}

/* Optional subtle pulse for active button - remove if causes issues */
.nav-btn.active {
  animation: soft-pulse 3s ease-in-out infinite;
}

@keyframes soft-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 5px 14px rgba(34, 197, 94, 0.45);
  }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .nav-btn {
    animation: none !important;
    transition: background-color 0.1s ease, box-shadow 0.1s ease !important;
  }
}

/* ===== WELCOME SECTION ===== */
.welcome-message {
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
  text-align: center;
  margin: var(--space-xs) 0;
  width: 100%;
  font-weight: 500;
}

.welcome-buttons-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-xs) 0;
  width: 100%;
}

.logout-btn {
  background: var(--secondary-color);
  color: var(--bg-primary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: var(--danger-color);
  transform: translateY(-1px);
}

.buttons-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.buttons-group {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

/* ===== FORM NAVIGATION BUTTONS ===== */
.form-buttons-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xs) 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.form-nav-btn {
  background: #A7F3D0;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 140px;
  min-height: 40px;
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.form-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.form-nav-btn:hover::before {
  left: 100%;
}

.form-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.form-nav-btn.add-btn {
  background: #A7F3D0;
  border: 1px solid #6EE7B7;
}

.form-nav-btn.add-btn:hover {
  background: #6EE7B7;
  border-color: #34D399;
}

.form-nav-btn.add-btn:active,
.form-nav-btn.add-btn.active {
  background: #34D399;
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.form-nav-btn.follow-up-btn {
  background: #BFDBFE;
  border: 1px solid #93C5FD;
  color: #1e40af;
}

.form-nav-btn.follow-up-btn:hover {
  background: #93C5FD;
  border-color: #60A5FA;
  color: #1e3a8a;
}

.form-nav-btn.follow-up-btn:active,
.form-nav-btn.follow-up-btn.active {
  background: #60A5FA;
  color: var(--bg-primary);
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.button-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
  margin: 0 var(--space-sm);
  position: relative;
}

.button-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--text-light);
  border-radius: 50%;
}

/* ===== FORM STYLES ===== */
.form-block {
  padding: var(--space-xl);
  margin: var(--space-3xl) auto var(--space-xl);
  max-width: 500px;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  width: 100%;
}

.form-group.relative-group {
  position: relative;
}

.form-group.business-name-group {
  position: relative;
}

.form-group label {
  width: 250px;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: 500;
}

.form-block .form-group input,
.form-block .form-group select,
.form-block .form-group textarea,
.login-form .form-group input,
.login-form .form-group select,
.login-form .form-group textarea {
  width: 200px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  transition: all 0.2s ease;
  background: var(--bg-primary);
}

.form-block .form-group input:focus,
.form-block .form-group select:focus,
.form-block .form-group textarea:focus,
.login-form .form-group input:focus,
.login-form .form-group select:focus,
.login-form .form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-block .form-group input[type="date"],
.login-form .form-group input[type="date"] {
  width: 200px;
}

.form-block .form-group select,
.login-form .form-group select {
  width: 200px;
  cursor: pointer;
}

.form-block .form-group textarea,
.login-form .form-group textarea {
  width: 200px;
  height: 80px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  resize: vertical;
}

.form-block .form-group input[readonly],
.form-block .form-group.completed-field input,
.login-form .form-group input[readonly],
.login-form .form-group.completed-field input {
  background-color: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* ===== BUTTON SYSTEM ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  min-height: 40px;
  box-sizing: border-box;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary Button */
.btn-primary,
.submit-btn,
.login-btn {
  background: var(--primary-gradient);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled),
.submit-btn:hover:not(:disabled),
.login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Secondary Button */
.btn-secondary {
  background: var(--bg-primary);
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-color);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

/* Success Button */
.btn-success,
.action-btn {
  background: linear-gradient(135deg, var(--success-color), var(--success-dark));
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled),
.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Group Button */
.group-btn {
  background: linear-gradient(135deg, #1e90ff, #1e40ff);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.group-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Specific button overrides */
.submit-btn {
  width: 200px;
  padding: var(--space-sm) var(--space-lg);
}

.login-btn {
  width: 150px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
}

.action-btn {
  width: 200px;
  font-size: var(--font-size-sm);
}

.global-submit-btn {
  display: block;
  margin: 10px auto;
}

/* ===== FORM SPECIFIC STYLES ===== */
.submit-field-follow-up {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.submit-field-follow-up .submit-btn {
  width: 100px;
  padding: var(--space-sm) var(--space-lg);
}

#submit-field-follow-up, 
#submit-field-follow-up-won, 
#submit-field-follow-up-lost {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
  align-items: center;
}

#submit-btn-follow-up, 
#submit-btn-follow-up-won, 
#submit-btn-follow-up-lost {
  width: 200px;
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--font-size-sm);
}

.form-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  padding: var(--space-sm);
  margin: 0 0 var(--space-lg);
  border-radius: var(--radius-sm);
}

.form-title-won {
  background: var(--success-color);
  color: var(--bg-primary);
  padding: 10px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.form-title-lost {
  background: var(--danger-color);
  color: var(--bg-primary);
  padding: 10px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== CHECKBOX STYLES ===== */
.checkbox-container-follow-up {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  justify-content: center;
  align-items: center;
}

.checkbox-group-follow-up {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  justify-content: center;
}

.checkbox-label-follow-up {
  display: flex;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label-follow-up input[type="checkbox"] {
  margin-right: var(--space-sm);
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* ===== TABLE HEADER STYLES ===== */
th {
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--space-md);
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

/* ===== AUTOCOMPLETE STYLES ===== */
.relative-group .autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 250px;
  width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 150px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
}

.relative-group .autocomplete-suggestions:not(.hidden) {
  display: block;
}

.autocomplete-suggestion {
  padding: var(--space-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.autocomplete-suggestion:hover {
  background: var(--bg-tertiary);
}

/* ===== INPUT WITH ICON ===== */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 200px;
}

.input-with-icon input {
  width: 100%;
  padding-right: 30px;
}

.dropdown-arrow {
  position: absolute;
  right: 3%;
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
  cursor: pointer;
  user-select: none;
}

.dropdown-arrow:hover {
  color: var(--text-primary);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.text-gray-800 {
  color: var(--text-primary);
}

/* ===== AVATAR DROPDOWN - BULLETPROOF Z-INDEX FIX ===== */

/* Base avatar styles */
.avatar-wrapper {
  position: relative;
  margin-right: var(--space-xs);
  z-index: 10000 !important;
}

.avatar-image {
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  margin-top: 10px;
  transition: transform 0.2s ease;
}

.avatar-image:hover {
  transform: scale(1.05);
}

/* Dropdown with bulletproof positioning */
.avatar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 99999 !important;
  min-width: 150px;
  margin-top: 8px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: all 0.2s ease;
}

.avatar-dropdown.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
}

.dropdown-item {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Admin Tools dropdown item styling */
.dropdown-item.admin-tools-item {
  color: #667eea !important;
  font-weight: 600 !important;
  border-top: 1px solid rgba(102, 126, 234, 0.2) !important;
  margin-top: 8px !important;
  padding-top: 12px !important;
}

.dropdown-item.admin-tools-item:hover {
  background: rgba(102, 126, 234, 0.1) !important;
  color: #5a5fcf !important;
}

/* Force all potentially conflicting elements to lower z-index */
.nav-block {
  z-index: 100 !important;
  position: relative;
}

#nav-bar-container {
  z-index: 100 !important;
  position: relative;
}

.welcome-buttons-section {
  z-index: 50 !important;
  position: relative;
}

.form-buttons-nav {
  z-index: 75 !important;
  position: relative;
}

.cms-section {
  z-index: 25 !important;
  position: relative;
}

/* Force header containers to allow overflow */
#header-container {
  overflow: visible !important;
  z-index: 10000 !important;
  position: relative;
}

.header-bar {
  overflow: visible !important;
  z-index: 10000 !important;
  position: relative;
}

.header-content {
  overflow: visible !important;
  z-index: 10000 !important;
  position: relative;
}

.header-right {
  overflow: visible !important;
  z-index: 10001 !important;
  position: relative;
}



/* ===== BUSINESS NAME AUTOCOMPLETE ===== */
.business-name-group .autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 250px;
  width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 150px;
  overflow-y: auto;
  z-index: 2000;
}

.business-name-group .autocomplete-suggestions:not(.hidden) {
  display: block;
}

.business-name-group .autocomplete-suggestion {
  padding: 10px var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  transition: all 0.2s ease;
}

.business-name-group .autocomplete-suggestion:hover {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.business-name-group .autocomplete-suggestion:last-child {
  border-bottom: none;
}

/* ===== INPUT WITH PREFIX ===== */
.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-prefix .prefix {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: var(--text-tertiary);
  pointer-events: none;
  font-weight: bold;
}

.input-with-prefix input {
  padding-left: 25px;
}

/* ===== FORM HEADER ===== */
.form-header {
  text-align: center;
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--primary-color);
  font-family: "Funnel Sans", sans-serif;
  margin: 2px 0 2px;
  display: none;
}

.form-header:not(.hidden) {
  display: block;
}

/* ===== NAVIGATION COMPONENTS ===== */
.form-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-lg);
}

.back-btn {
  background: var(--secondary-color);
  border: 1px solid var(--secondary-dark);
  color: var(--bg-primary);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
}

.next-btn {
  background: linear-gradient(135deg, #1e90ff, #1e40ff);
  border: 1px solid #1e40ff;
  color: var(--bg-primary);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.next-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}


/* ===== FOCUS IMPROVEMENTS FOR ACCESSIBILITY ===== */
.btn:focus,
.nav-btn:focus,
.form-nav-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-tertiary: #000000;
  }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .nav-block,
  .form-buttons-nav,
  .btn,
  .logout-btn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .form-block,
  .header-bar {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ===== ANIMATION CLASSES ===== */
.completed-fields {
  margin-bottom: var(--space-lg);
}

.completed-field {
  opacity: 0;
  animation: fadeIn 300ms ease-in forwards;
}

.current-field {
  min-height: 40px;
}

.animate-field-enter {
  animation: fadeIn 300ms ease-in;
}

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

/* ===== LOADING STATES ===== */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

/* ===== STICKY ELEMENTS ===== */
.sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}


/* ===== AVATAR DROPDOWN Z-INDEX FIX - AGGRESSIVE ===== */

/* Force avatar dropdown to highest z-index */
.avatar-dropdown {
  z-index: 9999 !important;
  position: fixed !important; /* Changed to fixed positioning */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Force nav-block to lower z-index */
.nav-block {
  z-index: 10 !important;
  position: relative !important;
}

/* Force header to allow overflow and higher z-index */
#header-container {
  overflow: visible !important;
  z-index: 9998 !important;
  position: relative !important;
}

.header-bar {
  overflow: visible !important;
  z-index: 9998 !important;
  position: relative !important;
}

/* Avatar wrapper needs higher z-index too */
.avatar-wrapper {
  z-index: 9999 !important;
  position: relative !important;
}



/* Admin Tools dropdown item styling */
.dropdown-item.admin-tools-item {
  color: #667eea !important;
  font-weight: 600 !important;
  border-top: 1px solid rgba(102, 126, 234, 0.2) !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
}

.dropdown-item.admin-tools-item:hover {
  background: rgba(102, 126, 234, 0.1) !important;
  color: #5a5fcf !important;
}

/* Ensure no other elements interfere */
.welcome-buttons-section {
  z-index: 1 !important;
  position: relative !important;
}

.cms-section {
  z-index: 1 !important;
  position: relative !important;
}

/* ===== SIMPLE LOGIN BUTTON FIX ===== */
.login-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important; /* FMD Green */
  color: white !important;
  border: none !important;
  border-radius: 10px !important; /* Nice rounded edges */
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3) !important;
  transition: all 0.3s ease !important;
  padding: 8px 20px !important; /* Smaller padding */
  font-weight: 600 !important;
  font-size: 13px !important; /* Slightly smaller font */
  min-height: 36px !important; /* Smaller height */
  max-width: 120px !important; /* Limit width */
  cursor: pointer !important; /* Hand cursor */
}

.login-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4) !important;
  cursor: pointer !important; /* Hand cursor on hover */
}


/* ===== CONVERSION MODAL STYLES ===== */
.conversion-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.conversion-modal-overlay.conversion-hidden {
  display: none;
}

.conversion-modal-content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 1200px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
}

.conversion-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 2px solid #3b82f6;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.conversion-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.conversion-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conversion-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.conversion-modal-body {
  padding: 20px;
}

/* ===== CONVERSION LAYOUT ===== */
.conversion-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  min-height: 500px;
}

.conversion-form-container {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
  position: relative;
}

.conversion-data-sidebar {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  height: fit-content;
}

.conversion-data-sidebar h3 {
  margin: 0 0 12px 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 600;
}

.conversion-data-sidebar p {
  margin: 0 0 12px 0;
  color: #6b7280;
  font-size: 14px;
}

.conversion-data-textarea {
  width: 100%;
  min-height: 300px;
  background: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #1f2937;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  resize: vertical;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.copy-data-btn {
  width: 100%;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.copy-data-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.conversion-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
}

.conversion-info small {
  color: #166534;
  font-size: 12px;
  font-weight: 500;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .conversion-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .conversion-data-sidebar {
    order: -1;
    position: relative;
    margin-bottom: 16px;
  }
  
  .conversion-data-textarea {
    min-height: 200px;
  }
  
  .conversion-modal-content {
    width: 98%;
    margin: 8px;
  }
  
  .conversion-modal-header {
    padding: 16px 20px 12px;
  }
  
  .conversion-modal-header h2 {
    font-size: 18px;
  }
  
  .conversion-modal-body {
    padding: 16px;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ===== SUCCESS NOTIFICATION ===== */
.conversion-success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #22c55e;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  z-index: 10002;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.success-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.success-icon {
  font-size: 18px;
}

.success-text {
  font-size: 14px;
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  /* CSS Variables for Mobile */
  :root {
    --space-xs: 3px;
    --space-sm: 6px;
    --space-md: 10px;
    --space-lg: 14px;
    --space-xl: 18px;
    --space-2xl: 22px;
    --space-3xl: 28px;
  }

  body {
    font-size: var(--font-size-sm);
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* ===== HEADER MOBILE ===== */
  @media (max-width: 768px) {
  .header-bar {
    padding: var(--space-md) 0;
    margin: 0;
    width: 100%;
    border-radius: 0;
    overflow: visible !important;
    position: relative;
    z-index: 9998 !important;
  }

  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    position: relative;
    padding: 0 var(--space-lg);
    overflow: visible !important;
    z-index: 9998 !important;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: flex-start;
    flex: 0 0 auto;
    position: relative;
  }

  .header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible !important;
    position: relative;
    flex: 0 0 auto;
    z-index: 99999 !important;
  }

  /* FMD Logo - Far Left, SMALLER for mobile */
  .header-logo {
    width: 55px !important; /* Smaller - was 70px */
    height: 37px !important; /* Smaller - was 47px, maintains proportion */
  }
  
  /* Rep Portal Logo - Centered, SLIGHTLY BIGGER for mobile */
  .header-bar .header2-logo {
    width: 120px !important; /* Bigger - was 90px */
    height: 33px !important; /* Bigger - was 24px, maintains proportion */
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    z-index: 10 !important;
    top: 25px !important;
  }

  /* HIDE nav FMD logo on mobile */
  .nav-fmd-logo {
    display: none !important;
  }
}
  
  .powered-by {
    display: none;
  }

  /* Force header containers to allow overflow */
  #header-container {
    overflow: visible !important;
    z-index: 9999 !important;
    position: relative;
  }

  /* ===== AVATAR DROPDOWN MOBILE ===== */
  .avatar-wrapper {
    position: relative;
    margin-right: 0;
    z-index: 99999 !important;
    overflow: visible !important;
  }

  .avatar-dropdown {
    position: fixed !important;
    z-index: 99999 !important;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    min-width: 120px;
    margin-top: 0;
    /* Position will be set by JavaScript */
  }

  .avatar-dropdown.hidden {
    display: none !important;
  }

  .avatar-dropdown:not(.hidden) {
    display: block !important;
  }

  /* ===== NAVIGATION MOBILE ===== */
  .nav-block {
    flex-direction: column;
    padding: var(--space-md) 0;
    margin: var(--space-md) 0;
    width: 100%;
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 100 !important;
  }
  
  .nav-links {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    margin: 0;
  }
  
  .nav-btn {
    font-size: var(--font-size-sm);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    min-height: 44px;
  }

  /* ===== WELCOME SECTION MOBILE ===== */
  .welcome-buttons-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: var(--space-md) 0;
    width: 100%;
    padding: 0 var(--space-lg);
    z-index: 50 !important;
    position: relative;
  }
  
  .welcome-message,
  .welcome-buttons-section #welcome-message {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    text-align: center;
    margin: var(--space-md) 0;
    width: 100%;
  }
  
  .buttons-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .buttons-group {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    align-items: center;
    margin-top: var(--space-md);
  }

  /* ===== FORM NAVIGATION MOBILE ===== */
  .form-buttons-nav {
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    position: relative;
    z-index: 75 !important;
  }
  
  .form-nav-btn {
    width: 100%;
    max-width: 320px;
    min-width: auto;
    font-size: var(--font-size-sm);
    padding: var(--space-md) var(--space-lg);
    min-height: 44px;
  }
  
  .button-divider {
    width: 80%;
    height: 2px;
    margin: var(--space-xs) auto;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
  }
  
  .button-divider::before {
    display: none;
  }

  /* ===== FORM STYLES MOBILE ===== */
  .form-block {
    margin: var(--space-xl) var(--space-lg);
    padding: var(--space-lg);
    max-width: none;
    width: calc(100% - 32px);
  }

  .form-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .form-group label {
    width: 100%;
    font-size: var(--font-size-sm);
  }

  .form-block .form-group input,
  .form-block .form-group select,
  .form-block .form-group textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--space-md);
  }

  .form-block .form-group textarea {
    min-height: 100px;
  }

  .form-navigation {
    flex-direction: column;
    gap: var(--space-md);
  }

  .back-btn,
  .next-btn {
    width: 100%;
    min-height: 44px;
  }

  /* ===== BUTTON MOBILE ===== */
  .btn {
    min-height: 44px;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
  }

  .action-btn {
    width: 100%;
    max-width: 320px;
    padding: var(--space-md);
    font-size: var(--font-size-sm);
  }

  .submit-btn {
    width: 100%;
    max-width: 320px;
  }

  /* ===== LOGIN MOBILE ===== */
   .login-wrapper {
    gap: var(--space-lg);
  }

  .login-form {
    padding: var(--space-xl);
  }

  /* Login Logo Container - MOBILE ONLY vertical layout */
  .logo-title-container {
    flex-direction: column !important;
    text-align: center !important;
    gap: var(--space-md) !important;
    padding: 15px 20px !important;
    width: 300px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 120px !important;
  }

  /* FMD Logo in Login - Top Position (mobile) */
  .logo-title-container .login-logo {
    width: 65px !important;
    height: 43px !important;
  }

  /* Rep Portal Logo in Login - Below FMD Logo (mobile) */
  .logo-title-container .header2-logo {
    width: 90px !important;
    height: 24px !important;
    margin: var(--space-sm) 0 0 0 !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .login-btn {
    min-height: 44px !important;
    font-size: 14px !important;
    padding: 10px 24px !important;
    max-width: 140px !important;
  }

  .login-form .form-group {
    margin-bottom: var(--space-lg);
  }

  .login-form .form-group label {
    width: 100%;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
  }
  
  .login-form .form-group input {
    width: 100%;
    max-width: 320px;
    min-height: 44px;
  }

  /* ===== AUTOCOMPLETE MOBILE ===== */
  .relative-group .autocomplete-suggestions,
  .business-name-group .autocomplete-suggestions {
    left: 0;
    width: 100%;
    max-height: 200px;
  }

  .input-with-icon {
    width: 100%;
  }

  .autocomplete-suggestion {
    padding: var(--space-md);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* ===== CHECKBOX MOBILE ===== */
  .checkbox-group-follow-up {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .checkbox-label-follow-up {
    font-size: var(--font-size-base);
    padding: var(--space-sm);
  }

  .checkbox-label-follow-up input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  /* ===== TOUCH-FRIENDLY IMPROVEMENTS ===== */
  .dropdown-arrow {
    padding: var(--space-sm);
    font-size: var(--font-size-lg);
  }

  /* ===== HIDE ELEMENTS ON MOBILE ===== */
  .logout-btn,
  .logout-text {
    display: none !important;
  }

  /* ===== Z-INDEX HIERARCHY MOBILE ===== */
  .cms-section {
    z-index: 25 !important;
    position: relative;
  }
}

/* ===== TABLET RESPONSIVE ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .form-buttons-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .form-nav-btn {
    min-width: 160px;
  }

  .header-bar {
    margin: 10px var(--space-lg) 10px var(--space-2xl);
  }

  .nav-block {
    margin: 10px var(--space-lg) 10px var(--space-2xl);
  }

  .powered-by {
    margin: 10px var(--space-2xl) 10px 0;
  }

  .avatar-dropdown {
    z-index: 50000 !important;
    position: absolute;
  }
  
  .nav-block {
    z-index: 200 !important;
  }
}

/* ===== SAFARI SPECIFIC FIXES ===== */
@supports (-webkit-appearance: none) {
  .avatar-dropdown {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  .avatar-wrapper {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* ===== iOS/SAFARI BACKDROP FIXES ===== */
@supports (-webkit-touch-callout: none) {
  .avatar-dropdown {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
  }
}

/* Desktop only - new logo positioning */
@media (min-width: 769px) {
  /* Rep Portal logo - far left in header, SLIGHTLY BIGGER and LOWER */
  .header-left .header2-logo {
    position: relative !important;
    left: auto !important;
    top: 3px !important; /* Move it down slightly */
    transform: none !important;
    width: 135px !important; /* Bigger - was 125px */
    height: 37px !important; /* Bigger - was 34px, maintains proportion */
    margin: 0 !important;
  }

  /* Remove FMD logo from header on desktop */
  .header-logo {
    display: none !important;
  }

  /* FMD logo in nav bar - slightly bigger and aligned with avatar */
  .nav-fmd-logo {
    width: 55px !important; /* Bigger - was 45px */
    height: 37px !important; /* Bigger - was 30px, maintains proportion */
    margin-left: auto !important;
    margin-right: 5px !important; /* Your updated value */
    flex-shrink: 0 !important;
  }

  /* Ensure nav-block uses flexbox properly */
  .nav-block {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
}

/* ===== UNIVERSAL CSV UPLOAD MODAL STYLES ===== */

/* Universal Upload Button */
.universal-upload-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
  border: 2px solid rgba(245, 158, 11, 0.3) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

.universal-upload-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

/* Modal Overlay */
.universal-upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  backdrop-filter: blur(2px);
}

/* Modal Content */
.universal-upload-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

/* Modal Header */
.universal-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: 2px solid #f59e0b;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.universal-upload-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
  font-family: var(--font-primary);
}

.universal-upload-close {
  background: none;
  border: none;
  color: var(--bg-primary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.universal-upload-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Modal Body */
.universal-upload-body {
  padding: var(--space-xl);
}

/* Upload Type Sections */
.upload-type-section {
  margin-bottom: var(--space-2xl);
}

.upload-type-section h3 {
  margin: 0 0 var(--space-lg) 0;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-sm);
}

/* Checkboxes */
.upload-checkboxes {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  background: var(--bg-accent);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.upload-checkbox-label {
  display: flex;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.upload-checkbox-label:hover {
  background: rgba(102, 126, 234, 0.1);
}

.upload-checkbox-label input[type="checkbox"] {
  margin-right: var(--space-md);
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* File Upload Section */
.upload-file-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.upload-file-input {
  width: 100%;
  padding: var(--space-md);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
}

.upload-file-input:hover {
  border-color: var(--primary-color);
  background: var(--bg-accent);
}

.upload-file-input::file-selector-button {
  background: var(--primary-gradient);
  color: var(--bg-primary);
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  margin-right: var(--space-md);
}

.upload-file-input::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Upload Buttons */
.upload-btn {
  background: var(--primary-gradient);
  color: var(--bg-primary);
  border: none;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

.upload-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.upload-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.upload-btn-customers {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.upload-btn-customers:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.upload-btn-products {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.upload-btn-products:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Divider */
.upload-divider {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-color), transparent);
  margin: var(--space-2xl) 0;
  position: relative;
}

.upload-divider::before {
  content: '⚡';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  padding: 0 var(--space-md);
  color: var(--text-tertiary);
  font-size: var(--font-size-lg);
}

/* Results Section */
.upload-results {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-weight: 500;
}

.upload-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.upload-result {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.upload-result-success {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.upload-result-error {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.upload-result-message {
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-details {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

.upload-details div {
  margin: var(--space-xs) 0;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.upload-details div:last-child {
  border-bottom: none;
}

/* Enhanced Upload Details */
.upload-detail-item {
  display: flex;
  align-items: flex-start;
  margin: var(--space-sm) 0 !important;
  padding: var(--space-sm) 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  font-size: var(--font-size-sm) !important;
}

.upload-sub-details {
  font-size: var(--font-size-xs) !important;
  color: var(--text-tertiary) !important;
  margin: var(--space-xs) 0 0 20px !important;
  padding: 0 !important;
  border: none !important;
  font-style: italic;
}

/* Drag and Drop Styling */
.drag-highlight {
  border-color: var(--primary-color) !important;
  background: rgba(102, 126, 234, 0.1) !important;
  transform: scale(1.02);
}

.upload-file-section {
  transition: all 0.2s ease;
}

/* ===== LAST UPLOADED SECTION STYLES ===== */
.last-uploaded-section {
  margin-bottom: var(--space-lg);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.last-uploaded-content {
  padding: 0;
}

.last-uploaded-header {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0;
}

.last-uploaded-item {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid #e2e8f0;
  background: white;
}

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

.last-uploaded-item.no-uploads {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  padding: var(--space-lg);
}

.last-uploaded-item.error {
  background: #fee2e2;
  color: #991b1b;
  text-align: center;
  font-weight: 500;
}

.upload-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.upload-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.upload-category {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.upload-time {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

.upload-user {
  color: var(--text-secondary);
}

.upload-records {
  color: var(--text-secondary);
  font-weight: 500;
}

.last-uploaded-loading {
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  background: white;
}

/* Animate loading */
.last-uploaded-loading::after {
  content: '...';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% { content: '...'; }
  40% { content: ''; }
  60% { content: '.'; }
  80% { content: '..'; }
  100% { content: '...'; }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .universal-upload-content {
    width: 95%;
    max-height: 90vh;
  }

  .universal-upload-header {
    padding: var(--space-md) var(--space-lg) var(--space-sm);
  }

  .universal-upload-header h2 {
    font-size: var(--font-size-lg);
  }

  .universal-upload-body {
    padding: var(--space-lg);
  }

  .upload-checkboxes {
    padding: var(--space-md);
  }

  .upload-checkbox-label {
    padding: var(--space-md);
  }

  .upload-btn {
    width: 100%;
    min-width: auto;
  }

  .upload-file-input {
    padding: var(--space-lg);
  }
}

/* ===== ACCESSIBILITY ===== */
.upload-btn:focus,
.upload-file-input:focus,
.upload-checkbox-label:focus-within,
.universal-upload-close:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .universal-upload-content {
    border: 3px solid var(--text-primary);
  }
  
  .upload-file-input {
    border-width: 3px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .upload-btn,
  .universal-upload-close,
  .upload-spinner {
    transition: none;
    animation: none;
  }
  
  .upload-btn:hover {
    transform: none;
  }
}