/* biome-ignore-all lint/complexity/noImportantStyles: must beat !important rules in tom-select.bootstrap5 */
/* biome-ignore-all lint/style/noDescendingSpecificity: each rule overrides one vendor selector; order follows the vendor file */
/* ส่วนเสริมของ WACHI GO ที่วางทับ CSS ที่คัดลอกมาจาก Wachi System (public/wachi/ ห้ามแก้)
   แต่ละกฎต้องบอกว่าแก้อะไรและทำไม */

/* Tom Select: tom-select.bootstrap5 ใส่ border:none !important ให้ .ts-control เมื่อ wrapper มี class form-select
   ส่วน base.css ของ Wachi System ตั้งใจให้กรอบอยู่ที่ .ts-control ("the visible border lives on the inner
   .ts-control") แต่ไม่มี !important จึงแพ้ — ช่องเลือกเลยไม่มีกรอบ ไม่เหมือนช่องอื่นในฟอร์มเดียวกัน */
.ts-wrapper.form-select .ts-control,
.ts-wrapper.form-select.single.input-active .ts-control {
  border: 1px solid var(--color-border-input) !important;
}
.ts-wrapper.form-select:not(.disabled) .ts-control,
.ts-wrapper.form-select:not(.disabled).single.input-active .ts-control {
  background-color: var(--color-bg-white) !important;
}
/* ลูกศรชี้ลงแบบ form-select ของ Bootstrap — wrapper ถูก base.css ล้าง background-image ทิ้ง */
.ts-wrapper.form-select.single .ts-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.5rem center !important;
  background-size: 12px 10px !important;
}
.ts-wrapper.form-select.focus .ts-control {
  border-color: var(--color-primary) !important;
}
.ts-wrapper.form-select.is-invalid .ts-control {
  border-color: var(--bs-form-invalid-border-color) !important;
}
[data-theme="dark"] .ts-wrapper.form-select:not(.disabled) .ts-control {
  background-color: var(--color-bg-surface) !important;
}

/* ===== ความลื่นและความทันสมัย (WACHI GO) =====
   หน้าตาและตำแหน่งทุกอย่างยังเหมือน Wachi System — เพิ่มแค่การเคลื่อนไหวสั้น ๆ ให้รู้ว่าเกิดอะไรขึ้น
   ทุกเอฟเฟกต์ไม่เกิน 220 มิลลิวินาที และปิดทั้งหมดเมื่อผู้ใช้ตั้งเครื่องให้ลดการเคลื่อนไหว (ท้ายส่วนนี้) */
:root {
  --one-motion-fast: 120ms;
  --one-motion: 180ms;
  --one-ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* เปลี่ยนหน้า: เนื้อหาหน้าใหม่ค่อย ๆ ขึ้นแทนการโผล่ทันที (.content ถูกสร้างใหม่ทุกครั้งที่เปลี่ยนหน้า) */
.content {
  animation: one-fade-up var(--one-motion) var(--one-ease-out);
}
@keyframes one-fade-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* แผงด้านขวา (เพิ่ม/แก้ไข): Offcanvas วาดพร้อม class show ทันที transition ของ Bootstrap จึงไม่ทำงาน
   ใช้ keyframe ให้แผงเลื่อนเข้าจากขวาและฉากหลังค่อย ๆ มืด */
.offcanvas.offcanvas-end.show {
  animation: one-slide-in-right 220ms var(--one-ease-out);
}
.offcanvas-backdrop.show {
  animation: one-backdrop-in var(--one-motion) ease-out;
}
@keyframes one-slide-in-right {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes one-backdrop-in {
  from {
    opacity: 0;
  }
}

/* เมนูดรอปดาวน์ (บริษัท ภาษา สีธีม ผู้ใช้): ค่อย ๆ ปรากฏแทนการโผล่ทันที */
.dropdown-menu.show {
  animation: one-pop-in var(--one-motion-fast) var(--one-ease-out);
  transform-origin: top right;
}
@keyframes one-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* แผงพับได้ (fast tab): ตอนกางเนื้อหาค่อย ๆ ลงมา — components.css สลับ display:none จึงใช้ transition ไม่ได้ */
.fast-tab:not(.collapsed) .fast-tab-content {
  animation: one-fade-down var(--one-motion) var(--one-ease-out);
}
@keyframes one-fade-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* แท็บ ปุ่มคำสั่ง และลิงก์ในเมนูข้าง: เปลี่ยนสีแบบนุ่มแทนการกระตุก */
.tab-item,
.tab-item a,
.cmd-btn,
.sb-item,
.dropdown-item,
.page-breadcrumb a {
  transition:
    background-color var(--one-motion-fast) ease,
    color var(--one-motion-fast) ease,
    box-shadow var(--one-motion-fast) ease;
}
/* กดปุ่มแล้วยุบลงนิดหนึ่ง ให้รู้ว่ากดติด */
.btn:not(:disabled):active,
.cmd-btn:not(:disabled):active {
  transform: scale(0.97);
}

/* กรอบโฟกัสตอนใช้คีย์บอร์ด (Tab) ให้เห็นชัดและเป็นแบบเดียวกันทั้งระบบ — base.css มีแค่กับปุ่มและช่องกรอก
   ใช้ :focus-visible จึงไม่ขึ้นตอนคลิกเมาส์ */
.tab-item a:focus-visible,
.cmd-btn:focus-visible,
.sb-item:focus-visible,
.dropdown-item:focus-visible,
.page-breadcrumb a:focus-visible,
.fast-tab-header:focus-visible,
.stat-mini-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* โครงหน้าระหว่างโหลด (Loading ใน src/ui/page.tsx): แถบสีเทามีแสงวิ่ง
   ขึ้นหลัง 150 มิลลิวินาที — ถ้าโหลดเร็วกว่านั้นผู้ใช้ไม่เห็นอะไรกะพริบ */
.one-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  opacity: 0;
  animation: one-appear 1ms linear 150ms forwards;
}
.one-skeleton__line {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    var(--color-bg-surface) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: one-shimmer 1.2s ease-in-out infinite;
}
.one-skeleton__line:nth-child(3n + 2) {
  width: 85%;
}
.one-skeleton__line:nth-child(3n + 3) {
  width: 60%;
}
@keyframes one-appear {
  to {
    opacity: 1;
  }
}
@keyframes one-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ผู้ใช้ตั้งเครื่องให้ลดการเคลื่อนไหว: ปิดเอฟเฟกต์ทั้งหมดในส่วนนี้ (แถบโหลดยังแสดงแต่ไม่วิ่ง) */
@media (prefers-reduced-motion: reduce) {
  .content,
  .offcanvas.offcanvas-end.show,
  .offcanvas-backdrop.show,
  .dropdown-menu.show,
  .fast-tab:not(.collapsed) .fast-tab-content,
  .one-skeleton__line {
    animation: none;
  }
  .one-skeleton {
    animation: none;
    opacity: 1;
  }
  .btn:not(:disabled):active,
  .cmd-btn:not(:disabled):active {
    transform: none;
  }
}

/* ===== มิติ: เงาและแสง (WACHI GO) =====
   เจ้าของสั่ง 2026-11-13 "ให้ดูสมูท ดูมีมิติ แต่ไม่ขยายขนาดและ padding"
   ใช้แค่ box-shadow / background-image / transition — ไม่แตะ width height padding margin border-width
   จึงไม่มีอะไรขยับ · เงาใช้ --elevation-* ของ tokens.css (โหมดมืดมีค่าของตัวเอง) ตามกฎ UI_UX_RULES
   แสงสมมติมาจากด้านบน: ช่องกรอกยุบลง (เงาด้านใน) · ปุ่มนูนขึ้น (เส้นสว่างขอบบน) · ของที่ลอยมีเงาด้านล่าง */
:root {
  --one-inset-field: inset 0 1px 2px rgba(16, 42, 67, 0.08);
  /* วงโฟกัสสีเดียวกับปุ่มใน base.css (--focus-ring = สีแบรนด์จาง ตามพาเลตที่ผู้ใช้เลือก · sync จาก Wachi System 2026-11-21)
     โหมดมืดยังใช้ฟ้าสว่างข้างล่าง เพราะสีแบรนด์จางบนพื้นมืดแทบมองไม่เห็น */
  --one-focus-ring: var(--focus-ring);
  --one-highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --one-pressed: inset 0 2px 3px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] {
  /* บนพื้นมืดเงาดำแทบมองไม่เห็น — ใช้เส้นสว่างจาง ๆ ขอบบนแทน ให้พื้นผิวที่ลอยแยกจากพื้น */
  --one-inset-field: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  --one-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.3);
  --one-highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ช่องกรอกและช่องเลือก: เงาด้านในบาง ๆ ให้ดูเป็นช่องที่ยุบลง · ตอนโฟกัสมีวงแสงรอบช่องสีเดียวกับโฟกัสปุ่มใน base.css
   (box-shadow ไม่กินพื้นที่ ช่องจึงไม่ขยาย) — base.css ตั้ง transition box-shadow 0.3s ไว้ ช้าไปสำหรับโฟกัส */
.form-control:not(.form-underline):not(:disabled),
.form-select:not(:disabled),
.ts-wrapper.form-select:not(.disabled) .ts-control {
  box-shadow: var(--one-inset-field);
  transition:
    border-color var(--one-motion-fast) ease,
    box-shadow var(--one-motion-fast) ease,
    background-color var(--one-motion-fast) ease;
}
.form-control:not(.form-underline):focus,
.form-select:focus,
.ts-wrapper.form-select.focus .ts-control {
  box-shadow: var(--one-inset-field), var(--one-focus-ring) !important;
}

/* ปุ่มหลัก: ไล่แสงจากบนลงล่าง ~4% และเส้นสว่างขอบบน ให้ดูนูน · กดแล้วเป็นเงาด้านในเหมือนถูกกดลงไป
   components.css ใส่ background shorthand !important (ล้าง background-image) จึงต้อง !important ที่ภาพไล่สี */
.btn.btn-primary:not(:disabled) {
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(0, 0, 0, 0.04)
  ) !important;
  box-shadow: var(--one-highlight-top), var(--elevation-1);
}
.btn.btn-primary:not(:disabled):hover {
  box-shadow: var(--one-highlight-top), var(--elevation-2);
}
.btn.btn-primary:not(:disabled):active {
  background-image: none !important;
  box-shadow: var(--one-pressed);
}

/* ตารางข้อมูล: หัวตารางลอยเหนือแถวเล็กน้อย · ตารางในแผง/ฟอร์ม (กรอบ) มีเงาชั้น 1 แบบการ์ด
   แถวเปลี่ยนสีตอนชี้/เลือกแบบนุ่ม — เฉพาะสีพื้น ห้าม transition transform (AG Grid ใช้ย้ายแถวตอนเลื่อน) */
.ag-theme-quartz .ag-header {
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(16, 42, 67, 0.07);
}
[data-theme="dark"] .ag-theme-quartz .ag-header {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.ag-theme-quartz.w-100:not(.flex-grow-1) .ag-root-wrapper {
  box-shadow: var(--elevation-1);
}
.ag-theme-quartz .ag-row,
.ag-theme-quartz .ag-row::before {
  transition: background-color var(--one-motion-fast) ease;
}

/* แท็บ: เส้นใต้แท็บที่เลือกค่อย ๆ เปลี่ยนสีพร้อมตัวอักษร (เดิมกระตุก) */
.tab-item {
  transition:
    background-color var(--one-motion-fast) ease,
    color var(--one-motion-fast) ease,
    border-color var(--one-motion) ease;
}

/* ของที่ลอยเหนือหน้า: แผงด้านขวาและเมนูมีเงาชั้นของมัน + เส้นสว่างขอบบน (เห็นชัดในโหมดมืด) */
.offcanvas.offcanvas-end {
  box-shadow: var(--elevation-3);
}
.dropdown-menu,
.ts-dropdown {
  box-shadow: var(--one-highlight-top), var(--elevation-2);
}

/* การ์ดโมดูลและการ์ดตัวเลข: components.css ยกการ์ดขึ้น 2px ตอนชี้ — หน้า ERP ที่ข้อมูลแน่นดูกระโดด เหลือ 1px
   การ์ดตัวเลขที่กดกรองได้มีเงาชั้น 1 ตอนชี้ ให้รู้ว่ากดได้ */
.module-grid .module-tile:hover,
.module-grid .module-tile:focus-visible {
  transform: translateY(-1px);
}
.stat-mini-card.stat-filter:hover {
  box-shadow: var(--elevation-1);
}
[data-theme="dark"] .module-grid .module-tile,
[data-theme="dark"] .stat-mini-card {
  box-shadow: var(--one-highlight-top), var(--elevation-1);
}

/* ข้อความบรรทัดเดียวที่ตัดด้วย … : components.css/pages.css ใช้ overflow:hidden + line-height 1.35-1.4 — กล่องบรรทัดเตี้ยกว่า
   ตัวอักษรไทยที่มีสระบนซ้อนวรรณยุกต์ (หนี้ · นี่ · ชื้อ) ฟอนต์ Sarabun เลยถูกตัดหัว (เจ้าของแจ้ง 2026-11-19 "ภาษาไทยบางตัวแสดงคำไม่ครบ เช่น หนี้")
   ขยายกล่องที่ตัดขึ้น-ลง .3em ด้วย padding แล้วหักคืนด้วย margin ติดลบ → ขนาดการ์ดและตำแหน่งข้อความเท่าเดิม ตัดด้วย … เฉพาะแนวนอน
   ครอบ 3 ที่ที่แอปใช้จริง: ชื่อการ์ดโมดูล · บรรทัดรองของการ์ดงานค้าง · ค่าในแถบสรุปหัวเอกสาร (DetailHeader) */
.module-grid .module-title,
.module-grid .module-desc,
.detail-summary-fact-value {
  padding-block: 0.3em;
  margin-block: -0.3em;
}

/* การ์ดโมดูลหลัก (หน้าแรก) — เจ้าของสั่ง 2026-11-13 "เอาคำอธิบายออกหมด แต่การ์ดหลักทำให้เด่น"
   แล้วสั่งต่อว่า "ไม่ต้องทำสีแยก แต่ทำให้มีกราฟิก element สวย ๆ" → สีธีมสีเดียว แต่งด้วยกราฟิก 3 ชั้นหลังเนื้อหา:
   แสงฟุ้งมุมขวาบน (พื้น) · ลายจุดจางลงทางซ้าย (::before) · ไอคอนโมดูลตัวใหญ่เอียงเป็นลายน้ำ (.one-module-tile__watermark)
   ทุกชั้น position:absolute + z-index ติดลบใน isolation ของการ์ด — อยู่ใต้ชื่อ ดาว ลูกศร ไม่กินพื้นที่ ขนาดการ์ดเท่าเดิม
   ดูในแอปจริงแล้ว (การ์ด 6 คอลัมน์): navy จางเป็นเทาขุ่นถ้าเข้มเกิน และลายน้ำชนชื่อยาว → กราฟิกชิดขวา ค่าจาง
   ใช้ rgba(--color-primary-rgb) ทั้งหมด จึงตามสีธีมที่ผู้ใช้เลือกและโหมดมืดเอง */
/* 2026-12-02 แบบเรียบของ kksteelcenter.com (เจ้าของเห็นหน้า login แบบซ้อนลายแล้วบอก "ไม่สวยเลย"):
   เอาแสงฟุ้งและลายจุดออก พื้นขาวเรียบ เหลือลายน้ำไอคอนชั้นเดียว · ทองขึ้นเฉพาะตอนชี้/โฟกัส
   เป็นเส้นใต้การ์ดที่ยืดออกจากซ้าย แบบเส้นทองใต้ลิงก์ของเว็บ (a border-bottom 1.8px goldenrod)
   ทองไม่ขึ้นทุกใบตลอดเวลา — การ์ดหน้าแรกเป็นการ์ดหลักทั้ง 12 ใบ ทองทุกใบจะไม่ได้เน้นอะไร */
.module-grid .module-tile.one-module-tile--main {
  overflow: hidden;
  isolation: isolate;
  background: var(--color-bg-white);
}
.module-grid .module-tile.one-module-tile--main::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 1;
  pointer-events: none;
  background: var(--one-brand-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--one-ease-out);
}
.module-grid .module-tile.one-module-tile--main:hover::before,
.module-grid .module-tile.one-module-tile--main:focus-visible::before {
  transform: scaleX(1);
}
.one-module-tile__watermark {
  position: absolute;
  right: 26px;
  bottom: -10px;
  z-index: -1;
  pointer-events: none;
  font-size: 46px;
  line-height: 1;
  color: rgba(var(--color-primary-rgb), 0.06);
  transform: rotate(-14deg);
  transition:
    transform 0.28s var(--one-ease-out),
    color 0.28s ease;
}
.module-grid .module-tile.one-module-tile--main:hover .one-module-tile__watermark,
.module-grid .module-tile.one-module-tile--main:focus-visible .one-module-tile__watermark {
  color: rgba(var(--color-primary-rgb), 0.1);
  transform: rotate(-6deg) scale(1.06);
}
[data-theme="dark"] .one-module-tile__watermark {
  color: rgba(var(--color-primary-rgb), 0.14);
}
.module-grid .module-tile.one-module-tile--main .module-title {
  font-weight: 700;
}

