/* ===== HomeInspectAI — Professional SaaS Styles ===== */
/* Brand: Navy #0A1628, Green #22C55E, White */

:root {
  --navy: #0A1628;
  --navy-light: #132240;
  --navy-mid: #1B2D4F;
  --green: #22C55E;
  --green-dark: #16a34a;
  --green-light: #F0FDF4;
  --white: #ffffff;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --yellow: #F59E0B;
  --yellow-light: #FEF3C7;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sidebar-logo .logo-text {
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px;
}
.sidebar-logo .logo-text span { color: var(--green); }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
  margin-bottom: 4px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: rgba(34,197,94,0.15); color: var(--green); }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-plan { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.sidebar-user .logout-btn {
  background: none; border: none; color: rgba(255,255,255,0.4);
  cursor: pointer; padding: 6px; border-radius: 6px; transition: all var(--transition);
}
.sidebar-user .logout-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.page-header .header-actions { display: flex; gap: 12px; align-items: center; }
.page-body { padding: 32px; }

/* Mobile sidebar toggle */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--navy); color: #fff;
  padding: 12px 16px;
  z-index: 99;
  align-items: center; gap: 12px;
}
.mobile-header .logo-text { font-size: 1.1rem; font-weight: 800; }
.mobile-header .logo-text span { color: var(--green); }
.hamburger {
  background: none; border: none; color: #fff;
  font-size: 1.3rem; cursor: pointer; padding: 4px 8px;
}
.sidebar-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding-top: 52px; max-width: 100vw; overflow-x: hidden; }
  .page-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .page-header h1 { font-size: 1.15rem; }
  .page-body { padding: 16px 12px; }

  /* Stats grid */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .stat-card { padding: 16px 12px; gap: 10px; }
  .stat-value { font-size: 1.4rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1rem; }

  /* Buttons */
  .btn-lg { width: 100%; justify-content: center; }
  .header-actions .btn { padding: 8px 14px; font-size: 0.8rem; }

  /* Wizard */
  .wizard-steps { padding: 12px 8px; gap: 0; }
  .wizard-step { padding: 6px 8px; font-size: 0.75rem; }
  .wizard-step .step-num { width: 24px; height: 24px; font-size: 0.7rem; }
  .wizard-connector { flex: 0 0 16px; }

  /* Photo grid */
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Upload zone */
  .upload-zone { padding: 32px 16px; }
  .upload-zone i { font-size: 2rem; }

  /* Cards */
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Delivery grid */
  .delivery-grid { grid-template-columns: 1fr; }

  /* Findings */
  .finding-card-header { padding: 12px; gap: 10px; }
  .finding-card-header .finding-thumb { width: 48px; height: 48px; }
  .finding-card-header .finding-title h3 { font-size: 0.85rem; }

  /* Inspection list items */
  .inspection-item { padding: 12px 16px; gap: 10px; }
  .inspection-item .insp-icon { width: 36px; height: 36px; font-size: 0.9rem; }
  .inspection-item .insp-address { font-size: 0.9rem; }

  /* Profile */
  .profile-form { max-width: 100%; }
  .logo-upload { flex-direction: column; align-items: flex-start; }

  /* Modal */
  .modal { width: 95%; max-width: 95%; }

  /* Toast */
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: 100%; }

  /* Tables scrollable */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Profile banner */
  .profile-banner { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .profile-banner .progress-bar { width: 100%; }

  /* Report view */
  .report-wrapper { padding: 8px; }
  .report-header-branded { padding: 16px; flex-direction: column; text-align: center; gap: 12px; }

  /* Wizard step buttons row */
  .wizard-panel .card-body > div:last-child { flex-wrap: wrap; }
  .wizard-panel .card-body > div:last-child .btn { flex: 1; min-width: 120px; justify-content: center; }

  /* Address lookup row */
  #wizStep1 div[style*="display:flex;gap:8px"] { flex-direction: column; }
  #wizStep1 div[style*="display:flex;gap:8px"] .btn { width: 100%; justify-content: center; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(34,197,94,0.3); }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-navy { background: linear-gradient(135deg, var(--navy), var(--navy-mid)); color: #fff; }
.btn-navy:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(10,22,40,0.3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 24px; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-100); font-weight: 600; color: var(--navy); }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 24px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--green); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.green { background: var(--green-light); color: var(--green-dark); }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow); }
.stat-icon.navy { background: rgba(10,22,40,0.08); color: var(--navy); }
.stat-info { flex: 1; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }

