body {
  font-family: Arial, sans-serif;
  padding: 20px;
}

/* === Fire Safety Form Field Highlighting === */
.field-populated,
input.field-populated,
select.field-populated,
textarea.field-populated {
  background-color: #dcfce7 !important; /* Light green background */
  border-color: #16a34a !important; /* Darker green border */
  border-width: 2px !important;
  border-style: solid !important;
  color: #000000 !important; /* Black text for better readability */
  opacity: 1 !important; /* Ensure full opacity */
  font-weight: 500 !important; /* Slightly bolder text for consistency */
  transition: all 0.3s ease !important;
}

.field-populated:focus,
input.field-populated:focus,
select.field-populated:focus,
textarea.field-populated:focus {
  border-color: #15803d !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
  background-color: #dcfce7 !important;
  color: #000000 !important;
}

.field-populated:hover,
input.field-populated:hover,
select.field-populated:hover,
textarea.field-populated:hover {
  background-color: #bbf7d0 !important; /* Slightly darker green on hover */
  border-color: #15803d !important;
  color: #000000 !important;
}

/* Override Tailwind CSS classes that might interfere */
.border-gray-300.field-populated,
.border-gray-200.field-populated {
  background-color: #dcfce7 !important; /* Light green background */
  border-color: #16a34a !important; /* Darker green border */
  border-width: 2px !important;
  border-style: solid !important;
  color: #000000 !important; /* Black text for better readability */
}

.bg-white.field-populated {
  background-color: #dcfce7 !important; /* Light green background */
  color: #000000 !important; /* Black text for better readability */
}

/* === Disabled Field Styling === */
.pending-selection:not(.field-populated):disabled,
.pending-selection:disabled {
  background-color: #f3f4f6 !important;
  border-color: #e5e7eb !important;
  color: #9ca3af !important;
  border-width: 1px !important;
  border-style: solid !important;
}

/* Force disabled fields to never show green borders */
input:disabled,
select:disabled,
textarea:disabled {
  border-color: #e5e7eb !important;
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
}

/* Specifically target the building field when disabled */
#building:disabled,
#building.pending-selection {
  border-color: #e5e7eb !important;
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
  border-width: 1px !important;
  border-style: solid !important;
}

/* === Enabled Field Styling (not disabled) === */
input:not(:disabled):not(.field-populated),
select:not(:disabled):not(.field-populated),
textarea:not(:disabled):not(.field-populated) {
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
  color: #374151 !important;
}

/* === Ensure consistent text color for populated fields === */
.field-populated,
input.field-populated,
select.field-populated,
textarea.field-populated {
  color: #000000 !important; /* Force black text */
}

/* Override any text color classes that might interfere */
.text-gray-700.field-populated,
.text-gray-600.field-populated,
.text-gray-500.field-populated {
  color: #000000 !important;
}