/* แถบข้าง: โลโก้เป็นกราฟิก — เจ้าของสั่ง 2026-11-13 "ปรับ sidebar ให้มีกราฟิก logo เป็น element"
   ::after = เครื่องหมาย KKS ตัวใหญ่จาง ๆ ล้นมุมขวาล่าง (ไฟล์เดียวกับ topbar: on-light / on-dark ตามโหมด)
   (2026-12-02 เอาลายเส้น/แสงทองที่มุมซ้ายล่างออก ให้เรียบแบบเว็บ kksteelcenter.com — เหลือเครื่องหมายชั้นเดียว)
   อยู่หลังเมนู (z-index ติดลบใน isolation) กดทะลุได้ ไม่กินพื้นที่ · พับแถบข้าง (56px) แล้วซ่อน เพราะแคบจนเหลือแต่เศษภาพ */
.sidebar {
  position: relative;
  isolation: isolate;
}
.sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.sidebar::after {
  right: -18px;
  bottom: -26px;
  width: 180px;
  height: 180px;
  background: url("/one/brand/kks-mark-on-light.svg") center / contain no-repeat;
  opacity: 0.07;
}
[data-theme="dark"] .sidebar::after {
  background-image: url("/one/brand/kks-mark-on-dark.svg");
  opacity: 0.09;
}
html[data-sidebar-collapsed] .sidebar::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .module-grid .module-tile:hover,
  .module-grid .module-tile:focus-visible,
  .stat-mini-card.stat-filter:hover {
    transform: none;
  }
  .one-module-tile__watermark {
    transition: none;
  }
}

/* ===== หน้าเข้าสู่ระบบ =====
   เจ้าของสั่ง 2026-11-16 "ปรับหน้า login ให้ดูทันสมัย" — กรอบ .signin-center/.signin-box ของ Wachi System คงไว้
   2026-12-02 ทำใหม่ตามหน้าแรกของ kksteelcenter.com (เจ้าของบอกว่าแบบที่ซ้อนแสง ลายจุด ลายเส้น และโลโก้จาง "ไม่สวยเลย"):
   ใช้แบบเรียบของเว็บ = สีพื้นเรียบ · ภาพอาคารบริษัท · โลโก้ตัวอักษรไทย · แท่งทองคม ๆ ไม่กี่จุด · ไม่มีแสงไล่สีหรือลายซ้อน
   แผงซ้าย (จอ ≥ 992px) = ภาพอาคาร (kks-building.webp ภาพ hero ของเว็บ ขนาด 1080px 37KB) ใต้ชั้นน้ำเงินแบรนด์
   ฝั่งฟอร์ม = พื้นฟ้าเทาอ่อน #e2e6ee แบบส่วนพื้นอ่อนของเว็บ · กล่องขาวมุมเหลี่ยม · หัวข้อนำด้วยจุดทอง 4 จุด */
.one-signin {
  padding: 24px 16px;
  background: #e2e6ee;
}
[data-theme="dark"] .one-signin {
  background: var(--color-bg-app);
}
.one-signin__brand {
  display: none;
}
.signin-box.one-signin__box {
  width: 100%;
  max-width: 400px;
  padding: 2.25rem 2rem 2rem;
  border: 0;
  border-top: 4px solid var(--one-brand-gold);
  border-radius: 0;
  box-shadow: 0 12px 32px rgba(36, 32, 34, 0.08);
  animation: one-signin-in 0.4s var(--one-ease-out) both;
}
.one-signin__box .input-group-text {
  color: var(--color-text-muted);
}
.one-signin__box .btn[type="submit"] {
  justify-content: center;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
/* ฝั่งฟอร์ม: กล่องอยู่กลาง ตราการรับรองอยู่ใต้กล่อง (จอเล็ก) / ชิดล่างของฝั่งขวา (จอกว้าง) */
.one-signin__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
}
/* ใบรับรองคุณภาพแบบส่วน "STEEL WITH CERTIFIED QUALITY" ของเว็บ: หัวข้อตัวพิมพ์ใหญ่สีเทาเข้ม + ตรากลมสีเทา */
.one-signin__certifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.one-signin__certifications-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #434442;
}
.one-signin__certifications-list {
  display: flex;
  gap: 14px;
}
[data-theme="dark"] .one-signin__certifications {
  filter: invert(1) brightness(1.2);
  opacity: 0.7;
}
/* คำต้อนรับ = หัวข้อแบบเว็บ: จุดทอง 4 จุดนำหน้า ตัวหนังสือน้ำเงิน */
.one-signin__welcome {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary) !important;
}
.one-signin__welcome::before {
  content: "";
  flex: 0 0 12px;
  height: 12px;
  background: var(--one-four-dots) center / contain no-repeat;
}
[data-theme="dark"] .one-signin__welcome {
  color: var(--color-text-primary) !important;
}

@media (min-width: 992px) {
  .one-signin {
    padding: 0;
    align-items: stretch;
  }
  .one-signin__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 46%;
    max-width: 680px;
    padding: 56px 56px 88px;
    color: #fff;
    border-right: 6px solid var(--one-brand-gold);
    background:
      linear-gradient(
        to top,
        rgba(58, 81, 138, 0.96) 0%,
        rgba(58, 81, 138, 0.82) 40%,
        rgba(58, 81, 138, 0.45) 100%
      ),
      url("/one/brand/kks-building.webp") 86% center / cover no-repeat,
      #3a518a;
  }
  /* โลโก้ตัวอักษรไทย (kks-th-w.svg ของเว็บ) มุมซ้ายบน แบบหัวเว็บ */
  .one-signin__wordmark {
    position: absolute;
    top: 48px;
    left: 56px;
    height: 44px;
    width: auto;
  }
  .one-signin__title {
    font-size: 3.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  /* คำโปรยมีแท่งทองด้านซ้าย แบบคำโปรยใต้ชื่อบริษัทบนเว็บ (.text-span-5 border-left 6px) */
  .one-signin__tagline {
    margin-top: 16px;
    max-width: 26em;
    padding-left: 14px;
    border-left: 5px solid var(--one-brand-gold);
    font-size: 1.1rem;
    line-height: 1.4;
    opacity: 0.92;
  }
  /* ค่านิยมหลัก (CoreValues ใน src/ui/brand.tsx · หน้าตากลางอยู่ส่วน "แบรนด์ KKS"): ใต้คำโปรย
     มีเส้นทองบางคั่นด้านบนแบบเส้นเหนือส่วนท้ายของเว็บ (.footer-wrapper border-top) */
  .one-signin__values {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(244, 183, 25, 0.7);
    max-width: 560px;
  }
  .one-signin__footer {
    position: absolute;
    left: 56px;
    bottom: 32px;
    font-size: 0.8rem;
    opacity: 0.6;
  }
  /* ฝั่งฟอร์ม: แผงซ้ายแสดงแบรนด์แล้ว ในกล่องไม่ต้องซ้ำ — คำต้อนรับขึ้นเป็นหัวเรื่องแทน */
  .one-signin__box .brand {
    display: none !important;
  }
  /* ฝั่งขวากว้าง (เจ้าของบอก 2026-12-02 "ฝั่งขวามันโล่ง"): กล่องใหญ่ขึ้น ตัวหนังสือ/ช่องกรอกใหญ่ขึ้น ·
     ตราการรับรองชิดล่าง · แถบลายเส้นของเว็บ (linepattern) ที่ขอบขวาล่าง */
  .one-signin__main {
    position: relative;
    isolation: isolate;
    flex: 1 1 auto;
    padding: 48px 48px 40px;
  }
  .one-signin__main::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 91px;
    height: 55%;
    z-index: -1;
    pointer-events: none;
    background-image:
      linear-gradient(var(--one-brand-gold), var(--one-brand-gold)),
      repeating-linear-gradient(125deg, rgba(32, 66, 121, 0.35) 0 1px, transparent 1px 4px),
      repeating-linear-gradient(90deg, rgba(32, 66, 121, 0.35) 0 1.4px, transparent 1.4px 5.7px);
    background-size:
      6px 100%,
      22px 100%,
      63px 100%;
    background-position:
      63px 0,
      69px 0,
      0 0;
    background-repeat: no-repeat;
    mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  }
  .signin-box.one-signin__box {
    margin: auto 0 0;
    max-width: 460px;
    padding: 36px 34px 32px;
    font-size: 14px;
  }
  /* หน่วย px: html ของ base.css ตั้ง font-size 12px — rem จึงเล็กกว่าปกติ (0.9rem ≈ 11px) */
  .one-signin__box .form-label,
  .one-signin__box .form-check-label {
    font-size: 13px;
  }
  .one-signin__box .form-control,
  .one-signin__box .input-group-text {
    min-height: 42px;
    font-size: 14px;
  }
  .one-signin__box .btn[type="submit"] {
    min-height: 44px;
    font-size: 15px;
  }
  .one-signin__welcome {
    font-size: 19px;
  }
  .one-signin__certifications {
    margin-top: auto;
  }
}
[data-theme="dark"] .one-signin__main::after {
  opacity: 0.3;
}
[data-theme="dark"] .one-signin__brand {
  background:
    linear-gradient(to top, rgba(10, 18, 34, 0.96) 0%, rgba(10, 18, 34, 0.7) 100%),
    url("/one/brand/kks-building.webp") 86% center / cover no-repeat,
    #0a1222;
}
@keyframes one-signin-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .signin-box.one-signin__box {
    animation: none;
  }
}

/* ===== พิมพ์เอกสาร (ใบแจ้งหนี้/ใบกำกับภาษี) =====
   หน้าเอกสารพิมพ์จากหน้าจอเดียวกัน (window.print) — ซ่อนแถบบน เมนูข้าง แถบแท็บ และปุ่ม ให้เหลือแผ่นเอกสาร
   แผ่นเอกสารอยู่ใน .one-print-sheet ไม่ต้องทำหน้าพิมพ์แยก */
@media print {
  .topbar,
  .sidebar,
  .page-bar,
  .tab-bar,
  .page-title-row,
  .cmd-bar,
  .status-bar {
    display: none !important;
  }
  .one-print-sheet {
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
  }
  /* พื้นที่ทำงานเป็นการ์ดลอยบนกรอบ (base.css ของ Wachi System ตั้งแต่ 2026-11 · sync มา 2026-11-21) — บนกระดาษไม่ต้องมีกรอบ/เงา/ขอบ 6px */
  body,
  .content {
    background: #fff !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  /* หน้าจอเป็นแอปสูงเท่าจอ (html/body/.shell/.body/.content ตั้ง height 100vh + overflow hidden ใน base.css
     และ utility vh-100/overflow-hidden ของ Bootstrap) — ตอนพิมพ์ต้องปลดให้ยาวตามเนื้อหา
     ไม่อย่างนั้นเบราว์เซอร์พิมพ์ได้แค่หนึ่งจอ ไม่แบ่งหน้า A4 และหน้าตัวอย่างค้าง */
  html,
  body,
  .shell,
  .shell .body,
  .shell .content,
  .shell .content > div,
  .main-scroll {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}

/* กระดาษ A4 ขอบ 8 มม. — ป้าย/สติ๊กเกอร์เรียงหลายแผ่นต่อหน้า และเอกสารพิมพ์เต็มหน้า */
@page {
  size: A4;
  margin: 8mm;
}

/* ===== ใบส่งมอบ/รับคืนไอที (handover ข้อ 10 · พิมพ์เป็น PDF แบบ ก — เจ้าของเลือก 2026-11-25) =====
   พิมพ์จากหน้าใบ (window.print → บันทึกเป็น PDF): หัวตารางซ้ำทุกหน้า · ช่องเซ็นและส่วนรับรองไม่แตกข้ามหน้า ·
   เลขหน้าที่มุมล่างขวา (กล่องขอบกระดาษของ @page — Chrome/Edge) · ส่วนรับรองการลงนามมีเส้นคั่นบาง */
@page handover {
  size: A4;
  margin: 10mm 10mm 14mm;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-size: 9pt;
    color: #6c757d;
  }
}
@media print {
  .one-handover-sheet {
    page: handover;
  }
  .one-handover-sheet thead {
    display: table-header-group;
  }
  .one-handover-sheet tr,
  .one-avoid-break {
    break-inside: avoid;
  }
}

/* พิมพ์ต้องไม่มีแถบเลื่อน (เจ้าของทัก 2026-11-25 "มันมี scroll" บนใบส่งมอบ):
   ตอนพิมพ์แผ่นเอกสารไม่มี padding → .row ของ Bootstrap (ขอบลบ) ล้นออกข้างละครึ่ง gutter →
   กรอบเลื่อน .overflow-auto ที่ห่อแผ่นวาดแถบเลื่อนแนวนอนลงกระดาษ · แก้ทั้งสองต้นเหตุ ใช้กับเอกสารพิมพ์ทุกแบบ */
@media print {
  .one-print-sheet .row {
    margin-left: 0;
    margin-right: 0;
  }
  .overflow-auto {
    overflow: visible !important;
  }
}
.one-signature-certificate {
  border-top: 1px solid #dee2e6;
}

/* ===== ป้ายล็อต (QR) =====
   ป้ายละ 100×70 มม. ขอบดำให้ตัดง่าย · ไม่แตกข้ามหน้า — A4 ได้หลายป้าย เครื่องพิมพ์ป้ายได้ป้ายละแผ่น
   ไม่มีใน Wachi System (ระบบเดิมไม่มีป้ายล็อต) จึงเพิ่มที่นี่ */
