:root {
  --color-bg: #F2F3F5;
  --color-surface: #FFFFFF;
  --color-red: #D6362B;
  --color-red-dark: #B22A21;
  --color-blue: #1259C3;
  --color-blue-dark: #0E479A;
  --color-text: #1B1C1E;
  --color-text-muted: #6B7076;
  --color-border: #E7E8EB;
  --color-gold: #C9A227;
  --color-gold-light: #F1D77E;
  --color-gold-dark: #8B6B14;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 30px rgba(27, 28, 30, 0.08);
}

* { box-sizing: border-box; }

/* (2026-09-25) ปิดกรอบสี่เหลี่ยมสีฟ้าที่เบราว์เซอร์มือถือ (Chrome Android ค่าเริ่มต้น rgba(51,181,229,0.4))
   วาดทับทุกครั้งที่แตะปุ่ม/ลิงก์ — แทนด้วยเอฟเฟกต์ "ยุบตัวเล็กน้อย" ของเราเองตอนกด (ดู :active ด้านล่าง) */
* { -webkit-tap-highlight-color: transparent; }

button:not(.toggle-pin):not(:disabled), [role="button"], label.card, .m-quick-tile, .m-quick-row {
  transition: transform 0.12s ease, filter 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
button:not(.toggle-pin):not(:disabled):active, [role="button"]:active, label.card:active {
  transform: scale(0.96);
  filter: brightness(0.96);
}
.toggle-pin:active { filter: brightness(0.9); }
/* ตอนใช้คีย์บอร์ด (Tab) ยังเห็นว่าอยู่ปุ่มไหน — ขอบโค้งตามปุ่ม สีแดงแบรนด์ ไม่ใช่สี่เหลี่ยมฟ้า */
:focus-visible { outline: 2px solid rgba(214,54,43,0.6); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  button:active, [role="button"]:active, label.card:active { transform: none !important; }
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app { min-height: 100vh; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus { border-color: var(--color-blue); }

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-red) 0%, var(--color-blue) 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primary:active { opacity: 0.85; }

.btn-secondary {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.error-box {
  display: none;
  background: #FDECEA;
  color: var(--color-red-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}


.page-wrap { max-width: 480px; margin: 0 auto; padding: 28px 20px 40px; }

.top-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
#reminderTopBarGroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* แท็บเมนูบนสุดของหน้าแอดมิน (แดชบอร์ด/สรุปเงินเดือน/จัดการสาขา ฯลฯ) — เดิมเคยลองทำ position:sticky ให้ค้างจอ
   ตอนเลื่อน แต่ผู้ใช้ไม่ชอบพฤติกรรมนี้ จึงเอากลับเป็นแบบเลื่อนตามหน้าปกติเหมือนเดิม เหลือไว้แค่ส่วนที่ยังต้องการ:
   แท็บที่กำลังเปิดอยู่ใช้สีแดง (--color-red-dark) แทนสีดำเดิม ให้เห็นชัดว่าอยู่หน้าไหน */
.nav-tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}
.nav-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.nav-tab-btn.active {
  background: var(--color-red-dark);
  border-color: var(--color-red-dark);
  color: #FFFFFF;
}

/* (2026-09-15) เมนูแท็บหน้าสายตรวจ "พนักงานในความรับผิดชอบ" (รายชื่อพนักงาน/แจ้งลาพนักงาน/เพิ่มพนักงานใหม่/ย้ายสาขา/
   แจ้งลาออก) — ผู้ใช้ขอให้ย้ายออกมานอกกล่องขาว (.card) แล้วตรึงค้างจอตอนเลื่อนลง คนละจุดกับ .nav-tab-bar ด้านบน
   (เมนูแอดมิน) ที่เคยลองตรึงแล้วผู้ใช้ไม่ชอบมาก่อน — จึงแยกเป็นคลาสใหม่ต่างหาก ไม่ไปกระทบเมนูแอดมิน ถ้าไม่ชอบ
   ให้ลบบล็อกนี้ทิ้ง แล้วคืนโครงสร้างเดิมใน renderInspectorShell/renderInspectorSubNav (ย้าย subnav กลับเข้าไปใน
   .card เหมือนเดิม แล้วเปลี่ยนคลาสปุ่มกลับเป็น nav-tab-btn) เพื่อกลับไปเป็นแบบเดิมทั้งหมด
   ตั้งใจไม่ใช้ flex-wrap เหมือน .nav-tab-bar เดิม — ถ้าจอแคบจนปุ่มเรียงในแถวเดียวไม่พอ (มือถือ) จะเลื่อนซ้าย-ขวา
   แทนการตกบรรทัดใหม่จนทับ/บังเนื้อหาด้านล่าง (มีผลทั้งจอกว้าง/แคบเหมือนกัน แค่จอกว้างพอจะไม่เห็นเลื่อนเพราะพอดีแถวเดียวอยู่แล้ว) */
.insp-subnav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  padding: 10px 0 8px;
  margin-bottom: 12px;
}
.insp-subnav-bar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.insp-subnav-bar::-webkit-scrollbar { display: none; }
.insp-subnav-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.insp-subnav-btn.active {
  background: var(--color-red-dark);
  border-color: var(--color-red-dark);
  color: #FFFFFF;
}

/* (2026-09-15) หัวข้อชื่อหน้า (เช่น "พนักงานในความรับผิดชอบ", "รายชื่อแอดมิน / สายตรวจเวลา") — ผู้ใช้ขอให้ย้าย
   ออกมาไว้เหนือแถบเมนูแท็บทุกหน้า (เดิมอยู่เป็น h2 ตัวแรกในกล่องขาว .card ใต้เมนู) ใช้คลาสนี้แทน .card h2 เดิม
   (ที่ไม่มีผลอีกต่อไปเพราะ h2 ไม่ได้อยู่ใน .card แล้ว) ตั้งค่าให้หน้าตาเหมือนเดิมทุกจุด (font-size:16px ตามที่ใช้
   อยู่แล้วทุกที่, font-weight/margin ลอกมาจาก .card h2 เดิม) ถ้าไม่ชอบให้ลบคลาสนี้ทิ้งแล้วย้าย h2 กลับเข้า .card
   ตามเดิมที่จุดที่แก้ไว้แต่ละหน้า */
.page-title-heading {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 900;
  color: var(--color-text);
}

/* แท็บย่อยใต้เมนู "ตั้งค่าระบบ" (Phase H4) — จงใจใช้สีน้ำเงินแทนแดง (ต่างจาก .nav-tab-btn.active)
   เพื่อให้ตาแยกออกทันทีว่านี่คือ "ชั้นย่อย" ไม่ใช่แท็บหลักระดับเดียวกัน */
.settings-subnav-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 10px 10px 2px;
  background: var(--color-bg);
  border-radius: 12px;
  border: 1px dashed var(--color-border);
}
.settings-subnav-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.settings-subnav-btn.active {
  background: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
  color: #FFFFFF;
}

/* ปุ่มกระดิ่งแจ้งเตือนอัพเดตข้อมูล (#reminderBannerBox) + การ์ดประกาศสายตรวจ + ป๊อปอัพ — ดู rm-* ท้ายไฟล์ */

.role-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-red) 0%, var(--color-blue) 100%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 900; }
.card p { margin: 0; color: var(--color-text-muted); font-size: 14px; line-height: 1.6; }

.branch-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  font-size: 13px;
  margin: 4px 6px 0 0;
}

.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.stat-card { padding:18px; margin-bottom:0; }
.stat-label { font-size:12px; color:var(--color-text-muted); margin:0 0 4px; }
.stat-num { font-size:26px; font-weight:900; }

.mini-table { width:100%; border-collapse:collapse; font-size:13px; }
.mini-table th, .mini-table td { text-align:left; padding:8px 6px; border-bottom:1px solid var(--color-border); }

/* หัวกระดาษที่ใช้ตอนพิมพ์รายงาน/สรุปเงินเดือน (rp_printHeader / pr_printHeader) — โลโก้+ชื่อบริษัทซ้าย,
   ช่วงวันที่/ขอบเขต/เวลาที่พิมพ์ขวา คั่นเส้นใต้หนา ๆ ให้ดูเป็นทางการ (2026-09-16 ปรับจากของเดิมที่มีแค่หัวข้อ+วันที่บรรทัดเดียว) */
.print-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid var(--color-text);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.print-doc-header .print-doc-brand { display: flex; align-items: center; gap: 8px; }
.print-doc-header .print-doc-logo {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-red-dark), var(--color-blue));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 10px;
}
.print-doc-header .print-doc-co { font-size: 15px; font-weight: 900; line-height: 1.25; }
.print-doc-header .print-doc-title { font-size: 12px; color: var(--color-text-muted); font-weight: 600; }
.print-doc-header .print-doc-meta { text-align: right; font-size: 11px; color: var(--color-text-muted); line-height: 1.7; }
.print-doc-header .print-doc-meta b { color: var(--color-text); font-weight: 700; }

/* เชิงอรรถอธิบายหัวข้อคอลัมน์ที่ย่อไว้ (เช่น "ลาป่วยเกินสิทธิ์¹") — อยู่ใต้ตารางเสมอ ไม่ใช่แค่ตอนพิมพ์
   เพราะช่วยให้ดูบนหน้าจอเข้าใจง่ายขึ้นด้วยเหมือนกัน ไม่ใช่ประโยชน์แค่ตอนพิมพ์อย่างเดียว */
.print-doc-legend { margin-top: 10px; font-size: 12px; color: var(--color-text-muted); line-height: 1.7; }
.print-doc-legend sup, .mini-table sup { font-size: 10px; color: var(--color-red-dark); margin-left: 2px; vertical-align: text-top; }

/* ตารางหน้ารายงาน/สรุปเงินเดือนตอนพิมพ์จริง — ปรับให้เป็นระเบียบกว่า .mini-table เปล่า ๆ:
   ใส่เส้นขอบครบทุกช่อง (ของเดิมมีแค่เส้นใต้), แถวลายสลับสีให้ไล่ตาไม่หลุดแถว, หัวตาราง (thead) ซ้ำทุกหน้าอัตโนมัติ
   ถ้าตารางยาวเกินหนึ่งหน้า, กันไม่ให้ตัดกลางแถวพนักงานคนเดียวกันพอดีรอยพับหน้า */
