/* =====================================================================
   KPOMS (ระบบสำนักงานอิเล็กทรอนิกส์) — ระบบดีไซน์กลาง
   ฟอนต์: IBM Plex Sans Thai (โฮสต์ในเครื่อง ไม่ต้องใช้อินเทอร์เน็ต · 3.354.0 กลับมาใช้แทน Noto Sans Thai)
   สี: หมึกน้ำเงินเข้ม (ตัวอักษร), โคบอลต์ (ปุ่มหลัก), ดาวเรือง (วันนี้/เวลาปัจจุบัน)
   ===================================================================== */

/* 3.354.0 ฟอนต์หน้าจอทั้งระบบ = IBM Plex Sans Thai (4 น้ำหนัก 400 500 600 700) แทน Noto Sans Thai ของ 3.321.0–3.353.0
   (ตัว J พิมพ์ใหญ่ของ Plex วางบนเส้นบรรทัด จึงไม่ต้องมีฟอนต์ "KPOMS J" แยกอีก) · เอกสาร (A4 Word พิมพ์ ใบลา) ยังเป็น TH Sarabun / Sarabun */
@font-face { font-family: "IBM Plex Sans Thai"; src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Thai"; src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --canvas: #F0F3F8;     /* 3.211.0 เข้มขึ้นเล็กน้อย (เดิม #F4F6FA) ให้การ์ดขาว/แถบส่วนหัว/เมนูซ้าย แยกจากพื้นหน้าชัด (ΔE ≥ 3.5) */
  --surface: #FFFFFF;
  --surface-2: #EFF2F7;  /* 3.211.0 หัวตาราง/ท้ายการ์ด บนพื้นขาว (เดิม #F8F9FC ใกล้ขาวเกินไป) */
  --ink: #18213A;
  --ink-2: #47516A;
  --muted: #5F6982;
  --line: #DCE1EA;       /* 3.211.0 เส้นขอบชัดขึ้น (เดิม #E2E6EE) */
  --line-2: #EDF0F5;
  --chip: #E6EAF1;       /* 3.211.0 พื้นป้ายสีกลาง (เดิมใช้ --line-2) */
  --primary: #2C54E0;
  --primary-ink: #1E3FB5;
  --primary-wash: #EDF1FF;
  --accent: #E9A21B;
  --accent-wash: #FFF5E1;
  --ok: #117A55;
  --ok-wash: #E4F4EC;
  --bad: #BE3A31;
  --bad-wash: #FCEBEA;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sidebar-w: 272px;
  --side-bg: #E8EEFC;   /* 3.125.0 พื้นแถบเมนูด้านซ้าย · 3.211.0 ฟ้าอ่อนเดียวกับแถบส่วนหัว (สีรอง 30 ของหลัก 60:30:10 · เดิม #F3F5F9) */
  --topbar-h: 64px;
  --topbar-bg: #E8EEFC;   /* 3.210.0 พื้นแถบส่วนหัว (หน้าหลัก คู่มือ ชื่อผู้ใช้) ฟ้าอ่อน แยกจากพื้นหน้า --canvas · โทนเดียวกับ --primary-wash */
  --topbar-line: #D3DCF4;

  --bs-body-font-family: "IBM Plex Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;   /* 3.354.0 */
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.65;
  --bs-body-color: #18213A;
  --bs-body-bg: #F0F3F8;
  --bs-emphasis-color: #18213A;
  --bs-secondary-color: #5F6982;
  --bs-success: #117A55; --bs-success-rgb: 17, 122, 85;   /* 3.379.0 สีเขียว/แดงของข้อความ (text-success/text-danger) ใช้โทนเดียวกับ --ok/--bad คอนทราสต์ผ่าน 4.5 บนพื้นกระจก */
  --bs-danger-rgb: 190, 58, 49; --bs-success-text-emphasis: #0B5A3E;
  --bs-primary: #2C54E0;
  --bs-primary-rgb: 44, 84, 224;
  --bs-link-color: #2C54E0;
  --bs-link-color-rgb: 44, 84, 224;
  --bs-link-hover-color: #1E3FB5;
  --bs-link-hover-color-rgb: 30, 63, 181;
  --bs-border-color: #DCE1EA;
  --bs-border-radius: 10px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 12px;
  --bs-focus-ring-color: rgba(44, 84, 224, .25);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { text-underline-offset: .2em; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.005em; }
h5, h6, .h5, .h6 { font-weight: 700; }   /* 3.379.0 หัวข้อเล็กหนาเท่าหัวข้ออื่น (Bootstrap 500 ดูเหมือนข้อความธรรมดา) */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { line-height: 1.35; }   /* 3.362.0 หัวข้อภาษาไทยที่ขึ้นบรรทัดใหม่ไม่ชิดกัน (Bootstrap 1.2 สระบน-ล่างชนกัน) */
.tnum { font-variant-numeric: tabular-nums; }
::selection { background: rgba(44, 84, 224, .18); }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

/* ---------- ปุ่มและฟอร์ม ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; }   /* 3.89.0 ไอคอนอยู่หน้าข้อความบรรทัดเดียวกันเสมอ */
.btn-sm { border-radius: 8px; padding: .3rem .7rem; font-size: .9rem; }
.btn-lg { padding: .65rem 1.3rem; font-size: 1.02rem; border-radius: 12px; }
.btn i { margin-right: .3rem; flex: none; }
.btn.text-nowrap, .btn-sm { flex-wrap: nowrap; }
.btn-primary {
  --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-ink); --bs-btn-hover-border-color: var(--primary-ink);
  --bs-btn-active-bg: #183294; --bs-btn-active-border-color: #183294;
  --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: 44, 84, 224;
}
/* 3.89.0 ปุ่มรองไม่ใช้พื้นขาว: พื้นฟ้าอ่อน ตัวอักษรน้ำเงินเข้ม (คอนทราสต์ 7:1) แยกจากพื้นการ์ดสีขาวชัดเจน */
.btn-light {
  --bs-btn-bg: #EAF0FF; --bs-btn-border-color: #C9D6FB; --bs-btn-color: var(--primary-ink);
  --bs-btn-hover-bg: #DCE6FF; --bs-btn-hover-border-color: #AFC3F8; --bs-btn-hover-color: #172F8A;
  --bs-btn-active-bg: #CFDCFF; --bs-btn-active-border-color: #9DB5F5; --bs-btn-active-color: #172F8A;
  --bs-btn-disabled-bg: #E6EAF1; --bs-btn-disabled-border-color: #CDD4DF; --bs-btn-disabled-color: var(--muted);   /* 3.211.0 ปุ่มที่กดไม่ได้ยังเห็นเป็นปุ่ม (เดิม #F0F2F6 กลืนกับพื้นหน้า) */
}
.btn-outline-primary { --bs-btn-bg: #F3F6FF; --bs-btn-color: var(--primary); --bs-btn-border-color: #A9BDF7; --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: #8FCFB2; --bs-btn-bg: var(--ok-wash); --bs-btn-hover-bg: var(--ok); --bs-btn-hover-border-color: var(--ok); --bs-btn-active-bg: #0E6646; --bs-btn-active-border-color: #0E6646; }   /* 3.379.0 คอนทราสต์ผ่าน (เดิมสีเริ่มต้น #198754 4.3:1) */
.btn-outline-danger { --bs-btn-bg: var(--bad-wash); --bs-btn-border-color: #EBB3AE; --bs-btn-color: var(--bad); --bs-btn-hover-bg: var(--bad); --bs-btn-hover-border-color: var(--bad); }
.btn-outline-warning { --bs-btn-bg: var(--accent-wash); --bs-btn-color: #8A4B06; --bs-btn-border-color: #F0C77A; --bs-btn-hover-bg: #F59E0B; --bs-btn-hover-border-color: #F59E0B; --bs-btn-hover-color: #1F1300; --bs-btn-active-bg: #D97706; --bs-btn-active-border-color: #D97706; --bs-btn-active-color: #1F1300; }   /* 3.136.0 ตัวอักษรส้มเข้ม คอนทราสต์ผ่าน (เดิมเหลืองอ่อนบนพื้นอ่อน) */

.form-label { font-weight: 600; color: var(--ink); margin-bottom: .35rem; font-size: .95rem; }
.form-control, .form-select { border-color: var(--line); border-radius: 10px; padding: .55rem .85rem; background-color: #fff; }
.form-select { padding-left: .75rem; padding-right: 1.9rem; background-position: right .55rem center; text-overflow: ellipsis; }   /* 3.161.0 เว้นที่ให้ลูกศร ข้อความไม่ทับลูกศร (เดิม padding เท่ากันทั้งสองข้าง) */
.form-select-sm { padding-right: 1.75rem; background-position: right .45rem center; }
.form-control-lg { border-radius: 12px; padding: .7rem 1rem; font-size: 1.02rem; }
.form-control::placeholder { color: #9AA3B6; }
.form-control:focus, .form-select:focus { border-color: #8EA8F2; box-shadow: 0 0 0 .22rem rgba(44, 84, 224, .14); background-color: #fff; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.input-group > .btn { border-color: var(--line); }
.req { color: var(--bad); }

.alert { border-radius: var(--r); border: 0; padding: .85rem 1.1rem; }
.alert-success { background: var(--ok-wash); color: #0C5C40; }
.alert-danger { background: var(--bad-wash); color: #8E241D; }
.alert-warning { background: var(--accent-wash); color: #7A4B00; }
.alert-info { background: var(--primary-wash); color: var(--primary-ink); }

.dropdown-menu { border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(24, 33, 58, .12); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--muted); }
.dropdown-item.text-danger i { color: inherit; }
.dropdown-head { padding: .45rem .75rem .55rem; display: flex; flex-direction: column; line-height: 1.35; }
.dropdown-head small { color: var(--muted); }

/* ---------- โครงหน้า: sidebar + topbar ---------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* 3.125.0 พื้นแถบเมนูสีเทาอ่อน ให้การ์ดสีขาวของแต่ละหมวดเห็นชัด */
.sidebar { display: flex; flex-direction: column; background: var(--side-bg); }
@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    border-right: 1px solid var(--topbar-line); background-color: var(--side-bg) !important;
  }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { background-color: var(--side-bg) !important; }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: min(300px, 86vw); }
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.1rem 1.1rem .9rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--primary);
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 9px;
}
.brand-mark i { display: block; border-radius: 3px; background: #fff; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { opacity: .7; }
.brand-mark i:nth-child(4) { background: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: .98rem; font-weight: 700; }
.brand-text small { font-size: .8rem; color: var(--muted); }
.brand-text small.brand-org { font-size: .8rem; }   /* ชื่อระบบ 3 บรรทัด (3.105.0 ศธจ.นครราชสีมา) */
.brand-text strong, .brand-text small { overflow-wrap: anywhere; }

.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .25rem .75rem 1rem; }
.side-group { margin: 1.15rem .6rem .35rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.side-link {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; margin: 1px 0; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; line-height: 1.4;
}
.side-link > i { font-size: 1.1rem; width: 26px; text-align: center; color: var(--muted); }
.side-link:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }   /* 3.211.0 บนพื้นฟ้าอ่อน */
.side-link.active { background: #fff; color: var(--primary-ink); font-weight: 600; box-shadow: 0 0 0 1px #C9D6FB; }   /* 3.211.0 บนพื้นฟ้าอ่อน (นอกการ์ด) = พื้นขาว · ในการ์ดดู .side-card */
.side-link.active > i { color: var(--primary); }
.module-link.is-current { color: var(--ink); font-weight: 600; }
.side-link.is-soon { color: #9AA3B6; cursor: default; }
.side-link.is-soon:hover { background: none; color: #9AA3B6; }
.side-link.is-soon .glyph { filter: grayscale(1); opacity: .45; }
.side-link em { margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--line-2); padding: .05rem .5rem; border-radius: 999px; white-space: nowrap; }
.side-sub { margin: .15rem 0 .5rem 1.45rem; padding-left: .75rem; border-left: 2px solid var(--topbar-line); display: flex; flex-direction: column; gap: 1px; }
.sub-link { display: block; padding: .38rem .7rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.sub-link:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.sub-link.active { background: #fff; color: var(--primary-ink); font-weight: 600; box-shadow: 0 0 0 1px #C9D6FB; }
.sub-link.has-badge { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sub-badge { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: #B42318; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
.sub-badge.is-link { cursor: pointer; }   /* 3.313.0 กดที่ตัวเลข = รายการที่นับอยู่ (data-badge-href) */
.sub-badge.is-link:hover { box-shadow: 0 0 0 3px rgba(180, 35, 24, .22); }

/* เมนูหลักที่มีเมนูย่อย: ยุบไว้ กดเพื่อคลี่ (assets/js/app.js) */
.side-toggle { width: 100%; border: 0; background: none; text-align: left; font-family: inherit; cursor: pointer; }
.side-toggle > span:not(.glyph) { flex: 1 1 auto; min-width: 0; }
.side-caret { margin-left: auto; font-size: .78rem; color: var(--muted); transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
.side-module.is-open > .side-toggle { color: var(--ink); }
.side-module.is-open > .side-toggle .side-caret { transform: rotate(180deg); color: var(--ink-2); }
.side-collapse {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1), opacity .22s ease, visibility 0s linear .3s;
}
.side-collapse-inner { min-height: 0; overflow: hidden; }
.side-module.is-open > .side-collapse {
  grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1), opacity .25s ease .05s, visibility 0s;
}
.side-collapse .side-sub { transform: translateY(-4px); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.side-module.is-open > .side-collapse .side-sub { transform: none; }
.side-module.no-anim .side-collapse, .side-module.no-anim .side-sub, .side-module.no-anim .side-caret { transition: none !important; }
.sub-link.sub-module { display: flex; align-items: center; gap: .55rem; padding: .34rem .6rem; }
.sub-link.side-toggle { line-height: inherit; color: var(--ink-2); }
.sub-link.side-toggle:hover { color: var(--ink); }
.sub-link.side-toggle .side-caret { font-size: .75rem; margin-right: .1rem; }
.side-module-sub.is-open > .side-toggle { color: var(--ink); font-weight: 600; }
.sub-link.sub-module.is-current { color: var(--ink); font-weight: 600; }
.side-sub3 { margin: .1rem 0 .3rem 1.35rem; padding-left: .6rem; border-left: 2px solid var(--topbar-line); display: flex; flex-direction: column; gap: 1px; }
.side-sub3 .sub-link { font-size: .88rem; padding: .3rem .6rem; }
.sub-link .sub-icon { font-size: .95rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .side-collapse, .side-collapse .side-sub, .side-caret { transition: none !important; }
}

.sidebar-foot { display: flex; align-items: center; gap: .65rem; padding: .8rem 1rem; border-top: 1px solid var(--topbar-line); }
.sidebar-foot .me { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.sidebar-foot .me strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .me small { font-size: .78rem; color: var(--muted); }
.sidebar-foot form { margin: 0; }

.glyph {
  --glyph: var(--primary);
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: inline-grid; place-items: center;
  background: var(--glyph); color: #fff; font-size: 1.25rem;
}
.glyph-sm { width: 26px; height: 26px; border-radius: 8px; font-size: .85rem; }
.glyph-xs { width: 22px; height: 22px; border-radius: 6px; font-size: .75rem; }
.glyph-lg { width: 60px; height: 60px; border-radius: 17px; font-size: 1.65rem; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--ink); font-weight: 700; line-height: 1; font-size: .95rem;
}
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font-size: 1.15rem;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem;
  padding: 0 2rem; background: rgba(232, 238, 252, .94); backdrop-filter: saturate(1.4) blur(10px);   /* 3.210.0 = --topbar-bg โปร่งเล็กน้อย (เดิมสีเดียวกับพื้นหน้า) */
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--topbar-line);
}
.crumb { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; font-size: .95rem; }
.crumb-sep { color: #A7AFC0; font-size: .7rem; flex: none; }
.crumb-page { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 3.159.0 เมนูลำดับชั้น: หน้าหลัก › หมวด › กลุ่ม › ระบบ › เมนู › หน้านี้ (ทุกชั้นกดได้) */
.crumb-list { display: flex; align-items: center; gap: .15rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
.crumb-item { display: flex; align-items: center; gap: .15rem; min-width: 0; flex: none; }   /* ชั้นก่อนหน้าไม่ย่อบนจอกว้าง (ชื่อยาวสุด 12rem) */
.crumb-item.crumb-home { flex: none; }
.crumb-item.is-current { flex: 0 6 auto; min-width: 5rem; }   /* ชื่อหน้านี้ (มีหัวข้อใหญ่ในหน้าอยู่แล้ว) ย่อก่อนชั้นอื่น */
.crumb-link { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; max-width: 12rem; padding: .25rem .45rem; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; }
.crumb-link:hover, .crumb-drop[aria-expanded="true"] { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.crumb-link:focus-visible { outline: 3px solid rgba(44, 84, 224, .35); outline-offset: 1px; }
.crumb-link.is-static { cursor: default; }
.crumb-link.is-static:hover { background: transparent; box-shadow: none; }
.crumb-link > .bi, .crumb-page > .bi { flex: none; color: var(--muted); font-size: .9rem; }
.crumb-home .crumb-link > .bi { font-size: 1rem; }
.crumb-link .glyph, .crumb-page .glyph { flex: none; }
.crumb-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb-page { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; padding: .25rem .2rem; }
.crumb-caret { flex: none; font-size: .65rem; color: var(--muted); }
.crumb-dd { display: flex; min-width: 0; }
.crumb-menu { min-width: 15rem; max-width: min(22rem, 92vw); max-height: min(70vh, 30rem); overflow-y: auto; padding: .35rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14); }
.crumb-menu .dropdown-header { padding: .3rem .6rem .35rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.crumb-menu .dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .4rem .6rem; border-radius: 8px; white-space: normal; }
.crumb-menu .dropdown-item > .bi { width: 22px; text-align: center; color: var(--muted); }
.crumb-menu .dropdown-item.active { background: var(--primary-wash); color: var(--ink); font-weight: 600; }
.crumb-menu .dropdown-item.active > .bi { color: var(--primary); }
.user-btn { display: flex; align-items: center; gap: .55rem; border: 0; background: transparent; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; color: var(--ink); }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.user-btn .user-name { font-weight: 500; font-size: .93rem; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn .bi-chevron-down { font-size: .75rem; color: var(--muted); }

.content { padding: 1.75rem 2rem 2.5rem; width: 100%; max-width: 1320px; flex: 1 0 auto; }
.app-foot { margin-top: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.app-foot p { margin: 0; }
.app-foot .app-foot-dev { margin-top: .2rem; }   /* 3.260.0 บรรทัดผู้พัฒนาระบบ ใต้ชื่อระบบ */

@media (max-width: 1199.98px) { .crumb-item { flex: 0 1 auto; } }   /* 3.159.0 จอกลาง: ชั้นก่อนหน้าย่อได้ */
@media (min-width: 1200px) {   /* 3.190.0 จอกว้าง: ชื่อหน้านี้ย่อก่อนจนสุด แล้วชั้นก่อนหน้าจึงย่อ (ไม่ล้นเมื่อชื่อผู้ใช้มีคำนำหน้า เมนูลึกหลายชั้น) */
  .crumb-item:not(.crumb-home) { flex: 0 1 auto; }
  .crumb-item.is-current { flex: 0 100000 auto; }
}
@media (max-width: 991.98px) {
  .topbar { padding: 0 .75rem; }
  .content { padding: 1.25rem 1rem 2rem; }
}
@media (max-width: 1199.98px) {   /* 3.295.0 เดิม < 576 px · แถบบนมีปุ่มช่วยอ่าน 3 ปุ่ม: จอเล็กกว่า 1200 px เหลือรูปผู้ใช้ (ชื่ออยู่ในเมนูที่กดเปิด) */
  .user-btn .user-name, .user-btn .bi-chevron-down { display: none; }
}
@media (max-width: 767.98px) {   /* 3.259.0 เดิมถึง 575.98 px · จอ 576–767 px ชื่อผู้ใช้แสดงอยู่ ที่ของเมนูลำดับชั้นแคบเท่าจอโทรศัพท์ */
  /* 3.159.0 จอแคบ: ชั้นก่อนหน้าเหลือแต่ไอคอน (ชั้นที่ไม่มีไอคอนยังแสดงชื่อแบบย่อ) · หน้านี้แสดงชื่อเต็มเท่าที่พอ */
  .crumb-item:not(.is-current):not(.no-glyph) .crumb-text, .crumb-caret { display: none; }
  .crumb-item.no-glyph:not(.is-current) .crumb-link { max-width: 5.5rem; }
  .crumb-sep { font-size: .55rem; }
  .crumb-home, .crumb-home + .crumb-item > .crumb-sep, .crumb-item.is-current .crumb-page > .bi { display: none; }   /* หน้าหลักอยู่ในเมนูด้านซ้ายแล้ว */
  /* 3.259.0 ชั้นก่อนหน้าไม่ย่อจนปุ่มทับกัน (เป้ากดอย่างน้อย 24 px) · เมนูลึกแสดง 2 ชั้นที่ใกล้หน้านี้ที่สุด (ชั้นอื่นอยู่ในเมนูด้านซ้าย) */
  .crumb-item:not(.is-current) { flex: none; }
  .crumb-item.no-glyph:not(.is-current) { flex: 0 1 auto; min-width: 2.75rem; }
  .crumb-item.no-glyph:not(.is-current) .crumb-link { flex: 1 1 auto; }
  .crumb-item:not(.is-current) .crumb-link { min-width: 2.25rem; justify-content: center; }   /* 3.379.0 จุดแตะกว้าง 36px (เดิม 28px) */
  .crumb-item:not(.is-current):nth-last-child(n+4) { display: none; }
  .crumb-item:nth-last-child(3) > .crumb-sep { display: none; }
}
@media (max-width: 379.98px) {   /* 3.259.0 จอเล็กมาก (320 px): ชั้นก่อนหน้า 1 ชั้น */
  .crumb-item:not(.is-current):nth-last-child(n+3) { display: none; }
  .crumb-item:nth-last-child(2) > .crumb-sep { display: none; }
}
/* 3.295.0 โทรศัพท์ (< 576 px): แถบบนมีปุ่มแว่นขยาย สปอตไลท์ คู่มือ — เมนูลำดับชั้นเหลือระบบ (ไอคอน) + ชื่อหน้า ไม่ทับกัน */
@media (max-width: 575.98px) {
  .crumb { gap: .3rem; }
  .crumb-item:not(.is-current):nth-last-child(n+3) { display: none; }
  .crumb-item:nth-last-child(2) > .crumb-sep { display: none; }
  .topbar .a11y-tools { gap: .2rem; }
  .a11y-tools .a11y-btn { width: 36px; height: 36px; font-size: .9rem; }   /* 3.379.0 จุดแตะ 36px (เดิม 32px) */
  .topbar .user-btn { padding: .2rem; }
}
@media (max-width: 379.98px) {   /* 320 px: เหลือชื่อหน้านี้ชั้นเดียว */
  .a11y-tools .a11y-btn { width: 34px; height: 34px; position: relative; }
  .a11y-tools .a11y-btn::after { content: ""; position: absolute; inset: -3px; }   /* 3.379.0 พื้นที่แตะกว้างกว่าวงกลม */
  .crumb-item:not(.is-current) { display: none; }
  .crumb-item.is-current > .crumb-sep { display: none; }
}

/* ---------- ส่วนประกอบทั่วไป ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.3; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-head p { margin: 0; color: var(--muted); font-size: .88rem; }
.panel-head a { font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 575.98px) { .panel-head { flex-wrap: wrap; } .panel-head > div:first-child { min-width: 0; flex: 1 1 12rem; } }   /* 3.87.0 จอแคบ: ปุ่มขึ้นบรรทัดใหม่แทนล้นจอ */
.panel-body { padding: 1.25rem; }
@media (max-width: 400px) { .panel-body { padding: 1rem .85rem; } }   /* 3.87.0 จอ 320–400 ได้พื้นที่เพิ่ม */
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--ink-2); }
.empty-state > i { font-size: 2.1rem; color: #A3ACBE; display: block; margin-bottom: .6rem; }
.empty-state h1, .empty-state h2 { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 0 0 .3rem; }
.empty-state p { color: var(--muted); margin: 0; }
section.empty-state { max-width: 560px; margin: 3rem auto; }
.empty-mini { color: var(--muted); padding: 1rem 1.25rem 1.25rem; margin: 0; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; line-height: 1.5;
  padding: .1rem .6rem; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 58, .07);   /* 3.211.0 เส้นบางรอบป้าย ไม่กลืนกับพื้นใต้ป้าย */
}
.chip-primary { background: var(--primary-wash); color: var(--primary-ink); }
.chip-ok { background: var(--ok-wash); color: var(--ok); }
.chip-bad { background: var(--bad-wash); color: var(--bad); }
.chip-accent { background: var(--accent-wash); color: #7A4B00; }

.facts { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .7rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dt { margin-top: .6rem; }
}

.table-clean { --bs-table-bg: transparent; margin: 0; }
.table-clean > :not(caption) > * > * { padding: .75rem 1.25rem; border-color: var(--line-2); }
.table-clean thead th { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom-color: var(--line); background: var(--surface-2); }
.table-clean tbody tr:last-child > * { border-bottom: 0; }
.table-clean a.row-title { color: var(--ink); text-decoration: none; font-weight: 600; }
.table-clean a.row-title:hover { color: var(--primary); text-decoration: underline; }
.table-clean form { margin: 0; }
.table-clean tr.is-off { color: var(--muted); }

.filter-bar { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.filter-bar .form-label { font-size: .85rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }
[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
/* 3.294.0 ค้นหาทันทีทุกหน้า (app.js data-live-auto): ระหว่างโหลดจางเฉพาะส่วนผลลัพธ์ ฟอร์มที่กำลังพิมพ์ไม่จาง */
#main[aria-busy="true"] { opacity: 1; }
#main[aria-busy="true"] > :not(:has(form[data-live-auto])) { opacity: .55; transition: opacity .15s; }
.live-hidden { display: none !important; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line-2); font-size: .9rem; color: var(--muted); }
.pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; list-style: none; margin: 0 auto; padding: 0; }
.pager-btn {
  min-width: 34px; height: 34px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums;
}
a.pager-btn:hover { border-color: #C5CCDA; color: var(--ink); background: var(--surface-2); }
.pager-btn.is-current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager-btn.is-disabled { opacity: .4; }
.pager-gap { padding: 0 .2rem; color: var(--muted); }
.pager-per { display: inline-flex; align-items: center; gap: .45rem; margin: 0; white-space: nowrap; }
.pager-per .form-select { width: auto; min-width: 4.8rem; padding-top: .2rem; padding-bottom: .2rem; }
.pager.is-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-top: 1rem; }
@media (max-width: 575.98px) {
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
}

/* ---------- หน้าหลัก ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.5rem; }
.hello h1 { font-size: 1.75rem; font-weight: 700; margin: 0; line-height: 1.3; }
.hello p { margin: .2rem 0 0; color: var(--muted); }
.hello .last-login { font-size: .85rem; color: var(--muted); }
.hello .hello-date { margin: 0; color: var(--ink-2); font-size: 1.02rem; font-weight: 600; }   /* 3.160.0 แทนคำทักทาย */
.hello .hello-date .bi { color: var(--primary); }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; padding: .75rem; }
@media (max-width: 575.98px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .5rem; } .app { padding: .9rem .4rem; } }
.app {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem;
  padding: 1.1rem .75rem 1rem; border-radius: 14px; text-decoration: none; color: var(--ink); position: relative;
}
a.app:hover { background: var(--surface-2); color: var(--ink); }
a.app:hover .glyph { transform: translateY(-2px); }
.app .glyph { transition: transform .15s ease; box-shadow: 0 6px 16px -6px var(--glyph); }
.app strong { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.app small { color: var(--muted); font-size: .84rem; line-height: 1.45; max-width: 22ch; }
.app.is-soon { color: var(--muted); }
.app.is-soon .glyph { filter: grayscale(1); opacity: .4; box-shadow: none; }
.app.is-soon .chip { position: absolute; top: .6rem; right: .6rem; font-size: .75rem; }

/* ---------- หน้าบัญชี ---------- */
.profile-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.profile-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.profile-head .roles { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
/* ข้อมูลของฉัน: อายุและอายุราชการ (3.24.0) */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 1199.98px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .svc-grid { grid-template-columns: 1fr; } }
.svc-tile { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.svc-label { display: flex; align-items: center; gap: .4rem; color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.svc-label i { color: var(--primary); }
.svc-val { font-size: 1.25rem; font-weight: 700; line-height: 1.35; color: var(--ink); font-variant-numeric: tabular-nums; }
.svc-na { font-size: .95rem; font-weight: 500; color: var(--muted); }
.svc-sub { color: var(--muted); font-size: .84rem; }
.svc-bar { margin-top: 1rem; }
.svc-bar-track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.svc-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #5B7CF0); }
.svc-bar-labels { display: flex; justify-content: space-between; gap: .5rem; margin-top: .35rem; font-size: .82rem; color: var(--muted); }
.svc-bar-labels .tnum { color: var(--ink-2); font-weight: 600; }

.narrow { max-width: 560px; }
.rules { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: .5rem; }
.rules li.is-ok { color: var(--ok); }
.note { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: var(--r); background: var(--primary-wash); color: var(--primary-ink); font-size: .92rem; }
.note i { font-size: 1.1rem; }
.note > div, .note > span { min-width: 0; overflow-wrap: anywhere; }   /* 3.87.0 จอ 320 ไม่ล้น */
.note.note-warn { background: var(--accent-wash); color: #6B4200; }
.note.note-bad { background: var(--bad-wash); color: var(--bad); }
.note.note-bad a { color: inherit; font-weight: 600; }

/* ---------- หน้าเข้าสู่ระบบ ---------- */
body.is-bare { background: var(--surface); }
.auth {
  --top: max(6vh, calc(50vh - 320px));
  --band: calc(var(--top) + 236px);
  position: relative; min-height: 100vh; background: var(--canvas); isolation: isolate;
}
.auth::before {
  content: ""; position: absolute; inset: 0 0 auto; height: var(--band); z-index: -1;
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(44, 84, 224, .38), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
}
.auth-wrap {
  width: 100%; max-width: 456px; margin: 0 auto; padding: var(--top) 20px 28px;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 1.75rem; }
.auth-brand .brand-mark {
  width: 56px; height: 56px; border-radius: 16px; padding: 13px; gap: 5px; margin-bottom: 1rem;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .06), 0 10px 24px rgba(0, 0, 0, .25);
}
.auth-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 1rem; }
.auth-app { color: #fff; font-size: 1.4rem; font-weight: 700; line-height: 1.35; margin: 0; }
.auth-sub { color: #DCE3F0; font-size: 1.05rem; font-weight: 600; margin: .1rem 0 0; }   /* 3.104.0 */
.auth-org { color: #AEB8CC; font-size: .95rem; margin: .15rem 0 0; }
.auth-card {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 1px 2px rgba(24, 33, 58, .04), 0 24px 48px -16px rgba(24, 33, 58, .28);
}
.auth-form h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.auth-hint { color: var(--muted); font-size: .92rem; margin: .2rem 0 1.5rem; }
.auth-foot {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  color: var(--muted); font-size: .88rem; margin: 1.5rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line-2);
}
.auth-legal { margin-top: auto; padding-top: 2rem; color: var(--muted); font-size: .8rem; text-align: center; }
.auth-legal p { margin: 0; }   /* 3.146.0 บรรทัด © + พัฒนาโดย */
.auth-legal-dev { margin-top: .2rem; font-size: .75rem; }

@media (max-width: 575.98px) {
  .auth { --top: max(5vh, calc(50vh - 330px)); --band: calc(var(--top) + 214px); }
  .auth-wrap { padding: var(--top) 16px 20px; }
  .auth-brand { margin-bottom: 1.35rem; }
  .auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; padding: 11px; margin-bottom: .8rem; }
  .auth-app { font-size: 1.2rem; }
  .auth-sub { font-size: .98rem; }
  .auth-org { font-size: .88rem; }
  .auth-card { padding: 1.5rem 1.25rem 1.25rem; }
}

/* 3.377.0 หน้าเข้าสู่ระบบ: ประกาศ · เข้าใช้ครั้งแรก (พับ) · Caps Lock · ข้อความปิดได้ · ปุ่มกำลังเข้าสู่ระบบ · ลิงก์ท้ายหน้า · แผงคำแนะนำจอกว้าง */
.auth-body { width: 100%; }
.auth-preview { display: flex; flex-wrap: wrap; gap: .1rem .4rem; align-items: baseline; margin: 0 0 1rem; padding: .5rem .75rem; border-radius: 10px; background: #FEF3C7; color: #78350F; font-size: .86rem; }
.auth-preview a { white-space: nowrap; }   /* 3.379.0 จอแคบ: ลิงก์กลับไปตั้งค่าไม่ถูกบีบ */
.auth-notice { display: flex; gap: .65rem; align-items: flex-start; margin: 0 0 1.25rem; padding: .75rem .9rem; border-radius: 14px; border: 1px solid #BFD3FB; background: #EEF4FF; color: #1E3A8A; }
.auth-notice > .bi { font-size: 1.2rem; line-height: 1.3; color: #2563EB; }
.auth-notice strong { display: block; font-size: .9rem; }
.auth-notice p { margin: .15rem 0 0; font-size: .9rem; line-height: 1.55; color: #1F2A44; }
.auth-notice.is-warning { border-color: #F5C97A; background: #FFF7E6; color: #78350F; }
.auth-notice.is-warning > .bi { color: #B45309; }
.auth-first { margin: .35rem 0 1.25rem; font-size: .9rem; color: var(--ink-2); }
.auth-first > summary { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; list-style: none; color: var(--primary-ink, #1D4ED8); font-weight: 600; padding: .2rem 0; }
.auth-first > summary::-webkit-details-marker { display: none; }
.auth-first > summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: .2rem; transition: transform .15s; }
.auth-first[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
@media (pointer: coarse) { .auth-first > summary { min-height: 2.75rem; } }   /* 3.379.0 จอสัมผัส: พื้นที่แตะ 44px */
.auth-first > summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; border-radius: 6px; }
.auth-first ol { margin: .5rem 0 .35rem; padding-left: 1.25rem; line-height: 1.6; }
.auth-first p { margin: 0; color: var(--muted); font-size: .86rem; }
.auth-alert { display: flex; align-items: flex-start; gap: .5rem; }
.auth-alert > span { flex: 1; min-width: 0; }
.auth-alert .btn-close { flex: none; padding: .35rem; margin: -.15rem -.25rem 0 0; font-size: .7rem; }
.auth-alert.is-hiding { opacity: 0; transition: opacity .3s; }
.auth-caps { display: flex; align-items: center; gap: .35rem; margin: .45rem 0 0; color: #92400E; font-size: .86rem; font-weight: 600; }
.auth-submit.is-loading { pointer-events: none; }
.auth-submit .spinner-border { width: 1rem; height: 1rem; border-width: .16em; }
.auth-foot span { min-width: 0; overflow-wrap: anywhere; text-align: start; }   /* 3.381.0 ขึ้นบรรทัดใหม่แล้วชิดไอคอน (เดิมกึ่งกลาง ไอคอนอยู่ห่างข้อความ) */
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; margin-bottom: .6rem; }
.auth-links a { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); font-weight: 600; text-decoration: none; padding: .25rem 0; }
.auth-links a:hover { color: var(--primary-ink, #1D4ED8); text-decoration: underline; }
.auth-side { display: none; }
@media (min-width: 1200px) {
  .auth.has-side .auth-wrap { max-width: 940px; }
  .auth.has-side .auth-body { display: grid; grid-template-columns: minmax(0, 456px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .auth.has-side .auth-side {
    display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(24, 33, 58, .04), 0 24px 48px -16px rgba(24, 33, 58, .2);
  }
}
.auth-side h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 1rem; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.auth-side li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: .75rem; align-items: start; }
.auth-side li > .bi { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; font-size: 1.15rem; background: #E7EEFF; color: #1D4ED8; }
.auth-side li:nth-child(2) > .bi { background: #E3F6EC; color: #15803D; }
.auth-side li:nth-child(3) > .bi { background: #FFF1DD; color: #B45309; }
.auth-side li:nth-child(4) > .bi { background: #F1E8FF; color: #6D28D9; }
.auth-side strong { display: block; font-size: .95rem; }
.auth-side p { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* 3.377.0 ประกาศความเป็นส่วนตัว (privacy.php) */
.auth.is-doc .auth-wrap { max-width: 780px; }
.privacy-doc { line-height: 1.7; }
.privacy-doc h1 { display: flex; align-items: center; gap: .5rem; font-size: 1.45rem; font-weight: 700; margin: 0 0 .35rem; }
.privacy-doc h2 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.privacy-lead { color: var(--muted); margin: 0 0 .5rem; }
.privacy-doc ul { padding-left: 1.2rem; margin: 0 0 .5rem; }
.privacy-doc li + li { margin-top: .3rem; }
.privacy-table td:last-child { white-space: nowrap; }
.privacy-back { margin: 1.75rem 0 0; }
main.panel.privacy-doc { max-width: 820px; padding: 1.5rem 1.75rem; }
@media (max-width: 575.98px) { .privacy-table td:last-child { white-space: normal; } .privacy-table td:first-child { width: 55%; } main.panel.privacy-doc { padding: 1.25rem 1rem; } }

/* ---------- หน้าสาธารณะ (เช่น ลิงก์สั้นที่เปิดไม่ได้) ---------- */
.public-note {
  max-width: 460px; margin: 14vh auto 0; padding: 2.25rem 1.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.public-note .brand-mark { width: 52px; height: 52px; border-radius: 15px; padding: 12px; gap: 5px; margin-bottom: .5rem; }
.public-note h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.public-note .su-url { font-size: .85rem; color: var(--muted); word-break: break-all; max-width: 36rem; }
.public-note .su-lead { font-size: .9rem; font-weight: 600; color: #7A4B00; background: var(--accent-wash); border-radius: 999px; padding: .2rem .85rem; }   /* 3.369.0 ลิงก์เดิมหมดอายุ/ปิด พาไปลิงก์สำรอง */
.public-note p { color: var(--ink-2); margin: 0; }
.public-note small { color: var(--muted); margin-top: 1.25rem; }

/* ---------- การเข้าถึงและการพิมพ์ ---------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .app-foot, .panel-actions { display: none !important; }
  body, .content { background: #fff; padding: 0; }
  /* 3.136.0 พิมพ์ตามที่เห็นบนจอ แต่ไม่ล้นกระดาษ: แถวคอลัมน์ไม่ยื่นเกินขอบ (gutter) · แถบแท็บ/ขั้นตอนที่เลื่อนแนวนอนได้ ขึ้นบรรทัดใหม่
     ตารางที่เลื่อนแนวนอนได้ พิมพ์ครบทุกคอลัมน์ (ตัวอักษรเล็กลงเล็กน้อย ข้อความยาวขึ้นบรรทัดใหม่) · หัวตารางซ้ำทุกหน้า ไม่ตัดแถวกลางหน้า */
  .content .row { margin-left: 0; margin-right: 0; }
  .tabs, .pj-steps { overflow: visible !important; flex-wrap: wrap; margin-left: 0 !important; margin-right: 0 !important; }
  .pj-steps ol { flex-wrap: wrap; width: auto !important; }
  .pj-savebar, .we-savebar, .wc-savebar { position: static !important; margin-left: 0 !important; margin-right: 0 !important; box-shadow: none !important; }
  .table-responsive { overflow: visible !important; }
  .table-responsive > .table { font-size: .82rem; }
  .table-responsive > .table th, .table-responsive > .table td { white-space: normal !important; overflow-wrap: anywhere; }
  thead { display: table-header-group; }
  tr, img, .chip { break-inside: avoid; page-break-inside: avoid; }
  /* ปฏิทิน (FullCalendar): ตารางเต็มความกว้างกระดาษ (เดิมใช้ความกว้างจากหน้าจอ) */
  .fc .fc-scrollgrid, .fc .fc-scrollgrid table, .fc .fc-col-header, .fc .fc-daygrid-body, .fc .fc-scrollgrid-sync-table, .fc .fc-timegrid-body, .fc .fc-list-table { width: 100% !important; }
}

/* ตารางเลื่อนแนวนอน: เก็บป้ายซ่อน (visually-hidden) ไว้ในกรอบ ไม่ให้หน้าเลื่อนแนวนอนบนมือถือ (3.40.0) */
.table-responsive { position: relative; }

/* ---------- รายการแบบแถว + กล่องวันที่ (ใช้ร่วมกันหลายระบบย่อย) ---------- */
.blist { list-style: none; margin: 0; padding: 0; }
.brow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center;
  padding: 1rem 1.25rem; border-top: 1px solid var(--line-2);
}
.brow:first-child { border-top: 0; }
.brow-compact { grid-template-columns: auto minmax(0, 1fr); padding: .85rem 1.25rem; gap: 1rem; }
.brow-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; font-size: .9rem; }
.brow-title { display: inline-block; font-weight: 600; font-size: 1.04rem; color: var(--ink); text-decoration: none; margin: .1rem 0; overflow-wrap: anywhere; line-height: 1.45; }
.brow-title:hover { color: var(--primary); text-decoration: underline; }
.brow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1.1rem; color: var(--ink-2); font-size: .9rem; }
.brow-meta i { color: var(--muted); margin-right: .35rem; }
.brow-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
@media (max-width: 575.98px) {
  .brow { grid-template-columns: auto minmax(0, 1fr); padding: 1rem; }
  .brow-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.dateblock {
  display: block; width: 62px; text-align: center; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #fff; line-height: 1.2; flex: none;
}
.dateblock .m { display: block; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 600; padding: .18rem 0; }
.dateblock .d { display: block; font-size: 1.45rem; font-weight: 700; padding-top: .2rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.dateblock .w { display: block; font-size: .75rem; color: var(--muted); padding-bottom: .3rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: .6rem .9rem; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--primary); }
.tabs .count { display: inline-block; min-width: 1.5rem; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; background: #DFE4EC; color: var(--ink-2); font-size: .76rem; text-align: center; }
.tabs a.active .count { background: var(--primary); color: #fff; }
/* หน้าหลัก: หมวดระบบงานตามสิทธิ์ และแท็บข้อมูลของแต่ละระบบ (3.22.0) */
.dash-note { color: var(--muted); font-size: .85rem; }
.dash-widgets { margin-top: .5rem; }
.dash-tabs { position: sticky; top: var(--topbar-h); z-index: 5; background: var(--canvas); margin-bottom: 1rem; }
.dash-tabs button { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  background: none; color: var(--ink-2); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.dash-tabs button:hover { color: var(--ink); }
.dash-tabs button.active { color: var(--ink); border-bottom-color: var(--primary); }
.dash-tabs button:not(.active) .glyph { filter: saturate(.35); opacity: .75; }
.dash-tabs button:focus-visible { outline: 3px solid rgba(44, 84, 224, .35); outline-offset: -3px; border-radius: 6px; }

.live { color: var(--ok); font-weight: 600; white-space: nowrap; font-size: .9rem; }
.live::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); margin-right: .35rem; vertical-align: .1em; box-shadow: 0 0 0 3px rgba(17, 122, 85, .18); }

.people { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: .85rem 0 0; padding: 0; }
.person { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem .2rem .25rem; font-size: .92rem; background: #fff; }
.person .avatar, .table-clean .avatar { width: 28px; height: 28px; font-size: .8rem; background: #E9EDF4; color: var(--ink-2); }
.person.is-me { border-color: #A9BDF7; background: var(--primary-wash); }
.person.is-me .avatar { background: var(--accent); color: var(--ink); }

/* ---------- 3.47.0 เมนูผู้ดูแล (โล่สีอำพัน) และปุ่มคู่มือ ---------- */
:root { --admin: #B45309; --admin-ink: #92400E; --admin-wash: #FFF7EA; --admin-line: #F3DDB6; }
.sub-link .sub-label { flex: 1 1 auto; min-width: 0; }
.sub-link.is-admin { color: var(--admin-ink); }
.sub-link.is-admin:hover { background: var(--admin-wash); color: var(--admin-ink); }
.sub-link.is-admin.active { background: var(--admin-wash); color: var(--admin-ink); box-shadow: inset 3px 0 0 var(--admin); }
.sub-admin-mark { color: var(--admin); font-size: .78rem; flex: none; }
.sub-link.sub-manual { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; padding-top: .45rem; border-top: 1px dashed var(--line); border-radius: 0 0 8px 8px; }
.sub-link.sub-manual > .bi { color: var(--muted); font-size: .92rem; }
.sub-link.sub-manual.active > .bi { color: var(--primary); }
/* 3.125.0 การ์ดสีขาวของแต่ละหมวดในเมนูด้านซ้าย (งานบุคลากร … บัญชีของฉัน) ขนาดและมุมเดียวกับกรอบ ผู้ดูแลระบบ */
/* 3.125.0 การ์ดของแต่ละหมวดในเมนู · 3.211.0 การ์ดขาวบนพื้นเมนูฟ้าอ่อน (เส้นขอบฟ้า --topbar-line) */
.side-card { margin: .7rem .1rem .25rem; padding: .1rem .3rem .45rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--topbar-line); box-shadow: 0 1px 2px rgba(24, 33, 58, .04); }
/* 3.211.0 ในการ์ดขาว: ชี้ = เทาอ่อน · เลือกอยู่ = ฟ้าอ่อน (นอกการ์ด เช่น หน้าหลัก ที่อยู่บนพื้นฟ้าอ่อน: เลือกอยู่ = พื้นขาว) */
.side-card .side-link:hover, .side-card .sub-link:hover { background: #F1F3F8; }
.side-card .side-link.active, .side-card .sub-link.active { background: var(--primary-wash); box-shadow: none; }
.side-card .side-group { margin: .65rem .45rem .35rem; }
.sidebar-nav > .side-link:hover { background: var(--surface); }
/* 3.126.0 ตั้งค่าแจ้งเตือนอีเมล: ปิดทุกระบบอยู่ = รายการรายระบบจางลง */
.pref-dim .mod-list { opacity: .6; }
.pref-dim .mod-list:focus-within, .pref-dim .mod-list:hover { opacity: 1; }   /* หน้าหลัก อยู่นอกการ์ด บนพื้นสีเทา */
.side-card + .side-admin { margin-top: .7rem; }
.side-admin { margin: 1rem .1rem .25rem; padding: .1rem .3rem .45rem; border-radius: 14px; background: var(--admin-wash); border: 1px solid var(--admin-line); }
.side-admin .side-group-admin { display: flex; align-items: center; gap: .4rem; margin: .65rem .45rem .35rem; color: var(--admin-ink); font-weight: 700; }
.side-admin .side-group-admin .bi { color: var(--admin); font-size: .85rem; }
.side-admin .side-link > i { color: var(--admin); }
.side-admin .side-link:hover, .side-admin .sub-link:hover { background: rgba(255, 255, 255, .75); }
.side-admin .side-link.active, .side-admin .sub-link.active { background: #fff; color: var(--admin-ink); box-shadow: 0 0 0 1px var(--admin-line); }
.side-admin .side-link.active > i { color: var(--admin); }
.side-admin .side-sub, .side-admin .side-sub3 { border-left-color: var(--admin-line); }
.crumb-admin { display: inline-flex; align-items: center; gap: .3rem; flex: none; margin-left: .25rem; padding: .1rem .55rem; border-radius: 999px; background: var(--admin-wash); color: var(--admin-ink); border: 1px solid var(--admin-line); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.crumb-admin .bi { color: var(--admin); font-size: .75rem; }
.help-btn { display: inline-flex; align-items: center; gap: .35rem; flex: none; height: 36px; padding: 0 .8rem; border-radius: 999px; border: 1px solid #C9D6FB; background: #EAF0FF; color: var(--primary-ink); text-decoration: none; font-size: .9rem; font-weight: 600; }
.help-btn:hover { color: #172F8A; border-color: #AFC3F8; background: #DCE6FF; }   /* 3.260.0 hover เดียวกับปุ่มรอง (.btn-light) ทุกปุ่ม · เดิมจางลง */
.help-btn .bi { font-size: 1rem; color: var(--primary); }
.dash-sec.is-admin { background: linear-gradient(180deg, var(--admin-wash), #fff 140px); border-color: var(--admin-line); }
.dash-sec.is-admin h2 { display: flex; align-items: center; gap: .45rem; color: var(--admin-ink); }
.dash-admin-mark { color: var(--admin); font-size: 1rem; }
@media (max-width: 1199.98px) {   /* 3.295.0 จอเล็กกว่า 1200 px: ป้ายเมนูผู้ดูแลเหลือไอคอน (hint บอกความหมาย) ให้ชื่อหน้ามีที่ */
  .crumb-admin span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .crumb-admin { padding: .1rem .4rem; }
}
@media (max-width: 575.98px) {
  .crumb .crumb-admin { display: none; }   /* 3.295.0 โทรศัพท์: ป้ายผู้ดูแลอยู่ในเมนูด้านซ้ายแล้ว */
  .help-btn { padding: 0 .6rem; }
  .help-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media print { .help-btn, .crumb-admin { display: none !important; } }

/* ---------- 3.48.0 กลุ่มเมนูผู้ดูแล และคู่มือของบัญชีของฉัน ---------- */
.side-link.side-manual { font-size: .9rem; color: var(--ink-2); }
.side-link.side-manual > i { font-size: 1rem; }
.side-admin .side-toggle > i { font-size: 1.1rem; width: 26px; text-align: center; color: var(--admin); }
/* 3.161.0 ชื่อกลุ่มเมนูผู้ดูแล (เช่น KPOMS) อยู่บรรทัดเดียวเสมอ ไม่ตัดที่ขีด (ตัวหนาตอนเปิดกลุ่มกว้างขึ้น) */
.side-admin .side-toggle { gap: .55rem; }
.side-admin .side-toggle > span:not(.glyph):not(.side-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .5rem; padding: 1rem; }
.admin-hub-card { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--admin-line); background: #fff; color: var(--ink); text-decoration: none; }
.admin-hub-card:hover { background: var(--admin-wash); color: var(--ink); border-color: #E9C78D; }
.admin-hub-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--admin-wash); color: var(--admin); font-size: 1.2rem; border: 1px solid var(--admin-line); }
.admin-hub-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.45; }
.admin-hub-text small { color: var(--ink-2); font-size: .86rem; }
.admin-hub-card > .bi-chevron-right { color: var(--muted); }

/* ---------- 3.51.0 หน้าหลัก: การ์ดของแต่ละระบบเรียงลงมา ---------- */
/* 3.247.0 การ์ดใครการ์ดมัน: แต่ละระบบเป็นการ์ดขาวของตัวเอง หัวการ์ด = ไอคอน ชื่อระบบ คำอธิบาย ปุ่มคู่มือ/เปิดระบบ
   ส่วนข้อมูลของระบบ (วิดเจ็ต) อยู่ใต้หัวการ์ด บนพื้นเทาอ่อนในการ์ดเดียวกัน · ระบบที่ไม่มีวิดเจ็ต = การ์ดมีแต่หัว */
.dash-sys { margin: 0 0 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(24, 33, 58, .04); scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.dash-sys-head { display: flex; align-items: center; gap: .85rem; margin: 0; padding: 1rem 1.25rem; }
.dash-sys-head > div { flex: 1 1 auto; min-width: 0; }
.dash-sys-head h2 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.dash-sys-head p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.dash-sys-body { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--line-2); background: #F7F9FC; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.dash-sys-body .panel { border-radius: var(--r); }
.dash-sys-body .panel > .panel-head:last-child { border-bottom: 0; }   /* กล่องที่มีแต่หัว (เช่น แจ้งซ่อม ยืมครุภัณฑ์) ไม่มีเส้นซ้อนด้านล่าง */
.dash-sys-body > .row > [class*="col-"]:only-child { flex: 0 0 auto; width: 100%; }   /* วิดเจ็ตที่มีกล่องเดียว (ครึ่งจอ) เต็มความกว้างการ์ด */
.dash-sys-links { display: flex; align-items: center; gap: .4rem; flex: none; }
/* 3.260.0 ปุ่มบนหน้าหลักไปทางเดียวกัน: ปุ่มรอง (คู่มือ ไปที่ระบบ ดูทั้งหมด ปฏิทิน ช่วงวันที่) = สีเดียวกับ .btn-light และ hover เข้มขึ้นแบบเดียวกัน
   ปุ่มหลัก (ยื่นใบลา บันทึกไปราชการ จอง… ) = .btn-primary · เดิม คู่มือ พื้นเทา hover ฟ้าอ่อน · เปิดระบบ hover เป็นพื้นน้ำเงิน */
.dash-sys-links a { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 36px; padding: .35rem .85rem; border-radius: 999px; border: 1px solid #C9D6FB; background: #EAF0FF; color: var(--primary-ink); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.dash-sys-links a:hover { color: #172F8A; border-color: #AFC3F8; background: #DCE6FF; }
.dash-sys-links a:active { color: #172F8A; border-color: #9DB5F5; background: #CFDCFF; }
.dash-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .25rem; padding: .6rem; }
.dash-tool { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 12px; color: var(--ink); text-decoration: none; }
.dash-tool:hover { background: var(--surface-2); color: var(--ink); }
.dash-tool > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.dash-tool small { color: var(--ink-2); font-size: .84rem; }
.dash-alert { display: flex; gap: .55rem; align-items: flex-start; margin: .75rem 1.25rem 0; padding: .6rem .85rem; border-radius: 10px; background: var(--accent-wash); color: #7A4A06; font-size: .92rem; }
.wl-dash-items { margin: .6rem 1.25rem 1rem; padding-left: 1.4rem; font-size: .94rem; } /* 3.53.0 ภาระงานของฉัน */
.wl-dash-items li { margin: .2rem 0; }
.dash-stats { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1.25rem .25rem; }
.dash-stat { display: flex; flex-direction: column; min-width: 110px; padding: .5rem .85rem; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); line-height: 1.3; }
.dash-stat span { font-size: 1.3rem; font-weight: 700; }
.dash-stat small { color: var(--ink-2); font-size: .82rem; }
.dash-stat:hover { border-color: #AFC3F8; background: #DCE6FF; color: var(--ink); }   /* 3.260.0 hover เดียวกับปุ่มรอง */
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.25rem; border-top: 1px solid var(--line-2); }
.dash-row:first-child { border-top: 0; }
.dash-row > div:first-child { min-width: 0; }
.dash-row-end { display: flex; align-items: center; gap: .5rem; flex: none; }
@media (max-width: 575.98px) {
  .dash-sys-head { flex-wrap: wrap; align-items: flex-start; padding: .9rem 1rem; }
  .dash-sys-head > div { flex-basis: calc(100% - 60px); }
  .dash-sys-links { width: 100%; }
  .dash-sys-links a { flex: 1 1 0; }   /* 3.247.0 ปุ่มคู่มือ/เปิดระบบ แบ่งความกว้างเท่ากันใต้ชื่อระบบ */
  .dash-sys-body { padding: .75rem; }
  .dash-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .dash-row-end { flex-wrap: wrap; max-width: 100%; }   /* 3.261.0 ป้ายสถานะยาว + ปุ่ม (เช่น ผ่านการตรวจสอบ รอลงนาม · แก้ไข) ไม่ล้นจอ 320 px */
}

/* ---------- 3.56.0 แถบแท็บของหน้าที่รวมกันเป็นกลุ่ม (อยู่บนสุดของเนื้อหา เหนือหัวเรื่อง) ---------- */
.page-tabs { gap: .15rem; margin: -.35rem 0 1.15rem; padding: 0 .1rem; border-bottom: 1px solid var(--line); }
.page-tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem .6rem; font-size: .94rem; border-radius: 10px 10px 0 0; }
.page-tabs a .bi { font-size: 1rem; color: var(--muted); }
.page-tabs a:hover { background: var(--surface-2, #F4F6FA); }
.page-tabs a.active { background: var(--surface, #fff); color: var(--primary); border-bottom-color: var(--primary); }
.page-tabs a.active .bi { color: var(--primary); }
@media (min-width: 768px) { .page-tabs { flex-wrap: wrap; overflow: visible; } }
.page-tabs a .sub-admin-mark { margin-left: .1rem; font-size: .75rem; color: var(--admin); }
@media (max-width: 575.98px) {
  .page-tabs { margin-top: -.15rem; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .page-tabs a { padding: .5rem .7rem; font-size: .9rem; }
}
@media print { .page-tabs { display: none; } }

/* ---------- 3.56.0 หน้ารวมเครื่องมือ (group.php) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1rem; }
.tool-card { display: flex; flex-direction: column; border-top: 4px solid var(--tool, var(--primary)); margin: 0; }
.tool-main { display: flex; align-items: flex-start; gap: .9rem; padding: 1.1rem 1.15rem .9rem; color: inherit; text-decoration: none; flex: 1 1 auto; }
.tool-main:hover strong { color: var(--primary); text-decoration: underline; }
.tool-text { flex: 1 1 auto; min-width: 0; }
.tool-text strong { display: block; font-size: 1.08rem; }
.tool-text small { display: block; color: var(--muted); margin-top: .15rem; line-height: 1.5; }
.tool-go { color: var(--muted); font-size: 1.1rem; padding-top: .3rem; }
.tool-links { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem 1.15rem .95rem; border-top: 1px dashed var(--line); }
.tool-links a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2, #F4F6FA); border: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; font-weight: 600; text-decoration: none; }
.tool-links a:hover { border-color: var(--tool, var(--primary)); color: var(--ink); }
.tool-links a .bi { color: var(--tool, var(--primary)); }
.tool-links a .sub-admin-mark { font-size: .75rem; color: var(--admin); }

/* 3.87.0 แท็บเล็ต (768–1024) และจอสัมผัสทุกขนาด: ช่องติ๊ก 24 px เหมือนมือถือ (เดิม 13–18 px ในตาราง) */
@media (max-width: 1024px), (pointer: coarse) {
  .form-check-input[type=checkbox]:not([role=switch]), .form-check-input[type=radio] { width: 1.5rem; height: 1.5rem; }
}
/* ---------- 3.60.0 จอสัมผัส/มือถือ: พื้นที่แตะอย่างน้อย 24–40 px ---------- */
@media (max-width: 767.98px) {
  .crumb-link { min-width: 36px; min-height: 40px; justify-content: center; border-radius: 10px; padding: .25rem .35rem; }   /* 3.379.0 สูง 40px (เดิม 34px) */
  .form-check-input[type=checkbox]:not([role=switch]), .form-check-input[type=radio] { width: 1.5rem; height: 1.5rem; }
  .form-check { min-height: 1.75rem; }
  .form-check .form-check-input { margin-top: .05rem; }
  details > summary { min-height: 2rem; padding-block: .2rem; }
  .back-link { display: inline-flex; align-items: center; min-height: 2rem; }
}

/* 3.190.0 แท็บเล็ต (ถึง 1024 px) และจอสัมผัสทุกขนาด: ช่องติ๊กและหัวข้อพับ/กางแตะง่าย */
@media (max-width: 1024px), (pointer: coarse) {
  .form-check-input[type=checkbox]:not([role=switch]), .form-check-input[type=radio] { width: 1.5rem; height: 1.5rem; }
  details > summary { min-height: 2rem; padding-block: .2rem; }
}

tr[hidden] { display: none !important; }   /* 3.93.0 แถวที่ซ่อนด้วยตัวกรอง (ตารางแบบการ์ดบนจอแคบตั้ง display ไว้) */

/* ---------- 3.60.0 ตารางแบบการ์ดบนจอแคบ: <table class="table-stack"> (ป้ายของแต่ละช่องมาจากหัวตาราง ใส่ให้โดย app.js) ---------- */
@media (max-width: 575.98px) {
  .table-stack, .table-stack > tbody, .table-stack > tbody > tr, .table-stack > tbody > tr > td, .table-stack > tbody > tr > th { display: block; width: 100%; }
  .table-stack > thead { display: block; }
  .table-stack > thead > tr { display: flex; flex-wrap: wrap; border: 0; }
  .table-stack > thead > tr > th { display: none; }
  .table-stack > thead > tr > th.stack-keep { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .25rem .6rem; font-weight: 600; color: var(--ink-2); }
  .table-stack > thead > tr > th.stack-keep::after { content: attr(data-stack-keep); }
  .table-stack > tbody > tr { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .7rem; padding: .55rem .8rem; background: var(--surface, #fff); }
  .table-stack > tbody > tr > th, .table-stack > tbody > tr > td.stack-title { order: -1; }
  .table-stack > tbody > tr > th, .table-stack > tbody > tr > td { border: 0; padding: .3rem 0; white-space: normal; min-width: 0; }
  .table-stack > tbody > tr > th { font-size: 1rem; padding-bottom: .4rem; }
  .table-stack > tbody > tr > td { display: flex; align-items: center; justify-content: space-between; gap: .75rem; text-align: right; border-top: 1px dashed var(--line-2); }
  .table-stack > tbody > tr > td::before { content: attr(data-label); flex: 0 1 45%; text-align: left; font-size: .85rem; font-weight: 600; color: var(--muted); }
  .table-stack > tbody > tr > td[data-label=""]::before, .table-stack > tbody > tr > td.stack-title::before { display: none; }
  .table-stack > tbody > tr > td.stack-title { display: block; text-align: left; border-top: 0; font-size: 1rem; padding-bottom: .4rem; }
  .table-stack > tbody > tr > td.stack-check { position: absolute; top: .45rem; right: .6rem; width: auto; border: 0; padding: 0; }
  .table-stack > tbody > tr > td.stack-check::before { display: none; }
  .table-stack > tbody > tr > td.stack-check .form-check-input, .table-stack > thead th.stack-keep .form-check-input { width: 1.5rem; height: 1.5rem; }
  .table-stack > tbody > tr:has(> td.stack-check) > .stack-title, .table-stack > tbody > tr:has(> td.stack-check) > th { padding-right: 2.5rem; }
  .table-stack > tbody > tr > td.d-none { display: none !important; }
  .table-stack > tbody > tr > td .form-control { width: 7rem; max-width: 55%; }
  .table-stack > tbody > tr > td.text-end, .table-stack > tbody > tr > td.text-center { justify-content: space-between; }
  .table-stack > tbody > tr > td[colspan] { display: block; text-align: left; }
  .table-stack > tbody > tr > td[colspan]::before { display: none; }
  .table-responsive:has(> .table-stack) { overflow: visible; }
}
.th-date-hint { margin-top: .2rem; font-size: .8rem; }
/* 3.136.0 แถวตัวกรอง: วันที่แบบไทยใต้ช่องวันที่ไม่ดันช่องอื่นให้เหลื่อมกัน (ทุกช่องในแถวเผื่อที่ด้านล่างเท่ากัน) */
.filter-bar .row:has(.th-date-hint) > [class*="col"]:not(.lv-quick):not(.tv-quick) { position: relative; padding-bottom: 1.4rem; }   /* 3.143.0 1.25 → 1.4rem ช่องวันที่ พ.ศ. สูงเท่าช่องอื่น ข้อความใต้ช่องไม่ชิด */
.filter-bar .row:has(.th-date-hint) > [class*="col"] > .th-date-hint { position: absolute; left: calc(var(--bs-gutter-x) * .5); right: calc(var(--bs-gutter-x) * .5); bottom: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 3.67.0 หน้าเปิดใช้บัญชี/ตั้งรหัสผ่านใหม่จากลิงก์ในอีเมล (activate.php) */
.auth-steps { margin: 0 0 1.25rem; padding-left: 1.2rem; color: var(--ink-2); font-size: .92rem; line-height: 1.6; }
.auth-steps li + li { margin-top: .35rem; }
/* 3.68.0 ลิงก์ ลืมรหัสผ่าน? ข้างป้ายรหัสผ่าน · กล่องส่งอีเมลแล้ว */
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.auth-forgot { font-size: .88rem; font-weight: 600; text-decoration: none; padding: .25rem 0; }
.auth-forgot:hover { text-decoration: underline; }
.auth-sent { display: flex; gap: .75rem; align-items: flex-start; background: var(--primary-wash); border-radius: 12px; padding: .9rem 1rem; margin: .9rem 0 1rem; line-height: 1.6; }
.auth-sent > i { font-size: 1.5rem; color: var(--primary); line-height: 1; margin-top: .15rem; }
.auth-sent p { margin: 0; font-size: .94rem; }
.btn-outline-secondary { --bs-btn-bg: #F1F3F7; --bs-btn-color: #545d68; --bs-btn-border-color: #8a939e; }   /* 3.87.0 คอนทราสต์ 4.5:1 บนพื้นเทาอ่อน */
@media (max-width: 400px) { .table td.text-nowrap { white-space: normal !important; } }   /* 3.87.0 จอ 320: วันที่/เวลาในตารางตัดบรรทัดได้ ไม่ล้นจอ */
/* 3.99.0 ตัวเลขแจ้งเตือนท้ายชื่อระบบในเมนูด้านซ้าย (เช่น ปฏิทินของฉัน) */
.side-link.has-side-badge > span:not(.side-badge):not(.glyph) { flex: 1 1 auto; min-width: 0; }
.side-badge { flex: none; min-width: 1.35rem; height: 1.35rem; margin-left: auto; padding: 0 .38rem; border-radius: 999px; background: #DC2626; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.side-toggle > span.side-badge { flex: none; margin-left: .35rem; }
.side-toggle.has-side-badge > .side-caret { margin-left: .35rem; }
/* 3.388.0 ชื่อระบบยาวขึ้น เช่น โครงการ (KPMS) + ตัวเลข: ระยะระหว่างชื่อ ตัวเลข และลูกศรแคบลง ให้ชื่ออยู่บรรทัดเดียว · ชื่อและลูกศรตรงแนวเดิม */
.side-toggle.has-side-badge { gap: .5rem; }
.side-toggle.has-side-badge > .glyph { margin-right: .2rem; }
.side-toggle.has-side-badge > span.side-badge, .side-toggle.has-side-badge > .side-caret { margin-left: .2rem; }
.side-toggle.has-side-badge > .side-caret { width: 14px; margin-right: 6px; }
#main td .chip { white-space: normal; text-align: left; }   /* 3.104.0 ป้ายยาวในตารางบนจอแคบ (ผู้ใช้และสิทธิ์) */
#main code { color: #A3195B; }   /* 3.104.0 สีโค้ดผ่านเกณฑ์ความคมชัดบนพื้นอ่อน */
.text-secondary { color: var(--muted) !important; }   /* 3.104.0 สีรองของ Bootstrap (#6C757D) ไม่ผ่านเกณฑ์บนพื้นเทาอ่อน */
.chip-wait { background: #EDE9FE; color: #5B21B6; }
.chip-closed { background: var(--chip); color: var(--ink-2); }   /* 3.115.0 ใช้ร่วมหลายระบบ (วิดเจ็ตหน้าหลัก) */

/* ---------- 3.126.0 คู่มือแบบหน้าต่าง: ปุ่ม คู่มือ เปิดหน้าต่างทับหน้าเดิม (iframe หน้าคู่มือ ?embed=1) ---------- */
.help-modal .modal-dialog { max-width: min(1180px, 96vw); }
.help-modal .modal-content { height: calc(100vh - 3.5rem); height: calc(100dvh - 3.5rem); overflow: hidden; }   /* 3.269.0 + dvh (มือถือ: ความสูงที่เห็นจริง ไม่ล้นใต้แถบเบราว์เซอร์) */
.help-modal .modal-header { gap: .5rem; padding: .7rem 1rem; }
.help-modal .modal-title { display: flex; align-items: center; gap: .45rem; margin: 0; min-width: 0; }
.help-modal .modal-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-modal .modal-body { padding: 0; background: var(--canvas); }
.help-modal iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--canvas); }
@media (max-width: 767.98px) {
  .help-modal .modal-content { height: 100%; }
  .help-modal .help-full-text { display: none; }
}
/* 3.269.0 หน้าต่าง (modal) ทุกหน้าต่างทุกระบบไม่ล้นจอ: สูงไม่เกินจอที่เห็นจริง (dvh) หัวหน้าต่างและปุ่มด้านล่างอยู่ในจอเสมอ เนื้อหาเลื่อนในหน้าต่าง
   หน้าต่างแบบเต็มจอบนจอเล็ก (modal-fullscreen-*-down) ใช้เต็มจออยู่แล้ว ไม่จำกัด */
.modal-content { max-height: calc(100vh - var(--bs-modal-margin) * 2); max-height: calc(100dvh - var(--bs-modal-margin) * 2); }
.modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { max-height: none; } }
@media (max-width: 767.98px) { .modal-fullscreen-md-down .modal-content { max-height: none; } }
@media (max-width: 991.98px) { .modal-fullscreen-lg-down .modal-content { max-height: none; } }
.modal-fullscreen .modal-content { max-height: none; }
body.is-embed { background: var(--canvas); }
main.embed { display: block; padding: 1rem 1.25rem 1.5rem; }
body.is-embed .man-side-inner { top: 1rem; }
body.is-embed .man-sec { scroll-margin-top: 1rem; }

/* ---------- 3.127.0 ระบบที่ใช้บ่อย (การ์ดบนสุดของเมนูด้านซ้าย) ---------- */
/* 3.185.0 ระบบสนับสนุนผู้บริหาร: การ์ดบนสุดของเมนูด้านซ้าย (สีเขียวหัวเป็ด แยกจาก ระบบที่ใช้บ่อย สีน้ำเงิน และ ผู้ดูแลระบบ สีอำพัน) */
.side-exec { border-color: #A9D8CF; background: linear-gradient(180deg, #EEF9F6, var(--surface) 70%); }
.side-exec .side-group { display: flex; align-items: center; gap: .4rem; color: #0E5A51; font-weight: 700; }
.side-exec .side-group .bi { color: #0F766E; font-size: .85rem; }
.side-exec .side-link > i { color: #0F766E; }
.side-exec .side-link:hover { background: #E3F4F0; color: #0E5A51; }
.side-exec .side-link.active { background: #DDF1EC; color: #0E5A51; box-shadow: inset 3px 0 0 #0F766E; }
.side-exec .side-link.active > i { color: #0F766E; }
.side-fav { border-color: #C9D6FB; background: linear-gradient(180deg, #F6F8FF, var(--surface) 70%); }
.side-fav-head { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.side-fav .side-group { display: flex; align-items: center; gap: .4rem; color: var(--primary-ink); font-weight: 700; }
.side-fav .side-group .bi { color: #E9A21B; font-size: .8rem; }
.side-fav-edit { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: .35rem .2rem 0 0; border-radius: 8px; color: var(--muted); text-decoration: none; }
.side-fav-edit:hover, .side-fav-edit:focus-visible { background: var(--primary-wash); color: var(--primary-ink); }
.side-fav-add { color: var(--primary-ink); font-size: .9rem; }
.side-fav-add > i { color: var(--primary); }

/* 3.136.0 คอลัมน์ ลำดับ (ใส่อัตโนมัติด้วย app.js ให้ตารางที่ยังไม่มี) */
th.num-col, td.num-cell { width: 1%; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
td.num-cell { color: var(--muted); }
th.num-col, td.num-cell { padding-right: .3rem !important; }   /* คอลัมน์ลำดับกะทัดรัด ไม่ดันตารางให้กว้างเกินจอ */
th.num-col { padding-left: .9rem; }
/* ตารางแบบการ์ดบนจอแคบ: ลำดับเป็นป้ายเล็กมุมซ้ายบนข้างชื่อการ์ด (ไม่เพิ่มแถว "ลำดับ" ในทุกการ์ด) แบบเดียวกับตารางบนมือถือของเว็บไซต์ */
@media (max-width: 575.98px) {
  .table-stack > tbody > tr > td.num-cell { position: absolute; top: .7rem; left: .8rem; width: auto; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; border: 0;
    display: grid; place-items: center; border-radius: 8px; background: var(--primary-wash); color: var(--primary-ink); font-weight: 700; font-size: .78rem; text-align: center; }
  .table-stack > tbody > tr > td.num-cell::before { display: none; }
  .table-stack > tbody > tr > td.num-cell:empty { display: none; }
  .table-stack > tbody > tr:has(> td.num-cell:not(:empty)) > .stack-title,
  .table-stack > tbody > tr:has(> td.num-cell:not(:empty)) > th { padding-left: 2.3rem; min-height: 2.3rem; }
}
/* การ์ดบนจอกลาง (ทะเบียนเครื่องราชฯ ครุภัณฑ์ อุปกรณ์คอมพิวเตอร์): ลำดับเป็นป้ายมุมซ้ายบน ช่องติ๊กเลื่อนไปทางขวาของป้าย */
@media (min-width: 576px) and (max-width: 1399.98px) {
  .ins-cardtable tbody tr, .ast-cardtable tbody tr, .its-cardtable tbody tr { position: relative; }
  .ins-cardtable tbody tr > td.num-cell, .ast-cardtable tbody tr > td.num-cell, .its-cardtable tbody tr > td.num-cell {
    position: absolute; top: .75rem; left: 1rem; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; display: grid; place-items: center;
    border-radius: 8px; background: var(--primary-wash); color: var(--primary-ink); font-weight: 700; font-size: .78rem; text-align: center; }
  .ins-cardtable tbody tr > td.num-cell::before, .ast-cardtable tbody tr > td.num-cell::before, .its-cardtable tbody tr > td.num-cell::before { display: none !important; }
  .ins-cardtable tbody tr > td.num-cell:empty, .ast-cardtable tbody tr > td.num-cell:empty, .its-cardtable tbody tr > td.num-cell:empty { display: none; }
  .ins-cardtable tbody tr:has(> td.num-cell:not(:empty)) > td.stack-title,
  .ast-cardtable tbody tr:has(> td.num-cell:not(:empty)) > td.stack-title,
  .its-cardtable tbody tr:has(> td.num-cell:not(:empty)) > td.stack-title { padding-left: 2.5rem; min-height: 1.9rem; }
  .ast-cardtable tbody tr:has(> td.num-cell:not(:empty)) > td.ast-chk,
  .its-cardtable tbody tr:has(> td.num-cell:not(:empty)) > td.its-chk { left: 3.2rem; }
  .ast-cardtable.has-chk tbody tr:has(> td.num-cell:not(:empty)) > td.stack-title,
  .its-cardtable tbody tr:has(> td.num-cell:not(:empty)):has(> td.its-chk) > td.stack-title { padding-left: 4.7rem; }
}

/* ---------- 3.143.0 ช่องวันที่แบบ พ.ศ. (assets/js/thdate.js) แทนปฏิทินของเบราว์เซอร์ที่แสดงปี ค.ศ. ---------- */
.thd-native, .tht-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; max-width: 1px !important; min-height: 0 !important; flex: none !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.thd-input { padding-right: 2.3rem; min-width: 9rem; cursor: pointer; font-variant-numeric: tabular-nums;   /* min-width: วันที่ 10 ตัวอักษร + ไอคอน ไม่ถูกตัดในแถวที่แคบ */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235F6982' viewBox='0 0 16 16'%3e%3cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3e%3cpath d='M11 7.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm-3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm-5 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem; }
.thd-input.form-control-sm { padding-right: 2rem; min-width: 8rem; background-position: right .55rem center; background-size: .9rem; }
.thd-input:not(:read-only), .thd-input:focus { cursor: text; }
.thd-input:disabled, .thd-input[readonly]:not(:focus) { cursor: default; }
.thd-input.is-pick[readonly]:not(:disabled), .tht-input.is-pick[readonly]:not(:disabled) { cursor: pointer; }   /* 3.244.0 เลือกเท่านั้น (data-pick-only) */
.was-validated .thd-input:invalid, .thd-input.is-invalid { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23BE3A31' viewBox='0 0 16 16'%3e%3cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3e%3c/svg%3e"); }
.thd-pop { position: fixed; z-index: 1090; width: 19.5rem; max-width: calc(100vw - 16px); padding: .7rem; background: var(--surface, #fff); color: var(--ink, #18213A);
  border: 1px solid var(--line, #E2E6EE); border-radius: var(--r, 12px); box-shadow: 0 12px 32px rgba(24, 33, 58, .18); font-size: .95rem; }
.thd-pop[hidden], .thd-back[hidden] { display: none !important; }
.thd-head { display: grid; grid-template-columns: 2.2rem minmax(0, 1.5fr) minmax(0, 1fr) 2.2rem; gap: .35rem; align-items: center; margin-bottom: .45rem; }
.thd-head .form-select { padding-left: .5rem; padding-right: 1.6rem; background-position: right .4rem center; font-weight: 600; }
.thd-nav { width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line, #E2E6EE); border-radius: var(--r-sm, 8px);
  background: var(--surface-2, #F8F9FC); color: var(--primary-ink, #1E3FB5); }
.thd-nav:hover, .thd-nav:focus-visible { background: var(--primary-wash, #EDF1FF); border-color: var(--primary, #2C54E0); }
.thd-dow, .thd-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.thd-dow span { font-size: .78rem; font-weight: 600; color: var(--ink-2, #47516A); padding: .2rem 0; }
.thd-dow .is-we { color: var(--bad, #BE3A31); }
.thd-day { height: 2.3rem; border: 0; border-radius: var(--r-sm, 8px); background: transparent; color: var(--ink, #18213A); font-variant-numeric: tabular-nums; font-size: .95rem; padding: 0; }
.thd-day.is-we { color: var(--bad, #BE3A31); }
.thd-day:hover:not(:disabled), .thd-day:focus-visible { background: var(--primary-wash, #EDF1FF); outline: 2px solid var(--primary, #2C54E0); outline-offset: -2px; }
.thd-day.is-today { box-shadow: inset 0 0 0 1.5px var(--primary, #2C54E0); font-weight: 700; }
.thd-day.is-sel, .thd-day.is-sel:hover { background: var(--primary, #2C54E0); color: #fff; font-weight: 700; }
.thd-day:disabled { color: #A4ABBB; text-decoration: line-through; text-decoration-color: rgba(164, 171, 187, .6); cursor: not-allowed; }
.thd-day.is-off { background: #F3F4F7; }   /* 3.162.0 วันหยุดที่เลือกไม่ได้ (เช่น วันเริ่ม/วันสุดท้ายของใบลา) */
.thd-foot { display: flex; gap: .35rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line-2, #EDF0F5); }
.thd-foot .btn { display: inline-flex; align-items: center; gap: .3rem; }
.thd-back { position: fixed; inset: 0; z-index: 1089; background: rgba(24, 33, 58, .35); }
.thd-pop.is-sheet { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; max-width: none; padding: .9rem; border-radius: var(--r-lg, 16px); }
.thd-pop.is-sheet .thd-day { height: 2.75rem; font-size: 1.05rem; }
@media print { .thd-pop, .thd-back { display: none !important; } .thd-input { background-image: none; padding-right: .75rem; } }

/* ---------- 3.145.0 ช่องเวลาแบบไทย 24 ชั่วโมง (assets/js/thtime.js) แทนช่องเวลาของเบราว์เซอร์ (บางเครื่องแสดง AM/PM) ---------- */
.tht-input { padding-right: 2.3rem; min-width: 6.5rem; cursor: pointer; font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235F6982' viewBox='0 0 16 16'%3e%3cpath d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z'/%3e%3cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem; }
.tht-input.form-control-sm { padding-right: 2rem; min-width: 5.75rem; background-position: right .55rem center; background-size: .9rem; }
.tht-input:not(:read-only), .tht-input:focus { cursor: text; }
.tht-input:disabled, .tht-input[readonly]:not(:focus) { cursor: default; }
.tht-input.is-invalid { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23BE3A31' viewBox='0 0 16 16'%3e%3cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0'/%3e%3cpath d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z'/%3e%3c/svg%3e"); }
.tht-pop { width: 15rem; }
.tht-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
.tht-now { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink, #18213A); }
.tht-head small { color: var(--muted, #6B7489); font-size: .78rem; }
.tht-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tht-col-title { font-size: .78rem; font-weight: 600; color: var(--ink-2, #47516A); text-align: center; padding-bottom: .25rem; }
.tht-list { position: relative; height: 12.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px; border: 1px solid var(--line-2, #EDF0F5); border-radius: var(--r-sm, 8px); overscroll-behavior: contain; }
.tht-opt { flex: none; height: 2.1rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink, #18213A); font-variant-numeric: tabular-nums; font-size: .95rem; }
.tht-opt:hover:not(:disabled), .tht-opt:focus-visible { background: var(--primary-wash, #EDF1FF); outline: 2px solid var(--primary, #2C54E0); outline-offset: -2px; }
.tht-opt.is-sel, .tht-opt.is-sel:hover { background: var(--primary, #2C54E0); color: #fff; font-weight: 700; }
.tht-opt:disabled { color: #A4ABBB; text-decoration: line-through; cursor: not-allowed; }
.thd-pop.tht-pop.is-sheet .tht-list { height: 14rem; }
.thd-pop.tht-pop.is-sheet .tht-opt { height: 2.6rem; font-size: 1.05rem; }
@media print { .tht-input { background-image: none; padding-right: .75rem; } }

/* ---------- 3.149.0 ดาวน์โหลดภาพแบบเลือกชนิดไฟล์ (WebP · PNG · JPG) ---------- */
.img-dl { position: relative; display: inline-block; }
.img-dl > summary { list-style: none; cursor: pointer; }
.img-dl > summary::-webkit-details-marker { display: none; }
.img-dl > summary::after { content: ''; display: inline-block; margin-left: .35rem; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: .15em; }
.img-dl[open] > summary::after { transform: rotate(180deg); }
.img-dl-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 12.5rem; padding: .3rem; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(24, 33, 58, .16); }
.img-dl.is-up .img-dl-menu { top: auto; bottom: calc(100% + 4px); }
.img-dl.is-right .img-dl-menu { left: auto; right: 0; }
.img-dl-menu a { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .45rem .6rem; border-radius: 7px; color: var(--ink); text-decoration: none; }
.img-dl-menu a:hover, .img-dl-menu a:focus-visible { background: var(--primary-wash, #EEF2FD); color: var(--primary-ink, #1F3FAE); }
.img-dl-fmt { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.img-dl-menu small { color: var(--muted); font-size: .78rem; white-space: nowrap; }
@media print { .img-dl { display: none !important; } }
.zoom-dl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: .6rem; }
.zoom-dl[hidden] { display: none; }
.zoom-dl > span { display: inline-flex; align-items: center; gap: .35rem; color: #fff; font-size: .88rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.zoom-dl a { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .8rem; border-radius: 99px; background: #EAF0FF; border: 1px solid #C9D6FB; color: var(--primary-ink, #1F3FAE); font-size: .86rem; font-weight: 700; text-decoration: none; }
.zoom-dl a:hover, .zoom-dl a:focus-visible { background: #DCE6FF; color: #172F8A; outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- 3.175.0 ช่องที่กรอกแล้ว (assets/js/app.js) ทุกแบบฟอร์มบันทึกข้อมูล ----------
   กรอบสีเขียวอ่อน + เครื่องหมายถูกที่มุมขวาของช่อง (ช่องหลายบรรทัดมุมขวาบน · ช่องเลือกข้างลูกศร) · .f-slim = เฉพาะกรอบ
   ไม่แทนสถานะผิดพลาด (.is-invalid / :invalid ยังเป็นสีแดงตามเดิม) · ไม่พิมพ์ */
:root { --filled-line: #93CFB2; --filled-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231F9467' viewBox='0 0 16 16'%3e%3cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z'/%3e%3c/svg%3e"); }
.form-control.f-filled:not(.is-invalid):not(:invalid), .form-select.f-filled:not(.is-invalid):not(:invalid) { border-color: var(--filled-line); }
.form-control.f-filled:focus, .form-select.f-filled:focus { border-color: #8EA8F2; }
.form-control.f-filled:not(.f-slim):not(.is-invalid):not(:invalid) {
  padding-right: 2.15rem; background-image: var(--filled-icon); background-repeat: no-repeat; background-position: right .7rem center; background-size: .95rem .95rem; }
textarea.form-control.f-filled:not(.f-slim):not(.is-invalid):not(:invalid) { background-position: right .7rem top .8rem; }
.form-select.f-filled:not(.f-slim):not(.is-invalid):not(:invalid) {
  --bs-form-select-bg-icon: var(--filled-icon); padding-right: 4.1rem; background-position: right .75rem center, center right 2.3rem; background-size: 16px 12px, .95rem .95rem; }
/* 3.223.0 ไม่มีข้อความใต้หัวหน้า "ช่องสีเขียว = กรอกแล้ว ..." แล้ว (เดิม .filled-note 3.176.0) */
@media print { .form-control.f-filled { background-image: none !important; } .form-select.f-filled { --bs-form-select-bg-icon: none; } }

/* 3.190.0 จุดเน้นและลูกเล่น
 *  - หัวกล่อง (panel-head h2) มีแถบสีประจำระบบ (--mod จาก modules.php) ช่วยให้รู้ว่าอยู่ระบบไหน · หัวกล่องที่มีไอคอนอยู่แล้วไม่เพิ่ม
 *  - ตัวเลขสรุปเด่น ๆ ค่อย ๆ ขึ้น · แถบความคืบหน้าเติมจากซ้าย (ปิดเมื่อผู้ใช้ตั้งค่าลดการเคลื่อนไหว) · ค่าที่แสดงเป็นค่าจริงตลอด */
.panel-head h2:not(:has(> .bi:first-child)):not(:has(> .glyph:first-child))::before { content: ""; display: inline-block; width: 4px; height: .95em; margin-right: .55rem; border-radius: 3px; background: var(--mod, var(--primary)); vertical-align: -.08em; }
@media print { .panel-head h2::before { display: none !important; } }
@media (prefers-reduced-motion: no-preference) {
  .cp-stat span, .ex-hero-n, .ex-tile-n, .kei-kpi-value, .lv-ent-big strong, .pj-round-kpis dd, .rp-fy strong, .rp-em-card strong, .ws-kpi-value { animation: o-num-in .55s cubic-bezier(.2, .7, .2, 1) both; }   /* ไม่เปลี่ยน display (ตัวเลขแบบ inline จางเข้าอย่างเดียว) */
  .ast-bar-track span, .ast-progress span, .eb-quota-bar > span, .ins-bar span, .its-bar-track span, .kei-bar-track span, .lv-bar span, .pj-rp-progress span, .pj-progress-bar span, .svc-bar-track span, .ws-bar-fill, .mem-issue-bar > span { transform-origin: left center; animation: o-bar-in .8s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes o-num-in { from { opacity: 0; transform: translateY(.3em); } to { opacity: 1; transform: none; } }
@keyframes o-bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media print { * { animation: none !important; } }

/* 3.252.0 การ์ด รอพิจารณา บนสุดของเมนูด้านซ้ายเสมอ (ติดด้านบนขณะเลื่อนเมนู) · มีรายการรอ = กรอบและไอคอนสีแดง วงกลมสีแดงบอกจำนวน */
.side-pending { position: sticky; top: 0; z-index: 2; margin: .35rem .1rem .45rem; padding: .3rem .3rem .35rem; border-color: #C9D6FB; background: var(--surface); box-shadow: 0 2px 6px rgba(24, 33, 58, .08); }
.side-pending.has-items { border-color: #F2B8B5; background: linear-gradient(180deg, #FFF4F3, var(--surface) 80%); }
.side-pending-head { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; color: var(--ink); font-weight: 700; font-size: 1rem; line-height: 1.35; text-decoration: none; }
.side-pending-head:hover { background: #F1F3F8; color: var(--ink); }
.side-pending.has-items .side-pending-head:hover { background: #FDE8E6; }
.side-pending-head.active { background: var(--primary-wash); color: var(--primary-ink); }
.side-pending-icon { flex: none; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--primary-wash); color: var(--primary); font-size: 1rem; }
.side-pending.has-items .side-pending-icon { background: #DC2626; color: #fff; }
.side-pending-title { flex: 1 1 auto; min-width: 0; }
.side-pending-head .side-badge { min-width: 1.6rem; height: 1.6rem; font-size: .82rem; line-height: 1.6rem; }
.side-pending-sys { display: flex; align-items: center; gap: .5rem; margin: 1px 0; padding: .36rem .55rem .36rem .6rem; border-radius: 9px; color: var(--ink-2); font-size: .9rem; line-height: 1.35; text-decoration: none; }
.side-pending-sys > i { width: 32px; text-align: center; color: var(--muted); font-size: .95rem; }
.side-pending-sys > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.side-pending-sys:hover { background: #F1F3F8; color: var(--ink); }
.side-pending-sys.active { background: var(--primary-wash); color: var(--primary-ink); font-weight: 600; }
.side-pending-n { flex: none; min-width: 1.45rem; padding: 0 .4rem; border-radius: 999px; background: #FEE2E2; color: #B42318; font-size: .78rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
.side-pending-empty { display: flex; align-items: center; gap: .35rem; margin: 0; padding: .1rem .5rem .3rem 3.05rem; color: var(--muted); font-size: .82rem; }
.side-pending-empty .bi { color: var(--ok); }
.menu-btn { position: relative; }
.menu-btn .menu-badge { position: absolute; top: -3px; right: -5px; min-width: 1.2rem; height: 1.2rem; margin: 0; padding: 0 .3rem; font-size: .68rem; line-height: 1.2rem; }
/* 3.253.0 วันเวลาที่บันทึก/แก้ไขล่าสุดของรายการ (stamp_html) ทุกระบบ */
.rec-stamp { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; margin-top: .2rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.rec-stamp > .bi { flex: none; font-size: .78rem; }
.rec-stamp > span + span::before { content: "·"; margin-right: .5rem; }

/* ===== 3.258.0 แถบขั้นตอนการพิจารณา ใช้ร่วม: วันลา (3.254.0–3.257.0) ไปราชการ กล้องวงจรปิด และหน้ารวม รอพิจารณา (ย้ายจาก modules/leave/assets/leave.css) ===== */
/* 3.254.0 ขั้นตอนของใบลาในรายการ (ใบลาและสิทธิ์ของฉัน · รอพิจารณา · ที่ฉันพิจารณาแล้ว · หน้ารวม รอพิจารณา)
   ครบทุกขั้น บอกว่าอยู่ขั้นไหน พร้อมวันเวลา · แนวตั้งเมื่อพื้นที่แคบ แนวนอนเมื่อกว้างพอ (container query) */
.lv-track-wrap { container-type: inline-size; margin-top: .55rem; }
.brow > .lv-track-wrap { grid-column: 1 / -1; margin-top: -.3rem; }   /* แถวรายการ: ใต้ วันที่ ชื่อ และปุ่ม เต็มความกว้าง */
.lv-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.lv-track > li { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: .5rem; align-items: start; padding-bottom: .5rem; font-size: .8rem; line-height: 1.4; }
.lv-track > li:last-child { padding-bottom: 0; }
.lv-track > li:not(:last-child)::before { content: ""; position: absolute; left: calc(.75rem - 1px); top: 1.5rem; bottom: 0; width: 2px; background: var(--line); }
.lv-tk-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-size: .74rem; }
.lv-track .is-good .lv-tk-dot { background: var(--ok-wash); color: var(--ok); border-color: #B5DEC9; }
.lv-track .is-bad .lv-tk-dot { background: var(--bad-wash); color: var(--bad); border-color: #F1C1BD; }
.lv-track .is-now .lv-tk-dot { background: #FEF3C7; color: #7A4B00; border-color: #E9A21B; box-shadow: 0 0 0 3px rgba(233, 162, 27, .25); }
.lv-track .is-end .lv-tk-dot { background: #F1F3F8; color: var(--ink-2); }
.lv-track .is-good:not(:last-child)::before { background: #9ED3B8; }
.lv-tk-b { display: flex; flex-direction: column; min-width: 0; }
.lv-tk-acts { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .4rem; }   /* 3.279.0 ปุ่มของขั้น (ระบบโครงการ) ใต้ข้อความของขั้น */
.lv-tk-acts > form { display: contents; }
.lv-tk-acts > template { display: none; }
.lv-tk-l { font-weight: 600; color: var(--ink); }
.lv-track .is-wait .lv-tk-l, .lv-track .is-skip .lv-tk-l { font-weight: 500; color: var(--muted); }
.lv-tk-t { color: var(--ink-2); overflow-wrap: anywhere; }
.lv-nm > span { white-space: nowrap; }   /* 3.383.0 ชื่อบุคคล (lv_name_html / lv_who) ขึ้นบรรทัดได้เฉพาะช่องว่าง ไม่ตัดกลางชื่อหรือนามสกุล */
.lv-tk-bar { display: none; }   /* 3.383.0 แถบย่อ (จุดทุกขั้น + ปุ่ม ดูทุกขั้น) ใช้เฉพาะรายการใบลาบนจอแคบ (modules/leave/assets/leave.css) */
.lv-track .is-good .lv-tk-t { color: var(--ok); }
.lv-track .is-bad .lv-tk-t { color: var(--bad); }
.lv-track .is-wait .lv-tk-t, .lv-track .is-skip .lv-tk-t { color: var(--muted); }
.lv-tk-at { color: var(--muted); }
.lv-tk-at .lv-when { white-space: normal; }
.lv-tk-now { display: inline-block; margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; background: #FEF3C7; color: #7A4B00; font-size: .75rem; font-weight: 600; vertical-align: 1px; }
.lv-track .is-now { background: linear-gradient(90deg, #FFF8E6, transparent 85%); border-radius: var(--r-sm); }
/* 3.263.0 แถบขั้นตอน แนวตั้ง (พื้นที่แคบ): ป้ายบนเส้นเหนือจุดของขั้น */
.lv-track > li.has-dur { padding-top: 1.6rem; }
.lv-track > li.has-dur::after { content: ""; position: absolute; left: calc(.75rem - 1px); top: 0; height: 1.6rem; width: 2px; background: var(--line); }
.lv-track > li.is-good + li.has-dur::after { background: #9ED3B8; }
.lv-track > li.has-dur:not(:last-child)::before { top: 3.1rem; }
.lv-track > li.has-dur > .lv-tk-b > .lv-tk-dur { top: .22rem; left: .05rem; max-width: calc(100% - .1rem); }
@container (min-width: 600px) {
  .lv-track { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: .4rem; }
  .lv-track > li { grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: .3rem; padding: .3rem .35rem .35rem; }
  .lv-track > li:not(:last-child)::before { left: 2.05rem; right: -.4rem; top: calc(.3rem + .75rem - 1px); bottom: auto; width: auto; height: 2px; }
  .lv-track .is-now { background: #FFF8E6; }
  .lv-tk-acts { grid-column: 1; margin-top: .1rem; }
  /* 3.263.0 แนวนอน: ป้ายเวลาที่ใช้อยู่กึ่งกลางเส้นระหว่างจุดของขั้นก่อนหน้ากับขั้นนี้ (เว้นที่ด้านบน/ล่างให้ป้าย 2 บรรทัด) */
  .lv-track.has-dur > li, .lv-track > li.has-dur { padding-top: .85rem; row-gap: .85rem; }
  .lv-track.has-dur > li:not(:last-child)::before, .lv-track > li.has-dur:not(:last-child)::before { top: calc(.85rem + .75rem - 1px); }
  .lv-track > li.has-dur::after { display: none; }
  .lv-track > li.has-dur > .lv-tk-b > .lv-tk-dur { top: calc(.85rem + .75rem); left: calc(.9rem - 50%); transform: translate(-50%, -50%); max-width: calc(100% - 1.7rem); }
}
/* 3.255.0 เวลาที่ใช้ในแต่ละขั้น นับจากขั้นก่อนหน้า (ตัวเล็ก) */
.lv-dur { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.lv-dur .bi { font-size: .7rem; }
/* 3.263.0 เวลาที่ใช้ = ป้ายเล็กบนเส้นระหว่างขั้น (ขั้นก่อนหน้า → ขั้นนี้) · แถบขั้นตอน (.lv-track) และขั้นตอนในหน้ารายละเอียด (.lv-steps .tv-steps .cv-steps)
   คำว่า "ใช้เวลา" อ่านด้วยโปรแกรมอ่านหน้าจอ · ป้ายอยู่ใน li ของขั้นนั้น (li.has-dur) ลำดับการอ่านเดิม */
.lv-dur-k { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lv-tk-dur, .lv-step-dur { position: absolute; z-index: 2; display: inline-flex; align-items: center; justify-content: center; padding: .05rem .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .75rem; line-height: 1.35; text-align: center; white-space: normal; box-shadow: 0 0 0 2px var(--surface); }
.lv-tk-dur .lv-dur, .lv-step-dur .lv-dur { font-size: inherit; color: inherit; line-height: inherit; }
.lv-tk-dur .bi, .lv-step-dur .bi { font-size: .68rem; color: var(--muted); }
/* หน้ารายละเอียด (วันลา ไปราชการ กล้องวงจรปิด): จุด 1.9rem เส้นที่ .95rem */
:is(.lv-steps, .tv-steps, .cv-steps) > li.has-dur { padding-top: 1.95rem; }
:is(.lv-steps, .tv-steps, .cv-steps) > li.has-dur::after { content: ""; position: absolute; left: .95rem; top: -.1rem; height: 2.05rem; width: 2px; background: var(--line); }
:is(.lv-steps, .tv-steps, .cv-steps) > li.has-dur:not(:last-child)::before { top: 3.95rem; }
:is(.lv-steps, .tv-steps, .cv-steps) > li.has-dur .lv-step-dur { top: .35rem; left: .25rem; max-width: calc(100% - .5rem); }
.lv-tk-note { display: block; margin-top: .2rem; padding: .3rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); overflow-wrap: anywhere; }   /* 3.261.0 */
.lv-step-dur { line-height: 1.35; }
/* 3.257.0 ใบลาที่มีการยกเลิกวันลา: ขั้นตอนการยื่นใบลา และการยกเลิกวันลา แสดงแยกเป็นรายการ (มีหัวข้อ) */
.lv-track-h { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; margin: 0 0 .35rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.lv-track-h .bi { color: var(--muted); }
.lv-track-h .chip { font-size: .75rem; font-weight: 600; }
.lv-track-wrap + .lv-track-wrap { margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed var(--line); }
.brow > .lv-track-wrap + .lv-track-wrap { margin-top: .15rem; }

/* ---------- 3.291.0 เครื่องมือช่วยอ่าน: แว่นขยาย · สปอตไลท์ (แถบด้านบน ข้างปุ่มคู่มือ · assets/js/a11y-tools.js) ---------- */
.a11y-tools { display: inline-flex; align-items: center; gap: .35rem; flex: none; }
.a11y-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid #C9D6FB; background: #EAF0FF; color: var(--primary-ink); font-size: .9rem; font-weight: 600; cursor: pointer; }
.a11y-btn:hover, .a11y-btn:focus-visible { color: #172F8A; border-color: #AFC3F8; background: #DCE6FF; }
.a11y-btn .bi { font-size: 1rem; color: var(--primary); }
.a11y-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.a11y-btn.is-on .bi { color: #fff; }
.a11y-menu { min-width: 12rem; }
.a11y-menu .dropdown-item { display: flex; align-items: center; gap: .45rem; }
.a11y-menu .dropdown-item .bi { visibility: hidden; color: var(--primary); }
.a11y-menu .dropdown-item[aria-pressed="true"] { font-weight: 700; }
.a11y-menu .a11y-esc { display: block; margin-top: .15rem; font-size: .75rem; font-weight: 400; color: var(--bs-secondary-color); }   /* 3.302.0 */
.a11y-menu .dropdown-item[aria-pressed="true"] .bi { visibility: visible; }
.a11y-menu .dropdown-item.active { background: var(--primary-wash); color: var(--primary-ink); }
.tooltip.a11y-tip { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2147483100; --bs-tooltip-max-width: 17rem; --bs-tooltip-font-size: .82rem; --bs-tooltip-bg: #1F2A44; --bs-tooltip-opacity: 1; }
.tooltip.a11y-tip .tooltip-inner { padding: .35rem .65rem; border-radius: 8px; }
.a11y-lens { position: fixed; left: 0; top: 0; z-index: 2147483000; border-radius: 50%; overflow: hidden; pointer-events: none; border: 3px solid #1E3A8A; box-shadow: 0 0 0 2px #fff, 0 10px 30px rgba(15, 23, 42, .35); background: #fff; contain: strict; }
.a11y-spot { position: fixed; inset: 0; z-index: 2147482999; pointer-events: none; }
@media print { .a11y-tools, .a11y-lens, .a11y-spot { display: none !important; } }
@media (prefers-reduced-motion: no-preference) { .a11y-btn { transition: background-color .15s, color .15s; } }

/* ---------- 3.293.0 hint ทั้งระบบ (assets/js/hints.js): คำอธิบายเมื่อชี้/โฟกัส ฟอนต์เดียวกับระบบ ---------- */
.app-hint { position: fixed; left: 0; top: 0; z-index: 2147483200; display: none; max-width: min(18rem, calc(100vw - 16px)); pointer-events: none;
  font-family: var(--bs-body-font-family); font-size: .82rem; font-weight: 500; line-height: 1.45; color: #fff; opacity: 0; transform: translateY(3px); }
.app-hint.is-on { opacity: 1; transform: none; }
.app-hint-inner { padding: .38rem .7rem; border-radius: 9px; background: #1F2A44; box-shadow: 0 8px 22px rgba(15, 23, 42, .28); text-align: center; white-space: pre-line; overflow-wrap: anywhere; }
.app-hint-arrow { position: absolute; left: var(--hint-arrow-x, 50%); bottom: -4px; width: 10px; height: 10px; background: #1F2A44; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.app-hint.is-below .app-hint-arrow { top: -4px; bottom: auto; }
@media (prefers-reduced-motion: no-preference) { .app-hint { transition: opacity .12s ease, transform .12s ease; } }
@media print { .app-hint { display: none !important; } }
.tooltip { font-family: var(--bs-body-font-family); }   /* 3.293.0 hint ของ Bootstrap ใช้ฟอนต์เดียวกับระบบ */
/* 3.362.0 จอสัมผัส (มือถือ/แท็บเล็ต): ปุ่มเล็ก ช่องเลือกเล็ก และปุ่มไอคอน สูงอย่างน้อย ~36px กดง่าย ไม่พลาด (จอที่ใช้เมาส์คงขนาดเดิม) */
@media (pointer: coarse) {
  .btn-sm { padding-top: .4rem; padding-bottom: .4rem; }
  .btn-sm, .filter-chip, .preset, .fc .fc-button, .pj-sbar-item, .chip-btn { min-height: 2.25rem; }   /* 3.379.0 จุดแตะอย่างน้อย 36px ทุกปุ่มเล็ก (เดิมบางปุ่ม 31–35px) */
  .btn-sm:has(> .bi:only-child) { min-width: 2.25rem; }
  .form-select-sm, .form-control-sm { min-height: 2.25rem; padding-top: .35rem; padding-bottom: .35rem; }
  .icon-btn { min-width: 2.25rem; min-height: 2.25rem; }
  #main .pj-view-switch .btn { padding-top: .45rem; padding-bottom: .45rem; }
  #main .tv-len .btn { padding-top: .35rem; padding-bottom: .35rem; }
  #main .ex-names > summary { min-height: 2.25rem; }
  .form-check-input { width: 1.15em; height: 1.15em; }
}
/* 3.362.0 หัวคอลัมน์ตัวเลข (ชิดขวา) ไม่แตกทีละพยางค์บนจอแคบ */
.table th.text-end { white-space: nowrap; }
/* 3.379.0 มือถือ/แท็บเล็ตจอสัมผัส: ตัวอักษรในช่องกรอกอย่างน้อย 16px (iPhone/iPad ไม่ซูมหน้าเองเมื่อแตะช่อง แล้วต้องซูมกลับ) */
@media (pointer: coarse) and (max-width: 1199.98px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=submit]):not([type=button]):not(.form-control-lg), select:not(.form-select-lg), textarea { font-size: 16px !important; }
}
@media (pointer: coarse) {   /* 3.379.0 จอสัมผัสทุกขนาด: ลิงก์ลำดับชั้นในแถบบน ปุ่มเครื่องมือ ปุ่มไอคอน หัวข้อพับ สูงอย่างน้อย 36–40px */
  .crumb-link { min-height: 40px; min-width: 2.25rem; }
  .a11y-btn { min-width: 36px; min-height: 36px; }
  .btn:has(> .bi:only-child) { min-width: 2.25rem; min-height: 2.25rem; }
  details > summary { min-height: 2.25rem; }
  .swatch { min-width: 2.25rem; min-height: 2.25rem; }
}
.lh-sm { line-height: 1.4 !important; }   /* 3.379.0 ภาษาไทยหลายบรรทัด: สระบน/วรรณยุกต์ไม่ชนบรรทัดบน (Bootstrap 1.25) */
/* 3.379.0 หัวกล่องที่มีไอคอนนำหน้า: ระยะห่างไอคอนกับข้อความเท่ากันทุกหน้า (เดิมบางหน้าไอคอนชิดข้อความ) */
.panel-head :is(h2, h3):has(> .bi:first-child) { display: flex; flex-wrap: wrap; align-items: center; column-gap: .45rem; }
small, .small { font-size: max(12px, .875em); }   /* 3.379.0 ตัวหนังสือเล็กไม่ต่ำกว่า 12px แม้อยู่ในกล่องที่ตัวหนังสือเล็กอยู่แล้ว */
/* 3.379.0 แถบแท็บที่เลื่อนได้: ขอบจางด้านที่ยังมีแท็บ (app.js ใส่ is-more-l / is-more-r) · ไม่ล้น = ไม่จาง */
.tabs.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.75rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 2.75rem), transparent); }
.tabs.is-more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.75rem); mask-image: linear-gradient(90deg, transparent, #000 2.75rem); }
.tabs.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.75rem, #000 calc(100% - 2.75rem), transparent); mask-image: linear-gradient(90deg, transparent, #000 2.75rem, #000 calc(100% - 2.75rem), transparent); }
@media (max-width: 575.98px) { .page-tabs.tabs:not(.is-more-l):not(.is-more-r) { -webkit-mask-image: none; mask-image: none; } }
@media (pointer: coarse) { .pager-btn { min-width: 2.5rem; height: 2.5rem; } }   /* 3.379.0 ปุ่มเลขหน้า จอสัมผัส 40px (เดิม 34px) */
/* 3.381.0 หน้าเข้าสู่ระบบ/ลืมรหัสผ่าน/เปิดใช้บัญชี: ชื่อระบบใหญ่และเด่น (ใหญ่กว่าหัวข้อในการ์ด) สีน้ำเงินเข้มเข้ากับโลโก้
   คอมพิวเตอร์และแท็บเล็ต: เห็นครบในจอเดียวไม่ต้องเลื่อน · โลโก้ | ชื่อระบบ | ชื่อเต็มและหน่วยงาน เรียงแนวนอนมีเส้นคั่น
   การ์ดกับท้ายหน้าอยู่กลางจอ · ลิงก์และ © บรรทัดเดียว · การ์ดสองใบกว้าง-สูงเท่ากัน หัวข้อขนาดเดียวกัน */
.auth .auth-app { color: #1E3A8A; font-size: 1.85rem; line-height: 1.15; letter-spacing: .02em; }
.auth .auth-sub { margin-top: .3rem; }
@media (min-width: 768px) {
  .auth:not(.is-doc) { --top: 0px; }
  .auth:not(.is-doc) .auth-wrap { padding: 1.5rem 24px .9rem; }
  .auth:not(.is-doc) .auth-brand { margin: auto 0 1.75rem; width: max-content; max-width: calc(100vw - 48px); display: grid; grid-template-columns: auto auto minmax(0, max-content); grid-template-areas: "mark app sub" "mark app org"; align-items: center; justify-content: center; text-align: left; }
  .auth:not(.is-doc) .auth-brand > .brand-mark, .auth:not(.is-doc) .auth-brand > .auth-logo { grid-area: mark; margin: 0 1.15rem 0 0; }
  .auth:not(.is-doc) .auth-brand > .brand-mark { width: 64px; height: 64px; border-radius: 18px; padding: 15px; gap: 6px; }
  .auth:not(.is-doc) .auth-brand > .auth-logo { width: 72px; height: 72px; }
  .auth:not(.is-doc) .auth-app { grid-area: app; align-self: stretch; display: flex; align-items: center; font-size: 2.75rem; line-height: 1.1; margin: 0 1.25rem 0 0; padding-right: 1.25rem; border-right: 1px solid rgba(30, 58, 138, .2); }
  .auth:not(.is-doc) .auth-sub { grid-area: sub; align-self: end; font-size: 1.1rem; line-height: 1.4; margin: 0; }
  .auth:not(.is-doc) .auth-org { grid-area: org; align-self: start; line-height: 1.45; margin: .1rem 0 0; }
  .auth:not(.is-doc) .auth-card { padding: 1.6rem 1.75rem 1.1rem; }
  .auth:not(.is-doc) .auth-first { margin: .2rem 0 1rem; }
  .auth:not(.is-doc) .auth-foot { margin-top: 1.15rem; padding-top: .85rem; }
  .auth:not(.is-doc) .auth-legal { margin-top: auto; padding-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 1.25rem; row-gap: .1rem; width: calc(100vw - 48px); max-width: 960px; }   /* กว้างกว่าการ์ดได้ จะได้อยู่บรรทัดเดียว */
  .auth:not(.is-doc) .auth-links { margin: 0; }
  .auth:not(.is-doc) .auth-legal-dev { margin: 0; }
}
@media (min-width: 1200px) {
  .auth.has-side .auth-wrap { max-width: 960px; }
  .auth.has-side .auth-body { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .auth.has-side .auth-side { display: flex; flex-direction: column; padding: 1.6rem 1.75rem 1.4rem; }
  .auth.has-side .auth-side ul { flex: 1; align-content: space-evenly; }
  .auth.has-side .auth-side h2 { font-size: 1.4rem; }   /* ขนาดเดียวกับหัวข้อ "เข้าสู่ระบบ" */
}
/* จอเตี้ย (เช่น 1366×768 ที่เหลือพื้นที่ประมาณ 650 px): ย่อระยะ โลโก้ และชื่อระบบลงเล็กน้อย */
@media (min-width: 768px) and (max-height: 760px) {
  .auth:not(.is-doc) .auth-wrap { padding-top: 1rem; }
  .auth:not(.is-doc) .auth-brand { margin-bottom: 1.2rem; }
  .auth:not(.is-doc) .auth-brand > .brand-mark { width: 54px; height: 54px; border-radius: 16px; padding: 12px; gap: 5px; }
  .auth:not(.is-doc) .auth-brand > .auth-logo { width: 60px; height: 60px; }
  .auth:not(.is-doc) .auth-app { font-size: 2.3rem; }
  .auth:not(.is-doc) .auth-sub { font-size: 1rem; }
  .auth:not(.is-doc) .auth-org { font-size: .86rem; }
  .auth:not(.is-doc) .auth-card { padding-top: 1.3rem; padding-bottom: .95rem; }
  .auth:not(.is-doc) .auth-form .mb-3 { margin-bottom: .8rem !important; }
  .auth:not(.is-doc) .auth-legal { padding-top: .9rem; }
}

/* ---------- 3.384.0 ตัวกรองพับบนมือถือ (ใช้ร่วม · ระบบโครงการ ทะเบียนคุมบัญชีจัดสรร): form.f-collapse
   จอแคบกว่า 768 px ซ่อนช่องที่มีคลาส .f-more เหลือช่องค้นหา + ปุ่ม ตัวกรอง (.f-toggle · ตัวเลข = ตัวกรองที่เลือก · app.js) · จอกว้างแสดงทุกช่องเหมือนเดิม */
.f-q { display: flex; gap: .5rem; align-items: stretch; }
.f-q > .input-icon, .f-q > .form-control { flex: 1 1 auto; min-width: 0; }
.f-toggle { display: none; }
.f-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; margin-left: .35rem; padding: 0 .3rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }
.f-count[hidden] { display: none; }
@media (max-width: 767.98px) {
  .f-toggle { display: inline-flex; align-items: center; flex: none; }
  .f-collapse.is-open .f-toggle { background: var(--primary-wash); border-color: var(--primary); color: var(--primary-ink); }
  .f-collapse:not(.is-open) .f-more { display: none !important; }
}

/* ---------- 3.383.0 แถบขั้นตอนย่อบนจอแคบ (รายการใบลา · 3.385.0 รายการคำขอ ก.พ.7 · ย้ายมาจาก leave.css) ----------
   แสดงจุดทุกขั้น (สีตามผล) + ขั้นสำคัญขั้นเดียว (ขั้นที่อยู่ตอนนี้ หรือผลสุดท้าย) · ปุ่ม ดูทุกขั้น เปิดขั้นตอนเต็ม (app.js) · จอกว้างแสดงเต็มเหมือนเดิม */
@container (max-width: 599.98px) {
  .lv-track-wrap.is-compact .lv-tk-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .5rem; }
  .lv-tk-mini { display: flex; align-items: center; min-width: 0; }
  .lv-tk-mini i { flex: none; width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
  .lv-tk-mini i + i { margin-left: 1.1rem; position: relative; }
  .lv-tk-mini i + i::before { content: ""; position: absolute; right: calc(100% + 2px); top: 50%; width: 1.1rem; height: 2px; margin-top: -1px; background: var(--line); }
  .lv-tk-mini i.is-good { background: var(--ok); border-color: var(--ok); }
  .lv-tk-mini i.is-good + i::before { background: #9ED3B8; }
  .lv-tk-mini i.is-bad { background: var(--bad); border-color: var(--bad); }
  .lv-tk-mini i.is-now { background: #F5B83D; border-color: #E9A21B; box-shadow: 0 0 0 3px rgba(233, 162, 27, .25); }
  .lv-tk-mini i.is-end { background: var(--muted); border-color: var(--muted); }
  .lv-tk-mini i.is-skip { border-style: dashed; }
  .lv-tk-more { flex: none; }
  .lv-track-wrap.is-compact:not(.is-open) .lv-track > li:not(.is-key) { display: none; }
  .lv-track-wrap.is-compact:not(.is-open) .lv-track > li.is-key { padding-top: .35rem; padding-bottom: .35rem; }
  .lv-track-wrap.is-compact:not(.is-open) .lv-track > li::before,
  .lv-track-wrap.is-compact:not(.is-open) .lv-track > li::after,
  .lv-track-wrap.is-compact:not(.is-open) .lv-tk-dur { display: none; }
}
