/* การตั้งค่าระบบ K-Minimal Design */

:root {
  --bg-color: #F4F7F6;       /* Off-white เทาอมฟ้าสว่างๆ */
  --surface-color: #FFFFFF;
  --primary-color: #60A5FA;  /* ฟ้าละมุน */
  --text-main: #334155;
  --text-muted: #94A3B8;
  --border-radius: 16px;
  --soft-shadow: 0 10px 25px rgba(100, 116, 139, 0.08), 0 4px 10px rgba(100, 116, 139, 0.04);
  --hover-shadow: 0 20px 40px rgba(100, 116, 139, 0.12);
}

body {
  font-family: 'Kanit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* K-Minimal Card Style */
.k-card {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

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

/* Inputs */
.k-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  font-size: 16px;
  transition: all 0.3s ease;
  color: var(--text-main);
  outline: none;
  font-family: 'Kanit', sans-serif;
}

.k-input:focus {
  border-color: var(--primary-color);
  background: #FFF;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

/* Buttons */
.k-btn {
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: 'Kanit', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.k-btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.k-btn-primary:hover {
  background-color: #3B82F6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(96, 165, 250, 0.4);
}

.k-btn-danger {
  background-color: #EF4444;
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.k-btn-danger:hover {
  background-color: #DC2626;
  transform: translateY(-2px);
}

.k-btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.k-btn-outline:hover {
  background-color: rgba(96, 165, 250, 0.1);
}

/* Glassmorphism Header */
.k-glass-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #1E293B;
}

/* Status Badges */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.badge-active { background: #DCFCE7; color: #166534; }
.badge-idle { background: #F1F5F9; color: #475569; }

/* Loading Overlay */
#globalLoader {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* CSS Spinner 3D Pixar Vibe (Soft & Bouncy) */
.k-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 5px solid #E0F2FE;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite, bounce 2s ease-in-out infinite;
}

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

@keyframes bounce {
  0%, 100% { filter: drop-shadow(0 10px 10px rgba(96, 165, 250, 0.2)); }
  50% { filter: drop-shadow(0 20px 20px rgba(96, 165, 250, 0.4)); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