.one-batch-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4mm;
}
.one-batch-label {
  width: 100mm;
  height: 70mm;
  padding: 3mm;
  border: 1px solid #000;
  border-radius: 2mm;
  background: #fff;
  color: #000;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}
.one-batch-label__number {
  font-size: 20pt;
  font-weight: 700;
  line-height: 1.1;
}
.one-batch-label__item {
  font-size: 11pt;
  font-weight: 600;
}
.one-batch-label__facts {
  width: 100%;
  margin-top: 1.5mm;
  font-size: 8.5pt;
}
.one-batch-label__facts th {
  font-weight: 400;
  color: #444;
  padding-right: 1.5mm;
  white-space: nowrap;
}
.one-batch-label__facts td {
  font-weight: 600;
  padding-right: 2mm;
}

/* ===== สติ๊กเกอร์ QR คลังและตำแหน่งเก็บ (storage-labels-page) =====
   สี่เหลี่ยมจัตุรัส เรียงชิดกันเต็มหน้า A4 (เจ้าของสั่ง 2026-11-10) — เส้นประ = เส้นตัด
   ขอบกระดาษ 4 มม. → พื้นที่พิมพ์ 202×289 มม.
     ตำแหน่ง 48×48 มม. · 4 คอลัมน์ × 6 แถว = 24 ดวงต่อหน้า
     คลัง    96×96 มม. · 2 คอลัมน์ × 3 แถว = 6 ดวงต่อหน้า
   ไม่มีใน Wachi System จึงเพิ่มที่นี่ */
@page storage-labels {
  size: A4;
  margin: 4mm;
}
.one-storage-sheet {
  page: storage-labels;
  display: grid;
  grid-template-columns: repeat(4, 48mm);
  grid-auto-rows: 48mm;
  justify-content: center;
}
.one-storage-sheet--warehouse {
  grid-template-columns: repeat(2, 96mm);
  grid-auto-rows: 96mm;
}
.one-storage-sheet + .one-storage-sheet {
  margin-top: 8mm;
  break-before: page;
  page-break-before: always;
}
.one-storage-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2mm;
  border: 1px dashed #888;
  background: #fff;
  color: #000;
  text-align: center;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}
.one-storage-label__code {
  max-width: 100%;
  font-size: 15pt;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-all;
}
.one-storage-sheet--warehouse .one-storage-label__code {
  font-size: 28pt;
}
.one-storage-label__name {
  max-width: 100%;
  font-size: 7pt;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-storage-sheet--warehouse .one-storage-label__name {
  font-size: 12pt;
  font-weight: 600;
  color: #000;
}
@media print {
  .one-storage-sheet + .one-storage-sheet {
    margin-top: 0;
  }
}

/* toggle เปิด/ปิดใช้งาน (StatusSwitch / statusToggleColumn ใน src/ui/) — ย่อให้พอดีแถวกริดสูง 26px
   และให้ทั้งก้อน (สวิตช์ + ป้าย) กดได้ เพื่อกดง่ายบนจอเล็ก */
.one-status-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  margin: 0;
  padding-left: 0;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}
.one-status-switch .form-check-input {
  float: none;
  margin: 0;
  cursor: pointer;
  transition:
    background-position 0.15s ease-in-out,
    background-color 0.15s ease-in-out;
}
.one-status-switch .form-check-input:disabled {
  cursor: default;
}
.one-status-switch__label {
  color: var(--bs-secondary-color);
}
.one-status-switch .form-check-input:checked + .one-status-switch__label {
  color: var(--bs-primary);
}

/* ช่องรหัส/เลขที่เอกสารที่เปิดรายการได้ (linkColumn ใน src/ui/data-grid.tsx) — แทนคอลัมน์ "จัดการ" แบบ D365FO
   ขีดเส้นใต้เฉพาะตอนชี้ ตารางจะได้ไม่รก */
.one-grid-link {
  color: var(--bs-link-color);
  text-decoration: none;
}
.one-grid-link:hover,
.one-grid-link:focus-visible {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
}

/* ไอคอนนำหน้าคอลัมน์ "ชนิด" (typeColumn ใน src/ui/type-icon.tsx · UI_UX_RULES §9.5) — จางกว่าข้อความ ให้รูปทรงนำสายตาแต่ไม่แย่งคำ
   fa-fw กว้างคงที่ ป้ายทุกแถวจึงเริ่มตรงกัน */
.one-type-icon {
  margin-right: 5px;
  color: var(--color-text-muted);
}

/* คอลัมน์ "คน" (personColumn ใน src/ui/data-grid.tsx · UI_UX_RULES §9.5) — วงกลม 20px พอดีแถว 26px (ไม่ขยายแถว §10.5) ·
   ไม่มีรูป = อักษรแรกบนสีป้ายของระบบ (--pill-* เปลี่ยนตามธีม) เลือกจากชื่อ · มีรูป = รูปทับอักษร (รูปเสีย = เหลืออักษร) */
.one-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.one-person-avatar {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.one-person-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.one-person-avatar.is-tint-0 {
  background: var(--pill-primary-bg);
  color: var(--pill-primary-fg);
}
.one-person-avatar.is-tint-1 {
  background: var(--pill-success-bg);
  color: var(--pill-success-fg);
}
.one-person-avatar.is-tint-2 {
  background: var(--pill-warning-bg);
  color: var(--pill-warning-fg);
}
.one-person-avatar.is-tint-3 {
  background: var(--pill-danger-bg);
  color: var(--pill-danger-fg);
}
.one-person-avatar.is-tint-4 {
  background: var(--pill-info-bg);
  color: var(--pill-info-fg);
}
.one-person-avatar.is-tint-5 {
  background: var(--pill-secondary-bg);
  color: var(--pill-secondary-fg);
}

/* แผงอ่านอย่างเดียว (ReadOnlyPanel ใน src/ui/offcanvas.tsx) — fieldset ไม่ให้มีกรอบ/ระยะของเบราว์เซอร์ */
.one-readonly-panel {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ช่องในฟอร์มสูงเท่ากันทุกชนิด — เจ้าของสั่ง 2026-11-10 "ทำช่องเท่ากันหมด ให้ต่างกันแค่สี disable"
   ของเดิมสูงไม่เท่ากัน: ช่องกรอก 24.5px · ช่องเลือก (Tom Select) 26px · วันที่ 23.75px · อ่านอย่างเดียว 22px
   ตั้งทุกช่องเท่าช่องเลือก (26px ซึ่งเป็น min-height ใน base.css) · จำกัดเฉพาะช่องในฟอร์ม ([class*="col-"].mb-3)
   ไม่ให้กระทบตัวกรองบนแถบคำสั่ง · textarea สูงตามเนื้อหาเหมือนเดิม */
[class*="col-"].mb-3 .form-control-sm:not(textarea),
[class*="col-"].mb-3 .input-group-sm > .form-control,
[class*="col-"].mb-3 .input-group-sm > .input-group-text,
[class*="col-"].mb-3 .input-group-sm > .btn {
  height: 26px;
  min-height: 26px;
  padding-top: 0;
  padding-bottom: 0;
}

/* ช่องที่ปิดอยู่ทุกชนิดหน้าตาเดียวกับช่องกรอกที่ปิด: กรอบเดิม พื้นเทา ตัวหนังสือสีปกติ
   Tom Select ของผู้ผลิตทำให้จางทั้งช่อง (opacity .5) และตัวหนังสือสีเทา จึงดูต่างจากช่องกรอก */
.ts-wrapper.disabled .ts-control {
  opacity: 1;
  background-color: var(--bs-secondary-bg);
}
.ts-wrapper.disabled .ts-control > div {
  background: transparent;
  color: var(--color-text-primary);
}

/* ค่าที่อ่านอย่างเดียว (FormReadonly ใน src/ui/form.tsx) — กล่องเดียวกับช่องกรอกที่ปิด สูงเท่าช่องอื่น
   ข้อความยาวตัดด้วย … (ชี้ดูข้อความเต็มได้จาก title) */
.one-readonly-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--bs-secondary-bg);
  overflow: hidden;
  white-space: nowrap;
}
.one-readonly-field > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ช่องเลือกแบบตาราง (SearchableSelect columns ใน src/ui/searchable-select.tsx) — lookup หลายคอลัมน์แบบ D365FO
   เจ้าของขอ 2026-11-11: แยกรหัส ชื่อ แผนก เป็นคอลัมน์ให้อ่านง่ายแทนข้อความต่อกันบรรทัดเดียว
   รายการกว้างกว่าช่องได้ (คอลัมน์ไม่ถูกบีบ) · หัวคอลัมน์ติดอยู่บนสุดของรายการ */
.ts-dropdown.one-grid-select {
  min-width: min(560px, 90vw);
}
.one-grid-select .one-grid-row {
  display: grid;
  column-gap: var(--space-6);
  align-items: center;
}
.one-grid-select .one-grid-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.one-grid-select .one-grid-header {
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-header);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ตารางสิทธิ์ของบทบาท (src/features/roles/permission-matrix.tsx) — แบบ Wachi System role_details (เจ้าของสั่ง 2026-11-11)
   ปุ่ม อนุญาต/ไม่อนุญาต ในแถว AG Grid — ย่อให้พอดีแถวสูง 26px (btn-sm ปกติสูงกว่าแถว) */
.permission-grant .btn {
  padding: 0 var(--space-4);
  font-size: 11px;
  line-height: 18px;
}

/* แก้ในเซลล์ของ AG Grid (src/ui/grid-editors.ts) — บรรทัดเอกสารแบบ Wachi System (เจ้าของสั่ง 2026-11-11)
   เซลล์ที่แก้ได้มีพื้นอ่อนให้รู้ว่าคลิกแก้ได้ · แถวที่ยังกรอกไม่ครบพื้นแดงอ่อน · ช่องเลือกในเซลล์ลอยเหนือกริด */
.ag-theme-quartz .one-cell-editable {
  background-color: rgba(var(--color-primary-rgb), 0.04);
  cursor: text;
}
.ag-theme-quartz .ag-row.one-row-invalid {
  background-color: var(--bs-danger-bg-subtle);
}
/* ตาราง IP ของวงเครือข่าย (IT5): แถบช่วง DHCP (เราเตอร์แจกเอง) · gateway — เจ้าของขอ 2026-11-13
   ให้เห็นทันทีว่าเลขไหนตั้ง Static ได้ · .one-legend = กล่องสีในคำอธิบายเหนือตาราง */
.ag-theme-quartz .ag-row.one-row-dhcp,
.one-legend.one-row-dhcp {
  background-color: var(--bs-info-bg-subtle);
}
.ag-theme-quartz .ag-row.one-row-gateway,
.one-legend.one-row-gateway {
  background-color: var(--bs-primary-bg-subtle);
}
.one-legend {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  margin-right: 0.125rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.1875rem;
  background-color: var(--bs-body-bg);
  vertical-align: -0.125rem;
}
.one-cell-lookup {
  background: var(--color-bg-white);
}

/* ===== ต้นไม้ลำดับชั้น (ui/tree-view.tsx) — แทน jsTree ของ Wachi System (UI_UX_RULES §6 หน้า treeview)
   Wachi System ใช้ jsTree (jQuery) · WACHI GO ไม่มี jQuery จึงทำเป็น React แล้วเลียนหน้าตาเดิม:
   กล่องซ้ายกว้าง 380px มีเส้นขวา · ลูกศรพับ/ขยาย · ไอคอนโฟลเดอร์สีเหลือง · รหัสสีเทาหน้าชื่อ · แถวที่เลือกพื้นฟ้าอ่อน */
.one-tree-layout {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}
.one-tree-layout__aside {
  width: 380px;
  flex-shrink: 0;
  border-right: 1px solid var(--bs-border-color, #dee2e6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.one-tree-layout__main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
}
.one-tree {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.one-tree__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  font-size: 0.875rem;
}
.one-tree__body {
  flex-grow: 1;
  overflow: auto;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}
.one-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.one-tree__row {
  display: flex;
  align-items: center;
  min-height: 26px;
  transition: background-color 0.12s ease;
}
.one-tree__row:hover {
  background: var(--bs-tertiary-bg, #f1f3f5);
}
.one-tree__row.is-selected {
  background: rgba(13, 110, 253, 0.12);
}
.one-tree__row.is-muted .one-tree__text,
.one-tree__row.is-muted .one-tree__icon {
  opacity: 0.5;
}
.one-tree__caret {
  width: 18px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bs-secondary-color, #6c757d);
  text-align: center;
}
.one-tree__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.one-tree__label:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.5);
  outline-offset: 1px;
}
.one-tree__icon {
  color: #f0ad1c;
}
.one-tree__code {
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.8rem;
}
.one-tree__text {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 767.98px) {
  .one-tree-layout {
    flex-direction: column;
  }
  .one-tree-layout__aside {
    width: 100%;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  }
}

/* ส่วนหัวรายละเอียดแบบมีรูป (ui/detail-header.tsx) — เจ้าของทัก 2026-11-12 ว่า "ห่างกันจัง":
   CSS เดิมจัดรูปหลักไว้กลางคอลัมน์ (margin: 0 auto) และกริดข้อมูลยืดเต็มจอ → ชิดซ้ายและให้ช่องข้อมูลกว้างคงที่ */
.one-detail-header .detail-image-carousel {
  margin: 0;
}
.one-detail-header .detail-summary-facts {
  grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
}

/* หัวข้อแบ่งส่วนในแผง/ฟอร์ม (FormSectionTitle ใน ui/form.tsx) — เจ้าของทัก 2026-11-12 ว่า "ป้ายแบ่งส่วนมันชิดกันเกิน":
   เดิม <h6 class="mt-2"> ห่างช่องด้านบนนิดเดียวและติดป้ายช่องถัดไป → เว้นบน/ล่าง + เส้นใต้ให้เห็นว่าเป็นส่วนใหม่ */
.one-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  font-weight: 600;
}
.one-form-section-title:first-child {
  margin-top: 0.25rem;
}

/* แผน PM ประจำปี (FM-IT-001): ตาราง 12 เดือนกว้าง — พิมพ์ A4 แนวนอน เฉพาะแผ่นนี้ (named page)
   ตัวอักษรเล็กลงให้เวิร์กสเตชันหลายสิบแถวอยู่ในไม่กี่หน้า */
@page maintenance-plan {
  size: A4 landscape;
  margin: 10mm;
}
@media print {
  .one-print-landscape {
    page: maintenance-plan;
  }
  .one-maintenance-plan {
    font-size: 8pt;
  }
}

/* แผนบำรุงรักษา — หน้าจอ (เจ้าของขอปรับ 2026-11-25): ตาราง 85 แถว × 12 เดือนเลื่อนแล้วหลงหัวตาราง จึงให้
   หัวตารางและคอลัมน์ # / เวิร์กสเตชันค้างไว้ · เดือนปัจจุบันมีพื้นสี · ช่องเป็นป้ายสีตามสถานะแทนการระบายทั้งช่อง ·
   แถวที่ไม่ผ่านตัวกรองซ่อนเฉพาะบนจอ (พิมพ์ครบทุกแถว) · สีจากตัวแปร Bootstrap จึงตามธีมมืด/สว่าง */