/* Fix placeholder text styling for populated fields - Cross-browser support */
.field-populated::placeholder,
.field-populated::-webkit-input-placeholder,
.field-populated::-moz-placeholder,
.field-populated:-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Fix placeholder text styling for enabled fields (not disabled) - Cross-browser support */
input:not(:disabled)::placeholder,
input:not(:disabled)::-webkit-input-placeholder,
input:not(:disabled)::-moz-placeholder,
input:not(:disabled):-ms-input-placeholder,
select:not(:disabled)::placeholder,
select:not(:disabled)::-webkit-input-placeholder,
select:not(:disabled)::-moz-placeholder,
select:not(:disabled):-ms-input-placeholder,
textarea:not(:disabled)::placeholder,
textarea:not(:disabled)::-webkit-input-placeholder,
textarea:not(:disabled)::-moz-placeholder,
textarea:not(:disabled):-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Force black placeholder text on ALL enabled fields - Override any inherited colors */
input:not(:disabled)::placeholder,
input:not(:disabled)::-webkit-input-placeholder,
input:not(:disabled)::-moz-placeholder,
input:not(:disabled):-ms-input-placeholder,
select:not(:disabled)::placeholder,
select:not(:disabled)::-webkit-input-placeholder,
select:not(:disabled)::-moz-placeholder,
select:not(:disabled):-ms-input-placeholder,
textarea:not(:disabled)::placeholder,
textarea:not(:disabled)::-webkit-input-placeholder,
textarea:not(:disabled)::-moz-placeholder,
textarea:not(:disabled):-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Additional override for fields that might have inline styles affecting placeholder */
input[style*="color"]:not(:disabled)::placeholder,
input[style*="color"]:not(:disabled)::-webkit-input-placeholder,
input[style*="color"]:not(:disabled)::-moz-placeholder,
input[style*="color"]:not(:disabled):-ms-input-placeholder,
select[style*="color"]:not(:disabled)::placeholder,
select[style*="color"]:not(:disabled)::-webkit-input-placeholder,
select[style*="color"]:not(:disabled)::-moz-placeholder,
select[style*="color"]:not(:disabled):-ms-input-placeholder,
textarea[style*="color"]:not(:disabled)::placeholder,
textarea[style*="color"]:not(:disabled)::-webkit-input-placeholder,
textarea[style*="color"]:not(:disabled)::-moz-placeholder,
textarea[style*="color"]:not(:disabled):-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Nuclear option - Force black placeholder on ALL form elements regardless of state */
#inspection-form input::placeholder,
#inspection-form input::-webkit-input-placeholder,
#inspection-form input::-moz-placeholder,
#inspection-form input:-ms-input-placeholder,
#inspection-form select::placeholder,
#inspection-form select::-webkit-input-placeholder,
#inspection-form select::-moz-placeholder,
#inspection-form select:-ms-input-placeholder,
#inspection-form textarea::placeholder,
#inspection-form textarea::-webkit-input-placeholder,
#inspection-form textarea::-moz-placeholder,
#inspection-form textarea:-ms-input-placeholder,
#dynamic-form-fields input::placeholder,
#dynamic-form-fields input::-webkit-input-placeholder,
#dynamic-form-fields input::-moz-placeholder,
#dynamic-form-fields input:-ms-input-placeholder,
#dynamic-form-fields select::placeholder,
#dynamic-form-fields select::-webkit-input-placeholder,
#dynamic-form-fields select::-moz-placeholder,
#dynamic-form-fields select:-ms-input-placeholder,
#dynamic-form-fields textarea::placeholder,
#dynamic-form-fields textarea::-webkit-input-placeholder,
#dynamic-form-fields textarea::-moz-placeholder,
#dynamic-form-fields textarea:-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Specific fix for cascading fields - Force black placeholder on enabled select fields */
select:not(:disabled)::placeholder,
select:not(:disabled)::-webkit-input-placeholder,
select:not(:disabled)::-moz-placeholder,
select:not(:disabled):-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Additional fix for select elements that might have "Select..." placeholder text */
select option:first-child {
  color: #000000 !important;
}

/* Force black text on select elements when they're enabled but showing placeholder */
select:not(:disabled) {
  color: #000000 !important;
}

/* Override any gray text styling on enabled select fields */
select:not(:disabled):not(.field-populated) {
  color: #000000 !important;
}

/* Force black text on ALL enabled select fields regardless of selection state */
select:not(:disabled) {
  color: #000000 !important;
}

/* Force black text on selected options in enabled select fields */
select:not(:disabled) option:checked,
select:not(:disabled) option[selected] {
  color: #000000 !important;
}

/* Override any inline styles that might be making selected text gray */
select[style*="color"]:not(:disabled) {
  color: #000000 !important;
}

/* Nuclear option for select fields - force black text on everything */
#inspection-form select:not(:disabled),
#dynamic-form-fields select:not(:disabled) {
  color: #000000 !important;
}

/* Force black text on select field content when enabled */
select:not(:disabled) * {
  color: #000000 !important;
}

/* Ensure placeholder text is black for enabled form fields - Cross-browser support */
#inspection-form input:not(:disabled)::placeholder,
#inspection-form input:not(:disabled)::-webkit-input-placeholder,
#inspection-form input:not(:disabled)::-moz-placeholder,
#inspection-form input:not(:disabled):-ms-input-placeholder,
#inspection-form select:not(:disabled)::placeholder,
#inspection-form select:not(:disabled)::-webkit-input-placeholder,
#inspection-form select:not(:disabled)::-moz-placeholder,
#inspection-form select:not(:disabled):-ms-input-placeholder,
#inspection-form textarea:not(:disabled)::placeholder,
#inspection-form textarea:not(:disabled)::-webkit-input-placeholder,
#inspection-form textarea:not(:disabled)::-moz-placeholder,
#inspection-form textarea:not(:disabled):-ms-input-placeholder,
#dynamic-form-fields input:not(:disabled)::placeholder,
#dynamic-form-fields input:not(:disabled)::-webkit-input-placeholder,
#dynamic-form-fields input:not(:disabled)::-moz-placeholder,
#dynamic-form-fields input:not(:disabled):-ms-input-placeholder,
#dynamic-form-fields select:not(:disabled)::placeholder,
#dynamic-form-fields select:not(:disabled)::-webkit-input-placeholder,
#dynamic-form-fields select:not(:disabled)::-moz-placeholder,
#dynamic-form-fields select:not(:disabled):-ms-input-placeholder,
#dynamic-form-fields textarea:not(:disabled)::placeholder,
#dynamic-form-fields textarea:not(:disabled)::-webkit-input-placeholder,
#dynamic-form-fields textarea:not(:disabled)::-moz-placeholder,
#dynamic-form-fields textarea:not(:disabled):-ms-input-placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

