/* ==========================================================================
 * SweetAlert2 theme — ให้เข้าชุดกับ modal ของระบบ FleetLink
 * (มุมมน 16px, ปุ่มทรงแคปซูล, ฟอนต์ Sarabun, เงานุ่ม)
 * หมายเหตุ: ไม่บังคับสีปุ่ม confirm — ปล่อยให้ confirmButtonColor ของแต่ละจุดทำงาน
 *           (เช่น ลบ=แดง, สำเร็จ=เขียว) แค่จัดทรง/เงา/โฟกัสให้สวยขึ้น
 * ========================================================================== */
.swal2-popup {
  border-radius: 16px !important;
  font-family: 'Kanit', 'Segoe UI', Tahoma, sans-serif !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28) !important;
  padding: 24px !important;
}
.swal2-title { font-size: 1.15rem !important; font-weight: 700 !important; color: #2b2a26 !important; padding-top: 4px !important; }
.swal2-html-container { font-size: 0.92rem !important; color: #475569 !important; }
.swal2-actions { gap: 10px !important; margin-top: 16px !important; }

.swal2-styled {
  border-radius: 999px !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  box-shadow: none !important;
  transition: filter .15s ease, background .15s ease, box-shadow .15s ease !important;
}
.swal2-styled.swal2-confirm { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important; }
.swal2-styled.swal2-confirm:hover { filter: brightness(0.93) !important; }
.swal2-styled.swal2-cancel {
  background: #fff !important;
  color: #7a7568 !important;
  border: 1px solid #ddd8cb !important;
}
.swal2-styled.swal2-cancel:hover { background: #f1f5f9 !important; color: #2b2a26 !important; }
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25) !important; }
.swal2-icon { margin-top: 8px !important; }

/* ชั้นบนสุดเสมอ (UI-CONVENTIONS §13) — ค่าเดิมของไลบรารีคือ 1060 ต่ำกว่า dropdown แบบ fixed (10010)
 * และ modal ที่ยกชั้น → popup ยืนยัน/แจ้ง error ถูกบัง ตั้งที่นี่ที่เดียวให้ทุกหน้าที่โหลดธีมนี้ */
.swal2-container { z-index: 100000 !important; }

/* Toast (rtToast) */
.swal2-toast { border-radius: 12px !important; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16) !important; font-family: 'Kanit', 'Segoe UI', sans-serif !important; }
.swal2-toast .swal2-title { font-size: 0.92rem !important; font-weight: 600 !important; }

/* --------------------------------------------------------------------------
 * animation เปิด popup ให้เป็นตัวเดียวกับ modal ของระบบ (mdUp .3s ease)
 * เรียกใช้ด้วย showClass: { popup: 'swal-mdUp' } — คลาสนี้ไปแทน swal2-show ของ
 * SweetAlert ที่ผ่านมามีหลายหน้าเรียกใช้อยู่แล้วแต่ไม่เคยนิยามคลาสนี้ไว้ที่ไหน
 * ผลคือ popup เด้งขึ้นมาเฉย ๆ ไม่มี animation เลย
 * animate เฉพาะ transform + opacity (ห้ามแตะ height/top — layout thrash บนมือถือ)
 * -------------------------------------------------------------------------- */
@keyframes swalMdUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.swal2-popup.swal-mdUp { animation: swalMdUp .3s ease; }
@media (prefers-reduced-motion: reduce) {
  .swal2-popup.swal-mdUp { animation: none; }
}