@media screen {
  .one-maintenance-plan thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-tertiary-bg);
  }
  .one-maintenance-plan .one-plan-number,
  .one-maintenance-plan .one-plan-workstation {
    position: sticky;
    z-index: 1;
    background: var(--bs-body-bg);
  }
  .one-maintenance-plan thead .one-plan-number,
  .one-maintenance-plan thead .one-plan-workstation {
    z-index: 3;
    background: var(--bs-tertiary-bg);
  }
  .one-maintenance-plan .one-plan-number {
    left: 0;
    width: 36px;
    min-width: 36px;
  }
  .one-maintenance-plan .one-plan-workstation {
    left: 36px;
    min-width: 170px;
    box-shadow: inset -1px 0 0 var(--bs-border-color);
  }
  .one-maintenance-plan tbody tr:hover > td {
    background-color: var(--bs-secondary-bg);
  }
  /* เจ้าของทัก 2026-11-25 "ตารางดูบวม" — แถวเดียวบรรทัดเดียว ช่องเตี้ยลง เดือนปัจจุบันสีอ่อนลง */
  .one-maintenance-plan > :not(caption) > * > * {
    padding: 2px 6px;
    vertical-align: middle;
  }
  .one-maintenance-plan .one-plan-workstation,
  .one-maintenance-plan .one-plan-holder {
    white-space: nowrap;
  }
  .one-maintenance-plan .one-plan-holder {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .one-maintenance-plan .is-current-month {
    background-color: color-mix(in srgb, var(--bs-primary-bg-subtle) 45%, transparent);
  }
  .one-maintenance-plan thead .is-current-month {
    color: var(--bs-primary-text-emphasis);
    background-color: var(--bs-primary-bg-subtle);
  }
  .one-maintenance-plan tr.is-filtered-out {
    display: none;
  }
}
.one-maintenance-plan .one-plan-cycle {
  width: 56px;
}
.one-maintenance-plan .one-plan-month {
  min-width: 52px;
}
.one-maintenance-plan .one-plan-holder {
  width: 220px;
}
.one-plan-cell-button,
.one-plan-cell-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
.one-plan-cell-button {
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.one-plan-cell-button:hover,
.one-plan-cell-button:focus-visible {
  background-color: var(--bs-primary-bg-subtle);
  outline: none;
}
.one-plan-empty {
  color: var(--bs-secondary-color);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.one-plan-cell-button:hover .one-plan-empty,
.one-plan-cell-button:focus-visible .one-plan-empty {
  opacity: 1;
}
.one-plan-slot {
  display: inline-block;
  min-width: 40px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.one-plan-slot.is-planned {
  color: var(--bs-primary-text-emphasis);
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}
.one-plan-slot.is-open {
  color: var(--bs-warning-text-emphasis);
  background: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}
.one-plan-slot.is-pass {
  color: var(--bs-success-text-emphasis);
  background: var(--bs-success-bg-subtle);
  border-color: var(--bs-success-border-subtle);
}
.one-plan-slot.is-fail,
.one-plan-slot.is-overdue {
  color: var(--bs-danger-text-emphasis);
  background: var(--bs-danger-bg-subtle);
  border-color: var(--bs-danger-border-subtle);
}
.one-plan-slot.is-canceled {
  color: var(--bs-secondary-color);
  background: transparent;
  border-color: var(--bs-border-color);
  text-decoration: line-through;
}
@media print {
  .one-plan-slot {
    min-width: 0;
    padding: 0 3px;
    font-size: 7pt;
  }
  .one-plan-cell-button,
  .one-plan-cell-link {
    min-height: 0;
  }
}

/* ผังเครือข่าย (IT5 · network-pages.tsx) — เจ้าของทัก 2026-11-13 "ไม่สวยเลย" จึงออกแบบใหม่:
   กล่องเป็น HTML (ไอคอนตามประเภท · รหัส · ยี่ห้อรุ่น · IP) วางบนพื้นลายจุด · เส้นหักมุมโค้งมนวาดด้วย SVG ข้างใต้
   ไม่มี CSS เดิมของ Wachi System ให้ใช้ · สีจากตัวแปร Bootstrap จึงตามธีมสว่าง/มืดเอง
   พิมพ์ A3 แนวนอน (เจ้าของตัดสินข้อ 8.8) — ย่อด้วย --one-print-zoom ที่หน้าเว็บคำนวณจากความกว้างผัง */
.one-network-canvas {
  position: relative;
  min-width: 100%;
  background-color: var(--bs-body-bg);
  background-image: radial-gradient(var(--bs-border-color) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: 0.5rem;
}
.one-network-links {
  position: absolute;
  inset: 0;
  overflow: visible;
}
.one-network-link {
  fill: none;
  stroke: var(--bs-secondary-color);
  stroke-opacity: 0.45;
  stroke-width: 1.5;
}
.one-network-link.is-backbone {
  stroke: var(--bs-primary);
  stroke-opacity: 0.7;
  stroke-width: 2.5;
}
.one-network-link.is-fiber {
  stroke: var(--bs-primary);
  stroke-opacity: 0.9;
  stroke-width: 3;
}
.one-network-link.is-wifi,
.one-network-link.is-cellular {
  stroke-dasharray: 6 5;
}
/* ป้ายพอร์ต: ปลายเส้นฝั่งลูก (ชิดขวา) · ต้นเส้นฝั่งแม่ (.is-start ชิดซ้าย) · เป็นปุ่มเมื่อแก้ได้ */
.one-network-port {
  position: absolute;
  z-index: 1;
  transform: translate(-100%, -50%);
  padding: 0 0.375rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-body-bg);
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-monospace);
  font-size: 0.6875rem;
  line-height: 1.25rem;
  white-space: nowrap;
}
.one-network-port.is-start {
  transform: translate(0, -50%);
}
.one-network-port.is-empty {
  border-style: dashed;
}
button.one-network-port {
  cursor: pointer;
}
button.one-network-port:hover,
button.one-network-port:focus-visible {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  outline: none;
}
.one-network-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border: 1px solid var(--bs-border-color);
  border-left: 4px solid var(--bs-secondary-bg);
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(var(--bs-body-color-rgb), 0.06);
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
.one-network-node:hover,
.one-network-node:focus-visible {
  color: var(--bs-body-color);
  border-color: var(--bs-primary);
  box-shadow: 0 4px 12px rgba(var(--bs-body-color-rgb), 0.12);
  transform: translateY(-1px);
  outline: none;
}
.one-network-node.is-hub {
  border-left-color: var(--bs-primary);
}
.one-network-node.is-group {
  border-style: dashed;
  border-left-style: solid;
  background: var(--bs-tertiary-bg);
  cursor: pointer;
}
/* สายอินเทอร์เน็ต (ก้อนเมฆซ้ายสุด · ข้อ 16) — แถบซ้ายสีฟ้า ต่างจากอุปกรณ์ */
.one-network-node.is-internet {
  border-left-color: var(--bs-info);
  cursor: pointer;
}
.one-network-node.is-internet .one-network-icon {
  background: var(--bs-info-bg-subtle);
  color: var(--bs-info-text-emphasis);
}
.one-network-link.is-internet {
  stroke: var(--bs-info);
  stroke-opacity: 0.9;
  stroke-width: 2.5;
}
.one-network-node.has-warning {
  border-left-color: var(--bs-danger);
}
.one-network-node.is-match {
  background: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning);
  box-shadow: 0 0 0 3px rgba(var(--bs-warning-rgb), 0.35);
}
.one-network-icon {
  flex: 0 0 2.25rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}
.one-network-node.is-hub .one-network-icon {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}
.one-network-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.one-network-code {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-monospace);
  font-size: 0.6875rem;
}
/* ปุ่มดินสอมุมกล่อง (แก้การเชื่อมต่อ/บทบาทจากผัง) — จางไว้ไม่แย่งสายตา ชี้แล้วชัด */
.one-network-edit {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: 0.6875rem;
  opacity: 0.45;
  transition:
    opacity 0.15s ease,
    background-color 0.15s ease;
}
.one-network-edit:hover,
.one-network-edit:focus-visible {
  background: var(--bs-secondary-bg);
  color: var(--bs-primary);
  opacity: 1;
  outline: none;
}
@media print {
  .one-network-edit {
    display: none;
  }
}
.one-network-role {
  color: var(--bs-primary);
  font-family: var(--bs-body-font-family);
  font-size: 0.625rem;
  font-weight: 600;
}
/* บทบาทที่ระบบเดา (ยังไม่ยืนยัน) — จางและเอียง ให้ต่างจากที่ทีมไอทีเลือกแล้ว */
.one-network-role.is-guess {
  color: var(--bs-secondary-color);
  font-style: italic;
  font-weight: 400;
}
.one-network-status {
  padding: 0 0.3rem;
  border-radius: 0.25rem;
  background: var(--bs-secondary-bg);
  font-family: var(--bs-body-font-family);
  font-size: 0.625rem;
}
.one-network-name {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.one-network-meta {
  overflow: hidden;
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-monospace);
  font-size: 0.6875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ย่อ/ขยายผังเครือข่ายบนจอ (ui/pan-zoom.ts · เจ้าของถาม 2026-11-18): กล่องนอกขนาดตามระดับขยาย กล่องในย่อด้วย transform
   ตอนพิมพ์ไม่ใช้ระดับบนจอ — ใช้ --one-print-zoom ให้พอดีหน้า A3 เหมือนเดิม */
.one-pan-zoom__content {
  transform-origin: 0 0;
}
@page network-diagram {
  size: A3 landscape;
  margin: 10mm;
}
@media print {
  .one-print-network {
    page: network-diagram;
  }
  .one-print-network .one-pan-zoom {
    width: auto !important;
    height: auto !important;
  }
  .one-print-network .one-pan-zoom__content {
    transform: none !important;
  }
  .one-print-network .one-network-canvas {
    zoom: var(--one-print-zoom, 1);
    background-image: none;
  }
  .one-network-node {
    box-shadow: none;
  }
}

/* ===== สลิปเงินเดือน / ใบรับเงินสด (payroll-runs-pages) =====
   ครึ่ง A4 ต่อใบ (A4 ได้ 2 ใบ ตัดครึ่ง) · ไม่แตกข้ามหน้า — ไม่มีใน Wachi System จึงเพิ่มที่นี่ */
.one-payslip {
  min-height: 136mm;
  break-inside: avoid;
  page-break-inside: avoid;
}
.one-payslip + .one-payslip {
  border-top: 1px dashed #888;
}
.one-payslip table td,
.one-payslip table th {
  padding: 1px 4px;
}

/* 50 ทวิ — ใบละหน้า A4 (payroll-year-pages) */
.one-withholding-certificate + .one-withholding-certificate {
  margin-top: 8mm;
  padding-top: 8mm;
  border-top: 1px dashed #888;
  break-before: page;
  page-break-before: always;
}

/* แผนผังโรงงาน (floor-plan.tsx) — ไฟล์ผังเป็นเส้นดำบนพื้นขาวจาก Illustrator ·
   ธีมมืด: กลับสีเฉพาะภาพผัง (หมุด/ตัวหนังสือเป็น SVG แยก ใช้สีของธีมอยู่แล้ว) · เจ้าของทักว่าผังยังเป็นพื้นขาว 2026-11-18 */
.one-floor-plan {
  background-color: #fff;
}
[data-theme="dark"] .one-floor-plan {
  background-color: var(--bs-body-bg);
}
/* เต็มจอ: พื้นหลังของเบราว์เซอร์ตอนเต็มจอเป็นสีดำ — ใช้พื้นของธีมแทน */
.one-floor-plan-view:fullscreen {
  background-color: var(--bs-body-bg);
  overflow: auto;
}
[data-theme="dark"] .one-floor-plan img {
  filter: invert(0.88) hue-rotate(180deg);
}

/* หน้าภาคสนาม (/field · มือถือคนขับ — transportation.md ข้อ 10 T3b · ARCHITECTURE "มือถือและงานภาคสนาม")
   สเกลของ ERP (ตัวอักษร 12px · ปุ่ม 22px ใน tokens.css/components.css) ออกแบบให้คอมในสำนักงานเห็นข้อมูลแน่น ๆ
   คนขับกดบนมือถือขณะยืนข้างรถ และไม่ถนัดเทคโนโลยี → เจ้าของเลือกหน้าตา "แบบแอปส่งของ" 2026-11-18:
   หัวสีหลักเต็มบน · การ์ดจุดถัดไปลอยทับหัว · ปุ่มกลมโทร/นำทาง · ปุ่มเลื่อนเพื่อยืนยัน (กันกดพลาด) · แผ่นเลื่อนขึ้นจากล่าง ·
   ติ๊กถูกเต็มจอเมื่อบันทึก — ทั้งหมดอยู่ใต้ .one-field (หน้า ERP ไม่กระทบ) · สีจาก token (palette 10 สี + ธีมมืด) */
.one-field {
  --one-field-font: 15px;
  --one-field-font-small: 13px;
  --one-field-font-title: 22px;
  --one-field-tap: 48px;
  --one-field-swipe: 64px;
  --one-field-hero-ink: var(--color-on-accent);
  /* dvh = ไม่นับแถบที่อยู่ของเบราว์เซอร์มือถือ */
  min-height: 100dvh;
  background: var(--color-bg-app);
  color: var(--color-text-primary);
  font-size: var(--one-field-font);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
.one-field .small,
.one-field small {
  font-size: var(--one-field-font-small);
}
.one-field .btn {
  height: auto;
  min-height: var(--one-field-tap);
  padding: 0.6rem 1rem;
  font-size: var(--one-field-font);
  font-weight: 600;
  justify-content: center;
  border-radius: var(--radius-lg);
}
.one-field .form-control {
  height: auto;
  min-height: var(--one-field-tap);
  font-size: 18px;
  border-radius: var(--radius-md);
}
.one-field-muted {
  color: var(--color-text-muted);
  font-size: var(--one-field-font-small);
}

/* ---------- หัวสีหลัก (แถบบน + ข้อมูลรถ/คำทักทาย) ---------- */
.one-field-hero {
  background: var(--color-primary);
  color: var(--one-field-hero-ink);
  padding-bottom: 3.25rem;
  padding-top: env(safe-area-inset-top);
}
.one-field-appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 56px;
  padding: 0.25rem 0.75rem;
  background: var(--color-primary);
  color: var(--one-field-hero-ink);
}
.one-field-appbar img {
  width: 28px;
  height: 28px;
}
.one-field-appbar-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-field-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: inherit;
  text-decoration: none;
  font-size: 18px;
}
.one-field-icon-button:active {
  background: color-mix(in srgb, var(--one-field-hero-ink) 16%, transparent);
}
/* ป้ายสถานะการส่งบนแถบบน — พื้นโปร่งของสีตัวหนังสือบนหัว ไม่สมมติว่าขาว (UI_UX_RULES §10 ข้อ 2) */
.one-field-sync {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: var(--one-field-font-small);
  font-weight: 600;
  background: color-mix(in srgb, var(--one-field-hero-ink) 16%, transparent);
  white-space: nowrap;
}
.one-field-sync.is-waiting {
  background: var(--color-status-pending-bg);
  color: var(--color-warning-strong);
}
.one-field-sync.is-offline {
  background: var(--color-status-inactive-bg);
  color: var(--color-status-inactive-fg);
}
/* โลโก้บนหัวสีหลัก: ปกติใช้แบบพื้นเข้ม · palette ที่สีหลักสว่าง (data-accent-ink="dark") ใช้แบบพื้นสว่าง (UI_UX_RULES §10 ข้อ 3) */
.one-field-appbar .one-field-logo-on-light {
  display: none;
}
[data-accent-ink="dark"] .one-field-appbar .one-field-logo-on-light {
  display: inline;
}
[data-accent-ink="dark"] .one-field-appbar .one-field-logo-on-dark {
  display: none;
}
.one-field-hero-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 0.25rem 1.25rem 0;
}
.one-field-hero-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.one-field-hero-sub {
  opacity: 0.8;
  font-size: var(--one-field-font-small);
  margin-top: 0.15rem;
}

/* จุดบนหัว: ● เสร็จ · ◎ จุดปัจจุบัน · ○ ยังไม่ถึง · ✕ ไม่สำเร็จ — เส้นต่อระหว่างจุดเติมตามที่เสร็จ */
.one-field-stepper {
  display: flex;
  align-items: center;
  margin: 1rem 0 0.4rem;
}
.one-field-stepper > span {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--one-field-hero-ink) 45%, transparent);
  font-size: 8px;
}
.one-field-stepper > i {
  flex: 1;
  height: 2px;
  background: color-mix(in srgb, var(--one-field-hero-ink) 30%, transparent);
}
.one-field-stepper > i.is-done {
  background: var(--one-field-hero-ink);
}
.one-field-stepper > span.is-done {
  background: var(--one-field-hero-ink);
  border-color: var(--one-field-hero-ink);
}
.one-field-stepper > span.is-failed {
  background: var(--color-status-inactive-fg);
  border-color: var(--color-status-inactive-fg);
}
.one-field-stepper > span.is-current {
  width: 20px;
  height: 20px;
  border-color: var(--one-field-hero-ink);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--one-field-hero-ink) 22%, transparent);
  animation: one-field-pulse 1.8s ease-out infinite;
}
@keyframes one-field-pulse {
  70% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--one-field-hero-ink) 0%, transparent);
  }
}

