/* KruPlan Global & Responsive Stylesheet */
body {
  font-family: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Prompt', 'Inter', sans-serif;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* ซ่อน Scrollbar สำหรับแถบเมนูแนวนอนบนมือถือ */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* แอนิเมชันสำหรับ Modal และ Toast */
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}
.animate-pop-in {
  animation: popIn 0.15s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ปรับปรุงการสัมผัสและการแตะบนอุปกรณ์มือถือ (Mobile Touch & Responsiveness) */
button, select, input, textarea, a {
  touch-action: manipulation;
}

/* เพิ่ม Horizontal Scroll Indicator / Smooth Scroll บนจอมือถือ */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* รองรับ Safe Area สำหรับ iPhone และมือถือรุ่นใหม่ (Home indicator bar) */
.safe-area-pb {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ปรับระยะขอบและตัวอักษรเมื่อเปิดบนหน้าจอขนาดเล็กกว่า 640px */
@media (max-width: 640px) {
  table th, table td {
    padding: 0.35rem 0.25rem !important;
  }
  #printable-report {
    padding: 10px;
  }
}

/* Print Styles สำหรับพิมพ์รายงานทางการ */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-report, #printable-report * {
    visibility: visible;
  }
  #printable-report {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: white;
  }
  .no-print {
    display: none !important;
  }
}
