: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; }

/* (2026-10-07) ซ่อนเคอร์เซอร์กะพริบ "|" ที่โผล่กลางข้อความธรรมดาตอนคลิก (เช่น ชื่อ "สวัสดี, ผู้ดูแลระบบหลัก")
   — ตัวเว็บไม่ได้ตั้งให้พิมพ์ได้ เป็นโหมด Caret Browsing (F7) ของ Chrome ที่เปิดอยู่ในเครื่อง กฎนี้ซ่อนให้ทุกหน้า/ทุกเครื่อง
   ส่วนช่องที่พิมพ์ได้จริง (input/textarea) คืนเคอร์เซอร์ให้ตามปกติ */
html, body { caret-color: transparent; }
input, textarea, select, [contenteditable]:not([contenteditable="false"]) { caret-color: auto; }

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;
}
/* (2026-10-22) เอฟเฟกต์ตอนกด = สีเข้มลงเล็กน้อยเท่านั้น — เดิมใช้ transform: scale(0.96) ให้ปุ่ม "หดตัว" ตอนกด ทำให้กดใกล้ขอบปุ่ม
   แล้วไม่ติด (ปุ่มหดหนีจากจุดที่ปล่อยนิ้ว/เมาส์ เบราว์เซอร์จึงไม่นับเป็นการคลิก) ห้ามใช้ transform/translate/scale กับตัวปุ่มตอน :hover/:active */
button:not(.toggle-pin):not(:disabled):active, [role="button"]:active, label.card:active {
  filter: brightness(0.94);
}
.toggle-pin:active { filter: brightness(0.9); }
/* ตอนใช้คีย์บอร์ด (Tab) ยังเห็นว่าอยู่ปุ่มไหน — ขอบโค้งตามปุ่ม สีแดงแบรนด์ ไม่ใช่สี่เหลี่ยมฟ้า */
:focus-visible { outline: 2px solid rgba(214,54,43,0.6); outline-offset: 2px; }

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: 13px; 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;
}

.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;
}
/* (V.2) องค์กรที่อัปโหลดรูปโลโก้: แสดงรูปแทนตัวย่อบนหัวใบพิมพ์ (orgDocLogoHtml) */
.k3-logo.has-img, .print-doc-header .print-doc-logo.has-img { background: none !important; padding: 0; overflow: hidden; }
.k3-logo.has-img img, .print-doc-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.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.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.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) */

}

/* (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; }

}
@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: 13px; 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: 13px; 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); }
/* (2026-11-18) ช่องติ๊ก "จำการเข้าสู่ระบบ" — ข้อความยาวกว่า "จำไอดี" ขึ้นบรรทัดใหม่ได้ ติ๊กไม่หดตอนข้อความตัดบรรทัด */
.glass-row-stay { margin: 0 0 8px; justify-content: flex-start; }
.glass-row-stay .glass-remember { align-items: flex-start; line-height: 1.4; }
.glass-row-stay .glass-remember input { flex: none; margin-top: 1px; }
.glass-stay-note { display: block; font-size: 13px; font-weight: 400; opacity: 0.75; }
.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: 13px; color: var(--color-gold-light); 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 { filter: brightness(0.95); }
.glass-foot { margin: 16px 0 0; font-size: 13px; opacity: 0.7; }
/* (V.2) หัวข้อ "เงื่อนไข" ในฟอร์มประเภทลา (หน้าตั้งค่าวันลา) */
.lt-cond-h { font-size: 15px; font-weight: 800; margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--color-border); }
/* (V.2 ขั้นที่ 4) หน้า "รูปแบบการทำงาน" (js/work-patterns.js) — ปุ่มไม่ขยับตอนชี้/กด ใช้เงา/ความสว่างแทน */
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.wp-card { text-align: left; border: 2px solid var(--color-border); background: var(--color-surface); color: var(--color-text); border-radius: 18px; padding: 14px; cursor: pointer; font: inherit; }
.wp-card:hover { filter: brightness(0.98); box-shadow: var(--shadow-card); }
.wp-card.on { border-color: var(--color-red); box-shadow: 0 0 0 3px rgba(214, 54, 43, .12); }
.wp-card b { display: block; font-size: 15px; margin: 6px 0 4px; }
.wp-card small { display: block; font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.wp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 0; border-top: 1px solid var(--color-border); flex-wrap: wrap; }
.wp-row > div:first-child { flex: 1 1 220px; min-width: 0; font-size: 14px; }
.wp-hint { font-size: 13px; color: var(--color-text-muted); line-height: 1.45; margin-top: 2px; font-weight: 400; }
.wp-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px; }
.wp-seg button { border: 0; background: transparent; color: var(--color-text-muted); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.wp-seg button:hover { filter: brightness(0.96); }
.wp-seg button.on { background: var(--color-surface); color: var(--color-text); box-shadow: 0 0 0 2px var(--color-red) inset; }
.wp-num { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.wp-num input { width: 92px; text-align: center; padding: 9px 10px; }
.wp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-day { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--color-border); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--color-text-muted); }
.wp-day input { width: auto; margin: 0; }
.wp-day.on { border-color: var(--color-red); color: var(--color-text); }
.wp-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.wp-switch input { width: auto; margin: 0; }
.wp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wp-table select { min-width: 190px; padding: 8px 12px; font-size: 14px; }
@media (max-width: 640px) { .wp-hide-m { display: none; } .wp-table select { min-width: 0; max-width: 100%; padding-right: 30px; font-size: 13px; } }
/* (V.2 ขั้นที่ 3) แถวสิทธิ์ตามอายุงาน "ครบ [n] ปี ได้ [d] วัน [ลบ]" */
.lt-tiers { display: grid; gap: 8px; }
.lt-tier { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.lt-tier input { width: 80px; flex: 0 0 auto; }
.lt-tier .lt-tier-del { width: auto; padding: 6px 12px; font-size: 13px; color: var(--color-red-dark); }
/* (V.2) บรรทัด "ให้บริการโดย WadDee" ใต้การ์ดเข้าสู่ระบบ/สมัครใช้งาน (ชื่อผลิตภัณฑ์ ต่างจากชื่อองค์กร) */
.glass-powered { margin: 12px auto 0; width: fit-content; display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #0B2A6F; font-size: 13px; }
.glass-powered-ic { width: 18px; height: 18px; flex: none; }
.glass-powered-name { font-weight: 800; letter-spacing: 0.2px; }
.glass-powered-name span { color: #E5322D; }

/* (2026-10-09) หน้า login แบบสองฝั่ง (.glass-split) — ซ้าย: โลโก้ YSG ใหญ่ + ข้อความทักทาย (นอกการ์ด) · ขวา: การ์ดกรอกไอดี/PIN
   มือถือ/จอแคบ (≤ 900px) เรียงแนวตั้ง โลโก้ → ข้อความ → การ์ด ใช้เฉพาะหน้า login (หน้าสมัครใช้งานไม่ใส่ .glass-split จึงไม่เปลี่ยน) */
.glass-split .glass-inner { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: clamp(32px, 6vw, 72px); align-items: center; }
.glass-split .glass-hero { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.glass-split .ysg-cast { justify-content: flex-start; gap: clamp(2px, 0.8vw, 12px); margin: 0 0 clamp(14px, 2.4vw, 26px); }
/* ตัวอักษร Y S G ลอย ๆ ไม่มีกรอบสี่เหลี่ยม: ไล่สีทอง + เงาซ้อนหลายชั้นให้ดูนูนเป็น 3 มิติ (ใช้ drop-shadow เพราะตัวอักษรเป็นสีไล่ระดับ ใช้ text-shadow ไม่ได้)
   แสงกวาดตอนพิมพ์ = แถบสีขาวเลื่อนผ่านตัวอักษรเอง (เดิมเป็นแถบเลื่อนในกรอบ) */
.glass-split .ysg-letter {
  width: auto; height: auto; border-radius: 0; overflow: visible; background: none; box-shadow: none;
  filter: drop-shadow(0 1px 0 #A98516) drop-shadow(0 2px 0 #9A7A12) drop-shadow(0 3px 0 #8B6B14) drop-shadow(0 4px 0 #7C5F11) drop-shadow(0 5px 0 #6E540F) drop-shadow(0 14px 14px rgba(0, 0, 0, 0.35));
}
.glass-split .ysg-letter::after { display: none; }
.glass-split .ysg-letter .glyph {
  font-size: clamp(96px, 13vw, 176px); line-height: 1; font-weight: 900; padding: 0 0.02em;
  color: transparent; -webkit-text-fill-color: transparent; text-shadow: none;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0) 62%) no-repeat -150% 0 / 250% 100%,
    linear-gradient(180deg, #FFF6CF 0%, #F6DD88 30%, #D8B23A 62%, #A57F16 100%);
  -webkit-background-clip: text; background-clip: text;
}
.glass-split .ysg-letter.shimmer .glyph { animation: ysgGlyphShimmer 0.7s ease; }
@keyframes ysgGlyphShimmer { from { background-position: -150% 0, 0 0; } to { background-position: 250% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .glass-split .ysg-letter.shimmer .glyph { animation: none; } }
.glass-split .glass-brand { margin: 0 0 16px; font-size: 15px; letter-spacing: 3px; opacity: 0.85; }
.glass-split .glass-greeting { margin: 0; font-size: clamp(34px, 4.2vw, 48px); line-height: 1.15; font-weight: 900; }
.glass-split .glass-sub { margin: 6px 0 0; font-size: clamp(15px, 1.6vw, 19px); opacity: 0.85; }
.glass-split .glass-card { padding: 30px 26px 24px; }
@media (max-width: 900px) {
  .glass-split .glass-inner { grid-template-columns: minmax(0, 1fr); max-width: 400px; gap: 24px; }
  .glass-split .glass-hero { align-items: center; text-align: center; }
  .glass-split .ysg-cast { justify-content: center; margin-bottom: 12px; }
  .glass-split .ysg-letter .glyph { font-size: 92px; }
  .glass-split .glass-brand { font-size: 13px; margin-bottom: 10px; }
  .glass-split .glass-greeting { font-size: 32px; }
  .glass-split .glass-sub { font-size: 14px; }
}

@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, .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: 12px;
    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: 12px; 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 คน" ลอยเหนือเมนูล่าง */

  /* ---- การ์ดตัวเลขแดชบอร์ด ---- */

  /* ส่วนที่เกี่ยวกับไฟล์ 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: 13px; 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: 12px; 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: 13px; }
.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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; }
.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: 12px; 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: 13px; color: var(--color-text-muted); white-space: normal; }
.lr-tip { background: #FFF8E1; border-radius: 12px; padding: 10px 12px; font-size: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; color: var(--color-text-muted); }
.lh-tag { display: inline-block; margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #E8F0FC; color: var(--color-blue); font-weight: 400; }
.lh-note { display: block; font-size: 13px; color: var(--color-text-muted); }
.lh-cancel { font-size: 13px; 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: 13px; 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: 12px; line-height: 1.35; color: var(--color-text-muted); }
.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-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: 13px; 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: 13px; }
.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: 13px; }
.lr-table td.z { color: #C3C6CB; }
.lr-table td .rem { font-size: 13px; line-height: 1.1; }
.lr-table td.z .rem { color: #B5B9BF; }
.lr-table td sup { font-size: 12px; 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: 13px; }
.lr-table .lr-st { font-size: 13px; 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: 13px !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: 13px; 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: 13px; 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: 12px; 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: 13px; }
/* 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; }
.lrm-bar-top span { color: var(--color-text-muted); font-weight: 500; }
.lrm-bar-top b { font-size: 13px; }
.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: 12px; 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: 12px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 12px; 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: 12px; 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: 12px; 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: 13px; 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: 13px; 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: 12px; 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: 13px; font-weight: 800; }
.sev-error .lal-type { color: var(--color-red-dark); }
.sev-suspicious .lal-type { color: #8B6B14; }
.lal-date { font-size: 13px; color: var(--color-text-muted); white-space: nowrap; }
.lal-who { font-size: 15px; font-weight: 700; margin-top: 4px; }
.lal-who span { font-size: 13px; 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: 13px; color: var(--color-text-muted); line-height: 1.7; }
.lal-entries small { font-size: 12px; }
.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: 13px; }
.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; } }
/* (2026-11-10) กันลงพนักงานซ้ำ: กล่องยืนยันชื่อ/เลขบัตรซ้ำ + รายการชื่อซ้ำในหน้าเช็คประวัติ (app.js: confirmDuplicateDialog / runDuplicateList) */
.dupc-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.dupc-item { background: var(--color-bg); border: 1.5px solid var(--color-border); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.dupc-item small { color: var(--color-text-muted); font-size: 12.5px; }
.dupc-item ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dupc-item li { font-size: 13.5px; line-height: 1.55; padding-left: 14px; position: relative; }
.dupc-item li::before { content: '•'; position: absolute; left: 2px; color: var(--color-text-muted); }
.dupc-item li.strong { font-weight: 700; color: #9A5B00; }
.dupc-item li.bad { font-weight: 800; color: var(--color-red-dark); }
.dupl-h { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dupl-h small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--color-text-muted); line-height: 1.5; max-width: 62ch; }
.dupl-h button { width: auto; min-height: 40px; padding: 6px 16px; }
.dupl-g { border: 1.5px solid var(--color-border); border-radius: 14px; padding: 10px; margin-top: 12px; }
.dupl-g.high { border-color: #E9A8A2; background: rgba(200, 53, 43, 0.04); }
.dupl-gh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: 15px; }
.dupl-gh small { color: var(--color-text-muted); font-size: 12.5px; }
.dupl-tag { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: #EAF3FF; color: #1F5FBF; }
.dupl-tag.high { background: #FDECEA; color: var(--color-red-dark); }

/* ================= โปรไฟล์พนักงาน: หน้าเช็คประวัติ (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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; }
.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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; margin-top: 8px; }
.imp-table th { text-align: left; font-size: 12px; 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: 13px; 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: 13px; }
.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: 12px; 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: 13px; 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-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: 13px; }

.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: 13px; 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: 13px; color: var(--color-text-muted); margin-top: 5px; }
.acc-rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-rc { font-family: inherit; font-size: 13px; 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: 13px; 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: 13px; 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: 12px; 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: 13px; color: var(--color-text-muted); white-space: nowrap; }
.el-sub { display: none; }
.el-act { text-align: right; }
.el-btn { font-family: inherit; font-size: 13px; 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: 12px; 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: 13px; color: #7D3FBF; padding: 4px 12px 0; background: #FCFCFD; }
.el-count { font-size: 12px; 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: 13px; 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: 13px; color: var(--color-text-muted); margin: 0 0 8px; line-height: 1.7; }

.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: 13px; 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-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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 12px; color: var(--color-red); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.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: 12px; 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: 13px; 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: 12px; }
.lc-pp:has(input:checked) { background: #EEF4FD; }
.lc-onleave { color: #B26A00; }
.lc-people[hidden] { display: none; }

.lc-people { margin-top: 8px; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lc-chips:empty { display: none; }
.lc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--color-bg); border: 1.5px solid var(--color-border); font-size: 13px; }
.lc-chip small { color: var(--color-text-muted); font-size: 12px; }
.lc-chip button { width: 22px; height: 22px; border: none; border-radius: 50%; background: none; color: var(--color-text-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.lc-chip button:hover { background: var(--color-border); }
.lc-types { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-ty { display: flex; align-items: center; gap: 5px; font-family: inherit; font-size: 13px; 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: 13px; 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; }
.lc-wd-hint { font-size: 13px; color: var(--color-blue); margin-top: 4px; line-height: 1.4; } /* (V.2 ขั้นที่ 5) ประเภทนับเฉพาะวันทำงาน */

@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{ 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: 13px; 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: 12px; }
  .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: 13px; 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: 13px; 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: 13px; 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-note { font-size: 13px; color: var(--color-blue); margin-top: 4px; line-height: 1.4; }
.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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; font-weight: 700; }
.lh-hol { font-size: 12px; color: var(--color-red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-ch { display: block; font-size: 12px; 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: 12px; 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: 13px; 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: 13px; }
.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: 13px; 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: 12px; }
.lh-li em { margin-left: auto; font-style: normal; color: var(--color-text-muted); font-size: 13px; white-space: nowrap; }
.lh-li.cx b, .lh-li.cx em { text-decoration: line-through; color: var(--color-text-muted); }
.lh-empty { font-size: 13px; 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: 13px; }
  .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: 13px; 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: 13px; }
.db-keys span { display: flex; align-items: center; gap: 5px; }
.db-keys i { width: 9px; height: 9px; border-radius: 3px; }
.db-delta { font-size: 13px; 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: 13px; 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: 12px; 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: 13px; 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: 13px; }
/* นำเข้า/ส่งออก CSV (แอดมินหลัก): 2 เครื่องมืออยู่บรรทัดเดียวกัน ส่วนแผงรายละเอียดที่กด "เปิด" ขยายเต็มความกว้างอยู่ใต้การ์ด */
.db-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.db-tools-grid > .card { margin-bottom: 0; }
.db-tools-grid .db-tools-body { grid-column: 1 / -1; }
.db-tools-grid .db-tools-row .tt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.db-tools-grid .db-tools-row .tt b { font-size: 13.5px; }
.db-tools-grid .db-tools-row .tt small { font-size: 12px; color: var(--color-text-muted); }
.tool-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.tool-ic .ic { width: 1.1em; height: 1.1em; vertical-align: 0; }
.tool-ic.imp { background: #E8F0FC; color: var(--color-blue); }
.tool-ic.exp { background: #E3F4E8; color: #1E8E3E; }
@media (max-width: 860px) { .db-tools-grid { grid-template-columns: 1fr; } }
@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: 13px; }
  .db-mini small { font-size: 12px; }
  .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) ================= */
 .rp-fcard { padding: 20px 22px; }

 .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: 12px; }
.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: 12px; 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-dr { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-dr > div { flex: 1; min-width: 150px; }

 .rp-go { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--color-border); margin-top: 16px; padding-top: 14px; }
 .rp-sum { font-size: 13px; color: var(--color-text-muted); flex: 1; min-width: 0; }
 .rp-sum b { color: var(--color-text); }
.rp-sum small { font-size: 12px; }
 .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: 13px; margin-top: 3px; line-height: 1.3; }
.rp-type small { display: block; font-size: 12px; 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: 13px; 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) {
   .rp-fcard { padding: 16px; }

  .pr-seg { display: flex; }
  .pr-seg button { flex: 1; padding: 7px 4px; font-size: 13px; }
   .rp-go { flex-direction: column; align-items: stretch; }
   .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: 13px; }
  .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: 13px; 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: 13px; 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: 13px; }
.lr-kcard .lr-gbar { margin-top: 12px; height: 34px; }
.lr-knote { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }
.lr-knote b { color: var(--color-text); }
.lr-kwatch { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 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: 12px; 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; }

@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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; }
.lc-tip-g small { color: var(--color-text-muted); font-size: 12px; line-height: 1.5; }

/* ความสูงช่องสำหรับวงกลม — เฉพาะจอคอม (มือถือใช้ช่องสี่เหลี่ยมจัตุรัส 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; line-height: 1.5; }
.qe-status .qe-check { font-size: 13px; }
.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: 13px; 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_resultBox { transition: opacity 0.15s; }
#pr_resultBox > .card { margin-bottom: 12px; }

.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 td { vertical-align: top; font-size: 13px; }
.prp-nm small { display: block; font-size: 11px; color: var(--color-text-muted); }

.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-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-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-sign { display: none; }

@media (max-width: 600px) {
  .prp-title h1 { font-size: 22px; }

}
@media print {
  #pr_resultBox { opacity: 1 !important; }
  #pr_resultBox > .card { border: none !important; padding: 0 !important; margin: 0 0 8px !important; }

  .prp-hd { padding-right: 2px; }

   .prp-st, .prp-table thead th, .prp-table tr.branch-row 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; }
}
/* (2026-09-29 รอบ 2) Payroll Prep แบบกระชับ: แถวเดียว = ปุ่มรอบ · เลือกเดือน · ปุ่มส่งออก (ตัดขอบเขตสาขา/ตัวเลขสรุปบนจอ/แถบปุ่มล่างออก) */
.prp-top { padding: 14px 18px; margin-bottom: 12px; }

@media (max-width: 600px) {
  .prp-top { padding: 12px; }

}
@media (max-width: 600px) {

  .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: 12px; }
.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: 13px; right: -4px; top: -4px; }
  .db-mini small { font-size: 12px; 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: 12px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 12px; }
.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: 13px; 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: 13px; 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: 13px; }
.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: 13px; 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-count { text-align: center; font-size: 13px; 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: 12px; }
.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: 13px; 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: 13px; 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-exp, .prp-chk { grid-template-columns: 1fr; }
  .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: 12px; 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: 12px; 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: 12px; 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: 12px; 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: 12px; 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: 12px; }