/* Ensure select option text is properly colored */
.field-populated option {
  color: #000000 !important;
  background-color: #dcfce7 !important;
}

/* Force consistent text styling for all populated field types */
.field-populated[type="text"],
.field-populated[type="number"],
.field-populated[type="email"],
.field-populated[type="tel"],
.field-populated[type="url"],
.field-populated[type="search"],
.field-populated[type="password"],
.field-populated[type="date"],
.field-populated[type="time"],
.field-populated[type="datetime-local"],
.field-populated[type="month"],
.field-populated[type="week"],
.field-populated[type="color"],
.field-populated[type="range"],
.field-populated[type="file"],
.field-populated[type="hidden"],
.field-populated[type="checkbox"],
.field-populated[type="radio"],
.field-populated[type="submit"],
.field-populated[type="button"],
.field-populated[type="reset"],
.field-populated[type="image"] {
  color: #000000 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

/* Specific styling for textarea elements */
textarea.field-populated {
  color: #000000 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
  background-color: #dcfce7 !important;
  border-color: #16a34a !important;
  border-width: 2px !important;
  border-style: solid !important;
}

/* === Score bar styling (unchanged) === */
.score-bar {
  min-width: 200px;
}

.score-bar-fill {
  background-color: #0197da;
  height: 100%;
  transition: width 0.4s ease-in-out;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  overflow-anchor: none;
  
  /* Mobile scrolling optimizations */
  touch-action: pan-x pan-y;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: scroll-position;
  contain: layout style paint;
}

/* ===== SORTING STYLES ===== */

/* Sort indicators */
.sort-indicator {
  font-size: 12px;
  font-weight: bold;
  color: #6B7280;
  transition: color 0.2s ease;
  user-select: none;
}

.sort-indicator.sort-asc {
  color: #0197da;
}

.sort-indicator.sort-desc {
  color: #0197da;
}

.sort-indicator.sort-none {
  color: #9CA3AF;
}

/* Sortable column headers */
th.sort-active {
  background-color: #F3F4F6 !important;
  border-color: #0197da !important;
}

th:hover .sort-indicator {
  color: #0197da;
}

/* ===== MODERN TABLE DESIGN ===== */

/* Table wrapper with enhanced styling */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  overflow-anchor: none;
  background: white;
  
  /* Mobile scrolling optimizations */
  touch-action: pan-x pan-y;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: scroll-position;
  contain: layout style paint;
}

/* Use full width but let cells stretch naturally */
#inspection-table,
#inventory-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  background: white;
  
  /* Mobile performance optimizations */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

/* Enhanced sticky header */
#inspection-table thead,
#inventory-table thead {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%); /* gray-50 to gray-100 */
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modern header cells */
#inspection-table thead th,
#inventory-table thead th {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
  white-space: nowrap;
  position: relative;
  background: transparent;
  transition: all 0.2s ease;
}

/* Header cell hover effects */
#inspection-table thead th:hover,
#inventory-table thead th:hover {
  background: rgba(1, 151, 218, 0.1);
  color: #0197da;
}

/* Filtered header styling */
#inspection-table thead th.filtered,
#inventory-table thead th.filtered {
  background: rgba(1, 151, 218, 0.2);
  color: #0197da;
  border-bottom-color: #0197da;
}

/* Body rows with enhanced styling and smooth transitions */
#inspection-table tbody tr,
#inventory-table tbody tr {
  white-space: nowrap;
  transition: all var(--transition-normal) var(--ease-out);
  border-bottom: 1px solid #f1f5f9;
  transform-origin: center;
}

/* Removed zebra striping for cleaner look */

/* Enhanced row hover with smooth transitions */
#inspection-table tbody tr:hover,
#inventory-table tbody tr:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-normal) var(--ease-out);
}

/* Selected row styling */
#inspection-table tbody tr.selected-row,
#inventory-table tbody tr.selected-row {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 4px solid #0197da;
  box-shadow: 0 2px 8px rgba(1, 151, 218, 0.2);
}

/* Modern body cells with enhanced transitions */
#inspection-table td,
#inventory-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  text-align: center;
  color: #374151;
  white-space: nowrap;
  transition: all var(--transition-fast) var(--ease-out);
  border-right: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
  
  /* Mobile touch optimizations */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Add subtle hover effect to cells */
#inspection-table td:hover,
#inventory-table td:hover {
  background-color: rgba(1, 151, 218, 0.05);
  transform: scale(1.02);
}

/* Remove duplicate hover effects - handled above */

