/* กล่องยืนยันของระบบ (ใช้แทน confirm ของเบราว์เซอร์)
   เขียนเป็น CSS ธรรมดา ไม่ต้อง build Tailwind ใหม่ — ใช้สีจากตัวแปรของธีมใน tailwind.css */

.ui-modal[hidden] { display: none; }

.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .45);
  animation: ui-fade .14s ease-out;
}

.ui-modal-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  padding: 22px 22px 18px;
  animation: ui-pop .18s cubic-bezier(.2, .9, .3, 1.2);
}

.ui-modal-head { display: flex; gap: 12px; align-items: flex-start; }

.ui-modal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--color-brand-soft, #eaf0fd);
  color: var(--color-brand, #2b59c3);
}

.ui-modal.danger .ui-modal-icon { background: var(--color-err-soft, #fdecea); color: var(--color-err, #c0322b); }

.ui-modal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-ink, #1b2333);
  margin: 2px 0 4px;
}

.ui-modal p {
  color: var(--color-muted, #5f6b7f);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0;
}

.ui-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.ui-modal-actions .btn { min-width: 96px; justify-content: center; }

@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ui-modal, .ui-modal-box { animation: none; }
}

@media (max-width: 480px) {
  .ui-modal-actions { flex-direction: column-reverse; }
  .ui-modal-actions .btn { width: 100%; }
}
