/*
 * Srinakhon Backoffice — สไตล์เพิ่มเติมที่ไม่ได้อยู่ใน tailwind.css
 * (กล่องแจ้งเตือนมุมขวาบน และข้อความเมื่อเปิดไฟล์โดยไม่ผ่านเว็บเซิร์ฟเวอร์)
 */

/* ───── การแจ้งเตือน (toast) ───── */

.toaster {
  position: fixed;
  z-index: 999999999;
  top: 76px;
  right: 24px;
  width: 356px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
  font-family: inherit;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid hsl(0, 0%, 93%);
  background: #fff;
  color: hsl(0, 0%, 9%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  overflow-wrap: anywhere;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-100%);
  transition:
    opacity 400ms ease,
    transform 400ms ease;
}

.toast.is-mounted {
  opacity: 1;
  transform: none;
}

.toast.is-removed {
  opacity: 0;
  transform: translateY(-40%);
  transition-duration: 200ms;
}

.toast-icon {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-start;
  width: 16px;
  height: 16px;
  margin-left: -3px;
  margin-right: 4px;
}

.toast-icon svg {
  flex-shrink: 0;
}

.toast-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-weight: 500;
  line-height: 1.5;
}

.toast-description {
  font-weight: 400;
  line-height: 1.4;
  color: #3f3f3f;
}

.toast-close {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid hsl(0, 0%, 93%);
  border-radius: 50%;
  background: #fff;
  color: hsl(0, 0%, 9%);
  transform: translate(-35%, -35%);
  cursor: pointer;
  transition:
    background 200ms,
    border-color 200ms;
}

.toast-close svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.5;
}

.toast-close:hover {
  background: hsl(0, 0%, 99%);
  border-color: hsl(0, 0%, 88%);
}

.toast[data-type='success'],
.toast[data-type='success'] .toast-close {
  background: hsl(143, 85%, 96%);
  border-color: hsl(145, 92%, 87%);
  color: hsl(140, 100%, 27%);
}

.toast[data-type='info'],
.toast[data-type='info'] .toast-close {
  background: hsl(208, 100%, 97%);
  border-color: hsl(221, 91%, 93%);
  color: hsl(210, 92%, 45%);
}

.toast[data-type='warning'],
.toast[data-type='warning'] .toast-close {
  background: hsl(49, 100%, 97%);
  border-color: hsl(49, 91%, 84%);
  color: hsl(31, 92%, 45%);
}

.toast[data-type='error'],
.toast[data-type='error'] .toast-close {
  background: hsl(359, 100%, 97%);
  border-color: hsl(359, 100%, 94%);
  color: hsl(360, 100%, 45%);
}

.toast:not([data-type='default']) .toast-description {
  color: inherit;
}

@media (max-width: 600px) {
  .toaster {
    top: 72px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* ───── เปิดไฟล์ HTML ตรง ๆ (ดับเบิลคลิก) แทนการเปิดผ่านเว็บเซิร์ฟเวอร์ ───── */

.file-notice {
  max-width: 28rem;
  text-align: center;
  text-wrap: balance;
}