/* Editable cell styling */
#inspection-table td[contenteditable="true"],
#inventory-table td[contenteditable="true"] {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 2px solid #0197da;
  border-radius: 4px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1);
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== PAGINATION STYLES ===== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(to right, #f9fafb, #f3f4f6);
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-right: 1rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
}

.pagination-btn.active {
  background: #0197da;
  border-color: #0197da;
  color: white;
}

.pagination-btn.active:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}


/* Mobile pagination adjustments */
@media (max-width: 768px) {
  .pagination-container {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .pagination-info {
    margin-right: 0.5rem;
    font-size: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
  }
  
  .pagination-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0;
  }
  
  .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  
  .pagination-ellipsis {
    min-width: 2rem;
    height: 2rem;
    flex-shrink: 0;
  }
}

.status-inspected {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #10b981;
}

.status-pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #f59e0b;
}

.status-pass {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #10b981;
}

.status-fail {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1px solid #ef4444;
}

.status-unavailable {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  color: #374151;
  border: 1px solid #9ca3af;
}

/* Action buttons in table with enhanced transitions */
.table-action-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-normal) var(--ease-out);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-origin: center;
}

/* Button ripple effect */
.table-action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow) var(--ease-out), height var(--transition-slow) var(--ease-out);
}

.table-action-btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #0197da 0%, #0178b3 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(1, 151, 218, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0178b3 0%, #015a8a 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(1, 151, 218, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(156, 163, 175, 0.2);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(156, 163, 175, 0.4);
}

/* Modern Filter Dropdown Design */
.filter-dropdown {
  background: white;
  border: 1px solid #e5e7eb;
  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);
  padding: 1.5rem;
  min-width: 280px;
  max-width: 320px;
  backdrop-filter: blur(10px);
  position: relative;
}

.filter-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
  z-index: 1;
}

.filter-dropdown::after {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid #e5e7eb;
  z-index: 0;
}