/* ---------- เนื้อหา: ลอยทับหัว ---------- */
.one-field-main {
  position: relative;
  max-width: 560px;
  margin: -2.5rem auto 0;
  padding: 0 1rem;
  /* เผื่อที่ให้ปุ่มเลื่อนที่ติดขอบล่าง */
  padding-bottom: calc(var(--one-field-swipe) + 2.5rem + env(safe-area-inset-bottom));
}
.one-field-card {
  display: block;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--elevation-2);
  padding: 1.1rem;
  margin-bottom: 0.9rem;
  color: inherit;
  text-decoration: none;
}
a.one-field-card {
  color: inherit;
  text-decoration: none;
  transition: transform var(--transition-ui);
}
a.one-field-card:active {
  transform: scale(0.985);
}
.one-field-card.is-floating {
  box-shadow: var(--elevation-3);
}
.one-field-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-primary);
  font-size: var(--one-field-font-small);
  font-weight: 700;
}
.one-field-name {
  font-size: var(--one-field-font-title);
  font-weight: 800;
  line-height: 1.25;
  margin: 0.2rem 0 0.4rem;
}
.one-field-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: var(--one-field-font-small);
  font-weight: 600;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
}
.one-field-tag.is-inbound {
  background: var(--color-status-active-bg);
  color: var(--color-status-active-fg);
}
.one-field-note {
  display: flex;
  gap: 0.5rem;
  background: var(--color-status-pending-bg);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  margin: 0.75rem 0 0.25rem;
}
.one-field-address {
  display: flex;
  gap: 0.5rem;
  color: var(--color-text-muted);
  margin-top: 0.6rem;
}

/* ปุ่มกลม: โทร · นำทาง · อื่น ๆ */
.one-field-round-row {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border-light);
}
.one-field-round {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 72px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-primary);
  font-size: var(--one-field-font-small);
  font-weight: 600;
  text-decoration: none;
}
.one-field-round > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 20px;
  transition: transform var(--transition-ui);
}
.one-field-round:active > span {
  transform: scale(0.92);
}
.one-field-round.is-danger > span {
  background: var(--color-status-inactive-bg);
  color: var(--color-status-inactive-fg);
}

/* หัวข้อส่วน */
.one-field-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.4rem 0.25rem 0.6rem;
  font-weight: 700;
}
.one-field-section > .one-field-muted {
  margin-left: auto;
  font-weight: 600;
}

/* ---------- เส้นทาง: รายการจุด ---------- */
.one-field-route {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}
.one-field-route > li > button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 64px;
  padding: 0.55rem 1rem;
  background: none;
  border: none;
  text-align: left;
  color: inherit;
}
.one-field-route > li > button:active {
  background: rgba(var(--color-primary-rgb), 0.06);
}
/* เส้นต่อระหว่างหมุด */
.one-field-route > li:not(:last-child) > button::after {
  content: "";
  position: absolute;
  left: calc(1rem + 15px);
  top: calc(50% + 17px);
  height: calc(100% - 34px);
  width: 2px;
  background: var(--color-border);
}
.one-field-pin {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: var(--one-field-font-small);
  font-weight: 800;
  background: var(--color-bg-surface);
  border: 2px solid var(--color-border-input);
  color: var(--color-text-muted);
}
.one-field-pin.is-completed {
  background: var(--color-status-active-fg);
  border-color: var(--color-status-active-fg);
  color: #fff;
}
.one-field-pin.is-arrived,
.one-field-pin.is-current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-accent);
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.18);
}
.one-field-pin.is-failed {
  background: var(--color-status-inactive-fg);
  border-color: var(--color-status-inactive-fg);
  color: #fff;
}
.one-field-route-text {
  flex: 1;
  min-width: 0;
}
.one-field-route-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-field-route-name.is-closed {
  color: var(--color-text-muted);
}

/* แถบความคืบหน้าในการ์ดเที่ยวรถ (หน้างานของฉัน) */
.one-field-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--color-primary-rgb), 0.12);
  overflow: hidden;
  margin: 0.9rem 0 0.35rem;
}
.one-field-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}
.one-field-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 20px;
}
.one-field-plate {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

/* ---------- ปุ่มเลื่อนเพื่อยืนยัน (ติดขอบล่าง) ---------- */
.one-field-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--color-bg-app) 70%, transparent);
}
.one-field-swipe {
  position: relative;
  max-width: 560px;
  height: var(--one-field-swipe);
  margin: 0 auto;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-on-accent);
  box-shadow: var(--elevation-3);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.one-field-swipe.is-disabled {
  opacity: 0.45;
}
.one-field-swipe-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--color-on-accent) 18%, transparent);
  border-radius: inherit;
}
.one-field-swipe-label {
  position: absolute;
  inset: 0 1.25rem 0 calc(var(--one-field-swipe) + 0.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
  pointer-events: none;
}
.one-field-swipe-label strong {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-field-swipe-label small {
  opacity: 0.75;
}
.one-field-swipe-knob {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(var(--one-field-swipe) - 12px);
  height: calc(var(--one-field-swipe) - 12px);
  border-radius: 50%;
  border: none;
  background: var(--color-on-accent);
  color: var(--color-primary);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--elevation-2);
  cursor: grab;
}
.one-field-swipe-knob.is-resting {
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.one-field-swipe-knob:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-on-accent) 60%, transparent);
}

/* ---------- แผ่นเลื่อนขึ้นจากล่าง ---------- */
.one-field-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  animation: one-field-fade 160ms ease-out;
}
.one-field-sheet-dismiss {
  position: absolute;
  inset: 0;
  border: none;
  background: none;
}
.one-field-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow: auto;
  background: var(--color-bg-white);
  border-radius: 22px 22px 0 0;
  padding: 0.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  box-shadow: var(--elevation-3);
  animation: one-field-rise 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.one-field-sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--color-border-input);
  margin: 0.25rem auto 0.9rem;
}
.one-field-sheet-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.one-field-sheet .btn + .btn {
  margin-top: 0.6rem;
}
.one-field-odometer {
  position: relative;
  margin: 0.25rem 0 0.4rem;
}
.one-field .one-field-odometer .form-control {
  min-height: 68px;
  padding-right: 3.5rem;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
}
/* หน่วยอยู่ในสายตาเสมอ (UI_UX_RULES §2 ช่องกรอกปริมาณ) */
.one-field-odometer > span {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 600;
}
@keyframes one-field-fade {
  from {
    opacity: 0;
  }
}
@keyframes one-field-rise {
  from {
    transform: translateY(100%);
  }
}

/* ---------- ติ๊กถูกเต็มจอเมื่อบันทึก ---------- */
.one-field-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: color-mix(in srgb, var(--color-bg-white) 88%, transparent);
  font-size: 20px;
  font-weight: 800;
  animation: one-field-fade 140ms ease-out;
  pointer-events: none;
}
.one-field-flash > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--color-status-active-fg);
  color: #fff;
  font-size: 44px;
  animation: one-field-pop 380ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes one-field-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

/* ---------- เสร็จ · ว่าง · กำลังโหลด ---------- */
.one-field-done,
.one-field-empty {
  text-align: center;
  padding: 1.75rem 1rem;
}
.one-field-done > i {
  display: block;
  font-size: 60px;
  color: var(--color-status-active-fg);
  margin-bottom: 0.75rem;
}
.one-field-empty {
  color: var(--color-text-muted);
}
.one-field-empty > i {
  display: block;
  font-size: 42px;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.one-field-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-bg-surface) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: one-field-shimmer 1.2s linear infinite;
}
@keyframes one-field-shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .one-field *,
  .one-field-flash,
  .one-field-flash > span,
  .one-field-sheet,
  .one-field-sheet-backdrop {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== ตารางเวลา (ui/time-grid.tsx) — จองห้องประชุม · docs/design/meeting-room-booking.md ข้อ 6
   Wachi System ไม่มีตารางแบบนี้ (ระบบเดิมใช้ปฏิทินเต็มรูป) — เพิ่มใหม่ ใช้สีจาก tokens:
   ของฉัน = สีหลัก · ของคนอื่น = พื้นเทา · รออนุมัติ = สีรอ (pending) ขอบประ · ช่วงที่ผ่านแล้วจาง · เส้นตอนนี้ = แดง */
.one-time-grid {
  --one-time-grid-label: 200px;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 6px;
  overflow-x: auto;
  user-select: none;
}
.one-time-grid__head,
.one-time-grid__row {
  display: grid;
  grid-template-columns: var(--one-time-grid-label) minmax(
      calc(var(--one-time-grid-hours) * 56px),
      1fr
    );
}
.one-time-grid__head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.one-time-grid__row + .one-time-grid__row {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}
.one-time-grid__label {
  padding: 6px 10px;
  border-right: 1px solid var(--bs-border-color, #dee2e6);
  min-width: 0;
  background: var(--bs-body-bg);
  position: sticky;
  left: 0;
  z-index: 1;
}
.one-time-grid__scale {
  position: relative;
  height: 28px;
}
.one-time-grid__scale span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.one-time-grid__track {
  position: relative;
  min-height: 62px;
  cursor: crosshair;
}
.one-time-grid__row--disabled .one-time-grid__track {
  cursor: not-allowed;
  background: var(--bs-secondary-bg);
}
.one-time-grid__line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--bs-border-color, #dee2e6);
  pointer-events: none;
}
.one-time-grid__past {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--bs-secondary-bg);
  opacity: 0.6;
  pointer-events: none;
}
.one-time-grid__now {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--color-danger, #dc3545);
  pointer-events: none;
  z-index: 1;
}
.one-time-grid__event,
.one-time-grid__selection {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 5px;
  padding: 2px 6px;
  overflow: hidden;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.one-time-grid__event {
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    filter var(--one-motion-fast, 120ms) ease,
    box-shadow var(--one-motion-fast, 120ms) ease;
}
.one-time-grid__event:hover {
  filter: brightness(0.96);
  box-shadow: var(--elevation-1);
}
.one-time-grid__event--mine {
  background: var(--color-primary);
  color: var(--color-on-accent);
}
.one-time-grid__event--other {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color, #dee2e6);
  color: var(--color-text-primary);
}
.one-time-grid__event--pending {
  background: var(--color-status-pending-bg);
  border: 1px dashed var(--color-status-pending-fg);
  color: var(--color-status-pending-fg);
}
.one-time-grid__event-title,
.one-time-grid__event-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-time-grid__event-title {
  font-weight: 600;
}
.one-time-grid__event-subtitle {
  opacity: 0.85;
}
.one-time-grid__selection {
  background: rgba(var(--color-primary-rgb), 0.18);
  border: 1px dashed var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  pointer-events: none;
}
@media (max-width: 767.98px) {
  .one-time-grid {
    --one-time-grid-label: 120px;
  }
}

/* ===== ดูไฟล์แนบในหน้าเว็บ (ui/file-preview.tsx) — เจ้าของขอ 2026-11-21 "เสียเวลาโหลดไฟล์แล้วเปิดมาก"
   เต็มจอทับหน้า · แถบบนมีดาวน์โหลด/แท็บใหม่/ปิด · Word วาดเป็นหน้ากระดาษบนพื้นเทา (แบบโปรแกรม Word) */
.one-file-preview {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  background: var(--bs-secondary-bg);
}
.one-file-preview__bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  box-shadow: var(--elevation-1);
  min-width: 0;
}
.one-file-preview__body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}
.one-file-preview__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.one-file-preview__image {
  display: block;
  max-width: 100%;
  margin: 16px auto;
  box-shadow: var(--elevation-2);
}
/* docx-preview วาดหน้ากระดาษสีขาวเอง — ให้กระดาษอยู่กลางและมีเงา · ฉากหลังของตัววาดใช้สีเดียวกับหน้าต่าง */
.one-file-preview__docx .one-docx-wrapper {
  background: transparent;
  padding: 16px;
}
.one-file-preview__docx .one-docx-wrapper > section.one-docx {
  box-shadow: var(--elevation-2);
  margin: 0 auto 16px;
}

/* รูปลายมือชื่อ (ลายเซ็นอิเล็กทรอนิกส์ E2) — กรอบวาดใช้นิ้วบนแท็บเล็ตได้ (ไม่เลื่อนหน้าตอนวาด) */
.one-signature-pad {
  touch-action: none;
  cursor: crosshair;
  aspect-ratio: 3 / 1;
}
.one-signature-image {
  max-height: 72px;
  max-width: 240px;
  object-fit: contain;
}
.one-signature-image--small {
  max-height: 32px;
  max-width: 120px;
}

/* รูปเมื่อชี้ค้างที่รหัสในตาราง (imageTooltipColumn ใน ui/data-grid.tsx) — กรอบเล็กลอยเหนือกริด ไม่บังทั้งหน้า */
.one-image-tooltip {
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 4px;
  pointer-events: none;
}
/* กรอบจัตุรัสเท่ากันทุกรูป (เจ้าของสั่ง 2026-11-24) — ตัดขอบส่วนเกินแทนการย่อ ภาพเต็มกรอบ */
.one-image-tooltip img {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: cover;
}

/* เครื่องหน้าร้านโรงอาหาร + ตู้ดูยอด (/canteen-terminal · /canteen-balance-kiosk — docs/design/canteen.md C2)
   แบบเดียวกับหน้าภาคสนาม (.one-field): สเกลของ ERP (12px · ปุ่ม 22px) ออกแบบให้คอมในสำนักงาน · จอที่ร้านเป็นจอสัมผัส
   คนขายกดตอนรีบและอ่านตัวเลขจากระยะยืน → ขนาดตัวอักษร/ปุ่มของหน้านี้ตั้งเป็นตัวแปรที่นี่ที่เดียว (ไม่กระทบหน้า ERP) ·
   rem ของระบบ = 12px (html ใช้ --font-size-base) ข้อความอ่านให้ใช้ตัวแปร px ข้างล่าง · rem ใช้กับตัวเลขขนาดใหญ่เท่านั้น ·
   สีทั้งหมดจาก token (palette 10 สี + ธีมสว่าง/มืดตามที่เครื่องตั้ง) — เจ้าของติ 2026-12-01 "UX/UI หลุดจากแนวทาง"
   เมื่อชุดก่อนเป็นพื้นมืดสีตายตัว · ปุ่มใช้ 3 แบบของระบบ (.btn · .btn-primary · .btn-danger) ·
   ช่องกรอก/ข้อความแจ้ง/สวิตช์ใช้ .form-control .alert .form-switch แล้วขยายขนาดใต้ .one-canteen · คงไว้เฉพาะสิ่งที่ระบบไม่มี: ไทล์หน้าหลัก แป้นตัวเลข จอยอด บัตรพนักงาน แป้น PIN */
.one-canteen {
  --one-canteen-font: 16px;
  --one-canteen-font-small: 14px;
  --one-canteen-font-title: 20px;
  --one-canteen-tap: 52px;
  --canteen-key: var(--color-bg-app);
  --canteen-key-hover: rgba(var(--color-primary-rgb), 0.08);
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--one-canteen-font);
  line-height: 1.45;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(var(--color-primary-rgb), 0.08), transparent 60%),
    var(--color-bg-frame);
  -webkit-tap-highlight-color: transparent;
}
.one-canteen button,
.one-canteen input {
  font-family: inherit;
}
.one-canteen .small,
.one-canteen small {
  font-size: var(--one-canteen-font-small);
}
.one-canteen-muted {
  color: var(--color-text-muted);
}
.one-canteen .btn {
  height: auto;
  min-height: var(--one-canteen-tap);
  padding: 0.6rem 1.1rem;
  font-size: var(--one-canteen-font);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-lg);
}
.one-canteen .form-control {
  height: auto;
  min-height: var(--one-canteen-tap);
  font-size: 18px;
  border-radius: var(--radius-md);
}
.one-canteen .form-switch {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-left: 0;
  margin: 1rem 0 0;
  cursor: pointer;
}
.one-canteen .form-switch .form-check-input {
  width: 3.2rem;
  height: 1.75rem;
  margin: 0;
  float: none;
  cursor: pointer;
}
.one-canteen .alert {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: var(--one-canteen-font);
  border-radius: var(--radius-lg);
  animation: one-canteen-pop 0.18s ease;
}

