/* เส้นตารางรอบทุกช่องของทุกตารางในหน้าทำงาน + ที่จับปรับความกว้าง/ย้ายคอลัมน์ (ชุดเสริมสำหรับตารางที่ระบบตารางหลักไม่ครอบคลุม)
   ปิดเฉพาะตารางด้วย class "no-grid-lines" หรือ data-table-lite="off" · สีเส้นใช้ค่าเทาของ table-neutral (--tn-line) */
@media (min-width: 761px) {
  html body .main table:not(.no-grid-lines):not(.fg-table):not(.dataTable) > :is(thead, tbody, tfoot) > tr > :is(th, td) { border-right: 1px solid var(--tn-line, #d9d9d9); border-bottom: 1px solid var(--tn-line, #d9d9d9); }
  html body .main table:not(.no-grid-lines):not(.fg-table):not(.dataTable) > :is(thead, tbody, tfoot) > tr > :is(th, td):last-child { border-right: 0; }
  html body .main table:not(.no-grid-lines):not(.fg-table):not(.dataTable) > thead > tr > th { border-right-color: var(--tn-headline, #cfcfcf); }
  html body .main table:not(.no-grid-lines):not(.fg-table):not(.dataTable) > tbody:last-of-type > tr:last-child > :is(th, td), html body .main table:not(.no-grid-lines):not(.fg-table):not(.dataTable):not(:has(> tbody)) > tr:last-child > :is(th, td) { border-bottom-width: 0; }
  /* กรอบนอก เมื่อตารางไม่มีกล่องห่อที่มีกรอบอยู่แล้ว */
  html body .main :not(.table-wrap, .fg-scroll, .dt-scroll, .dt-layout-table, .rm-scroll, .fg) > table:not(.no-grid-lines):not(.fg-table):not(.dataTable):has(> thead) { border: 1px solid var(--tn-line, #d9d9d9); border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
  html body .main :is(.table-wrap, .rm-scroll, .fg-scroll) { border: 1px solid var(--tn-line, #d9d9d9); border-radius: 10px; }
  /* ตารางสิทธิ์ (Role / Permission): แถวโมดูลมีเส้นแบ่งหนักกว่าแถวเมนูย่อย */
  html body .rm-table .rm-modrow > :is(th, td) { border-top: 1px solid var(--tn-headline, #cfcfcf); }
}

.ftl-th .ftl-wrap { position: relative; }
.ftl-rz { position: absolute; right: -4px; width: 9px; cursor: col-resize; z-index: 5; touch-action: none; }
.ftl-rz::after { content: ""; position: absolute; top: 18%; bottom: 18%; left: 4px; width: 2px; border-radius: 2px; background: transparent; transition: background .12s; }
.ftl-th:hover > .ftl-wrap > .ftl-rz::after, .ftl-rz:hover::after, .ftl-rz:focus-visible::after, .ftl-resizing .ftl-rz::after { background: var(--fleet-primary, #6e5de7); }
.ftl-rz:focus-visible { outline: 2px solid var(--fleet-primary, #6e5de7); outline-offset: -2px; border-radius: 3px; }
table.ftl-resizing { cursor: col-resize; user-select: none; }
.ftl-th[draggable="true"] { cursor: grab; }
.ftl-th.ftl-dragging { opacity: .45; }
.ftl-th.ftl-drop-before { box-shadow: inset 3px 0 0 var(--fleet-primary, #6e5de7); }
.ftl-th.ftl-drop-after { box-shadow: inset -3px 0 0 var(--fleet-primary, #6e5de7); }
@media (max-width: 760px) { .ftl-rz { display: none; } }
@media print { .ftl-rz { display: none; } html body .main table { border-color: #999; } }
