/* =========================================================
   ระบบบันทึกข้อมูล RSA — Modern Glassmorphism (Tailwind-based)
   โทนสีส้มอบอุ่น พื้นหลัง gradient + การ์ดกระจกโปร่งแสง
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --orange-primary: #F97316;
  --orange-light: #FB923C;
  --orange-dark: #EA580C;
}

* { font-family: 'Sarabun', sans-serif; }

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #FDF0E8 0%, #FFE8D6 40%, #FFD9B8 100%);
  background-attachment: fixed;
}

/* ---------- การ์ดกระจก (glass card) ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(234, 88, 12, 0.10);
}

.glass-card-solid {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(234, 88, 12, 0.12);
}

/* ---------- แถบเมนู tab แบบ pill ---------- */
.tab-pill {
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  color: #6B7280;
  transition: all .2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}
.tab-pill:hover:not(.active) { background: rgba(249,115,22,0.10); color: var(--orange-dark); }
.tab-pill.active {
  background: linear-gradient(135deg, var(--orange-light), var(--orange-primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.4);
}

/* ---------- ปุ่มหลัก ---------- */
.btn-glass-primary {
  background: linear-gradient(135deg, var(--orange-light), var(--orange-primary));
  color: #fff; font-weight: 600; border: none; border-radius: 14px;
  padding: 10px 22px; box-shadow: 0 4px 14px rgba(249,115,22,0.35);
  transition: all .2s ease; cursor: pointer;
}
.btn-glass-primary:hover { box-shadow: 0 6px 18px rgba(249,115,22,0.5); transform: translateY(-1px); }
.btn-glass-primary:disabled { opacity:.6; cursor:not-allowed; transform:none; }

.btn-glass-secondary {
  background: rgba(255,255,255,0.6); color: #374151; font-weight: 600;
  border: 1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 10px 22px;
  cursor: pointer; transition: all .2s ease;
}
.btn-glass-secondary:hover { background: rgba(255,255,255,0.85); }

.btn-glass-info { background: linear-gradient(135deg,#38bdf8,#0ea5e9); color:#fff; }
.btn-glass-danger-outline {
  border: 1px solid #fca5a5; color:#dc2626; background: rgba(255,255,255,0.5);
  border-radius: 10px; padding: 4px 10px; font-size: .78rem; font-weight:600; cursor:pointer;
}
.btn-glass-danger-outline:hover { background:#fee2e2; }
.btn-glass-info-outline {
  border: 1px solid #93c5fd; color:#1d4ed8; background: rgba(255,255,255,0.5);
  border-radius: 10px; padding: 4px 10px; font-size: .78rem; font-weight:600; cursor:pointer;
}
.btn-glass-info-outline:hover { background:#dbeafe; }

/* ---------- input กระจก ---------- */
.glass-input, .glass-select, .glass-textarea {
  width: 100%; background: rgba(255,255,255,0.65); border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px; padding: 9px 14px; font-size: .9rem; color:#1F2937;
  transition: all .15s ease;
}
.glass-input:focus, .glass-select:focus, .glass-textarea:focus {
  outline: none; border-color: var(--orange-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15); background: rgba(255,255,255,0.9);
}
.field-label { font-size: .8rem; font-weight: 600; color: #78350F; margin-bottom: 4px; display:block; }

/* ---------- KPI stat tile ---------- */
.kpi-tile {
  border-radius: 18px; padding: 18px; color: #fff; text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12); height: 100%;
  display:flex; flex-direction:column; justify-content:center;
}
.kpi-tile h3 { font-size: 2.2rem; font-weight: 700; margin: 4px 0 0; }
.kpi-tile span { font-size: .82rem; opacity:.92; font-weight:500; }

.kpi-total { background: linear-gradient(135deg,#94a3b8,#64748b); }
.kpi-need  { background: linear-gradient(135deg,#f87171,#dc2626); }
.kpi-sent  { background: linear-gradient(135deg,#fbbf24,#d97706); }
.kpi-follow{ background: linear-gradient(135deg,#60a5fa,#2563eb); }
.kpi-done  { background: linear-gradient(135deg,#4ade80,#16a34a); }

/* ---------- badge สถานะ ---------- */
.badge-glass { padding: 3px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; display:inline-block; }
.badge-none   { background:#E5E7EB; color:#4B5563; }
.badge-need   { background:#FEE2E2; color:#B91C1C; }
.badge-sent   { background:#FEF3C7; color:#B45309; }
.badge-day1   { background:#CFFAFE; color:#0E7490; }
.badge-follow { background:#DBEAFE; color:#1D4ED8; }
.badge-doneok { background:#D1FAE5; color:#047857; }
.badge-source { background: rgba(255,255,255,0.7); color:#374151; border:1px solid rgba(0,0,0,0.08); }

/* ---------- ตาราง ---------- */
.glass-table-wrap { border-radius: 16px; overflow: hidden; border: 1px solid rgba(0,0,0,0.06); }
table.glass-table { width:100%; border-collapse: collapse; background: rgba(255,255,255,0.5); }
table.glass-table thead th {
  background: rgba(249,115,22,0.12); color:#78350F; font-size:.8rem; font-weight:700;
  padding: 10px 12px; text-align:center; position: sticky; top:0; cursor: default;
}
table.glass-table thead th.sortable { cursor: pointer; }
table.glass-table thead th.sortable:hover { background: rgba(249,115,22,0.22); }
table.glass-table tbody td { padding: 10px 12px; font-size:.85rem; border-top: 1px solid rgba(0,0,0,0.05); }
table.glass-table tbody tr:hover { background: rgba(249,115,22,0.06); }
.sort-icon { font-size:.7em; margin-left:4px; color:#B45309; }

/* ---------- section title ในฟอร์ม ---------- */
.form-section-title {
  font-weight: 700; color: var(--orange-dark); margin: 22px 0 12px;
  border-bottom: 2px solid rgba(249,115,22,0.25); padding-bottom: 6px; font-size: 1rem;
}

/* ---------- highlight box (แหล่งที่มา) ---------- */
.highlight-box {
  background: rgba(255,251,235,0.7); border: 1px solid rgba(251,191,36,0.4);
  border-radius: 14px; padding: 16px; margin-bottom: 18px;
}

/* scrollbar เล็กน้อยให้สวยขึ้น */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(249,115,22,0.35); border-radius: 8px; }

.chart-box { position: relative; height: 280px; width: 100%; }
.chart-box-tall { position: relative; height: 340px; width: 100%; }