/* แถบบน */
.one-canteen-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1.15rem;
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--elevation-topbar);
  flex-shrink: 0;
}
.one-canteen-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: var(--one-canteen-font-title);
}
.one-canteen-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: var(--color-on-accent);
}
.one-canteen-bar-period {
  color: var(--color-text-muted);
  font-size: var(--one-canteen-font-small);
}
.one-canteen-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.one-canteen-icon-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.08s ease;
}
.one-canteen-icon-button:hover {
  background: var(--color-row-hover);
}
.one-canteen-icon-button:active {
  transform: scale(0.94);
}
.one-canteen-icon-button.is-muted {
  color: var(--color-text-muted);
}

/* โครงหน้าจอ */
.one-canteen-screen {
  flex: 1;
  overflow: auto;
  padding: 1.15rem;
  animation: one-canteen-fade 0.18s ease;
}
@keyframes one-canteen-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes one-canteen-pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.one-canteen-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--elevation-2);
}
.one-canteen-center-card {
  max-width: 780px;
  margin: 1.6rem auto;
}
.one-canteen-label {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--one-canteen-font-small);
  margin-bottom: 0.45rem;
}

/* หน้าหลัก: ไทล์ — สีไอคอนจากป้ายสถานะของระบบ (--pill-*) */
.one-canteen-tiles {
  display: grid;
  gap: 1.15rem;
  max-width: 820px;
  margin: 2.2rem auto;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.one-canteen-tile {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1rem;
  cursor: pointer;
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  box-shadow: var(--elevation-1);
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}
.one-canteen-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--color-primary-rgb), 0.45);
  box-shadow: var(--elevation-3);
}
.one-canteen-tile-icon {
  width: 66px;
  height: 66px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}
.one-canteen-tile-icon.is-primary {
  background: var(--pill-primary-bg);
  color: var(--pill-primary-fg);
}
.one-canteen-tile-icon.is-warning {
  background: var(--pill-warning-bg);
  color: var(--pill-warning-fg);
}
.one-canteen-tile-icon.is-success {
  background: var(--pill-success-bg);
  color: var(--pill-success-fg);
}
.one-canteen-tile-icon.is-danger {
  background: var(--pill-danger-bg);
  color: var(--pill-danger-fg);
}
.one-canteen-tile-icon.is-secondary {
  background: var(--pill-secondary-bg);
  color: var(--pill-secondary-fg);
}
.one-canteen-tile-icon.is-info {
  background: var(--pill-info-bg);
  color: var(--pill-info-fg);
}
.one-canteen-tile-title {
  font-size: var(--one-canteen-font-title);
  font-weight: 600;
}

/* หน้าขาย */
.one-canteen-sell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.15rem;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}
@media (max-width: 940px) {
  .one-canteen-sell {
    grid-template-columns: 1fr;
  }
}
.one-canteen-display {
  background: var(--color-bg-app);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 1.15rem;
  text-align: right;
}
.one-canteen-display-expression {
  color: var(--color-text-muted);
  font-size: var(--one-canteen-font);
  min-height: 1.4rem;
}
.one-canteen-display-amount {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}
.one-canteen .one-canteen-card-input {
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}

/* บัตรพนักงานแบบบัตรเครดิต (เจ้าของสั่ง 2026-11-30 "อยากแสดงกราฟิกบัตรเครดิตสวย ๆ มีรูปพนักงาน")
   สัดส่วนบัตรจริง 85.6 × 54 มม. · พื้นไล่จากสีหลักของ palette ที่เลือก ตัวหนังสือ --color-on-accent ·
   ลายเส้นคลื่น แสงเคลือบ และชิปทองเป็นภาพของบัตรจริง (ไม่ใช่สีแบรนด์) จึงเป็นสีคงที่ ·
   รูปพนักงานกรอบมนใหญ่ทางขวา (คนขายเทียบหน้า) · ไม่มีรูป = เงาคนพร้อมอักษรแรก ·
   ใช้ได้ถึง = วันจบงวด (เงินหมดอายุตอนปิดงวด) · ยอดต่ำ = บัตรสีแดง (danger ของระบบ) */
.one-canteen-credit-card {
  --card-ink: var(--color-on-accent);
  --card-base: var(--color-primary);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: 1rem;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1.586 / 1;
  padding: 1.3rem 1.4rem;
  border-radius: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 0.35rem 1rem;
  color: var(--card-ink);
  background:
    radial-gradient(
      120% 90% at 0% 0%,
      color-mix(in srgb, var(--card-base) 55%, #fff),
      transparent 55%
    ),
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--card-base) 70%, #000) 0%,
      var(--card-base) 55%,
      color-mix(in srgb, var(--card-base) 75%, #000) 100%
    );
  box-shadow: var(--elevation-3);
  transform-origin: 50% 100%;
  animation: one-canteen-card-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.one-canteen-credit-card.is-low {
  --card-ink: var(--color-text-white);
  --card-base: var(--bs-danger);
}
.one-canteen-credit-card.is-big {
  max-width: 640px;
  margin: 1.2rem auto 0;
  padding: 1.6rem 1.8rem;
}
@keyframes one-canteen-card-in {
  from {
    opacity: 0;
    transform: perspective(900px) rotateX(18deg) translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* ลายเส้นคลื่น (guilloche) แบบบัตรจริง */
.one-canteen-credit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'%3E%3Cg fill='none' stroke='white' stroke-width='0.6'%3E%3Cpath d='M0 60 Q30 20 60 60 T120 60 T180 60 T240 60'/%3E%3Cpath d='M0 70 Q30 30 60 70 T120 70 T180 70 T240 70'/%3E%3Cpath d='M0 80 Q30 40 60 80 T120 80 T180 80 T240 80'/%3E%3Cpath d='M0 50 Q30 10 60 50 T120 50 T180 50 T240 50'/%3E%3Cpath d='M0 90 Q30 50 60 90 T120 90 T180 90 T240 90'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 120px;
  mask-image: linear-gradient(115deg, transparent 5%, #000 35%, #000 60%, transparent 95%);
}
/* แสงเคลือบพาดผ่านตอนบัตรขึ้นจอ */
.one-canteen-credit-card::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.24) 48%,
    rgba(255, 255, 255, 0.05) 54%,
    transparent 60%
  );
  transform: translateX(-60%);
  animation: one-canteen-card-shine 1.4s 0.25s ease-out forwards;
}
@keyframes one-canteen-card-shine {
  to {
    transform: translateX(60%);
  }
}
.one-canteen-cc-top,
.one-canteen-cc-middle,
.one-canteen-cc-bottom,
.one-canteen-cc-photo-frame {
  position: relative;
  z-index: 1;
}
/* แถวบน: ชื่อบริษัท + แตะจ่าย */
.one-canteen-cc-top {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.one-canteen-cc-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--card-base);
  background: var(--card-ink);
}
.one-canteen-cc-brand {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.one-canteen-cc-contactless {
  margin-left: auto;
  font-size: 1.25rem;
  opacity: 0.85;
  transform: rotate(90deg);
}
/* กลาง: ชิป + เลขบัตร */
.one-canteen-cc-middle {
  grid-column: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.one-canteen-cc-chip {
  width: 50px;
  height: 38px;
  border-radius: 8px;
  position: relative;
  background:
    linear-gradient(90deg, transparent 32%, rgba(120, 72, 8, 0.45) 33%, transparent 34%),
    linear-gradient(90deg, transparent 65%, rgba(120, 72, 8, 0.45) 66%, transparent 67%),
    linear-gradient(0deg, transparent 48%, rgba(120, 72, 8, 0.45) 49%, transparent 52%),
    linear-gradient(135deg, #fef3c7 0%, #fbbf24 35%, #d97706 65%, #fde68a 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 72, 8, 0.35);
}
.one-canteen-cc-number {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}
.one-canteen-credit-card.is-big .one-canteen-cc-number {
  font-size: 2rem;
}
/* รูปพนักงาน: กรอบมนแนวตั้ง */
.one-canteen-cc-photo-frame {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
  width: 118px;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  padding: 3px;
  background: var(--color-bg-white);
  box-shadow: var(--elevation-2);
}
.one-canteen-credit-card.is-big .one-canteen-cc-photo-frame {
  width: 160px;
}
.one-canteen-cc-photo {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: var(--color-bg-app);
}
/* ไม่มีรูป: เงาคน + อักษรแรก */
.one-canteen-cc-photo.is-placeholder {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end center;
  color: var(--color-text-secondary);
}
.one-canteen-cc-photo.is-placeholder svg {
  width: 100%;
  fill: var(--color-border-medium);
}
.one-canteen-cc-initial {
  position: absolute;
  top: 0.45rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}
/* ล่าง: ผู้ถือบัตร + ใช้ได้ถึง | ยอดคงเหลือ */
.one-canteen-cc-bottom {
  grid-column: 1 / 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.one-canteen-cc-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  opacity: 0.75;
}
.one-canteen-cc-name {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.one-canteen-credit-card.is-big .one-canteen-cc-name {
  font-size: 1.5rem;
}
.one-canteen-cc-through {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.one-canteen-cc-balance {
  text-align: right;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--card-ink) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-ink) 28%, transparent);
  flex-shrink: 0;
}
.one-canteen-cc-balance-amount {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.one-canteen-cc-balance-amount small {
  font-size: 0.55em;
  font-weight: 600;
  opacity: 0.85;
  margin-right: 0.15rem;
}
.one-canteen-credit-card.is-big .one-canteen-cc-balance-amount {
  font-size: 2.7rem;
}
@media (max-width: 560px) {
  .one-canteen-cc-photo-frame {
    width: 92px;
  }
  .one-canteen-cc-number {
    font-size: 1.2rem;
  }
  .one-canteen-cc-balance-amount {
    font-size: 1.5rem;
  }
}

/* ข้อความผลลัพธ์ (.alert ของระบบ) — จองที่ไว้ จอไม่กระโดดตอนข้อความขึ้น/หาย */
.one-canteen-result {
  margin-top: 1rem;
  min-height: 3.4rem;
}

/* ปุ่มคู่ใต้แป้น (.btn ของระบบ) */
.one-canteen-buttons {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

/* แป้นคิดเลข */
.one-canteen-pad {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, 1fr);
}
.one-canteen-key {
  background: var(--canteen-key);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 1.65rem;
  padding: 1.15rem 0;
  cursor: pointer;
  transition:
    transform 0.06s ease,
    background 0.12s ease;
}
.one-canteen-key:hover {
  background: var(--canteen-key-hover);
}
.one-canteen-key:active {
  transform: scale(0.95);
}
.one-canteen-key:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.one-canteen-key.is-operator {
  background: var(--pill-primary-bg);
  color: var(--pill-primary-fg);
}
.one-canteen-key.is-warning {
  background: var(--pill-warning-bg);
  color: var(--pill-warning-fg);
  font-size: 1.3rem;
}
.one-canteen-key.is-danger {
  background: var(--pill-danger-bg);
  color: var(--pill-danger-fg);
}
.one-canteen-key.is-equals {
  background: var(--pill-secondary-bg);
  color: var(--pill-secondary-fg);
  grid-column: span 3;
}
.one-canteen-key.is-primary {
  background: var(--color-primary);
  color: var(--color-on-accent);
  border-color: var(--color-primary);
  font-size: 1.2rem;
}

/* ตั้งค่าเครื่อง */
.one-canteen-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.2rem;
  border-bottom: 1px solid var(--color-border);
}
.one-canteen-setting .form-switch {
  margin: 0;
}
.one-canteen-setting-name {
  font-size: var(--one-canteen-font);
}
.one-canteen-setting-description {
  color: var(--color-text-muted);
  font-size: var(--one-canteen-font-small);
  margin-top: 0.15rem;
  max-width: 46ch;
}
.one-canteen-stepper {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.35rem;
  font-weight: 600;
  white-space: nowrap;
}
.one-canteen-stepper-unit {
  font-size: var(--one-canteen-font-small);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-left: -0.4rem;
}
.one-canteen-step {
  width: var(--one-canteen-tap);
  height: var(--one-canteen-tap);
  border-radius: var(--radius-md);
  font-size: 1.4rem;
  cursor: pointer;
  background: var(--canteen-key);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
.one-canteen-step:hover {
  background: var(--canteen-key-hover);
}

/* ประวัติการขาย */
.one-canteen-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.one-canteen-history-total {
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.one-canteen-history-list {
  max-height: 66vh;
  overflow: auto;
}
.one-canteen-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.2rem;
  border-bottom: 1px solid var(--color-border);
}
.one-canteen-history-row.is-reversed {
  opacity: 0.5;
  text-decoration: line-through;
}
.one-canteen-history-time {
  color: var(--color-text-muted);
  font-size: var(--one-canteen-font-small);
}
.one-canteen-history-amount {
  font-size: var(--one-canteen-font-title);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* เข้าเครื่องด้วยการแตะรูป + PIN (เจ้าของสั่ง 2026-11-30 "ปรับหน้าเข้าระบบด้วย PIN")
   นาฬิกาตัวใหญ่ · รูปผู้ใช้ที่เครื่องจำไว้เป็นวงกลมสีหลัก · จุด PIN แทนช่องรหัส · แป้น 3 คอลัมน์ปุ่มใหญ่ */
.one-canteen-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.one-canteen-login {
  display: grid;
  gap: 1.2rem;
  width: min(440px, 94vw);
}
.one-canteen-clock {
  text-align: center;
}
.one-canteen-clock-time {
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}
.one-canteen-clock-date {
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}
.one-canteen-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.one-canteen-user-slot {
  position: relative;
}
.one-canteen-user {
  width: 104px;
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.one-canteen-user:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
}
.one-canteen-user.is-picked {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}
.one-canteen-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--color-primary);
  color: var(--color-on-accent);
}
.one-canteen-user.is-add .one-canteen-user-avatar {
  background: var(--pill-secondary-bg);
  color: var(--pill-secondary-fg);
}
.one-canteen-user-name {
  font-size: var(--one-canteen-font-small);
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.one-canteen-user-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-white);
  background: var(--bs-danger);
  color: var(--color-text-white);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.one-canteen-pin-card {
  padding: 1.2rem;
}
.one-canteen-pin-change {
  width: min(440px, 94vw);
}
.one-canteen-pin-prompt {
  text-align: center;
  font-size: var(--one-canteen-font-title);
  margin-bottom: 0.8rem;
}
.one-canteen-pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  min-height: 18px;
}
.one-canteen-pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border-input);
  transition:
    background 0.12s ease,
    transform 0.12s ease;
}
.one-canteen-pin-dots span.is-filled {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.1);
}
.one-canteen-pin-dots.is-error span {
  border-color: var(--bs-danger);
  animation: one-canteen-shake 0.3s ease;
}
@keyframes one-canteen-shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.one-canteen-pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
.one-canteen-error {
  font-size: var(--one-canteen-font-small);
  min-height: 1.3rem;
  margin-top: 0.6rem;
  text-align: center;
}
.one-canteen-login-card {
  width: min(400px, 92vw);
  text-align: center;
}
.one-canteen-login-card form {
  text-align: left;
}
.one-canteen-login-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 0.8rem;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: var(--pill-primary-bg);
  color: var(--pill-primary-fg);
}
.one-canteen-login-title {
  font-size: var(--one-canteen-font-title);
  margin: 0 0 0.2rem;
}
.one-canteen-steps {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.one-canteen-steps span {
  font-size: var(--one-canteen-font-small);
  color: var(--pill-secondary-fg);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--pill-secondary-bg);
  border: 1px solid transparent;
}
.one-canteen-steps span.is-active {
  color: var(--pill-primary-fg);
  border-color: var(--color-primary);
  background: var(--pill-primary-bg);
}
.one-canteen-steps span.is-done {
  color: var(--pill-success-fg);
  background: var(--pill-success-bg);
}

