/* ===== SMH Equipment Inspections — Design System =====
   Matching Google Stitch prototype typography and styling
   ====================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Roboto+Condensed:wght@700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* Brand Colors */
  --smh-red: #C41E24;
  --smh-red-dark: #A01A1F;
  --smh-red-light: rgba(196, 30, 36, 0.1);

  /* Status Colors */
  --blue-compliance: #2196F3;
  --blue-light: rgba(33, 150, 243, 0.1);
  --green-pass: #4CAF50;
  --green-light: rgba(76, 175, 80, 0.1);
  --orange-warning: #FF9800;
  --orange-light: rgba(255, 152, 0, 0.1);
  --red-high: #F44336;
  --red-light: rgba(244, 67, 54, 0.1);

  /* Neutrals */
  --bg-page: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-input: #ECECEC;
  --bg-checklist: #F0F0F2;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-light: #E0E0E0;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-card-hover: 0 6px 24px rgba(0,0,0,0.15);

  /* Typography - matching Stitch */
  --font-heading: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --page-padding: 20px;
  --card-radius: 12px;
  --input-radius: 8px;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- App Shell ---- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-card);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.app-content {
  flex: 1;
  padding-bottom: 80px; /* space for bottom nav */
  overflow-y: auto;
}

/* ---- Header / Branding ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--page-padding);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: var(--smh-red);
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  color: var(--smh-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-text-lg {
  font-size: 1.1rem;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
}

/* ---- Section Labels (FIELD OPERATIONS style) ---- */
.section-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--smh-red);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

/* ---- Page Titles (SELECT INSPECTION TYPE style) ---- */
.page-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2rem;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.page-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--smh-red);
  margin-top: 12px;
  border-radius: 2px;
}

/* ---- Form Page Title (Equipment Inspection style - not uppercase) ---- */
.form-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2rem;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.form-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---- Compliance Badge ---- */
.compliance-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.compliance-badge.active {
  background: var(--blue-compliance);
  color: white;
}

.compliance-badge.inactive {
  background: var(--bg-input);
  color: var(--text-muted);
}

/* ---- Inspection Type Cards ---- */
.type-cards {
  padding: 0 var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.type-card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 10;
}

.type-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.type-card:active {
  transform: scale(0.98);
}

.type-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(60%);
}

.type-card.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.type-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.type-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.type-card-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.type-card-icon.equipment { background: var(--smh-red); }
.type-card-icon.vehicle { background: var(--blue-compliance); }
.type-card-icon.crane { background: var(--text-primary); }

.type-card-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.3rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}

.coming-soon-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: 20px;
}

/* ---- Form Sections ---- */
.form-section {
  padding: 0 var(--page-padding);
  margin-bottom: 24px;
}

.field-group {
  background: var(--bg-page);
  border-radius: var(--card-radius);
  padding: 16px;
  margin-bottom: 16px;
}

.field-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.field-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border-radius: var(--input-radius);
  padding: 12px 14px;
}

.field-input-wrap .field-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.field-input-wrap input {
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  outline: none;
}

.field-input-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- System Checklist ---- */
.checklist-section {
  background: var(--bg-checklist);
  border-radius: var(--card-radius);
  padding: 20px;
  margin: 0 var(--page-padding) 24px;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.checklist-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.checklist-count {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-compliance);
  text-align: right;
  line-height: 1.3;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--input-radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.checklist-item:hover {
  border-color: var(--border-light);
}

.checklist-item.checked {
  border-color: var(--green-pass);
  background: var(--green-light);
}

.checklist-item.failed {
  border-color: var(--red-high);
  background: var(--red-light);
}

.checklist-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--blue-light);
  color: var(--blue-compliance);
  flex-shrink: 0;
}

.checklist-item.checked .checklist-item-icon {
  background: var(--green-light);
  color: var(--green-pass);
}

.checklist-item.failed .checklist-item-icon {
  background: var(--red-light);
  color: var(--red-high);
}

.checklist-item-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  flex: 1;
}

.checklist-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.checklist-buttons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.cl-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border-light);
  background: transparent;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-muted);
}

.cl-btn:active {
  transform: scale(0.95);
}

.cl-btn.cl-pass.active {
  background: var(--green-pass);
  border-color: var(--green-pass);
  color: white;
}

.cl-btn.cl-fail.active {
  background: var(--red-high);
  border-color: var(--red-high);
  color: white;
}

.cl-btn.cl-na.active {
  background: #9E9E9E;
  border-color: #9E9E9E;
  color: white;
}

.checklist-item.na {
  border-color: #9E9E9E;
  background: rgba(158,158,158,0.08);
}

.checklist-item.na .checklist-item-icon {
  background: rgba(158,158,158,0.12);
  color: #9E9E9E;
}

/* ---- Defect Reporting ---- */
.defect-section {
  background: var(--bg-checklist);
  border-radius: var(--card-radius);
  padding: 20px;
  margin: 0 var(--page-padding) 24px;
}