/* ===== PROFILE COMPLETION BAR ===== */
.profile-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.profile-banner:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.profile-banner i { font-size: 1.5rem; color: var(--green); }
.profile-banner .banner-text { flex: 1; }
.profile-banner .banner-text h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.profile-banner .banner-text p { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.profile-banner .progress-bar { width: 120px; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.profile-banner .progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.5s ease; }

/* ===== TABLES / LISTS ===== */
.inspections-list { margin-top: 8px; }
.inspection-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background var(--transition);
}
.inspection-item:hover { background: var(--gray-50); }
.inspection-item:last-child { border-bottom: none; }
.inspection-item .insp-icon {
  width: 44px; height: 44px;
  background: var(--green-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-dark); font-size: 1.1rem;
}
.inspection-item .insp-info { flex: 1; min-width: 0; }
.inspection-item .insp-address { font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inspection-item .insp-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }
.inspection-item .insp-meta span { margin-right: 12px; }
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-yellow { background: var(--yellow-light); color: #B45309; }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 32px;
  color: var(--gray-400);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 24px; }

/* ===== WIZARD / STEPS ===== */
.wizard-steps {
  display: flex; align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 16px 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.wizard-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; white-space: nowrap;
  font-size: 0.85rem; font-weight: 500; color: var(--gray-400);
  position: relative;
}
.wizard-step .step-num {
  width: 28px; height: 28px;
  border-radius: 50%; border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  transition: all var(--transition);
}
.wizard-step.active { color: var(--navy); }
.wizard-step.active .step-num { border-color: var(--green); background: var(--green); color: #fff; }
.wizard-step.completed { color: var(--green-dark); }
.wizard-step.completed .step-num { border-color: var(--green); background: var(--green); color: #fff; }
.wizard-step.completed .step-num::after { content: '✓'; }
.wizard-step.completed .step-num span { display: none; }
.wizard-connector { flex: 0 0 32px; height: 2px; background: var(--gray-200); margin: 0 4px; }
.wizard-connector.active { background: var(--green); }

.wizard-panel { display: none; animation: fadeIn 0.3s ease; }
.wizard-panel.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}
.form-group .hint { font-size: 0.8rem; color: var(--gray-400); font-weight: 400; margin-left: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-family: inherit; color: var(--gray-800);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green); outline: none;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--green);
  background: var(--green-light);
}
.upload-zone i { font-size: 2.5rem; color: var(--gray-400); margin-bottom: 12px; }
.upload-zone.dragover i { color: var(--green); }
.upload-zone h3 { font-size: 1rem; color: var(--gray-700); margin-bottom: 4px; }
.upload-zone p { font-size: 0.85rem; color: var(--gray-400); }
.upload-zone .mobile-capture { margin-top: 12px; }

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-top: 16px;
}
.photo-thumb {
  position: relative; border-radius: var(--radius-sm);
  overflow: hidden; aspect-ratio: 1;
  background: var(--gray-100);
  border: 2px solid transparent;
  transition: all var(--transition);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-status {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #fff;
}
.photo-thumb .photo-status.pending { background: var(--gray-400); }
.photo-thumb .photo-status.analyzing { background: var(--yellow); animation: pulse 1s infinite; }
.photo-thumb .photo-status.done { background: var(--green); }
.photo-thumb .photo-status.error { background: var(--red); }
.photo-thumb .photo-status.failed { background: var(--red); }
.analysis-log-entry.error i { color: var(--red); }
.analysis-log-entry.error span { color: var(--red); }
.photo-thumb .photo-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff; font-size: 0.7rem; padding: 12px 6px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-thumb .voice-btn {
  position: absolute; bottom: 6px; right: 6px;
  width: 28px; height: 28px;
  background: var(--navy); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.photo-thumb:hover .voice-btn { opacity: 1; }
.photo-thumb .voice-btn.has-note { opacity: 1; background: var(--green); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ===== ANALYSIS PROGRESS ===== */
.analysis-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 32px;
}
.analysis-overall {
  margin-bottom: 24px;
}
.progress-bar-container {
  height: 8px; background: var(--gray-100);
  border-radius: 4px; overflow: hidden; margin-top: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.analysis-log {
  max-height: 400px; overflow-y: auto;
  font-size: 0.85rem;
}
.analysis-log-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
}
.analysis-log-entry i { width: 20px; text-align: center; }
.analysis-log-entry.success i { color: var(--green); }
.analysis-log-entry.pending i { color: var(--gray-400); }
.analysis-log-entry.analyzing i { color: var(--yellow); animation: pulse 1s infinite; }
.analysis-log-entry.error i { color: var(--red); }

/* ===== FINDINGS REVIEW ===== */
.finding-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
  overflow: hidden;
}
.finding-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.finding-card-header:hover { background: var(--gray-50); }
.finding-card-header .finding-thumb {
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden; flex-shrink: 0;
}
.finding-card-header .finding-thumb img { width: 100%; height: 100%; object-fit: cover; }
.finding-card-header .finding-title { flex: 1; }
.finding-card-header .finding-title h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.finding-card-header .finding-title .finding-section { font-size: 0.8rem; color: var(--gray-500); }
.condition-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.condition-good { background: var(--green-light); color: var(--green-dark); }
.condition-fair { background: var(--yellow-light); color: #B45309; }
.condition-poor { background: var(--red-light); color: var(--red); }
.condition-monitor { background: var(--blue-light); color: var(--blue); }
.finding-card-body {
  padding: 0 20px 20px;
  display: none;
}
.finding-card-body.open { display: block; animation: fadeIn 0.2s ease; }

/* ===== DELIVERY OPTIONS ===== */
.delivery-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.delivery-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.delivery-card:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); }
.delivery-card.selected { border-color: var(--green); background: var(--green-light); }
.delivery-card .delivery-icon {
  width: 56px; height: 56px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem; color: var(--navy);
}
.delivery-card:hover .delivery-icon { background: var(--green-light); color: var(--green-dark); }
.delivery-card h3 { font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.delivery-card p { font-size: 0.85rem; color: var(--gray-500); }

/* ===== PROFILE PAGE ===== */
.profile-form { max-width: 640px; }
.logo-upload {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.logo-preview {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--gray-400);
  overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===== REPORT VIEW (public) ===== */
.report-wrapper {
  max-width: 900px; margin: 0 auto; padding: 20px;
}
.report-header-branded {
  background: var(--navy);
  color: #fff;
  padding: 24px 32px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; gap: 20px;
}
.report-header-branded .company-logo {
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.report-header-branded .company-logo img { width: 100%; height: 100%; object-fit: cover; }
.report-header-branded .company-info h2 { font-size: 1.2rem; font-weight: 700; }
.report-header-branded .company-info p { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.report-content-frame {
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.report-content-frame iframe {
  width: 100%; border: none;
  min-height: 80vh;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none; border: none;
  color: var(--gray-400); cursor: pointer;
  font-size: 1.2rem; padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 12px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  max-width: 380px;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--blue); }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-dark { border-color: var(--gray-200); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  z-index: 9999;
}
.loading-screen .spinner { width: 32px; height: 32px; border-width: 3px; border-color: var(--gray-200); border-top-color: var(--green); }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-navy { color: var(--navy); }
.text-gray { color: var(--gray-500); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }
.gap-8 { gap: 8px; }

/* ===== INSTALL BANNER ===== */
.install-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
  z-index: 1500; box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

/* ===== METRICS CHARTS ===== */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.chart-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; }
.chart-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); margin-bottom: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-chart .bar { width: 100%; background: linear-gradient(180deg, var(--green), var(--green-dark)); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.5s ease; }
.bar-chart .bar-label { font-size: 0.7rem; color: var(--gray-500); white-space: nowrap; }
.bar-chart .bar-value { font-size: 0.75rem; font-weight: 600; color: var(--navy); }
.pie-bars { display: flex; flex-direction: column; gap: 8px; }
.pie-bar-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.pie-bar-row .pie-bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.pie-bar-row .pie-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.pie-bar-row .pie-bar-label { width: 110px; color: var(--gray-700); font-weight: 500; }
.pie-bar-row .pie-bar-count { width: 30px; text-align: right; font-weight: 600; color: var(--navy); }

/* ===== TEMPLATES ===== */
.template-section { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.template-section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; transition: background var(--transition); }
.template-section-header:hover { background: var(--gray-50); }
.template-section-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.template-section-body { padding: 0 20px 16px; display: none; }
.template-section-body.open { display: block; }
.template-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.template-item:last-child { border: none; }
.template-item .item-name { flex: 1; }
.template-item .btn-icon-sm { width: 28px; height: 28px; border: none; background: none; color: var(--gray-400); cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.template-item .btn-icon-sm:hover { background: var(--red-light); color: var(--red); }
.template-add { display: flex; gap: 8px; margin-top: 8px; }
.template-add input { flex: 1; padding: 6px 10px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 0.85rem; font-family: inherit; }
.template-add input:focus { border-color: var(--green); outline: none; }

/* ===== AGREEMENTS ===== */
.agreement-item { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background var(--transition); }
.agreement-item:hover { background: var(--gray-50); }
.agreement-item:last-child { border: none; }
.agreement-item .agr-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.agreement-item .agr-icon.signed { background: var(--green-light); color: var(--green-dark); }
.agreement-item .agr-icon.pending { background: var(--yellow-light); color: #B45309; }
.agreement-item .agr-info { flex: 1; min-width: 0; }
.agreement-item .agr-client { font-weight: 600; color: var(--navy); }
.agreement-item .agr-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }

/* ===== INSPECTOR NOTES IN REVIEW ===== */
.inspector-note-box { margin-top: 12px; }
.inspector-note-box textarea { width: 100%; padding: 10px 14px; border: 2px solid var(--blue-light); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: inherit; resize: vertical; min-height: 60px; background: var(--blue-light); color: var(--gray-800); transition: border-color var(--transition); }
.inspector-note-box textarea:focus { border-color: var(--blue); outline: none; background: var(--white); }
.inspector-note-box label { font-size: 0.8rem; font-weight: 600; color: var(--blue); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* ===== EDIT PHOTO GRID (Step 4) ===== */
.edit-photo-grid { display: flex; flex-direction: column; gap: 16px; }
.edit-photo-card {
  display: flex; gap: 16px; position: relative;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 16px;
  transition: all var(--transition);
}
.edit-photo-card:hover { box-shadow: var(--shadow); }
.edit-photo-delete {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--red); color: #fff; border: none;
  cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.7; transition: opacity var(--transition);
  z-index: 2;
}
.edit-photo-delete:hover { opacity: 1; }
.edit-photo-img {
  width: 120px; height: 120px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--gray-100);
}
.edit-photo-img img { width: 100%; height: 100%; object-fit: cover; }
.edit-photo-info { flex: 1; min-width: 0; }
.edit-photo-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.edit-photo-title { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.edit-photo-status { font-size: 0.75rem; }
.edit-photo-status.done { color: var(--green-dark); }
.edit-photo-status.pending { color: var(--gray-400); }
.edit-photo-status.failed { color: var(--red); }
.edit-photo-desc { }
.edit-desc-text { font-size: 0.85rem; color: var(--gray-600); line-height: 1.5; margin-bottom: 8px; }
.edit-desc-btn { margin-top: 4px; }
.edit-textarea { font-size: 0.85rem; }

@media (max-width: 768px) {
  .edit-photo-card { flex-direction: column; }
  .edit-photo-img { width: 100%; height: 160px; }
}

/* ===== PRINT ===== */
@media print {
  .sidebar, .mobile-header, .page-header, .wizard-steps, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; padding-top: 0 !important; }
  .page-body { padding: 0 !important; }
  body { background: #fff; }
}

/* ===== VOICE NOTE MODAL ===== */
.voice-recording { text-align: center; padding: 20px; }
.voice-recording .rec-indicator {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem; color: #fff;
  animation: pulse 1s infinite;
}
.voice-recording .rec-timer { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }

/* ===== GHL DELIVERY ===== */
.delivery-form { margin-top: 16px; }
.delivery-result { margin-top: 16px; padding: 16px; border-radius: var(--radius-sm); }
.delivery-result.success { background: var(--green-light); color: var(--green-dark); }
.delivery-result.error { background: var(--red-light); color: var(--red); }

/* Link share */
.share-link-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 8px 12px; margin-top: 12px;
}
.share-link-box input {
  flex: 1; border: none; background: none;
  font-size: 0.85rem; font-family: monospace;
  color: var(--navy); outline: none;
}
.share-link-box button { flex-shrink: 0; }

/* ===== HELP PAGE ===== */
.help-callout {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 32px;
}
.help-callout-icon { font-size: 2.5rem; flex-shrink: 0; line-height: 1; }
.help-callout h3 { color: var(--green-dark); font-size: 1.15rem; margin-bottom: 4px; }
.help-callout p { color: var(--gray-700); font-size: 0.95rem; line-height: 1.6; }

.help-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 36px; }
.help-step {
  display: flex; align-items: flex-start; gap: 20px; padding: 20px 0;
  border-bottom: 1px solid var(--gray-200);
}
.help-step:last-child { border-bottom: none; }
.help-step-num {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--navy); color: var(--green);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
}
.help-step-content h3 { color: var(--navy); font-size: 1.05rem; margin-bottom: 4px; }
.help-step-content p { color: var(--gray-600); font-size: 0.9rem; }