/* ===== สีแบรนด์เกรียงไกร สตีล เซ็นเตอร์ (เจ้าของสั่ง 2026-12-02) =====
   ชุดสีจาก CSS ของ kksteelcenter.com: น้ำเงิน --dark-slate-blue #3a518a · ทอง --goldenrod #f4b719 ·
   ตัวหนังสือ --dark #242022 · สีหลัก (ปุ่ม ลิงก์ แถวที่เลือก) อยู่ที่ชุดสี "ค่าเริ่มต้น" ใน src/ui/theme.ts
   ที่นี่ตั้งเฉพาะสิ่งที่ชุดสีไม่ได้คุม: แถบบนเป็นน้ำเงินแบรนด์ และเส้นทองแบบเส้นใต้หัวข้อของเว็บ
   ทองใช้เป็นเส้น/แถบเท่านั้น ไม่ใช้เป็นพื้นหลังตัวหนังสือขาว (ขาวบนทองอ่านยาก) */
:root {
  --one-brand-gold: #f4b719;
  /* จุดทอง 4 จุด (4dots.svg ของเว็บ) — เครื่องหมายนำหน้าหัวข้อ */
  --one-four-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17' fill='%23f4b719'%3E%3Ccircle cx='3.5' cy='3.5' r='3.5'/%3E%3Ccircle cx='13.5' cy='3.5' r='3.5'/%3E%3Ccircle cx='3.5' cy='13.5' r='3.5'/%3E%3Ccircle cx='13.5' cy='13.5' r='3.5'/%3E%3C/svg%3E");
}
/* สีหลักตายตัวเป็นสีแบรนด์ (ไม่มีตัวเลือกชุดสีแล้ว — เจ้าของสั่ง 2026-12-02 "เอาเลือกสีได้ออก")
   โหมดสว่าง: ต้องเขียน :not([data-theme="dark"]) — :root เฉย ๆ จะชนะ [data-theme="dark"] ของ tokens.css (น้ำหนักเท่ากัน ไฟล์นี้มาทีหลัง) */
:root:not([data-theme="dark"]) {
  --color-primary: #3a518a;
  --color-primary-rgb: 58, 81, 138;
  --color-primary-hover: #33497f;
  --color-accent: #3a518a;
  --color-link: #3a518a;
  --color-text-primary: #242022;
  --color-dark-bg: #3a518a;
  --color-dark-hover: #33497f;
  --color-dark-active: #2b3e6c;
}
/* โหมดมืด: น้ำเงินแบรนด์ที่สว่างขึ้น ให้ตัวหนังสือขาวบนปุ่มยังอ่านได้บนพื้นมืด (เดิมอยู่ในชุดสี default ของ theme.ts) */
[data-theme="dark"] {
  --color-primary: #5f78b8;
  --color-primary-rgb: 95, 120, 184;
  --color-primary-hover: #7a90c8;
  --color-accent: #5f78b8;
  --color-link: #7a90c8;
}
/* แถบบน: เส้นทองใต้แถบ แบบเส้นคั่นสีทองบนเว็บ */
.topbar {
  box-shadow:
    inset 0 -2px 0 var(--one-brand-gold),
    var(--elevation-topbar);
}
/* เมนูข้างที่เปิดอยู่: ขีดทองด้านซ้าย แบบขอบทองข้างรูปบนเว็บ */
.sb-item.active {
  box-shadow: inset 3px 0 0 var(--one-brand-gold);
}
/* แท็บที่เปิดอยู่: เส้นใต้สีทอง แบบหัวข้อบนเว็บ */
.tab-item.active {
  border-bottom-color: var(--one-brand-gold);
}
/* ปุ่มไอคอนบนแถบบน (แจ้งเตือน · โหมดมืด · เต็มจอ): components.css ใช้ --color-text-muted (เทาฟ้า) ซึ่งจมหายบนพื้นน้ำเงิน
   — เจ้าของชี้ "โลโก้จม" แล้วสั่งให้เป็นสีขาว 2026-12-02 · เส้นคั่นเป็นขาวโปร่งให้เบากว่าไอคอน */
.topbar .topbar-btn {
  color: #fff;
}
.topbar .topbar-divider {
  background: rgba(255, 255, 255, 0.3);
}
/* โลโก้บริษัทบนปุ่มเลือกบริษัท (แถบบน): รูปที่อัปโหลดเป็นโลโก้สีน้ำเงินสำหรับพื้นขาว จมหายบนแถบน้ำเงิน
   — เจ้าของสั่งให้เป็นสีขาว 2026-12-02 · ทำเป็นเงาขาวทั้งรูปด้วย filter จึงใช้ได้กับโลโก้ทุกบริษัทโดยไม่ต้องอัปโหลดรูปอีกชุด */
.one-topbar-company-logo {
  filter: brightness(0) invert(1);
}
/* ชื่อระบบบนแถบบน "KKS SOFT": KKS สีทองแบรนด์บนพื้นน้ำเงิน (แทน text-sky ของชื่อเดิม) */
.topbar-brand .one-brand-mark {
  color: var(--one-brand-gold);
}

/* ===== รูปทรงและองค์ประกอบแบบ kksteelcenter.com (เจ้าของสั่ง 2026-12-02 "ปรับ UI ให้สอดคล้องกับเว็บ") =====
   จาก CSS ของเว็บ (kks-staging.webflow.shared.css): ปุ่ม ช่องติ๊ก ช่องกรอก border-radius: 0 ·
   ปุ่มหลักพื้นทอง (.button) ชี้แล้วเป็นพื้นโปร่ง ขอบทอง ตัวหนังสือน้ำเงิน · หัวข้อสีน้ำเงินมีขีดทอง
   (.heading = เส้นทองใต้ · .heading-15 = แถบทองซ้าย) · ช่องกรอกขีดล่างสีทอง (.text-field) · พื้นอ่อน #e2e6ee */

/* มุมเหลี่ยมแบบเว็บ: ลดมุมโค้งของทั้งระบบผ่านตัวแปร (tokens.css + Bootstrap) — ป้ายสถานะเปลี่ยนเป็นทรงเหลี่ยม 2px ในบล็อก "รอบที่ 3 ของแบรนด์" ท้ายไฟล์
   เหลือ 2px แทน 0 เพื่อไม่ให้ขอบ 1px ดูแตกเป็นหยักบนจอความละเอียดต่ำ */
:root {
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 3px;
  --bs-border-radius: 2px;
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 3px;
  --bs-border-radius-xl: 3px;
  --bs-border-radius-xxl: 3px;
}
/* การ์ดและกล่องที่ components.css / pages.css ใส่มุมโค้งเป็นตัวเลขตายตัว (ไม่ผ่านตัวแปร) */
.data-area,
.stat-mini-card,
.signin-box,
.modal .modal-content,
.wachi-swal-popup {
  border-radius: var(--radius-sm);
}

/* ปุ่มหลัก = ปุ่ม "ขอใบเสนอราคา" ของเว็บ: พื้นทอง ชี้แล้วพื้นโปร่ง ขอบทอง ตัวหนังสือน้ำเงิน
   ตัวหนังสือใช้ --dark #242022 ไม่ใช่ขาวแบบเว็บ — ขาวบนทองคอนทราสต์ 1.9:1 อ่านไม่ออกบนปุ่มเล็กของ ERP (เข้มบนทอง 8.7:1)
   ใช้กับทุกคน (ไม่มีตัวเลือกชุดสีแล้ว) · กฎนี้อยู่หลังกฎ "ปุ่มหลัก: ไล่แสง" ข้างบน จึงทับ background-image ของกฎนั้นได้
   components.css ใส่ background/color/border-color แบบ !important จึงต้อง !important */
.btn.btn-primary:not(:disabled) {
  background: var(--one-brand-gold) !important;
  border-color: var(--one-brand-gold) !important;
  color: #242022 !important;
}
.btn.btn-primary:not(:disabled):hover,
.btn.btn-primary:not(:disabled):focus-visible {
  background: transparent !important;
  color: var(--color-primary) !important;
  box-shadow: none;
}
[data-theme="dark"] .btn.btn-primary:not(:disabled):hover,
[data-theme="dark"] .btn.btn-primary:not(:disabled):focus-visible {
  color: var(--one-brand-gold) !important;
}
.btn.btn-primary:disabled {
  background: rgba(244, 183, 25, 0.45) !important;
  border-color: transparent !important;
  color: rgba(36, 32, 34, 0.6) !important;
}
/* ปุ่มขอบน้ำเงิน = .button.is--outline ของเว็บ: ชี้แล้วพื้นทอง */
.btn.btn-outline-primary:not(:disabled):hover {
  background: var(--one-brand-gold);
  border-color: var(--one-brand-gold);
  color: #242022;
}

/* ชื่อหน้า: จุดทอง 4 จุดนำหน้าแบบหัวข้อ section ของเว็บ (4dots.svg) ตัวหนังสือสีน้ำเงิน */
.page-title-row__title h1,
.page-title-row__title h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
}
.page-title-row__title h1::before,
.page-title-row__title h4::before {
  content: "";
  flex: 0 0 11px;
  height: 11px;
  background: var(--one-four-dots) center / contain no-repeat;
}
[data-theme="dark"] .page-title-row__title h1,
[data-theme="dark"] .page-title-row__title h4 {
  color: var(--color-text-primary);
}

/* หัวแผงพับได้ (fast tab): ตัวหนังสือน้ำเงิน · เมื่อกางอยู่มีเส้นแบ่งบาง ๆ เต็มแถว + ขีดทองสั้นใต้หัวข้อแบบ .heading ของเว็บ
   (เดิมเป็นเส้นทองเต็มความกว้างทุกแผง — เจ้าของดูหน้าอุปกรณ์ไอทีแล้วว่า "แปลก ๆ" 2026-12-02 เพราะเส้นทองยาวหลายเส้นแย่งสายตา)
   ใช้ box-shadow / ::after ไม่ใช่ border เพื่อไม่ให้ความสูงหัวแผงเปลี่ยน */
.fast-tab-header {
  position: relative;
  color: var(--color-primary);
}
.fast-tab:not(.collapsed) > .fast-tab-header {
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.fast-tab:not(.collapsed) > .fast-tab-header::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--one-brand-gold);
}
/* เนื้อหาในแผงชิดเส้นใต้หัวแผง (components.css padding-top 0) — เว้นให้ป้ายช่องแรกไม่ติดเส้น */
.fast-tab-content {
  padding-top: 10px;
}
[data-theme="dark"] .fast-tab-header {
  color: var(--color-text-primary);
}
/* ลูกศรพับ/กางแผง: สีทองแบบลูกศร (arrow.svg) บนเว็บ */
.fast-tab-header i.fa-chevron-down {
  color: var(--one-brand-gold);
}

/* ช่องกรอก/ช่องเลือกตอนโฟกัส: ขีดล่างสีทองแบบ .text-field ของเว็บ (ขอบด้านอื่นยังเป็นสีหลักตามเดิม) */
.form-control:not(.form-underline):focus,
.form-select:focus {
  border-bottom-color: var(--one-brand-gold);
}
.ts-wrapper.form-select.focus .ts-control {
  border-bottom-color: var(--one-brand-gold) !important;
}

/* ช่องติ๊ก: สี่เหลี่ยมขอบน้ำเงินแบบ .checkbox ของเว็บ (สวิตช์ .form-switch คงทรงเดิม) */
.form-check:not(.form-switch) .form-check-input[type="checkbox"] {
  border-radius: 0;
  border-color: var(--color-primary);
}

/* ===== แบรนด์ KKS: ส่วนที่ใช้หลายหน้า (src/ui/brand.tsx) — เจ้าของสั่ง 2026-12-02 ===== */

/* ค่านิยมหลัก K-K-S: ใช้บนพื้นน้ำเงิน (แผงหน้าเข้าสู่ระบบ · แถบหัวหน้าแรก) — ตัวหนังสือรับสีจากที่วาง ตัวอักษรแรกสีทอง */
.one-core-values__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--one-brand-gold);
}
.one-core-values__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.one-core-values__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.one-core-values__initial {
  color: var(--one-brand-gold);
  font-weight: 700;
}
.one-core-values__meaning {
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.82;
}

/* หน้าสถานะ (ไม่พบหน้า · ไม่มีสิทธิ์): เครื่องหมาย K กลางหน้า หัวข้อนำด้วยจุดทอง 4 จุดแบบหัวข้อของเว็บ
   (เดิม: ไม่พบหน้า = พากลับหน้าแรกเงียบ ๆ · ไม่มีสิทธิ์ = แถบเตือนสีเหลืองบรรทัดเดียว) */
.one-brand-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 320px;
  padding: 48px 24px;
  text-align: center;
}
.one-brand-state__mark {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  opacity: 0.9;
}
[data-theme="dark"] .one-brand-state__mark,
[data-theme="dark"] .one-brand-splash__mark {
  content: url("/one/brand/kks-mark-on-dark.svg");
}
.one-brand-state__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}
.one-brand-state__title::before {
  content: "";
  flex: 0 0 12px;
  height: 12px;
  background: var(--one-four-dots) center / contain no-repeat;
}
[data-theme="dark"] .one-brand-state__title {
  color: var(--color-text-primary);
}
.one-brand-state__text {
  max-width: 34em;
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}
.one-brand-state__detail {
  padding: 2px 10px;
  border-left: 3px solid var(--one-brand-gold);
  background: rgba(var(--color-primary-rgb), 0.06);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}
.one-brand-state__actions {
  margin-top: 14px;
}

/* โหลด session ครั้งแรก: เครื่องหมาย K หายใจช้า ๆ บนพื้นฟ้าเทาอ่อนแบบหน้าเข้าสู่ระบบ — ขึ้นหลัง 150 มิลลิวินาที */
.one-brand-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #e2e6ee;
  opacity: 0;
  animation: one-appear 1ms linear 150ms forwards;
}
[data-theme="dark"] .one-brand-splash {
  background: var(--color-bg-app);
}
.one-brand-splash__mark {
  width: 64px;
  height: 64px;
  animation: one-breathe 1.6s ease-in-out 150ms infinite;
}
.one-brand-splash__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-primary);
}
@keyframes one-breathe {
  50% {
    opacity: 0.45;
    transform: scale(0.94);
  }
}

/* แถบหัวหน้าแรก: ภาพอาคารใต้ชั้นน้ำเงินแบรนด์ (เข้มซ้าย จางขวาให้เห็นตัว K บนผนัง) · แถบทองซ้ายแบบกรอบรูปบนเว็บ */
.one-home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin-bottom: 16px;
  padding: 22px 28px;
  color: #fff;
  border-left: 6px solid var(--one-brand-gold);
  background:
    linear-gradient(
      90deg,
      rgba(58, 81, 138, 0.97) 0%,
      rgba(58, 81, 138, 0.9) 45%,
      rgba(58, 81, 138, 0.6) 100%
    ),
    url("/one/brand/kks-building.webp") 86% 42% / cover no-repeat,
    #3a518a;
}
[data-theme="dark"] .one-home-hero {
  background:
    linear-gradient(90deg, rgba(10, 18, 34, 0.96) 0%, rgba(10, 18, 34, 0.7) 100%),
    url("/one/brand/kks-building.webp") 86% 42% / cover no-repeat,
    #0a1222;
}
.one-home-hero__welcome {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.one-home-hero__tagline {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 4px solid var(--one-brand-gold);
  font-size: 13px;
  opacity: 0.92;
}
.one-home-hero__values {
  flex: 0 1 520px;
}

/* หัวส่วน ("งานรอฉัน" · "โมดูล" · หน้า landing ของโมดูล): แบบหัวข้อของเว็บ — พื้นฟ้าเทาอ่อนเรียบ (#e2e6ee)
   จุดทอง 4 จุดนำหน้า ตัวหนังสือน้ำเงิน · เอากองลูกบาศก์และไอคอนออก (components.css เป็นพื้นไล่สี + ภาพสามมิติ) */
.module-head {
  padding: 12px 18px;
  border: 0;
  border-radius: 0;
  background: #e2e6ee;
}
[data-theme="dark"] .module-head {
  background: rgba(var(--color-primary-rgb), 0.12);
}
.module-head-icon {
  display: none;
}
.module-head-text h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-primary);
}
.module-head-text h4::before {
  content: "";
  flex: 0 0 12px;
  height: 12px;
  background: var(--one-four-dots) center / contain no-repeat;
}
[data-theme="dark"] .module-head-text h4 {
  color: var(--color-text-primary);
}
.module-head-count {
  margin-left: 0;
}