@media print {
  .mini-table { font-size: 11px; }
  .mini-table th, .mini-table td { border: 1px solid #C7CBD1; padding: 5px 6px; }
  .mini-table thead th { background: #EFF1F4; }
  .mini-table tbody tr { page-break-inside: avoid; }
  .mini-table tbody tr.zebra td { background: #FAFAFB; }
  .mini-table tbody tr.branch-row td { background: #F5F6F8; font-weight: 700; border-top: 1.5px solid #B9BDC4; }
  /* หน้ารายงาน (renderReportResult) ไม่มีแถวคั่นสาขาแบบหน้าสรุปเงินเดือน เลยให้ลายสลับสีอัตโนมัติตามลำดับแถวได้เลย
     ไม่ต้องเติม class ทีละแถวใน JS — กันชนกับตารางสรุปเงินเดือนที่ใช้ class .zebra ระบุเองเพราะมีแถวคั่นสาขาแทรก */
  .mini-table:not(.payroll-print-table) tbody tr:nth-child(even) td { background: #FAFAFB; }
  .mini-table th, .mini-table td,
  .mini-table tbody tr.zebra td, .mini-table tbody tr.branch-row td,
  .mini-table:not(.payroll-print-table) tbody tr:nth-child(even) td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  /* ตารางสรุปเงินเดือนคอลัมน์เยอะ (8 คอลัมน์) — กำหนดสัดส่วนความกว้างตายตัวตอนพิมพ์ ไม่ให้คอลัมน์ดันกันเอง
     (ความกว้าง % กำหนดที่ th แต่ละอันใน renderPayrollResult ใน app.js) */
  table.payroll-print-table { table-layout: fixed; font-size: 8.6px; }
}

/* (2026-09-27) การ์ดรายการแอดมิน/สายตรวจแบบเดิม (.admin-item*) ลบออกแล้ว — ดู .acc-* ท้ายไฟล์ */
/* กล่องเลือกสายตรวจ (checklist) — ปุ่มขนาดแตะได้สะดวกบนมือถือ */
.route-cb-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}
.route-cb-label input { width: auto; }

.print-only { display: none; }

/* หน้าสรุปเงินเดือน: กด Print/Save as PDF ของเบราว์เซอร์ -> ซ่อนทุกอย่างยกเว้นตารางผลลัพธ์ และคืนความกว้างเต็มหน้าให้ตาราง */
@media print {
  @page { size: A4; margin: 10mm; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { display: block !important; background: #fff !important; }
  #app { width: auto !important; max-width: none !important; }
  .page-wrap { max-width: none !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc; }
  /* แบนเนอร์แจ้งเตือน "อัพเดตข้อมูล" ติดตั้งเป็น position:fixed นอก #app จึงหลุดพ้น .no-print/#app scope เดิม
     ทำให้ติดไปในเอกสาร PDF ที่พิมพ์จากหน้าเดียวกัน (รายงาน/สรุปเงินเดือน ใช้ window.print() ของหน้าเดิม) — ซ่อนแยกตรงนี้ */
  #reminderBannerBox, #reminderAnnCard { display: none !important; }
}

/* ดรอปดาวเลือกสาขา/ตัวเลือกต่าง ๆ ทั่วทั้งแอป — ปรับให้หน้าตาเหมือน .field input (พิลชิดขอบมน) แทนกล่องเหลี่ยมธรรมดาเดิม
   ใช้ appearance:none + วาดลูกศรเองด้วย background-image เพราะลูกศร <select> ของเบราว์เซอร์เริ่มต้นดูหลุดสไตล์ ไม่ตรงกับปุ่ม/อินพุตอื่นในแอป */
.ysg-select {
  width: 100%;
  padding: 13px 42px 13px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background-color: var(--color-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%236B7076' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  min-height: 48px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.ysg-select:hover { border-color: var(--color-blue); }
.ysg-select:focus { border-color: var(--color-blue); }

/* Segment 13: ดรอปดาวเลือกเดือน/ปี (พ.ศ.) แบบเล็ก อยู่หัวปฏิทินไทย (renderThaiCalendar) ให้กระโดดข้ามปี/เดือนได้
   ทันที แทนที่จะต้องกด ‹ › ทีละเดือน — ใช้เวลากรอกข้อมูลย้อนหลังเยอะ ๆ เช่น วันเข้างานพนักงานเก่า */
.thcal-jump-select {
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background-color: var(--color-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%236B7076' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 22px 6px 8px;
  cursor: pointer;
  color: inherit;
  min-height: 32px;
}
.thcal-jump-select:hover, .thcal-jump-select:focus { border-color: var(--color-blue); outline: none; }

/* จอกว้าง (แท็บเล็ต/เดสก์ท็อป) — เดิมบล็อกนี้บังคับ #app ให้แคบแค่ 480px และจัดกึ่งกลางจอเสมอ "ทุกหน้า"
   ไม่ใช่แค่หน้า login เท่านั้น ทำให้หน้าแอดมิน/สายตรวจ (ตาราง รายชื่อพนักงาน ฯลฯ) ถูกบีบแคบเหมือนตอนอยู่บนมือถือ
   ทั้งที่จอกว้างกว่านั้นมาก จนบางคอลัมน์/ชื่อคนล้นทับกัน — เปลี่ยนมาขยาย .page-wrap (กล่องของหน้าแอดมิน/สายตรวจ
   ทั้งหมด) ให้กว้างขึ้นตามจอแทน โดยจำกัดเพดานไว้ที่ 1040px ไม่ให้ยืดเต็มจอจนอ่านยาก (หน้า login ใช้ .glass-* แยกต่างหาก) */
@media (min-width: 640px) {
  .page-wrap { max-width: 640px; padding: 32px 28px 48px; }
}
@media (min-width: 900px) {
  .page-wrap { max-width: 820px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .page-wrap { max-width: 1040px; }
}


/* ---------- หน้า login: ตัวอักษร YSG โทนทอง ลอยตัว + เด้ง/มีแสงกวาดตอนพิมพ์ PIN (แทน logo-circle เดิม) ---------- */
.ysg-cast { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ysg-letter {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--color-gold-light) 0%, var(--color-gold) 55%, var(--color-gold-dark) 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25), inset 0 1.5px 0 rgba(255,255,255,0.55);
  overflow: hidden;
  animation: ysgFloatY 3.2s ease-in-out infinite;
}
.ysg-letter:nth-child(1) { animation-delay: 0s; }
.ysg-letter:nth-child(2) { animation-delay: 0.35s; }
.ysg-letter:nth-child(3) { animation-delay: 0.7s; }

@keyframes ysgFloatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ysg-letter .glyph {
  font-weight: 900; font-size: 32px; color: #FFFDF6;
  line-height: 1; user-select: none; pointer-events: none;
  text-shadow: 0 2px 2px rgba(139, 107, 20, 0.5);
  position: relative; z-index: 1;
}

.ysg-letter::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.7), transparent);
  transform: skewX(-20deg);
}
.ysg-letter.shimmer::after { animation: ysgShimmerSweep 0.7s ease; }
@keyframes ysgShimmerSweep { from { left: -60%; } to { left: 140%; } }

@keyframes ysgLetterBounce {
  0% { transform: translateY(0) scale(1) rotate(0deg); }
  35% { transform: translateY(-12px) scale(1.08) rotate(-4deg); }
  65% { transform: translateY(-2px) scale(1.02) rotate(3deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}
.ysg-letter.bounce { animation: ysgLetterBounce 0.5s ease; }

/* ปุ่มดวงตาแสดง/ซ่อน PIN ในช่องกรอก */
.toggle-pin {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); font-size: 16px;
}
.toggle-pin:hover { background: var(--color-border); }

/* ไอคอนฟันเฟือง ⚙️ (ตั้งค่า/เปลี่ยน PIN หน้าสายตรวจ) — หมุนโชว์ตอนกดทุกครั้ง ให้รู้สึกว่ากดติด
   เพิ่ม/ลบคลาส .gear-spin ผ่าน JS ทุกครั้งที่กด (ดู inspSettingsBtn ใน app.js) */
@keyframes gearSpinClick {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}
.gear-spin { animation: gearSpinClick 0.35s ease; }

/* ---------- หน้า login แบบกระจกโปร่งแสง (glassmorphism) — แบบ Figma "07 · ล็อคอินแบบกระจก" (2026-09-25) ----------
   พื้นหลังไล่สีแดงเข้ม→น้ำเงินเข้ม + วงกลมสีแดง/น้ำเงิน/ทองเบลอ ๆ ด้านหลัง แล้วการ์ดกระจก (backdrop-filter) วางทับ
   ถ้าเบราว์เซอร์ไม่รองรับ backdrop-filter (Android รุ่นเก่าบางรุ่น) จะได้การ์ดสีกรมท่าทึบแทน ดู @supports ด้านล่าง */
body:has(.glass-login) { background: #1a0f22; }
#app:has(> .glass-login) { min-height: 100vh; min-height: 100dvh; }

.glass-login {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 18px calc(32px + env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  color: #FFFFFF;
  background: linear-gradient(160deg, #7A1712 0%, var(--color-red-dark) 42%, var(--color-blue-dark) 76%, #0A2E66 100%);
}
.glass-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.glass-blob { position: absolute; border-radius: 50%; filter: blur(60px); animation: glassDrift 14s ease-in-out infinite alternate; }
.glass-blob.b1 { width: 300px; height: 300px; left: -90px; top: 8%; background: var(--color-red); opacity: 0.95; }
.glass-blob.b2 { width: 280px; height: 280px; right: -90px; top: 30%; background: var(--color-blue); opacity: 0.95; animation-delay: -4s; }
.glass-blob.b3 { width: 240px; height: 240px; left: 10%; bottom: 14%; background: var(--color-gold); opacity: 0.8; animation-delay: -8s; }
.glass-blob.b4 { width: 180px; height: 180px; right: 5%; top: -40px; background: var(--color-gold-light); opacity: 0.5; animation-delay: -2s; }
.glass-blob.b5 { width: 260px; height: 260px; left: -60px; bottom: -80px; background: var(--color-blue); opacity: 0.7; animation-delay: -6s; }
@keyframes glassDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, -18px) scale(1.08); }
}
.glass-watermark {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  font-size: clamp(120px, 38vw, 220px); font-weight: 900; letter-spacing: 4px; line-height: 1;
  color: rgba(255,255,255,0.07); user-select: none;
}

.glass-inner { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; }
.glass-login .ysg-cast { margin-bottom: 8px; }
.glass-login .ysg-letter { width: 52px; height: 52px; border-radius: 15px; }
.glass-login .ysg-letter .glyph { font-size: 26px; }
.glass-brand { margin: 0 0 22px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; opacity: 0.8; }

.glass-card {
  position: relative;
  width: 100%;
  padding: 0 22px 24px;
  border-radius: 28px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.35);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.45);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  text-align: center;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card { background: rgba(16, 28, 66, 0.82); }
}
.glass-tab {
  display: inline-block;
  margin: 0 auto 16px;
  padding: 11px 30px 13px;
  border-radius: 0 0 18px 18px;
  background: rgba(255,255,255,0.92);
  color: var(--color-red-dark);
  font-size: 17px; font-weight: 700;
}
.glass-greeting { margin: 0; font-size: 26px; font-weight: 900; }
.glass-sub { margin: 0 0 20px; font-size: 13px; opacity: 0.8; }

.glass-card .error-box { text-align: left; background: rgba(255,255,255,0.92); }

.glass-field { position: relative; margin-bottom: 22px; text-align: left; }
.glass-field label {
  position: absolute; left: 18px; top: -10px; z-index: 1;
  padding: 1px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.92); color: var(--color-red-dark);
  font-size: 11px; font-weight: 700; line-height: 1.5;
}
.glass-field input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
  font-family: inherit; font-size: 16px; font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.glass-field input::placeholder { color: rgba(255,255,255,0.55); font-weight: 400; }
.glass-field input:focus { border-color: #FFFFFF; background: rgba(255,255,255,0.16); }
/* กันเบราว์เซอร์ระบายพื้นช่องเป็นสีขาว/เหลืองตอน autofill จนตัวหนังสือสีขาวมองไม่เห็น */
.glass-field input:-webkit-autofill {
  -webkit-text-fill-color: #FFFFFF;
  caret-color: #FFFFFF;
  transition: background-color 99999s ease 0s;
}
.glass-field-icon {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.glass-field .toggle-pin { right: 8px; color: #FFFFFF; }
.glass-field .toggle-pin:hover { background: rgba(255,255,255,0.15); }

.glass-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 6px; }
.glass-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.glass-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-red-dark); }
.glass-link {
  border: none; background: none; padding: 6px 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--color-gold-light);
}
.glass-hint { margin: 2px 0 6px; font-size: 12px; color: var(--color-gold-light); text-align: left; }
.glass-note { margin: 0 0 16px; font-size: 11px; opacity: 0.65; text-align: left; }

.btn-glass {
  width: 100%;
  padding: 15px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--color-red-dark);
  font-family: inherit; font-size: 17px; font-weight: 700;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn-glass:hover { background: #FFFFFF; }
.btn-glass:active { transform: scale(0.98); }
.glass-foot { margin: 16px 0 0; font-size: 11px; opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  .glass-blob { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ysg-letter { animation: none !important; }
  .ysg-letter::after { display: none; }
  .gear-spin { animation: none !important; }
}

/* =====================================================================================================
   (2026-09-25) หน้าตาแบบใหม่สำหรับมือถือ — ตามแบบ Figma "YSG HR – Mobile Redesign" (หน้า 01–04)
   มีผลเฉพาะจอกว้างไม่เกิน 639px เท่านั้น จอคอม/แท็บเล็ตหน้าตาเหมือนเดิมทุกอย่าง
   - หัวหน้า (.top-bar) เป็นแถบไล่สีแดง→น้ำเงิน ขอบล่างมน
   - เมนูแอดมิน (.nav-tab-bar) กลายเป็นเมนูล่างติดขอบจอ มีไอคอน + ชื่อสั้น
   - หน้าสายตรวจใช้เมนูล่างของตัวเอง (.m-bottom-nav) + ปุ่ม + ตรงกลางเปิดเมนูด่วน (.m-sheet)
   - การ์ดตัวเลขแดชบอร์ดมีไอคอน + ชื่อสั้น
   - แถบ "เลือกไว้ N คน" ลอยอยู่เหนือเมนูล่าง
   ถ้าไม่ชอบ ลบบล็อกนี้ทั้งหมด (ถึงท้ายไฟล์) ได้เลย ไฟล์เดิมสำรองไว้ที่โฟลเดอร์ backup-before-mobile-nav
   ===================================================================================================== */

/* ส่วนที่ใช้เฉพาะมือถือ — จอกว้างซ่อนไว้ */
.nav-ic, .nav-lbl-short, .stat-ic, .stat-label-short, .m-bottom-nav { display: none; }

.m-sheet-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(11,12,14,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: mSheetFade 0.18s ease;
}
.m-sheet {
  width: 100%; max-width: 480px;
  background: var(--color-surface);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: mSheetUp 0.22s ease;
}
.m-sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--color-border); margin: 0 auto 14px; }
.m-sheet-title { margin: 0 0 14px; font-size: 20px; font-weight: 900; }
.m-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.m-quick-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px; border-radius: 18px; cursor: pointer; font-family: inherit; color: var(--color-text);
  background: color-mix(in srgb, var(--tint) 7%, #FFFFFF);
  border: 1px solid color-mix(in srgb, var(--tint) 20%, #FFFFFF);
}
.m-quick-tile .stat-ic { margin-bottom: 8px; }
.m-quick-tile b, .m-quick-row b { font-size: 15px; font-weight: 700; display: block; }
.m-quick-tile small, .m-quick-row small { font-size: 12px; color: var(--color-text-muted); display: block; }
.m-quick-row {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin-top: 8px;
  padding: 12px 14px; border-radius: 16px; border: none; background: var(--color-bg);
  cursor: pointer; font-family: inherit; color: var(--color-text);
}
.m-sheet .stat-ic { display: flex; }
@keyframes mSheetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mSheetUp { from { transform: translateY(40px); } to { transform: translateY(0); } }

/* ไอคอนในกรอบสีอ่อน ใช้ทั้งการ์ดตัวเลขและเมนูด่วน — สีมาจาก style="--tint:#xxxxxx" */
.stat-ic {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px;
  align-items: center; justify-content: center;
  color: var(--tint, var(--color-blue));
  background: color-mix(in srgb, var(--tint, var(--color-blue)) 13%, #FFFFFF);
}
.stat-ic svg { width: 20px; height: 20px; }

@media (max-width: 639px) {
  /* ---- หัวหน้าไล่สี ---- */
  .page-wrap > .top-bar {
    margin: -28px -20px 16px;
    padding: calc(20px + env(safe-area-inset-top)) 20px 20px;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(160deg, var(--color-red) 0%, var(--color-red-dark) 38%, var(--color-blue-dark) 72%, var(--color-blue) 100%);
    color: #FFFFFF;
    box-shadow: 0 10px 24px rgba(14,71,154,0.18);
  }
  .page-wrap > .top-bar .role-badge {
    margin-top: 4px; padding: 2px 10px; font-size: 11px;
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.35);
  }
  /* (2026-09-25 รอบ 2) จัดหัวให้กระชับ: ชื่อซ้าย / ปุ่มตั้งค่า+ออกจากระบบชิดขวาสุดในแถวเดียวกัน
     ใช้ display:contents ให้ปุ่มในกล่องขวา (รวมกล่อง #reminderTopBarGroup ที่ JS ห่อไว้) กลายเป็นลูกของ .top-bar
     ตรง ๆ แล้วเรียงลำดับด้วย order — ป้ายแจ้งเตือนอัพเดตข้อมูล (ถ้ามี) ลงไปอยู่บรรทัดที่ 2 เต็มความกว้าง */
  .page-wrap > .top-bar {
    flex-wrap: wrap; align-items: center; gap: 8px 8px;
    padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: 16px;
  }
  .page-wrap > .top-bar > div:first-child { flex: 1 1 0; min-width: 0; order: 0; }
  .page-wrap > .top-bar > div:first-child > div:first-child {
    font-size: 17px !important; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .page-wrap > .top-bar > div:last-child, .page-wrap > .top-bar #reminderTopBarGroup { display: contents !important; }
  .page-wrap > .top-bar .btn-secondary {
    width: 40px !important; height: 40px; padding: 0 !important; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.16) !important;
    border-color: rgba(255,255,255,0.35) !important;
    color: #FFFFFF !important;
  }
  .page-wrap > .top-bar #adminSettingsBtn, .page-wrap > .top-bar #inspSettingsBtn { order: 2; font-size: 17px !important; }
  /* ปุ่มออกจากระบบ: ซ่อนตัวหนังสือ แสดงเป็นไอคอนประตูแทน (ยังมี title/aria สำหรับโปรแกรมอ่านหน้าจอจากข้อความเดิม) */
  .page-wrap > .top-bar #logoutBtn { order: 3; font-size: 0 !important; }
  .page-wrap > .top-bar #logoutBtn::before {
    content: ''; width: 20px; height: 20px; background: #FFFFFF;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5v16h5M14 8l4 4-4 4M18 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5v16h5M14 8l4 4-4 4M18 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .page-wrap > .top-bar #reminderBannerBox { order: 1; font-size: 17px !important; }

  /* ข้อความแนะนำวิธีใช้ (class="hint-text") และรหัสพนักงานในรายชื่อ (class="emp-id") — ซ่อนบนมือถือเพื่อประหยัดพื้นที่ */
  .hint-text, .emp-id { display: none !important; }
  .page-wrap .card { padding: 18px; }
  .page-title-heading { margin-bottom: 10px; }

  /* ---- เมนูล่าง: ใช้ร่วมกันทั้งแอดมิน (.nav-tab-bar) และสายตรวจ (.m-bottom-nav) ---- */
  /* (รอบ 2) เมนูล่างแบบลอย: แคปซูลโค้งมน เว้นขอบจอซ้าย/ขวา/ล่าง */
  .nav-tab-bar, .m-bottom-nav {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 400;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    gap: 0; margin: 0;
    padding: 6px 4px 6px;
    background: #FFFFFF;
    border: 1px solid var(--color-border);
    border-radius: 26px;
    box-shadow: 0 10px 30px rgba(27,28,30,0.16);
  }
  .nav-tab-bar .nav-tab-btn, .m-bottom-nav .m-nav-btn, .m-nav-fab {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
    min-height: 50px; padding: 2px; margin: 0;
    border: none; border-radius: 12px; background: none;
    color: var(--color-text-muted);
    font-family: inherit; font-size: 11px; font-weight: 600; white-space: nowrap;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav-tab-bar .nav-lbl { display: none; }
  .nav-lbl-short { display: block; }
  .nav-ic { display: flex; padding: 4px 14px; border-radius: 999px; transition: background 0.15s ease; }
  .nav-ic svg { width: 22px; height: 22px; }
  .nav-tab-bar .nav-tab-btn.active, .m-bottom-nav .m-nav-btn.active {
    background: none; border: none; color: var(--color-red); font-weight: 700;
  }
  .nav-tab-btn.active .nav-ic, .m-nav-btn.active .nav-ic { background: rgba(214,54,43,0.1); }

  .m-nav-fab { color: var(--color-red); font-weight: 700; }
  .m-nav-fab-circle {
    width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #FFFFFF;
    background: linear-gradient(150deg, var(--color-red) 0%, var(--color-red-dark) 40%, var(--color-blue-dark) 80%, var(--color-blue) 100%);
    box-shadow: 0 6px 14px rgba(214,54,43,0.35), 0 0 0 4px #FFFFFF;
  }
  .m-nav-fab-circle svg { width: 28px; height: 28px; stroke-width: 2.6; }
  .m-nav-fab.active .m-nav-fab-circle { box-shadow: 0 6px 14px rgba(214,54,43,0.35), 0 0 0 4px #FFFFFF, 0 0 0 6px rgba(214,54,43,0.3); }

  /* หน้าสายตรวจ: ซ่อนแถบแท็บเดิมด้านบน (ยังอยู่ใน DOM ให้เมนูด่วนสั่งคลิกได้) */
  .page-wrap:has(.m-bottom-nav) .insp-subnav-wrap { display: none; }

  /* เว้นที่ด้านล่างไม่ให้เนื้อหาโดนเมนูล่างบัง (แทนค่า padding-bottom ที่เขียนไว้ใน style ของแต่ละหน้า) */
  .page-wrap:has(.nav-tab-bar) { padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important; }
  .page-wrap:has(.m-bottom-nav) { padding-bottom: calc(180px + env(safe-area-inset-bottom)) !important; }

  /* แถบ "เลือกไว้ N คน" ลอยเหนือเมนูล่าง */
  .insp-batch-float {
    left: 12px !important; right: 12px !important;
    bottom: calc(112px + env(safe-area-inset-bottom)) !important; /* พ้นปุ่ม + ที่ยื่นเหนือเมนูล่าง (เดิม 92px วงกลมทับขอบแถบ) */
    border-radius: 18px; border-top: none !important;
    background: var(--color-text) !important; color: #FFFFFF;
    padding: 10px 12px 10px 16px !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25) !important;
  }
  .insp-batch-float .btn-secondary {
    background: transparent; color: var(--color-gold-light); border-color: rgba(255,255,255,0.3);
  }

  /* ---- การ์ดตัวเลขแดชบอร์ด ---- */
  .stat-grid { gap: 10px; }
  .stat-card { position: relative; display: flex; flex-direction: column; padding: 14px !important; border-radius: 20px; }
  .stat-card .stat-ic { display: flex; margin-bottom: 8px; }
  .stat-card .stat-num { order: 2; font-size: 26px; line-height: 1.2; }
  .stat-card .stat-label { order: 3; margin: 0; font-weight: 500; }
  .stat-label-full { display: none; }
  .stat-label-short { display: inline; }
  .stat-card[role="button"]::after {
    content: '\203A'; position: absolute; top: 14px; right: 16px;
    font-size: 22px; line-height: 1; color: #C4C7CC;
  }
  .stat-card[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--color-red), var(--shadow-card); }

  /* ส่วนที่เกี่ยวกับไฟล์ CSV ทุกหน้า (นำเข้าพนักงาน/สาขา/บริษัท + ปุ่มดาวน์โหลด CSV ในรายงาน/สรุปเงินเดือน)
     ซ่อนบนมือถือ — ใช้งานจากคอมเท่านั้น (ผู้ใช้ขอ 2026-09-25) */
  .csv-mobile-hide { display: none !important; }

  /* (2026-09-25 รอบ 3) เมนูรอง/ปุ่มสลับโหมดทุกหน้า → แบบ "segmented control" เดียวกันหมด:
     รางสีเทาอ่อน ปุ่มกว้างเท่ากันเรียงเป็นตาราง ปุ่มที่เลือกอยู่เป็นการ์ดขาว ตัวหนังสือแดง
     - ≤ 4 ปุ่ม: แถวเดียวแบ่งช่องเท่ากัน / ≥ 5 ปุ่ม (ประเภทรายงาน): 2 คอลัมน์ ปุ่มเศษสุดท้ายกินเต็มแถว
     - เมนูย่อยตั้งค่าระบบ (ชื่อยาว) ใช้ 2×2
     ปุ่มที่เลือกอยู่ตรวจจาก aria-pressed="true" / .active / สีพื้น #111 ที่ JS เดิมใส่ไว้ใน style */
  .seg-group, .settings-subnav-bar {
    display: grid !important;
    grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 4px !important;
    padding: 4px !important;
    margin: 8px 0 12px !important;
    background: #E8E9EC;
    border: none !important;
    border-radius: 16px;
  }
  .seg-group:has(> :nth-child(5)), .settings-subnav-bar {
    grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seg-group:has(> :nth-child(5)) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .seg-group > button, .settings-subnav-bar > .settings-subnav-btn {
    width: 100% !important; min-height: 42px !important; margin: 0 !important;
    padding: 8px 3px !important;
    display: flex !important; align-items: center; justify-content: center;
    border: none !important; border-radius: 12px !important;
    background: transparent !important; color: var(--color-text-muted) !important;
    box-shadow: none !important;
    font-size: 13px !important; font-weight: 600 !important; line-height: 1.3;
    white-space: normal; text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
  }
  /* (2026-09-25 รอบ 4) ตาราง → การ์ด — ทุก .mini-table ที่ JS ติด data-cards ไว้ (ดู labelTablesForMobile ใน app.js)
     แต่ละแถวเป็นการ์ด: ชื่อเป็นหัวการ์ด, ช่องอื่นเป็น "หัวข้อ ....... ค่า", ปุ่มเรียงท้ายการ์ด, รหัสพนักงานซ่อน */
  .mini-table[data-cards], .mini-table[data-cards] > tbody, .mini-table[data-cards] > thead { display: block; width: 100%; }
  .mini-table[data-cards] tr.mt-head { display: none; }
  .mini-table[data-cards] tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
    padding: 10px 12px; margin: 0 0 8px;
    border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface);
  }
  .mini-table[data-cards] td, .mini-table[data-cards] tr:not(.mt-head) > th {
    flex: 1 1 100%; min-width: 0;
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 2px 0 !important; border: none !important;
    text-align: right; font-size: 13px; overflow-wrap: anywhere;
  }
  .mini-table[data-cards] td[data-label]:not([data-label=""])::before,
  .mini-table[data-cards] tr:not(.mt-head) > th[data-label]:not([data-label=""])::before {
    content: attr(data-label); flex-shrink: 0; max-width: 55%;
    color: var(--color-text-muted); font-size: 12px; font-weight: 400; text-align: left;
  }
  .mini-table[data-cards] td[data-label=""] { justify-content: flex-start; text-align: left; }
  .mini-table[data-cards] td.mt-title {
    order: -1; justify-content: flex-start; text-align: left;
    font-size: 15px; font-weight: 700; margin-bottom: 2px;
  }
  .mini-table[data-cards] td.mt-title::before { display: none; }
  /* ตารางสิทธิ์วันลา (รายละเอียดพนักงาน) — ตัวเลขสั้น ๆ แสดงเป็นชิปเรียงแถวเดียวใต้ชื่อประเภท ประหยัดความสูง */
  .mini-table[id^="quotaTable"][data-cards] td:not(.mt-title) {
    flex: 0 0 auto; gap: 4px; padding: 2px 10px !important;
    background: var(--color-bg); border-radius: 999px; font-weight: 700;
  }
  .mini-table[id^="quotaTable"][data-cards] td:not(.mt-title)::before { max-width: none; }
  /* ช่องที่ไม่มีข้อมูล ("-" หรือว่าง) ไม่ต้องแสดงบรรทัดบนการ์ด ลดคำรก ๆ */
  .mini-table[data-cards] td.mt-empty { display: none; }
  .mini-table[data-cards] td.mt-action { flex: 0 0 auto; justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .mini-table[data-cards] td.mt-action::before { display: none; }
  .mini-table[data-cards] td button, .mini-table[data-cards] td .btn-primary, .mini-table[data-cards] td .btn-secondary {
    width: auto !important; min-height: 34px !important; margin: 0 !important;
    padding: 6px 12px !important; font-size: 12px !important; white-space: nowrap;
  }
  .mini-table[data-cards] tr.mt-group { border: none; background: none; padding: 10px 2px 2px; margin: 0; }
  .mini-table[data-cards] tr.mt-group > td { font-weight: 700; color: var(--color-red-dark); text-align: left; justify-content: flex-start; }
  /* กล่องแจ้งเตือน "ย้ายสาขาเข้ามา" (กระดิ่ง 🔔) — เดิมเป็น absolute ชิดขวาของกระดิ่ง กว้าง 300px ขยายไปทางซ้าย
     พอซ่อนข้อความแนะนำแล้วกระดิ่งไปอยู่ชิดซ้ายของการ์ด กล่องเลยล้นออกนอกจอด้านซ้าย เห็นแต่พื้นขาว (บั๊ก 2026-09-25)
     บนมือถือให้ลอยเต็มความกว้างจอ เหนือเมนูล่างแทน ไม่ขึ้นกับตำแหน่งกระดิ่ง */
  #transferNotifPanel {
    position: fixed !important;
    left: 12px !important; right: 12px !important; top: auto !important;
    bottom: calc(112px + env(safe-area-inset-bottom)) !important;
    width: auto !important; max-width: none !important; max-height: 60vh !important;
    z-index: 950 !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 40px rgba(27,28,30,0.25) !important;
  }
  /* รายชื่อพนักงานทั้งหมด (แดชบอร์ด) เดิมเลื่อนในกล่องสูง 520px — บนมือถือกลายเป็นเลื่อนซ้อนเลื่อน ให้ยืดตามเนื้อหาแทน */
  #empSearchResults { max-height: none !important; overflow: visible !important; }
  /* กล่องที่เคยให้ตารางเลื่อนซ้าย-ขวาได้ ไม่จำเป็นแล้วเมื่อเป็นการ์ด */
  div[style*="overflow-x:auto"]:has(> .mini-table[data-cards]) { overflow-x: visible !important; }

  /* ปุ่มก่อนหน้า/ถัดไป หน้าเช็คความถูกต้อง — ไม่ให้ตัวหนังสือตกบรรทัดบนจอแคบ */
  #la_prevBtn, #la_nextBtn { white-space: nowrap; flex-shrink: 0; padding: 8px 12px !important; font-size: 13px !important; }
  #la_periodLabel { min-width: 0 !important; flex: 1; }
  .seg-group > button[aria-pressed="true"],
  .seg-group > button[style*="rgb(17, 17, 17)"],
  .seg-group > button[style*="#111"],
  .settings-subnav-bar > .settings-subnav-btn.active {
    background: #FFFFFF !important; color: var(--color-red-dark) !important; font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(27,28,30,0.12) !important;
  }
}

@media print {
  .m-bottom-nav, .m-sheet-overlay { display: none !important; }
}

/* ================= รายงาน "สิทธิ์การลา & KPI" (2026-09-25, app.js: renderLeaveRightsResult) =================
   แทนเมนู "ประวัติการลารายละเอียด" เดิม — ตาราง 1 แถว/คน ใช้ไป/คงเหลือ/เกินสิทธิ์ + การ์ด KPI ผู้บริหาร + เกรด A-D
   + popup รายการวันลา (.lr-ov) + เอกสารพิมพ์ A4 แนวนอน (#lrPrintOverlay) คลาสขึ้นต้น lr- ทั้งหมด ไม่ชนของเดิม */
.lr-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.lr-filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; align-items: flex-end; }
.lr-seg { display: inline-flex; background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: var(--radius-pill); padding: 4px; gap: 4px; }
.lr-seg button { border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: var(--radius-pill); cursor: pointer; color: var(--color-text-muted); min-height: 40px; }
.lr-seg button.on { background: #111; color: #fff; }
.lr-search { background-image: none !important; padding-right: 18px !important; }
.lr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lr-chip { border: 1.5px solid var(--color-border); background: var(--color-bg); border-radius: var(--radius-pill); padding: 7px 14px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); min-height: 38px; }
.lr-chip.on { background: #111; border-color: #111; color: #fff; }
.lr-chip .cnt { opacity: 0.7; font-weight: 400; margin-left: 4px; }

.lr-gbar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin-top: 10px; background: var(--color-bg); }
.lr-gbar button { border: 0; font-family: inherit; font-weight: 900; font-size: 12px; color: #fff; cursor: pointer; min-width: 38px; }
.lr-gbar button.sel { box-shadow: inset 0 0 0 3px #111; }
.g-a { background: #1E7B34; } .g-b { background: #5FA83B; } .g-c { background: #E0A21B; } .g-d { background: #D6362B; } .g-x { background: #9AA0A6; }

.lr-table th { background: var(--color-bg); font-size: 11.5px; white-space: nowrap; }
.lr-table td { white-space: nowrap; }
.lr-table th.n, .lr-table td.n { text-align: center; }
.lr-table .lr-q { font-weight: 400; color: var(--color-red-dark); font-size: 10.5px; }
.lr-table td.used, .lr-p-table td.used { background: #FFF6DC; }
.lr-table td.full, .lr-p-table td.full { background: #FFE7B8; font-weight: 700; }
.lr-table td.over, .lr-p-table td.over { background: #FDECEA; color: var(--color-red-dark); font-weight: 900; }
.lr-table td.lr-click { cursor: pointer; }
.lr-table td.lr-click:hover { outline: 2px solid var(--color-blue); outline-offset: -2px; }
.lr-table .rem, .lr-p-table .rem { display: block; font-size: 10.5px; color: var(--color-text-muted); font-weight: 400; }
.lr-table td.over .rem, .lr-p-table td.over .rem { color: var(--color-red-dark); }
.lr-table tr.lr-grp td { background: #F7F8FA; font-weight: 900; font-size: 12px; color: var(--color-blue-dark); }
.lr-table tr.lr-resigned td:not(.used):not(.full):not(.over) { color: var(--color-text-muted); }
.lr-table td.bf-2, .lr-p-table td.bf-2 { color: var(--color-gold-dark); }
.lr-table td.bf-3, .lr-p-table td.bf-3 { color: #B24A12; font-weight: 700; }
.lr-table td.bf-4, .lr-p-table td.bf-4 { color: var(--color-red-dark); font-weight: 900; }
.lr-st { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.lr-st.st-perm { background: #E6F4EA; color: #1E7B34; }
.lr-st.st-prob { background: #FFF3D6; color: #8B6B14; }
.lr-st.st-mat { background: #FCE4EF; color: #C2185B; }
.lr-st.st-pre { background: #FFE9E0; color: #B24A12; }
.lr-st.st-out { background: #F1F1F2; color: #6B7076; }
.lr-grade { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 13px; }
.lr-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--color-text-muted); margin-top: 10px; }
.lr-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: var(--c); border: 1px solid var(--color-border); }
.lr-legend span.plain::before { display: none; }
/* จอมือถือ: ระบบแปลงทุก .mini-table เป็นการ์ดอยู่แล้ว (labelTablesForMobile / data-cards) — ยกเลิกความกว้างขั้นต่ำ
   ของตารางนี้ ให้ช่องประเภทวันลาเป็นชิปเรียงต่อกันใต้ชื่อ (แบบเดียวกับตารางสิทธิ์วันลา quotaTable) และตัดช่อง 0 ทิ้ง */
@media (max-width: 639px) {
  .lr-table[data-cards] { min-width: 0; }
  .lr-table[data-cards] td.n { flex: 0 0 auto; gap: 4px; padding: 3px 10px !important; background: var(--color-bg); border-radius: 999px; font-weight: 700; text-align: left; }
  .lr-table[data-cards] td.n::before { max-width: none; }
  .lr-table[data-cards] td.n.used, .lr-table[data-cards] td.n.full { background: #FFF1CC; }
  .lr-table[data-cards] td.n.over { background: #FDECEA; }
  .lr-table[data-cards] td.n .rem { display: inline; margin-left: 4px; }
  .lr-table[data-cards] td.over.lr-click::after { display: inline; margin-left: 4px; }
  .lr-table[data-cards] tr.lr-grp { border: none; background: none; padding: 10px 2px 2px; margin: 0; }
}

.lr-help summary { cursor: pointer; font-weight: 900; font-size: 15px; }
.lr-help table { margin-top: 10px; }
.lr-help td { vertical-align: top; font-size: 12.5px; line-height: 1.6; }

/* popup รายการวันลา */
.lr-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lr-modal { background: var(--color-surface); border-radius: 20px; padding: 20px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; }
.lr-modal h3 { margin: 0; font-size: 17px; font-weight: 900; }
.lr-msub { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.lr-x { border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--color-text-muted); padding: 4px 8px; min-width: 44px; min-height: 44px; }
.lr-msum { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lr-msum span { background: var(--color-bg); border-radius: 10px; padding: 6px 12px; font-size: 12px; }
.lr-msum span.bad { background: #FDECEA; color: var(--color-red-dark); }
.lr-msum b { font-size: 14px; }
.lr-dtable td { white-space: nowrap; }
.lr-dtable th.n, .lr-dtable td.n { text-align: center; }
.lr-dtable tr.bad td { background: #FDECEA; color: var(--color-red-dark); font-weight: 700; }
.lr-dtable tr.cross td { background: #FFE7B8; }
.lr-flag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--color-red); color: #fff; margin: 1px 4px 1px 0; }
.lr-flag.w { background: #FFF3D6; color: #8B6B14; }
.lr-note { display: inline-block; font-size: 11px; color: var(--color-text-muted); white-space: normal; }
.lr-tip { background: #FFF8E1; border-radius: 12px; padding: 10px 12px; font-size: 12px; color: #6B5510; margin-top: 10px; line-height: 1.6; }

/* หน้าตัวอย่างก่อนพิมพ์ + เอกสารพิมพ์ (A4 แนวนอน) */
body.lr-pv-open { overflow: hidden; }
#lrPrintOverlay { position: fixed; inset: 0; z-index: 1000; background: #DADDE2; overflow: auto; padding: 0 12px 40px; }
.lr-pv-bar { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); padding: 10px 16px; margin: 0 -12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.lr-pv-bar span { color: var(--color-text-muted); font-size: 12px; margin-right: auto; }
.lr-sheet { width: 297mm; min-height: 210mm; margin: 0 auto; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15); padding: 10mm; color: var(--color-text); }
.lr-sheet .print-doc-header { margin-bottom: 10px; }
.lr-p-kpi { display: flex; border: 1px solid #C7CBD1; border-radius: 6px; margin-bottom: 8px; }
.lr-p-kpi div { flex: 1; padding: 5px 8px; border-right: 1px solid #C7CBD1; min-width: 0; }
.lr-p-kpi div:last-child { border-right: 0; }
.lr-p-kpi span { display: block; font-size: 9px; color: var(--color-text-muted); }
.lr-p-kpi b { display: block; font-size: 14px; font-weight: 900; line-height: 1.3; }
.lr-p-kpi b.red { color: var(--color-red-dark); }
.lr-p-kpi b.org { color: #B24A12; }
.lr-p-kpi small { display: block; font-size: 8.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-p-grade { display: flex; align-items: center; gap: 16px; font-size: 11px; margin-bottom: 8px; flex-wrap: wrap; }
.lr-p-grade .lbl { font-weight: 700; }
.lr-p-grade div { display: flex; align-items: center; gap: 5px; }
.lr-p-grade small { color: var(--color-text-muted); }
.lr-sheet .lr-grade { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.lr-p-table { table-layout: fixed; font-size: 9.5px !important; }
.lr-p-table th, .lr-p-table td { border: 1px solid #C7CBD1 !important; padding: 3px 4px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-p-table thead th { background: #EFF1F4; font-size: 9px; text-align: center; line-height: 1.2; white-space: normal; }
.lr-p-table th small { color: var(--color-red-dark); font-weight: 700; }
.lr-p-table td.c, .lr-p-table td.n { text-align: center; }
.lr-p-table td.n { line-height: 1.1; }
.lr-p-table .rem { font-size: 7.5px; }
.lr-p-table tr.branch-row td { background: #F5F6F8; font-weight: 700; color: #0E479A; border-top: 1.5px solid #B9BDC4 !important; }
.lr-p-table td.bad { color: var(--color-red-dark); font-weight: 700; }
.lr-p-table tbody tr { page-break-inside: avoid; }
.lr-sheet .print-doc-legend { font-size: 9.5px; margin-top: 6px; }
.lr-lg { display: inline-block; width: 9px; height: 9px; border: 1px solid #C7CBD1; background: var(--c); vertical-align: -1px; margin-right: 3px; }
.lr-p-apx { margin-top: 14px; }
.lr-p-apx h3 { font-size: 12px; margin: 0 0 6px; font-weight: 900; }
.lr-p-method { margin-top: 10px; font-size: 9px; color: var(--color-text-muted); line-height: 1.6; border-top: 1px dashed #C7CBD1; padding-top: 6px; }
.lr-p-sign { display: flex; justify-content: space-around; margin-top: 22px; font-size: 10.5px; text-align: center; line-height: 2; page-break-inside: avoid; }
.lr-p-sign span { color: var(--color-text-muted); }
.lr-sheet, .lr-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print {
  body.lr-printing > *:not(#lrPrintOverlay) { display: none !important; }
  body.lr-printing { overflow: visible !important; background: #fff !important; }
  body.lr-printing #lrPrintOverlay { position: static; overflow: visible; background: #fff; padding: 0; }
  body.lr-printing .lr-pv-bar { display: none !important; }
  body.lr-printing .lr-sheet { width: auto; min-height: 0; box-shadow: none; padding: 0; margin: 0; }
}

/* ================= ประวัติการลาแบบจัดกลุ่ม ปี → เดือน (2026-09-25, app.js: renderLeaveHistoryBrowser) =================
   ใช้ในรายละเอียดพนักงาน และแท็บแจ้งลาพนักงาน → แก้ไข — แทนตาราง 50 รายการล่าสุดเดิม */
.lh-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.lh-years { display: flex; flex-wrap: wrap; gap: 6px; }
.lh-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lh-controls .ysg-select { width: auto; min-width: 200px; flex: 1 1 200px; padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
.lh-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-muted); cursor: pointer; }
.lh-check input { width: auto; margin: 0; }
.lh-yearsum { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin-bottom: 10px; }
.lh-yearsum-lbl { font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-right: 6px; }
.lh-yearsum .branch-chip b { margin-left: 2px; }
.lh-months { display: flex; flex-direction: column; gap: 8px; }
.lh-month { border: 1.5px solid var(--color-border); border-radius: 14px; background: var(--color-surface); }
.lh-month > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lh-month > summary::-webkit-details-marker { display: none; }
.lh-month > summary::before { content: '▾'; color: var(--color-text-muted); font-size: 12px; transition: transform 0.15s ease; }
.lh-month:not([open]) > summary::before { transform: rotate(-90deg); }
.lh-month > summary b, .lh-month.lh-empty b { font-size: 14px; }
.lh-month > summary span, .lh-month.lh-empty span { font-size: 12px; color: var(--color-text-muted); }
.lh-month.lh-empty { display: flex; gap: 10px; align-items: baseline; padding: 8px 14px 8px 32px; background: var(--color-bg); border-style: dashed; }
.lh-table { margin: 0 0 6px; }
.lh-table th, .lh-table td { padding-left: 14px; }
.lh-table td { vertical-align: top; }
.lh-table tr.lh-cancelled td { color: var(--color-text-muted); text-decoration: line-through; }
.lh-table tr.lh-cancelled td:last-child { text-decoration: none; }
.lh-sub { font-size: 11px; color: var(--color-text-muted); }
.lh-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: #E8F0FC; color: var(--color-blue); font-weight: 400; }
.lh-note { display: block; font-size: 11px; color: var(--color-text-muted); }
.lh-cancel { font-size: 12px; color: var(--color-text-muted); }
@media (max-width: 639px) {
  .lh-table[data-cards] tr { margin: 0 8px 8px; }
  .lh-table[data-cards] td.mt-title { font-size: 14px; }
}

/* ================= รายงาน "สิทธิ์การลา & KPI" แบบกระชับ (2026-09-25 รอบ 2) =================
   ผู้ใช้แจ้งว่าหน้าเดิมยาว/กว้างเกิน ดูไม่ครบในหน้าเดียว — การ์ด KPI ใหญ่ 8 ใบ → แถบ KPI บาง ๆ, แถบเกรดบรรทัดเดียว,
   ตัดคอลัมน์สาขา/สายตรวจ (อยู่ในหัวกลุ่มแล้ว), สถานะเป็นป้ายหลังชื่อ, ช่องวันลาเตี้ยลง, ชื่อค้างซ้ายตอนเลื่อน */
.lr-kstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 12px; }
.lr-kstrip > div { padding: 10px 14px; border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); min-width: 0; margin-right: -1px; margin-bottom: -1px; }
.lr-kstrip span { display: block; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-kstrip b { display: block; font-size: 19px; font-weight: 900; line-height: 1.3; }
.lr-kstrip small { display: block; font-size: 10.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-kstrip .lr-k-click { cursor: pointer; }
.lr-kstrip .lr-k-click span::after { content: ' ›'; }
.lr-kstrip .lr-k-click:hover { background: #FFF5F4; }
.lr-kstrip .lr-k-click.sel { background: #FDECEA; box-shadow: inset 0 0 0 2px var(--color-red); }
@media (max-width: 639px) { .lr-kstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lr-gline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lr-gline .lbl { font-size: 12px; font-weight: 700; white-space: nowrap; }
.lr-gline .lr-gbar { flex: 1; min-width: 220px; height: 26px; margin: 0; }
.lr-gline .lr-gbar button { font-size: 11px; min-width: 30px; }
.lr-gline .help { font-size: 11px; color: var(--color-text-muted); }
.lr-result-card { padding: 16px 18px; }
.lr-tbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.lr-tbar h2 { font-size: 15px; margin: 0; }
.lr-tbar .opts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--color-text-muted); }
.lr-tbar label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.lr-tbar input { width: auto; margin: 0; }
.lr-scroll { overflow-x: auto; }
.lr-table { font-size: 12.5px; }
.lr-table th { padding: 6px 5px !important; line-height: 1.25; text-align: center; }
.lr-table td { padding: 4px 5px !important; }
.lr-table .lr-q { font-size: 10px; }
.lr-table td.z { color: #C3C6CB; }
.lr-table td .rem { font-size: 9.5px; line-height: 1.1; }
.lr-table td.z .rem { color: #B5B9BF; }
.lr-table td sup { font-size: 9px; margin-left: 1px; }
.lr-table tr.lr-grp td { padding: 5px 6px !important; font-weight: 400; }
.lr-table tr.lr-grp td b { font-weight: 900; }
.lr-table .lr-grade { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.lr-table .lr-st { font-size: 10px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.lr-table td.lr-nm { max-width: 230px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
@media (min-width: 640px) {
  .lr-table th.lr-nm, .lr-table td.lr-nm { position: sticky; left: 0; z-index: 1; background: var(--color-surface); box-shadow: 1px 0 0 var(--color-border); text-align: left; }
  .lr-table th.lr-nm { background: var(--color-bg); }
}
.lr-help { margin-top: 10px; }
.lr-help summary { font-size: 12.5px !important; color: var(--color-blue); font-weight: 700 !important; }

/* (2026-09-25 รอบ 3) ตาราง "สิทธิ์การลา & KPI" — เลื่อนลงแล้วหัวตารางหาย ไม่รู้ว่าตัวเลขคอลัมน์ไหนคือลาอะไร:
   ให้ตารางเลื่อนในกรอบตัวเอง (สูงไม่เกินจอ) หัวตารางค้างบนสุด + หัวกลุ่มสาขา (S1 · สาย 2) ค้างต่อจากหัวตาราง
   (sticky top ใช้กับหน้าเว็บตรง ๆ ไม่ได้เพราะกรอบ overflow-x ของตารางกั้นไว้) + หัวตารางสีน้ำเงินเข้มให้เด่น
   เฉพาะจอกว้าง — จอมือถือตารางถูกแปลงเป็นการ์ดอยู่แล้ว (data-cards) ไม่มีหัวตาราง */
@media (min-width: 640px) {
  .lr-scroll { max-height: calc(100vh - 110px); overflow: auto; border: 1px solid var(--color-border); border-radius: 12px; }
  .lr-table { border-collapse: separate; border-spacing: 0; }
  .lr-table thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--color-blue-dark) !important; color: #fff; font-size: 12.5px; font-weight: 700;
    border-bottom: 3px solid var(--color-red) !important; padding: 8px 6px !important;
  }
  .lr-table thead th .lr-q { color: #FFC4BD; font-weight: 700; }
  .lr-table thead th.lr-nm { z-index: 4; background: var(--color-blue-dark) !important; box-shadow: 1px 0 0 rgba(255, 255, 255, 0.2); }
  .lr-table tr.lr-grp td {
    position: sticky; top: var(--lr-head-h, 36px); z-index: 2;
    background: #E8F0FC !important; color: var(--color-blue-dark);
    border-left: 4px solid var(--color-blue); box-shadow: 0 1px 0 #C9D9F2;
  }
}
/* สลับสีคอลัมน์ประเภทวันลาเป็นแถบจาง ๆ ให้ไล่ตาลงตามคอลัมน์ได้ไม่หลง (ไม่ทับสีเหลือง/ส้ม/แดงของช่องที่มีการลา) */
.lr-table td.n.z:nth-child(even) { background: #FAFBFC; }


/* ================= แท็บ "สิทธิ์การลา" หน้าสายตรวจ — ออกแบบใหม่ (2026-09-25 รอบ 3, app.js: renderInspectorLeaveRightsTab) =================
   ไม่มีปุ่มดึงรายงาน (โหลด/รีเฟรชเอง) · แถบควบคุมแถวเดียว · ตารางเลื่อนในกรอบตัวเอง หัวตาราง + สาขา/ชื่อ ค้างไว้เสมอ */
.lri-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.lri-bar .lri-year { flex: 0 0 auto; min-width: 130px; font-weight: 700; }
.lri-bar .ysg-select { width: auto; padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
.lri-search { flex: 1 1 200px; min-width: 160px; }
.lri-select { flex: 0 1 190px; }
.lri-updated { margin-left: auto; font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; }
.lri-updated::before { content: '● '; color: #1E8E5A; }

.lri-sheet { border: 1.5px solid #C9D9F2; border-radius: 14px; overflow: hidden; background: var(--color-surface); }
.lri-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; background: linear-gradient(90deg, #EAF1FE, #F4F8FE); border-bottom: 1.5px solid #C9D9F2; }
.lri-title { font-size: 16px; font-weight: 900; color: #1A3FD0; }
.lri-title small { font-size: 12px; font-weight: 700; color: var(--color-text-muted); }
.lri-quota { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; margin-left: auto; }
.lri-quota .lbl { color: var(--color-text-muted); font-weight: 700; margin-right: 2px; }
.lri-quota span:not(.lbl) { background: #fff; border: 1px solid #C9D9F2; border-radius: 99px; padding: 2px 10px; color: var(--color-red-dark); }
.lri-quota b { color: var(--color-text); margin-left: 3px; }
.lri-sheet .lr-legend { padding: 8px 14px 10px; margin: 0; border-top: 1px solid var(--color-border); }

.lri-table { font-size: 13px; border-collapse: separate; border-spacing: 0; width: 100%; }
.lri-table thead th, .lri-table thead th.lr-nm {
  background: #3E8E41 !important; color: #fff !important; font-weight: 700; font-size: 12.5px; text-align: center;
  line-height: 1.25; padding: 8px 6px !important; white-space: nowrap; border-bottom: 3px solid #2E6B30 !important; box-shadow: none;
}
.lri-table thead th small { display: block; font-size: 10px; font-weight: 400; color: #DDF3DD; }
.lri-table thead th.lri-nm, .lri-table thead th.lri-br { text-align: left; }
.lri-table td { padding: 6px 6px !important; border-bottom: 1px solid var(--color-border); }
.lri-table tbody tr:nth-child(even) td { background-color: #FAFBFC; }
.lri-table tbody tr.lri-first td { border-top: 2px solid #B6D7A8; }
.lri-table td.lri-br { color: var(--color-blue-dark); }
.lri-table td.n.z { color: #C3C6CB; }
.lri-table td.n.used { background: #FFF2CC !important; font-weight: 700; }
.lri-table td.n.full { background: #FFE0A3 !important; font-weight: 900; }
.lri-table td.n.over { background: #FDECEA !important; color: var(--color-red-dark); font-weight: 900; }
.lri-table td.lr-click { cursor: pointer; }
.lri-table td.lr-click:hover { outline: 2px solid var(--color-blue); outline-offset: -2px; }
.lri-table tbody tr:hover td { background-color: #EEF4FF; }

@media (min-width: 640px) {
  /* กรอบเลื่อนสูงไม่เกินจอ (หักแถบเมนูสายตรวจที่ค้างบนสุด + หัวรายงาน) — หัวตาราง sticky ภายในกรอบนี้ */
  .lri-scroll { max-height: calc(100vh - 230px); min-height: 240px; overflow: auto; }
  .lri-table thead th { position: sticky; top: 0; z-index: 3; }
  .lri-table th.lri-br, .lri-table td.lri-br { position: sticky; left: 0; z-index: 1; width: 64px; min-width: 64px; max-width: 64px; background: var(--color-surface); }
  .lri-table th.lri-nm, .lri-table td.lri-nm { position: sticky; left: 64px; z-index: 1; min-width: 170px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; background: var(--color-surface); box-shadow: 2px 0 0 #E1E8F0; }
  .lri-table thead th.lri-br, .lri-table thead th.lri-nm { z-index: 4; }
  .lri-table tbody tr:nth-child(even) td.lri-br, .lri-table tbody tr:nth-child(even) td.lri-nm { background: #FAFBFC; }
  .lri-table tbody tr:hover td.lri-br, .lri-table tbody tr:hover td.lri-nm { background: #EEF4FF; }
}
@media (max-width: 639px) {
  .lri-updated { margin-left: 0; }
  .lri-quota { margin-left: 0; }
  .lri-bar .ysg-select, .lri-select { flex: 1 1 100%; }
}
.lri-table td.lri-br .lri-br-rep { color: #A9B3C1; font-size: 12px; }
/* PDF สิทธิ์การลา: สีช่อง (ใช้แล้ว/ครบ/เกิน) ต้องชนะพื้นเทาสลับแถวของ .mini-table ตอนพิมพ์ (กฎ @media print ด้านบน
   specificity สูงกว่า ทำให้แถวคู่สีหายในไฟล์ PDF จริง — เจอตอนทดสอบพิมพ์ 2026-09-25) */
.lr-p-table td.used { background: #FFF6DC !important; }
.lr-p-table td.full { background: #FFE7B8 !important; }
.lr-p-table td.over { background: #FDECEA !important; }

/* ================= แท็บ "สิทธิ์การลา" สายตรวจ — มือถือ (<640px) ตามแบบ Figma (2026-09-25, app.js: lrmListHtml) =================
   จอกว้างใช้ตารางเขียว .lri-sheet ส่วนมือถือซ่อนตารางแล้วใช้การ์ดทีละคน .lrm + แผ่นรายละเอียด .lrm-sheet */
.lrm { display: none; }
@media (max-width: 639px) {
  .lri-sheet { display: none; }
  .lrm { display: block; }
  #lri_status { display: none; } /* มือถือใช้ตัวกรองด่วน 3 ปุ่มแทน */
  .lri-bar { gap: 8px; }
  .lri-bar .lri-year { flex: 0 0 auto; min-width: 0; }
  .lri-bar .lri-search { flex: 1 1 150px; min-width: 0; }
  .lri-bar .lri-updated { flex: 1 1 100%; }
}
.lrm-quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 10px; scrollbar-width: none; }
.lrm-quick button {
  flex: 0 0 auto; border: 1.5px solid var(--color-border); background: #FFFFFF; color: var(--color-text-muted);
  border-radius: 999px; padding: 7px 13px; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; min-height: 36px;
}
.lrm-quick button.on { background: #111111; border-color: #111111; color: #FFFFFF; }
.lrm-quick button.warn { background: #FDECEA; border-color: #F4C7C2; color: var(--color-red-dark); }
.lrm-quick button.warn.on { background: var(--color-red); border-color: var(--color-red); color: #FFFFFF; }
.lrm-quota { background: #EAF1FE; border-radius: 12px; padding: 8px 12px; font-size: 11.5px; line-height: 1.6; margin-bottom: 8px; }
.lrm-quota b { color: var(--color-blue); margin-right: 4px; }
.lrm-sec { padding: 10px 2px 6px; font-size: 12px; color: var(--color-text-muted); }
.lrm-sec b { font-size: 13px; font-weight: 900; color: var(--color-blue-dark); }
.lrm-card, .lrm-empty {
  display: block; width: 100%; text-align: left; font-family: inherit; color: var(--color-text); cursor: pointer;
  background: #FFFFFF; border: 1.5px solid var(--color-border); border-radius: 16px; margin-bottom: 8px;
}
.lrm-card { padding: 12px 14px; }
.lrm-card.alert { border-color: #F4C7C2; }
.lrm-top { display: flex; align-items: center; gap: 6px; }
.lrm-top > b { font-size: 15px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrm-chev { margin-left: auto; font-size: 20px; line-height: 1; color: #B5B9BF; }
.lrm-alert { background: #FDECEA; color: var(--color-red-dark); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 700; margin-top: 8px; line-height: 1.5; }
.lrm-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 10px; }
.lrm-bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 12px; }
.lrm-bar-top span { color: var(--color-text-muted); font-weight: 500; }
.lrm-bar-top b { font-size: 12.5px; }
.lrm-bar i, .lrm-type i { display: block; height: 6px; border-radius: 3px; background: #EEF0F3; overflow: hidden; margin: 4px 0 2px; }
.lrm-bar i em, .lrm-type i em { display: block; height: 100%; border-radius: 3px; background: #C9CDD3; }
.lrm-bar small, .lrm-type > small { font-size: 10.5px; color: #9AA0A6; }
.s-used i em { background: #E9A23B; }
.s-full i em { background: #E07B00; }
.s-over i em { background: var(--color-red); }
.lrm-bar.s-zero .lrm-bar-top b { color: #9AA0A6; }
.lrm-bar.s-over .lrm-bar-top b, .lrm-bar.s-over small { color: var(--color-red-dark); font-weight: 700; }
.lrm-extras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lrm-chip { background: var(--color-bg); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 500; }
.lrm-empty { display: flex; align-items: center; gap: 6px; padding: 11px 14px; }
.lrm-empty b { font-size: 14px; font-weight: 500; }
.lrm-empty > span:last-child { margin-left: auto; font-size: 12px; color: #9AA0A6; white-space: nowrap; }
.lrm-none { text-align: center; padding: 28px 10px; color: var(--color-text-muted); font-size: 13px; }

/* แผ่นรายละเอียดพนักงาน */
.lrm-sheet { max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; }
.lrm-sh-head { display: flex; align-items: flex-start; gap: 8px; }
.lrm-sh-head > div { flex: 1; min-width: 0; }
.lrm-sh-head h3 { margin: 0; font-size: 19px; font-weight: 900; }
.lrm-sh-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--color-text-muted); }
.lrm-x { border: none; background: none; font-size: 18px; color: #9AA0A6; cursor: pointer; min-width: 44px; min-height: 44px; margin: -8px -10px 0 0; }
.lrm-hint { font-size: 11.5px; color: #9AA0A6; margin: 10px 0 8px; }
.lrm-types { display: flex; flex-direction: column; gap: 8px; }
.lrm-type { background: #F7F8FA; border: 1.5px solid #F7F8FA; border-radius: 14px; padding: 10px 14px; }
.lrm-type.open { background: #FFFFFF; border-color: var(--color-border); }
.lrm-type.open.s-over { border-color: #F4C7C2; }
.lrm-type-head { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 0; font-family: inherit; color: var(--color-text); text-align: left; cursor: pointer; min-height: 30px; }
.lrm-type-head:disabled { cursor: default; }
.lrm-type-head b { flex: 1; font-size: 14px; }
.lrm-type-head span { font-size: 14px; font-weight: 700; }
.lrm-type.s-zero .lrm-type-head span { color: #9AA0A6; }
.lrm-type.s-over .lrm-type-head span, .lrm-type.s-over > small { color: var(--color-red-dark); font-weight: 700; }
.lrm-type-head em { font-style: normal; color: #9AA0A6; width: 12px; transition: transform 0.15s ease; }
.lrm-type.open .lrm-type-head em { transform: rotate(180deg); }
.lrm-entries { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.lrm-entries[hidden] { display: none; }
.lrm-entry { display: flex; align-items: center; gap: 10px; background: #F7F8FA; border-radius: 10px; padding: 8px 10px; }
.lrm-entry .n { font-size: 12px; font-weight: 700; color: #9AA0A6; }
.lrm-entry > div:not(.r) { flex: 1; min-width: 0; }
.lrm-entry b { display: block; font-size: 13.5px; }
.lrm-entry small { display: block; font-size: 11.5px; color: var(--color-text-muted); }
.lrm-entry .r { text-align: right; flex-shrink: 0; }
.lrm-entry .r .lr-flag { margin: 2px 0 0; }
.lrm-entry.bad { background: #FDECEA; }
.lrm-entry.bad b, .lrm-entry.bad .n { color: var(--color-red-dark); }
.lrm-edit { margin-top: 14px; }

/* (2026-09-25) ตัวโหลดตอนเปิดแอป (index.html) — แอปวาดหน้าจริงทับเมื่อโหลดเสร็จ */
.app-loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--color-text-muted); font-size: 14px; }
.app-loading p { margin: 0; }
.app-spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--color-border); border-top-color: var(--color-red); animation: appSpin 0.8s linear infinite; }
@keyframes appSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-spinner { animation-duration: 2.4s; } }
/* ข้อความใต้ปุ่มไอคอน 📋 วันนี้ / 🔔 ย้ายเข้า */
.icon-btn-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.icon-btn-lbl { font-size: 10.5px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }

/* ================= แจ้งเตือนการลงลา (2026-09-25, app.js: renderLeaveAlertsSection) ================= */
/* ตัวเลขแจ้งเตือนสีแดงที่เมนู (data-lal-badge) — ซ่อนเองเมื่อเป็น 0 */
.lal-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--color-red); color: #FFFFFF; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: 1px;
  box-shadow: 0 0 0 2px #FFFFFF;
}
.lal-badge[hidden] { display: none !important; }
.m-nav-fab-circle { position: relative; }
.lal-badge.on-fab { position: absolute; top: -4px; right: -6px; margin: 0; min-width: 22px; height: 22px; font-size: 12px; background: #FFD43B; color: #7A1A13; box-shadow: 0 0 0 2px #FFFFFF; }
.lal-badge.on-row { margin-left: auto; min-width: 24px; height: 24px; font-size: 12.5px; }
.nav-tab-btn { position: relative; }
.lal-badge.on-nav { margin-left: 6px; }
@media (max-width: 639px) {
  .lal-badge.on-nav { position: absolute; top: 2px; right: calc(50% - 26px); margin: 0; }
}

.lal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lal-head h2 { margin: 0; font-size: 18px; font-weight: 900; }
.lal-head p { margin: 2px 0 0; font-size: 12px; color: var(--color-text-muted); }
.lal-route { width: auto; min-width: 160px; padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
.lal-muted { font-size: 12px; color: var(--color-text-muted); margin: 6px 0; }
.lal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lal-chip { border: 1.5px solid var(--color-border); background: #FFFFFF; color: var(--color-text-muted); border-radius: 999px; padding: 7px 14px; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; min-height: 38px; }
.lal-chip b { margin-left: 2px; }
.lal-chip.on { background: #111111; border-color: #111111; color: #FFFFFF; }
.lal-chip.err { border-color: #F4C7C2; color: var(--color-red-dark); }
.lal-chip.err.on { background: var(--color-red); border-color: var(--color-red); color: #FFFFFF; }
.lal-chip.sus { border-color: #F1D77E; color: #8B6B14; }
.lal-chip.sus.on { background: #E0A21B; border-color: #E0A21B; color: #FFFFFF; }
.lal-chip.ghost { border-style: dashed; }
.lal-sec { font-size: 14px; font-weight: 900; margin: 16px 0 8px; }
.lal-sec small { font-size: 11.5px; font-weight: 400; color: var(--color-text-muted); margin-left: 4px; }
.lal-sec.err { color: var(--color-red-dark); }
.lal-sec.sus { color: #8B6B14; }
.lal-card { background: #FFFFFF; border: 1.5px solid var(--color-border); border-left-width: 5px; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.lal-card.sev-error { border-left-color: var(--color-red); }
.lal-card.sev-suspicious { border-left-color: #E0A21B; }
.lal-card.is-dismissed { opacity: 0.7; border-left-color: #9AA0A6; }
.lal-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lal-type { font-size: 12.5px; font-weight: 800; }
.sev-error .lal-type { color: var(--color-red-dark); }
.sev-suspicious .lal-type { color: #8B6B14; }
.lal-date { font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; }
.lal-who { font-size: 15px; font-weight: 700; margin-top: 4px; }
.lal-who span { font-size: 12.5px; font-weight: 400; color: var(--color-text-muted); }
.lal-detail { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--color-text); }
.lal-entries { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--color-text-muted); line-height: 1.7; }
.lal-entries small { font-size: 11px; }
.lal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lal-actions .btn-secondary { width: auto; min-height: 38px; padding: 7px 14px; font-size: 12.5px; }
.lal-actions .lal-ok { border-color: #B6D7A8; color: #1E7B34; }
.lal-empty { text-align: center; padding: 36px 12px; display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--color-text-muted); font-size: 13px; }
.lal-empty .big { font-size: 40px; }
.lal-empty b { color: var(--color-text); font-size: 15px; }
.lal-late { margin-top: 16px; border: 1.5px solid var(--color-border); border-radius: 14px; padding: 10px 14px; background: #F7F8FA; }
.lal-late summary { cursor: pointer; font-size: 13px; font-weight: 700; }

/* ================= เตือนก่อนบันทึกวันลา (2026-09-27, app.js: confirmLeaveWarnings) ================= */
.lsw-modal { max-width: 520px; }
.lsw-modal h3 { margin: 0; font-size: 17px; font-weight: 900; }
.lsw-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.lsw-list li { display: flex; gap: 10px; align-items: flex-start; background: #FFF8E6; border: 1.5px solid #F1D77E; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; }
.lsw-ic { font-size: 18px; line-height: 1.3; }
.lsw-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.lsw-actions button { width: auto; min-height: 44px; padding: 8px 18px; }
@media (max-width: 480px) { .lsw-actions button { flex: 1; } }

/* ================= โปรไฟล์พนักงาน: หน้าเช็คประวัติ (bgp-*) + หน้าต่างแก้ไขแบบใหม่ (pe-*) — 2026-09-27 ================= */
.bgp-count { font-size: 12px; color: var(--color-text-muted); margin: 0 4px 10px; }
.bgp { background: #FFFFFF; border: 1.5px solid var(--color-border); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.bgp.bad { border-color: #F4C7C2; background: linear-gradient(#FFF6F5, #FFFFFF 70px); }
.bgp-h { display: flex; gap: 12px; align-items: center; }
.bgp-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; font-size: 16px; color: #FFFFFF; background: linear-gradient(135deg, var(--color-red), var(--color-blue)); }
.bgp-av.gray { background: #9AA0A6; }
.bgp-who { min-width: 0; flex: 1; }
.bgp-nm { font-size: 17px; font-weight: 900; line-height: 1.35; }
.bgp-nm small { font-size: 12px; font-weight: 500; color: var(--color-text-muted); margin-left: 6px; }
.bgp-nm small.bgp-match { color: var(--color-blue); font-weight: 700; }
.bgp-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.bgp-sub b { color: var(--color-text); }
.bgp-st { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin-left: 4px; vertical-align: 2px; white-space: nowrap; }
.bgp-st.ok { background: #E6F4EA; color: #1E7B34; }
.bgp-st.try { background: #FFF4D6; color: var(--color-gold-dark); }
.bgp-st.mat { background: #F3E8FB; color: #7B3FA0; }
.bgp-st.out { background: #EDEEF0; color: #555A60; }
.bgp-st.bad { background: var(--color-red); color: #FFFFFF; }
.bgp-act { display: flex; gap: 8px; margin-left: auto; flex: none; }
.bgp-btn { font-family: inherit; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 9px 16px; min-height: 40px; border: 1.5px solid var(--color-border); background: #FFFFFF; color: var(--color-blue); cursor: pointer; white-space: nowrap; }
.bgp-btn.pri { background: linear-gradient(90deg, var(--color-red), var(--color-blue)); color: #FFFFFF; border: none; }
.bgp-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.bgp-f { background: var(--color-bg); border-radius: 12px; padding: 8px 11px; min-width: 0; }
.bgp-f span { display: block; font-size: 10.5px; color: var(--color-text-muted); }
.bgp-f b { display: block; font-size: 13.5px; margin-top: 1px; overflow-wrap: anywhere; }
.bgp-f b em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--color-text-muted); }
.bgp-f.big b { font-size: 15px; color: var(--color-blue); }
.bgp-warn { margin-top: 12px; background: #FDECEA; border: 1.5px solid #F4C7C2; color: var(--color-red-dark); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }
.bgp-tl { display: flex; align-items: flex-start; margin-top: 12px; padding: 6px 2px 2px; overflow-x: auto; }
.bgp-ev { flex: 1; min-width: 110px; position: relative; padding-top: 18px; font-size: 11.5px; padding-right: 8px; }
.bgp-ev::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--color-border); }
.bgp-ev::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--color-blue); border: 2px solid #FFFFFF; box-shadow: 0 0 0 1.5px var(--color-blue); }
.bgp-ev.r::after { background: var(--color-red); box-shadow: 0 0 0 1.5px var(--color-red); }
.bgp-ev.g::after { background: #9AA0A6; box-shadow: 0 0 0 1.5px #9AA0A6; }
.bgp-ev:last-child::before { display: none; }
.bgp-ev b { display: block; font-size: 12px; }
.bgp-ev i { font-style: normal; color: var(--color-text-muted); }
@media (max-width: 760px) {
  .bgp-h { flex-wrap: wrap; }
  .bgp-act { width: 100%; margin: 4px 0 0; order: 3; }
  .bgp-act .bgp-btn { flex: 1; }
  .bgp-facts { grid-template-columns: 1fr 1fr; }
  .bgp-facts .bgp-f:last-child:nth-child(odd) { grid-column: span 2; }
  .bgp-tl { flex-direction: column; gap: 10px; }
  .bgp-ev { padding: 0 0 0 22px; min-width: 0; }
  .bgp-ev::before { top: 14px; bottom: -12px; left: 5px; right: auto; width: 2px; height: auto; }
}

.pe-ov { padding: 20px; }
.pe { background: var(--color-surface); border-radius: 24px; width: 100%; max-width: 880px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.pe-loading { padding: 40px 20px; text-align: center; font-size: 14px; color: var(--color-text-muted); }
.pe-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--color-border); }
.pe-who { min-width: 0; flex: 1; }
.pe-head .bgp-nm { font-size: 16px; }
.pe-x { margin-left: auto; }
.pe-tabs { display: flex; gap: 4px; padding: 6px 16px 0; border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.pe-tab { font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.pe-tab.on { color: var(--color-text); border-color: var(--color-red); }
.pe-body { padding: 14px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.pe-sec { font-size: 12px; font-weight: 900; color: var(--color-text-muted); margin: 6px 0 8px; display: flex; align-items: center; gap: 8px; }
.pe-sec::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px; }
.pe-grid.pe-name { grid-template-columns: 130px 1fr 1fr; }
.pe-fld { min-width: 0; margin-bottom: 0; }
.pe-fld > label { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 4px; }
.pe-fld input[type="text"], .pe-fld textarea { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 14px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 15px; box-sizing: border-box; }
.pe-fld textarea { min-height: 0; resize: vertical; }
.pe-fld .ysg-select { width: 100%; }
.pe-fld .thcal-trigger { min-height: 46px !important; padding: 10px 14px !important; }
.pe .pe-changed { border-color: var(--color-gold) !important; background: #FFFBEE !important; }
.pe-help { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.5; }
.pe-help .ok { color: #1E7B34; font-weight: 700; }
.pe-help .bad { color: var(--color-red-dark); font-weight: 700; }
.pe-note { font-size: 12.5px; background: #FFF8E6; border: 1.5px solid var(--color-gold-light); border-radius: 12px; padding: 9px 12px; color: #6B5212; line-height: 1.6; margin-bottom: 12px; }
.pe-seg { display: flex; background: var(--color-bg); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.pe-seg button { flex: 1; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 10px; padding: 9px 4px; min-height: 42px; cursor: pointer; }
.pe-seg button.on { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.pe-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--color-red-dark); margin: 4px 0 10px; }
.pe-check input { width: 20px; height: 20px; }
.pe-log { list-style: none; margin: 0; padding: 0; }
.pe-log li { padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; line-height: 1.6; }
.pe-log-t { font-size: 11.5px; color: var(--color-text-muted); }
.pe-err { margin: 0 20px 8px; }
.pe-foot { display: flex; gap: 10px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--color-border); background: #FAFAFB; }
.pe-chg { font-size: 12px; color: var(--color-gold-dark); font-weight: 700; min-width: 0; }
.pe-sp { margin-left: auto; display: flex; gap: 8px; }
.pe-sp button { width: auto; min-height: 44px; padding: 8px 22px; margin: 0; }
.pe-save:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) {
  .pe-ov { padding: 0; align-items: stretch; }
  .pe { max-width: none; height: 100%; border-radius: 0; }
  .pe-head { padding: 10px 8px 10px 14px; }
  .pe-head .bgp-av { width: 38px; height: 38px; font-size: 14px; }
  .pe-tabs { padding: 2px 8px 0; }
  .pe-tab { padding: 10px 10px; }
  .pe-body { padding: 12px 14px; }
  .pe-grid { grid-template-columns: 1fr; gap: 10px; }
  .pe-grid.pe-name { grid-template-columns: 110px 1fr; }
  .pe-grid.pe-name .pe-fld:last-child { grid-column: span 2; }
  .pe-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .pe-chg { width: 100%; }
  .pe-chg:empty { display: none; }
  .pe-sp { margin: 0; width: 100%; }
  .pe-sp button { flex: 1; }
}

/* ================= นำเข้าพนักงานจากไฟล์ แบบใหม่ (2026-09-27, app.js: renderEmployeeImport) ================= */
.imp-top { display: flex; gap: 12px; flex-wrap: wrap; }
.imp-dl, .imp-drop { flex: 1; min-width: 280px; display: flex; gap: 12px; align-items: center; border-radius: 16px; padding: 14px 16px; }
.imp-dl { border: 2px dashed #BFD3F2; background: #F4F8FE; }
.imp-drop { border: 2px dashed var(--color-border); background: #FAFAFB; cursor: pointer; }
.imp-drop:hover { border-color: var(--color-blue); }
.imp-dl > div, .imp-drop > div { flex: 1; min-width: 0; }
.imp-dl b, .imp-drop b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.imp-dl span, .imp-drop span { font-size: 12px; color: var(--color-text-muted); }
.imp-ic { font-size: 28px; line-height: 1; }
.imp-dl .btn-secondary, .imp-pick { width: auto !important; min-height: 42px; padding: 8px 16px; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; color: var(--color-blue) !important; }
.imp-cols { margin-top: 14px; }
.imp-cols summary { font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.imp-table th { text-align: left; font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; padding: 8px; border-bottom: 1.5px solid var(--color-border); background: #FAFAFB; position: sticky; top: 0; z-index: 1; }
.imp-table td { padding: 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; line-height: 1.55; }
.imp-req { color: var(--color-red); font-weight: 700; white-space: nowrap; }
.imp-opt { color: var(--color-text-muted); }
.imp-note { font-size: 12px; color: var(--color-text-muted); line-height: 1.7; margin: 8px 0 0; }
.imp-err { color: var(--color-red-dark); font-size: 13px; }
.imp-h { font-size: 15px; font-weight: 900; margin: 18px 0 10px; }
.imp-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.imp-sum div { border-radius: 14px; padding: 10px 14px; font-size: 12.5px; }
.imp-sum b { display: block; font-size: 22px; }
.imp-sum .ok, .imp-tag.ok { background: #E6F4EA; color: #1E7B34; }
.imp-sum .warn, .imp-tag.warn { background: #FFF4D6; color: var(--color-gold-dark); }
.imp-sum .bad, .imp-tag.bad { background: #FDECEA; color: var(--color-red-dark); }
.imp-sum .skip, .imp-tag.skip { background: #EDEEF0; color: #555A60; }
.imp-scroll { max-height: 460px; overflow: auto; margin-top: 12px; border: 1px solid var(--color-border); border-radius: 12px; }
.imp-preview { margin-top: 0; }
.imp-tag { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.imp-r-bad td { background: #FFF7F6; }
.imp-r-warn td { background: #FFFCF2; }
.imp-r-skip td { color: var(--color-text-muted); }
.imp-more { text-align: center; }
.imp-link { font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-blue); background: none; border: none; cursor: pointer; padding: 8px; }
.imp-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.imp-foot .imp-note { flex: 1; min-width: 220px; margin: 0; }
.imp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.imp-actions button { width: auto; min-height: 44px; padding: 8px 18px; margin: 0; }
.imp-actions input { width: 130px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 14px; }
.imp-dl-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= จัดการแอดมิน/สายตรวจ แบบใหม่ (2026-09-27, app.js: renderAdminListBox / openAdminEditor) ================= */
.acc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-head h2 { margin: 0; font-size: 18px; font-weight: 900; }
.acc-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-stat { font-size: 12px; color: var(--color-text-muted); background: var(--color-bg); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.acc-stat b { color: var(--color-text); }
.acc-stat.on b { color: #1E8E3E; }
.acc-add { margin-left: auto; font-family: inherit; font-weight: 700; font-size: 13px; border: none; border-radius: 999px; padding: 10px 18px; min-height: 42px; color: #FFFFFF; cursor: pointer; background: linear-gradient(90deg, var(--color-red), var(--color-blue)); }
.acc-tools { display: flex; gap: 10px; margin: 14px 0 4px; align-items: center; flex-wrap: wrap; }
.acc-search { flex: 1; min-width: 200px; background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: 999px; padding: 10px 16px; font-family: inherit; font-size: 14px; }
.acc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-chip { font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 7px 13px; min-height: 36px; color: var(--color-text-muted); background: #FFFFFF; cursor: pointer; white-space: nowrap; }
.acc-chip.on { background: #111111; color: #FFFFFF; border-color: #111111; }
.acc-note { font-size: 11.5px; color: var(--color-text-muted); margin: 12px 0 0; line-height: 1.6; }
.acc-empty { font-size: 13px; color: var(--color-text-muted); padding: 20px 0; text-align: center; }
.acc-muted { color: var(--color-text-muted); font-weight: 400; }
.acc-warn { color: #B26A00; font-weight: 700; font-size: 12.5px; }
.acc-warn-inline { color: #B26A00; font-weight: 700; }

.acc-thead, .acc-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 92px minmax(0, 1.5fr) 112px 122px; gap: 8px; align-items: center; }
.acc-thead { font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); padding: 10px 10px 2px; }
.acc-sec { font-size: 12px; font-weight: 900; color: var(--color-text-muted); margin: 14px 0 4px; display: flex; align-items: center; gap: 8px; }
.acc-sec::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.acc-row { padding: 9px 10px; border-top: 1px solid var(--color-border); font-size: 13px; }
.acc-row:hover { background: #FAFBFC; }
.acc-row.is-hidden > div:not(.acc-acts) { opacity: 0.55; }
.acc-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acc-av { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; font-size: 14px; color: #FFFFFF; }
.acc-av.main { background: linear-gradient(135deg, #D6362B, #9C1F16); }
.acc-av.sub { background: linear-gradient(135deg, #1259C3, #0B3A80); }
.acc-av.insp { background: linear-gradient(135deg, #3AA0A8, #1F6F75); }
.acc-av i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #FFFFFF; background: #C4C7CC; }
.acc-av i.on { background: #22A447; }
.acc-nm-wrap { min-width: 0; display: flex; flex-direction: column; }
.acc-nm { font-weight: 900; font-size: 14px; overflow-wrap: anywhere; line-height: 1.35; }
.acc-id { font-size: 12px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-role { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.acc-role.main { background: #FDECEA; color: #B22A21; }
.acc-role.sub { background: #E8F0FC; color: #0E479A; }
.acc-role.insp { background: #E3F4F4; color: #1F6F75; }
.acc-routes { display: flex; gap: 5px; flex-wrap: wrap; }
.acc-rt { font-size: 11.5px; background: var(--color-bg); border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.acc-rt b { font-weight: 700; }
.acc-last { font-size: 12.5px; }
.acc-last.on { color: #1E8E3E; font-weight: 700; }
.acc-acts { display: flex; gap: 6px; justify-content: flex-end; }
.acc-more-items { display: contents; }
.acc-ib { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--color-border); background: #FFFFFF; display: grid; place-items: center; font-size: 14px; color: var(--color-text-muted); cursor: pointer; font-family: inherit; padding: 0; }
.acc-ib:hover { border-color: var(--color-blue); }
.acc-ib.edit { color: var(--color-blue); }
.acc-ib.del { color: #B22A21; }
.acc-ib[data-confirming="1"] { width: auto; padding: 0 10px; background: #FDECEA; border-color: #F4C7C2; font-size: 12px; font-weight: 700; }
.acc-more { display: none; }

@media (max-width: 760px) {
  .acc-add { padding: 8px 14px; }
  .acc-thead { display: none; }
  .acc-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who acts" "routes last"; row-gap: 8px; border: 1.5px solid var(--color-border); border-radius: 16px; margin-bottom: 8px; padding: 12px; }
  .acc-who { grid-area: who; }
  .acc-acts { grid-area: acts; }
  .acc-routes-cell { grid-area: routes; min-width: 0; }
  .acc-last-cell { grid-area: last; text-align: right; }
  .acc-role-cell { display: none; }
  .acc-rt-unit { display: none; }
  .acc-more { display: grid; }
  .acc-more-items { display: none; }
  .acc-row.show-more .acc-more-items { display: contents; }
  .acc-sec { margin-top: 12px; }
}

.acc-ov { padding: 20px; }
.acc-md { background: var(--color-surface); border-radius: 22px; width: 100%; max-width: 620px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.acc-md-h { display: flex; align-items: center; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--color-border); }
.acc-md-h b { font-size: 16px; }
.acc-md-h .lr-x { margin-left: auto; }
.acc-md-b { padding: 16px 20px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.acc-f > label { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 4px; }
.acc-f input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 15px; box-sizing: border-box; }
.acc-seg { display: flex; background: var(--color-bg); border-radius: 12px; padding: 3px; gap: 3px; }
.acc-seg button { flex: 1; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 9px; padding: 9px 6px; min-height: 40px; cursor: pointer; }
.acc-seg button.on { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.acc-help { font-size: 11.5px; color: var(--color-text-muted); margin-top: 5px; }
.acc-rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-rc { font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 7px 12px; min-height: 38px; color: var(--color-text-muted); background: #FFFFFF; cursor: pointer; }
.acc-rc small { font-weight: 400; }
.acc-rc .acc-tick { display: none; }
.acc-rc.on { border-color: var(--color-blue); background: #E8F0FC; color: #0E479A; }
.acc-rc.on .acc-tick { display: inline; }
.acc-md-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--color-border); background: #FAFAFB; }
.acc-md-f button { width: auto; min-height: 44px; padding: 8px 22px; margin: 0; }
@media (max-width: 640px) {
  .acc-ov { padding: 0; align-items: stretch; }
  .acc-md { max-width: none; height: 100%; border-radius: 0; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc-md-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .acc-md-f button { flex: 1; }
}

/* ================= รายชื่อพนักงานแบบแถวชิด (2026-09-28, app.js: empListHtml) — หน้าแอดมิน + สายตรวจ ================= */
.el-list { font-size: 13px; }
.el-head, .el-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) 150px 118px 104px; gap: 8px; align-items: center; }
.el-head { font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); padding: 7px 10px; background: #FAFAFB; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 1; }
.el-grp { background: var(--color-bg); font-weight: 900; font-size: 12px; color: var(--color-text-muted); padding: 6px 10px; margin-top: 4px; border-radius: 8px; }
.el-grp span { font-weight: 400; }
.el-row { padding: 4px 10px; min-height: 42px; border-bottom: 1px solid #F0F1F3; cursor: pointer; }
.el-row:hover { background: #F7F9FC; }
.el-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-name b { font-weight: 700; }
.el-name small { font-size: 11px; color: var(--color-text-muted); margin-left: 4px; }
.el-pos { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-ten { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.el-sub { display: none; }
.el-act { text-align: right; }
.el-btn { font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-blue); border: 1.5px solid var(--color-border); border-radius: 8px; padding: 5px 10px; min-height: 32px; background: #FFFFFF; cursor: pointer; white-space: nowrap; }
.el-btn:hover { border-color: var(--color-blue); }
.el-pill { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.el-pill.ok { background: #E6F4EA; color: #1E7B34; }
.el-pill.try { background: #FFF4D6; color: #8B6B14; }
.el-pill.mat { background: #F3E8FB; color: #7B3FA0; }
.el-pill.out { background: #FDECEA; color: #B22A21; }
.el-pill.gone { background: #EDEEF0; color: #555A60; }
.el-detail { padding: 10px 12px 14px; border-bottom: 1px solid var(--color-border); background: #FCFCFD; }
.el-note { font-size: 11.5px; color: #7D3FBF; padding: 4px 12px 0; background: #FCFCFD; }
.el-count { font-size: 11px; color: var(--color-text-muted); margin-top: 8px; }
@media (max-width: 640px) {
  .el-head { display: none; }
  .el-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name st" "sub sub"; row-gap: 1px; padding: 8px 10px; }
  .el-name { grid-area: name; }
  .el-name small { display: none; }
  .el-st { grid-area: st; }
  .el-sub { grid-area: sub; display: block; font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .el-pos, .el-ten, .el-act { display: none; }
}

/* ================= คีย์ต่อเนื่อง: ช่องกรอกพื้นฐาน (หน้าตาการ์ดอยู่บล็อก 2026-09-29 ด้านล่าง) ================= */
.qe-hint { font-size: 12px; color: var(--color-text-muted); margin: 0 0 8px; line-height: 1.7; }
.qe-kbd { font-size: 11px; background: #FFFFFF; border: 1px solid var(--color-border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-weight: 700; color: var(--color-text); }
.qe-in { width: 100%; min-width: 0; height: 38px; min-height: 38px; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 13px; box-sizing: border-box; }
select.qe-in { padding-right: 4px; }
.qe-in:focus { outline: none; border-color: var(--color-blue); background: #FFFFFF; box-shadow: 0 0 0 3px #E8F0FC; }
.qe-date .thcal-trigger { min-height: 38px !important; height: 38px; padding: 6px 8px !important; font-size: 13px !important; border-radius: 10px !important; }
.qe-amt { display: flex; gap: 4px; align-items: center; min-width: 0; }
.qe-amt em { font-style: normal; font-size: 12px; color: var(--color-text-muted); }
.qe-amt .qe-days, .qe-amt .qe-hours { width: 52px; flex: none; }
.qe-notecell { display: flex; gap: 4px; align-items: center; min-width: 0; }
.qe-cert { display: flex; align-items: center; gap: 3px; font-size: 11.5px; white-space: nowrap; }
.qe-cert input { width: 16px; height: 16px; margin: 0; }
.qe-del { border: none; background: none; color: var(--color-text-muted); font-size: 18px; cursor: pointer; padding: 0; height: 32px; }
.qe-del:hover { color: var(--color-red-dark); }
.qe-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.qe-foot .qe-hint { margin: 0; flex: 1; min-width: 180px; }
.qe-foot button { width: auto; min-height: 44px; padding: 8px 18px; margin: 0; }
.qe-save:disabled { opacity: 0.45; cursor: not-allowed; }

/* ================= ปฏิทินการลา (2026-09-28, app.js: renderLeaveCalendarMode) ================= */
.lc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lc-nav { display: flex; align-items: center; gap: 6px; }
.lc-nav b { font-size: 18px; font-weight: 900; min-width: 150px; text-align: center; }
.lc-nb { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--color-border); background: #FFFFFF; font-size: 18px; font-weight: 900; color: var(--color-text-muted); cursor: pointer; }
.lc-today { font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 7px 14px; min-height: 38px; background: #FFFFFF; cursor: pointer; }
.lc-branch { width: auto !important; min-width: 200px; margin-left: auto; }
.lc-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--color-text-muted); margin-bottom: 8px; }
.lc-legend span { display: flex; align-items: center; gap: 4px; }
.lc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; background: #FFFFFF; }
.lc-dow { background: #FAFAFB; font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); text-align: center; padding: 6px; border-bottom: 1px solid var(--color-border); }
.lc-dow.sun { color: var(--color-red); }
.lc-cell { min-height: 104px; border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); padding: 4px 5px 6px; min-width: 0; cursor: pointer; position: relative; }
.lc-cell:nth-child(7n) { border-right: none; }
.lc-cell:hover:not(.out) { background: #F4F8FE; }
.lc-cell:focus-visible { outline: 2px solid var(--color-blue); outline-offset: -2px; }
.lc-cell.out { background: #FAFAFB; cursor: default; }
.lc-cell.out .lc-dn { color: #C4C7CC; }
.lc-cell.tod { box-shadow: inset 0 0 0 2px var(--color-blue); }
.lc-cell.sun .lc-dn { color: var(--color-red); }
.lc-dn { font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; }
.lc-plus { color: var(--color-blue); font-weight: 900; opacity: 0; }
.lc-cell:hover .lc-plus { opacity: 1; }
.lc-hol { font-size: 10.5px; color: var(--color-red); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-chips { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.lc-chip { display: block; width: 100%; text-align: left; font-family: inherit; font-size: 11px; font-weight: 700; color: #FFFFFF; background: var(--c); border: none; border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.lc-chip.half { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0) 0 5px, rgba(255, 255, 255, 0.28) 5px 8px); }
.lc-chip:hover { filter: brightness(1.08); }
.lc-more { font-size: 11px; color: var(--color-blue); font-weight: 700; }
.lc-dots { display: none; }
.lc-day { display: none; }

.lc-ov { padding: 20px; }
.lc-sheet { background: var(--color-surface); border-radius: 20px; width: 100%; max-width: 440px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.lc-sh-h { display: flex; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--color-border); }
.lc-sh-h b { font-size: 15px; }
.lc-sh-h .lr-x { margin-left: auto; }
.lc-sh-b { padding: 12px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.lc-sh-f { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--color-border); background: #FAFAFB; }
.lc-sh-f button { width: auto; min-height: 44px; padding: 8px 16px; margin: 0; }
.lc-sh-f .lc-save:disabled { opacity: 0.5; cursor: not-allowed; }
.lc-lbl { font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 4px; }
.lc-in { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 14px; box-sizing: border-box; }
.lc-exist { background: var(--color-bg); border-radius: 12px; padding: 8px 10px; }
.lc-ex, .lc-li { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font-family: inherit; font-size: 12.5px; background: none; border: none; padding: 5px 0; cursor: pointer; color: var(--color-text); }
.lc-ex i, .lc-li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lc-ex em, .lc-li em { margin-left: auto; font-style: normal; color: var(--color-blue); font-weight: 700; flex: none; }
.lc-people { border: 1.5px solid var(--color-border); border-radius: 12px; max-height: 190px; overflow-y: auto; }
.lc-pp { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13.5px; border-bottom: 1px solid var(--color-border); cursor: pointer; min-height: 42px; }
.lc-pp:last-child { border-bottom: none; }
.lc-pp input { width: 18px; height: 18px; margin: 0; }
.lc-pp small { margin-left: auto; color: var(--color-text-muted); font-size: 11px; }
.lc-pp:has(input:checked) { background: #EEF4FD; }
.lc-onleave { color: #B26A00; }
.lc-types { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-ty { display: flex; align-items: center; gap: 5px; font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 6px 11px; min-height: 36px; background: #FFFFFF; cursor: pointer; color: var(--color-text); }
.lc-ty i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lc-ty.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); background: #FAFAFB; }
.lc-f-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lc-seg { display: flex; background: var(--color-bg); border-radius: 10px; padding: 3px; gap: 3px; }
.lc-seg button { flex: 1; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 8px; padding: 7px 4px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.lc-seg button.on { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.lc-days { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.lc-days .lc-in { width: 80px; }

@media (max-width: 640px) {
  .lc-nav b { min-width: 120px; font-size: 16px; }
  .lc-branch { min-width: 0; flex: 1; }
  .lc-grid { border: none; gap: 3px; background: transparent; }
  .lc-dow { background: none; border: none; padding: 2px; }
  .lc-cell { min-height: 0; aspect-ratio: 1 / 1.05; border: none; border-radius: 10px; background: #FFFFFF; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; }
  .lc-cell.out { background: transparent; }
  .lc-cell.sel { background: #111111; }
  .lc-cell.sel .lc-dn { color: #FFFFFF; }
  .lc-dn { justify-content: center; font-size: 13px; }
  .lc-plus, .lc-hol, .lc-chips { display: none; }
  .lc-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 4px; max-width: 34px; }
  .lc-dots i { width: 6px; height: 6px; border-radius: 50%; }
  .lc-day { display: block; background: #FFFFFF; border-radius: 16px; padding: 10px 12px; margin-top: 10px; }
  .lc-day-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .lc-day-h b { font-size: 14px; }
  .lc-day-h span { font-size: 12px; color: var(--color-text-muted); }
  .lc-day-h .lc-add { margin-left: auto; width: auto; min-height: 38px; padding: 6px 14px; font-size: 13px; }
  .lc-li { border-top: 1px solid var(--color-border); padding: 8px 0; font-size: 13px; }
  .lc-li span { display: flex; flex-direction: column; min-width: 0; }
  .lc-li small { color: var(--color-text-muted); font-size: 11.5px; }
  .lc-ov { padding: 0; align-items: flex-end; }
  .lc-sheet { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .lc-sh-f { padding-bottom: calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .lc-sh-f .lc-save { flex: 1; }
}

/* ================= สิทธิ์วันลาแบบการ์ด + ประวัติการลาแบบปฏิทิน (2026-09-28, app.js: renderLeaveRightsCards / renderLeaveHistoryCalendar) ================= */
.lrc-h { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; flex-wrap: wrap; }
.lrc-h b { font-size: 14px; }
.lrc-h span { font-size: 12px; color: var(--color-text-muted); }
.lrc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lrc { border: 1.5px solid var(--color-border); border-radius: 12px; padding: 8px 10px; background: #FFFFFF; min-width: 0; }
.lrc-n { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrc-n i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.lrc-v { font-size: 12px; color: var(--color-text-muted); margin-top: 3px; white-space: nowrap; }
.lrc-v b { font-size: 17px; color: var(--color-text); font-weight: 900; }
.lrc-bar { height: 5px; border-radius: 9px; background: #EEF0F2; margin-top: 6px; overflow: hidden; }
.lrc-bar i { display: block; height: 100%; border-radius: 9px; }
.lrc.full { border-color: #F4C7C2; background: #FFF7F6; }
.lrc.full .lrc-v b { color: var(--color-red); }
.lrc.near .lrc-v b { color: #B26A00; }
.lrc-more { font-size: 12px; color: var(--color-text-muted); margin-top: 8px; line-height: 1.6; }
.lhc-host { margin-top: 16px; }
.lh-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lh-title { font-size: 14px; }
.lh-ro { font-size: 11px; color: var(--color-text-muted); background: var(--color-bg); border-radius: 999px; padding: 2px 9px; }
.lh-seg { display: flex; background: var(--color-bg); border-radius: 10px; padding: 3px; gap: 3px; margin-left: auto; }
.lh-seg button { font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 8px; padding: 6px 14px; min-height: 34px; cursor: pointer; }
.lh-seg button.on { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.lh-nb { width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--color-border); background: #FFFFFF; font-size: 17px; font-weight: 900; color: var(--color-text-muted); cursor: pointer; }
.lh-period { font-size: 15px; min-width: 120px; text-align: center; }
.lh-sum { font-size: 12px; color: var(--color-text-muted); }
.lh-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.lh-dow { background: #FAFAFB; font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-align: center; padding: 5px; border-bottom: 1px solid var(--color-border); }
.lh-dow.sun { color: var(--color-red); }
.lh-c { min-height: 62px; border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); padding: 3px 4px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lh-c:nth-child(7n) { border-right: none; }
.lh-c.out { background: #FAFAFB; }
.lh-c.sun .lh-dn { color: var(--color-red); }
.lh-c.tod { box-shadow: inset 0 0 0 2px var(--color-blue); }
.lh-dn { font-size: 11.5px; font-weight: 700; }
.lh-hol { font-size: 10px; color: var(--color-red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-ch { display: block; font-size: 10.5px; font-weight: 700; color: #FFFFFF; border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-ch.half, .lh-mg i.half { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0) 0 5px, rgba(255, 255, 255, 0.3) 5px 8px); }
.lh-more { font-size: 10.5px; color: var(--color-blue); font-weight: 700; }
.lh-year { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.lh-mm { border: 1.5px solid var(--color-border); border-radius: 12px; padding: 7px; background: #FFFFFF; font-family: inherit; text-align: left; cursor: pointer; min-width: 0; }
.lh-mm.on { border-color: var(--color-blue); box-shadow: 0 0 0 2px #E8F0FC; }
.lh-mm-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 4px; color: var(--color-text); }
.lh-mm-h em { font-style: normal; font-weight: 400; color: var(--color-text-muted); font-size: 11px; }
.lh-mg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.lh-mg i { aspect-ratio: 1; border-radius: 3px; background: #F1F2F4; display: block; }
.lh-mg i.x { background: transparent; }
.lh-mg i.tod { box-shadow: inset 0 0 0 1.5px var(--color-blue); }
.lh-listhead { display: flex; align-items: center; margin: 12px 0 2px; gap: 8px; }
.lh-listhead b { font-size: 13.5px; }
.lh-alllist, .lh-back { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-blue); background: none; border: none; cursor: pointer; padding: 6px 0; }
.lh-back { margin-left: 0; }
.lh-li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #F0F1F3; font-size: 13px; }
.lh-li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lh-li span { min-width: 0; }
.lh-li small { color: var(--color-text-muted); font-size: 11.5px; }
.lh-li em { margin-left: auto; font-style: normal; color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.lh-li.cx b, .lh-li.cx em { text-decoration: line-through; color: var(--color-text-muted); }
.lh-empty { font-size: 12.5px; color: var(--color-text-muted); padding: 8px 0; }
@media (max-width: 640px) {
  .lrc-grid { grid-template-columns: 1fr 1fr; }
  .lh-grid { border: none; gap: 3px; }
  .lh-dow { background: none; border: none; padding: 2px; }
  .lh-c { min-height: 0; aspect-ratio: 1 / 1.05; border: none; border-radius: 9px; background: #F7F8FA; align-items: center; justify-content: flex-start; padding-top: 4px; }
  .lh-c.out { background: transparent; }
  .lh-c[style*="--c"] { background: var(--c); }
  .lh-c[style*="--c"] .lh-dn { color: #FFFFFF; }
  .lh-dn { font-size: 12.5px; }
  .lh-ch, .lh-hol, .lh-more { display: none; }
  .lh-year { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lh-seg { margin-left: auto; }
  .lh-li { flex-wrap: wrap; }
  .lh-li em { margin-left: 18px; width: calc(100% - 18px); }
}

/* ================= แดชบอร์ดแอดมิน v2 (2026-09-28, app.js: renderAdminShell / loadDashboardStats) ================= */
:root { --db-green: #1E8E3E; --db-gold: #E0A21B; --db-pur: #7B3FA0; }
.c-green { color: #1E8E3E; } .c-red { color: var(--color-red); } .c-blue { color: var(--color-blue); } .c-pur { color: #7B3FA0; } .c-gold { color: #B26A00; }
.db-hero-card { padding: 16px 20px; }
.db-hero { display: flex; align-items: center; gap: 22px; }
.db-hero-n { display: flex; flex-direction: column; }
.db-big { font-size: 42px; font-weight: 900; line-height: 1; }
.db-unit { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; white-space: nowrap; }
.db-hero-bar { flex: 1; min-width: 0; }
.db-stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; background: #EEF0F2; margin-bottom: 8px; }
.db-stack i { display: block; min-width: 3px; }
.db-keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.db-keys span { display: flex; align-items: center; gap: 5px; }
.db-keys i { width: 9px; height: 9px; border-radius: 3px; }
.db-delta { font-size: 12px; color: var(--color-text-muted); text-align: right; white-space: nowrap; line-height: 1.5; }
.db-delta b { font-size: 15px; }
.db-mini-card { padding: 14px 16px; }
.db-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.db-minis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.db-mini { position: relative; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 8px 10px; background: #FFFFFF; cursor: pointer; min-width: 0; }
.db-mini:hover { background: #FAFBFC; }
.db-mini.db-todo { border-top-width: 4px; }
.db-mini.db-todo.c-blue { border-top-color: var(--color-blue); } .db-mini.db-todo.c-red { border-top-color: var(--color-red); }
.db-mini.db-todo.c-gold { border-top-color: #E0A21B; } .db-mini.db-todo.c-pur { border-top-color: #7B3FA0; }
.db-mt { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.db-mt b { font-size: 22px; font-weight: 900; line-height: 1.15; }
.db-mt span { font-size: 14px; }
.db-mini small { display: block; font-size: 11px; line-height: 1.35; color: var(--color-text-muted); margin-top: 2px; }
.db-mini.is-zero { opacity: 0.5; }
.db-mini[aria-expanded="true"] { border-color: var(--color-blue); box-shadow: 0 0 0 2px #DCE7FA; opacity: 1; }
.db-mini[aria-expanded="true"]::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 12px; height: 12px; background: #FFFFFF; border-right: 1.5px solid var(--color-blue); border-bottom: 1.5px solid var(--color-blue); transform: translateX(-50%) rotate(45deg); }
#statDetailBox:empty { display: none; }
.db-mini-card #statDetailBox { margin-top: 12px; }
.db-mini-card #statDetailBox > .card { margin: 0; box-shadow: none; border: 1.5px solid var(--color-blue); border-radius: 14px; background: #FBFCFF; padding: 12px 14px; }
.db-muted { font-size: 13px; color: var(--color-text-muted); margin: 4px 0; }
.db-tr { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid #F0F1F3; }
.db-tr:last-child { border-bottom: none; }
.db-tr span { min-width: 0; }
.db-tr small { color: var(--color-text-muted); }
.db-tr em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.db-tools { padding: 10px 16px; }
.db-tools-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text-muted); }
.db-tools-row b { color: var(--color-text); }
.db-tools-row button { margin-left: auto; width: auto; min-height: 38px; padding: 6px 14px; font-size: 12.5px; }
@media (max-width: 760px) {
  .db-hero { flex-wrap: wrap; gap: 10px 16px; }
  .db-hero-bar { order: 3; flex-basis: 100%; }
  .db-delta { text-align: left; }
  .db-big { font-size: 36px; }
  .db-mini-card { padding: 12px; }
  .db-groups { display: none; }
  .db-minis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .db-mini { padding: 7px; }
  .db-mt b { font-size: 19px; }
  .db-mt span { font-size: 12px; }
  .db-mini small { font-size: 10px; }
  .db-tr { flex-wrap: wrap; }
  .db-tr em { margin-left: 0; width: 100%; }
  .db-tools-row small { display: none; }
}

/* ================= สรุปเงินเดือน + รายงาน แบบการ์ดเดียว (2026-09-28, app.js: renderPayrollPage / renderReportsPage) ================= */
.pr-card, .rp-fcard { padding: 20px 22px; }
.pr-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.pr-lbl, .rp-lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 7px; }
.rp-lbl span { font-weight: 400; font-size: 11.5px; }
.pr-sublbl { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 5px; }
.pr-seg { display: inline-flex; flex-wrap: wrap; background: var(--color-bg); border-radius: 12px; padding: 3px; gap: 3px; max-width: 100%; }
.pr-seg button { font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 9px; padding: 7px 14px; min-height: 40px; cursor: pointer; line-height: 1.25; }
.pr-seg button small { display: block; font-size: 10.5px; font-weight: 500; }
.pr-seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.pr-body { margin-top: 10px; }
.pr-step { display: flex; align-items: center; gap: 8px; }
.pr-nb { width: 42px; height: 48px; flex: none; border-radius: 12px; border: 1.5px solid var(--color-border); background: #FFFFFF; font-size: 20px; font-weight: 900; color: var(--color-text-muted); cursor: pointer; }
.pr-nb:hover { color: var(--color-blue); border-color: var(--color-blue); }
.pr-per { flex: 1; text-align: center; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 5px 8px; background: #FFFFFF; min-width: 0; }
.pr-per b { display: block; font-size: 17px; font-weight: 900; }
.pr-per small { display: block; font-size: 12px; color: var(--color-text-muted); }
.pr-dr { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-dr > div { flex: 1; min-width: 150px; }
.pr-note { font-size: 12.5px; color: var(--color-text-muted); margin: 4px 0; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.pr-chip { font-family: inherit; font-size: 12px; font-weight: 700; border: none; border-radius: 999px; padding: 4px 10px; background: #E8F0FC; color: var(--color-blue); cursor: pointer; }
.pr-chip-clear { font-family: inherit; font-size: 12px; font-weight: 700; border: none; background: none; color: var(--color-red); cursor: pointer; padding: 4px 6px; }
.pr-brsearch { width: 100%; margin-bottom: 6px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-family: inherit; font-size: 14px; }
.pr-brlist { max-height: 210px; overflow-y: auto; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 4px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); column-gap: 10px; }
.pr-br { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: 13px; cursor: pointer; min-width: 0; }
.pr-br input { width: 18px; height: 18px; flex: none; }
.pr-br span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-go, .rp-go { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--color-border); margin-top: 16px; padding-top: 14px; }
.pr-sum, .rp-sum { font-size: 13px; color: var(--color-text-muted); flex: 1; min-width: 0; }
.pr-sum b, .rp-sum b { color: var(--color-text); }
.rp-sum small { font-size: 11.5px; }
.pr-go .btn-primary, .rp-go .btn-primary { width: auto; margin: 0; padding-left: 28px; padding-right: 28px; white-space: nowrap; }
.rp-types-card { padding: 14px; }
.rp-types { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.rp-type { position: relative; font-family: inherit; border: 1.5px solid var(--color-border); border-radius: 14px; padding: 9px 6px; background: #FFFFFF; color: var(--color-text); text-align: center; cursor: pointer; min-width: 0; }
.rp-type:hover { border-color: #C9CCD1; }
.rp-ti { display: block; font-size: 19px; line-height: 1.2; }
.rp-type b { display: block; font-size: 12px; margin-top: 3px; line-height: 1.3; }
.rp-type small { display: block; font-size: 10.5px; color: var(--color-text-muted); line-height: 1.3; }
.rp-type[aria-pressed="true"] { background: #1B1C1E; border-color: #1B1C1E; color: #FFFFFF; }
.rp-type[aria-pressed="true"] small { color: #C9CCD1; }
.lal-badge.on-type { position: absolute; top: -7px; right: -5px; margin: 0; }
.rp-frow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.rp-emp { flex: 2; min-width: 280px; display: flex; gap: 12px; flex-wrap: wrap; }
.rp-emp > div { flex: 1; min-width: 150px; }
.rp-dates { flex: 1.3; min-width: 290px; }
.rp-pres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-pres button { font-family: inherit; font-size: 12px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 4px 12px; background: #FFFFFF; color: var(--color-text-muted); cursor: pointer; }
.rp-pres button.on { border-color: var(--color-blue); color: var(--color-blue); background: #E8F0FC; }
.rp-dr { display: flex; align-items: center; gap: 6px; }
.rp-dr > div { flex: 1; min-width: 0; }
.rp-dr > span { color: var(--color-text-muted); }
.rp-lr { border-top: 1px solid var(--color-border); margin-top: 16px; padding-top: 8px; }
@media (max-width: 760px) {
  .pr-card, .rp-fcard { padding: 16px; }
  .pr-grid { grid-template-columns: 1fr; gap: 18px; }
  .pr-seg { display: flex; }
  .pr-seg button { flex: 1; padding: 7px 4px; font-size: 12px; }
  .pr-go, .rp-go { flex-direction: column; align-items: stretch; }
  .pr-go .btn-primary, .rp-go .btn-primary { width: 100%; }
  .rp-types-card { padding: 10px; }
  .rp-types { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .rp-type { padding: 7px 3px; }
  .rp-type small { display: none; }
  .rp-type b { font-size: 10.5px; }
  .rp-dates { order: -1; min-width: 0; flex-basis: 100%; }
  .rp-emp { min-width: 0; flex-basis: 100%; }
}
.rp-dr .thcal-trigger-label { white-space: nowrap; }
@media (max-width: 760px) { .rp-dr .thcal-trigger { padding: 10px 12px !important; font-size: 14px !important; } }

/* ================= KPI เกณฑ์ใหม่ (ทดลอง) (2026-09-28, app.js: lrNewKpi / lrGradeBadge) ================= */
.lr-kmode { display: inline-flex; background: var(--color-bg); border-radius: 10px; padding: 3px; gap: 3px; flex: none; }
.lr-kmode button { font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 8px; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.lr-kmode button[aria-pressed="true"] { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.lr-kmode button[data-k="new"][aria-pressed="true"] { color: var(--color-blue); }
.lr-gcell { white-space: nowrap; }
.lr-k2flag { color: var(--color-red); font-size: 12px; margin-left: 3px; vertical-align: 1px; }
.lr-was { display: block; font-size: 10px; color: var(--color-text-muted); line-height: 1.2; margin-top: 1px; }

/* ================= คะแนนวินัยการลา v3: การ์ดบนสุด · สรุปย่อ · ใบสรุป/หลักเกณฑ์ A4 (2026-09-28, app.js: lrK3*) ================= */
.lr-kcard { border: 2px solid #DCE7FA; padding: 16px 18px; }
.lr-kh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lr-kh h2 { font-size: 16px; margin: 0; }
.lr-kacts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.lr-kacts button { width: auto; margin: 0; min-height: 38px; padding: 6px 14px; font-size: 12.5px; }
.lr-kcard .lr-gbar { margin-top: 12px; height: 34px; }
.lr-knote { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--color-text-muted); margin-top: 8px; }
.lr-knote b { color: var(--color-text); }
.lr-kwatch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.lr-kwatch > div { background: var(--color-bg); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 0; }
.lr-kwatch small { font-size: 11.5px; color: var(--color-text-muted); }
.lr-kwatch b { font-size: 18px; font-weight: 900; }
.lr-kwatch .lr-k-click { cursor: pointer; }
.lr-kwatch .lr-k-click.sel { box-shadow: inset 0 0 0 2px var(--color-red); }
.lr-k3btn { cursor: pointer; }
.lr-k3btn:hover, .lr-k3btn:focus-visible { outline: 2px solid var(--color-blue); outline-offset: 2px; }
.k3-pop { position: fixed; z-index: 1100; width: 300px; max-width: calc(100vw - 16px); background: #FFFFFF; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25); padding: 12px 14px; font-size: 12.5px; }
.k3-pop-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.k3-pop-h b { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k3-pop-h em { margin-left: auto; font-style: normal; font-weight: 900; white-space: nowrap; }
.k3-pop-r { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #EEF0F2; }
.k3-pop-r b { color: var(--color-red); white-space: nowrap; }
.k3-pop-ok { color: #1E8E3E; margin: 4px 0; }
.k3-pop-note { font-size: 11.5px; color: var(--color-text-muted); margin: 6px 0 0; }
.k3-pop-flag { font-size: 11.5px; color: var(--color-red); margin: 6px 0 0; }
.k3-pop-b { display: flex; gap: 6px; margin-top: 10px; }
.k3-pop-b button { flex: 1; width: auto; margin: 0; min-height: 36px; padding: 6px 8px; font-size: 12px; }
.lr-sheet.k3-sheet { width: 210mm; min-height: 297mm; padding: 12mm 14mm; margin-bottom: 18px; font-size: 12.5px; line-height: 1.55; }
.k3-hd { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1B1C1E; padding-bottom: 10px; margin-bottom: 12px; gap: 12px; }
.k3-brand { display: flex; gap: 10px; align-items: center; }
.k3-logo { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, #D6362B, #1259C3); color: #FFFFFF; font-weight: 900; display: grid; place-items: center; font-size: 13px; flex: none; }
.k3-brand b { display: block; font-size: 16px; }
.k3-brand span { font-size: 12px; color: var(--color-text-muted); }
.k3-meta { text-align: right; font-size: 11px; color: var(--color-text-muted); }
.k3-meta b { color: var(--color-text); }
.k3-emp { display: grid; grid-template-columns: 1.3fr 0.9fr 1.3fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.k3-emp div { background: #F5F6F8; border-radius: 8px; padding: 6px 10px; }
.k3-emp span { display: block; font-size: 10.5px; color: var(--color-text-muted); }
.k3-emp b { font-size: 13px; }
.k3-score { display: flex; gap: 14px; align-items: stretch; }
.k3-big { border: 2px solid var(--g); border-radius: 12px; padding: 10px 16px; text-align: center; min-width: 140px; display: flex; flex-direction: column; justify-content: center; }
.k3-big .n { font-size: 40px; font-weight: 900; line-height: 1; }
.k3-big .g { display: inline-block; margin: 4px auto 0; background: var(--g); color: #FFFFFF; font-weight: 900; border-radius: 6px; padding: 1px 12px; font-size: 15px; }
.k3-big small { display: block; color: var(--color-text-muted); font-size: 10px; margin-top: 3px; }
.k3-sum { flex: 1; border-collapse: collapse; font-size: 12px; }
.k3-sum td { padding: 4px 8px; border-bottom: 1px solid #EDEEF1; }
.k3-sum tr.z td { color: var(--color-text-muted); }
.k3-sum tr.tot td { border-top: 2px solid #1B1C1E; border-bottom: none; font-weight: 900; }
.k3-sheet td.p, .k3-sheet th.p { text-align: right; white-space: nowrap; }
.k3-sheet td.p { font-weight: 700; color: #C8352B; }
.k3-sheet tr.z td.p, .k3-sheet td.p.z { color: var(--color-text-muted); font-weight: 400; }
.k3-h { font-size: 13.5px; margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.k3-h i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #1B1C1E; color: #FFFFFF; display: grid; place-items: center; font-size: 11.5px; flex: none; }
.k3-lg { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.k3-lg th { background: #F5F6F8; text-align: left; padding: 6px 7px; font-size: 10.5px; color: var(--color-text-muted); border-bottom: 1px solid #DADDE2; }
.k3-lg td { padding: 6px 7px; border-bottom: 1px solid #EDEEF1; vertical-align: top; }
.k3-empty { text-align: center; color: var(--color-text-muted); padding: 14px !important; }
.k3-tag { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 5px; margin: 1px 3px 1px 0; background: #FDECEA; color: #C8352B; }
.k3-tag.ok { background: #E7F4EA; color: #1E8E3E; }
.k3-tag.none { background: #F1F2F4; color: var(--color-text-muted); font-weight: 400; }
.k3-note { font-size: 10.5px; color: var(--color-text-muted); margin: 6px 0 0; }
.k3-p { margin: 0 0 6px; }
.k3-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 11px; background: #F5F6F8; border-radius: 8px; padding: 9px 12px; }
.k3-rules div { display: flex; justify-content: space-between; gap: 8px; }
.k3-rules b { color: #C8352B; white-space: nowrap; }
.k3-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 24px; font-size: 11.5px; text-align: center; line-height: 1.9; page-break-inside: avoid; }
.k3-sign span { display: block; color: var(--color-text-muted); font-size: 10.5px; }
.k3-prin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.k3-prin div { background: #F5F6F8; border-radius: 10px; padding: 9px 12px; }
.k3-prin b { display: block; font-size: 13px; }
.k3-prin span { font-size: 11.5px; color: var(--color-text-muted); }
.k3-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.k3-box { border: 1.5px solid #DADDE2; border-radius: 10px; padding: 9px 12px; font-size: 11.5px; }
.k3-box.ok { border-color: #BFE3C9; background: #F3FAF5; }
.k3-box ul { margin: 4px 0 0; padding-left: 18px; }
.k3-grades { display: flex; gap: 8px; }
.k3-grades div { flex: 1; border-radius: 8px; padding: 6px; text-align: center; font-size: 11px; color: #FFFFFF; }
.k3-grades b { display: block; font-size: 16px; }
.k3-faq b { display: block; font-size: 12.5px; }
.k3-faq p { margin: 0 0 8px; }
.k3-foot { margin-top: 14px; border-top: 1px solid #DADDE2; padding-top: 8px; font-size: 10.5px; color: var(--color-text-muted); }
@media print {
  body.lr-printing .lr-sheet.k3-sheet { width: auto; min-height: 0; padding: 0; margin: 0; page-break-after: always; break-after: page; }
  body.lr-printing .lr-sheet.k3-sheet:last-child { page-break-after: auto; break-after: auto; }
}
@media (max-width: 760px) {
  .lr-kacts { margin-left: 0; width: 100%; }
  .lr-kacts button { flex: 1; }
  .lr-kwatch { gap: 6px; }
  .lr-kwatch > div { padding: 7px 8px; }
  .lr-kwatch b { font-size: 15px; }
  .lr-kwatch small:last-child { display: none; }
  .lr-sheet.k3-sheet { width: 100%; min-height: 0; padding: 16px; }
  .k3-emp, .k3-prin, .k3-two, .k3-rules { grid-template-columns: 1fr 1fr; }
  .k3-score { flex-direction: column; }
}

/* คะแนนวินัยการลา: บอกขอบเขต (ลาป่วยเท่านั้น) + ใบสรุปส่วนการใช้สิทธิ์ลาอื่น (2026-09-28) */
.lr-kscope { margin: 10px 0 0; font-size: 12px; color: var(--color-text-muted); background: var(--color-bg); border-radius: 10px; padding: 7px 12px; }
.lr-kscope b { color: var(--color-text); }
.k3-h small { font-size: 10.5px; font-weight: 400; color: var(--color-text-muted); }
.k3-other { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.k3-other div { background: #F5F6F8; border-radius: 8px; padding: 5px 9px; display: flex; flex-direction: column; min-width: 0; }
.k3-other span { font-size: 10.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k3-other b { font-size: 12.5px; }
.k3-other small { font-size: 10px; color: var(--color-text-muted); }
@media (max-width: 760px) { .k3-other { grid-template-columns: 1fr 1fr; } }

/* ใบสรุปคะแนน หน้า 2 (2026-09-28, app.js: lrK3Page2Html) */
.k3-hd2 { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid #1B1C1E; padding-bottom: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.k3-hd2 b { font-size: 14px; }
.k3-hd2 span { font-size: 12px; color: var(--color-text-muted); }
.k3-hd2 em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--color-text-muted); }
.k3-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.k3-facts div { background: #F5F6F8; border-radius: 8px; padding: 5px 9px; }
.k3-facts span { display: block; font-size: 10.5px; color: var(--color-text-muted); }
.k3-facts b { font-size: 13px; }
.k3-other div.hl { background: #FDECEA; }
.k3-tag.warn { background: #FFF3D6; color: #8B6B14; }
.k3-sub { font-size: 10.5px; color: var(--color-text-muted); font-weight: 400; }
@media (max-width: 760px) { .k3-facts { grid-template-columns: 1fr 1fr; } }

/* เอกสารหลักเกณฑ์ฉบับเต็ม 3 หน้า (2026-09-28, app.js: lrK3RulesPages) */
.k3-kv th { width: 24%; background: #F5F6F8; color: var(--color-text); font-size: 11.5px; font-weight: 700; border-bottom: 1px solid #EDEEF1; }
.k3-grades-m small { display: block; font-size: 10px; opacity: 0.9; margin-top: 1px; }
.k3-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.k3-steps div { border: 1.5px solid #DADDE2; border-radius: 8px; padding: 5px 8px; text-align: center; }
.k3-steps b { display: block; font-size: 12px; }
.k3-steps span { font-size: 10.5px; color: var(--color-text-muted); }
.k3-ul { margin: 0; padding-left: 20px; font-size: 12px; }
.k3-ul li { margin-bottom: 3px; }
.k3-gc { display: inline-block; width: 24px; height: 24px; border-radius: 6px; color: #FFFFFF; font-weight: 900; text-align: center; line-height: 24px; }
.k3-sign3 { margin-top: 30px; }
.k3-approve { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 16px; font-size: 12px; }
@media (max-width: 760px) { .k3-steps { grid-template-columns: 1fr 1fr; } }

/* ข้อ ⑦ ⑧ ลารายชั่วโมง/ไม่รับเงินเดือน — ป้ายประเภทที่คิดคะแนนในหน้า 2 (2026-09-28) */
.k3-other div.hl span { color: #C8352B; }

/* ปฏิทินการลา: วงกลมตามประเภท + จำนวนคน แทนชื่อในช่องวัน · กล่องรายชื่อตอนชี้เมาส์ (2026-09-29, app.js: lcDraw / lcShowTip) */
.lc-balls { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.lc-ball { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #FFFFFF; font-size: 12px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.lc-ball.half { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0) 0 4px, rgba(255, 255, 255, 0.3) 4px 7px); }
.lc-total { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; font-weight: 700; }
.lc-tip { position: fixed; z-index: 1200; width: 280px; max-width: calc(100vw - 16px); background: #FFFFFF; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22); padding: 10px 12px; font-size: 12px; pointer-events: none; }
.lc-tip[hidden] { display: none; }
.lc-tip-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.lc-tip-h b { font-size: 13px; }
.lc-tip-h span { color: var(--color-text-muted); font-weight: 700; }
.lc-tip-g { display: flex; gap: 8px; padding: 5px 0; border-top: 1px solid #F0F1F3; }
.lc-tip-g i { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 4px; }
.lc-tip-g b { display: block; font-size: 12px; }
.lc-tip-g small { color: var(--color-text-muted); font-size: 11.5px; line-height: 1.5; }
.lc-tip-f { margin: 6px 0 0; font-size: 11px; color: var(--color-blue); font-weight: 700; }
/* ความสูงช่องสำหรับวงกลม — เฉพาะจอคอม (มือถือใช้ช่องสี่เหลี่ยมจัตุรัส aspect-ratio ใน @media 640px ด้านบน
   ถ้าตั้ง min-height ตรงนี้ทุกจอ มือถือจะถูกบังคับกว้างตาม aspect-ratio จนตารางล้นขอบ — บั๊ก 2026-09-29) */
@media (min-width: 641px) { .lc-cell { min-height: 92px; } }
@media (max-width: 640px) { .lc-balls, .lc-total { display: none; } }

/* ================= คีย์ต่อเนื่อง แบบการ์ดแนวตั้ง (2026-09-29, app.js: renderHybridEntryList) ================= */
.qe-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.qe-list .qe-row { display: block; grid-template-columns: none; grid-template-areas: none; padding: 0; margin: 0; border: 1.5px solid var(--color-border); border-radius: 16px; background: #FFFFFF; overflow: hidden; }
.qe-list .qe-row:focus-within { border-color: var(--color-blue); box-shadow: 0 0 0 3px #DCE7FA; }
.qe-list .qe-row.is-closed { cursor: default; }
.qe-ch { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; min-width: 0; }
.qe-row.is-closed .qe-ch { padding-bottom: 8px; }
.qe-ch .qe-no { width: 24px; height: 24px; border-radius: 50%; background: #1B1C1E; color: #FFFFFF; font-size: 12px; font-weight: 900; display: grid; place-items: center; flex: none; text-align: center; }
.qe-row:focus-within .qe-ch .qe-no { background: var(--color-blue); }
.qe-ch b { font-size: 14px; white-space: nowrap; }
.qe-ch small { color: var(--color-text-muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-ch small i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 1px; }
.qe-muted { color: var(--color-text-muted); }
.qe-open { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-blue); background: none; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.qe-ch .qe-del { margin-left: auto; height: 28px; font-size: 14px; font-weight: 700; }
.qe-open + .qe-del { margin-left: 0; }
.qe-body { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px 12px; padding: 10px 14px 12px; }
.qe-f { min-width: 0; }
.qe-f > label { display: block; font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 4px; }
.qe-full { grid-column: 1 / -1; }
.qe-body .qe-in { height: 40px; min-height: 40px; font-size: 13.5px; }
.qe-types { display: flex; flex-wrap: wrap; gap: 6px; }
.qe-ty { font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); background: #FFFFFF; color: var(--color-text); border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.qe-ty i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.qe-ty.on { background: var(--c); border-color: var(--c); color: #FFFFFF; }
.qe-ty.on i { background: #FFFFFF; }
.qe-seg { display: flex; background: var(--color-bg); border-radius: 10px; padding: 3px; gap: 3px; }
.qe-seg button { flex: 1; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); background: none; border: none; border-radius: 8px; padding: 7px 4px; cursor: pointer; white-space: nowrap; }
.qe-seg button.on { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.qe-multi { margin-top: 6px; }
.qe-multi .qe-in { width: 80px; }
.qe-body .qe-date .thcal-trigger { min-height: 40px !important; padding: 8px 12px !important; font-size: 13.5px !important; }
.qe-body .qe-notecell { display: flex; gap: 10px; align-items: center; }
.qe-body .qe-notecell .qe-note { flex: 1; }
.qe-status { padding: 8px 14px; font-size: 12.5px; line-height: 1.5; }
.qe-status .qe-check { font-size: 12.5px; }
.qe-status.ok { background: #EAF6EE; color: #1E8E3E; }
.qe-status.warn { background: #FFF6DE; color: #8B6B14; }
.qe-status.bad { background: #FDECEA; color: var(--color-red); font-weight: 700; }
.qe-status.wait { background: var(--color-bg); color: var(--color-text-muted); }
.qe-list + .qe-foot { max-width: 780px; margin: 12px auto 0; border: 1.5px solid var(--color-border); border-radius: 16px; padding: 10px 12px; background: #FFFFFF; }
.qe-sum { flex: 1; font-size: 12.5px; color: var(--color-text-muted); min-width: 0; }
.qe-sum b { color: var(--color-text); }
@media (max-width: 640px) {
  .qe-body { grid-template-columns: 1fr; }
  .qe-list + .qe-foot { flex-wrap: wrap; }
  .qe-list + .qe-foot .qe-sum { flex-basis: 100%; }
  .qe-list + .qe-foot button { flex: 1; }
}

/* ข้อยกเว้นรายกรณีในใบสรุป + ใบแพทย์ 3 สถานะในคีย์ต่อเนื่อง (2026-09-29) */
.k3-exbtn { display: inline-block; margin-left: 4px; font-family: inherit; font-size: 10.5px; font-weight: 700; color: var(--color-blue); background: #FFFFFF; border: 1px solid var(--color-border); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.k3-exform { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.k3-exform input { flex: 1; min-width: 0; border: 1.5px solid var(--color-blue); border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 12.5px; }
.k3-exform button { width: auto; margin: 0; min-height: 32px; padding: 4px 12px; font-size: 12px; }
@media print { body.lr-printing .k3-noprint { display: none !important; } }
.qe-certseg { flex: none; }
.qe-certseg button { padding: 7px 10px; }
@media (max-width: 640px) { .qe-body .qe-notecell { flex-wrap: wrap; } .qe-certseg { width: 100%; } }

/* ===== (2026-09-29) Payroll Prep — หน้าเตรียมรายชื่อส่งบัญชี (คลาส prp-* แยกจาก pr-* ของการ์ดเลือกรอบ) ===== */
.prp-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.prp-title h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.3px; }
.prp-title h1 i, .prp-brand b i { font-style: normal; background: linear-gradient(90deg, var(--color-red), var(--color-blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prp-title span { font-size: 13px; color: var(--color-text-muted); }
.pr-go .prp-reload { width: auto; margin: 0; min-height: 40px; padding: 8px 18px; font-size: 13px; white-space: nowrap; }
#pr_resultBox { transition: opacity 0.15s; }
#pr_resultBox > .card { margin-bottom: 12px; }
.prp-checkh { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); margin: 0 0 8px; }
.prp-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.prp-ck { display: flex; gap: 8px; align-items: center; border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.prp-ck.bad { background: #FDECEA; color: var(--color-red-dark); }
.prp-ck.warn { background: #FFF6DE; color: #8B6B14; }
.prp-ck.ok { background: #EAF6EE; color: #1E7A3A; }
.prp-ckgo { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 700; border: none; background: none; color: inherit; cursor: pointer; white-space: nowrap; }
.prp-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.prp-tile { border: 1.5px solid var(--color-border); border-radius: 14px; padding: 9px 12px; background: #FFFFFF; min-width: 0; }
.prp-tile b { display: block; font-size: 22px; font-weight: 900; line-height: 1.15; }
.prp-tile small { display: block; font-size: 11.5px; color: var(--color-text-muted); line-height: 1.35; }
.prp-tile span { display: block; font-size: 11px; font-weight: 700; color: var(--color-text-muted); margin-top: 2px; }
.prp-tile.big { border-color: #C9D9F5; background: #F5F8FF; }
.prp-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.prp-filter > span { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.prp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.prp-chip { font-family: inherit; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 5px 12px; background: #FFFFFF; color: var(--color-text); cursor: pointer; }
.prp-chip i { font-style: normal; color: var(--color-red); margin-left: 4px; }
.prp-chip.on { background: var(--color-text); border-color: var(--color-text); color: #FFFFFF; }
.prp-chip.on i { color: #FFB3AD; }
.prp-chip:disabled { opacity: 0.4; cursor: default; }
.prp-table { table-layout: fixed; width: 100%; }
.prp-table thead th { background: #0F3F99; color: #FFFFFF; font-size: 12px; line-height: 1.3; }
.prp-table th.n, .prp-table td.n { text-align: right; white-space: nowrap; }
.prp-table tr.branch-row td { background: #E8F0FC; color: var(--color-blue); font-weight: 900; font-size: 12.5px; }
.prp-table tr.zebra td { background: #FAFAFB; }
.prp-table td { vertical-align: top; font-size: 13px; }
.prp-nm small { display: block; font-size: 11px; color: var(--color-text-muted); }
.prp-table td.prp-hl { background: #FFF6DE !important; font-weight: 900; }
.prp-table td.prp-warn { color: #8B6B14; font-weight: 700; }
.prp-z { color: #B8BCC2; }
.prp-note { font-size: 12.5px; color: #3B3F45; line-height: 1.5; }
.prp-note em { font-style: normal; font-weight: 700; color: var(--color-text); }
.prp-st { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.prp-st.s-rs { background: #FDECEA; color: var(--color-red-dark); }
.prp-st.s-nw { background: #E7F4EA; color: #1E7A3A; }
.prp-st.s-mt { background: #F0E6F7; color: #7B3FA0; }
.prp-st.s-pb { background: #FFF3D6; color: #8B6B14; }
.prp-st.s-pr { background: #FFF1E6; color: #B4540A; }
.prp-legend { font-size: 11.5px; color: var(--color-text-muted); margin: 8px 0 0; line-height: 1.6; }
.prp-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prp-bar .prp-barsum { flex: 1; min-width: 200px; font-size: 13px; color: var(--color-text-muted); }
.prp-bar .prp-barsum b { color: var(--color-text); }
.prp-bar button { width: auto; margin: 0; min-height: 42px; padding: 8px 18px; font-size: 13px; white-space: nowrap; }
/* หัวกระดาษตอนพิมพ์ */
.prp-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border-bottom: 2px solid #1B1C1E; padding-bottom: 8px; margin-bottom: 8px; }
.prp-brand { display: flex; gap: 9px; align-items: center; }
.prp-logo { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--color-red), var(--color-blue)); color: #FFFFFF; font-weight: 900; display: grid; place-items: center; font-size: 12px; flex: none; }
.prp-brand b { display: block; font-size: 15px; line-height: 1.25; }
.prp-brand span { font-size: 11px; color: var(--color-text-muted); }
.prp-meta { text-align: right; font-size: 10px; color: var(--color-text-muted); line-height: 1.6; }
.prp-meta b { color: var(--color-text); }
.prp-round { display: flex; gap: 6px; margin-bottom: 8px; }
.prp-round div { flex: 1; background: #F5F6F8; border-radius: 8px; padding: 4px 9px; }
.prp-round span { display: block; font-size: 9px; color: var(--color-text-muted); }
.prp-round b { font-size: 11px; }
.prp-sign { display: none; }
@media (max-width: 900px) {
  .prp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .prp-title h1 { font-size: 22px; }
  .prp-checklist { grid-template-columns: 1fr; }
  .prp-tiles { grid-template-columns: 1fr 1fr; }
  .prp-tile.big { grid-column: 1 / -1; }
  .prp-filter { flex-wrap: nowrap; overflow-x: auto; }
  .prp-chips { flex-wrap: nowrap; }
  .prp-chip { white-space: nowrap; }
  .prp-bar button { flex: 1; padding: 8px 6px; }
  .prp-bar .prp-barsum { flex-basis: 100%; }
}
@media print {
  #pr_resultBox { opacity: 1 !important; }
  #pr_resultBox > .card { border: none !important; padding: 0 !important; margin: 0 0 8px !important; }
  .prp-tiles { gap: 6px; grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .prp-tile.big { grid-column: auto !important; }
  .prp-hd { padding-right: 2px; }
  .prp-tile { padding: 5px 8px; border-radius: 9px; }
  .prp-tile b { font-size: 16px; }
  .prp-tile small, .prp-tile span { font-size: 8.5px; }
  .prp-tile, .prp-tile.big, .prp-round div, .prp-logo, .prp-st, .prp-table thead th, .prp-table tr.branch-row td, .prp-table td.prp-hl, .prp-table tr.zebra td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  table.prp-table { font-size: 9px; }
  .prp-table th, .prp-table td { border: none !important; border-bottom: 1px solid #E6E8EC !important; padding: 3px 5px !important; font-size: 9px; }
  .prp-table thead th { background: #0F3F99 !important; color: #FFFFFF !important; font-size: 8.8px; }
  .prp-table tr.branch-row td { background: #E8F0FC !important; border-top: none !important; font-size: 9px; }
  .prp-note { font-size: 8.8px; line-height: 1.4; }
  .prp-nm small { font-size: 7.5px; }
  .prp-st { font-size: 8px; padding: 0 6px; }
  p.prp-legend { font-size: 8px !important; line-height: 1.5 !important; }
  .prp-sign { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: center; font-size: 10px; line-height: 1.9; margin-top: 34px; page-break-inside: avoid; }
  .prp-sign span { display: block; color: #62676F; font-size: 9px; }
}
.prp-rd b { display: block; font-size: 12.5px; white-space: nowrap; color: var(--color-red-dark); }
.prp-rd small { display: block; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
@media print { .prp-rd b { font-size: 9px; } .prp-rd small { font-size: 7.5px; } }
/* (2026-09-29 รอบ 2) Payroll Prep แบบกระชับ: แถวเดียว = ปุ่มรอบ · เลือกเดือน · ปุ่มส่งออก (ตัดขอบเขตสาขา/ตัวเลขสรุปบนจอ/แถบปุ่มล่างออก) */
.prp-top { padding: 14px 18px; margin-bottom: 12px; }
.prp-toprow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prp-range { flex: 1; min-width: 260px; }
.prp-range .pr-nb { height: 44px; }
.prp-range .pr-per { padding: 3px 8px; }
.prp-range .pr-per b { font-size: 15.5px; }
.prp-range .pr-dr > div { min-width: 140px; }
.prp-acts { display: flex; gap: 6px; align-items: center; }
.prp-acts button { width: auto; margin: 0; min-height: 42px; padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.prp-acts .prp-icon { padding: 8px 12px; font-size: 16px; }
#pr_checkBox .prp-checklist { margin-top: 12px; }
@media (max-width: 900px) {
  .prp-acts { width: 100%; }
  .prp-acts button { flex: 1; }
  .prp-acts .prp-icon { flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .prp-top { padding: 12px; }
  .prp-toprow .pr-seg { display: flex; width: 100%; }
  .prp-toprow .pr-seg button { flex: 1; padding: 7px 4px; font-size: 12px; }
  .prp-range { min-width: 0; width: 100%; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .prp-filter > span { display: none; }
  .mini-table[data-cards] td.prp-note { display: block; text-align: left; }
  .mini-table[data-cards] td.prp-note::before { display: block; margin-bottom: 2px; }
}

/* ===== (2026-09-29) แดชบอร์ด: การ์ดเล็ก 8 ใบ → วงแหวน (แบบ A ที่เลือกจากตัวอย่าง) — ใช้ markup เดิม (.db-mini > .db-mt > b + span, small)
   วง = .db-mt · ตัวเลขกลางวง · ไอคอนเป็นป้ายเล็กมุมขวาบน · ชื่อใต้วง · ค่า 0 จาง · วงที่เปิดรายละเอียดอยู่มีแสงรอบวง ===== */
.db-mini { --c: var(--color-blue); border: none !important; background: none !important; padding: 2px 2px 4px; display: flex; flex-direction: column; align-items: center; text-align: center; border-radius: 14px; }
.db-mini.c-blue { --c: var(--color-blue); } .db-mini.c-red { --c: var(--color-red); } .db-mini.c-gold { --c: #D9A21B; }
.db-mini.c-pur { --c: #7B3FA0; } .db-mini.c-green { --c: #1E8E3E; }
.db-mini:hover .db-mt { transform: translateY(-2px); }
.db-mt { position: relative; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; place-content: center; background: #FFFFFF; box-shadow: 0 0 0 4px var(--c) inset, 0 2px 8px rgba(0, 0, 0, 0.06); transition: transform 0.15s, box-shadow 0.15s; flex: none; }
.db-mt b { font-size: 23px; font-weight: 900; line-height: 1; color: var(--c); }
.db-mt span { position: absolute; right: -5px; top: -5px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; display: grid; place-items: center; font-size: 13px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16); }
.db-mini small { margin-top: 7px; font-size: 11.5px; }
.db-mini.is-zero { opacity: 0.45; }
.db-mini[aria-expanded="true"] { box-shadow: none; opacity: 1; }
.db-mini[aria-expanded="true"] .db-mt { box-shadow: 0 0 0 4px var(--c) inset, 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }
.db-mini[aria-expanded="true"]::after { bottom: -14px; border-color: var(--c); }
.db-mini:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.db-minis { gap: 6px; align-items: start; }
@media (max-width: 760px) {
  .db-minis { row-gap: 12px; }
  .db-mt { width: 58px; height: 58px; }
  .db-mt b { font-size: 19px; }
  .db-mt span { width: 22px; height: 22px; font-size: 11px; right: -4px; top: -4px; }
  .db-mini small { font-size: 10.5px; margin-top: 5px; }
}

/* ===== (2026-09-29) แจ้งเตือนอัพเดตข้อมูล แบบใหม่: กระดิ่งกลม · การ์ดประกาศสายตรวจ · ป๊อปอัพ (rm-*) ===== */
.rm-bell { position: relative; width: auto; padding: 10px 14px; font-size: 18px; line-height: 1; }
.rm-badge { position: absolute; top: -5px; right: -5px; font-style: normal; font-size: 10.5px; font-weight: 900; color: #FFFFFF; background: var(--color-red); border-radius: 999px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; border: 2px solid var(--color-bg); }
.rm-badge.ok { background: #1E8E3E; }
.rm-ann { display: flex; gap: 14px; align-items: center; background: #FFFFFF; border-radius: 20px; padding: 14px 16px; margin-bottom: 14px; border-left: 6px solid #D9A21B; box-shadow: var(--shadow-card); }
.rm-ann .rm-ic { width: 48px; height: 48px; border-radius: 14px; background: #FFF4D6; display: grid; place-items: center; font-size: 24px; flex: none; }
.rm-ann .rm-tx { flex: 1; min-width: 0; }
.rm-ann .rm-tx b { display: block; font-size: 14.5px; line-height: 1.45; }
.rm-ann .rm-tx small { display: block; font-size: 12.5px; color: var(--color-text-muted); }
.rm-cd { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.rm-cd span { white-space: nowrap; background: var(--color-bg); border-radius: 9px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.rm-ann .rm-cd span b { display: inline; font-size: 15px; color: #B97F00; }
.rm-ann.over { border-left-color: var(--color-red); }
.rm-ann.over .rm-ic { background: #FDECEA; }
.rm-ann.over .rm-cd span b { color: var(--color-red); }
.rm-ann.done { border-left-color: #1E8E3E; padding: 10px 16px; }
.rm-ann.done .rm-ic { background: #EAF6EE; width: 36px; height: 36px; font-size: 18px; border-radius: 11px; }
.rm-ann.done .rm-tx b { color: #1E8E3E; font-size: 13.5px; }
.rm-okbtn { font-family: inherit; border: none; border-radius: 999px; padding: 11px 18px; font-weight: 900; color: #FFFFFF; background: #1E8E3E; font-size: 13.5px; white-space: nowrap; cursor: pointer; min-height: 44px; }
.rm-okbtn:disabled { opacity: 0.6; }
.rm-okbtn.wide { width: 100%; margin-top: 12px; }
.rm-h { margin: 0 0 2px; font-size: 18px; }
.rm-sub { font-size: 12.5px; color: var(--color-text-muted); margin: 0 0 14px; }
.rm-empty { border: 1.5px dashed var(--color-border); border-radius: 14px; padding: 14px; text-align: center; font-size: 13px; color: var(--color-text-muted); }
.rm-now { border-radius: 16px; padding: 14px 16px; background: linear-gradient(135deg, #FFF8F0, #F4F8FF); border: 1.5px solid #F1DDC9; }
.rm-now.over { background: #FDF1F0; border-color: #F3C8C3; }
.rm-msg { font-size: 14.5px; font-weight: 700; white-space: pre-wrap; }
.rm-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rm-chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #FFFFFF; border: 1px solid var(--color-border); }
.rm-chip.r { background: #FDECEA; color: var(--color-red-dark); border-color: #F6C9C4; }
.rm-chip.b { background: #E8F0FC; color: var(--color-blue); border-color: #CFE0F8; }
.rm-prog { margin-top: 12px; }
.rm-plab { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.rm-plab b { font-size: 13px; }
.rm-bar { height: 10px; border-radius: 999px; background: #E8EAED; overflow: hidden; }
.rm-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1E8E3E, #4CB86A); border-radius: 999px; }
.rm-ppl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 150px; overflow-y: auto; }
.rm-pp { font-size: 12px; border-radius: 999px; padding: 4px 10px 4px 5px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.rm-pp i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; color: #FFFFFF; flex: none; }
.rm-pp.ok { background: #EAF6EE; color: #1E7A3A; } .rm-pp.ok i { background: #1E8E3E; }
.rm-pp.no { background: #F4F5F7; color: var(--color-text-muted); } .rm-pp.no i { background: #B8BCC2; }
.rm-done { margin-top: 12px; padding: 12px; border-radius: 12px; background: #EAF7EE; color: #1E7B34; font-weight: 700; font-size: 13px; text-align: center; }
.rm-mine { font-size: 11.5px; color: var(--color-text-muted); margin-top: 6px; text-align: center; }
.rm-sec { margin-top: 16px; border-top: 1px solid var(--color-border); padding-top: 14px; }
.rm-st { font-size: 14px; font-weight: 900; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rm-st small { font-weight: 400; color: var(--color-text-muted); font-size: 11.5px; }
.rm-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin: 12px 0 5px; }
.rm-inp { width: 100%; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 11px 12px; font-size: 14px; background: var(--color-bg); font-family: inherit; }
.rm-tpl { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rm-tpl button { font-family: inherit; font-size: 11.5px; border: 1px dashed #C9CDD3; border-radius: 999px; padding: 3px 10px; color: var(--color-text-muted); background: #FFFFFF; cursor: pointer; }
.rm-tpl button:hover { color: var(--color-blue); border-color: var(--color-blue); }
.rm-seg { display: inline-flex; }
.rm-seg label { font-size: 13px; font-weight: 700; color: var(--color-text-muted); border-radius: 9px; padding: 8px 14px; cursor: pointer; display: flex; align-items: center; min-height: 40px; }
.rm-seg label input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.rm-seg label:has(input:checked) { background: #FFFFFF; color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.rm-dt { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; flex-wrap: wrap; }
.rm-dt > div:first-child { flex: 1; min-width: 180px; }
.rm-time { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; color: var(--color-text-muted); }
.rm-time select { width: auto; padding: 12px 30px 12px 12px; }
.rm-acclist { max-height: 180px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 12px; padding: 8px 10px; }
.rm-note { font-size: 12px; color: var(--color-text-muted); }
.rm-go { display: flex; gap: 8px; margin-top: 16px; }
.rm-go .btn-primary { flex: 1; margin: 0; }
.rm-go .rm-del { width: auto; margin: 0; padding: 10px 16px; border-color: #F1C4BF; color: var(--color-red-dark); }
@media (max-width: 600px) {
  .rm-ann { flex-wrap: wrap; }
  .rm-ann .rm-okbtn { width: 100%; }
  .rm-ann.done { flex-wrap: nowrap; }
  .rm-seg { display: flex; }
  .rm-seg button, .rm-seg label { flex: 1; justify-content: center; }
}

/* ===== (2026-09-29) หน้ารายงาน: ปุ่มเลือกรายงาน → วงแหวนแบบเดียวกับแดชบอร์ด (ไอคอนกลางวง · ชื่อใต้วง · ที่เลือกอยู่ = วงทึบสีตามรายงาน) ===== */
.rp-type { --c: var(--color-blue); border: none !important; background: none !important; padding: 2px 2px 4px; display: flex; flex-direction: column; align-items: center; border-radius: 14px; color: var(--color-text) !important; }
.rp-type[data-type="leave"] { --c: #1259C3; } .rp-type[data-type="leaveRights"] { --c: #7B3FA0; } .rp-type[data-type="newhire"] { --c: #1E8E3E; }
.rp-type[data-type="resign"] { --c: #D6362B; } .rp-type[data-type="maternity"] { --c: #C2549A; } .rp-type[data-type="cert"] { --c: #D9A21B; } .rp-type[data-type="leaveAlerts"] { --c: #E0662B; }
.rp-type .rp-ti { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; place-content: center; font-size: 26px; background: #FFFFFF; box-shadow: 0 0 0 4px var(--c) inset, 0 2px 8px rgba(0, 0, 0, 0.06); transition: transform 0.15s, box-shadow 0.15s, background 0.15s; margin: 0 auto; }
.rp-type:hover .rp-ti { transform: translateY(-2px); }
.rp-type b { margin-top: 7px; font-size: 12px; }
.rp-type small { color: var(--color-text-muted) !important; }
.rp-type[aria-pressed="true"] .rp-ti { background: var(--c); box-shadow: 0 0 0 4px var(--c) inset, 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent), 0 6px 14px color-mix(in srgb, var(--c) 30%, transparent); }
.rp-type[aria-pressed="true"] b { color: var(--c); }
.rp-type:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.rp-types { align-items: start; }
@media (max-width: 760px) {
  .rp-types { row-gap: 12px; }
  .rp-type .rp-ti { width: 54px; height: 54px; font-size: 22px; }
  .rp-type b { font-size: 10.5px; margin-top: 5px; }
}
.rp-type .lal-badge.on-type { right: calc(50% - 40px); top: -4px; }

/* ===== (2026-09-29 v3) Payroll Prep: วงกลมเลือกรอบ · ปุ่มออกไฟล์ใหญ่ · ตรวจก่อนออกไฟล์ (ไม่มีตารางบนจอ) ===== */
.prp-top { padding: 20px 22px; }
.prp-rounds { display: flex; justify-content: center; gap: 34px; margin: 2px 0 14px; flex-wrap: wrap; }
.prp-rd { --c: var(--color-blue); font-family: inherit; border: none; background: none; padding: 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.prp-ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; place-content: center; background: #FFFFFF; box-shadow: 0 0 0 4px var(--c) inset, 0 2px 8px rgba(0, 0, 0, 0.06); line-height: 1.15; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.prp-ring b { font-size: 17px; font-weight: 900; color: var(--c); }
.prp-ring small { font-size: 10.5px; color: var(--color-text-muted); display: block; }
.prp-rd em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--color-text); }
.prp-rd:hover .prp-ring { transform: translateY(-2px); }
.prp-rd[aria-pressed="true"] .prp-ring { background: var(--c); box-shadow: 0 0 0 4px var(--c) inset, 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent), 0 8px 16px color-mix(in srgb, var(--c) 30%, transparent); }
.prp-rd[aria-pressed="true"] .prp-ring b, .prp-rd[aria-pressed="true"] .prp-ring small { color: #FFFFFF; }
.prp-rd[aria-pressed="true"] em { color: var(--c); }
.prp-rd:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; border-radius: 14px; }
.prp-top .prp-range { max-width: 560px; margin: 0 auto; min-width: 0; }
.prp-step .pr-nb { border-radius: 50%; width: 42px; height: 42px; }
.prp-step .pr-per { border: none; background: none; }
.prp-step .pr-per b { font-size: 18px; }
.prp-count { text-align: center; font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; min-height: 18px; }
.prp-count b { color: var(--color-text); }
.prp-exp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.prp-eb { font-family: inherit; border-radius: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 15px; cursor: pointer; text-align: left; border: 1.5px solid var(--color-border); background: #FFFFFF; color: var(--color-text); }
.prp-eb i { font-style: normal; font-size: 24px; }
.prp-eb small { display: block; font-weight: 400; font-size: 12px; color: var(--color-text-muted); }
.prp-eb.pdf { border: none; background: linear-gradient(90deg, var(--color-red), var(--color-blue)); color: #FFFFFF; }
.prp-eb.pdf small { color: rgba(255, 255, 255, 0.85); }
.prp-eb:disabled { opacity: 0.45; cursor: default; }
.prp-checkcard { padding: 18px 22px; }
.prp-ch { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.prp-ch b { font-size: 15px; font-weight: 900; }
.prp-ch small, .prp-muted { font-size: 12px; color: var(--color-text-muted); margin: 0; }
#pr_checkBox { transition: opacity 0.15s; }
.prp-chk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prp-ck2 { border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1.5px solid transparent; }
.prp-ck2[role="button"] { cursor: pointer; }
.prp-ck2 .n { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #FFFFFF; flex: none; }
.prp-ck2 .tx { flex: 1; min-width: 0; }
.prp-ck2 .tx b { display: block; font-size: 13px; }
.prp-ck2 .tx small { color: var(--color-text-muted); font-size: 11.5px; }
.prp-ck2 .go { font-size: 12px; font-weight: 700; white-space: nowrap; }
.prp-ck2.r { background: #FDF1F0; } .prp-ck2.r .n { background: var(--color-red); } .prp-ck2.r .go { color: var(--color-red-dark); }
.prp-ck2.y { background: #FFF8E6; } .prp-ck2.y .n { background: #D9A21B; } .prp-ck2.y .go { color: #8B6B14; }
.prp-ck2.ok { background: #F2F9F4; } .prp-ck2.ok .n { background: #1E8E3E; }
.prp-ck2.open { grid-column: 1 / -1; border-color: #E6D7D5; }
.prp-ck2.y.open { border-color: #EFDDB0; }
.prp-lst { flex-basis: 100%; margin: 6px 0 0 44px; font-size: 12.5px; max-height: 320px; overflow-y: auto; cursor: default; }
.prp-lst div { display: flex; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(0, 0, 0, 0.06); }
.prp-lst b { white-space: nowrap; }
.prp-lst span { color: var(--color-text-muted); }
.prp-lgo { margin-top: 8px; font-family: inherit; border: none; background: none; color: var(--color-blue); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 4px 0; }
.prp-pwarn { font-size: 9.5px; color: #B42A21; background: #FDF1F0; border-radius: 8px; padding: 4px 9px; margin-bottom: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media (max-width: 760px) {
  .prp-top, .prp-checkcard { padding: 14px; }
  .prp-rounds { gap: 6px; justify-content: space-between; }
  .prp-ring { width: 68px; height: 68px; }
  .prp-ring b { font-size: 14px; }
  .prp-ring small { display: none; }
  .prp-rd em { font-size: 11.5px; }
  .prp-exp, .prp-chk { grid-template-columns: 1fr; }
  .prp-step .pr-per b { font-size: 15.5px; }
  .prp-lst { margin-left: 0; }
  .prp-lst div { flex-direction: column; gap: 0; }
}

/* ===== (2026-09-29) บัญชีผู้ใช้แบบ "ตัวคน" (acc2-*) · PIN ชั่วคราว · บังคับตั้ง PIN (fpc-*) · รูปโปรไฟล์ (tb-av / ph-*) ===== */
.acc2-card { padding: 18px 20px; }
.acc2-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.acc2-head h2 { margin: 0; font-size: 18px; font-weight: 900; }
.acc2-head small { font-size: 12.5px; color: var(--color-text-muted); }
.acc2-tools { display: flex; gap: 8px; align-items: center; }
.acc2-search { width: 240px; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--color-bg); padding: 10px 16px; font-family: inherit; font-size: 13px; }
.acc2-tools .acc2-add { width: auto; margin: 0; padding: 10px 18px; min-height: 42px; font-size: 13px; white-space: nowrap; }
.acc2-gt { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; margin: 16px 0 8px; }
.acc2-gt i { font-style: normal; font-size: 11.5px; background: var(--color-bg); color: var(--color-text-muted); border-radius: 999px; padding: 0 8px; }
.acc2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.acc2-p { font-family: inherit; position: relative; display: flex; gap: 11px; align-items: center; text-align: left; border: 1.5px solid var(--color-border); border-radius: 16px; padding: 11px 12px; background: #FFFFFF; cursor: pointer; color: var(--color-text); min-width: 0; }
.acc2-p:hover { border-color: #C9CCD1; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.acc2-p.off { opacity: 0.55; }
.acc2-avw { position: relative; flex: none; display: flex; }
.acc2-on { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #1E8E3E; border: 2px solid #FFFFFF; }
.acc2-tx { min-width: 0; display: flex; flex-direction: column; }
.acc2-tx b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc2-tx b small { font-weight: 400; color: var(--color-text-muted); }
.acc2-tx > small { font-size: 11.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc2-flag { position: absolute; right: 8px; top: -8px; font-style: normal; font-size: 10px; font-weight: 700; background: #FFF3D6; color: #8B6B14; border-radius: 999px; padding: 0 8px; border: 1px solid #F1DFA8; }
.acc2-hid { font-family: inherit; border: none; background: none; color: #8A8F96; font-weight: 700; font-size: 12.5px; margin: 16px 0 8px; cursor: pointer; padding: 4px 0; }
.acc2-av { border-radius: 50%; display: grid; place-items: center; place-content: center; color: #FFFFFF; font-weight: 700; flex: none; overflow: hidden; line-height: 1; }
.acc2-av.main { background: #B42A21; } .acc2-av.sub { background: #1259C3; } .acc2-av.insp { background: #1E8E3E; }
.acc2-av.has-photo { background: #E3E5E8; }
.acc2-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc2-md { position: relative; background: #FFFFFF; border-radius: 24px; padding: 22px; width: min(400px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 12px; }
.acc2-x { position: absolute; right: 12px; top: 10px; }
.acc2-dh { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.acc2-dh b { font-size: 20px; font-weight: 900; }
.acc2-dh small { font-size: 12px; color: var(--color-text-muted); }
.acc2-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.acc2-chip { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.acc2-chip.main { background: #FDECEA; color: #B42A21; } .acc2-chip.sub { background: #E8F0FC; color: #1259C3; } .acc2-chip.insp { background: #EAF6EE; color: #1E7A3A; }
.acc2-chip.warn { background: #FFF3D6; color: #8B6B14; } .acc2-chip.off { background: #F1F2F4; color: #6B7076; } .acc2-chip.exp { background: #FDECEA; color: #B42A21; }
.acc2-kv { background: #F5F6F8; border-radius: 14px; padding: 10px 14px; font-size: 12.5px; }
.acc2-kv div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.acc2-kv span { color: var(--color-text-muted); white-space: nowrap; }
.acc2-kv b { text-align: right; }
.acc2-rts { display: flex; flex-wrap: wrap; gap: 6px; }
.acc2-rts span { font-size: 11.5px; font-weight: 700; background: #E8F0FC; color: #1259C3; border-radius: 999px; padding: 2px 10px; }
.acc2-rts small { font-weight: 400; }
.acc2-acts { display: flex; flex-direction: column; gap: 8px; }
.acc2-acts .btn-primary, .acc2-acts .btn-secondary, .acc2-md > .btn-primary, .acc2-md > .btn-secondary { width: 100%; margin: 0; min-height: 44px; font-size: 13.5px; }
.acc2-two { display: flex; gap: 8px; }
.acc2-two > * { flex: 1; }
.acc2-del, .acc2-hide { color: var(--color-red-dark) !important; border-color: #F1C4BF !important; }
.acc2-pin { display: flex; gap: 10px; justify-content: center; margin: 4px 0; }
.acc2-pin span { width: 54px; height: 64px; border-radius: 14px; background: var(--color-bg); display: grid; place-items: center; font-size: 32px; font-weight: 900; color: #1259C3; }
.acc2-msg { background: #F5F6F8; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.acc2-msg small { font-weight: 700; color: var(--color-text-muted); font-size: 11px; }
.acc2-msg p { margin: 4px 0 0; line-height: 1.6; }
.acc2-note { background: #FFF6DE; border-radius: 12px; padding: 9px 12px; font-size: 12px; color: #6B5410; margin: 0; line-height: 1.6; }
.acc-help { font-size: 12px; color: var(--color-text-muted); margin: 6px 0 0; }
/* บังคับตั้ง PIN ใหม่ */
.fpc-card { max-width: 420px; margin: 40px auto; padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.fpc-ic { font-size: 42px; }
.fpc-card h2 { margin: 0; font-size: 21px; font-weight: 900; }
.fpc-sub { font-size: 13px; color: var(--color-text-muted); margin: 0 0 8px; line-height: 1.6; }
.fpc-l { font-size: 12px; font-weight: 700; color: var(--color-text-muted); text-align: left; margin-top: 4px; }
.fpc-in { text-align: center; font-size: 22px !important; letter-spacing: 10px; border-radius: 14px; }
.fpc-card .btn-primary { margin-top: 10px; }
.fpc-out { font-family: inherit; border: none; background: none; color: var(--color-text-muted); font-weight: 700; font-size: 13px; cursor: pointer; padding: 10px; }
/* รูปโปรไฟล์บนแถบบน */
.tb-hi { display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; justify-items: start; }
.tb-hi > .tb-av { grid-row: 1 / span 2; }
.tb-hi > div { min-width: 0; max-width: 100%; }
.tb-av { position: relative; font-family: inherit; border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: flex; }
.tb-av .acc2-av { border: 2px solid #FFFFFF; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15); }
.tb-cam { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; display: grid; place-items: center; font-size: 11px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
@media (max-width: 760px) {
  .page-wrap > .top-bar .tb-hi > div { font-size: 17px !important; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-av .acc2-av { width: 42px !important; height: 42px !important; }
  .acc2-head { flex-direction: column; align-items: stretch; }
  .acc2-tools { width: 100%; }
  .acc2-search { flex: 1; width: auto; min-width: 0; }
  .acc2-grid { grid-template-columns: 1fr; }
}
/* เปลี่ยนรูป: แผ่นจากด้านล่าง */
.ph-ov { align-items: flex-end !important; }
.ph-sheet { background: #FFFFFF; border-radius: 26px 26px 0 0; padding: 12px 18px 22px; width: min(460px, 100vw); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2); }
.ph-grab { width: 44px; height: 5px; border-radius: 9px; background: #D5D8DC; margin: 0 auto 6px; }
.ph-t { font-size: 16px; font-weight: 900; text-align: center; }
.ph-s { font-size: 12px; color: var(--color-text-muted); text-align: center; }
.ph-crop { position: relative; width: 220px; height: 220px; margin: 8px auto; border-radius: 50%; overflow: hidden; background: #F2F3F5; box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 6px #1259C3; touch-action: none; }
.ph-crop canvas { width: 220px; height: 220px; display: block; cursor: grab; }
.ph-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ph-zoom { display: flex; align-items: center; gap: 10px; margin: 0 8px; font-size: 13px; }
.ph-zoom input { flex: 1; }
.ph-two { display: flex; gap: 8px; }
.ph-pick { flex: 1; width: auto !important; margin: 0 !important; display: flex !important; align-items: center; justify-content: center; min-height: 44px; font-size: 13px; cursor: pointer; }
.ph-sheet .btn-primary { width: 100%; margin: 0; min-height: 46px; }
.ph-del, .ph-cancel { font-family: inherit; border: none; background: none; font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px; }
.ph-del { color: #C0392B; }
.ph-cancel { color: var(--color-text-muted); }
@media (min-width: 761px) { .ph-ov { align-items: center !important; } .ph-sheet { border-radius: 24px; } }
@media (max-width: 760px) { .ph-ov { padding: 0 !important; } }

/* ===== (2026-09-29) สายตรวจ: เพิ่มพนักงาน / ย้ายสาขา / ลาออก แบบหลายรายการ (mx-*) · แก้ไขวันลา (le2-*) ===== */
.mx-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.mx-hd b { display: block; font-size: 16px; font-weight: 900; }
.mx-hd small { font-size: 12px; color: var(--color-text-muted); }
.mx-seg button { font-size: 12.5px; padding: 6px 12px; min-height: 36px; }
.mx-pick { background: var(--color-bg); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.mx-search { width: 100%; border-radius: 999px; border: 1.5px solid var(--color-border); background: #FFFFFF; padding: 11px 16px; font-family: inherit; font-size: 14px; }
.mx-results:not(:empty) { margin-top: 6px; background: #FFFFFF; border-radius: 12px; padding: 4px 6px; }
.mx-res { font-family: inherit; width: 100%; display: flex; align-items: center; gap: 10px; border: none; background: none; text-align: left; padding: 9px 6px; border-bottom: 1px solid #F0F1F3; cursor: pointer; color: var(--color-text); }
.mx-res:last-child { border-bottom: none; }
.mx-res span { flex: 1; min-width: 0; }
.mx-res b { display: block; font-size: 13.5px; }
.mx-res small { font-size: 11.5px; color: var(--color-text-muted); }
.mx-res i { font-style: normal; font-size: 18px; font-weight: 900; color: var(--color-blue); }
.mx-res.in { opacity: 0.5; cursor: default; }
.mx-res.in i { color: #1E8E3E; }
.mx-muted { font-size: 12.5px; color: var(--color-text-muted); margin: 6px; }
.mx-shared { max-width: 320px; margin-bottom: 10px; }
.mx-shared:empty { display: none; }
.mx-l { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 5px; }
.mx-list { display: flex; flex-direction: column; gap: 10px; }
.mx-empty { border: 1.5px dashed #C9CDD3; border-radius: 16px; padding: 18px; text-align: center; font-size: 13px; color: var(--color-text-muted); }
.mx-it { border: 1.5px solid var(--color-border); border-radius: 16px; padding: 12px 14px; background: #FFFFFF; }
.mx-it.ok { border-color: #BFE3CB; }
.mx-it.bad { border-color: #F3C8C3; }
.mx-ih { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mx-n { width: 24px; height: 24px; border-radius: 50%; background: var(--color-text); color: #FFFFFF; font-size: 12px; font-weight: 900; display: grid; place-items: center; flex: none; }
.mx-title { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-st { margin-left: auto; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.mx-st.g { background: #EAF6EE; color: #1E7A3A; } .mx-st.r { background: #FDECEA; color: #B42A21; } .mx-st.y { background: #F2F3F5; color: var(--color-text-muted); }
.mx-x { font-family: inherit; border: none; background: none; color: #B8BCC2; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.mx-x:hover { color: var(--color-red); }
.mx-f4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mx-more-f { margin-top: 8px; }
.mx-in { display: flex; flex-direction: column; background: var(--color-bg); border: 1.5px solid transparent; border-radius: 12px; padding: 6px 12px; min-width: 0; }
.mx-in small { font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); }
.mx-in input, .mx-in select { border: none !important; background: none !important; padding: 2px 0 !important; min-height: 26px; font-family: inherit; font-size: 14px; width: 100%; box-shadow: none !important; outline: none; }
.mx-in:focus-within { border-color: var(--color-blue); background: #FFFFFF; }
.mx-ro { color: var(--color-text); font-size: 14px; font-weight: 700; flex: 0 0 auto; min-width: 70px; }
.mx-full { margin-top: 8px; }
.mx-it.bad .mx-in:has(input:placeholder-shown) { border-color: #F1B8B2; background: #FEF6F5; }
.mx-more { font-family: inherit; border: none; background: none; color: var(--color-blue); font-weight: 700; font-size: 12px; cursor: pointer; padding: 8px 0 0; }
.mx-date { margin-top: 8px; max-width: 300px; }
.mx-date small { display: block; font-size: 10.5px; font-weight: 700; color: var(--color-text-muted); margin-bottom: 4px; }
.mx-tr { display: flex; align-items: center; gap: 8px; }
.mx-tr .mx-in:last-child { flex: 1; }
.mx-arrow { font-weight: 900; color: var(--color-text-muted); }
.mx-tog { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #B42A21; margin-top: 10px; cursor: pointer; }
.mx-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mx-tog span { width: 36px; height: 21px; border-radius: 999px; background: #D5D8DC; position: relative; flex: none; transition: background 0.15s; }
.mx-tog span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.mx-tog input:checked + span { background: var(--color-red); }
.mx-tog input:checked + span::after { transform: translateX(15px); }
.mx-tog input:focus-visible + span { outline: 2px solid var(--color-red); outline-offset: 2px; }
.mx-err { margin: 8px 0 0; font-size: 12.5px; color: #B42A21; font-weight: 700; }
.mx-addrow { font-family: inherit; width: 100%; margin-top: 10px; border: 1.5px dashed #C9CDD3; border-radius: 16px; padding: 12px; background: none; font-size: 13.5px; font-weight: 700; color: var(--color-blue); cursor: pointer; }
.mx-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; align-items: center; margin-top: 14px; background: #FFFFFF; border-radius: 18px; padding: 10px 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12); border: 1px solid var(--color-border); }
.mx-bs { flex: 1; font-size: 13px; color: var(--color-text-muted); }
.mx-bs b { color: var(--color-text); }
.mx-bs b.r { color: #B42A21; }
.mx-bar button { width: auto; margin: 0; min-height: 42px; padding: 8px 18px; font-size: 13px; white-space: nowrap; }
.le2-pick { background: var(--color-bg); border-radius: 16px; padding: 10px; }
.le2-row > td { background: #FBFCFF !important; padding: 0 !important; }
.le2-panel { background: #F5F8FF; border: 1.5px solid #C9D9F5; border-radius: 14px; padding: 14px; margin: 6px 0 10px; }
@media (max-width: 760px) {
  .mx-f4 { grid-template-columns: 1fr 1fr; }
  .mx-shared, .mx-date { max-width: none; }
  .mx-bar { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .mx-hd .mx-seg { width: 100%; display: flex; }
  .mx-hd .mx-seg button { flex: 1; }
  .mini-table[data-cards] tr.le2-row { display: block; border: none; padding: 0; background: none; }
  .mini-table[data-cards] tr.le2-row > td { display: block; }
  .mini-table[data-cards] tr.le2-row > td::before { display: none; }
  .mx-bar { flex-wrap: wrap; }
  .mx-bs { flex-basis: 100%; }
  .mx-bar button { flex: 1; }
}

/* ===== (2026-09-30) สมัครใช้งานจากหน้าแรก (su-*) · คำขอรออนุมัติในหน้าบัญชีผู้ใช้ (acc2-pend / acc2-req) ===== */
.su-sub { font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.su-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.su-lbl { font-size: 13px; font-weight: 700; margin: 4px 0 6px; color: inherit; opacity: 0.85; }
.su-seg { display: flex; gap: 6px; margin-bottom: 12px; }
.su-seg button { flex: 1; font-family: inherit; font-size: 13px; font-weight: 700; border-radius: 14px; padding: 10px 6px; border: 1.5px solid rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.35); color: inherit; cursor: pointer; }
.su-seg button[aria-checked="true"] { background: #FFFFFF; border-color: #FFFFFF; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); color: #B42A21; }
.su-back { display: block; margin: 12px auto 0; }
.su-link { display: block; margin: 12px auto 0; font-size: 13.5px; }
.su-done { text-align: center; padding: 10px 4px 16px; }
.su-ok { width: 64px; height: 64px; border-radius: 50%; background: #1E8E3E; color: #FFFFFF; font-size: 32px; font-weight: 900; display: grid; place-items: center; margin: 6px auto 10px; }
.su-done b { font-size: 18px; }
.su-done p { font-size: 13.5px; line-height: 1.7; margin: 8px 0 0; }
.acc2-pend { background: #FFF8E6; border: 1.5px solid #F1DFA8; border-radius: 18px; padding: 4px 14px 12px; margin-top: 10px; }
.acc2-pend .acc2-gt { flex-wrap: wrap; }
.acc2-pend .acc2-gt i.warn { background: #D9A21B; color: #FFFFFF; }
.acc2-pend .acc2-gt small { font-weight: 400; font-size: 12px; color: #8B6B14; }
.acc2-req { display: flex; align-items: center; gap: 12px; background: #FFFFFF; border-radius: 14px; padding: 10px 12px; margin-top: 8px; flex-wrap: wrap; }
.acc2-rq-tx { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.acc2-rq-tx b { font-size: 14px; }
.acc2-rq-tx small { font-size: 12px; color: var(--color-text-muted); }
.acc2-rq-tx em { font-size: 12px; color: #6B5410; margin-top: 2px; }
.acc2-rq-act { display: flex; gap: 6px; }
.acc2-rq-act button { width: auto; margin: 0; min-height: 40px; padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.acc2-rej { color: var(--color-red-dark) !important; border-color: #F1C4BF !important; }
@media (max-width: 760px) {
  .acc2-rq-act { width: 100%; }
  .acc2-rq-act button { flex: 1; }
}

/* ===== (2026-09-30) มือถือ: กดเมนูแล้วเด้งไปค้นหา Google — กัน "แตะเพื่อค้นหา" ของ Chrome/Android ที่ทำงานเมื่อแตะโดน "ตัวหนังสือ"
   บนปุ่ม: ปุ่ม/เมนู/วงกลมทั้งหมดห้ามเลือกข้อความ + ไม่มีเมนูกดค้าง + ตอบสนองการแตะทันที (ไม่รอเช็คดับเบิลแตะ) ===== */
button, [role="button"], .nav-tab-btn, .m-nav-btn, .m-nav-fab, .insp-subnav-btn, .db-mini, .rp-type, .prp-rd, .prp-ck2, .acc2-p, .mx-res, .lc-cell, .tb-av {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
/* แถบเมนูล่างยกสูงจากขอบจอขึ้นอีกนิด — กันนิ้วแตะเลยไปโดนแถบของเบราว์เซอร์/ระบบ (แถบค้นหาด้านล่างของ Chrome, ปุ่ม Home) */
@media (max-width: 760px) {
  .nav-tab-bar, .m-bottom-nav { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ===== (2026-09-30) PDF Payroll Prep แบบกระชับ: บรรทัดสรุปบรรทัดเดียวแทนการ์ด · หมายเหตุ 1 บรรทัด · หน้าสรุปลาไม่รับเงินเดือนท้ายเอกสาร ===== */
.prp-pr { color: #C8352B; } /* สีทึบ — ตัวไล่สี (background-clip:text) ไม่ถูกพิมพ์ลง PDF ทำให้คำว่า Payroll หาย */
.prp-hd .prp-meta { padding-right: 4mm; max-width: 52%; }
.prp-sumline { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; font-size: 11px; margin: 8px 0 4px; }
.prp-sumline .big { font-size: 19px; font-weight: 900; }
.prp-sumline span { color: #62676F; }
.prp-sumline span b { color: #1B1C1E; }
.prp-unpaid h3 { font-size: 13px; margin: 0 0 8px; }
@media print {
  table.prp-compact td { font-size: 9.5px; padding: 3px 5px !important; }
  table.prp-compact td.prp-nm small { display: inline; font-size: 8px; color: #9BA0A6; }
  table.prp-compact td.prp-note { font-size: 9px; }
  .prp-unpaid { break-before: page; page-break-before: always; }
  .prp-pr { color: #C8352B !important; }
}
.prp-brand b .prp-pr { font-size: inherit; display: inline; color: #C8352B; }
@media print { table.prp-table td.prp-nm small { display: inline; font-size: 8px; color: #9BA0A6; } }
@media print { html, body, #app, .page-wrap, #pr_resultBox { background: #FFFFFF !important; } }

/* ===== (2026-09-30) PDF Payroll Prep ให้ตรงกับภาพตัวอย่างที่ผู้ใช้เลือก (pdf-compact-mockup) — ทับกฎ .mini-table ตอนพิมพ์ทั่วไป ===== */
@media print {
  .prp-hd { align-items: flex-end; padding-bottom: 8px; }
  .prp-hd .prp-brand b { font-size: 17px; font-weight: 900; }
  .prp-hd .prp-brand > div > span { font-size: 10.5px; color: #62676F; }
  .prp-hd .prp-meta { font-size: 10.5px; line-height: 1.6; color: #62676F; }
  .prp-sumline { font-size: 11.5px; margin: 10px 0 4px; gap: 18px; }
  .prp-sumline .big { font-size: 20px; }
  .prp-pwarn { background: none !important; padding: 0 !important; border-radius: 0; font-size: 10px; color: #B42A21; margin: 2px 0 8px; }
  #pr_resultBox .prp-tablecard { padding: 0 !important; border: none !important; box-shadow: none !important; }
  table.prp-table { font-size: 10.5px !important; table-layout: fixed; }
  table.prp-table th, table.prp-table td { border: none !important; }
  table.prp-table thead th { background: #0F3F99 !important; color: #FFFFFF !important; font-size: 10px !important; font-weight: 700; padding: 5px 6px !important; }
  table.prp-table tbody td { font-size: 10.5px !important; padding: 4px 6px !important; border-bottom: 1px solid #EBEDF0 !important; background: #FFFFFF !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.prp-table tbody td.prp-note { white-space: normal; color: #3B3F45; font-size: 10.5px !important; }
  table.prp-table tbody td.prp-note em { font-style: normal; font-weight: 400; color: #3B3F45; }
  table.prp-table tbody tr.branch-row td { background: #EEF3FC !important; color: #1259C3 !important; font-weight: 900; font-size: 10px !important; border-top: none !important; }
  table.prp-table td.prp-nm small { display: inline !important; font-size: 10.5px !important; color: #C4C7CC !important; }
  table.prp-table .prp-z, table.prp-table td.prp-z { color: #C4C7CC !important; }
  table.prp-table td.prp-red { color: #B42A21 !important; font-weight: 900; }
  table.prp-table .prp-st { font-size: 9.5px; padding: 0 6px; line-height: 1.6; }
  #pr_resultBox .prp-legend { font-size: 9px !important; color: #62676F; margin-top: 6px; }
}
/* (2026-09-30) PDF Payroll Prep: หัวตารางกึ่งกลางทุกช่อง (แนวตั้ง+แนวนอน) · สาขา/สถานะ/ตัวเลขกึ่งกลาง · ชื่อ/หมายเหตุชิดซ้าย */
@media print {
  table.prp-compact thead th { text-align: center !important; vertical-align: middle !important; line-height: 1.3; }
  table.prp-compact tbody tr:not(.branch-row) td:nth-child(1), table.prp-compact tbody tr:not(.branch-row) td:nth-child(3), table.prp-compact tbody td.n { text-align: center !important; }
  table.prp-compact tbody td { vertical-align: middle !important; }
}

/* ===== (2026-10-02) ไอคอนเส้นแทนอีโมจิ (แดชบอร์ด = ป้ายมุมวง · รายงาน = กลางวง) + ชื่อใต้วงตัวหนา ตัดบรรทัดเอง (<br>) ไม่ให้ตัดกลางคำ ===== */
.line-ic { display: block; }
.db-mt span { color: var(--c); }
.db-mt span .line-ic { width: 15px; height: 15px; }
.db-mini small { font-weight: 800; color: var(--color-text); line-height: 1.3; white-space: nowrap; }
.rp-type .rp-ti { color: var(--c); }
.rp-type .rp-ti .line-ic { width: 28px; height: 28px; }
.rp-type[aria-pressed="true"] .rp-ti { color: #FFFFFF; }
.rp-type b { font-weight: 800; line-height: 1.3; white-space: nowrap; }
@media (max-width: 760px) {
  .db-mt span .line-ic { width: 13px; height: 13px; }
  .rp-type .rp-ti .line-ic { width: 24px; height: 24px; }
}

/* ===== (2026-10-02) ไอคอนเส้นทั้งระบบแทนอีโมจิ — <i class="ic ic-NAME"></i> · สีตามตัวหนังสือ (currentColor) · ขนาดตาม font-size ===== */
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; flex: none; font-style: normal; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ic-dot { display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%; vertical-align: 0.04em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ic-dot.err { background: #D6362B; } .ic-dot.sus { background: #E8A600; }
.ic-checkCircle { color: #1E8E3E; }
.rm-okbtn .ic-checkCircle, .btn-primary .ic-checkCircle { color: inherit; }
.mx-search, .acc2-search, .lri-search { padding-left: 38px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; background-size: 16px 16px; }
.ic-clipboard { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='4' x='8' y='2' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='M12 11h4'/%3E%3Cpath d='M12 16h4'/%3E%3Cpath d='M8 11h.01'/%3E%3Cpath d='M8 16h.01'/%3E%3C/svg%3E"); }
.ic-copy { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E"); }
.ic-bell { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
.ic-checkCircle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.ic-megaphone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 18-5v12L3 14v-3z'/%3E%3Cpath d='M11.6 16.8a3 3 0 1 1-5.8-1.6'/%3E%3C/svg%3E"); }
.ic-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.ic-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.ic-lock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.ic-camera { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E"); }
.ic-minus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.ic-wrench { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.ic-hourglass { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 22h14'/%3E%3Cpath d='M5 2h14'/%3E%3Cpath d='M17 22v-4.17a2 2 0 0 0-.59-1.42L12 12l-4.41 4.41A2 2 0 0 0 7 17.83V22'/%3E%3Cpath d='M7 2v4.17a2 2 0 0 0 .59 1.42L12 12l4.41-4.41A2 2 0 0 0 17 6.17V2'/%3E%3C/svg%3E"); }
.ic-logout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E"); }
.ic-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.ic-file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E"); }
.ic-fileCheck { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='m9 15 2 2 4-4'/%3E%3C/svg%3E"); }
.ic-eye { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ic-eyeOff { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.53 13.53 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E"); }
.ic-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4'/%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E"); }
.ic-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.ic-info { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E"); }
.ic-zap { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E"); }
.ic-pencil { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E"); }
.ic-message { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ic-compass { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16.24 7.76-2.12 6.36-6.36 2.12 2.12-6.36 6.36-2.12z'/%3E%3C/svg%3E"); }
.ic-shield { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.ic-crown { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7z'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E"); }
.ic-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6'/%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2'/%3E%3C/svg%3E"); }
.ic-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6'/%3E%3Cpath d='m15.5 7.5 3 3L22 7l-3-3'/%3E%3C/svg%3E"); }
.ic-bulb { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E"); }
.ic-building { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z'/%3E%3Cpath d='M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2'/%3E%3Cpath d='M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M10 6h4'/%3E%3Cpath d='M10 10h4'/%3E%3Cpath d='M10 14h4'/%3E%3Cpath d='M10 18h4'/%3E%3C/svg%3E"); }
.ic-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.ic-thumbsUp { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E"); }
.ic-award { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='6'/%3E%3Cpath d='M15.48 12.89 17 22l-5-3-5 3 1.52-9.11'/%3E%3C/svg%3E"); }
.ic-book { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.ic-printer { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect width='12' height='8' x='6' y='14'/%3E%3C/svg%3E"); }
.ic-folder { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }
.ic-gear { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ic-flag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cpath d='M4 22v-7'/%3E%3C/svg%3E"); }
.ic-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E"); }
.ic-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E"); }
.ic-image { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21'/%3E%3C/svg%3E"); }
/* กันกฎ "xxx i {…}" เดิมของแต่ละหน้า (ป้ายตัวเลข/วงกลม) มาทับไอคอน */
i.ic.ic { display: inline-block; width: 1.15em; height: 1.15em; padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; min-width: 0; background: currentColor; vertical-align: -0.2em; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.rm-ann .rm-ic { color: #B7791F; } .rm-ann.over .rm-ic { color: var(--color-red); } .rm-ann.done .rm-ic { color: #1E8E3E; }
.fpc-ic, .imp-ic { color: var(--color-blue); }
.lsw-ic { color: #B7791F; }
.tb-cam { color: var(--color-text-muted); }

/* (2026-10-02) ปุ่มแสดง/ซ่อนคนที่ลาออกแล้วท้ายรายชื่อพนักงาน */
.el-gone-tg { display: inline-block; width: auto; margin: 8px 0 0; padding: 7px 14px; border-radius: 999px; border: 1.5px dashed var(--color-border); background: var(--color-bg); color: var(--color-text-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.el-gone-tg:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* (2026-10-02) แดชบอร์ด: หัวกลุ่ม 3 กลุ่ม — ต้องจัดการ (4 วง) · ตอนนี้ (2 วง) · เดือนนี้ (2 วง) ให้ตรงคอลัมน์วงกลม */
.db-groups { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.db-groups .g4 { grid-column: span 4; }
.db-groups .g2 { grid-column: span 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* (2026-10-03) ลาคลอด: ช่อง "ถึงวันที่" + ปุ่มเต็มสิทธิ์ + สรุปจำนวนวัน/วันที่จ่ายถึง */
.mat-row { display: flex; gap: 8px; align-items: stretch; }
.mat-row .mat-end { flex: 1; min-width: 0; }
.mat-full { width: auto; flex: none; margin: 0; padding: 0 14px; border-radius: 12px; border: 1.5px solid #E7C6DA; background: #FBF1F7; color: #A23C7E; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mat-full:hover { background: #F6E1EE; }
.mat-sum { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--color-text-muted); }
.mat-sum b { color: var(--color-text); }
.mat-warn { color: var(--color-red-dark); font-weight: 700; }
.qe-f .mat-row .thcal-trigger { min-height: 40px !important; }
.lc-matf { margin-top: 12px; }
.lc-matf + .lc-f, .lc-f-row:has(.lc-matf) + .lc-f { margin-top: 10px; }

/* (2026-10-05) Payroll Prep: เวลาดึงสรุปใต้วงงวด + หมายเหตุจุดตัดข้อมูล + ตารางปรับย้อนหลังใน PDF */
.prp-snapt { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: #1E8E3E; min-height: 14px; margin-top: 1px; white-space: nowrap; }
.prp-snapnote { margin-top: 8px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--color-text-muted); }
.prp-snapnote b { color: var(--color-text); }
.prp-snapnote .prp-carryn { color: #B7791F; }
.prp-carry { margin-top: 10px; }
.prp-carryh { font-size: 13px; font-weight: 800; margin: 0 0 6px; }
.prp-carryh small { display: block; font-size: 10.5px; font-weight: 500; color: var(--color-text-muted); }