.filter-dropdown h4 {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-dropdown select {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: white;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.filter-dropdown select:focus {
  outline: none;
  border-color: #0197da;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1);
  background-color: #f8fafc;
}

.filter-dropdown select:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.filter-dropdown .filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.filter-dropdown .filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.filter-dropdown .filter-btn-primary {
  background: linear-gradient(135deg, #0197da 0%, #0178b3 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(1, 151, 218, 0.2);
}

.filter-dropdown .filter-btn-primary:hover {
  background: linear-gradient(135deg, #0178b3 0%, #015a8a 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(1, 151, 218, 0.3);
}

.filter-dropdown .filter-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.filter-dropdown .filter-btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Filter trigger button styling */
.filter-trigger {
  background: none;
  border: none;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-trigger:hover {
  background: rgba(1, 151, 218, 0.1);
  transform: scale(1.1);
}

.filter-trigger svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.filter-trigger:hover svg {
  color: #0197da;
}

/* Active filter indicator */
.filter-trigger.active {
  background: rgba(1, 151, 218, 0.1);
}

.filter-trigger.active svg {
  color: #0197da;
}

/* ===== MODERN FILTER PANEL ===== */

.filter-panel {
  background: white;
  border: 1px solid #e5e7eb;
  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);
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.filter-panel.active {
  display: block;
}

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

.filter-panel h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-panel h3 svg {
  width: 20px;
  height: 20px;
  color: #0197da;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: white;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: #0197da;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1);
  background-color: #f8fafc;
}

.filter-input:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.filter-select {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: white;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.filter-select:focus {
  outline: none;
  border-color: #0197da;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1);
  background-color: #f8fafc;
}

.filter-select:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.filter-panel-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.filter-panel-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-panel-btn-primary {
  background: linear-gradient(135deg, #0197da 0%, #0178b3 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(1, 151, 218, 0.2);
}

.filter-panel-btn-primary:hover {
  background: linear-gradient(135deg, #0178b3 0%, #015a8a 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(1, 151, 218, 0.3);
}

.filter-panel-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.filter-panel-btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
}

.filter-panel-btn svg {
  width: 16px;
  height: 16px;
}

/* Filter toggle button states */
.filter-toggle-btn.active {
  background: linear-gradient(135deg, #0197da 0%, #0178b3 100%);
  color: white;
  border-color: #0178b3;
}

.filter-toggle-btn.active svg {
  color: white;
}

.filter-toggle-btn.active:hover {
  background: linear-gradient(135deg, #0178b3 0%, #015a8a 100%);
}

/* Loading states */
.table-loading {
  opacity: 0.6;
  pointer-events: none;
}

.table-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Hardware acceleration for smooth scrolling */
.table-wrapper {
  transform: translateZ(0);
  will-change: scroll-position;
}

/* Optimize table rendering */
#inspection-table,
#inventory-table {
  contain: layout style paint;
}

/* Optimize row animations */
#inspection-table tbody tr,
#inventory-table tbody tr {
  will-change: transform, background-color;
}

/* ===== MOBILE RESPONSIVENESS ===== */

@media (max-width: 768px) {
  /* Compact action bar on mobile */
  .bg-gradient-to-r {
    padding: 1rem;
  }
  
  .flex-wrap {
    flex-direction: column;
    gap: 1rem;
  }
  
  .flex-wrap > div:first-child {
    order: 2;
  }
  
  .flex-wrap > div:last-child {
    order: 1;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* Consistent button sizing on mobile */
  .flex.items-center.gap-2,
  .flex.items-center.gap-3 button {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .flex.items-center.gap-2 img,
  .flex.items-center.gap-3 button img {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
  }
  
  /* Ensure all action buttons have consistent sizing */
  .bg-gradient-to-r .flex.items-center.gap-3 button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }
  
  .bg-gradient-to-r .flex.items-center.gap-3 button img {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
  }
  
  /* Ensure filter button matches other buttons */
  #inventory-filter-toggle {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }
  
  #inventory-filter-toggle svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0 !important;
  }
  
  #inventory-filter-toggle span:not(#inventory-filter-badge) {
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }
  
  /* Ensure inventory count and filter badge are visible on mobile */
  #inventory-count {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
  }
  
  #inventory-count svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
  }
  
  #inventory-count span {
    white-space: nowrap;
    font-size: 0.75rem;
  }
  
  #inventory-filter-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.625rem;
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    z-index: 10;
  }
  
  /* Ensure filter button has proper positioning for badge */
  #inventory-filter-toggle {
    position: relative;
  }
  
  /* Compact table on mobile */
  #inspection-table td,
  #inventory-table td {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    
    /* Enhanced mobile touch optimizations */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }
  
  #inspection-table thead th,
  #inventory-table thead th {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
  }
  
  /* Smaller status indicators on mobile */
  .status-indicator {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
  }
  
  /* Enhanced mobile scrolling for table wrapper */
  .table-wrapper {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    scroll-snap-type: none;
    touch-action: pan-x pan-y;
  }
  
  /* Disable hover effects on mobile for better touch performance */
  #inspection-table td:hover,
  #inventory-table td:hover {
    background-color: transparent;
  }
  
  .status-indicator svg {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .table-wrapper {
    border-radius: 8px;
    margin: 0 -0.5rem;
  }
  
  #inspection-table td,
  #inventory-table td {
    font-size: 0.625rem;
    padding: 0.375rem 0.5rem;
  }
  
  #inspection-table thead th,
  #inventory-table thead th {
    font-size: 0.625rem;
    padding: 0.5rem 0.375rem;
  }
  
  /* Ensure inventory count is always visible on small screens */
  #inventory-count {
    font-size: 0.625rem !important;
    padding: 0.125rem 0.375rem !important;
  }
  
  #inventory-count span {
    font-size: 0.625rem !important;
  }
  
  /* Make buttons more compact on very small screens */
  .flex.items-center.gap-2,
  .flex.items-center.gap-3 button {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.625rem !important;
  }
  
  /* Hide button text on very small screens but keep icons */
  .flex.items-center.gap-2 span:not(#inventory-count span),
  .flex.items-center.gap-3 button span {
    display: none;
  }
  
  /* Ensure filter badge is visible */
  #inventory-filter-badge {
    min-width: 1rem !important;
    height: 1rem !important;
    font-size: 0.5rem !important;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus indicators */
#inspection-table td:focus,
#inventory-table td:focus,
.filter-dropdown select:focus,
.table-action-btn:focus {
  outline: 2px solid #0197da;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .status-indicator {
    border-width: 2px;
  }
  
  #inspection-table thead th,
  #inventory-table thead th {
    border-bottom-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #inspection-table tbody tr,
  #inventory-table tbody tr,
  .table-action-btn,
  .status-indicator {
    transition: none;
  }
  
  .table-wrapper {
    scroll-behavior: auto;
  }
}

/* ===== PRINT STYLES ===== */

@media print {
  .table-wrapper {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  #inspection-table thead th,
  #inventory-table thead th {
    background: #f3f4f6 !important;
    color: #374151 !important;
  }
  
  .status-indicator {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
}

/* ===== MODERN TRANSITION SYSTEM ===== */

/* CSS Custom Properties for consistent timing */
:root {
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-spring: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Easing curves for different interactions */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== PAGE TRANSITIONS ===== */

/* Page enter animation */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page exit animation */
@keyframes pageExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Apply page transitions to main content */
main {
  animation: pageEnter var(--transition-slow) var(--ease-out);
}

/* ===== ENHANCED LOADING ANIMATIONS ===== */

/* Loading spinner container with enhanced styling */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  animation: fadeIn var(--transition-normal) var(--ease-out);
}

/* Main spinner animation with enhanced styling */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(243, 243, 243, 0.3);
  border-top: 4px solid #0197da;
  border-radius: 50%;
  animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(1, 151, 218, 0.3);
}