/* ตารางข้อมูล: หัวตารางพื้นฟ้าเทาจาง ตัวหนังสือน้ำเงิน (แบบส่วนพื้นอ่อนของเว็บ) ·
   แถวที่เลือกมีขีดทองซ้ายแบบเมนูข้างที่เปิดอยู่ — มีคอลัมน์ตรึงซ้ายให้ขีดอยู่ที่ส่วนตรึง ไม่โผล่กลางแถว */
.ag-theme-quartz .ag-header {
  background-color: #eef1f6;
  color: var(--color-primary);
  border-bottom-color: rgba(58, 81, 138, 0.22);
}
[data-theme="dark"] .ag-theme-quartz .ag-header {
  background-color: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-text-secondary);
}
.ag-theme-quartz .ag-pinned-left-cols-container .ag-row-selected,
.ag-theme-quartz
  .ag-root:not(:has(.ag-pinned-left-cols-container .ag-row))
  .ag-center-cols-container
  .ag-row-selected {
  box-shadow: inset 3px 0 0 var(--one-brand-gold);
}

@media (prefers-reduced-motion: reduce) {
  .one-brand-splash__mark {
    animation: none;
  }
}

/* การ์ดตัวเลขหัวหน้าจอ (StatCards ใน ui/page.tsx): แบบกรอบข้อมูลของเว็บ — พื้นขาว ขอบบาง แถบน้ำเงินซ้าย
   ไอคอนในช่องสี่เหลี่ยมน้ำเงินจางวางซ้าย ตัวเลขน้ำเงินตัวหนา · เอาวงกลมมุมขวาและพื้นเทาไล่สีของ pages.css ออก
   (เจ้าของดูหน้าอุปกรณ์ไอที 2026-12-02 "การ์ดมันดูแตกแยก" — กล่องเทาสูงมีวงกลมจาง ไม่เข้ากับตารางและแถบสีแบรนด์)
   การ์ดที่กดกรองได้และกำลังกรองอยู่ = แถบซ้ายและขอบเป็นสีทอง แบบเมนูที่เปิดอยู่ */
.stat-mini-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 0;
}
.stat-mini-card::after {
  display: none;
}
.stat-mini-card .stat-icon {
  grid-row: 1 / span 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  font-size: 13px;
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.1);
}
/* 18px: ยอดเงินหลักล้านพร้อมทศนิยม (หน้า license ซอฟต์แวร์) ต้องอยู่ในการ์ดแคบได้ — 22px ล้นขอบ (เจ้าของทัก 2026-12-02 "ตัวใหญ่ไป")
   ยังล้นก็ขึ้นบรรทัดใหม่ ไม่ตัดตัวเลขทิ้ง */
.stat-mini-card .stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  color: var(--color-primary);
}
.stat-mini-card .stat-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}
[data-theme="dark"] .stat-mini-card {
  background: var(--color-surface);
}
[data-theme="dark"] .stat-mini-card .stat-value {
  color: var(--color-text-primary);
}
.stat-mini-card.stat-filter:hover {
  border-color: rgba(var(--color-primary-rgb), 0.45);
  border-left-color: var(--color-primary);
}
.stat-mini-card.stat-filter.is-active {
  border-color: var(--one-brand-gold);
  border-left-color: var(--one-brand-gold);
  box-shadow: none;
}
.stat-mini-card.stat-filter.is-active .stat-icon {
  color: #242022;
  background: var(--one-brand-gold);
}

/* เมนูผู้ใช้ (มุมขวาบน): หัวเมนูแถบน้ำเงินมีรูป ชื่อ ชื่อผู้ใช้ และบริษัท เส้นทองใต้แบบแถบบน ·
   ชี้รายการแล้วมีขีดทองซ้ายแบบเมนูข้าง (เจ้าของทัก 2026-12-02 "เรียบเกินไปไหม" — เดิมเป็นรายการล้วนไม่บอกว่าเป็นของใคร) */
.one-user-menu {
  padding-top: 0;
  overflow-x: hidden;
}
.one-user-menu__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 12px 14px;
  color: #fff;
  background: #3a518a;
  box-shadow: inset 0 -3px 0 var(--one-brand-gold);
}
[data-theme="dark"] .one-user-menu__head {
  background: #1d2a48;
}
.one-user-menu__avatar {
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 2px solid var(--one-brand-gold);
  border-radius: 50%;
  font-weight: 700;
  color: #242022;
  background: var(--one-brand-gold);
}
.one-user-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.one-user-menu__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.one-user-menu__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.one-user-menu__sub {
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.8;
}
.one-user-menu .dropdown-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-primary);
}
[data-theme="dark"] .one-user-menu .dropdown-header {
  color: var(--color-text-secondary);
}
.one-user-menu .dropdown-item:hover,
.one-user-menu .dropdown-item:focus-visible {
  box-shadow: inset 3px 0 0 var(--one-brand-gold);
}

/* ===== รอบที่ 3 ของแบรนด์ (เจ้าของเลือก "1+2+4+5" 2026-12-02): แถบข้าง · ป้ายสถานะ · ตารางว่าง · แถบล่าง ===== */

/* แถบข้าง: ไอคอนเมนูสีน้ำเงินเดียวทั้งแถบ (เดิมเทาจาง) · หัวกลุ่มตัวหนังสือน้ำเงิน ไอคอนหัวกลุ่มสีทอง ·
   "รายการโปรด" เลิกพื้นส้มอ่อน/ตัวหนังสือส้มของ components.css (#f59e0b ไม่ใช่สีแบรนด์) — ดาวเป็นทองแบรนด์ */
.sb-item i,
.sb-item svg {
  color: var(--color-primary);
}
.sb-header,
.sb-favorites .sb-header {
  color: var(--color-primary);
}
.sb-header > i:first-child {
  color: var(--one-brand-gold);
}
[data-theme="dark"] .sb-item i,
[data-theme="dark"] .sb-header,
[data-theme="dark"] .sb-favorites .sb-header {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .sb-header > i:first-child {
  color: var(--one-brand-gold);
}
.sb-favorites,
[data-theme="dark"] .sb-favorites {
  background: transparent;
}
.sb-fav-btn.is-favorite,
.sb-favorites .sb-fav-btn {
  color: var(--one-brand-gold);
}
/* เมนูที่เปิดอยู่: พื้นน้ำเงินจาง + ขีดทองซ้าย (กฎขีดทองอยู่ข้างบน) · มุมเหลี่ยมแบบเว็บ */
.sb-item {
  border-radius: 0;
}

/* ป้ายสถานะ (ใช้งาน · สำรอง · อนุมัติ ฯลฯ): จากแคปซูลมนเป็นป้ายเหลี่ยมแบบป้ายบนเว็บ + ขีดซ้ายสีเข้มของกลุ่มสีเดียวกัน
   สีพื้น/ตัวหนังสือยังมาจาก --pill-* ตามกติกาสถานะ (UI_UX_RULES §5) — เปลี่ยนแค่ทรง · ป้ายนับตัวเลข (ไม่มี .badge-mark) ไม่โดน */
.badge:has(> .badge-mark):not([style*="background"]) {
  border-radius: 2px;
  box-shadow: inset 2px 0 0 currentColor;
  padding: 0.3em 0.6em 0.3em 0.7em;
}

/* ตารางว่าง (overlayNoRowsTemplate ใน ui/data-grid.tsx): เครื่องหมาย K จางเหนือข้อความ */
.one-grid-empty {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.one-grid-empty__mark {
  width: 40px;
  height: 40px;
  opacity: 0.25;
}
[data-theme="dark"] .one-grid-empty__mark {
  content: url("/one/brand/kks-mark-on-dark.svg");
}

/* แถบล่าง: ขีดทองด้านบนแบบเส้นใต้แถบบน (ปิดหัวท้ายหน้าจอด้วยเส้นเดียวกัน) · ชื่อบริษัทที่กำลังใช้ชิดขวา */
.status-bar {
  border-top: 2px solid var(--one-brand-gold) !important;
}
.one-status-bar__company {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
}
[data-theme="dark"] .one-status-bar__company {
  color: var(--color-text-secondary);
}

/* ===== รอบที่ 4 ของแบรนด์ (เจ้าของเลือก "1-10" 2026-12-02) ===== */

/* (1) ตัวนับเหนือตาราง "ใช้งาน: 582 · ปิดใช้งาน: 0" (CommandBar stats ใน ui/page.tsx): เดิมเป็นเม็ดทึบสีเข้มดูเหมือนปุ่ม
   ทั้งที่กดไม่ได้ → ตัวหนังสือบนพื้นเรียบ มีขีดสีซ้าย (น้ำเงิน = ใช้งาน · เทา = ปิดใช้งาน) แบบป้ายข้อมูล ไม่ใช่ปุ่ม */
.one-command-stats .badge {
  padding: 2px 10px 2px 8px;
  border-left: 3px solid var(--color-border-medium);
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent !important;
}
.one-command-stats .badge.bg-primary {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
}
[data-theme="dark"] .one-command-stats .badge.bg-primary {
  border-left-color: var(--one-brand-gold);
  color: var(--color-text-primary);
}

/* (3) หน้าเข้าสู่ระบบ: ข้อมูลบริษัทใต้คำโปรย — ตัวเล็ก เว้นช่องไฟ แบบบรรทัดรองบนเว็บ */
.one-signin__facts {
  margin-top: 12px;
  padding-left: 19px;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* (5) กล่องแจ้งเตือนมุมจอ (notify.ts · SweetAlert2 toast): มุมเหลี่ยม พื้นขาวทึบ แถบสีซ้ายตามผล
   (เขียว = สำเร็จ · แดง = ผิดพลาด) แบบการ์ดตัวเลข — เดิมมุมโค้ง 14px พื้นโปร่งเบลอ */
.swal2-toast.wachi-toast {
  border-radius: 2px !important;
  border-left: 4px solid var(--color-primary) !important;
  background: var(--color-bg-white, #fff) !important;
  backdrop-filter: none;
}
.swal2-toast.wachi-toast.swal2-icon-success {
  border-left-color: #146c43 !important;
}
.swal2-toast.wachi-toast.swal2-icon-error {
  border-left-color: #b42318 !important;
}
.swal2-toast.wachi-toast .swal2-timer-progress-bar {
  border-radius: 0;
  background: var(--one-brand-gold);
}
[data-theme="dark"] .swal2-toast.wachi-toast {
  background: var(--color-surface) !important;
}

/* (7) หัวแผงแก้ไขที่เลื่อนออกด้านขวา (ui/offcanvas.tsx) และหัวกล่อง modal: แถบน้ำเงินแบรนด์ ตัวหนังสือขาว เส้นทองใต้
   แบบหัวเมนูผู้ใช้/แถบบน · ปุ่มปิด (×) เป็นสีขาว */
.offcanvas .offcanvas-header,
.modal .modal-header {
  color: #fff;
  background: #3a518a;
  border-bottom: 0;
  box-shadow: inset 0 -3px 0 var(--one-brand-gold);
}
[data-theme="dark"] .offcanvas .offcanvas-header,
[data-theme="dark"] .modal .modal-header {
  background: #1d2a48;
}
.offcanvas .offcanvas-header .offcanvas-title,
.modal .modal-header .modal-title {
  color: #fff;
}
.offcanvas .offcanvas-header .btn-close,
.modal .modal-header .btn-close {
  filter: invert(1) grayscale(1) brightness(2);
  opacity: 0.85;
}
.offcanvas .offcanvas-header .btn-close:hover,
.modal .modal-header .btn-close:hover {
  opacity: 1;
}

/* (8) ปุ่มบนแถวหัวหน้า (TitleButton = btn-outline-secondary): ขอบน้ำเงินบาง ตัวหนังสือน้ำเงินแบบปุ่มรองของเว็บ ·
   ปุ่มที่กดไม่ได้ เดิม Bootstrap จาง 65% จนอ่านไม่ออก → ทึบ อ่านได้ แต่พื้นเทาอ่อน ขอบประ ตัวหนังสือเทา ให้รู้ว่ากดไม่ได้ */
.btn-outline-secondary {
  color: var(--color-primary);
  background: var(--color-bg-white, #fff);
  border-color: rgba(var(--color-primary-rgb), 0.35);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.08);
  border-color: var(--color-primary);
}
[data-theme="dark"] .btn-outline-secondary {
  color: var(--color-text-primary);
  background: transparent;
  border-color: rgba(var(--color-primary-rgb), 0.55);
}
[data-theme="dark"] .btn-outline-secondary:hover {
  color: #fff;
}
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
  opacity: 1;
  color: var(--color-text-muted);
  background: var(--color-bg-header);
  border-color: var(--color-border-medium);
  border-style: dashed;
}
.cmd-btn:disabled {
  opacity: 1;
  color: var(--color-text-muted);
}

/* (9) แท็บเมนูย่อยของโมดูล (.tab-bar): ไอคอนน้ำเงินจางให้ตัวหนังสือเด่นกว่า · แท็บที่เปิดอยู่ไอคอนน้ำเงินเต็ม ขีดทองหนา 3px */
.tab-item i {
  color: rgba(var(--color-primary-rgb), 0.55);
}
.tab-item.active i {
  color: var(--color-primary);
}
.tab-item.active {
  border-bottom-width: 3px;
}
[data-theme="dark"] .tab-item i {
  color: var(--color-text-muted);
}
[data-theme="dark"] .tab-item.active i {
  color: var(--one-brand-gold);
}

/* (10) ช่องกรอก/ช่องเลือกที่กำลังกรอก: ขอบน้ำเงิน + เงาเรืองทองรอบช่อง ให้เห็นชัดว่าอยู่ช่องไหนตอนกด Tab
   (ขอบน้ำเงินให้ความต่างสีพอบนพื้นขาว — ทองอย่างเดียวต่างจากขาวแค่ 1.9:1 มองไม่ชัด) */
.form-control:not(.form-underline):focus,
.form-select:focus {
  border-color: var(--color-primary);
  border-bottom-color: var(--one-brand-gold);
  box-shadow: 0 0 0 3px rgba(244, 183, 25, 0.4);
}
.ts-wrapper.form-select.focus .ts-control {
  border-color: var(--color-primary) !important;
  border-bottom-color: var(--one-brand-gold) !important;
  box-shadow: 0 0 0 3px rgba(244, 183, 25, 0.4) !important;
}

/* (2) เอกสารพิมพ์ (.one-print-sheet ที่เป็นแผ่นเอกสารขาว — ไม่รวมแผ่นป้ายสติกเกอร์): แถบน้ำเงินบนหัวกระดาษ + เส้นทองใต้
   แบบแถบบนของระบบ ทั้งบนจอและบนกระดาษ (print-color-adjust ให้เครื่องพิมพ์พิมพ์สีพื้น) */
.one-print-sheet.bg-white {
  border-top: 6px solid #3a518a !important;
  box-shadow: inset 0 2px 0 var(--one-brand-gold);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
@media print {
  .one-print-sheet.bg-white {
    border-top: 6px solid #3a518a !important;
    padding-top: 10px !important;
  }
}