.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.help-info-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px; text-align: center;
}
.help-info-icon {
  width: 48px; height: 48px; margin: 0 auto 12px;
  background: var(--navy); color: var(--green);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.help-info-card h4 { color: var(--navy); font-size: 0.95rem; margin-bottom: 10px; }
.help-info-card ul { list-style: none; text-align: left; }
.help-info-card ul li {
  padding: 4px 0; font-size: 0.85rem; color: var(--gray-600);
  position: relative; padding-left: 18px;
}
.help-info-card ul li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700;
}

/* ===== SHARE MODAL ===== */
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay.active .modal { transform: translateY(0); }

#shareModal .form-group {
  margin-bottom: 16px;
}

#shareModal .form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

#qrCodeContainer canvas {
  border-radius: var(--radius-sm);
}

.spinner-dark {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--navy);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* ===== AI CHAT ASSISTANT WIDGET ===== */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: 'Inter', sans-serif;
}

.chat-button {
  width: 60px;
  height: 60px;
  background: var(--green);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  position: relative;
  animation: chatButtonEnter 0.6s ease-out;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

.chat-button.active {
  background: var(--navy);
  transform: scale(0.9);
}

.ai-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--navy);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 10px;
  border: 2px solid white;
  animation: badgePulse 2s infinite;
}