.defect-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.defect-header-icon {
  font-size: 1.2rem;
  color: var(--orange-warning);
}

.defect-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.severity-options {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.severity-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--input-radius);
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.severity-btn:hover {
  border-color: var(--text-muted);
}

.severity-btn.active.low {
  border-color: var(--green-pass);
  color: var(--green-pass);
  background: var(--green-light);
}

.severity-btn.active.medium {
  border-color: var(--blue-compliance);
  color: var(--blue-compliance);
  background: var(--blue-light);
}

.severity-btn.active.high {
  border-color: var(--red-high);
  color: var(--red-high);
  background: var(--red-light);
}

.description-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.defect-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border: none;
  border-radius: var(--input-radius);
  background: var(--bg-input);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  margin-bottom: 20px;
}

.defect-textarea::placeholder {
  color: var(--text-muted);
}

.photo-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.photo-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-add-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--input-radius);
  border: 2px dashed var(--border-light);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  gap: 4px;
}

.photo-add-btn:hover {
  border-color: var(--smh-red);
  color: var(--smh-red);
}

.photo-add-btn .camera-icon {
  font-size: 1.5rem;
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--input-radius);
  overflow: hidden;
  position: relative;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview .remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red-high);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Submit Button ---- */
.submit-section {
  padding: 0 var(--page-padding) 24px;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--card-radius);
  background: var(--smh-red);
  color: white;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 16px rgba(196, 30, 36, 0.3);
}

.submit-btn:hover {
  background: var(--smh-red-dark);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-btn .arrow {
  font-size: 1.2rem;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  z-index: 200;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text-secondary);
}

.nav-item.active {
  color: var(--smh-red);
}

.nav-item.active .nav-icon-wrap {
  background: var(--smh-red);
  color: white;
  border-radius: 12px;
  padding: 6px 20px;
}

.nav-icon-wrap {
  font-size: 1.3rem;
  padding: 6px 20px;
  transition: all 0.2s ease;
}

.nav-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ---- Success State ---- */
.success-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: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.success-overlay.show {
  opacity: 1;
  visibility: visible;
}

.success-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.success-overlay.show .success-card {
  transform: scale(1);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-pass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}

.success-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.success-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.success-btn {
  padding: 12px 32px;
  border: none;
  border-radius: var(--input-radius);
  background: var(--smh-red);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

/* ---- History Page ---- */
.stats-row {
  display: flex;
  gap: 12px;
  padding: 0 var(--page-padding);
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2rem;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-trend {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
}

.stat-trend.up { color: var(--green-pass); }
.stat-trend.down { color: var(--red-high); }
.stat-trend.action { color: var(--red-high); font-weight: 700; text-transform: uppercase; font-size: 0.65rem; letter-spacing: 1px; }

.search-bar {
  margin: 0 var(--page-padding) 16px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: none;
  border-radius: var(--input-radius);
  background: var(--bg-input);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
}

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

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.history-list {
  padding: 0 var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-radius: var(--input-radius);
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.history-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-status-dot.passed { background: var(--blue-compliance); }
.history-status-dot.flagged { background: var(--red-high); }
.history-status-dot.submitted { background: var(--orange-warning); }

.history-info {
  flex: 1;
}

.history-equip-id {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-badge {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
}

.history-badge.passed { background: var(--blue-light); color: var(--blue-compliance); }
.history-badge.flagged { background: var(--red-light); color: var(--red-high); }
.history-badge.submitted { background: var(--orange-light); color: var(--orange-warning); }

/* ---- Loading Spinner ---- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--smh-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* ---- Toast Notifications ---- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text-primary);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--input-radius);
  z-index: 600;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--red-high);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px var(--page-padding);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---- Responsive ---- */
@media (min-width: 481px) {
  body {
    background: var(--bg-page);
  }

  .app-shell {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
    border-radius: 0;
  }
}

/* ---- Hidden file input ---- */
.hidden-input {
  display: none;
}

/* ---- Autocomplete Dropdowns ---- */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-wrap .field-input-wrap {
  transition: border-color 0.2s ease;
  border: 2px solid transparent;
}

.autocomplete-wrap.active .field-input-wrap {
  border-color: var(--smh-red);
  background: var(--bg-card);
}

.autocomplete-wrap.selected .field-input-wrap {
  border-color: var(--green-pass);
  background: var(--green-light);
}

.autocomplete-wrap.selected .field-input-wrap input {
  font-weight: 700;
  color: var(--text-primary);
}

.ac-clear {
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 1.1rem !important;
}

.ac-clear:hover {
  color: var(--smh-red) !important;
}

.ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--input-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 300;
  border: 1px solid var(--border-light);
}

.ac-dropdown.hidden {
  display: none;
}

.ac-item {
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--bg-page);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.ac-item:hover,
.ac-item.highlighted {
  background: var(--smh-red-light);
}

.ac-item-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.ac-item-detail {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ac-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}