.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: 13px; 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: 13px; 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: default; border-radius: 50%; display: flex; }
.tb-av .acc2-av { border: 2px solid #FFFFFF; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15); }

@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: 13px; 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: 13px; 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: 12px; 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: 13px; 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: 13px; 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: 13px; 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: 13px; 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: 12px; 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: 12px; 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: 13px; 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-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-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: 12px; margin: 8px 0 4px; }
.prp-sumline .big { font-size: 19px; font-weight: 900; }
.prp-sumline span { color: #62676F; }
.prp-sumline span b { color: #1B1C1E; }

@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-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-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-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-upload { --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='m17 8-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%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; }

/* (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: 13px; 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: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mat-full:hover { background: #F6E1EE; }
.mat-sum { margin-top: 6px; font-size: 13px; 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-snapnote { margin-top: 8px; text-align: center; font-size: 13px; 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: 12px; font-weight: 500; color: var(--color-text-muted); }

/* แผงส่งออกรายชื่อพนักงาน (แดชบอร์ดแอดมินหลัก) — ขั้นตอน 1 เลือกกลุ่ม / 2 เลือกคอลัมน์ (ชิปติ๊กได้) / สรุปจำนวน + ตัวอย่าง */
.ex-sec { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; margin: 18px 0 8px; }
.ex-sec:first-child { margin-top: 2px; }
.ex-n { width: 22px; height: 22px; border-radius: 50%; background: var(--color-blue); color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ex-links { margin-left: auto; display: inline-flex; gap: 6px; }
.ex-links button { font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-blue); background: none; border: none; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.ex-links button:hover { background: #EAF1FC; }
.ex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.ex-lbl, .ex-gl { min-width: 84px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.ex-grp { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ex-hint { font-size: 13px; color: var(--color-text-muted); margin-left: 4px; }
.ex-chip { font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); background: #fff; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 6px 14px; line-height: 1.2; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.ex-chip:hover { border-color: var(--color-blue); }
.ex-chip[aria-pressed="true"] { background: #EAF1FC; border-color: var(--color-blue); color: var(--color-blue); }
.ex-chip[aria-pressed="true"]::before { content: "✓ "; }
.ex-chip.fixed { background: var(--color-bg); border-style: dashed; color: var(--color-text); cursor: default; }
.ex-chip.fixed:hover { border-color: var(--color-border); }
.ex-res { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: #E6F4EA; color: #1E7B34; font-size: 13px; font-weight: 700; }
.ex-res b { font-size: 28px; line-height: 1; }
.ex-res em { margin-left: auto; font-style: normal; font-weight: 500; font-size: 13px; color: #4F6B57; }
.ex-pl { font-size: 13px; font-weight: 700; color: var(--color-text-muted); margin: 12px 0 6px; }
.ex-ps { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 12px; }
.ex-ps table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.ex-ps th { text-align: left; font-size: 12px; color: var(--color-text-muted); background: #FAFAFB; padding: 7px 10px; border-bottom: 1.5px solid var(--color-border); }
.ex-ps td { padding: 6px 10px; border-bottom: 1px solid var(--color-border); }
.ex-ps tr:last-child td { border-bottom: none; }
.ex-go { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ex-go button { width: auto; margin: 0; }
.ex-go .btn-primary { padding-left: 28px; padding-right: 28px; }

/* (2026-10-07) ย้ายสาขา/แจ้งลาออก: เลือกสาขา → เลือกพนักงาน (คู่กับช่องค้นชื่อ) */
.mx-br { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-br .mx-brsel { flex: 1 1 220px; min-width: 0; margin: 0; border-radius: 999px; }
.mx-br .mx-search { flex: 2 1 240px; width: auto; min-width: 0; }
.mx-brlist:not(:empty) { margin-top: 8px; background: #FFFFFF; border-radius: 12px; padding: 8px 10px; }
.mx-brhd { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted); padding: 0 2px 6px; }
.mx-brhd b { color: var(--color-text); }
.mx-brgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 360px; overflow-y: auto; }
.mx-bp { border: 1.5px solid #ECEEF1 !important; border-radius: 10px; padding: 8px 10px; }
.mx-bp.on { border-color: #1E8E3E !important; background: #EEF8F1; }
.mx-bp.on i { color: #1E8E3E; }

/* (2026-10-07) แจ้งเตือนการลงลา: วิธีแก้ + ปุ่มแก้/ยกเลิกตรงรายการ */
.lal-how { margin: 6px 0 2px; padding: 8px 12px; border-radius: 10px; background: #F4F7FC; font-size: 13px; line-height: 1.55; color: var(--color-text); }
.lal-card.sev-error .lal-how { background: #FDF1EF; }
.lal-entries li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 3px 0; }
.lal-et { min-width: 0; }
.lal-eb { display: inline-flex; gap: 6px; flex: none; }
.lal-eb button { width: auto; margin: 0; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--color-border); background: #FFFFFF; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--color-text); }
.lal-eb .lal-fix { color: var(--color-blue); border-color: #C9D8F2; }
.lal-eb .lal-del { color: var(--color-red-dark); border-color: #F1C4BF; }

/* ===== (2026-10-11) รายงานประวัติการลา แบบใหม่ (lhr-*) — ครบทุกประเภท · ไฮไลต์ตามสิทธิ์ · พิมพ์ A4 แนวนอน ===== */
.lhr-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lhr-hd h2 { font-size: 16px; margin: 0; }
.lhr-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.lhr-btns button { width: auto; margin: 0; padding: 8px 16px; font-size: 12px; }
.lhr-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.lhr-kpi { background: #1B1C1E; color: #FFFFFF; border-radius: 12px; padding: 7px 14px; font-size: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-kpi b { display: block; font-size: 19px; line-height: 1.15; }
.lhr-kpi.full { background: #1E8E3E; }
.lhr-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--color-border); border-radius: 12px; padding: 7px 12px; font-size: 12.5px; background: #FFFFFF; }
.lhr-chip i { width: 9px; height: 9px; border-radius: 50%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-opts { margin: 4px 0 10px; }
.lhr-opt { width: auto; margin: 0; border: none; border-radius: 999px; padding: 6px 14px; background: var(--color-bg); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.lhr-opt.on { background: #1B1C1E; color: #FFFFFF; }
.lhr-scroll { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 14px; }
.lhr-empty { padding: 20px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.lhr-t { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.lhr-t th { font-size: 11.5px; font-weight: 700; color: #3A3F45; text-align: left; padding: 7px 6px; border-bottom: 1.5px solid var(--color-border); line-height: 1.25; vertical-align: bottom; background: #FAFAFB; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-t th.n, .lhr-t td.n { text-align: center; }
.lhr-t th .dot { display: block; width: 8px; height: 8px; border-radius: 50%; margin: 0 auto 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-t th em.qh { display: block; font-style: normal; font-weight: 500; font-size: 10px; color: var(--color-text-muted); margin-top: 3px; white-space: nowrap; }
.lhr-t th em.qh.nq { color: var(--color-red); }
.lhr-t tr.hg th { font-size: 10.5px; text-align: center; padding: 5px 6px; border-bottom: none; color: var(--color-text-muted); }
.lhr-t tr.hg th.gq { background: #EEF6F0; color: #1E6B34; border-radius: 8px 8px 0 0; }
.lhr-t tr.hg th.gn { background: #FDECEA; color: #B22A21; border-radius: 8px 8px 0 0; }
.lhr-t .sep { border-left: 2px solid var(--color-border); }
.lhr-t td { padding: 8px 6px; border-bottom: 1px solid #F0F1F3; font-size: 13px; vertical-align: middle; }
.lhr-t td.who b { display: block; font-size: 13.5px; white-space: nowrap; }
.lhr-t td.who small { display: block; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.lhr-t td.z { color: #C9CCD1; }
.lhr-t td.nqc { background: #FFFBFA; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr .v { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 999px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #FFFFFF); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr .v.full { background: var(--c); color: #FFFFFF; }
.lhr small.ov { display: block; font-size: 9px; color: var(--color-red); font-weight: 700; }
.lhr-legend small.ov { display: inline; }
.lhr b.nq { color: var(--color-red); font-weight: 900; font-size: 14px; }
.lhr-t tr.grp td { background: #EEF3FB; color: #0E479A; font-size: 12.5px; padding: 7px 10px; border-bottom: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-t tr.grp td span { color: var(--color-text-muted); font-weight: 400; margin-left: 6px; }
.lhr-t tbody tr:not(.grp):hover td { background: #FAFBFD; }
.lhr-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--color-text-muted); margin-top: 12px; }
.lhr-legend .v { min-width: 0; padding: 1px 8px; }
.lhr-legend b.nq { font-size: 12px; }
@media (max-width: 640px) {
  .lhr-t td.who b { white-space: normal; }
  .lhr-t td.who small { white-space: normal; }
}
@media print {
  .lhr { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .lhr-scroll { overflow: visible; border: none; }
  .lhr-sum { margin: 4px 0 6px; }
  .lhr-kpi { padding: 3px 10px; font-size: 9.5px; } .lhr-kpi b { font-size: 13px; }
  .lhr-chip { padding: 3px 8px; font-size: 9.5px; }
  .lhr-t th { font-size: 8.5px; padding: 3px 3px; } .lhr-t th em.qh { font-size: 8px; } .lhr-t tr.hg th { font-size: 8.5px; padding: 2px 3px; }
  .lhr-t td { font-size: 9.5px; padding: 3px 3px; }
  .lhr-t td.who b { font-size: 10px; } .lhr-t td.who small { font-size: 8px; }
  .lhr .v { padding: 0 5px; min-width: 20px; }
  .lhr b.nq { font-size: 10px; }
  .lhr-t tr.grp td { font-size: 9.5px; padding: 3px 8px; }
  .lhr-t tr { break-inside: avoid; }
  .lhr-legend { font-size: 8.5px; margin-top: 6px; }
}

/* ปุ่ม "วันนี้" — ปฏิทินเลือกวันที่ (thcal) และปฏิทินประวัติการลา (lh) */
.thcal-today, .lh-today { font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-text); background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: 999px; padding: 6px 14px; min-height: 34px; cursor: pointer; flex: none; }
.thcal-today:hover, .lh-today:hover { background: var(--color-bg); }
.lh-today { margin-left: 2px; }

/* (2026-10-25) ผลตรวจในตารางลงลา แบบ "ชิป" — ผ่าน=เขียว · รอ=เทา · เตือน=เหลือง · ผิด=แดง (แทนแถบสีเต็มช่อง)
   ผ่าน/รอ: ชิปสั้นอยู่กลางช่องท้ายแถว · เตือน/ผิด: แถบใต้แถว ชิปนำหน้าแล้วตามด้วยเหตุผล */
.qe-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 3px 11px 3px 4px; border-radius: 999px; font-size: 12.5px; line-height: 1.35; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.qe-chip b { font-weight: 800; flex: none; }
.qe-chip small { font-size: 12px; font-weight: 600; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qe-chip small::before { content: '·'; margin: 0 5px 0 1px; opacity: 0.6; }
.qe-chip-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; line-height: 1; font-weight: 900; color: #FFFFFF; }
.qe-chip.ok { background: #E3F4E8; color: #17773A; }
.qe-chip.ok .qe-chip-ic { background: #1E8E3E; }
.qe-chip.warn { background: #FFF0C7; color: #7A5A0B; }
.qe-chip.warn .qe-chip-ic { background: #E0A21B; }
.qe-chip.bad { background: #FBDAD6; color: #A8231B; }
.qe-chip.bad .qe-chip-ic { background: #D6362B; }
.qe-chip.wait { padding-left: 10px; background: #EEF0F4; color: var(--color-text-muted); font-weight: 600; }
.qe-chip.wait::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #AEB5C1; box-sizing: border-box; }
.qe-list .qe-row > .qe-status.ok, .qe-list .qe-row > .qe-status.wait { background: transparent; }
.qe-list .qe-row > .qe-status.warn, .qe-list .qe-row > .qe-status.bad { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.qe-list .qe-row > .qe-status.warn { background: #FFF8E3; color: #7A5A0B; }
.qe-list .qe-row > .qe-status.bad { background: #FEF1EF; color: #A8231B; }
.qe-list .qe-row > .qe-status .qe-check { display: contents; }
.qe-msg { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1200px) {
  .qe-list .qe-row > .qe-status.ok, .qe-list .qe-row > .qe-status.wait { justify-content: flex-start; padding: 0 10px; border-radius: 0; }
  .qe-list .qe-row > .qe-status.ok .qe-check, .qe-list .qe-row > .qe-status.wait .qe-check { display: flex; align-items: center; min-width: 0; width: 100%; }
  .qe-list .qe-row > .qe-status.ok .qe-short, .qe-list .qe-row > .qe-status.wait .qe-short { display: flex; min-width: 0; max-width: 100%; }
}

/* ---------- (2026-11-04) ป๊อปอัพ "รายการวันนี้": แท็บ + ค้นหา + ลาแยกกลุ่มตามประเภท ---------- */
.tact-top { flex: none; padding: 0 4px 10px; }
.tact-h { margin: 0; font-size: 19px; }
.tact-sub { margin-top: 3px; font-size: 13px; color: var(--color-text-muted); }
.tact-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tact-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.tact-tab { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tact-tab em { font-style: normal; font-size: 13px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--color-bg); color: var(--color-text-muted); }
.tact-tab.on { background: var(--color-blue); border-color: var(--color-blue); color: #fff; }
.tact-tab.on em { background: rgba(255, 255, 255, .25); color: inherit; }
.tact-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-red); display: block; }
.tact-q { flex: 1 1 100%; padding: 7px 12px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 14px; }
.tact-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 6px; }
.tact-empty { text-align: center; color: var(--color-text-muted); padding: 36px 0; }
.tact-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.tact-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tact-chip i { width: 10px; height: 10px; border-radius: 4px; display: block; }
.tact-chip b { color: var(--color-text-muted); font-weight: 800; }
.tact-chip.on { border-color: var(--color-blue); background: var(--color-surface); box-shadow: 0 0 0 1px var(--color-blue) inset; }
.tact-grp { border: 1.5px solid var(--color-border); border-radius: 16px; margin-bottom: 12px; overflow: hidden; background: var(--color-surface); }
.tact-gh { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: none; background: var(--color-bg); color: var(--color-text); font: inherit; text-align: left; cursor: pointer; }
.tact-bar { width: 5px; align-self: stretch; border-radius: 5px; flex: none; }
.tact-gt { font-weight: 800; font-size: 14px; }
.tact-gc { font-size: 13px; font-weight: 800; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); }
.tact-car { margin-left: auto; color: var(--color-text-muted); font-size: 13px; transition: transform .15s; }
.tact-grp.closed .tact-car { transform: rotate(-90deg); }
.tact-grp.closed .tact-gb { display: none; }
.tact-gb { padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.tact-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; cursor: pointer; }
.tact-row:hover { border-color: var(--color-blue); }
.tact-tx { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; row-gap: 0; }
.tact-nm { font-weight: 700; font-size: 13.5px; }
.tact-cd { font-weight: 400; color: var(--color-text-muted); }
.tact-sb { flex: none; font-size: 13px; color: var(--color-text-muted); }
.tact-pen { margin-left: 0; flex: none; color: var(--color-text-muted); }
.tact-bad { color: var(--color-red-dark); font-weight: 700; }
.tact-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; vertical-align: 1px; }
.tact-tag.in { background: rgba(30, 142, 62, .14); color: #1E8E3E; }
.tact-tag.out { background: rgba(214, 54, 43, .12); color: var(--color-red-dark); }
.tact-seg { display: inline-flex; gap: 3px; padding: 3px; margin-bottom: 12px; border-radius: 12px; background: var(--color-bg); }
.tact-seg button { border: none; background: transparent; color: var(--color-text-muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 9px; cursor: pointer; }
.tact-seg button.on { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
@media (max-width: 720px) {
}

/* ---------- (2026-11-14) รายงานผู้มีประวัติทุจริต (หน้าเช็คประวัติ) ---------- */
.mis-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.mis-q { flex: 1 1 220px; padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 14px; }
.mis-bar .btn-secondary { width: auto; padding: 9px 16px; }
.mis-ctl { display: contents; }
.mis-ctl[hidden] { display: none; }
.mis-bar .ysg-select { width: auto; min-width: 120px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.mis-scroll { overflow-x: auto; }
.mis-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mis-table th { text-align: left; font-size: 13px; color: var(--color-text-muted); padding: 8px 6px; border-bottom: 1.5px solid var(--color-border); white-space: nowrap; }
.mis-table td { padding: 8px 6px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.mis-table td small { display: block; color: var(--color-text-muted); font-size: 13px; }
.mis-table .mis-id { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mis-table .mis-dt { min-width: 150px; color: var(--color-red-dark); font-weight: 700; }
.mis-back { color: var(--color-red-dark); }
.mis-na { color: var(--color-text-muted); font-style: italic; }
.mis-ph { margin-bottom: 10px; }
.mis-ph b { display: block; font-size: 16px; }
.mis-ph span { display: block; font-size: 13px; color: #555; }
@media print {
  #misCard.mis-printing { border: none !important; box-shadow: none !important; padding: 0 !important; }
  #misCard.mis-printing .mis-table { font-size: 10.5px; }
  #misCard.mis-printing .mis-table th, #misCard.mis-printing .mis-table td { padding: 4px 6px; color: #000; }
  #misCard.mis-printing .mis-table td small { font-size: 9px; }
  #misCard.mis-printing .mis-table tr { page-break-inside: avoid; }
  #misCard.mis-printing .mis-table thead { display: table-header-group; }
  #misCard.mis-printing .mis-scroll { overflow: visible; }
}

/* ---------- (2026-11-14) ประวัติทุจริตเก่า: กล่องเตือนตอนเพิ่มพนักงาน + แถวกดดูรายละเอียดในหน้าเช็คประวัติ ---------- */
.lsw-modal.dupc-red h3 { color: var(--color-red-dark); }
.dupc-mis { margin: 8px 0; padding: 10px 12px; border: 1.5px solid var(--color-red); border-radius: 12px; background: var(--color-bg); }
.dupc-mis b { font-size: 14px; }
.dupc-mis small { display: block; margin-top: 3px; font-size: 13px; color: var(--color-text-muted); }
.dupc-mis small.bad { color: var(--color-red-dark); font-weight: 700; }
.dupc-tag { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 800; background: rgba(214, 54, 43, .12); color: var(--color-red-dark); }
.dupc-whyl { display: block; margin: 8px 0 4px; font-size: 13px; font-weight: 700; color: var(--color-text-muted); }
.dupc-why { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 14px; resize: vertical; }
.bgh-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--color-red); }
.bgh-row:hover { filter: brightness(.97); }
.bgh-go { flex: none; font-size: 13px; font-weight: 800; white-space: nowrap; }
.bgh-kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; margin: 0 0 4px; font-size: 14px; }
.bgh-kv dt { color: var(--color-text-muted); }
.bgh-kv dd { margin: 0; font-weight: 700; word-break: break-word; }

/* ==== (V.2) ตั้งค่าองค์กร — js/org-settings.js · ฟีเจอร์ที่ปิด = คลาส of-no-* บน body (core.js applyOrgFeatureClasses) ==== */
body.of-no-payroll [data-nav="payroll"],
body.of-no-background [data-nav="background"],
body.of-no-cert .rp-type[data-type="cert"],
body.of-no-cert [id="statCard-ใบรับรอง"],
body.of-no-announce #reminderBannerBox,
body.of-no-announce #reminderAnnCard { display: none !important; }
.org-login-logo { width: 120px; height: 120px; object-fit: contain; border-radius: 24px; }
.org-who { font-size: 13px; color: var(--color-text-muted); margin: 4px 0 12px; }
.org-grid { display: grid; gap: 16px; }
.org-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.org-sub { margin: 0 0 14px; font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.org-tag { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 1px 9px; background: var(--color-bg); color: var(--color-text-muted); }
.org-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.org-row2.org-tight { grid-template-columns: 110px 1fr; gap: 10px; }
.org-f { margin-bottom: 12px; }
.org-lbl { display: block; font-size: 13px; font-weight: 700; color: var(--color-text-muted); margin: 0 0 6px; }
.org-in { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 15px; }
.org-in:disabled { opacity: .7; }
.org-num { width: 78px; text-align: center; }
.org-logo-box { display: flex; gap: 14px; align-items: center; }
.org-logo { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--color-red), var(--color-blue)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.org-logo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.org-file-btn, .org-mini-btn { width: auto !important; padding: 8px 14px !important; font-size: 14px; cursor: pointer; display: inline-block; }
.org-login-prev { border: 1px dashed var(--color-border); border-radius: 18px; padding: 16px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.org-login-prev b { font-size: 18px; }
.org-login-prev small { color: var(--color-text-muted); font-size: 13px; }
.org-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.org-preset { text-align: left; border: 2px solid var(--color-border); background: var(--color-surface); color: var(--color-text); border-radius: 18px; padding: 14px; cursor: pointer; font: inherit; }
.org-preset:not(:disabled):hover { filter: brightness(0.98); box-shadow: var(--shadow-card); }
.org-preset:disabled { cursor: default; }
.org-preset.on { border-color: var(--color-red); box-shadow: 0 0 0 3px rgba(214, 54, 43, .12); }
.org-preset b { display: block; font-size: 15px; margin: 6px 0 4px; }
.org-preset small { display: block; font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.org-pol { display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; align-items: center; }
.org-q { font-size: 14px; font-weight: 700; }
.org-q small { display: block; color: var(--color-text-muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
.org-a { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: 14px; flex-wrap: wrap; }
.org-feat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.org-feat:last-child { border-bottom: 0; }
.org-feat b { font-size: 14px; }
.org-feat small { display: block; color: var(--color-text-muted); font-size: 13px; }
.org-later b { color: var(--color-text-muted); }
.org-later-tag { font-size: 13px; font-weight: 700; color: var(--color-text-muted); white-space: nowrap; }
.org-sw { width: 46px; height: 26px; border-radius: 999px; border: 0; background: #B9BDC4; position: relative; cursor: pointer; flex-shrink: 0; padding: 0; }
.org-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.org-sw[aria-checked="true"] { background: #1E8E3E; }
.org-sw[aria-checked="true"]::after { left: 23px; }
.org-sw:disabled { opacity: .55; cursor: default; }
.org-soon { opacity: .8; }
.org-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 0 0; }
.org-foot button { width: auto; padding: 12px 22px; }
@media (max-width: 720px) {
  .org-row2, .org-presets, .org-pol { grid-template-columns: 1fr; }
  .org-row2.org-tight { grid-template-columns: 90px 1fr; }
  .org-a { justify-content: flex-start; }
  .org-foot button { flex: 1; }
}

/* ==== THEMES:BEGIN — สร้างโดย theme-src/build-themes.mjs ห้ามแก้ตรงนี้ (แก้ที่ theme-src แล้วรันใหม่) ==== */
/* ---- [1] ใช้ทุกธีม (shared.css) ---- */
/* ค่าตั้งต้นของตัวแปรที่ light.css/shared ใช้ (ธีมสีเดิมไม่มีตัวแปรเหล่านี้) */
:root { --accent: var(--color-red); --accent-soft: #FDECEA; --soft: #F2F3F5; }
/* ---------- มือถือ: ไม่มีแถบด้านบน · ปุ่ม "บัญชี" เป็นช่องสุดท้ายในแถบเมนูล่าง (แถบเดียวต่อกัน) ---------- */
#mAcctBtn { display: none; }
@media (max-width: 639px) {
  .page-wrap > .top-bar { display: none !important; }
  .page-wrap { padding-top: calc(18px + env(safe-area-inset-top)) !important; }
  .nav-tab-bar:has(#mAcctBtn) { grid-template-columns: repeat(6, 1fr) !important; }
  .m-bottom-nav:has(#mAcctBtn) { grid-template-columns: repeat(5, 1fr) !important; }
  #mAcctBtn {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
    border: none; background: none; padding: 0 0 2px; min-width: 0; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);
  }
  #mAcctBtn .m-acct-av { position: relative; display: flex; padding: 3px 12px; }
  #mAcctBtn .acc2-av { width: 26px !important; height: 26px !important; font-size: 12px !important; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3px var(--color-border); }
  #mAcctBtn .m-acct-dot { position: absolute; top: -4px; right: 2px; font-style: normal; font-size: 12px; font-weight: 900; color: #FFFFFF; background: var(--color-red); border-radius: 999px; min-width: 16px; line-height: 16px; padding: 0 4px; text-align: center; border: 2px solid #FFFFFF; }
}
.m-acct-sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.m-acct-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; border-bottom: 1px solid var(--color-border); margin-bottom: 6px; }
.m-acct-head b { display: block; font-size: 17px; font-weight: 900; color: var(--color-text); }
.m-acct-head small { font-size: 12.5px; color: var(--color-text-muted); }
.m-acct-list { display: flex; flex-direction: column; }
.m-acct-row { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: none; padding: 13px 4px; font-family: inherit; text-align: left; cursor: pointer; border-bottom: 1px solid #F0EFEB; color: var(--color-text); }
.m-acct-row:last-child { border-bottom: none; }
.m-acct-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 18px; flex: none; }
.m-acct-tx { flex: 1; min-width: 0; }
.m-acct-tx b { display: block; font-size: 15px; }
.m-acct-tx small { display: block; font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-acct-go { font-style: normal; font-size: 20px; color: #B5B4BA; }
.m-acct-badge { font-style: normal; font-size: 12px; font-weight: 900; color: #FFFFFF; background: var(--color-red); border-radius: 999px; min-width: 22px; line-height: 22px; padding: 0 7px; text-align: center; }
.m-acct-badge.ok { background: #1E8E3E; }
.m-acct-row[data-k="logout"] b, .m-acct-row[data-k="logout"] .m-acct-ic { color: var(--accent); }
.m-acct-row[data-k="logout"] .m-acct-ic { background: var(--accent-soft); }

/* ---------- สวิตช์เลือกโหมด (เม็ดยา 3 ช่อง: 🎨 โหมดสี · ☀️ โหมดสว่าง · 🌙 โหมดมืด) ----------
   เว็บ = แถบบนขวา ข้างปุ่มตั้งค่า · หน้าล็อกอิน/สมัคร = มุมขวาบน · มือถือ = แถว "ธีม" ในแผงบัญชี
   ปุ่มกลมสีขาว (.thm-knob) เลื่อนตาม data-pos (0/1/2) · ไอคอนที่เลือกมีสี ที่ไม่ได้เลือกเป็นเทาจาง */
.ic-palette { --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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21.5a9.5 9.5 0 1 1 9.5-9.5c0 2.5-2 3.6-4 3.6h-2.1a1.8 1.8 0 0 0-1.3 3c.7.8.3 2.9-2.1 2.9z'/%3E%3Ccircle cx='7.6' cy='11.6' r='1' fill='black'/%3E%3Ccircle cx='10.4' cy='7.4' r='1' fill='black'/%3E%3Ccircle cx='15.2' cy='8' r='1' fill='black'/%3E%3C/svg%3E"); }
.ic-sun { --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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2.2M12 19.3v2.2M2.5 12h2.2M19.3 12h2.2M5.3 5.3l1.6 1.6M17.1 17.1l1.6 1.6M5.3 18.7l1.6-1.6M17.1 6.9l1.6-1.6'/%3E%3C/svg%3E"); }
.ic-moon { --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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.2A8 8 0 0 1 9.8 4 8 8 0 1 0 20 14.2Z'/%3E%3Cpath d='M17.5 3.2l.7 1.6 1.6.7-1.6.7-.7 1.6-.7-1.6-1.6-.7 1.6-.7z' fill='black' stroke-width='1'/%3E%3C/svg%3E"); }
.ic-contrast { --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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 3a9 9 0 0 1 0 18z' fill='black'/%3E%3C/svg%3E"); }
.thm-sw {
  --w: 36px; position: relative; display: inline-grid; grid-template-columns: repeat(3, var(--w)); align-items: center;
  height: 30px; margin: 2px; border-radius: 999px; flex: none;
  background: #E1E4EE; box-shadow: inset 0 1px 3px rgba(40, 50, 90, 0.18);
}
.thm-knob {
  position: absolute; top: -2px; left: 1px; width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 2px 7px rgba(30, 40, 80, 0.28), 0 0 0 1px rgba(30, 40, 80, 0.04); transition: transform 0.24s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.thm-sw[data-pos='1'] .thm-knob { transform: translateX(var(--w)); }
.thm-sw[data-pos='2'] .thm-knob { transform: translateX(calc(var(--w) * 2)); }
.thm-sw button {
  position: relative; z-index: 1; width: var(--w); height: 30px; padding: 0; border: none; background: none; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; font-size: 17px; color: #9AA3BC;
}
.thm-sw button .ic { width: 1em; height: 1em; transition: color 0.2s ease; }
.thm-sw button[aria-checked='true'][data-t='light'] { color: #F59E0B; }
.thm-sw button[aria-checked='true'][data-t='dark'] { color: #4F67D8; }
.thm-sw button[aria-checked='true'][data-t='color'] .ic { background: linear-gradient(135deg, #D6362B 10%, #E0A21B 50%, #1259C3 90%); }
.thm-sw button:not([aria-checked='true']):hover { color: #6F7896; }
.thm-sw button:focus-visible { outline-offset: 1px; }
/* ---------- ปุ่มโหมด (หน้าล็อกอิน/สมัครใช้งาน): ปุ่มเดียวแสดงโหมดปัจจุบัน กดแล้วค่อยกางตัวเลือก ---------- */
.ic-check { --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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.thm-pick { position: relative; display: inline-flex; flex: none; }
.thm-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px 0 11px; border-radius: 999px; cursor: pointer;
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text);
  font-family: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.thm-btn .ic { width: 18px; height: 18px; flex: none; }
.thm-btn[data-cur='light'] .ic { color: #F59E0B; }
.thm-btn[data-cur='dark'] .ic { color: #4F67D8; }
.thm-btn[data-cur='color'] .ic { background: linear-gradient(135deg, #D6362B 10%, #E0A21B 50%, #1259C3 90%); }
.thm-caret { width: 6px; height: 6px; margin: -3px 1px 0 0; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg); opacity: 0.55; flex: none; }
.thm-btn[aria-expanded='true'] .thm-caret { transform: rotate(-135deg); margin-top: 3px; }
.thm-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 190px; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 20, 30, 0.16); animation: thmIn 0.14s ease;
}
@keyframes thmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.thm-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: none; border-radius: 10px; background: none;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--color-text); cursor: pointer; text-align: left;
}
.thm-opt:hover { background: var(--soft); }
.thm-opt > span { flex: 1; }
.thm-opt .ic { width: 19px; height: 19px; flex: none; }
.thm-opt[data-t='light'] .ic { color: #F59E0B; }
.thm-opt[data-t='dark'] .ic { color: #4F67D8; }
.thm-opt[data-t='color'] .ic { background: linear-gradient(135deg, #D6362B 10%, #E0A21B 50%, #1259C3 90%); }
.thm-opt .ic-check { width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.thm-opt[aria-checked='true'] .ic-check { visibility: visible; background: var(--accent); }
.thm-opt[aria-checked='true'] { font-weight: 800; }
/* หน้าล็อกอิน/สมัครใช้งาน: มุมขวาบน */
.thm-pick.login-thm { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px; z-index: 20; }
html:not([data-theme]) .thm-pick.login-thm .thm-btn { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.34); color: #FFFFFF; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html:not([data-theme]) .thm-pick.login-thm .thm-btn[data-cur='color'] .ic { background: #FFFFFF; }
/* ---------- สวิตช์เม็ดยา: แถว "โหมด" ในหน้าตั้งค่า (ฟันเฟือง) และแผงบัญชีบนมือถือ ---------- */
/* มือถือ: แถว "โหมด" ในแผงบัญชี (ชื่อซ้าย สวิตช์ขวา) */
.m-acct-trow { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid #F0EFEB; color: var(--color-text); }
.m-acct-trow .thm-sw { margin-right: 4px; }
.m-acct-go { transition: transform 0.15s ease; }

/* Payroll ตรวจก่อนออกไฟล์: ตัวเลขขาวบนวงสีเหลือง อ่านยาก → ทองเข้มขึ้น (ทุกธีม) */
.prp-ck2.y .n { background: #B7860B; }
/* รายงานสิทธิ์การลา: ป้ายเกรด "–" ขาวบนเทาอ่อน อ่านยาก → เทาเข้มขึ้น · ใบรับรอง: ชื่อสีทองตอนเลือก อ่านยากบนพื้นขาว */
.g-x { background: #80868B; }
.rp-type[data-type="cert"] { --c: #B7860B; }

/* (2026-10-12) ลบข้อความแนะนำการใช้งานแล้ว — ช่องคำอธิบายที่ว่าง (เช่น หัวฟอร์มเพิ่มสาขา/บริษัท หัวแผงย้ายสาขา) ไม่ต้องกินที่ */
.hint-text:empty, .mx-hd small:empty { display: none; }

/* ---------- (2026-10-13) หน้าแจ้งลา: ช่องพนักงานแบบ combobox (พิมพ์ค้น + เลือกในช่องเดียว) ---------- */
.qe-cb { position: relative; }
.qe-cb .qe-emp-in { padding-right: 26px; text-overflow: ellipsis; }
.qe-cb-ar { position: absolute; right: 9px; top: 12px; font-style: normal; font-size: 13px; color: var(--color-text-muted); pointer-events: none; }
.qe-cb-list { margin-top: 4px; max-height: 232px; overflow-y: auto; border: 1.5px solid var(--color-border); border-radius: 12px; background: var(--color-surface); padding: 4px; -webkit-overflow-scrolling: touch; }
.qe-cb-list[hidden] { display: none; }
.qe-cb-opt { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: none; border-radius: 9px; padding: 7px 10px; font-family: inherit; cursor: pointer; color: var(--color-text); }
.qe-cb-opt b { font-size: 13.5px; }
.qe-cb-opt small { font-size: 12px; color: var(--color-text-muted); }
.qe-cb-opt:hover, .qe-cb-opt.on { background: var(--color-bg); }
.qe-cb-none { margin: 0; padding: 10px; font-size: 13px; color: var(--color-text-muted); }

/* ประเภทลา: ปุ่มที่ใช้บ่อยอยู่บรรทัดเดียว (เลื่อนข้างได้ถ้าจอแคบมาก) + "อื่นๆ" ขยายตัวที่เหลือ */
.qe-types { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 6px; min-width: 0; max-width: 100%; }
.qe-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
@media (max-width: 640px) { .qe-body { grid-template-columns: minmax(0, 1fr); } }
.qe-types-main { display: flex; gap: 6px; }
.qe-types-main { min-width: 0; flex-wrap: wrap; padding: 1px; }
.qe-types-main::-webkit-scrollbar { display: none; }
.qe-types .qe-ty { flex: none; white-space: nowrap; }
.qe-more-ar { font-size: 12px; margin-left: 2px; }
@media (max-width: 640px) {
  .qe-types-main { gap: 3px; flex-wrap: wrap; overflow: visible; } /* จอแคบมากที่สุดยังไม่พอ → ตัดลงบรรทัดถัดไปแทนการเลื่อนซ่อน */
  .qe-types-main .qe-ty { font-size: 13px; padding: 6px 5px; gap: 0; flex: 0 1 auto; }
  .qe-types-main .qe-ty i { display: none; }
  .qe-types-main .qe-ty.on i { display: none; }
}

/* ---------- (2026-10-13) ปุ่มเลือกหลายตัวเลือกทุกหน้า → สไตล์สวิตช์ (รางเว้า + ปุ่มลอยเลื่อนไปที่ตัวเลือก) ---------- */
:is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg, .rm-seg) {
  border: none; border-radius: 999px; padding: 3px; gap: 2px;
  background: linear-gradient(180deg, #D9DDE6, #E9ECF2); box-shadow: inset 0 2px 4px rgba(24, 34, 70, 0.22), 0 1px 0 rgba(255, 255, 255, 0.8);
}
:is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg) > button, .rm-seg > label {
  border-radius: 999px; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.25s ease; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
:is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg) > button:is(.on, [aria-pressed='true']), .rm-seg > label:has(input:checked) {
  background: linear-gradient(180deg, #FFFFFF, #F0F2F6); color: var(--color-text);
  box-shadow: 0 2px 7px rgba(24, 34, 70, 0.3), 0 0 0 1.5px var(--accent);
}
:is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .lr-seg) > button.on::before, .rm-seg > label:has(input:checked)::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none;
}
.pr-seg > button { display: inline-block; }

/* ---------- (2026-10-13 รอบ 2) ปุ่มสลับที่เหลือทุกหน้า: เกณฑ์เกรด · โหมดลงลา · เมนูย่อยตั้งค่า · แท็บแก้ไขพนักงาน · สมัครใช้งาน ---------- */
:is(.lr-kmode, .lm-seg, .settings-subnav-bar, .pe-tabs) {
  border: none; border-radius: 999px; padding: 3px; gap: 2px; overflow: visible;
  background: linear-gradient(180deg, #D9DDE6, #E9ECF2); box-shadow: inset 0 2px 4px rgba(24, 34, 70, 0.22), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.lm-seg { display: inline-flex; max-width: 100%; margin: 0 0 4px; }
.pe-tabs { margin: 10px 16px 4px; }
.settings-subnav-bar { margin: -4px 0 16px; width: fit-content; max-width: 100%; border-radius: 22px; }
:is(.lr-kmode, .lm-seg, .settings-subnav-bar, .pe-tabs) > :is(button) {
  border: none; background: transparent; border-radius: 999px; color: var(--color-text-muted); box-shadow: none; font-family: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.25s ease;
}
.lm-seg > button { padding: 9px 16px; min-height: 40px; font-size: 13px; white-space: nowrap; }
.pe-tab { flex: 1; border-bottom: none !important; padding: 8px 12px; min-height: 40px; }
.settings-subnav-bar > .settings-subnav-btn { padding: 7px 14px; font-size: 12.5px; }
:is(.lr-kmode > button[aria-pressed='true'], .lm-seg > button.on, .lm-seg > button[aria-pressed='true'], .settings-subnav-bar > .settings-subnav-btn.active, .pe-tab.on) {
  background: linear-gradient(180deg, #FFFFFF, #F0F2F6) !important; color: var(--color-text) !important;
  box-shadow: 0 2px 7px rgba(24, 34, 70, 0.3), 0 0 0 1.5px var(--accent) !important;
}
.lr-kmode > button[data-k='new'][aria-pressed='true'] { color: var(--color-blue) !important; }
:is(.lr-kmode > button[aria-pressed='true'], .lm-seg > button.on, .settings-subnav-bar > .settings-subnav-btn.active, .pe-tab.on)::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none;
}
/* หน้าสมัครใช้งาน (กระจกบนพื้นสี) */
.su-seg { gap: 2px; padding: 3px; border-radius: 999px; background: rgba(20, 20, 40, 0.2); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25); }
.su-seg button { border: none !important; background: transparent !important; border-radius: 999px; transition: background 0.2s ease, box-shadow 0.25s ease; }
.su-seg button[aria-checked='true'] { background: linear-gradient(180deg, #FFFFFF, #F0F2F6) !important; box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3) !important; }
/* มือถือ: กฎเดิมทำ seg-group/เมนูย่อยเป็นการ์ดสี่เหลี่ยมมน → ให้เป็นสวิตช์เหมือนกัน */
@media (max-width: 639px) {
  .seg-group, .settings-subnav-bar { background: linear-gradient(180deg, #D9DDE6, #E9ECF2) !important; border-radius: 22px !important; box-shadow: inset 0 2px 4px rgba(24, 34, 70, 0.22) !important; width: 100%; }
  .seg-group > button, .settings-subnav-bar > .settings-subnav-btn { border-radius: 999px !important; }
  .seg-group > button[aria-pressed='true'], .settings-subnav-bar > .settings-subnav-btn.active {
    background: linear-gradient(180deg, #FFFFFF, #F0F2F6) !important; color: var(--color-text) !important;
    box-shadow: 0 2px 7px rgba(24, 34, 70, 0.3), 0 0 0 1.5px var(--accent) !important;
  }
  .lm-seg { display: grid !important; }
  /* (2026-10-16) 3 ปุ่มใน 330px: ไอคอน+จุด+ข้อความในบรรทัดเดียวกันชนกัน → ไอคอนอยู่บน ข้อความอยู่ล่าง ไม่มีจุด (กรอบสีบอกปุ่มที่เลือกอยู่แล้ว) */
  .lm-seg > button { flex-direction: column; gap: 3px !important; padding: 7px 2px !important; min-height: 54px; font-size: 13px !important; line-height: 1.25; white-space: normal !important; text-align: center; }
  .lm-seg > button.on::before, .lm-seg > button[aria-pressed='true']::before { display: none !important; }
  /* แท็บในหน้าต่างแก้ไขพนักงาน: ข้อความ "ประวัติการแก้ไข" ถูกตัดท้ายเพราะมีจุดนำหน้า → ตัดจุดออก ให้ข้อความขึ้นบรรทัดใหม่ได้ */
  .pe-tab { padding: 8px 4px !important; white-space: normal !important; text-align: center; line-height: 1.25; }
  .pe-tab.on::before { display: none !important; }
}

/* หน้าต่างลอย "ประเภทอื่นๆ" */
.qe-pop { position: fixed; z-index: 9000; min-width: 220px; max-width: calc(100vw - 16px); max-height: 60vh; overflow-y: auto; padding: 6px; background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: 16px; box-shadow: 0 14px 36px rgba(20, 28, 60, 0.28); display: flex; flex-direction: column; gap: 2px; }
.qe-pop-ty { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--color-text); cursor: pointer; }
.qe-pop-ty i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.qe-pop-ty:hover { background: var(--color-bg); }
.qe-pop-ty.on { background: var(--color-bg); box-shadow: inset 0 0 0 1.5px var(--c); }

/* ปฏิทินการลา: โหมดกะทัดรัด (แถวเตี้ย) ให้ทั้งเดือนพอดีจอ */
.lc-grid.lc-compact .lc-cell { padding: 3px 5px 4px; }
.lc-grid.lc-compact .lc-dn { font-size: 13px; }
.lc-grid.lc-compact .lc-balls { gap: 2px; margin-top: 2px; }
.lc-grid.lc-compact .lc-ball { width: 20px; height: 20px; font-size: 13px; }
.lc-grid.lc-compact .lc-total { font-size: 13px; margin-top: 2px; }
.lc-grid.lc-compact .lc-hol { font-size: 12px; }
/* โหมดกะทัดรัด: ลูกบอลแถวเดียว · "N คน" ย้ายไปมุมขวาบนข้างเลขวัน (ไม่กินบรรทัด) · ซ่อนปุ่ม ＋ ที่โผล่ตอนชี้ */
.lc-grid.lc-compact .lc-balls { flex-wrap: nowrap; overflow: hidden; }
.lc-grid.lc-compact .lc-ball { flex: none; }
.lc-grid.lc-compact .lc-total { position: absolute; top: 3px; right: 6px; margin: 0; }
.lc-grid.lc-compact .lc-plus { display: none; }

/* ช่องพนักงาน: รายชื่อลอยทับ (ไม่ดันเนื้อหาด้านล่างลงไป) */
.qe-list .qe-row { overflow: visible; }
.qe-list .qe-row > .qe-status:last-child { border-radius: 0 0 14px 14px; }
.qe-cb-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; box-shadow: 0 12px 30px rgba(20, 28, 60, 0.22); max-height: 280px; }

/* ---------- (2026-10-21) ปุ่มแบบ "มีมิติ" — แสงขอบบน + ขอบล่างเข้ม + เงาลอยสีเดียวกับปุ่ม (ใช้ทุกโหมด) ----------
   (2026-10-22) ชี้/กด เปลี่ยนแค่เงาและความสว่าง ไม่ขยับตัวปุ่ม — ปุ่มที่ขยับตอนกดทำให้กดขอบปุ่มไม่ติด
   ทำด้วย box-shadow อย่างเดียว ไม่แตะสีพื้นของปุ่ม จึงใช้ได้กับปุ่มทุกสี · สีทั้งหมดอยู่ในตัวแปร --d3-* (โหมดมืดตั้งค่าใหม่ใน dark.css)
   ห้ามใส่สีตรง ๆ ในกฎด้านล่าง ไม่งั้นตัวสร้างโหมดมืดจะย้อมสีแสงขาวเป็นกรมท่า */
:root {
  --d3-hl: rgba(255, 255, 255, 0.3); --d3-hl-sec: rgba(255, 255, 255, 0.9); --d3-lo: rgba(0, 0, 0, 0.14); --d3-lo-sec: rgba(17, 24, 39, 0.05);
  --d3-press: rgba(0, 0, 0, 0.22); --d3-press-sec: rgba(17, 24, 39, 0.1);
  --d3-drop-sec: rgba(17, 24, 39, 0.22); --d3-drop-tile: rgba(17, 40, 90, 0.5);
  --d3-glow: color-mix(in srgb, var(--accent) 55%, transparent);
  --d3-tile-blue: linear-gradient(180deg, #3A6FD0 0%, #1E4598 100%);
  --d3-tile-green: linear-gradient(180deg, #34B062 0%, #1C7A3E 100%);
  --d3-tile-gold: linear-gradient(180deg, #F2C14E 0%, #B8860B 100%);
}
.btn-primary, .bgp-btn.pri, .prp-eb.pdf {
  box-shadow: inset 0 1px 0 var(--d3-hl), inset 0 -3px 0 var(--d3-lo), 0 8px 18px -6px var(--d3-glow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn-secondary, .bgp-btn:not(.pri), .prp-eb:not(.pdf) {
  box-shadow: inset 0 1px 0 var(--d3-hl-sec), inset 0 -2px 0 var(--d3-lo-sec), 0 4px 10px -5px var(--d3-drop-sec);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
@media (hover: hover) {
  .btn-primary:not(:disabled):hover, .bgp-btn.pri:not(:disabled):hover, .prp-eb.pdf:not(:disabled):hover {
    filter: brightness(1.05);
    box-shadow: inset 0 1px 0 var(--d3-hl), inset 0 -3px 0 var(--d3-lo), 0 12px 22px -6px var(--d3-glow);
  }
  .btn-secondary:not(:disabled):hover, .bgp-btn:not(.pri):not(:disabled):hover, .prp-eb:not(.pdf):not(:disabled):hover {
    box-shadow: inset 0 1px 0 var(--d3-hl-sec), inset 0 -2px 0 var(--d3-lo-sec), 0 8px 16px -6px var(--d3-drop-sec);
  }
}
.btn-primary:not(:disabled):active, .bgp-btn.pri:not(:disabled):active, .prp-eb.pdf:not(:disabled):active {
  opacity: 1; box-shadow: inset 0 2px 4px var(--d3-press), 0 3px 8px -4px var(--d3-glow);
}
.btn-secondary:not(:disabled):active, .bgp-btn:not(.pri):not(:disabled):active, .prp-eb:not(.pdf):not(:disabled):active {
  box-shadow: inset 0 2px 4px var(--d3-press-sec);
}
.btn-primary:disabled, .btn-secondary:disabled, .bgp-btn:disabled { box-shadow: none; filter: none; }

/* ไอคอนในกล่องเครื่องมือ (นำเข้า/ส่งออก) และกล่องไฟล์นำเข้า — แผ่นสีไล่เฉด ไอคอนขาว มีเงา */
html .tool-ic.imp, html .imp-drop .imp-ic { background: var(--d3-tile-blue); color: #FFFFFF; }
html .tool-ic.exp { background: var(--d3-tile-green); color: #FFFFFF; }
html .imp-dl .imp-ic { background: var(--d3-tile-gold); color: #FFFFFF; }
html .tool-ic.imp, html .tool-ic.exp, html .imp-ic { box-shadow: inset 0 1px 0 var(--d3-hl), inset 0 -2px 0 var(--d3-lo), 0 6px 14px -5px var(--d3-drop-tile); }
.imp-ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; }
.imp-ic .ic { width: 24px; height: 24px; vertical-align: 0; }

/* (2026-10-21) ปุ่มยืนยันสีเขียว "ส่งสรุปแล้ว" (แจ้งเตือนอัพเดตข้อมูล) — มีมิติแบบเดียวกับปุ่มหลัก เงาเป็นสีเขียวของตัวเอง */
.rm-okbtn {
  --d3-glow: color-mix(in srgb, #1E8E3E 50%, transparent);
  box-shadow: inset 0 1px 0 var(--d3-hl), inset 0 -3px 0 var(--d3-lo), 0 8px 18px -6px var(--d3-glow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
@media (hover: hover) { .rm-okbtn:not(:disabled):hover { filter: brightness(1.05); } }
.rm-okbtn:not(:disabled):active { box-shadow: inset 0 2px 4px var(--d3-press), 0 3px 8px -4px var(--d3-glow); }
.rm-okbtn:disabled { box-shadow: none; }

/* (2026-10-21) ป้ายไอคอนมุมวงแหวนบนแดชบอร์ด — เป็นเม็ดสีไล่เฉดตามสีของวง (--c) ไอคอนขาว มีเงา */
html .db-mini .db-mt span {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, white), var(--c));
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 var(--d3-hl), inset 0 -2px 0 var(--d3-lo), 0 4px 9px -3px color-mix(in srgb, var(--c) 60%, transparent);
}

/* ---------- (2026-10-24) หน้า "ลงแบบตาราง": จอกว้างเป็นตารางมีกรอบ แถวละรายการ · จอแคบ/มือถือเป็นการ์ดเหมือนเดิม ---------- */
.qe-thead, .qe-tsel, .qe-spansel, .qe-dup { display: none; }
@media (min-width: 1200px) {
  .qe-list { --qe-cols: 36px minmax(88px, 0.7fr) minmax(130px, 1.1fr) minmax(108px, 0.85fr) minmax(150px, 1.1fr) minmax(88px, 0.65fr) minmax(96px, 0.8fr) minmax(132px, 1fr) 62px; max-width: none; display: block; gap: 0; border: 1.5px solid #B9C0CC; border-radius: 10px; background: #FFFFFF; }
  .qe-list + .qe-foot { max-width: none; }
  .qe-thead { position: sticky; top: 56px; z-index: 6; display: grid; grid-template-columns: var(--qe-cols); background: #E9EDF3; border-bottom: 2px solid #8D97A8; border-radius: 8px 8px 0 0; }
  .qe-thead span { padding: 11px 6px; text-align: center; font-size: 13px; font-weight: 700; color: #3A4352; border-right: 1px solid #CBD1DB; }
  .qe-thead span:last-child { border-right: none; }
  .qe-list .qe-row { display: grid; grid-template-columns: var(--qe-cols); border: none; border-bottom: 1px solid #B9C0CC; border-radius: 0; background: #FFFFFF; }
  .qe-list .qe-row:last-child { border-bottom: none; }
  .qe-list .qe-row:focus-within { box-shadow: inset 0 0 0 2px var(--color-blue); border-color: #B9C0CC; }
  .qe-ch, .qe-body { display: contents; }
  .qe-ch b, .qe-ch small, .qe-open, .qe-f > label { display: none; }
  .qe-f:has(.qe-mat) > label { display: block; font-size: 12px; margin-bottom: 2px; }
  .qe-ch .qe-no { grid-column: 1; grid-row: 1; width: auto; height: auto; border-radius: 0; background: #F1F3F7; color: #5B6576; font-size: 13px; border-right: 1.5px solid #B9C0CC; }
  .qe-row:focus-within .qe-ch .qe-no { background: #DCE7FA; color: var(--color-blue); }
  .qe-body > .qe-f { grid-row: 1; display: flex; flex-direction: column; justify-content: center; padding: 6px 8px; border-right: 1px solid #CBD1DB; min-width: 0; }
  .qe-body > .qe-f:nth-child(1) { grid-column: 2; }
  .qe-body > .qe-f:nth-child(2) { grid-column: 3; }
  .qe-body > .qe-f:nth-child(3) { grid-column: 4; }
  .qe-body > .qe-f:nth-child(4) { grid-column: 5; }
  .qe-body > .qe-f:nth-child(5) { grid-column: 6; }
  .qe-body > .qe-f:nth-child(6) { grid-column: 7; border-right: 1px solid #CBD1DB; }
  .qe-ch .qe-dup, .qe-ch .qe-del { grid-column: 9; grid-row: 1; align-self: center; margin: 0; }
  .qe-ch .qe-dup { display: block; justify-self: start; margin-left: 8px; border: none; background: none; color: var(--color-text-muted); font-size: 16px; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; padding: 0; }
  .qe-ch .qe-dup:hover { background: var(--color-bg); color: var(--color-blue); }
  .qe-ch .qe-del { justify-self: end; margin-right: 8px; width: 30px; border-radius: 50%; }
  .qe-ch .qe-del:hover { background: var(--color-bg); }
  .qe-types { display: none; }
  .qe-tsel { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 38px; padding: 6px 8px; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--color-text); background: transparent; border: 1.5px solid transparent; border-radius: 8px; cursor: pointer; text-align: left; }
  .qe-tsel:hover { border-color: var(--color-border); }
  .qe-tsel i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
  .qe-tsel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qe-tsel em { font-style: normal; font-size: 12px; color: var(--color-text-muted); }
  .qe-spansel { display: block; }
  .qe-f > .qe-seg:not(.qe-certseg) { display: none; }
  .qe-list .qe-row .qe-in { border-color: transparent; background: transparent; height: 38px; min-height: 38px; }
  .qe-list .qe-row .qe-in:hover { border-color: var(--color-border); }
  .qe-list .qe-row .qe-in:focus { border-color: var(--color-blue); background: #FFFFFF; }
  .qe-list .qe-row .qe-date .thcal-trigger { border-color: transparent !important; background: transparent !important; }
  .qe-list .qe-row .qe-date .thcal-trigger:hover { border-color: var(--color-border) !important; }
  .qe-list .qe-row .qe-multi { margin-top: 2px; }
  .qe-list .qe-row .qe-notecell { flex-wrap: wrap; gap: 4px; }
  .qe-list .qe-row > .qe-status { grid-column: 1 / -1; grid-row: 2; padding: 6px 14px 6px 56px; font-size: 13px; border-top: 1px solid #CBD1DB; border-radius: 0; }
  .qe-list .qe-row > .qe-status.wait { font-size: 12px; padding-top: 4px; padding-bottom: 4px; }
}
@media (min-width: 1200px) {
  .qe-list .qe-row .qe-date .thcal-trigger { font-size: 12.5px !important; white-space: nowrap; padding-left: 6px !important; padding-right: 6px !important; }
  .qe-list .qe-row .qe-notecell { flex-direction: column; align-items: stretch; }
  .qe-list .qe-row .qe-certseg { width: 100%; flex-wrap: wrap; }
  .qe-list .qe-row .qe-certseg button { flex: 1 1 auto; font-size: 12px; padding: 5px 4px; }
}
/* หนึ่งรายการ = หนึ่งบรรทัด: ผลตรวจที่ผ่าน/รอกรอกอยู่ในช่องท้ายแถว (ข้อความสั้น ชี้ดูเต็มได้) · เตือน/ติดขยายเป็นแถบเต็มใต้แถว */
.qe-short { display: none; }
@media (min-width: 1200px) {
  .qe-long { display: inline; }
  .qe-list .qe-row > .qe-status.ok, .qe-list .qe-row > .qe-status.wait { grid-column: 8; grid-row: 1; display: flex; align-items: center; min-width: 0; padding: 0 8px; border-top: none; border-left: 1px solid #CBD1DB; font-size: 12.5px; white-space: nowrap; }
  .qe-list .qe-row > .qe-status.ok .qe-check, .qe-list .qe-row > .qe-status.wait .qe-check { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .qe-list .qe-row > .qe-status.ok .qe-long, .qe-list .qe-row > .qe-status.wait .qe-long { display: none; }
  .qe-list .qe-row > .qe-status.ok .qe-short, .qe-list .qe-row > .qe-status.wait .qe-short { display: inline; }
  .qe-list .qe-row > .qe-status.wait { background: transparent; }
}
/* แถบล่าง (เพิ่มรายการ / บันทึกทั้งหมด) ลอยติดล่างจอเสมอ ไม่ต้องเลื่อนหา */
.qe-list + .qe-foot { position: sticky; bottom: 12px; z-index: 20; box-shadow: 0 -4px 22px rgba(20, 28, 60, 0.14); }
@media (max-width: 639px) {
  .qe-list + .qe-foot { bottom: calc(104px + env(safe-area-inset-bottom)); }
}
.qe-certsel { display: none; }
@media (min-width: 1200px) {
  .qe-list .qe-row .qe-certsel { display: block; }
  .qe-list .qe-row .qe-certseg { display: none; }
}
/* การ์ดบนจอแคบ: ชื่อยาวห้ามบีบปุ่ม ✕ / "แก้ ›" ให้เล็กจนกดไม่ติด (เดิมที่ 360px ปุ่มลบเหลือกว้าง 11px) */
@media (max-width: 1199px) {
  .qe-ch b { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
  .qe-ch .qe-open, .qe-ch .qe-dup { flex: none; }
  .qe-ch .qe-del { flex: none; min-width: 40px; height: 40px; }
}
/* ผลตรวจที่ผ่าน/รอกรอก ใช้ข้อความสั้นบรรทัดเดียวทุกขนาดจอ (การ์ดมือถือด้วย) — ข้อความเต็มดูได้ที่ title · กันความสูงการ์ดกระโดดตอนผลตรวจกลับมา (ปุ่มเลื่อนหนีนิ้ว) */
.qe-status.ok .qe-long, .qe-status.wait .qe-long { display: none; }
.qe-status.ok .qe-short, .qe-status.wait .qe-short { display: inline; }
@media (max-width: 639px) {
  .qe-list + .qe-foot { padding: 8px 10px; gap: 8px; }
  .qe-list + .qe-foot .qe-sum { flex-basis: 100%; font-size: 12.5px; }
  .qe-list + .qe-foot button { min-height: 42px; padding: 6px 12px; white-space: nowrap; }
}

/* ---------- (2026-10-24) ตารางลงลา: ช่องเลือกเป็นปุ่ม + หน้าต่างลอยของเราเอง (แทน select ของเบราว์เซอร์) ---------- */
.qe-pk { align-items: center; gap: 6px; text-align: left; cursor: pointer; color: var(--color-text); }
.qe-branch.qe-pk { display: flex; }
.qe-pk-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-pk-v b { font-weight: 800; }
.qe-pk-v em { font-style: normal; font-size: 13px; color: var(--color-text-muted); }
.qe-pk-ph { color: var(--color-text-muted); }
.qe-pk-ar { font-style: normal; font-size: 13px; color: var(--color-text-muted); flex: none; }
.qe-pk[aria-expanded='true'] { border-color: var(--color-blue); }
.qe-pop.qe-pick { display: flex; flex-direction: column; gap: 6px; overflow: hidden; padding: 6px; border-radius: 14px; }
.qe-pick-q { width: 100%; height: 42px; padding: 0 12px; border: 1.5px solid var(--color-border); border-radius: 10px; background: var(--color-bg); font-family: inherit; font-size: 14px; box-sizing: border-box; color: var(--color-text); }
.qe-pick-q:focus { outline: none; border-color: var(--color-blue); background: var(--color-surface); }
.qe-pick-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.qe-pk-o { flex: none; }
.qe-pk-o b { font-size: 14px; font-weight: 800; flex: none; }
.qe-pk-o em { font-style: normal; font-size: 13.5px; font-weight: 500; color: var(--color-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-pk-o.hl { background: var(--color-bg); }
.qe-pk-o.on { box-shadow: inset 0 0 0 1.5px var(--color-blue); }
/* รายชื่อพนักงาน (ป๊อปอัพกว้าง ข้อมูลครบ: ชื่อ / รหัส · สาขา · ตำแหน่ง) */
.qe-list .qe-cb-list { z-index: 9000; padding: 6px; border-radius: 14px; }
.qe-list .qe-cb-opt { padding: 9px 12px; gap: 2px; }
.qe-list .qe-cb-opt b { font-size: 14.5px; }
.qe-list .qe-cb-opt small { font-size: 13px; }
.qe-cb-opt.hl { background: var(--color-bg); }
@media (min-width: 1200px) {
  /* ตารางลงลากว้างขึ้นกว่าหน้าอื่น (หน้าปกติกว้าง 1040px แคบเกินไป ข้อความในช่องถูกตัด) */
  .page-wrap:has(.qe-list) { max-width: 1280px; }
  .qe-list .qe-row .qe-spansel, .qe-list .qe-row .qe-certsel { display: flex; }
  .qe-list { --qe-cols: 36px minmax(104px, 0.8fr) minmax(170px, 1.3fr) minmax(132px, 1fr) minmax(150px, 1.1fr) minmax(104px, 0.75fr) minmax(120px, 0.9fr) minmax(150px, 1.1fr) 62px; }
  .qe-list .qe-row .qe-pk { padding: 6px 8px; font-size: 13.5px; }
  .qe-list .qe-row .qe-in { font-size: 13.5px; }
  .qe-list .qe-row .qe-in::placeholder { font-size: 13px; }
}

/* ---------- (2026-10-25) สิทธิ์การลา (สายตรวจ): ช่องสถานะเลือกหลายสถานะ ---------- */
.lri-multi { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lri-multi[aria-expanded='true'] { border-color: var(--color-blue); }
.lri-statpop { min-width: 240px; }
.lri-opt { gap: 10px; }
.lri-opt b { flex: 1; font-size: 14px; font-weight: 700; }
.lri-opt em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.lri-opt.on { box-shadow: none; }
.lri-cb { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--color-border); background: var(--color-surface); font-size: 13px; font-weight: 900; line-height: 1; color: transparent; }
.lri-opt.on .lri-cb { background: var(--color-blue); border-color: var(--color-blue); color: #FFFFFF; }

/* ---------- (2026-10-25) หน้า "ข้อมูลของฉัน" (ฟันเฟือง) ---------- */
.myinfo-card { background: var(--color-surface); border-radius: 22px; padding: 22px 20px 18px; max-width: 440px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(15, 20, 40, 0.28); }
.myinfo-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.myinfo-av { flex: none; display: flex; }
.myinfo-head h3 { margin: 0; font-size: 19px; font-weight: 900; }
.myinfo-head p { margin: 2px 0 0; font-size: 13px; color: var(--color-text-muted); }
.myinfo-box { background: var(--color-bg); border-radius: 16px; padding: 2px 16px; }
.myinfo-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.myinfo-row:last-child { border-bottom: none; }
.myinfo-row > span { color: var(--color-text-muted); flex: none; }
.myinfo-row > b { font-weight: 800; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.myinfo-btn { width: auto; padding: 8px 14px; min-height: 38px; font-size: 13.5px; }
.myinfo-note { margin: 12px 2px 16px; font-size: 13px; line-height: 1.5; color: var(--color-text-muted); }
.myinfo-foot { display: flex; justify-content: flex-end; gap: 10px; }
.myinfo-foot .btn-primary, .myinfo-foot .btn-secondary { width: auto; padding: 11px 22px; font-size: 14.5px; }
@media (max-width: 420px) { .myinfo-foot .btn-primary, .myinfo-foot .btn-secondary { flex: 1; padding-left: 12px; padding-right: 12px; } }

/* ---------- (2026-11-02) Payroll Prep ดึงเป็นรอบ ไม่ทับกัน: กล่อง "ดึงไปแล้ว" + ช่วงวันที่ ---------- */
.prp-ln2 { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 12px 14px; margin: 0 auto 14px; max-width: 640px; border: 1.5px solid var(--color-border); background: var(--color-bg); }
.prp-ln2-i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: var(--color-surface); color: var(--color-blue); }
.prp-ln2-t { min-width: 0; flex: 1; }
.prp-ln2-t > b { display: block; font-size: 15px; font-weight: 900; margin-bottom: 2px; line-height: 1.4; }
.prp-ln2-t p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--color-text-muted); }
.prp-ln2-t p b { color: var(--color-text); }
.prp-ln2.info, .prp-ln2.first { background: #EEF4FD; border-color: #CFE0F8; }
.prp-ln2.warn { background: #FFF1EF; border-color: #F3C4BF; }
.prp-ln2.warn .prp-ln2-i { background: var(--color-red); color: #FFFFFF; }
.prp-ln2-t p .prp-ln2-e { color: var(--color-red-dark); }
.prp-dr { max-width: 640px; margin: 0 auto; }
.prp-dr > div { min-width: 190px; }
.prp-ln2-a { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prp-nb2 { font-family: inherit; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-red-dark); }
.prp-nb2:hover { border-color: var(--color-red); }
/* ---------- (2026-11-02) Payroll Prep: สวิตช์รอบที่ 1 / 2 + ป้าย "จ่ายรอบ 2" ---------- */
.prp-slot { max-width: 640px; margin: 0 auto 14px; }
.prp-seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prp-seg > span { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); margin-right: 4px; }
.prp-seg button { font-family: inherit; font-size: 13.5px; font-weight: 800; border: 1.5px solid var(--color-border); border-radius: 999px; padding: 7px 16px; background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; }
.prp-seg button.on { background: var(--color-text); border-color: var(--color-text); color: var(--color-surface); }
.prp-seg button:disabled { cursor: default; opacity: 0.85; }
.prp-slot-m { margin: 6px 4px 0; font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); }
.prp-slot-m.warn { color: var(--color-red-dark); font-weight: 700; }
.prp-defer { font-size: 11.5px; font-weight: 700; color: var(--color-text-muted); white-space: nowrap; }
/* ---------- (2026-11-02) รายงานประวัติการลา: กลุ่มคอลัมน์ "คิดเงินเดือน" + ป้ายลาออก ---------- */
.lhr-t tr.hg th.gp { background: #EEF3FB; color: #0E479A; border-radius: 8px 8px 0 0; }
.lhr-t td.gpc { background: #FAFCFF; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lhr-t td.gpc b { font-weight: 800; }
.lhr-out { color: var(--color-red-dark); font-weight: 700; }
.lhr-of { font-weight: 600; color: var(--color-text-muted); }
/* ---- [2] ธีมมืด: ย้อมสี base + shared อัตโนมัติ (อยู่ก่อน light เพื่อให้ light ชนะเหมือนในธีมสว่าง) ---- */
@media screen {
html[data-theme="dark"] {
  --color-bg: #1E2940;
  --color-surface: #182132;
  --color-red: #DB4D44;
  --color-red-dark: #D93D33;
  --color-blue: #2673E7;
  --color-blue-dark: #196BE2;
  --color-text: #D7DBE4;
  --color-text-muted: #93989D;
  --color-border: #24314C;
  --color-gold: #DAB43E;
  --color-gold-dark: #D8A61F;
}
:where(html[data-theme="dark"]) .error-box {
  background: #481D18;
}
:where(html[data-theme="dark"]) .settings-subnav-btn {
  background: #182132;
}
:where(html[data-theme="dark"]) .ysg-letter {
  box-shadow: 0 8px 18px rgba(0,0,0,0.25), inset 0 1.5px 0 rgba(24, 33, 50, 0.55);
}
:where(html[data-theme="dark"]) .ysg-letter::after {
  background: linear-gradient(100deg, transparent, rgba(24, 33, 50, 0.7), transparent);
}
:where(html[data-theme="dark"]) .glass-card {
  background: rgba(24, 33, 50, 0.12);
  border: 1.5px solid rgba(39, 50, 73, 0.35);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25), inset 0 1px 0 rgba(24, 33, 50, 0.45);
}
:where(html[data-theme="dark"]) .glass-tab {
  background: rgba(24, 33, 50, 0.92);
}
:where(html[data-theme="dark"]) .glass-card .error-box {
  background: rgba(24, 33, 50, 0.92);
}
:where(html[data-theme="dark"]) .glass-field label {
  background: rgba(24, 33, 50, 0.92);
}
:where(html[data-theme="dark"]) .glass-field input {
  border: 1.5px solid rgba(39, 50, 73, 0.55);
  background: rgba(24, 33, 50, 0.1);
}
:where(html[data-theme="dark"]) .glass-field input:focus {
  border-color: #273249;
  background: rgba(24, 33, 50, 0.16);
}
:where(html[data-theme="dark"]) .glass-field .toggle-pin:hover {
  background: rgba(24, 33, 50, 0.15);
}
:where(html[data-theme="dark"]) .btn-glass {
  background: rgba(24, 33, 50, 0.95);
}
:where(html[data-theme="dark"]) .btn-glass:hover {
  background: #182132;
}
:where(html[data-theme="dark"]) .glass-powered {
  background: rgba(24, 33, 50, 0.92);
  color: #2360E9;
}
:where(html[data-theme="dark"]) .glass-powered-name span {
  color: #EA5B57;
}
:where(html[data-theme="dark"]) .m-quick-tile {
  background: color-mix(in srgb, var(--tint) 7%, #182132);
  border: 1px solid color-mix(in srgb, var(--tint) 20%, #273249);
}
:where(html[data-theme="dark"]) .stat-ic {
  color: color-mix(in srgb, var(--tint, var(--color-blue)) 68%, #FFFFFF);
  background: color-mix(in srgb, var(--tint, var(--color-blue)) 13%, #182132);
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .page-wrap > .top-bar .role-badge {
  background: rgba(24, 33, 50, 0.2);
  border: 1px solid rgba(39, 50, 73, 0.35);
}
:where(html[data-theme="dark"]) .page-wrap > .top-bar .btn-secondary {
  background: rgba(24, 33, 50, 0.16) !important;
  border-color: rgba(39, 50, 73, 0.35) !important;
}
:where(html[data-theme="dark"]) .page-wrap > .top-bar #logoutBtn::before {
  background: #182132;
}
:where(html[data-theme="dark"]) .nav-tab-bar,
:where(html[data-theme="dark"]) .m-bottom-nav {
  background: #182132;
}
:where(html[data-theme="dark"]) .m-nav-fab-circle {
  box-shadow: 0 6px 14px rgba(214,54,43,0.35), 0 0 0 4px #182132;
}
:where(html[data-theme="dark"]) .m-nav-fab.active .m-nav-fab-circle {
  box-shadow: 0 6px 14px rgba(214,54,43,0.35), 0 0 0 4px #182132, 0 0 0 6px rgba(214,54,43,0.3);
}
:where(html[data-theme="dark"]) .seg-group,
:where(html[data-theme="dark"]) .settings-subnav-bar {
  background: #23304B;
}
:where(html[data-theme="dark"]) .seg-group > button[aria-pressed="true"],
:where(html[data-theme="dark"]) .seg-group > button[style*="rgb(17, 17, 17)"],
:where(html[data-theme="dark"]) .seg-group > button[style*="#111"],
:where(html[data-theme="dark"]) .settings-subnav-bar > .settings-subnav-btn.active {
  background: #182132 !important;
}
}
:where(html[data-theme="dark"]) .lr-seg button.on {
  background: #303D58;
}
:where(html[data-theme="dark"]) .lr-chip.on {
  background: #303D58;
  border-color: #303D58;
}
:where(html[data-theme="dark"]) .lr-table td.used,
:where(html[data-theme="dark"]) .lr-p-table td.used {
  background: #4D401A;
}
:where(html[data-theme="dark"]) .lr-table td.full,
:where(html[data-theme="dark"]) .lr-p-table td.full {
  background: #5D481F;
}
:where(html[data-theme="dark"]) .lr-table td.over,
:where(html[data-theme="dark"]) .lr-p-table td.over {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lr-table tr.lr-grp td {
  background: #1B253A;
}
:where(html[data-theme="dark"]) .lr-table td.bf-3,
:where(html[data-theme="dark"]) .lr-p-table td.bf-3 {
  color: #EB793B;
}
:where(html[data-theme="dark"]) .lr-st.st-perm {
  background: #20482B;
  color: #45D266;
}
:where(html[data-theme="dark"]) .lr-st.st-prob {
  background: #50401B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .lr-st.st-mat {
  background: #4B1930;
  color: #E84686;
}
:where(html[data-theme="dark"]) .lr-st.st-pre {
  background: #4B2819;
  color: #EB793B;
}
:where(html[data-theme="dark"]) .lr-st.st-out {
  background: #1F2B42;
  color: #93989D;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .lr-table[data-cards] td.n.used,
:where(html[data-theme="dark"]) .lr-table[data-cards] td.n.full {
  background: #54451C;
}
:where(html[data-theme="dark"]) .lr-table[data-cards] td.n.over {
  background: #481D18;
}
}
:where(html[data-theme="dark"]) .lr-msum span.bad {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lr-dtable tr.bad td {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lr-dtable tr.cross td {
  background: #5D481F;
}
:where(html[data-theme="dark"]) .lr-flag.w {
  background: #50401B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .lr-tip {
  background: #4B3F19;
  color: #E0B42D;
}
:where(html[data-theme="dark"]) #lrPrintOverlay {
  background: #2A3958;
}
:where(html[data-theme="dark"]) .lr-pv-bar {
  background: #182132;
}
:where(html[data-theme="dark"]) .lr-sheet {
  background: #182132;
}
:where(html[data-theme="dark"]) .lr-p-kpi {
  border: 1px solid #575F6A;
}
:where(html[data-theme="dark"]) .lr-p-kpi div {
  border-right: 1px solid #575F6A;
}
:where(html[data-theme="dark"]) .lr-p-kpi b.org {
  color: #EB793B;
}
:where(html[data-theme="dark"]) .lr-p-table th,
:where(html[data-theme="dark"]) .lr-p-table td {
  border: 1px solid #575F6A !important;
}
:where(html[data-theme="dark"]) .lr-p-table thead th {
  background: #1F2B42;
}
:where(html[data-theme="dark"]) .lr-p-table tr.branch-row td {
  background: #1C273C;
  color: #307DEC;
}
:where(html[data-theme="dark"]) .lr-lg {
  border: 1px solid #575F6A;
}
:where(html[data-theme="dark"]) .lr-p-method {
  border-top: 1px dashed #575F6A;
}
:where(html[data-theme="dark"]) .lh-tag {
  background: #182C49;
}
:where(html[data-theme="dark"]) .lr-kstrip .lr-k-click:hover {
  background: #421A16;
}
:where(html[data-theme="dark"]) .lr-kstrip .lr-k-click.sel {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lr-table td.z {
  color: #6E7A92;
}
@media (min-width: 640px) {
:where(html[data-theme="dark"]) .lr-table thead th.lr-nm {
  box-shadow: 1px 0 0 rgba(24, 33, 50, 0.2);
}
:where(html[data-theme="dark"]) .lr-table tr.lr-grp td {
  background: #182C49 !important;
}
}
:where(html[data-theme="dark"]) .lr-table td.n.z:nth-child(even) {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lri-updated::before {
  color: #46D894;
}
:where(html[data-theme="dark"]) .lri-sheet {
  border: 1.5px solid #304F80;
}
:where(html[data-theme="dark"]) .lri-head {
  background: linear-gradient(90deg, #182847, #162843);
  border-bottom: 1.5px solid #304F80;
}
:where(html[data-theme="dark"]) .lri-title {
  color: #4B6BE8;
}
:where(html[data-theme="dark"]) .lri-quota span:not(.lbl) {
  background: #182132;
  border: 1px solid #304F80;
}
:where(html[data-theme="dark"]) .lri-table tbody tr:nth-child(even) td {
  background-color: #1A2437;
}
:where(html[data-theme="dark"]) .lri-table td.n.z {
  color: #6E7A92;
}
:where(html[data-theme="dark"]) .lri-table td.n.used {
  background: #54461C !important;
}
:where(html[data-theme="dark"]) .lri-table td.n.full {
  background: #675022 !important;
}
:where(html[data-theme="dark"]) .lri-table td.n.over {
  background: #481D18 !important;
}
:where(html[data-theme="dark"]) .lri-table tbody tr:hover td {
  background-color: #172745;
}
@media (min-width: 640px) {
:where(html[data-theme="dark"]) .lri-table tbody tr:nth-child(even) td.lri-br,
:where(html[data-theme="dark"]) .lri-table tbody tr:nth-child(even) td.lri-nm {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lri-table tbody tr:hover td.lri-br,
:where(html[data-theme="dark"]) .lri-table tbody tr:hover td.lri-nm {
  background: #172745;
}
}
:where(html[data-theme="dark"]) .lr-p-table td.used {
  background: #4D401A !important;
}
:where(html[data-theme="dark"]) .lr-p-table td.full {
  background: #5D481F !important;
}
:where(html[data-theme="dark"]) .lr-p-table td.over {
  background: #481D18 !important;
}
:where(html[data-theme="dark"]) .lrm-quick button {
  background: #182132;
}
:where(html[data-theme="dark"]) .lrm-quick button.on {
  background: #303D58;
  border-color: #303D58;
}
:where(html[data-theme="dark"]) .lrm-quick button.warn {
  background: #481D18;
  border-color: #823931;
}
:where(html[data-theme="dark"]) .lrm-quota {
  background: #182847;
}
:where(html[data-theme="dark"]) .lrm-card,
:where(html[data-theme="dark"]) .lrm-empty {
  background: #182132;
}
:where(html[data-theme="dark"]) .lrm-card.alert {
  border-color: #823931;
}
:where(html[data-theme="dark"]) .lrm-alert {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lrm-bar i,
:where(html[data-theme="dark"]) .lrm-type i {
  background: #202B43;
}
:where(html[data-theme="dark"]) .lrm-bar i em,
:where(html[data-theme="dark"]) .lrm-type i em {
  background: #3F454D;
}
:where(html[data-theme="dark"]) .lrm-bar small,
:where(html[data-theme="dark"]) .lrm-type > small {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-bar.s-zero .lrm-bar-top b {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-empty > span:last-child {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-x {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-hint {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-type {
  background: #1B253A;
  border: 1.5px solid #2B3750;
}
:where(html[data-theme="dark"]) .lrm-type.open {
  background: #182132;
}
:where(html[data-theme="dark"]) .lrm-type.open.s-over {
  border-color: #823931;
}
:where(html[data-theme="dark"]) .lrm-type.s-zero .lrm-type-head span {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-type-head em {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-entry {
  background: #1B253A;
}
:where(html[data-theme="dark"]) .lrm-entry .n {
  color: #A3A9AE;
}
:where(html[data-theme="dark"]) .lrm-entry.bad {
  background: #481D18;
}
:where(html[data-theme="dark"]) .lal-badge {
  box-shadow: 0 0 0 2px #182132;
}
:where(html[data-theme="dark"]) .lal-badge.on-fab {
  box-shadow: 0 0 0 2px #182132;
}
:where(html[data-theme="dark"]) .lal-chip {
  background: #182132;
}
:where(html[data-theme="dark"]) .lal-chip.on {
  background: #303D58;
  border-color: #303D58;
}
:where(html[data-theme="dark"]) .lal-chip.err {
  border-color: #823931;
}
:where(html[data-theme="dark"]) .lal-chip.sus {
  color: #E2B437;
}
:where(html[data-theme="dark"]) .lal-sec.sus {
  color: #E2B437;
}
:where(html[data-theme="dark"]) .lal-card {
  background: #182132;
}
:where(html[data-theme="dark"]) .sev-suspicious .lal-type {
  color: #E2B437;
}
:where(html[data-theme="dark"]) .lal-actions .lal-ok {
  color: #45D266;
}
:where(html[data-theme="dark"]) .lal-late {
  background: #1B253A;
}
:where(html[data-theme="dark"]) .lsw-list li {
  background: #483B18;
}
:where(html[data-theme="dark"]) .dupc-item li.strong {
  color: #EE9D2A;
}
:where(html[data-theme="dark"]) .dupl-tag {
  background: #182C47;
  color: #4D89E2;
}
:where(html[data-theme="dark"]) .dupl-tag.high {
  background: #481D18;
}
:where(html[data-theme="dark"]) .bgp {
  background: #182132;
}
:where(html[data-theme="dark"]) .bgp.bad {
  border-color: #823931;
  background: linear-gradient(#421A16, #182132 70px);
}
:where(html[data-theme="dark"]) .bgp-st.ok {
  background: #20482B;
  color: #45D266;
}
:where(html[data-theme="dark"]) .bgp-st.try {
  background: #50411B;
}
:where(html[data-theme="dark"]) .bgp-st.mat {
  background: #351849;
  color: #A26BC5;
}
:where(html[data-theme="dark"]) .bgp-st.out {
  background: #212D45;
  color: #8A9097;
}
:where(html[data-theme="dark"]) .bgp-btn {
  background: #182132;
}
:where(html[data-theme="dark"]) .bgp-warn {
  background: #481D18;
  border: 1.5px solid #823931;
}
:where(html[data-theme="dark"]) .bgp-ev::after {
  border: 2px solid #273249;
}
:where(html[data-theme="dark"]) .pe .pe-changed {
  background: #453A17 !important;
}
:where(html[data-theme="dark"]) .pe-help .ok {
  color: #45D266;
}
:where(html[data-theme="dark"]) .pe-note {
  background: #483B18;
  color: #DCAC31;
}
:where(html[data-theme="dark"]) .pe-seg button.on {
  background: #182132;
}
:where(html[data-theme="dark"]) .pe-foot {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .imp-dl {
  border: 2px dashed #325283;
  background: #162843;
}
:where(html[data-theme="dark"]) .imp-drop {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .imp-table th {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .imp-sum .ok,
:where(html[data-theme="dark"]) .imp-tag.ok {
  background: #20482B;
  color: #45D266;
}
:where(html[data-theme="dark"]) .imp-sum .warn,
:where(html[data-theme="dark"]) .imp-tag.warn {
  background: #50411B;
}
:where(html[data-theme="dark"]) .imp-sum .bad,
:where(html[data-theme="dark"]) .imp-tag.bad {
  background: #481D18;
}
:where(html[data-theme="dark"]) .imp-sum .skip,
:where(html[data-theme="dark"]) .imp-tag.skip {
  background: #212D45;
  color: #8A9097;
}
:where(html[data-theme="dark"]) .imp-r-bad td {
  background: #411B16;
}
:where(html[data-theme="dark"]) .imp-r-warn td {
  background: #433916;
}
:where(html[data-theme="dark"]) .acc-warn {
  color: #EEA231;
}
:where(html[data-theme="dark"]) .acc-seg button.on {
  background: #182132;
}
:where(html[data-theme="dark"]) .acc-rc {
  background: #182132;
}
:where(html[data-theme="dark"]) .acc-rc.on {
  background: #182C49;
  color: #307DEC;
}
:where(html[data-theme="dark"]) .acc-md-f {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .el-head {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .el-row {
  border-bottom: 1px solid #2F3C57;
}
:where(html[data-theme="dark"]) .el-row:hover {
  background: #1B2539;
}
:where(html[data-theme="dark"]) .el-btn {
  background: #182132;
}
:where(html[data-theme="dark"]) .el-pill.ok {
  background: #20482B;
  color: #45D266;
}
:where(html[data-theme="dark"]) .el-pill.try {
  background: #50411B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .el-pill.mat {
  background: #351849;
  color: #A26BC5;
}
:where(html[data-theme="dark"]) .el-pill.out {
  background: #481D18;
  color: #DE564D;
}
:where(html[data-theme="dark"]) .el-pill.gone {
  background: #212D45;
  color: #8A9097;
}
:where(html[data-theme="dark"]) .el-detail {
  background: #192235;
}
:where(html[data-theme="dark"]) .el-note {
  color: #9C6CCE;
  background: #192235;
}
:where(html[data-theme="dark"]) .qe-in:focus {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-nb {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-today {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-grid {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-dow {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lc-cell:hover:not(.out) {
  background: #162843;
}
:where(html[data-theme="dark"]) .lc-cell.out {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lc-cell.out .lc-dn {
  color: #6D7991;
}
:where(html[data-theme="dark"]) .lc-sh-f {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lc-pp:has(input:checked) {
  background: #172A46;
}
:where(html[data-theme="dark"]) .lc-onleave {
  color: #EEA231;
}
:where(html[data-theme="dark"]) .lc-ty {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-ty.on {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lc-seg button.on {
  background: #182132;
}
@media (max-width: 640px) {
:where(html[data-theme="dark"]) .lc-cell {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-cell.sel {
  background: #303D58;
}
:where(html[data-theme="dark"]) .lc-day {
  background: #182132;
}
}
:where(html[data-theme="dark"]) .lrc {
  background: #182132;
}
:where(html[data-theme="dark"]) .lrc-bar {
  background: #202C44;
}
:where(html[data-theme="dark"]) .lrc.full {
  border-color: #823931;
  background: #411B16;
}
:where(html[data-theme="dark"]) .lrc.near .lrc-v b {
  color: #EEA231;
}
:where(html[data-theme="dark"]) .lh-seg button.on {
  background: #182132;
}
:where(html[data-theme="dark"]) .lh-nb {
  background: #182132;
}
:where(html[data-theme="dark"]) .lh-dow {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lh-c.out {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lh-ch.half,
:where(html[data-theme="dark"]) .lh-mg i.half {
  background-image: repeating-linear-gradient(135deg, rgba(24, 33, 50, 0) 0 5px, rgba(24, 33, 50, 0.3) 5px 8px);
}
:where(html[data-theme="dark"]) .lh-mm {
  background: #182132;
}
:where(html[data-theme="dark"]) .lh-mg i {
  background: #1E2A41;
}
:where(html[data-theme="dark"]) .lh-li {
  border-bottom: 1px solid #2F3C57;
}
@media (max-width: 640px) {
:where(html[data-theme="dark"]) .lh-c {
  background: #1B253A;
}
}
html[data-theme="dark"] {
  --db-green: #2CD05B;
  --db-gold: #E7AF35;
  --db-pur: #9555BC;
}
:where(html[data-theme="dark"]) .c-green {
  color: #46D870;
}
:where(html[data-theme="dark"]) .c-pur {
  color: #A26BC5;
}
:where(html[data-theme="dark"]) .c-gold {
  color: #EEA231;
}
:where(html[data-theme="dark"]) .db-stack {
  background: #202C44;
}
:where(html[data-theme="dark"]) .db-mini {
  background: #182132;
}
:where(html[data-theme="dark"]) .db-mini:hover {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .db-mini[aria-expanded="true"]::after {
  background: #182132;
}
:where(html[data-theme="dark"]) .db-mini-card #statDetailBox > .card {
  background: #192235;
}
:where(html[data-theme="dark"]) .db-tr {
  border-bottom: 1px solid #2F3C57;
}
:where(html[data-theme="dark"]) .tool-ic.imp {
  background: #182C49;
}
:where(html[data-theme="dark"]) .tool-ic.exp {
  background: #1E4B2B;
  color: #46D870;
}
:where(html[data-theme="dark"]) .pr-seg button[aria-pressed="true"] {
  background: #182132;
}
:where(html[data-theme="dark"]) .rp-type {
  background: #182132;
}
:where(html[data-theme="dark"]) .rp-type:hover {
  border-color: #43567D;
}
:where(html[data-theme="dark"]) .rp-type[aria-pressed="true"] {
  background: #33415E;
  border-color: #33415E;
}
:where(html[data-theme="dark"]) .rp-type[aria-pressed="true"] small {
  color: #6B778E;
}
:where(html[data-theme="dark"]) .rp-pres button {
  background: #182132;
}
:where(html[data-theme="dark"]) .rp-pres button.on {
  background: #182C49;
}
:where(html[data-theme="dark"]) .lr-kmode button[aria-pressed="true"] {
  background: #182132;
}
:where(html[data-theme="dark"]) .lr-kcard {
  border: 2px solid #2D4876;
}
:where(html[data-theme="dark"]) .k3-pop {
  background: #182132;
}
:where(html[data-theme="dark"]) .k3-pop-r {
  border-bottom: 1px solid #303D59;
}
:where(html[data-theme="dark"]) .k3-pop-ok {
  color: #46D870;
}
:where(html[data-theme="dark"]) .k3-hd {
  border-bottom: 2px solid #33415E;
}
:where(html[data-theme="dark"]) .k3-emp div {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-sum td {
  border-bottom: 1px solid #303E5A;
}
:where(html[data-theme="dark"]) .k3-sum tr.tot td {
  border-top: 2px solid #33415E;
}
:where(html[data-theme="dark"]) .k3-sheet td.p {
  color: #DC635B;
}
:where(html[data-theme="dark"]) .k3-h i {
  background: #33415E;
}
:where(html[data-theme="dark"]) .k3-lg th {
  background: #1C273C;
  border-bottom: 1px solid #3A4A6B;
}
:where(html[data-theme="dark"]) .k3-lg td {
  border-bottom: 1px solid #303E5A;
}
:where(html[data-theme="dark"]) .k3-tag {
  background: #481D18;
  color: #DC635B;
}
:where(html[data-theme="dark"]) .k3-tag.ok {
  background: #204629;
  color: #46D870;
}
:where(html[data-theme="dark"]) .k3-tag.none {
  background: #1E2A41;
}
:where(html[data-theme="dark"]) .k3-rules {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-rules b {
  color: #DC635B;
}
:where(html[data-theme="dark"]) .k3-prin div {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-box {
  border: 1.5px solid #3A4A6B;
}
:where(html[data-theme="dark"]) .k3-box.ok {
  border-color: #39834E;
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-other div {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-hd2 {
  border-bottom: 2px solid #33415E;
}
:where(html[data-theme="dark"]) .k3-facts div {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .k3-other div.hl {
  background: #481D18;
}
:where(html[data-theme="dark"]) .k3-tag.warn {
  background: #50401B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .k3-kv th {
  background: #1C273C;
  border-bottom: 1px solid #303E5A;
}
:where(html[data-theme="dark"]) .k3-steps div {
  border: 1.5px solid #3A4A6B;
}
:where(html[data-theme="dark"]) .k3-other div.hl span {
  color: #DC635B;
}
:where(html[data-theme="dark"]) .lc-ball.half {
  background-image: repeating-linear-gradient(135deg, rgba(24, 33, 50, 0) 0 4px, rgba(24, 33, 50, 0.3) 4px 7px);
}
:where(html[data-theme="dark"]) .lc-tip {
  background: #182132;
}
:where(html[data-theme="dark"]) .lc-tip-g {
  border-top: 1px solid #2F3C57;
}
:where(html[data-theme="dark"]) .qe-list .qe-row {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-ch .qe-no {
  background: #33415E;
}
:where(html[data-theme="dark"]) .qe-ty {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-ty.on i {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-seg button.on {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-status.ok {
  background: #1E462B;
  color: #46D870;
}
:where(html[data-theme="dark"]) .qe-status.warn {
  background: #4C3E19;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .qe-status.bad {
  background: #481D18;
}
:where(html[data-theme="dark"]) .qe-list + .qe-foot {
  background: #182132;
}
:where(html[data-theme="dark"]) .k3-exbtn {
  background: #182132;
}
:where(html[data-theme="dark"]) .prp-table tr.branch-row td {
  background: #182C49;
}
:where(html[data-theme="dark"]) .prp-note {
  color: #7E8590;
}
:where(html[data-theme="dark"]) .prp-st.s-rs {
  background: #481D18;
}
:where(html[data-theme="dark"]) .prp-st.s-nw {
  background: #204629;
  color: #45D170;
}
:where(html[data-theme="dark"]) .prp-st.s-mt {
  background: #37194C;
  color: #A26BC5;
}
:where(html[data-theme="dark"]) .prp-st.s-pb {
  background: #50401B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .prp-st.s-pr {
  background: #482D18;
  color: #EF8635;
}
:where(html[data-theme="dark"]) .prp-hd {
  border-bottom: 2px solid #33415E;
}
:where(html[data-theme="dark"]) .db-mini.c-gold {
  --c: #E6B234;
}
:where(html[data-theme="dark"]) .db-mini.c-pur {
  --c: #9555BC;
}
:where(html[data-theme="dark"]) .db-mini.c-green {
  --c: #2CD05B;
}
:where(html[data-theme="dark"]) .db-mt {
  background: #182132;
}
:where(html[data-theme="dark"]) .db-mt b {
  color: color-mix(in srgb, var(--c) 68%, #FFFFFF);
}
:where(html[data-theme="dark"]) .db-mt span {
  background: #182132;
}
:where(html[data-theme="dark"]) .rm-ann {
  background: #182132;
}
:where(html[data-theme="dark"]) .rm-ann .rm-ic {
  background: #50411B;
}
:where(html[data-theme="dark"]) .rm-ann .rm-cd span b {
  color: #EFB434;
}
:where(html[data-theme="dark"]) .rm-ann.over .rm-ic {
  background: #481D18;
}
:where(html[data-theme="dark"]) .rm-ann.done .rm-ic {
  background: #1E462B;
}
:where(html[data-theme="dark"]) .rm-ann.done .rm-tx b {
  color: #46D870;
}
:where(html[data-theme="dark"]) .rm-now {
  background: linear-gradient(135deg, #442F17, #162642);
  border: 1.5px solid #805831;
}
:where(html[data-theme="dark"]) .rm-now.over {
  background: #451A17;
  border-color: #823A31;
}
:where(html[data-theme="dark"]) .rm-chip {
  background: #182132;
}
:where(html[data-theme="dark"]) .rm-chip.r {
  background: #481D18;
  border-color: #803931;
}
:where(html[data-theme="dark"]) .rm-chip.b {
  background: #182C49;
  border-color: #2F4F7B;
}
:where(html[data-theme="dark"]) .rm-bar {
  background: #23304A;
}
:where(html[data-theme="dark"]) .rm-pp.ok {
  background: #1E462B;
  color: #45D170;
}
:where(html[data-theme="dark"]) .rm-pp.no {
  background: #1D283D;
}
:where(html[data-theme="dark"]) .rm-done {
  background: #1B4829;
  color: #45D266;
}
:where(html[data-theme="dark"]) .rm-tpl button {
  border: 1px dashed #565E6A;
  background: #182132;
}
:where(html[data-theme="dark"]) .rm-seg label:has(input:checked) {
  background: #182132;
}
:where(html[data-theme="dark"]) .rm-go .rm-del {
  border-color: #843A32;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leave"] {
  --c: #2673E7;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leaveRights"] {
  --c: #9555BC;
}
:where(html[data-theme="dark"]) .rp-type[data-type="newhire"] {
  --c: #2CD05B;
}
:where(html[data-theme="dark"]) .rp-type[data-type="resign"] {
  --c: #DB4D44;
}
:where(html[data-theme="dark"]) .rp-type[data-type="maternity"] {
  --c: #C660A1;
}
:where(html[data-theme="dark"]) .rp-type[data-type="cert"] {
  --c: #E6B234;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leaveAlerts"] {
  --c: #E3753F;
}
:where(html[data-theme="dark"]) .rp-type .rp-ti {
  background: #182132;
}
:where(html[data-theme="dark"]) .rp-type[aria-pressed="true"] b {
  color: color-mix(in srgb, var(--c) 68%, #FFFFFF);
}
:where(html[data-theme="dark"]) .prp-eb {
  background: #182132;
}
:where(html[data-theme="dark"]) .prp-ck2.r {
  background: #451A17;
}
:where(html[data-theme="dark"]) .prp-ck2.y {
  background: #483B18;
}
:where(html[data-theme="dark"]) .prp-ck2.y .go {
  color: #E2B437;
}
:where(html[data-theme="dark"]) .prp-ck2.ok {
  background: #1D283D;
}
:where(html[data-theme="dark"]) .prp-ck2.open {
  border-color: #6F4742;
}
:where(html[data-theme="dark"]) .prp-ck2.y.open {
  border-color: #8A7234;
}
:where(html[data-theme="dark"]) .prp-lst div {
  border-top: 1px solid rgba(255, 255, 255, 0.084);
}
:where(html[data-theme="dark"]) .prp-pwarn {
  color: #DE564E;
  background: #451A17;
}
:where(html[data-theme="dark"]) .acc2-p {
  background: #182132;
}
:where(html[data-theme="dark"]) .acc2-p:hover {
  border-color: #43567D;
}
:where(html[data-theme="dark"]) .acc2-on {
  border: 2px solid #273249;
}
:where(html[data-theme="dark"]) .acc2-flag {
  background: #50401B;
  color: #E2B437;
  border: 1px solid #8C7735;
}
:where(html[data-theme="dark"]) .acc2-hid {
  color: #9EA2A8;
}
:where(html[data-theme="dark"]) .acc2-av.has-photo {
  background: #263450;
}
:where(html[data-theme="dark"]) .acc2-md {
  background: #182132;
}
:where(html[data-theme="dark"]) .acc2-chip.main {
  background: #481D18;
  color: #DE564E;
}
:where(html[data-theme="dark"]) .acc2-chip.sub {
  background: #182C49;
  color: #3F85ED;
}
:where(html[data-theme="dark"]) .acc2-chip.insp {
  background: #1E462B;
  color: #45D170;
}
:where(html[data-theme="dark"]) .acc2-chip.warn {
  background: #50401B;
  color: #E2B437;
}
:where(html[data-theme="dark"]) .acc2-chip.off {
  background: #1E2A41;
  color: #93989D;
}
:where(html[data-theme="dark"]) .acc2-chip.exp {
  background: #481D18;
  color: #DE564E;
}
:where(html[data-theme="dark"]) .acc2-kv {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .acc2-rts span {
  background: #182C49;
  color: #3F85ED;
}
:where(html[data-theme="dark"]) .acc2-del,
:where(html[data-theme="dark"]) .acc2-hide {
  border-color: #843A32 !important;
}
:where(html[data-theme="dark"]) .acc2-pin span {
  color: #3F85ED;
}
:where(html[data-theme="dark"]) .acc2-msg {
  background: #1C273C;
}
:where(html[data-theme="dark"]) .acc2-note {
  background: #4C3E19;
  color: #E0B22D;
}
:where(html[data-theme="dark"]) .tb-av .acc2-av {
  border: 2px solid #273249;
}
:where(html[data-theme="dark"]) .ph-sheet {
  background: #182132;
}
:where(html[data-theme="dark"]) .ph-grab {
  background: #2D3D5F;
}
:where(html[data-theme="dark"]) .ph-crop {
  background: #1E2940;
  box-shadow: 0 0 0 4px #182132, 0 0 0 6px #1259C3;
}
:where(html[data-theme="dark"]) .ph-del {
  color: #DA665A;
}
:where(html[data-theme="dark"]) .mx-search {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-results:not(:empty) {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-res {
  border-bottom: 1px solid #2F3C57;
}
:where(html[data-theme="dark"]) .mx-res.in i {
  color: #46D870;
}
:where(html[data-theme="dark"]) .mx-empty {
  border: 1.5px dashed #565E6A;
}
:where(html[data-theme="dark"]) .mx-it {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-it.ok {
  border-color: #398352;
}
:where(html[data-theme="dark"]) .mx-it.bad {
  border-color: #823A31;
}
:where(html[data-theme="dark"]) .mx-n {
  color: var(--color-bg) !important;
}
:where(html[data-theme="dark"]) .mx-st.g {
  background: #1E462B;
  color: #45D170;
}
:where(html[data-theme="dark"]) .mx-st.r {
  background: #481D18;
  color: #DE564E;
}
:where(html[data-theme="dark"]) .mx-st.y {
  background: #1E2940;
}
:where(html[data-theme="dark"]) .mx-in:focus-within {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-it.bad .mx-in:has(input:placeholder-shown) {
  border-color: #893C34;
  background: #421B16;
}
:where(html[data-theme="dark"]) .mx-tog {
  color: #DE564E;
}
:where(html[data-theme="dark"]) .mx-tog span {
  background: #2D3D5F;
}
:where(html[data-theme="dark"]) .mx-tog span::after {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-err {
  color: #DE564E;
}
:where(html[data-theme="dark"]) .mx-addrow {
  border: 1.5px dashed #565E6A;
}
:where(html[data-theme="dark"]) .mx-bar {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-bs b.r {
  color: #DE564E;
}
:where(html[data-theme="dark"]) .le2-row > td {
  background: #192235 !important;
}
:where(html[data-theme="dark"]) .le2-panel {
  background: #162342;
  border: 1.5px solid #304D7F;
}
:where(html[data-theme="dark"]) .su-seg button {
  border: 1.5px solid rgba(39, 50, 73, 0.55);
  background: rgba(24, 33, 50, 0.35);
}
:where(html[data-theme="dark"]) .su-seg button[aria-checked="true"] {
  background: #182132;
  border-color: #273249;
  color: #DE564E;
}
:where(html[data-theme="dark"]) .acc2-pend {
  background: #483B18;
  border: 1.5px solid #8C7735;
}
:where(html[data-theme="dark"]) .acc2-pend .acc2-gt small {
  color: #E2B437;
}
:where(html[data-theme="dark"]) .acc2-req {
  background: #182132;
}
:where(html[data-theme="dark"]) .acc2-rq-tx em {
  color: #E0B22D;
}
:where(html[data-theme="dark"]) .acc2-rej {
  border-color: #843A32 !important;
}
:where(html[data-theme="dark"]) .prp-pr {
  color: #DC635B;
}
:where(html[data-theme="dark"]) .prp-sumline span {
  color: #8F949C;
}
:where(html[data-theme="dark"]) .prp-sumline span b {
  color: #D7DBE4;
}
:where(html[data-theme="dark"]) .prp-brand b .prp-pr {
  color: #DC635B;
}
:where(html[data-theme="dark"]) .db-mt span {
  color: color-mix(in srgb, var(--c) 68%, #FFFFFF);
}
:where(html[data-theme="dark"]) .rp-type .rp-ti {
  color: color-mix(in srgb, var(--c) 68%, #FFFFFF);
}
:where(html[data-theme="dark"]) .ic-checkCircle {
  color: #46D870;
}
:where(html[data-theme="dark"]) .rm-ann .rm-ic {
  color: #E1A44C;
}
:where(html[data-theme="dark"]) .rm-ann.done .rm-ic {
  color: #46D870;
}
:where(html[data-theme="dark"]) .lsw-ic {
  color: #E1A44C;
}
:where(html[data-theme="dark"]) .mat-full {
  border: 1.5px solid #813664;
  background: #451733;
  color: #C768A6;
}
:where(html[data-theme="dark"]) .mat-full:hover {
  background: #4F1A3B;
}
:where(html[data-theme="dark"]) .prp-snapnote .prp-carryn {
  color: #E1A44C;
}
:where(html[data-theme="dark"]) .ex-links button:hover {
  background: #182B48;
}
:where(html[data-theme="dark"]) .ex-chip {
  background: #182132;
}
:where(html[data-theme="dark"]) .ex-chip[aria-pressed="true"] {
  background: #182B48;
}
:where(html[data-theme="dark"]) .ex-res {
  background: #20482B;
  color: #45D266;
}
:where(html[data-theme="dark"]) .ex-res em {
  color: #81A28A;
}
:where(html[data-theme="dark"]) .ex-ps th {
  background: #1A2437;
}
:where(html[data-theme="dark"]) .mx-brlist:not(:empty) {
  background: #182132;
}
:where(html[data-theme="dark"]) .mx-bp {
  border: 1.5px solid #313E5A !important;
}
:where(html[data-theme="dark"]) .mx-bp.on {
  background: #1C4428;
}
:where(html[data-theme="dark"]) .mx-bp.on i {
  color: #46D870;
}
:where(html[data-theme="dark"]) .lal-how {
  background: #1B263A;
}
:where(html[data-theme="dark"]) .lal-card.sev-error .lal-how {
  background: #451E17;
}
:where(html[data-theme="dark"]) .lal-eb button {
  background: #182132;
}
:where(html[data-theme="dark"]) .lal-eb .lal-fix {
  border-color: #304E80;
}
:where(html[data-theme="dark"]) .lal-eb .lal-del {
  border-color: #843A32;
}
:where(html[data-theme="dark"]) .lhr-kpi {
  background: #33415E;
}
:where(html[data-theme="dark"]) .lhr-chip {
  background: #182132;
}
:where(html[data-theme="dark"]) .lhr-opt.on {
  background: #33415E;
}
:where(html[data-theme="dark"]) .lhr-t th {
  color: #7D8691;
  background: #1A2437;
}
:where(html[data-theme="dark"]) .lhr-t tr.hg th.gq {
  background: #1F2A41;
  color: #46CB6C;
}
:where(html[data-theme="dark"]) .lhr-t tr.hg th.gn {
  background: #481D18;
  color: #DE564D;
}
:where(html[data-theme="dark"]) .lhr-t td {
  border-bottom: 1px solid #2F3C57;
}
:where(html[data-theme="dark"]) .lhr-t td.z {
  color: #6B778E;
}
:where(html[data-theme="dark"]) .lhr-t td.nqc {
  background: #192235;
}
:where(html[data-theme="dark"]) .lhr .v {
  color: color-mix(in srgb, var(--c) 68%, #FFFFFF);
  background: color-mix(in srgb, var(--c) 13%, #182132);
}
:where(html[data-theme="dark"]) .lhr-t tr.grp td {
  background: #182A47;
  color: #307DEC;
}
:where(html[data-theme="dark"]) .lhr-t tbody tr:not(.grp):hover td {
  background: #1A2336;
}
:where(html[data-theme="dark"]) .qe-chip.ok {
  background: #1E4B2B;
  color: #3AD974;
}
:where(html[data-theme="dark"]) .qe-chip.warn {
  background: #56471D;
  color: #EBB225;
}
:where(html[data-theme="dark"]) .qe-chip.bad {
  background: #51211B;
  color: #E14D45;
}
:where(html[data-theme="dark"]) .qe-chip.wait {
  background: #1F2B42;
}
:where(html[data-theme="dark"]) .qe-list .qe-row > .qe-status.warn {
  background: #4A3E19;
  color: #EBB225;
}
:where(html[data-theme="dark"]) .qe-list .qe-row > .qe-status.bad {
  background: #451D17;
  color: #E14D45;
}
:where(html[data-theme="dark"]) .tact-tab.on em {
  background: rgba(24, 33, 50, 0.25);
}
:where(html[data-theme="dark"]) .tact-tag.in {
  color: #46D870;
}
:where(html[data-theme="dark"]) .mis-ph span {
  color: #B1BACB;
}
:where(html[data-theme="dark"]) .org-logo img {
  background: #182132;
}
:where(html[data-theme="dark"]) .org-sw::after {
  background: #182132;
}
html[data-theme="dark"] {
  --accent-soft: #481D18;
  --soft: #1E2940;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) #mAcctBtn .acc2-av {
  box-shadow: 0 0 0 2px #182132, 0 0 0 3px var(--color-border);
}
:where(html[data-theme="dark"]) #mAcctBtn .m-acct-dot {
  border: 2px solid #273249;
}
}
:where(html[data-theme="dark"]) .m-acct-row {
  border-bottom: 1px solid #313F5B;
}
:where(html[data-theme="dark"]) .m-acct-go {
  color: #788399;
}
:where(html[data-theme="dark"]) .m-acct-trow {
  border-bottom: 1px solid #313F5B;
}
:where(html[data-theme="dark"]) .rp-type[data-type="cert"] {
  --c: #E6AD1F;
}
:where(html[data-theme="dark"]) :is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg, .rm-seg) {
  background: linear-gradient(180deg, #2F3748, #262F40);
  box-shadow: inset 0 2px 4px rgba(24, 34, 70, 0.22), 0 1px 0 rgba(24, 33, 50, 0.8);
}
:where(html[data-theme="dark"]) :is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg) > button:is(.on, [aria-pressed='true']),
:where(html[data-theme="dark"]) .rm-seg > label:has(input:checked) {
  background: linear-gradient(180deg, #182132, #1E2A40);
}
:where(html[data-theme="dark"]) :is(.lr-kmode, .lm-seg, .settings-subnav-bar, .pe-tabs) {
  background: linear-gradient(180deg, #2F3748, #262F40);
  box-shadow: inset 0 2px 4px rgba(24, 34, 70, 0.22), 0 1px 0 rgba(24, 33, 50, 0.8);
}
:where(html[data-theme="dark"]) :is(.lr-kmode > button[aria-pressed='true'], .lm-seg > button.on, .lm-seg > button[aria-pressed='true'], .settings-subnav-bar > .settings-subnav-btn.active, .pe-tab.on) {
  background: linear-gradient(180deg, #182132, #1E2A40) !important;
}
:where(html[data-theme="dark"]) .su-seg button[aria-checked='true'] {
  background: linear-gradient(180deg, #182132, #1E2A40) !important;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .seg-group,
:where(html[data-theme="dark"]) .settings-subnav-bar {
  background: linear-gradient(180deg, #2F3748, #262F40) !important;
}
:where(html[data-theme="dark"]) .seg-group > button[aria-pressed='true'],
:where(html[data-theme="dark"]) .settings-subnav-bar > .settings-subnav-btn.active {
  background: linear-gradient(180deg, #182132, #1E2A40) !important;
}
}
html[data-theme="dark"] {
  --d3-hl: rgba(24, 33, 50, 0.3);
  --d3-hl-sec: rgba(24, 33, 50, 0.9);
  --d3-lo: rgba(234, 236, 241, 0.14);
  --d3-lo-sec: rgba(74, 105, 171, 0.05);
  --d3-press: rgba(234, 236, 241, 0.22);
  --d3-press-sec: rgba(74, 105, 171, 0.1);
  --d3-drop-sec: rgba(74, 105, 171, 0.22);
  --d3-drop-tile: rgba(47, 100, 216, 0.5);
  --d3-tile-blue: linear-gradient(180deg, #4D7DD5 0%, #2B62D5 100%);
  --d3-tile-green: linear-gradient(180deg, #49C979 0%, #2DC665 100%);
  --d3-tile-gold: linear-gradient(180deg, #F2C14E 0%, #E6AD1F 100%);
}
:where(html[data-theme="dark"]) .rm-okbtn {
  --d3-glow: color-mix(in srgb, #2CD05B 50%, transparent);
}
html[data-theme="dark"] .db-mini .db-mt span {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #182132), var(--c));
}
@media (min-width: 1200px) {
:where(html[data-theme="dark"]) .qe-list {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-thead {
  background: #243042;
}
:where(html[data-theme="dark"]) .qe-thead span {
  color: #75849D;
  border-right: 1px solid #4C596E;
}
:where(html[data-theme="dark"]) .qe-list .qe-row {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-ch .qe-no {
  background: #1E293F;
  color: #8892A3;
}
:where(html[data-theme="dark"]) .qe-row:focus-within .qe-ch .qe-no {
  background: #1A2E4F;
}
:where(html[data-theme="dark"]) .qe-body > .qe-f {
  border-right: 1px solid #4C596E;
}
:where(html[data-theme="dark"]) .qe-body > .qe-f:nth-child(6) {
  border-right: 1px solid #4C596E;
}
:where(html[data-theme="dark"]) .qe-list .qe-row .qe-in:focus {
  background: #182132;
}
:where(html[data-theme="dark"]) .qe-list .qe-row > .qe-status {
  border-top: 1px solid #4C596E;
}
}
@media (min-width: 1200px) {
:where(html[data-theme="dark"]) .qe-list .qe-row > .qe-status.ok,
:where(html[data-theme="dark"]) .qe-list .qe-row > .qe-status.wait {
  border-left: 1px solid #4C596E;
}
}
:where(html[data-theme="dark"]) .prp-ln2.info,
:where(html[data-theme="dark"]) .prp-ln2.first {
  background: #172A46;
  border-color: #2F4F7B;
}
:where(html[data-theme="dark"]) .prp-ln2.warn {
  background: #441C17;
  border-color: #833A32;
}
:where(html[data-theme="dark"]) .lhr-t tr.hg th.gp {
  background: #182A47;
  color: #307DEC;
}
:where(html[data-theme="dark"]) .lhr-t td.gpc {
  background: #192235;
}
}
/* ---- [3] ธีมสว่าง + ธีมมืด (light.css) ---- */
html[data-theme="light"],
html[data-theme="dark"] {
  --color-bg: #F5F5F3;
  --color-surface: #FFFFFF;
  --color-text: #1C1C1E;
  --color-text-muted: #74737A;
  --color-border: #E7E6E2;
  --accent: #C8302A;
  --accent-soft: #FBEDEC;
  --soft: #F1F0EC;
  --shadow-card: 0 1px 2px rgba(28, 28, 30, 0.04);
}
:where(html[data-theme="light"], html[data-theme="dark"]) body {
  background: var(--color-bg);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .card {
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .btn-primary,
:where(html[data-theme="light"], html[data-theme="dark"]) .bgp-btn.pri,
:where(html[data-theme="light"], html[data-theme="dark"]) .prp-eb.pdf {
  background: var(--accent) !important;
  border: none;
  color: #FFFFFF;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .role-badge {
  background: var(--soft) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .nav-tab-btn,
:where(html[data-theme="light"], html[data-theme="dark"]) .insp-subnav-btn,
:where(html[data-theme="light"], html[data-theme="dark"]) .settings-subnav-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .nav-tab-btn.active,
:where(html[data-theme="light"], html[data-theme="dark"]) .insp-subnav-btn.active,
:where(html[data-theme="light"], html[data-theme="dark"]) .settings-subnav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .k3-logo,
:where(html[data-theme="light"], html[data-theme="dark"]) .print-doc-header .print-doc-logo {
  background: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .prp-title h1 i,
:where(html[data-theme="light"], html[data-theme="dark"]) .prp-brand b i {
  background: none !important;
  -webkit-text-fill-color: var(--accent) !important;
  color: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mt {
  background: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 44px;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mt b {
  font-size: 30px;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mt span {
  display: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini.is-zero {
  opacity: 1;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini.is-zero .db-mt b {
  color: #C9C9CC;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini.is-zero small {
  color: #8E8D93;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini:hover .db-mt {
  transform: none;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini:hover {
  background: var(--soft) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini[aria-expanded="true"] {
  background: var(--soft) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mini[aria-expanded="true"] .db-mt {
  box-shadow: none !important;
}
@media (max-width: 760px) {
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mt b {
  font-size: 24px;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .db-mt {
  min-height: 36px;
}
}
@media (max-width: 639px) {
:where(html[data-theme="light"], html[data-theme="dark"]) .page-wrap > .top-bar {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--color-border);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .page-wrap > .top-bar .role-badge {
  background: var(--soft) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .page-wrap > .top-bar .btn-secondary {
  background: var(--soft) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .page-wrap > .top-bar #logoutBtn::before {
  background: var(--color-text);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .nav-tab-bar .nav-tab-btn.active,
:where(html[data-theme="light"], html[data-theme="dark"]) .m-bottom-nav .m-nav-btn.active {
  color: var(--accent);
  background: none;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .nav-tab-btn.active .nav-ic,
:where(html[data-theme="light"], html[data-theme="dark"]) .m-nav-btn.active .nav-ic {
  background: var(--accent-soft);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .m-nav-fab {
  color: var(--accent);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .m-nav-fab-circle {
  background: var(--accent) !important;
  box-shadow: 0 4px 10px rgba(200, 48, 42, 0.25), 0 0 0 4px #FFFFFF !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .m-nav-fab.active .m-nav-fab-circle {
  box-shadow: 0 4px 10px rgba(200, 48, 42, 0.25), 0 0 0 4px #FFFFFF, 0 0 0 6px rgba(200, 48, 42, 0.25) !important;
}
}
:where(html[data-theme="light"], html[data-theme="dark"]) body:has(.glass-login) {
  background: #F3F2EE;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-login {
  background: #F3F2EE !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-bg {
  display: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-brand {
  color: var(--color-text-muted);
  opacity: 1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-greeting {
  color: var(--color-text);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-sub {
  color: var(--color-text-muted);
  opacity: 1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-card {
  background: #FFFFFF !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 8px 28px rgba(28, 28, 30, 0.06) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: var(--color-text);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-tab {
  background: var(--soft) !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field label {
  background: #FFFFFF !important;
  color: var(--color-text-muted) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field input {
  background: var(--soft) !important;
  border: 1px solid transparent !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field input::placeholder {
  color: #9C9BA1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field input:focus {
  border-color: var(--accent) !important;
  background: #FFFFFF !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field-icon {
  stroke: #9C9BA1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field .toggle-pin {
  color: #9C9BA1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-field .toggle-pin:hover {
  background: var(--soft) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-remember {
  color: var(--color-text);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-remember input {
  accent-color: var(--accent);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-link {
  color: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-hint {
  color: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-foot {
  color: var(--color-text-muted);
  opacity: 1 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-powered {
  background: var(--soft);
  color: var(--color-text-muted);
}
:where(html[data-theme="light"], html[data-theme="dark"]) .btn-glass {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .btn-glass:hover {
  background: #B32A25 !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-card .error-box {
  background: var(--accent-soft) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .glass-split .ysg-letter {
  filter: drop-shadow(0 1px 0 #B8941F) drop-shadow(0 2px 0 #A5841B) drop-shadow(0 3px 0 #8B6B14) drop-shadow(0 10px 12px rgba(139, 107, 20, 0.22));
}
:where(html[data-theme="light"], html[data-theme="dark"]) .prp-title h1,
:where(html[data-theme="light"], html[data-theme="dark"]) .prp-title h1 i {
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type,
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type] {
  --c: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type .rp-ti {
  box-shadow: 0 0 0 1.5px var(--color-border) inset !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[aria-pressed="true"] .rp-ti {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[aria-pressed="true"] b {
  color: var(--accent) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-head {
  background: var(--soft) !important;
  border-bottom: 1px solid var(--color-border) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-quota span:not(.lbl) {
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-table thead th,
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-table thead th.lr-nm {
  background: #ECEBE6 !important;
  color: var(--color-text) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-table thead th small {
  color: var(--color-text-muted) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-table thead th {
  border-bottom-color: var(--color-border) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .lri-table tbody tr td {
  border-top-color: var(--color-border) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="leave"] {
  --tc: #1259C3;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="leaveRights"] {
  --tc: #7B3FA0;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="newhire"] {
  --tc: #1E8E3E;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="resign"] {
  --tc: #D6362B;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="maternity"] {
  --tc: #C2549A;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="cert"] {
  --tc: #C28A12;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[data-type="leaveAlerts"] {
  --tc: #E0662B;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type .rp-ti {
  color: var(--tc, var(--color-text)) !important;
  background: color-mix(in srgb, var(--tc, #888) 8%, #FFFFFF) !important;
  box-shadow: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[aria-pressed="true"] .rp-ti {
  background: var(--tc, var(--accent)) !important;
  color: #FFFFFF !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .rp-type[aria-pressed="true"] b {
  color: var(--tc, var(--accent)) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .m-quick-tile {
  background: #FFFFFF !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: none !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .m-quick-row {
  background: #FFFFFF !important;
  border: 1px solid var(--color-border) !important;
}
:where(html[data-theme="light"], html[data-theme="dark"]) .pe-tab.on {
  border-bottom-color: var(--accent) !important;
}
/* ---- [4] ธีมมืด: ย้อมสี light.css อัตโนมัติ ---- */
@media screen {
html[data-theme="dark"] {
  --color-bg: #1E293F;
  --color-surface: #182132;
  --color-text: #D6DBE4;
  --color-text-muted: #9BA6BD;
  --color-border: #263451;
  --accent: #D74741;
  --accent-soft: #481B18;
  --soft: #212D45;
}
:where(html[data-theme="dark"]) .db-mini.is-zero .db-mt b {
  color: #6C788F;
}
:where(html[data-theme="dark"]) .db-mini.is-zero small {
  color: #8B97B1;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .m-nav-fab-circle {
  box-shadow: 0 4px 10px rgba(200, 48, 42, 0.25), 0 0 0 4px #182132 !important;
}
:where(html[data-theme="dark"]) .m-nav-fab.active .m-nav-fab-circle {
  box-shadow: 0 4px 10px rgba(200, 48, 42, 0.25), 0 0 0 4px #182132, 0 0 0 6px rgba(200, 48, 42, 0.25) !important;
}
}
:where(html[data-theme="dark"]) body:has(.glass-login) {
  background: #202B43;
}
:where(html[data-theme="dark"]) .glass-login {
  background: #202B43 !important;
}
:where(html[data-theme="dark"]) .glass-card {
  background: #182132 !important;
}
:where(html[data-theme="dark"]) .glass-field label {
  background: #182132 !important;
}
:where(html[data-theme="dark"]) .glass-field input::placeholder {
  color: #8891A5 !important;
}
:where(html[data-theme="dark"]) .glass-field input:focus {
  background: #182132 !important;
}
:where(html[data-theme="dark"]) .glass-field-icon {
  stroke: #8891A5 !important;
}
:where(html[data-theme="dark"]) .glass-field .toggle-pin {
  color: #8891A5 !important;
}
:where(html[data-theme="dark"]) .lri-table thead th,
:where(html[data-theme="dark"]) .lri-table thead th.lr-nm {
  background: #24314C !important;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leave"] {
  --tc: #2673E7;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leaveRights"] {
  --tc: #9555BC;
}
:where(html[data-theme="dark"]) .rp-type[data-type="newhire"] {
  --tc: #2CD05B;
}
:where(html[data-theme="dark"]) .rp-type[data-type="resign"] {
  --tc: #DB4D44;
}
:where(html[data-theme="dark"]) .rp-type[data-type="maternity"] {
  --tc: #C660A1;
}
:where(html[data-theme="dark"]) .rp-type[data-type="cert"] {
  --tc: #E7A926;
}
:where(html[data-theme="dark"]) .rp-type[data-type="leaveAlerts"] {
  --tc: #E3753F;
}
:where(html[data-theme="dark"]) .rp-type .rp-ti {
  color: color-mix(in srgb, var(--tc, var(--color-text)) 68%, #FFFFFF) !important;
  background: color-mix(in srgb, var(--tc, #888) 8%, #182132) !important;
}
:where(html[data-theme="dark"]) .rp-type[aria-pressed="true"] b {
  color: color-mix(in srgb, var(--tc, var(--accent)) 68%, #FFFFFF) !important;
}
:where(html[data-theme="dark"]) .m-quick-tile {
  background: #182132 !important;
}
:where(html[data-theme="dark"]) .m-quick-row {
  background: #182132 !important;
}
}
/* ---- [5] ธีมมืด: ปรับมือ (dark.css) ---- */
@media screen {
html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0B1220;
  --color-surface: #141E31;
  --color-text: #E6EBF4;
  --color-text-muted: #94A1B8;
  --color-border: #26334D;
  --color-blue: #3B7DF0;
  --accent: #3B7DF0;
  --accent-soft: rgba(77, 141, 255, 0.16);
  --soft: #1B2740;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35);
}
:where(html[data-theme="dark"]) body {
  background: var(--color-bg);
  color: var(--color-text);
}
:where(html[data-theme="dark"]) .card {
  background: var(--color-surface);
}
:where(html[data-theme="dark"]) .btn-glass:hover {
  background: #2F6FE0 !important;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .m-nav-fab-circle {
  box-shadow: 0 4px 12px rgba(77, 141, 255, 0.35), 0 0 0 4px var(--color-surface) !important;
}
:where(html[data-theme="dark"]) .m-nav-fab.active .m-nav-fab-circle {
  box-shadow: 0 4px 12px rgba(77, 141, 255, 0.35), 0 0 0 4px var(--color-surface), 0 0 0 6px rgba(77, 141, 255, 0.35) !important;
}
}
:where(html[data-theme="dark"]) :focus-visible {
  outline-color: rgba(77, 141, 255, 0.7);
}
:where(html[data-theme="dark"]) .db-mini.is-zero .db-mt b {
  color: #3A4762;
}
:where(html[data-theme="dark"]) .db-mini.is-zero small {
  color: #6E7C98;
}
:where(html[data-theme="dark"]) body:has(.glass-login) {
  background: var(--color-bg);
}
:where(html[data-theme="dark"]) .glass-login {
  background: var(--color-bg) !important;
}
:where(html[data-theme="dark"]) .glass-card {
  background: var(--color-surface) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}
:where(html[data-theme="dark"]) .glass-field label {
  background: var(--color-surface) !important;
}
:where(html[data-theme="dark"]) .glass-field input:focus {
  background: var(--color-surface) !important;
}
@media (max-width: 639px) {
:where(html[data-theme="dark"]) .seg-group > button[aria-pressed="true"],
:where(html[data-theme="dark"]) .seg-group > button[style*="rgb(17, 17, 17)"],
:where(html[data-theme="dark"]) .seg-group > button[style*="#111"],
:where(html[data-theme="dark"]) .settings-subnav-bar > .settings-subnav-btn.active {
  background: #2B3A58 !important;
  color: #8DB6FF !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}
}
:where(html[data-theme="dark"]) .lr-table tr.lr-grp td,
:where(html[data-theme="dark"]) .lri-table td.lri-br,
:where(html[data-theme="dark"]) .lrm-sec b {
  color: #8DB6FF;
}
:where(html[data-theme="dark"]) .lr-table tr.lr-grp td b {
  color: #8DB6FF;
}
:where(html[data-theme="dark"]) .thm-sw {
  background: #3A4566;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
:where(html[data-theme="dark"]) .thm-knob {
  background: #F2F5FC;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
}
:where(html[data-theme="dark"]) .thm-sw button {
  color: #8C97B8;
}
:where(html[data-theme="dark"]) .thm-sw button[aria-checked='true'][data-t='light'] {
  color: #F59E0B;
}
:where(html[data-theme="dark"]) .thm-sw button[aria-checked='true'][data-t='dark'] {
  color: #4F67D8;
}
:where(html[data-theme="dark"]) .thm-sw button:not([aria-checked='true']):hover {
  color: #C4CCE4;
}
:where(html[data-theme="dark"]) .m-acct-trow {
  border-bottom-color: var(--color-border);
}
:where(html[data-theme="dark"]) .thm-btn[data-cur='dark'] .ic,
:where(html[data-theme="dark"]) .thm-opt[data-t='dark'] .ic {
  color: #7EA2FF;
}
:where(html[data-theme="dark"]) .thm-menu {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
:where(html[data-theme="dark"]) .thm-opt:hover {
  background: rgba(255, 255, 255, 0.07);
}
:where(html[data-theme="dark"]) .error-box,
:where(html[data-theme="dark"]) .glass-card .error-box {
  color: #FF9C94;
}
:where(html[data-theme="dark"]) :is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg, .rm-seg) {
  background: linear-gradient(180deg, #0C1424, #121C30);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05);
}
:where(html[data-theme="dark"]) :is(.qe-seg, .lc-seg, .lh-seg, .pe-seg, .acc-seg, .pr-seg, .lr-seg) > button:is(.on, [aria-pressed='true']),
:where(html[data-theme="dark"]) .rm-seg > label:has(input:checked) {
  background: linear-gradient(180deg, #2C3C5E, #22304C);
  color: #FFFFFF;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5), 0 0 0 1.5px var(--accent);
}
:where(html[data-theme="dark"]) .qe-cb-list {
  background: var(--color-surface);
}
:where(html[data-theme="dark"]) :is(.lr-kmode, .lm-seg, .settings-subnav-bar, .pe-tabs, .seg-group) {
  background: linear-gradient(180deg, #0C1424, #121C30) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}
:where(html[data-theme="dark"]) :is(.lr-kmode > button[aria-pressed='true'], .lm-seg > button.on, .lm-seg > button[aria-pressed='true'], .seg-group > button[aria-pressed='true'], .settings-subnav-bar > .settings-subnav-btn.active, .pe-tab.on) {
  background: linear-gradient(180deg, #2C3C5E, #22304C) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5), 0 0 0 1.5px var(--accent) !important;
}
html[data-theme="dark"][data-theme="dark"] {
  --d3-hl: rgba(255, 255, 255, 0.2);
  --d3-hl-sec: rgba(255, 255, 255, 0.07);
  --d3-lo: rgba(0, 0, 0, 0.25);
  --d3-lo-sec: rgba(0, 0, 0, 0.25);
  --d3-press: rgba(0, 0, 0, 0.35);
  --d3-press-sec: rgba(0, 0, 0, 0.35);
  --d3-drop-sec: rgba(0, 0, 0, 0.6);
  --d3-drop-tile: rgba(0, 0, 0, 0.6);
  --d3-glow: rgba(59, 125, 240, 0.5);
}
html[data-theme="dark"][data-theme="dark"] .qe-chip.ok {
  background: rgba(52, 176, 98, 0.2);
  color: #8FE3AE;
}
html[data-theme="dark"][data-theme="dark"] .qe-chip.warn {
  background: rgba(224, 162, 27, 0.24);
  color: #F5D27A;
}
html[data-theme="dark"][data-theme="dark"] .qe-chip.bad {
  background: rgba(214, 54, 43, 0.3);
  color: #FFB9B2;
}
html[data-theme="dark"][data-theme="dark"] .qe-chip.wait {
  background: rgba(255, 255, 255, 0.08);
  color: #AAB4C5;
}
html[data-theme="dark"][data-theme="dark"] .qe-chip.wait::before {
  border-color: #6F7B90;
}
html[data-theme="dark"][data-theme="dark"] .qe-list .qe-row > .qe-status.warn {
  background: rgba(224, 162, 27, 0.14);
  color: #F1D58A;
}
html[data-theme="dark"][data-theme="dark"] .qe-list .qe-row > .qe-status.bad {
  background: rgba(214, 54, 43, 0.16);
  color: #FFB9B2;
}
:where(html[data-theme="dark"]) .glass-powered-name span {
  color: #FF8A84;
}
}
/* ==== THEMES:END ==== */
