/* ==========================================================================
   bo_theme.css — UI หน้ารายงาน backoffice / branch (Demo4 · 02/11/2026)
   ต้นแบบจาก Thaiway 221 (assets/css/app/bo_theme.css) ปรับตาม mockup: หัวตารางสีหลักของระบบ,
   ปุ่ม Excel เขียว / PDF แดง, ไอคอนจัดการกล่องสีอ่อน, pagination ก่อนหน้า/ถัดไป
   โหลดจาก function/app_nav_head.php (เฉพาะ backoffice/branch — member ไม่โดน)
   markup: class.datatable.php showdata() (.bo-table-card) · data_ajax.php (.bo-act) · rpdialog.php (.bo-filter)
   ========================================================================== */

:root {
	--bo-primary: var(--ui-pri, var(--twn-primary, #2B6A94));
	--bo-primary-dark: color-mix(in srgb, var(--bo-primary) 78%, #000);
	--bo-primary-soft: color-mix(in srgb, var(--bo-primary) 10%, #fff);
	--bo-success: #1e8e3e;
	--bo-success-dark: #17733a;
	--bo-success-soft: #e6f4ea;
	--bo-danger: #d93025;
	--bo-danger-dark: #b3261e;
	--bo-danger-soft: #fdecea;
	--bo-warning: #e8710a;
	--bo-warning-soft: #fef1e1;
	--bo-info: #1a73e8;
	--bo-info-soft: #e8f0fe;
	--bo-text: var(--ui-text, #1F2A37);
	--bo-text-muted: var(--ui-muted, #64748B);
	--bo-border: var(--ui-line, #E2E8F0);
	--bo-border-soft: var(--ui-line-soft, #EEF2F6);
	--bo-row-hover: color-mix(in srgb, var(--bo-primary) 4%, #fff);
	--bo-radius: 14px;
	--bo-radius-sm: 9px;
	--bo-shadow: 0 1px 2px rgba(15, 30, 50, .04), 0 4px 14px rgba(15, 30, 50, .05);
	--bo-ctrl-h: 40px;
	--bo-page-bg: var(--ui-page, #F4F7FB);
}

/* ---------- พื้นหลัง Content ---------- */
body.fix-header,
#page-wrapper { background-color: var(--bo-page-bg); }

/* ---------- หัวหน้า (legend > h3.page-title) : ตัวหนาใหญ่ ไม่มีไอคอน/คำอธิบาย ---------- */
#page-wrapper legend {
	border: 0;
	margin: 22px 0 18px;
	padding: 0;
	width: 100%;
}
#page-wrapper legend .page-title {
	margin: 0;
	font-size: 26px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--bo-text);
	text-transform: none;
}

/* ---------- Card ---------- */
.bo-card {
	background: #fff;
	border: 1px solid var(--bo-border);
	border-radius: var(--bo-radius);
	box-shadow: var(--bo-shadow);
	margin-bottom: 20px;
}

/* ==========================================================================
   กล่องค้นหา — rpdialog.php (.bo-filter)
   ========================================================================== */
.bo-filter { margin-bottom: 20px; }
.bo-filter > .card { margin-bottom: 0; } /* (12/11/2026) panel→card : เดิม .panel-group .panel ไม่มีระยะล่าง */
/* (12/11/2026) ค่าที่เดิมได้จากกฎธีม .panel-heading / .panel-title (style.php) — คงหน้าตาเดิมหลังเปลี่ยนเป็น card */
#accordion.bo-filter .card .card-title { font-size: 16px; }
#accordion.bo-filter .card .card-title > a.accordion-toggle { position: relative; }
#accordion.bo-filter .card .card-title > a.accordion-toggle::before { width: 25px; text-align: right; }
.bo-filter + hr { display: none; }
.bo-filter .card {
	background: #fff;
	border: 1px solid var(--bo-border) !important;
	border-radius: var(--bo-radius) !important;
	box-shadow: var(--bo-shadow);
	overflow: visible;
	padding: 10px;
}
#accordion.bo-filter .card .card-header {
	padding: 0;
	background: var(--bo-primary-soft) !important;
	border: 0;
	border-radius: var(--bo-radius-sm) !important;
}
.bo-filter .card-title { font-size: inherit; }
#accordion.bo-filter .card .card-title > a.accordion-toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 13px 16px;
	font-size: 18px;
	font-weight: 700;
	color: var(--bo-text) !important;
	text-decoration: none;
	text-transform: none;
	background: transparent;
}
#accordion.bo-filter .card .card-title > a.accordion-toggle > i { display: none; }
#accordion.bo-filter .card .card-title > a.accordion-toggle::before {
	content: "\f002";
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 19px;
	color: var(--bo-primary);
}
#accordion.bo-filter .card .card-title > a.accordion-toggle::after {
	content: "\f077";
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 15px;
	color: var(--bo-text);
	margin-left: auto;
	transition: transform .2s ease;
}
#accordion.bo-filter .card .card-title > a.accordion-toggle.collapsed::after,
#accordion.bo-filter .card .card-title > a.accordion-toggle[aria-expanded="false"]::after { transform: rotate(180deg); }
#accordion.bo-filter .card .card-title > a.accordion-toggle:hover { color: var(--bo-primary-dark) !important; }
/* ซ่อนไอคอนลูกศรเดิมของ theme ทางขวา (ถ้ามี) */
.bo-filter .card-header .pull-right,
.bo-filter .card-header .panel-action { display: none !important; }

.bo-filter .collapse > .card-body {
	padding: 16px 8px 0;
	border-top: 0 !important;
}
.bo-filter .card-body > form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	margin: 0 -8px;
}
.bo-filter .card-body > form > div[class*="col-"] {
	float: none;
	height: auto !important;
	min-height: 0 !important;
	padding: 0 8px;
	margin-bottom: 16px;
}
.bo-filter h5.header {
	margin: 0 0 6px;
	padding: 0;
	border: 0;
	font-size: 14px;
	font-weight: 600;
	color: #334155;
	line-height: 1.4;
}
.bo-filter .form-control {
	height: var(--bo-ctrl-h);
	padding: 8px 12px;
	border: 1px solid var(--bo-border);
	border-radius: var(--bo-radius-sm);
	box-shadow: none;
	font-size: 14px;
	color: var(--bo-text);
	background-color: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.bo-filter .form-control:focus {
	border-color: var(--bo-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bo-primary) 18%, transparent);
	outline: 0;
}
.bo-filter .form-control::placeholder { color: #9aa5b1; }
.bo-filter .select2-container { width: 100% !important; } /* select2 แบบหลายตัวเลือกได้ style width:100px จาก JS → เต็มช่องเหมือนช่องอื่น */
.bo-filter .select2-container .select2-selection { min-height: var(--bo-ctrl-h); border-color: var(--bo-border); border-radius: var(--bo-radius-sm); }

.bo-filter .input-group[class*="col-"] { padding: 0; float: none; width: 100%; }
.bo-filter .input-group .input-group-addon,
.bo-filter .input-group .input-group-text {
	background: #f6f8fb;
	border-color: var(--bo-border);
	color: var(--bo-text-muted);
	font-size: 13px;
	padding: 6px 10px;
}
.bo-filter .input-group .form-control { border-radius: 0; }
.bo-filter .input-group > :first-child { border-radius: var(--bo-radius-sm) 0 0 var(--bo-radius-sm) !important; }
.bo-filter .input-group > :last-child  { border-radius: 0 var(--bo-radius-sm) var(--bo-radius-sm) 0 !important; }

/* ปุ่มค้นหา */
.bo-filter button[type="submit"],
.bo-filter .btn-round.btn-block {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: var(--bo-ctrl-h);
	border: 1px solid var(--bo-primary) !important;
	border-radius: var(--ui-btn-r, 10px) !important;
	background: var(--bo-primary) !important;
	color: #fff !important;
	font-size: var(--ui-btn-fs, 14px);
	font-weight: 600;
	box-shadow: none !important;
	text-shadow: none;
}
.bo-filter button[type="submit"]:hover,
.bo-filter .btn-round.btn-block:hover {
	background: var(--bo-primary-dark) !important;
	border-color: var(--bo-primary-dark) !important;
}
.bo-filter button[type="submit"] .fa,
.bo-filter button[type="submit"] .ace-icon { color: #fff !important; }
.bo-filter input[type="checkbox"] { accent-color: var(--bo-primary); }

/* ==========================================================================
   ตาราง — class.datatable.php showdata()
   ========================================================================== */
.bo-table-card { overflow: hidden; padding: 0; }
.bo-table-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 16px;
}
.bo-table-actions:empty { display: none; }
.bo-table-actions .dt-buttons {
	float: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}
.bo-table-info {
	float: none !important;
	margin-left: auto;
	padding: 0 !important;
}
.bo-table-info .dataTables_info {
	float: none;
	padding: 0 !important;
	font-size: 14px;
	color: var(--bo-text-muted);
}

/* ปุ่มแถบบน (Excel / PDF / CSV / ปุ่มพิเศษ) */
.bo-table-card .dt-buttons .dt-button.bo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: var(--ui-btn-h, 40px);
	margin: 0;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: var(--ui-btn-r, 10px);
	background-image: none !important;
	box-shadow: none;
	font-size: var(--ui-btn-fs, 14px);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.bo-table-card .dt-buttons .dt-button.bo-btn:active { transform: translateY(1px); }
.bo-table-card .dt-buttons .dt-button.bo-btn::before {
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 18px;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-excel::before { content: "\f1c3"; }
.bo-table-card .dt-buttons .dt-button.bo-btn-pdf::before   { content: "\f1c1"; }
.bo-table-card .dt-buttons .dt-button.bo-btn-csv::before   { content: "\f6dd"; }
.bo-table-card .dt-buttons .dt-button.bo-btn-excel,
.bo-table-card .dt-buttons .dt-button.bo-btn-csv {
	background-color: var(--bo-success) !important;
	border-color: var(--bo-success) !important;
	color: #fff !important;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-excel:hover:not(.disabled),
.bo-table-card .dt-buttons .dt-button.bo-btn-csv:hover:not(.disabled) {
	background-color: var(--bo-success-dark) !important;
	border-color: var(--bo-success-dark) !important;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-pdf {
	background-color: var(--bo-danger) !important;
	border-color: var(--bo-danger) !important;
	color: #fff !important;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-pdf:hover:not(.disabled) {
	background-color: var(--bo-danger-dark) !important;
	border-color: var(--bo-danger-dark) !important;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-secondary {
	background-color: #fff !important;
	border-color: var(--bo-border) !important;
	color: var(--bo-text) !important;
}
.bo-table-card .dt-buttons .dt-button.bo-btn-secondary:hover:not(.disabled) {
	border-color: var(--bo-primary) !important;
	color: var(--bo-primary-dark) !important;
	background-color: var(--bo-primary-soft) !important;
}
.bo-table-card .dt-button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--bo-primary) 30%, transparent);
	outline-offset: 1px;
}

.bo-table-card .table-scroll.bo-table-wrapper { width: auto; margin: 0 16px; border-radius: var(--bo-radius-sm); } /* width:auto — branch มี .table-scroll{width:100%} inline ทำให้ตารางล้นการ์ดเท่า margin */
.bo-table-wrapper > .dataTables_wrapper { min-height: 0; }

table.dataTable.bo-table {
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
	font-size: 14.5px;
	color: var(--bo-text);
}
/* หัวตาราง : สีหลักของระบบ ตัวขาว */
table.dataTable.bo-table thead th {
	background: var(--bo-primary) !important;
	color: #fff !important;
	font-weight: 600;
	font-size: 14.5px;
	padding: 14px 26px 14px 12px !important;
	border: 0 !important;
	vertical-align: middle;
	white-space: nowrap;
	text-align: center;
}
table.dataTable.bo-table thead tr th:first-child { border-top-left-radius: var(--bo-radius-sm); }
table.dataTable.bo-table thead tr th:last-child  { border-top-right-radius: var(--bo-radius-sm); }
table.dataTable.bo-table thead th.sorting_disabled,
table.dataTable.bo-table thead th:not([class*="sorting"]) { padding-right: 12px !important; }
/* ไอคอนเรียงของ DataTables (jQueryUI) บนพื้นสี → ขาว */
table.dataTable.bo-table thead th span.DataTables_sort_icon,
table.dataTable.bo-table thead th .ui-icon { filter: brightness(0) invert(1); opacity: .75; }
/* ลิงก์/ตัวอักษรบนหัวตาราง (เช่น "ลบ" ที่เดิมเป็นสีแดง) → ขาว ตัวหนา */
table.dataTable.bo-table thead th a,
table.dataTable.bo-table thead th a *,
table.dataTable.bo-table thead th font { color: #fff !important; font-weight: 700 !important; }
table.dataTable.bo-table thead th input[type="checkbox"] { accent-color: #fff; }

table.dataTable.bo-table tbody td {
	padding: 12px !important;
	border-top: 0 !important;
	border-bottom: 1px solid var(--bo-border-soft);
	vertical-align: middle;
	background-color: #fff;
}
table.dataTable.bo-table.display tbody tr.odd,
table.dataTable.bo-table.display tbody tr.even,
table.dataTable.bo-table.display tbody tr > .sorting_1,
table.dataTable.bo-table.display tbody tr > .sorting_2,
table.dataTable.bo-table.display tbody tr > .sorting_3 { background-color: #fff; }
table.dataTable.bo-table.display tbody tr:hover > td { background-color: var(--bo-row-hover); }

table.dataTable.bo-table tbody td.dataTables_empty,
table.dataTable.bo-table.display tbody tr:hover > td.dataTables_empty {
	padding: 22px 12px !important;
	background-color: var(--ui-bg-soft, #F8FAFC) !important;
	color: var(--bo-text-muted);
	font-weight: 600;
	text-align: center;
}

table.dataTable.bo-table tfoot th,
table.dataTable.bo-table tfoot td {
	padding: 12px !important;
	border-top: 1px solid var(--bo-border) !important;
	background-color: #fff;
	font-weight: 700;
}
table.dataTable.bo-table tfoot tr:empty,
table.dataTable.bo-table tfoot th:empty { padding: 0 !important; border-top: 0 !important; }

/* ลิงก์ในตาราง (เช่นรหัสสมาชิก) */
table.dataTable.bo-table tbody a:not(.bo-act) {
	color: var(--bo-info);
	font-weight: 600;
	text-decoration: none;
}
table.dataTable.bo-table tbody a:not(.bo-act):hover { text-decoration: underline; }

table.dataTable.bo-table tbody font[color="red"],
table.dataTable.bo-table tbody .text-danger { color: var(--bo-danger) !important; font-weight: 700; }
table.dataTable.bo-table tbody .text-success { color: var(--bo-success) !important; font-weight: 700; }

table.dataTable.bo-table input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	vertical-align: middle;
	accent-color: var(--bo-primary);
	cursor: pointer;
}

/* ปุ่มไอคอนจัดการ (data_ajax.php) : กล่องสีอ่อน */
.bo-act {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: var(--bo-radius-sm);
	background: var(--bo-info-soft);
	color: var(--bo-info) !important;
	font-size: 16px;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.bo-act:hover { background: var(--bo-info); color: #fff !important; }
.bo-act:active { transform: scale(.94); }
.bo-act-edit    { background: var(--bo-warning-soft); color: var(--bo-warning) !important; }
.bo-act-edit:hover    { background: var(--bo-warning); color: #fff !important; }
.bo-act-success { background: var(--bo-success-soft); color: var(--bo-success) !important; }
.bo-act-success:hover { background: var(--bo-success); color: #fff !important; }
.bo-act-warning { background: var(--bo-warning-soft); color: var(--bo-warning) !important; }
.bo-act-warning:hover { background: var(--bo-warning); color: #fff !important; }
.bo-act-danger  { background: var(--bo-danger-soft); color: var(--bo-danger) !important; }
.bo-act-danger:hover  { background: var(--bo-danger); color: #fff !important; }

/* ---------- Pagination (.bo-table-footer ใต้ตาราง) ---------- */
.bo-table-footer {
	display: flex;
	justify-content: flex-end;
	padding: 16px;
}
.bo-table-footer:empty { display: none; }
.bo-table-footer .dataTables_paginate {
	float: none !important;
	position: static !important;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 0 !important;
	margin: 0;
	text-align: right;
	opacity: 1 !important;
}
.bo-table-footer .dataTables_paginate > span { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.bo-table-footer .dataTables_paginate a,
.bo-table-footer .dataTables_paginate .paginate_button,
.bo-table-footer .dataTables_paginate .fg-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 42px;
	height: 42px;
	margin: 0 !important;
	padding: 0 14px !important;
	border: 1px solid var(--bo-border) !important;
	border-radius: var(--bo-radius-sm) !important;
	background: #fff !important;
	color: var(--bo-text) !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	box-shadow: none !important;
	cursor: pointer;
}
.bo-table-footer .dataTables_paginate a:hover {
	border-color: var(--bo-primary) !important;
	background: var(--bo-primary-soft) !important;
	color: var(--bo-primary-dark) !important;
}
.bo-table-footer .dataTables_paginate .paginate_button.current,
.bo-table-footer .dataTables_paginate .paginate_button.current:hover,
.bo-table-footer .dataTables_paginate > span > a.ui-state-disabled {
	background: var(--bo-primary) !important;
	border-color: var(--bo-primary) !important;
	color: #fff !important;
	cursor: default;
}
/* ก่อนหน้า / ถัดไป : ข้อความเดิม + ลูกศร */
.bo-table-footer .dataTables_paginate a[id$="_previous"]::before,
.bo-table-footer .dataTables_paginate a[id$="_first"]::before,
.bo-table-footer .dataTables_paginate a[id$="_next"]::after,
.bo-table-footer .dataTables_paginate a[id$="_last"]::after {
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 12px;
}
.bo-table-footer .dataTables_paginate a[id$="_previous"]::before { content: "\f053"; }
.bo-table-footer .dataTables_paginate a[id$="_first"]::before    { content: "\f100"; }
.bo-table-footer .dataTables_paginate a[id$="_next"]::after      { content: "\f054"; }
.bo-table-footer .dataTables_paginate a[id$="_last"]::after      { content: "\f101"; }
.bo-table-footer .dataTables_paginate a.disabled,
.bo-table-footer .dataTables_paginate a[id$="_previous"].ui-state-disabled,
.bo-table-footer .dataTables_paginate a[id$="_next"].ui-state-disabled,
.bo-table-footer .dataTables_paginate a[id$="_first"].ui-state-disabled,
.bo-table-footer .dataTables_paginate a[id$="_last"].ui-state-disabled {
	opacity: .5;
	cursor: default;
	background: #fff !important;
	border-color: var(--bo-border) !important;
	color: var(--bo-text) !important;
}
.bo-table-footer .dataTables_paginate .ellipsis {
	display: inline-flex;
	align-items: flex-end;
	padding: 0 4px;
	color: var(--bo-text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	#page-wrapper legend { margin-top: 16px; }
	#page-wrapper legend .page-title { font-size: 21px; }
	#accordion.bo-filter .card .card-title > a.accordion-toggle { padding: 12px 14px; font-size: 16px; }
	.bo-table-toolbar { padding: 12px; }
	.bo-table-info { margin-left: 0; width: 100%; }
	.bo-table-card .dt-buttons .dt-button.bo-btn { padding: 0 14px; font-size: 14px; height: 38px; }
	.bo-table-card .table-scroll.bo-table-wrapper { margin: 0 12px; }
	.bo-table-footer { justify-content: center; padding: 12px; }
}

/* ---------- มุมโค้ง block ทั่วไป ---------- */
.white-box,
.panel,
.bo-filter > .card,
.modal-content { border-radius: var(--bo-radius) !important; }
.dropdown-menu { border-radius: var(--bo-radius-sm); }
.datepicker.datepicker-dropdown { z-index: 1060 !important; }

/* (02/11/2026) theme .accordion-style1 ใส่ display/font/::before ของตัวเองแบบเจาะจงกว่า → บังคับ */
#accordion.bo-filter .card .card-title > a.accordion-toggle { display: flex !important; font-size: 18px !important; font-weight: 700 !important; font-family: inherit; line-height: 1.3 !important; }
#accordion.bo-filter .card .card-title > a.accordion-toggle::before { font-family: "Font Awesome 5 Free" !important; content: "\f002" !important; position: static !important; display: inline-block !important; }
#accordion.bo-filter .card .card-title > a.accordion-toggle::after { position: static !important; display: inline-block !important; }
/* pagination : หน้าปัจจุบัน (theme ใช้ a.btn.btn-info.disabled) */
.bo-table-footer .dataTables_paginate > span > a.btn-info,
.bo-table-footer .dataTables_paginate > span > a.btn-info:hover {
	background: var(--bo-primary) !important;
	border-color: var(--bo-primary) !important;
	color: #fff !important;
	opacity: 1 !important;
	cursor: default;
}
/* ลูกศรกล่องค้นหา : ปิด = ชี้ลง · เปิด = ชี้ขึ้น (ดูจาก .collapse.in) */
#accordion.bo-filter .card .card-title > a.accordion-toggle::after { transform: rotate(180deg); }
#accordion.bo-filter .card:has(.collapse.in) .card-title > a.accordion-toggle::after { transform: none; }
#accordion.bo-filter .card:has(.collapse.show) .card-title > a.accordion-toggle::after{ transform: none; }

/* (02/11/2026) หัวตาราง : ผู้ใช้สั่ง fix สีเทา #f0f0f0 ไปก่อน (ไม่ใช้สี Sup Header) — ลบบล็อกนี้ถ้าจะกลับไปใช้สีตาม config */
table.dataTable.bo-table thead th {
	background: #f0f0f0 !important;
	color: #2f3a45 !important;
	border-bottom: 1px solid var(--bo-border) !important;
}
table.dataTable.bo-table thead th span.DataTables_sort_icon,
table.dataTable.bo-table thead th .ui-icon { filter: none; opacity: 1; }
table.dataTable.bo-table thead th a,
table.dataTable.bo-table thead th a *,
table.dataTable.bo-table thead th font { color: var(--bo-danger) !important; font-weight: 700 !important; }
table.dataTable.bo-table thead th input[type="checkbox"] { accent-color: var(--bo-primary); }

/* แถว "ไม่พบข้อมูล" ตารางรายงาน : กล่องเส้นประ + ไอคอน โทนแดงอ่อน (ผู้ใช้เลือก 05/11/2026) */
table.dataTable.bo-table tbody td.dataTables_empty,
table.dataTable.bo-table.display tbody tr:hover > td.dataTables_empty {
	padding: 26px 12px 30px !important;
	background-color: var(--ui-danger-bg, #FEF2F2) !important;
	color: var(--ui-danger-text, #B91C1C) !important;
	font-size: 14px;
	font-weight: 600;
	outline: 1.5px dashed var(--ui-danger-line, #FCA5A5) !important;
	outline-offset: -10px;
}
table.dataTable.bo-table tbody td.dataTables_empty::before {
	content: "\f002"; display: block; margin: 4px auto 8px;
	font: 900 24px/1 "Font Awesome 5 Free"; color: var(--ui-danger-icon, #F87171);
}

/* ---------- (03/11/2026) ปุ่ม "เพิ่ม..." ข้างชื่อรายงาน (legend .btn-color-main) : สีหลัก มุมมน ไอคอนในกล่องโปร่ง ---------- */
#page-wrapper legend .page-title > a,
#page-wrapper legend > a { text-decoration: none !important; }
#page-wrapper legend .btn-color-main {
	display: inline-flex; align-items: center; gap: 4px;
	height: var(--ui-btn-h, 40px); margin-left: 8px; padding: 0 16px 0 6px;
	vertical-align: middle;
	border: 0 !important;
	border-radius: var(--ui-btn-r, 10px) !important;
	background: var(--ui-pri, var(--twn-primary, #2B6A94)) !important;
	color: #fff !important;
	font-size: var(--ui-btn-fs-lg, 15px); font-weight: 600; line-height: 1;
	box-shadow: var(--ui-btn-shadow, 0 6px 14px color-mix(in srgb, var(--twn-primary, #2B6A94) 28%, transparent));
	transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
#page-wrapper legend .btn-color-main > i {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px;
	border-radius: 9px;
	background: rgba(255, 255, 255, .22);
	font-size: 13px;
	transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
#page-wrapper legend .btn-color-main:hover,
#page-wrapper legend .btn-color-main:focus {
	transform: translateY(-1px);
	filter: brightness(1.05);
	box-shadow: 0 10px 22px color-mix(in srgb, var(--twn-primary, #2B6A94) 36%, transparent);
	outline: 0;
}
#page-wrapper legend .btn-color-main:hover > i.fa-plus { transform: rotate(90deg); }
#page-wrapper legend .btn-color-main:active { transform: scale(.97); box-shadow: 0 3px 8px color-mix(in srgb, var(--twn-primary, #2B6A94) 26%, transparent); }
@media (max-width: 575px) {
	#page-wrapper legend .btn-color-main { height: 36px; font-size: 13.5px; padding-right: 12px; }
	#page-wrapper legend .btn-color-main > i { width: 24px; height: 24px; }
}

/* ---------- (03/11/2026) ช่องกรอกไม่ครบหลังกดบันทึก (bootstrap.validator → .form-group.has-error) ----------
   กรอบแดง + วงแดงจาง + พื้นชมพูอ่อน + สั่น 1 ครั้ง · ข้อความใต้ช่อง (.twn-err-msg สร้างใน app_nav.js) · กรอกแล้วหายทันที */
#page-wrapper .has-error .form-control,
#page-wrapper .has-error .select2-container .select2-selection,
.select2-container .select2-selection.has-error {
	border-color: #E5484D !important;
	background-color: #FFF7F7 !important;
	box-shadow: 0 0 0 3px rgba(229, 72, 77, .12) !important;
	animation: twnErrShake .36s ease-in-out;
}
#page-wrapper .has-error .form-control[readonly] { animation: none; }
#page-wrapper .has-error .form-control:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, .22) !important; }
#page-wrapper .has-error .form-control::placeholder { color: #e8a0a3; }
#page-wrapper .has-error .input-group-addon,
#page-wrapper .has-error .input-group-text { border-color: #E5484D !important; background-color: #FDECEC !important; color: #C62F35 !important; }
#page-wrapper .has-error .vp-lbl,
#page-wrapper .has-error .control-label,
#page-wrapper .has-error > label { color: #C62F35 !important; }
@keyframes twnErrShake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-5px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(3px); }
}
.twn-err-msg {
	display: flex; align-items: center; gap: 6px;
	margin: 6px 0 0;
	font-size: 13px; font-weight: 500; line-height: 1.3;
	color: #C62F35;
	text-align: left;
	animation: twnErrIn .2s ease-out;
}
.twn-err-msg i { font-size: 13px; }
@keyframes twnErrIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* tooltip เดิมของ validator ซ้ำกับข้อความใต้ช่อง → ซ่อน */
.has-error .tooltip, .tooltip.twn-err-tip { display: none !important; }

/* [UI-YN] (11/11/2026) ป้าย YES / NO ในตารางรายงาน · ใส่ที่ต้นทาง SQL CASE / array เอง
   ใช้คลาสเดียวได้ (รองรับ SQL ที่ไม่มี quote เช่น <span class=ui-yn-yes>YES</span>) · .ui-yn ใช้คู่ได้ตามเดิม ($arr_status_news)
   YES = เขียวอ่อน · NO = เทา · ตัวอักษรเป็นตัวใหญ่เสมอ (ต้นทางบางจุดเขียน Yes/No) */
.ui-yn,
.ui-yn-yes,
.ui-yn-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 58px;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: .03em;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
}
.ui-yn::before,
.ui-yn-yes::before,
.ui-yn-no::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}
.ui-yn-yes { background: var(--bo-success-soft, #e6f4ea); color: var(--bo-success, #1e8e3e); }
.ui-yn-no  { background: var(--ui-bg-mute, #F1F5F9); color: var(--ui-muted, #64748B); }
.ui-yn-no::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
a > .ui-yn, a > .ui-yn-yes, a > .ui-yn-no { cursor: pointer; }
.ui-yn-yes + *, .ui-yn-no + * { margin-left: 4px; }