.pulse-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid var(--green);
  border-radius: 50%;
  animation: chatPulse 2s infinite;
  opacity: 0;
}

.chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.chat-header {
  background: var(--navy);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chat-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-clear-btn, .chat-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.chat-clear-btn:hover, .chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  animation: messageSlide 0.3s ease-out;
}

.user-bubble {
  background: var(--green);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.assistant-bubble {
  background: var(--gray-100);
  color: var(--navy);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.chat-welcome .assistant-bubble {
  max-width: 100%;
  background: var(--blue-light);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.chat-bubble ul {
  margin: 8px 0;
  padding-left: 16px;
}

.chat-bubble li {
  margin: 4px 0;
}

.chat-bubble p {
  margin: 0 0 8px 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-suggestions {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
  transform: translateY(-1px);
}

.chat-input-container {
  border-top: 1px solid var(--gray-200);
  padding: 16px;
  background: white;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--gray-500);
  font-size: 0.8rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  background: var(--gray-400);
  border-radius: 50%;
  animation: typingDots 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

#chatInput {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

#chatInput:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

#chatSendBtn {
  width: 40px;
  height: 40px;
  background: var(--green);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

#chatSendBtn:hover:not(:disabled) {
  background: var(--green-dark);
  transform: scale(1.1);
}

#chatSendBtn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    transform: translateY(100%);
  }
  
  .chat-panel.active {
    transform: translateY(0);
  }
  
  .chat-header {
    border-radius: 0;
    padding: 20px 16px;
  }
  
  .suggestion-chips {
    justify-content: center;
  }
  
  .suggestion-chip {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

/* Animations */
@keyframes chatButtonEnter {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes chatPulse {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

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

@keyframes messageSlide {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingDots {
  0%, 20% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
  80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
}

/* ===== AGREEMENT FUNCTIONALITY ===== */

/* Agreement Section in Wizard */
.agreement-section {
  background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 24px 0;
}

.agreement-status .badge-pending {
  background: #F59E0B;
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
}

.agreement-status .badge-signed {
  background: #22C55E;
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
}

.form-input-sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.btn-success {
  background: linear-gradient(135deg, #22C55E, #16a34a);
  color: #fff;
}

.btn-navy {
  background: linear-gradient(135deg, #0A1628, #1B2D4F);
  color: #fff;
}

.btn-green {
  background: linear-gradient(135deg, #22C55E, #16a34a);
  color: #fff;
}

/* Enhanced Inspection List */
.inspection-item.enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.inspection-item.enhanced:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.insp-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.insp-info {
  flex: 1;
}

.insp-address {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.insp-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--gray-600);
  font-size: 0.85rem;
}

.insp-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.insp-stats {
  display: flex;
  gap: 16px;
  color: var(--gray-500);
  font-size: 0.8rem;
}

.insp-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.insp-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.agreement-status,
.inspection-status {
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-gray {
  background: var(--gray-400);
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Agreement Results */
.agreement-result {
  margin-top: 16px;
}

.agreement-result .success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
}

.agreement-result .error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
}

.agreement-result .info {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #3730A3;
}

.agreement-result div {
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Agreement Signing Page Enhancements */
.signature-pad-container {
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  text-align: center;
}

.signature-pad {
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  cursor: crosshair;
  background: #FAFBFC;
  touch-action: none;
}

.signature-controls {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .agreement-section {
    padding: 16px;
  }
  
  .inspection-item.enhanced {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .insp-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .insp-badges {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .insp-meta,
  .insp-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .signature-controls {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* Professional Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green {
  background: #22C55E;
  color: #fff;
}

.badge-yellow {
  background: #F59E0B;
  color: #fff;
}

.badge-blue {
  background: #3B82F6;
  color: #fff;
}

.badge-red {
  background: #EF4444;
  color: #fff;
}

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

.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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