/* Enhanced spinner keyframes */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade out animation */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Loading text styling */
.loading-text {
  margin-top: 20px;
  color: #6b7280;
  font-size: 16px;
  font-weight: 500;
}

/* Hide loading when content is ready */
.loading-container.hidden {
  display: none;
}

/* Hide content while loading */
.content-container.hidden {
  display: none;
}

/* Fullscreen loader overlay */
.fullscreen-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.fullscreen-loader.hidden {
  display: none;
}

/* Inline loader for small elements */
.inline-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inline-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0197da;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Button loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== FORM STYLES - ALIGNED WITH TABLE DESIGN ===== */

/* Form input styling to match table filter inputs with enhanced transitions */
#inspection-form input[type="text"],
#inspection-form input[type="number"],
#inspection-form input[type="date"],
#inspection-form input[type="time"],
#inspection-form select,
#inspection-form textarea {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: white;
  font-size: 0.875rem;
  color: #374151;
  transition: all var(--transition-normal) var(--ease-out);
  position: relative;
  transform-origin: center;
}

/* Form input focus enhancement */
#inspection-form input:focus,
#inspection-form select:focus,
#inspection-form textarea:focus {
  outline: none;
  border-color: #0197da;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1);
  background-color: #f8fafc;
  transform: scale(1.02);
}

/* Form input hover enhancement */
#inspection-form input:hover,
#inspection-form select:hover,
#inspection-form textarea:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
  transform: scale(1.01);
}

/* Form select dropdown styling */
#inspection-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Form label styling */
#inspection-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

/* Form field group styling */
#dynamic-form-fields .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Form field container styling */
#dynamic-form-fields .field-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Form button styling to match table action buttons */
#inspection-form button:not(#scan-button):not(#lookup-button):not(#prev-outlet):not(#next-outlet):not(#submit-button) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

#inspection-form button:not(#scan-button):not(#lookup-button):not(#prev-outlet):not(#next-outlet):not(#submit-button):hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}

/* Form checkbox and radio styling */
#inspection-form input[type="checkbox"],
#inspection-form input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
  accent-color: #0197da;
}

/* Form field grid layout */
#dynamic-form-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Mobile form responsiveness */
@media (max-width: 768px) {
  #dynamic-form-fields {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  #dynamic-form-fields .col-span-1,
  #dynamic-form-fields .col-span-2 {
    grid-column: span 1;
  }
  
  #inspection-form input,
  #inspection-form select,
  #inspection-form textarea {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  #inspection-form label {
    font-size: 0.75rem;
  }
  
  #inspection-form button {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* Hide lookup button on small screens for Fire Safety devices */
  #lookup-button {
    display: none !important;
  }
}

/* Form validation styling */
#inspection-form input:invalid,
#inspection-form select:invalid,
#inspection-form textarea:invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Removed automatic green styling for valid fields - handled by form progression system */

/* Form section spacing */
#form-section .space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* Form loading state */
#inspection-form.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Form success state */
#inspection-form.success {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
}

/* Form error state */
#inspection-form.error {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.05);
}

/* ===== FORM PROGRESSION HIGHLIGHTING ===== */

/* Next field to fill highlighting - REMOVED */

/* Removed pulse animation - keeping styling simple */

/* Completed field highlighting - GREEN FILL */
.form-field-completed {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
  position: relative;
}

/* Override any conflicting UX classes for completed fields */
.form-field-completed.pending-selection,
.form-field-completed.loading,
.form-field-completed.ready,
.form-field-completed.selected,
.form-field-completed.no-options,
.form-field-completed.error {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

/* Completed field checkmark indicator - REMOVED */

/* Submit button highlighting - REMOVED */

/* Enhanced field group highlighting - REMOVED */

/* Ensure proper spacing for checkmark in completed fields */
.form-field-completed {
  padding-right: 2.5rem !important;
}

/* Special handling for select elements with checkmarks */
.form-field-completed select {
  padding-right: 3rem !important;
}

/* Disabled field styling that doesn't interfere with progression */
#inspection-form input:disabled,
#inspection-form select:disabled,
#inspection-form textarea:disabled {
  background-color: #f9fafb !important;
  color: #6b7280 !important;
  cursor: not-allowed;
}

/* Special styling for fields disabled after gas type */
.field-disabled-after-gas {
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  opacity: 0.6;
}

/* Special styling for fields disabled after room (FlexLine only) */
.field-disabled-after-room {
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  opacity: 0.6;
}

