/* ============================================================
   Theme: Clean Neutral (ตาม Style Guide 10 ก.ค. 2569)
   หลักการ: พื้นหลังสีกลาง สีอยู่ที่ badge/ปุ่มเท่านั้น
   ตัวอักษรเข้มบนพื้นอ่อน Contrast ≥ 4.5:1 (WCAG AA)
   ตอนนี้เปิดใช้เฉพาะหน้า "รายการเคส" เพื่อพรีวิว
   ============================================================ */

:root, [data-theme="dark"] {
  --bg-grad: #F8FAFC;
  --glass: #FFFFFF;
  --glass-strong: #F8FAFC;
  --glass-border: #E2E8F0;
  --ink: #0F172A;
  --ink-head: #0F172A;
  --ink-soft: #475569;
  --accent: #9D174D;          /* สีแบรนด์ ใช้เฉพาะปุ่มหลัก/ลิงก์/โลโก้ */
  --accent-deep: #831843;
  --on-accent: #FFFFFF;
  --line: #E2E8F0;
  --danger: #B91C1C;
  --danger-bg: #FEE2E2;
  --warn: #A16207;
  --warn-bg: #FEF9C3;
  --ok: #15803D;
  --ok-bg: #DCFCE7;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --radius: 12px;
}

body {
  background: var(--bg-grad);
  font-family: 'Noto Sans Thai', 'Prompt', 'Segoe UI', system-ui, sans-serif;
}

/* การ์ด: ขาว ขอบบาง เงาเบา ไม่มีเอฟเฟกต์แก้ว */
.glass { backdrop-filter: none; border: 1px solid var(--glass-border); }
.glass h2 { color: var(--accent); }

/* Sidebar / Bottom nav: พื้นขาว */
.sidebar, .bottom-nav { backdrop-filter: none; background: #FFFFFF; }
.nav-item.active { background: var(--accent); color: #FFFFFF; }
.brand-icon { background: var(--accent); color: #FFFFFF; }

/* ปุ่ม */
.btn { background: var(--accent); color: #FFFFFF; }
.btn.secondary { background: #FFFFFF; color: var(--ink); border: 1px solid var(--glass-border); }
.icon-btn, .user-chip { background: #FFFFFF; }

/* ฟอร์ม */
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], input[type=file], select, textarea {
  background: #FFFFFF;
}

/* ---------- Badge สถานะ (Status tokens) ---------- */
.badge { font-weight: 700; }
.st-open     { background: #E2E8F0; color: #334155; border: none; }  /* รอคัดกรอง */
.st-assigned { background: #DBEAFE; color: #1D4ED8; }                /* มอบหมายแล้ว */
.st-progress { background: #DBEAFE; color: #1D4ED8; }                /* กำลังแก้ไข */
.st-resolved { background: #DCFCE7; color: #15803D; }                /* แก้ไขเสร็จ (รอปิด) */
.st-closed   { background: #F1F5F9; color: #334155; }                /* ปิดเคสแล้ว */

/* ---------- Badge ระดับความรุนแรง (Severity tokens) ---------- */
.tp-crisis    { background: #FEE2E2; color: #991B1B; }
.tp-emergency { background: #FFE4E6; color: #BE123C; }
.tp-major     { background: #FFEDD5; color: #C2410C; }
.tp-minor     { background: #FEF9C3; color: #A16207; }
.tp-event     { background: #F1F5F9; color: #334155; border: none; }

/* ---------- ตาราง ---------- */
.tbl th { background: #F8FAFC; color: var(--ink-soft); }
.tbl td { border-bottom: 1px solid var(--glass-border); }
.tbl tr.row-pending td { background: rgba(254, 249, 195, 0.45); } /* รอคัดกรอง: เหลืองจาง */
.tbl tr.row-danger td { background: #FEE2E2; }
.tbl tr.row-warn td { background: #FEF9C3; }

/* ไอคอนเกินกำหนด */
.rto-big { color: #B91C1C; }

/* metric cards */
.metric .num { color: var(--accent); }
