/* ♿ Accessibility Standard: ขั้นต่ำ 16px สำหรับ Body */
body, html {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px; 
  background-color: #f4f6f9;
  margin: 0;
  padding-bottom: 70px; /* เผื่อที่ให้ Bottom Nav */
  padding-top: 55px; /* เผื่อที่ให้ Top Nav */
  overscroll-behavior-y: contain;
}

/* SPA Page Management */
.page { 
  display: none;
}
.page.active { 
  display: block; 
  animation: fadeIn 0.3s;
}
@keyframes fadeIn { 
  from { opacity: 0; } 
  to { opacity: 1; } 
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0; height: 55px;
  background: #ffffff; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
  z-index: 2000;
}
.nav-title { 
  font-weight: 700; 
  font-size: 1.1rem; 
  color: #333;
}
.btn-back { 
  position: absolute; 
  left: 10px; 
  min-height: 44px; 
  min-width: 44px;
} /* Touch Target 44x44 */

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0; height: 65px;
  background: #ffffff; 
  display: flex; 
  justify-content: space-around; 
  align-items: center;
  box-shadow: 0 -2px 15px rgba(0,0,0,0.08); 
  z-index: 2000; 
  border-top-left-radius: 15px; 
  border-top-right-radius: 15px;
}
.nav-item {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  color: #888;
  text-decoration: none; 
  cursor: pointer; 
  min-width: 60px; 
  min-height: 44px; 
  padding: 5px;
}
.nav-item.active { 
  color: #0d6efd; 
  font-weight: bold;
}
.nav-item i { 
  font-size: 1.3rem; 
  margin-bottom: 2px; 
}
.nav-item span { 
  font-size: 0.75rem;
}

/* Cards & Layout */
.qc-card {
  background: #fff;
  border-radius: 12px; 
  padding: 15px; 
  margin-bottom: 15px;
  border-left: 5px solid #6c757d; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s;
}
.qc-card.border-danger { 
  border-left-color: #dc3545 !important; 
  box-shadow: 0 0 8px rgba(220,53,69,0.3);
} /* Smart Validation */

.fix-card {
  background: white;
  border-radius: 15px; 
  padding: 15px; 
  margin-bottom: 15px;
  border-left: 6px solid #dc3545; 
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.btn-touch { 
  min-height: 48px; 
  border-radius: 10px; 
  font-weight: bold;
} /* Touch target button */

.tab-nav {
  display: flex;
  overflow-x: auto; 
  padding: 10px 5px; 
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
  position: sticky; 
  top: 55px; 
  z-index: 1000;
}
.tab-btn {
  padding: 8px 15px; 
  border-radius: 20px; 
  border: 1px solid #ddd;
  background: #fff; 
  font-weight: bold; 
  margin-right: 8px; 
  font-size: 0.9rem; 
  white-space: nowrap; 
  min-height: 44px;
}
.tab-btn.active { 
  background: #000;
  color: #fff; 
  border-color: #000; 
}

.img-preview { 
  width: 100%; 
  height: 200px; 
  object-fit: contain;
  border-radius: 8px; 
  background: #eee; 
  margin-bottom: 10px; 
  display: none; 
}
.img-compare { 
  width: 100%; 
  height: 180px; 
  object-fit: contain;
  border-radius: 10px; 
  border: 1px solid #eee; 
  background: #fafafa; 
  margin-bottom: 5px; 
}

.note-admin { 
  background: #fff5f5;
  border: 1px solid #feb2b2; 
  color: #c53030; 
}
.note-staff { 
  background: #f0fff4; 
  border: 1px solid #9ae6b4; 
  color: #276749;
}

/* แถบเครื่องมือแบบลอยตัว (Sticky Action Bar) */
.sticky-action-bar {
  position: sticky;
  top: 55px; 
  z-index: 1050;
  background: #f4f6f9; 
  padding: 10px 0 15px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 15px;
}