/* Disabled field styling - REMOVED form-field-next references */

/* Remove duplicate - already defined above */

/* Field group next styling - REMOVED */

/* Next field label styling - REMOVED */


/* ===== DASHBOARD STYLES ===== */

/* Dashboard card styling with enhanced transitions */
.dashboard-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-normal) var(--ease-out);
  transform-origin: center;
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(1, 151, 218, 0.1), transparent);
  transition: left var(--transition-slow) var(--ease-out);
}

.dashboard-card:hover::before {
  left: 100%;
}

.dashboard-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(1, 151, 218, 0.3);
}

/* Dashboard action bar styling */
.dashboard-action-bar {
  background: linear-gradient(to right, #f9fafb, #f3f4f6);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dashboard grid responsive behavior */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Mobile dashboard adjustments */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-card {
    padding: 1rem;
  }
  
  .dashboard-action-bar {
    padding: 1rem;
  }
  
  .dashboard-action-bar .flex-wrap {
    flex-direction: column;
    gap: 1rem;
  }
  
  .dashboard-action-bar .flex-wrap > div:first-child {
    order: 2;
  }
  
  .dashboard-action-bar .flex-wrap > div:last-child {
    order: 1;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .dashboard-grid {
    gap: 0.75rem;
  }
  
  .dashboard-card {
    padding: 0.75rem;
  }
  
  .dashboard-action-bar {
    padding: 0.75rem;
  }
}

/* Dashboard status indicators */
.dashboard-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Dashboard chart containers */
.dashboard-chart-container {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.dashboard-chart-container:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dashboard progress text styling */
.dashboard-progress-percentage {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dashboard-progress-text {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ===== ENHANCED FORM UX STYLES ===== */

/* Form field states */
.pending-selection {
  /* Yellow styling removed */
  position: relative;
}

.loading {
  border-color: #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.05) !important;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  pointer-events: none;
}

/* .ready class styling - only applies when not overridden by form progression */
.ready:not(.form-field-completed):not(.form-field-next) {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Component field ready styling - force lighter green for component field */
.component-ready {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Ready field checkmark indicator - REMOVED */

.selected {
  border-color: #0197da !important;
  background-color: rgba(1, 151, 218, 0.05) !important;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.1) !important;
}

.no-options {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
  color: #dc2626 !important;
}

.no-options::after {
  content: '⚠️';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: #ef4444;
  pointer-events: none;
}

.error {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
  color: #dc2626 !important;
}

.error::after {
  content: '❌';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: #ef4444;
  pointer-events: none;
}

/* Auto-populated field styling - only applies when not overridden by form progression */
.auto-populated:not(.form-field-completed):not(.form-field-next) {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
  position: relative;
}

.auto-populated::after {
  content: '🤖';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: #10b981;
  pointer-events: none;
}

/* Auto-populate notification */
.auto-populate-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: white;
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-icon {
  font-size: 1rem;
}

.notification-text {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
}

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

/* Mobile notification adjustments */
@media (max-width: 768px) {
  .auto-populate-notification {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    padding: 0.5rem 0.75rem;
  }
  
  .notification-text {
    font-size: 0.75rem;
  }
}

/* ===== AUTH MODAL STYLES ===== */

/* Modal overlay with enhanced transitions */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn var(--transition-normal) var(--ease-out);
  backdrop-filter: blur(4px);
}

/* Modal container base styles with enhanced animations */
.auth-modal {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn var(--transition-bounce) var(--ease-bounce);
  transform-origin: center;
}

/* Modal slide in animation */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Login modal - compact height for 2 fields */
.auth-modal-login {
  min-height: 400px;
}

/* Signup modal - natural height expansion for 4 fields */
.auth-modal-signup {
  min-height: 450px;
}

/* Modal logo */
.auth-modal-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-modal-logo img {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Modal form inputs */
.auth-modal-inputs {
  margin: 1rem 0;
}

.auth-modal-input {
  width: 100%;
  padding: 8px;
  margin: 4px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Modal button */
.auth-modal-button {
  background: #0197da;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin: 4px;
  width: 100%;
  box-sizing: border-box;
}

.auth-modal-button:hover {
  background: #0178b3;
}

/* Modal footer text */
.auth-modal-footer {
  margin-top: 1rem;
  font-size: 14px;
  color: #666;
}

.auth-modal-footer a {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.auth-modal-footer a:hover {
  color: #1d4ed8;
}

/* ===== MODERN TRANSITION UTILITIES ===== */

/* Staggered animation for lists */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn var(--transition-slow) var(--ease-out) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

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

/* Smooth scale animation */
.scale-on-hover {
  transition: transform var(--transition-normal) var(--ease-out);
}

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

/* Smooth slide animation */
.slide-in-left {
  animation: slideInLeft var(--transition-slow) var(--ease-out);
}

.slide-in-right {
  animation: slideInRight var(--transition-slow) var(--ease-out);
}

.slide-in-up {
  animation: slideInUp var(--transition-slow) var(--ease-out);
}

.slide-in-down {
  animation: slideInDown var(--transition-slow) var(--ease-out);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bounce animation */
.bounce-in {
  animation: bounceIn var(--transition-bounce) var(--ease-bounce);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse animation for attention */
.pulse-attention {
  animation: pulseAttention 2s ease-in-out infinite;
}

@keyframes pulseAttention {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(1, 151, 218, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(1, 151, 218, 0);
  }
}

/* Shake animation for errors */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Smooth reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-slow) var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth hide animation */
.hide {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--transition-normal) var(--ease-out);
}

.hide.hidden {
  opacity: 0;
  transform: translateY(-20px);
}

/* Loading skeleton animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

/* Smooth color transitions */
.color-transition {
  transition: color var(--transition-normal) var(--ease-out), 
              background-color var(--transition-normal) var(--ease-out),
              border-color var(--transition-normal) var(--ease-out);
}

/* Smooth transform transitions */
.transform-transition {
  transition: transform var(--transition-normal) var(--ease-out);
}

/* Smooth opacity transitions */
.opacity-transition {
  transition: opacity var(--transition-normal) var(--ease-out);
}

/* Smooth all transitions */
.smooth-transition {
  transition: all var(--transition-normal) var(--ease-out);
}

/* ===== ENHANCED HAMBURGER MENU ANIMATIONS ===== */

/* Hamburger menu icon animation */
.hamburger-icon {
  transition: transform var(--transition-normal) var(--ease-out);
}

.hamburger-icon:hover {
  transform: scale(1.1);
}

/* Mobile menu slide animation */
.mobile-menu {
  transition: all var(--transition-normal) var(--ease-out);
  transform: translateY(-100%);
  opacity: 0;
}

.mobile-menu.show {
  transform: translateY(0);
  opacity: 1;
}

/* ===== ENHANCED SCROLL ANIMATIONS ===== */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Scroll-triggered animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow) var(--ease-out);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ENHANCED FOCUS STATES ===== */

/* Enhanced focus ring */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 151, 218, 0.3);
  transform: scale(1.02);
  transition: all var(--transition-fast) var(--ease-out);
}

/* ===== ENHANCED INTERACTION FEEDBACK ===== */

/* Button press animation */
.btn-press:active {
  transform: scale(0.98);
  transition: transform var(--transition-fast) var(--ease-out);
}

/* Card lift animation */
.card-lift {
  transition: all var(--transition-normal) var(--ease-out);
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ===== RIPPLE EFFECT ===== */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== ENHANCED FORM ANIMATIONS ===== */

/* Field completion animation */
.field-completed {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
  position: relative;
}

.field-completed::after {
  content: '✓';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #10b981;
  font-weight: bold;
  font-size: 0.875rem;
  animation: checkmark-appear 0.3s ease-out;
}

@keyframes checkmark-appear {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* Completion animation */
.completion-animation {
  animation: completion-pulse 0.6s ease-out;
}

@keyframes completion-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Form submission states */
.form-submitting {
  opacity: 0.7;
  pointer-events: none;
}

.form-submitted {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
}

/* ===== SUCCESS NOTIFICATION ===== */

.success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
}

/* ===== ENHANCED TABLE ANIMATIONS ===== */

/* Table row animations */
.table-row-enter {
  animation: tableRowEnter 0.3s ease-out;
}

.table-row-exit {
  animation: tableRowExit 0.3s ease-out;
}

@keyframes tableRowEnter {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ===== ENHANCED MODAL ANIMATIONS ===== */

.modal-backdrop {
  backdrop-filter: blur(4px);
  transition: backdrop-filter var(--transition-normal) var(--ease-out);
}

/* ===== ENHANCED PROGRESS ANIMATIONS ===== */

.progress-bar-animated {
  transition: width 1s ease-out;
}

/* ===== ENHANCED COUNTER ANIMATIONS ===== */

.counter-animated {
  transition: all var(--transition-normal) var(--ease-out);
}

/* ===== ENHANCED FOCUS STATES ===== */

.focused {
  transform: scale(1.02);
  transition: transform var(--transition-fast) var(--ease-out);
}

/* ===== ENHANCED HOVER STATES ===== */

.hover-lift {
  transition: transform var(--transition-normal) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* ===== ENHANCED LOADING STATES ===== */

.skeleton-row {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .stagger-item {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .ripple {
    animation: none;
  }
  
  .field-completed::after {
    animation: none;
  }
}

