@font-face {
	font-family: 'Sarabun';
	src: url('fonts/Sarabun-Regular.ttf');
	-fs-pdf-font-embed: embed;
	-fs-pdf-font-encoding: Identity-H;
}

body {
	/*font-family: 'Sarabun', sans-serif;*/
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		Helvetica, Arial, sans-serif;
	margin: 0 auto;
	background-color: #fff;
	color: #333;
	max-width: 400px;
}

body, input, textarea, select, button {
	font-size: 16px;
	/*font-family: 'Sarabun', sans-serif;*/
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		Helvetica, Arial, sans-serif;
}

.header {
	background-color: #239825;
	color: white;
	padding: 20px;
	text-align: center;
}

.navbar {
	background-color: #fff;
	border-bottom: 1px solid #ddd;
	padding: 10px 20px;
	display: flex;
	gap: 20px;
}

.navbar a {
	text-decoration: none;
	color: #444;
}

.navbar a.highlight-link {
	color: #239825;
	font-weight: bold;
}

.main-content {
	padding: 20px;
	position: relative;
}

.summary-section {
	display: flex;
	gap: 20px;
	margin-bottom: 30px;
}

.card {
	background: white;
	padding: 20px;
	border-radius: 8px;
	flex: 1;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	text-align: center;
}

.card-link, .btn {
	margin-top: 10px;
	display: inline-flex;
	text-decoration: none;
	border-radius: 4px;
}

.buttons {
	display: grid;
	gap: 1rem;
}

/* ถ้ามีปุ่มเดียว */
.buttons:has(>button:only-child) {
	grid-template-columns: 1fr;
}

/* ถ้ามี 2 ปุ่มพอดี */
.buttons:has(>button:first-child:nth-last-child(2)) {
	grid-template-columns: repeat(2, 1fr);
}

.buttons:has(>button:first-child:nth-last-child(2)) .btn {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	margin-bottom: 10px;
	gap: 0;
	align-items: center;
}

.btn svg {
	width: 24px;
	height: 24px;
}

.buttons:has(>button:first-child:nth-last-child(2)) .btn span {
	font-size: 12px;
}

.card-link {
	color: #239825;
}

.btn-create {
	background-color: #43a047;
	color: white;
}

table {
	width: 100%;
	border-collapse: collapse;
	background-color: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	table-layout: fixed; /* หรือ fixed ถ้าอยากควบคุม layout */
}

table th, table td {
	padding: 0.5rem 1rem;
	text-align: left;
	border-bottom: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

table th {
	text-align: center;
}

table.inline td {
	padding: 0.05rem;
	background-color: #fbfbfb;
}

table.inline span {
	padding: 0 0.8rem;
	color: #888;
}

table.inline td.align-right span {
	padding: 0 0.8rem;
}

span.span-locked {
	color: #c8c8c8;
}

table.inline button {
	background-color: #fff;
}

table.inline tfoot td {
	padding: 0.8rem 1rem;
}

.total label, .total span {
	font-weight: 600;
	color: #2ecc71;
}

.total a {
	color: #000; /* สีน้ำเงินสวย สดใส แต่ไม่จัดจ้าน */
	text-decoration: none; /* เอาเส้นขีดใต้ลิงก์ออก */
	transition: color 0.3s ease;
	cursor: pointer;
}

.total a label {
	cursor: pointer;
}

.total a:hover, .total a:focus {
	color: #2ecc71;
	text-decoration: underline;
}

tfoot .total-row td .form-group, tfoot .total-row td .form-group label,
	tfoot .total-row td .form-group span {
	margin-bottom: 0;
}

tfoot .total-row td:first-child {
	font-weight: bold;
}

table.inline td.align-right {
	padding: 0 0;
}

table td {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}

table td span.flex-content {
	color: #888;
}

table th {
	background-color: #f5f5f5;
	font-weight: 600;
}

table th a::after {
	content: " ";
	width: 1.5em;
	display: inline-block;
	width: 1.5em;
	position: absolute;
}

table th a.hovered::after {
	content: "▼";
}

table th a.active::after {
	color: #d35400;
}

table th a.active.asc::after {
	content: "▼";
}

table th a.active.desc::after {
	content: "▲";
}

table th a.active.asc:hover::after {
	content: "▲";
}

table th a.active.desc:hover::after {
	content: "▼";
}

table th a.hovered::after {
	color: #f6b093;
	transition: background-color 0.3s ease;
}

table th a.clicked.active.asc:hover::after {
	content: "▼";
}

table th a.clicked.active.desc:hover::after {
	content: "▲";
}

table th a.clicked.hovered::after {
	color: #d35400;
	transition: none;
}

.fixed-table-wrapper {
	width: 100%;
	overflow-x: auto;
}

.fixed-table, .fixed-table-header {
	background-color: #eee;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 8px;
	border-collapse: collapse;
	width: max-content;
	border-collapse: collapse;
	table-layout: fixed;
}

.fixed-table thead, .fixed-table tbody, .fixed-table tr,
	.fixed-table-header thead, .fixed-table-header tbody,
	.fixed-table-header tr, .fixed-table-body thead, .fixed-table-body tbody,
	.fixed-table-body tr {
	background-color: #fff;
}

.fixed-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

.fixed-table-body-wrapper {
	overflow-y: auto;
	max-height: 480px;
	background-color: #eee;
}

/* ✅ Border-radius */
.fixed-table-header {
	border-bottom-left-radius: 0px;
	border-bottom-right-radius: 0px;
}

/* ✅ ใส่ border-radius เฉพาะแถวล่างสุด */
.fixed-table-body {
	border-top-left-radius: 0px;
	border-top-right-radius: 0px;
}

.export-buttons {
	margin-bottom: 20px;
}

.export-buttons .btn {
	display: inline-block;
	padding: 8px 16px;
	text-decoration: none;
	border-radius: 5px;
	margin-right: 10px;
	font-weight: bold;
	transition: background 0.3s;
}

.btn.pdf {
	background-color: #e74c3c;
	color: white;
}

.btn.pdf:hover {
	background-color: #c0392b;
}

.btn.excel {
	background-color: #27ae60;
	color: white;
}

.btn.excel:hover {
	background-color: #1e8449;
}

.filter-form label {
	margin-right: 5px;
}

.error {
	color: red;
	font-size: small;
	position: absolute;
	bottom: -0.7rem;
	left: 0.5rem;
	padding: 0.4rem !important;
	margin: 0;
	line-height: 2.5rem !important;
	height: 1rem !important;
}

.item-row .error {
	width: max-content;
	padding: 0.4rem 0 !important;
}

.error.invalid {
	display: block !important;
}

input.error::placeholder {
	color: red;
	opacity: 1; /* Firefox */
}

input.invalid, select.invalid, textarea.invalid, canvas.invalid {
	border: 1px solid red !important;
}

.container>p {
	padding: 0.8rem 1rem;
	text-align: left;
	border-bottom: 1px solid #ddd;
	margin: 0;
}

.container>.form-actions>p {
	padding: 0.8rem 1rem;
	text-align: left;
	margin: 0;
}

.container strong {
	display: inline-block;
	width: 10rem;
}

.form-row {
	display: flex;
	flex-wrap: wrap;
}

.form-group {
	margin-bottom: 0.8rem;
	display: flex;
	align-items: baseline;
	position: relative;
	/* gap: 2rem; */
	width: 100%;
}

@media ( max-width : 600px) {
	.form-group {
		flex: 1 1 100%;
	}
}

label {
	display: block;
	margin-bottom: 0.5rem;
	color: #444;
}

.form-group>span {
	margin-bottom: 0.4rem;
	padding: 0 0.8rem;
	height: 2.5rem;
	line-height: 2.5;
}

.form-group span.flex-content {
	color: #888;
}

.form-group label {
	width: 10rem;
	padding-left: 1rem;
	flex: none;
	/*white-space: pre;*/
}

.form-group .form-sub-group label {
	padding-left: 0;
}

.form-group .sub-label {
	width: 2rem;
}

input, textarea, select {
	box-sizing: border-box;
	padding: 0.2rem 0.8rem;
	border: 1px solid #ccc;
	border-radius: 8px;
	/*font-size: 1rem;*/
	height: 2.5rem;
	min-height: 2.5rem;
	margin-right: 4rem;
	box-sizing: border-box;
	flex: none;
}

textarea {
	height: 2.0rem;
	min-height: 5.5rem;
}

input, select {
	width: 100%;
}

textarea {
	/* min-width: 250px; */
	
}

.select-wrapper {
	position: relative;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 0;
	height: 2.5rem;
	display: flex;
	align-items: center;
	margin-right: 4rem;
	width: 250px;
	flex: none;
}

/* ปรับ select เองให้โปร่ง */
.select-wrapper select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: none;
	padding: 0.2rem 2rem 0.2rem 0.8rem;
	height: 100%;
	box-sizing: border-box;
	margin-right: 0;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: 100%;
	line-height: 1.5;
	width: 100%;
	margin: 0;
}

/* ลูกศร */
.select-wrapper::after {
	content: "▾";
	position: absolute;
	right: 0.8rem;
	pointer-events: none;
	color: #666;
	font-size: 0.9rem;
}

.form-sub-group input, .form-sub-group textarea, .form-sub-group select,
	.form-sub-group .select-wrapper {
	margin-right: 0;
	width: auto;
}

input[type='checkbox'], input[type='radio'] {
	height: auto;
	min-height: auto;
}

textarea {
	resize: block;
}

.form-actions {
	justify-content: space-between;
	align-items: center;
	margin: 1rem 0;
	text-align: center;
	display: flex;
	gap: 0.4rem;
	flex-direction: column;
}

.form-actions form {
	width: 100%;
}

.btn-submit {
	background: #239825;
	color: white;
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	margin: auto;
	justify-content: center;
}

.btn-cancel {
	background: transparent;
	color: #888;
	text-decoration: none;
	padding: 0.75rem 1.5rem;
}

td a, td button, th a {
	display: inline-block;
	padding: 0 1rem;
	/*font-size: 0.9rem;*/
	text-decoration: none;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	box-sizing: border-box;
	color: #1976d2;
	border-radius: 4px;
	position: relative;
}

td a.btn {
	background-color: #007bff;
	color: white;
}

td a.btn-danger {
	background-color: #dc3545;
}

td a.btn-success {
	background-color: #28a745;
}

td a.btn:hover {
	opacity: 0.85;
}

.alert {
	padding: 1rem;
	margin: 1rem 0;
	border-radius: 8px;
	/*font-size: 1rem;*/
	font-weight: 500;
}

.alert-success {
	background-color: #e6ffed;
	border: 1px solid #28a745;
	color: #155724;
}

.alert-danger {
	background-color: #ffe6e6;
	border: 1px solid #dc3545;
	color: #721c24;
}

h2, h3 {
	margin-top: 0;
	color: #444;
}

.rating-box {
	/*font-size: 1.5em;*/
	color: #f39c12;
	margin-bottom: 20px;
}

.review-list {
	list-style: none;
	padding-left: 0;
}

.review-list li {
	padding: 10px 0;
	border-bottom: 1px solid #ddd;
}

.review-date {
	/*font-size: 0.9em;*/
	color: #777;
}

ul {
	list-style: none;
	padding: 0;
}

li {
	background: white;
	padding: 10px 15px;
	margin-bottom: 8px;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pagination {
	margin: 0.5rem auto;
	text-align: center;
	width: fit-content;
}

.pagination span, .pagination a {
	display: inline-flex;
	position: relative;
}

.pagination.page-list {
	margin: -1.5rem 1.5rem 0rem 0;
	text-align: right;
	width: auto;
	float: none;
	border-bottom: 1px solid #f0f0f0;
}

.pagination.page-list .pagination-form-wrapper {
	margin-top: 0;
}

.pagination a, .pagination>button {
	margin: 0 5px;
	text-decoration: none;
	padding: 5px 10px;
	background: #eee;
	border-radius: 5px;
	color: #333;
}

.pagination a.active, .pagination>button.active {
	background: #333;
	color: white;
	font-weight: bold;
}

.pagination span.seperate {
	padding: 0 0.5rem;
	color: #c0c0c0;
	margin-bottom: 0.8rem;
}

.search-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

.search-grid label {
	display: inline-block;
	margin-bottom: 0.25rem;
	/*font-weight: bold;*/
	width: 8rem;
	flex: none;
}

.search-grid .form-sub-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.search-grid label.sub-label {
	display: inline-block;
	margin: 0 0.25rem;
	font-weight: bold;
	width: 2rem;
	text-align: center;
}

.search-grid input {
	flex: 1;
	width: 12rem;
}

.search-grid .select-wrapper, .search-grid select {
	flex: 1;
	width: 11.9rem;
}

.search-grid .form-group {
	display: flex;
	gap: 1px;
	align-items: center;
	flex-wrap: wrap;
	margin-right: 1rem;
}

.pagination-form-wrapper {
	display: inline-flex;
	margin-top: 0;
}

.pagination-form {
	display: flex;
	justify-content: end;
}

.pagination-fields {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	align-items: baseline;
}

.pagination-fields label {
	flex: none;
	/*font-size: 0.9rem;*/
	color: #333;
	margin-bottom: 0;
	text-align: center;
}

.pagination-fields label span {
	padding-right: 0.5rem;
}

.pagination-fields input[type="number"] {
	padding: 0.4rem 0.6rem;
	/*font-size: 1rem;*/
	border: 1px solid #ccc;
	border-radius: 0.5rem;
	width: 100px;
	text-align: center;
	height: 1.8rem;
	min-height: 1.8rem;
	margin-right: 0;
}

.pagination-fields button {
	padding: 0rem 1.2rem;
	/*font-size: 1rem;*/
	background-color: #239825;
	color: white;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background-color 0.3s;
	height: 1.8rem;
	min-height: 1.8rem;
	width: fit-content;
	position: relative;
	margin: auto 0 0 auto;
}

.pagination-fields button:hover {
	background-color: #2a358d;
}

.center {
	text-align: center;
	margin: auto;
}

input[type="checkbox"], table.inline input[type="checkbox"], input[type="radio"]
	{
	width: 18px;
	height: 18px;
	cursor: pointer;
	margin: auto;
}

.w-30 {
	width: 30px;
}

.w-50 {
	width: 50px;
}

.w-60 {
	width: 60px;
}

.w-100 {
	width: 100px;
}

.w-150 {
	width: 150px;
}

.w-200 {
	width: 200px;
}

.search-grid input.w-440 {
	width: 440px;
}

/* ---------- Main Menu ---------- */
.main-menu {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: #239825;
	padding: 0 24px;
	height: 56px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.menu-left, .menu-right {
	display: flex;
	align-items: center;
	gap: 22px;
}

.main-menu a, .notif-wrapper button {
	color: white;
	text-decoration: none;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: 6px;
	transition: background 0.3s ease;
}

.main-menu a:hover, .notif-wrapper button:hover {
	background-color: #F7948E;
}

/* ---------- Dropdown ---------- */
.dropdown {
	position: relative;
}

.dropdown>a::after {
	content: " ▼";
	font-size: 10px;
}

.dropdown-content {
	display: none;
	position: absolute;
	top: 26px;
	left: 0;
	background-color: #F5F1EE;
	min-width: 180px;
	padding: 0;
	border-radius: 10px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
	flex-direction: column;
	z-index: 99;
	transition: opacity 0.2s ease;
}

.dropdown-content a {
	color: #2c3e50;
	padding: 10px 20px;
	font-size: 15px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	border-left: 4px solid transparent;
}

.dropdown-content a:hover {
	background-color: #F7948E;
	border-left: 4px solid #239825;
	color: #239825;
	font-weight: 500;
}

.menu-left>.dropdown:hover .dropdown-content {
	display: flex;
}

.main-menu {
	flex-direction: column;
	align-items: flex-start;
	padding: 12px;
	height: auto;
}

.menu-left, .menu-right {
	flex-direction: column;
	width: 100%;
	gap: 10px;
}

.notif-wrapper {
	position: relative;
	display: inline-block;
}

.notif-button {
	background-color: transparent;
	border: none;
	/*font-size: 1rem;*/
	cursor: pointer;
}

.notif-badge {
	background-color: red;
	color: white;
	border-radius: 999px;
	padding: 0.1rem 0.5rem;
	/*font-size: 0.8rem;*/
	margin-left: 0.3rem;
}

.notif-dropdown {
	right: 0;
	width: 300px;
	max-height: 400px;
	overflow-y: auto;
	position: absolute;
	top: 26px;
	background-color: #fff8f2; /* ครีมอ่อน */
	min-width: 180px;
	padding: 0;
	border-radius: 10px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
	flex-direction: column;
	z-index: 99;
	transition: opacity 0.2s ease;
}

.notif-item {
	border-bottom: 1px solid #eee;
}

.menu-right a.notif-link {
	display: block;
	padding: 0.75rem;
	color: #333;
	text-decoration: none;
	transition: background 0.2s;
}

.notif-link:hover {
	background-color: #f9f9f9;
}

.notif-title {
	font-weight: bold;
}

.notif-time {
	/*font-size: 0.8rem;*/
	color: #888;
}

.notif-empty {
	padding: 1rem;
	text-align: center;
	color: #888;
}

.logout-link {
	color: red;
	font-weight: 500;
}

/* Submenu */
.submenu {
	display: none;
	background-color: #F5F1EE;
	padding: 10px 20px;
	border-bottom: 2px solid #239825;
	min-height: 34px;
}

.submenu.active {
	display: flex;
}

.submenu .dropdown {
	display: flex;
}

.submenu a {
	margin-right: 15px;
	color: #239825;
	font-weight: 500;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 4px;
	transition: background-color 0.3s ease;
}

.submenu a:hover {
	background-color: #F7948E;
	color: white;
}

.submenu a.active {
	background-color: #239825;
	color: #fff;
	font-weight: bold;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.align-right {
	text-align: right;
}

.form-group input.align-right {
	justify-items: flex-end;
}

.flex-1 .flex-content {
	display: flex;
	/* flex: 1; */
	width: fit-content;
	margin-right: 0;
	height: 2rem;
	line-height: 2;
	font-size: small;
	color: #888;
}

.sidebar {
	position: fixed;
	top: 40px;
	right: 40px;
	width: 180px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	padding: 1rem;
	height: fit-content;
	z-index: 10;
	overflow-y: auto;
}

.sidebar a {
	display: block;
	margin: 0.1rem;
	color: #333;
	font-weight: 500;
	text-decoration: none;
	padding: 0.5rem 0.8rem;
}

@media ( max-width : 1024px) {
	.sidebar {
		display: none; /* ซ่อนบนจอเล็ก */
	}
}

.sidebar a:hover, .sidebar a.active {
	color: #239825;
	border-left: 4px solid #239825;
	background: rgba(67, 74, 141, 0.05);
	border-radius: 6px;
}

.sidebar.collapsed {
	width: 60px;
	height: 30px;
	overflow-y: hidden;
}

.toggle-btn {
	background-color: #dee2e6;
	border: none;
	border-radius: 6px;
	padding: 0.5rem 1rem;
	cursor: pointer;
	transition: background 0.3s ease;
	width: 100%;
	display: flex;
	align-items: center;
	margin-bottom: 0.4rem;
}

.toggle-btn:hover {
	background-color: #ced4da;
}

.toggle-icon {
	font-size: 18px;
	line-height: 1;
}

.sidebar.collapsed .toggle-btn {
	justify-content: center;
}

.sidebar.collapsed a {
	display: flex;
	justify-content: center;
	align-items: center;
}

.sidebar.collapsed .label {
	display: none;
}

.sidebar .icon {
	font-size: 1.25rem;
	width: 24px;
	text-align: center;
}

.sidebar .label {
	transition: opacity 0.3s ease, transform 0.3s ease;
	padding-left: 0.8rem;
}

section {
	/*border-bottom: 1px solid #eee;*/
	
}

section h2 {
	padding: 1rem 0 0 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.2rem;
	font-size: 1.1rem;
	font-weight: 600;
	color: #2ecc71;
}

section h2 svg {
	position: relative;
	top: 0.1rem;
}

small {
	color: #1a237e;
}

.note a {
	color: #000;
	text-decoration: none;
	transition: color 0.3s ease;
	cursor: pointer;
}

.note small a {
	color: #239825;
}

.note a:hover, .note a:focus, .note small a:hover, .note small a:focus {
	color: #2a358d;
	text-decoration: underline;
}

.filter-button {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.8rem 1rem;
	cursor: pointer;
	overflow: hidden;
	color: #333;
	background-color: #f0f0f0;
	border: 1px solid #ccc;
	border-radius: 30px;
	padding: 0.8rem 1.5rem;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	transition: background-color 0.2s;
	position: absolute;
	top: 2rem;
	right: 2rem;
}

.filter-button:hover {
	background-color: #ffffff;
}

.filter-button span {
	margin-left: 0.5rem;
}

/* Filter Form Container */
.filter-form {
	width: 100%;
	background: white;
	border-radius: 12px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
	position: relative;
	transition: opacity 0.4s ease, opacity 0.3s ease;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	padding: 0 2rem;
	visibility: hidden;
	/* ยังไม่ให้ padding ด้านบนล่าง เพื่อไม่ให้กินพื้นที่ขณะซ่อน */
	pointer-events: none; /* ไม่ให้คลิกอะไรได้ในขณะซ่อน */
}

.filter-form.show {
	max-height: fit-content; /* ปรับตามความสูงที่ต้องการ */
	opacity: 1;
	padding: 2rem; /* เริ่มมี padding ด้านบน/ล่างเมื่อแสดง */
	pointer-events: auto;
	visibility: visible;
}

.filter-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 1.2rem;
}

.collapse-button {
	background: #fff;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	position: absolute;
	right: 1.5rem;
	top: 1.5rem;
	transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
	width: fit-content;
	color: #888;
	margin: 0;
}

.collapse-button:hover {
	background-color: #e0e0e0;
	color: #d00;
	transform: rotate(90deg);
}

.search-summary {
	background: #f9f9f9;
	padding: 0.75rem 1rem;
	border-left: 4px solid #239825;
	border-radius: 8px;
	font-size: 0.95rem;
	color: #333;
	margin-bottom: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
}

.search-summary .summary-item {
	background: #e8f5e9;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	color: #239825;
	font-weight: 500;
}

.checkbox-wrapper {
	position: relative;
	padding: 0;
	height: 2.9rem;
	display: flex;
	align-items: center;
	margin-right: 4rem;
	width: 250px;
	flex: none;
}

.checkbox-wrapper input[type='checkbox'] {
	margin: 0;
}

.p-0 {
	padding: 0;
}

.clear {
	clear: both;
}

.fixed-table-body .image-card {
	background-color: #f9f9f9;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
	position: relative;
	height: 18px;
	width: auto;
}

.fixed-table-body .image-card img {
	width: auto;
	height: 100%;
	object-fit: cover;
}

#submenu-service-request a {
	margin-right: 0;
}

#submenu-service-request .dropdown-content {
	display: none;
	position: absolute;
	top: 40px;
	left: 0; /* ให้แสดงด้านขวา */
	background-color: #F5F1EE;
	min-width: 180px;
	padding: 0;
	border-radius: 10px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
	flex-direction: column;
	z-index: 99;
	transition: opacity 0.2s ease;
}

#submenu-service-request .dropdown-content a {
	color: #2c3e50;
	padding: 10px 20px;
	font-size: 15px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	border-left: 4px solid transparent;
}

#submenu-service-request .dropdown-content a:hover {
	background-color: #F7948E;
	border-left: 4px solid #239825;
	color: #239825;
	font-weight: 500;
}

.form-row {
	flex-direction: column;
}

.form-group, .checkbox-wrapper {
	/*width: 95%;*/
	margin-right: 0;
}

.form-group label, .form-group input, .form-group select, .form-group textarea,
	.select-wrapper {
	width: fit-content;
	font-size: 16px;
	flex: 1;
	justify-items: flex-end;
	margin: 0 0.5rem;
}

.form-group select {
	width: 100%;
	margin: 0;
}

.form-group input, .form-group select, .form-group textarea {
	font-size: 16px;
}

.form-group input, .form-group select, .form-group textarea,
	.select-wrapper {
	flex: none;
	width: -webkit-fill-available;
	justify-items: flex-start;
}

.form-group input, .form-group textarea, .select-wrapper {
	margin-bottom: 0rem;
}

.search-grid {
	grid-template-columns: 1fr;
}

.search-grid .form-group {
	display: block;
	width: 100%;
	overflow: hidden;
}

.search-grid input, .search-grid select {
	width: 100%;
}

.search-grid .form-sub-group {
	display: block;
}

.search-grid input.w-440 {
	width: 100%;
}

.pagination.page-list {
	margin: 0.5rem 1.5rem 0rem 0;
}

.pagination span.seperate {
	display: none;
}

.pagination-fields {
	flex-wrap: wrap-reverse;
	align-items: center;
	margin-top: 0.5rem;
	flex-direction: row;
	text-align: center;
}

.pagination-fields input[type="number"] {
	width: 80px;
	display: flex;
}

.page-list .pagination-fields input[type="number"] {
	display: inline-flex;
}

.filter-button {
	gap: 0;
	position: relative;
	top: 0;
	right: 0;
	margin: 0 0 0.5rem auto;
}

.fixed-table-body-wrapper {
	max-height: 400px;
	overflow-x: auto;
}

.main-menu {
	flex-direction: column;
	align-items: flex-start;
}

.menu-left, .menu-right {
	width: 100%;
	flex-direction: column;
}

.sidebar {
	display: none;
}

.form-group {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0;
}

.form-group label {
	font-weight: bold;
	color: #333;
	font-size: 16px;
	padding: 0 0.8rem;
	line-height: 2.0rem;
	margin: 0;
	height: 2.0rem;
	display: flex;
	gap: 0.2rem;
}

.form-group>span {
	display: none;
	margin-bottom: 0;
}

.form-group span.flex-content {
	/* กรณีคุณต้องการตกแต่งเพิ่มเติม */
	display: flex;
	color: #888;
	font-size: 16px;
	line-height: 2rem;
	height: auto;
	justify-content: flex-end;
	align-items: flex-end;
	gap: 0.4rem;
}

.form-group span.flex-content span {
	line-height: normal;
}

.flex-1 .flex-content {
	font-size: small;
	color: #888;
}

#upload-form {
	display: block !important;
}

#upload-form #file-input {
	display: none;
}

#upload-form button {
	margin: 0.5rem 0;
}

.form-actions {
	/*margin: 1rem 1rem 1rem 0;*/
	
}

table.inline span {
	font-size: small;
}

.fixed-table thead th {
	font-size: small;
}

table td span.flex-content {
	color: #888;
	font-size: small;
}

.pagination-fields label span {
	font-size: small;
}

.pagination a, .pagination>button {
	font-size: small;
}

table th {
	font-size: small;
}

table td {
	font-size: small;
}

/* ในไฟล์ style.css */
.hamburger {
	display: none;
	background: none;
	font-size: 24px;
	border: none;
	cursor: pointer;
	margin: 10px;
	color: #fff;
}

.menu-left, .menu-right {
	display: none;
	flex-direction: column;
	width: 100%;
	height: 0;
	overflow: hidden;
}

.main-menu a, .notif-wrapper button {
	padding: 10px 20px;
	font-size: 15px;
	display: block;
}

.main-menu a, .notif-wrapper button {
	border-radius: 6px 6px 0 0;
	text-align: center;
}

.menu-left.active, .menu-right.active {
	display: flex;
	height: auto;
}

.hamburger {
	display: block;
}

.main-menu {
	flex-direction: column;
}

.dropdown {
	width: 90%;
}

.dropdown-content {
	top: auto;
	position: relative;
	border-radius: 0 0 6px 6px;
}

.dropdown-content a:hover {
	border-radius: 0;
}

/* ฟอนต์พื้นฐาน */
body {
	margin: 0;
	/*font-family: 'Sarabun', sans-serif;*/
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		Helvetica, Arial, sans-serif;
	background-color: #f9f9f9;
	color: #333;
}

/* หน้าต่างแต่ละหน้า */
.page {
	display: none;
	padding: 0 0 3.5rem 0;
	justify-items: center;
	height: -webkit-fill-available;
}

.page h4 {
	text-align: left;
	margin: 0 auto 0 0;
	padding: 0.5rem 0 0 0.5rem;
	font-size: small;
	font-weight: 500;
}

.page.active {
	display: block;
}

/* Feed */
.feed {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	text-align: left;
	width: 100%;
}

.feed-item {
	background-color: white;
	/* border-radius: 12px; */
	padding: 0.5rem;
	opacity: 0;
	transform: translateY(10px);
	transition: all 0.4s ease;
	border-bottom: 1px solid #f1f5f9;
}

.feed-item.visible {
	opacity: 1;
	transform: translateY(0);
}

.feed-sticky {
	position: sticky;
	top: 3.5rem;
	background: #f1f5f9; /* เทาอ่อน */
	color: #334155; /* เทาเข้ม */
	font-weight: 600;
	padding: 12px 12px;
	border-bottom: 1px solid #cbd5e1;
	font-size: 14px;
	z-index: 1;
}

.feed-sticky.visible {
	opacity: 1;
	transform: translateY(0);
}

.feed-item .title {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	margin: 0 0 6px 0;
	gap: 0.4rem;
}

.feed-item h3 {
	margin: 0 0.4rem 0 0;
	font-size: 14px;
}

.feed-item .timeago {
	color: #999;
	font-size: 14px;
}

.feed-item .timeago::before {
	content: ' ';
}

.feed-item p {
	margin: 0 0 8px;
	font-size: 14px;
	color: #666;
	display: flex;
	justify-content: space-between;
}

.feed-item p .right {
	display: flex;
	gap: 0.4rem;
	justify-content: flex-end;
	align-items: flex-end;
}

.status {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	color: white;
}

.form-group.status {
	display: flex;
}

/* Draft – เทาอ่อนสดใส */
.status-DRAFT {
	background-color: #95a5a6; /* silver */
}

/* Pending – เหลืองสด */
.status-PENDING {
	background-color: #f1c40f; /* bright yellow */
	color: #333;
}

/* Work Order – น้ำเงินสด */
.status-WORK_ORDER {
	background-color: #3498db; /* vivid blue */
}

/* In Progress – ฟ้า-เขียวสด */
.status-IN_PROGRESS {
	background-color: #1abc9c; /* turquoise */
}

/* Waiting Confirm – ม่วงสด */
.status-WAITING_CONFIRM {
	background-color: #9b59b6; /* amethyst */
}

/* Done – เขียวสด */
.status-DONE {
	background-color: #2ecc71; /* emerald green */
}

/* Cancelled – แดงสด */
.status-CANCELLED {
	background-color: #e74c3c; /* vivid red */
}

/* Active – เขียวสด */
.status-ACTIVE {
	background-color: #2ecc71;
}

/* Issued – เหลืองสด */
.status-ISSUED {
	background-color: #f1c40f; /* bright yellow */
	color: #333;
}

/* Paid – เขียวสด */
.status-PAID {
	background-color: #2ecc71;
}

/* Inactive – เทาอ่อนสดใส */
.status-INACTIVE {
	background-color: #95a5a6; /* silver */
}

/* Replaced – เทาอ่อนสดใส */
.status-REPLACED {
	background-color: #95a5a6; /* silver */
}

.review {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	background-color: #ffffff;
	color: #666666;
}

.review .star {
	color: #e67f22;
}

/* เมนู */
.menu-page h2 {
	margin-top: 0;
}

.menu-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 12px;
}

.menu-grid button {
	padding: 12px;
	font-size: 14px;
	border: none;
	border-radius: 12px;
	background-color: #2ecc71;
	color: white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	cursor: pointer;
}

.menu-grid button:hover {
	background-color: #2bcf1f;
}

/* Bottom Navigation */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: #fff;
	border-top: 1px solid #ddd;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	list-style-type: none;
	margin: 0;
	z-index: 2;
	height: 3.5rem;
	align-items: center;
	padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
	text-decoration: none;
	list-style-type: none;
	box-shadow: none;
	padding: 0;
	margin: 0;
}

.nav-item a {
	padding: 6px 0;
	color: #666;
	text-decoration: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 12px;
	color: #666;
	line-height: 1.2;
}

.nav-item.active a {
	color: #2ecc71;
}

.nav-item a svg {
	height: 28px;
	width: 28px;
}

body {
	/*font-family: 'Sarabun', sans-serif;*/
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		Helvetica, Arial, sans-serif;
	background: #fff;
	color: #333;
	margin: 0 auto;
	padding: 0;
	overflow-x: hidden;
}

.container {
	max-width: 400px;
	margin: 0 auto;
	padding: 0 0 3.5rem 0;
	background: white;
	border-radius: 0 0 12px 12px;
	/*box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);*/
	text-align: center;
	/*min-height: calc(var(--vh, 1vh)* 100);*/
	flex: 1 1 auto; /* กินพื้นที่ที่เหลือ */
	width: -webkit-fill-available;
}

h2 {
	margin-bottom: 20px;
}

label {
	display: block;
	margin-bottom: 10px;
	text-align: left;
}

input[type="email"], button {
	width: 100%;
	padding: 12px;
	margin: 10px auto 20px auto;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 6px;
}

button {
	background-color: #01873a;
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 12px 20px;
	font-weight: bold;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease;
	align-items: center;
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	justify-content: center;
}

button:hover {
	transform: scale(1.05);
}

.otp-inputs {
	display: flex;
	justify-content: space-between;
	margin: 20px auto;
	width: 95%;
	gap: 0.4rem;
}

.otp-inputs input {
	width: 12%;
	height: 40px;
	font-size: 24px;
	text-align: center;
	border: 1px solid #ccc;
	border-radius: 6px;
	outline: none;
	transition: border-color 0.2s;
	margin-right: 0;
}

.otp-inputs input:focus {
	border-color: #2ecc71;
	box-shadow: 0 0 5px rgba(230, 126, 34, 0.5);
}

.image-upload-section, .image-gallery-section {
	background: #fff;
	padding: 0;
	margin: 0 1rem 30px;
}

.image-upload-section h3, .image-gallery-section h3 {
	color: #333;
	margin-bottom: 15px;
}

#upload-form {
	display: flex;
	align-items: center;
	gap: 10px;
}

#upload-form input[type="file"] {
	flex-grow: 1;
	display: none;
}

/*#upload-form button {
	background-color: #239825;
	color: white;
	padding: 8px 16px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
}

#upload-form button:hover {
	background-color: #2a358d;
}*/
.image-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.image-card {
	background-color: #f9f9f9;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
	position: relative;
}

.image-card img {
	width: 100%;
	height: 120px;
	object-fit: cover;
}

.image-card .image-info {
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 0.2rem;
	text-align: center;
	word-break: break-word;
}

.image-card .time-info {
	font-size: 0.8rem;
	color: #888;
	margin-bottom: 0.5rem;
	text-align: center;
}

.image-card .main-radio {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	cursor: pointer;
	justify-content: center;
}

.image-card .main-radio input[type="radio"] {
	accent-color: #50b333;
	cursor: pointer;
	margin: 0;
}

.image-card .delete-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	background: #F7948E;
	border: none;
	color: white;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	font-weight: bold;
	cursor: pointer;
	padding: 0;
	margin: 0;
}

.image-card .delete-btn span {
	position: relative;
	bottom: 0.1rem;
}

.main-radio {
	margin-left: 8px;
	font-size: 0.85rem;
}

.app-container {
	display: flex;
	flex-direction: column;
	height: 100vh; /* เต็มหน้าจอ */
	padding: 0;
	position: absolute;
	left: 0;
	width: 100%;
}

.app-header {
	width: 100%;
	/*max-width: 400px;*/
	margin: 0 auto;
	background-color: #fff;
	padding: 10px 0;
	display: flex;
	align-items: center;
	justify-content: center;
	position: sticky;
	top: 0;
	z-index: 1000;
	flex: 0 0 auto; /* สูงตามเนื้อหา */
}

.app-header.feed {
	flex-direction: column;
	padding: 10px 0 0;
}

.app-header .app-header-container {
	display: flex;
	align-items: center;
	justify-content: center;
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
}

.app-title {
	flex: 1;
	text-align: center;
	font-size: 1.1rem;
	font-weight: 600;
	color: #2ecc71; /* สีส้ม */
	margin: 0;
	padding: 0;
	line-height: 1.2;
	/*font-family: 'Sarabun', sans-serif;*/
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		Helvetica, Arial, sans-serif;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
}

.app-title a {
	color: inherit;
	text-decoration: none;
}

.header-left, .header-right {
	display: flex;
	align-items: center;
	flex: 1;
}

.header-right {
	justify-content: flex-end;
}

.header-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.3rem;
	color: inherit;
	width: 24px;
	height: 24px;
}

.header-left a svg, .header-right a svg {
	height: 100%;
	width: 100%;
}

/* แถบค้นหาด้านบน */
.search-bar {
	position: sticky;
	top: 0;
	width: 100%;
	background: #ffffff;
	display: flex;
	align-items: center;
	z-index: 1000;
}

.search-container {
	display: flex;
	align-items: center;
	background: #f1f3f6;
	border-radius: 25px;
	padding: 0 14px;
	flex: 1;
	transition: box-shadow 0.3s ease;
}

.search-container:focus-within {
	box-shadow: 0 0 0 2px #4a90e2;
	background: #fff;
}

.search-container svg {
	width: 18px;
	height: 18px;
	margin-right: 10px;
	stroke: #666;
}

.search-input {
	border: none;
	outline: none;
	background: transparent;
	flex: 1;
	font-size: 16px;
	color: #333;
}

.search-input::placeholder {
	color: #999;
}

/* demo content */
.content {
	padding: 20px;
}

h1 {
	margin: 0 0 1rem 0;
}

.rating-group {
	margin-bottom: 1.2rem;
	flex-direction: column;
	gap: 1.2rem;
}

.stars {
	display: flex;
	gap: 4px;
	flex-direction: row-reverse;
	justify-content: center;
	margin: auto;
}

.stars input {
	display: none;
}

.stars label {
	font-size: 2.5rem;
	cursor: pointer;
	background: #ccc;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	transition: transform 0.2s ease;
	width: auto;
	line-height: 2.0rem;
}

.stars label:hover {
	transform: scale(1.1);
}

.stars input:checked ~ label, .stars label:hover, .stars label:hover ~
	label {
	background: linear-gradient(to right, #facc15 50%, #fde047 50%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.stars.flex-content label {
	background: linear-gradient(to right, #facc15 50%, #fde047 50%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.review-form textarea.form-control {
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 0.75rem;
	font-size: 0.95rem;
	resize: vertical;
	transition: border 0.2s ease, box-shadow 0.2s ease;
}

.flex {
	display: flex;
}

.grid {
	display: grid;
}

.hide {
	display: none !important;
}

.address .form-group {
	display: block;
}

#address .form-group span.flex-content {
	justify-content: left;
	text-align: left;
}

.form-group.status {
	padding: 0;
}

.form-group.status span {
	padding: 0;
	border-radius: 17px;
	color: #333;
	background-color: #fff;
}

.form-group.status .flex-content span {
	padding: 0.2rem 0.75rem 0.2rem 0.75rem;
	border-radius: 17px;
	color: white;
	position: relative;
	right: 0.75rem;
}

/* Draft – เทาอ่อนสดใส */
.form-group.status.DRAFT .flex-content span {
	background-color: #95a5a6; /* silver */
}

/* Pending – เหลืองสด */
.form-group.status.PENDING .flex-content span {
	background-color: #f1c40f; /* bright yellow */
	color: #333;
}

/* Work Order – น้ำเงินสด */
.form-group.status.WORK_ORDER .flex-content span {
	background-color: #3498db; /* vivid blue */
}

/* In Progress – ฟ้า-เขียวสด */
.form-group.status.IN_PROGRESS .flex-content span {
	background-color: #1abc9c; /* turquoise */
}

/* Waiting Confirm – ม่วงสด */
.form-group.status.WAITING_CONFIRM .flex-content span {
	background-color: #9b59b6; /* amethyst */
}

/* Done – เขียวสด */
.form-group.status.DONE .flex-content span {
	background-color: #2ecc71; /* emerald green */
}

/* Cancelled – แดงสด */
.form-group.status.CANCELLED .flex-content span {
	background-color: #e74c3c; /* vivid red */
}

/* Active – เขียวสด */
.form-group.status.ACTIVE .flex-content span {
	background-color: #2ecc71;
}

/* Issued – เหลืองสด */
.form-group.status.ISSUED .flex-content span {
	background-color: #f1c40f; /* bright yellow */
	color: #333;
}

/* Paid – เขียวสด */
.form-group.status.PAID .flex-content span {
	background-color: #2ecc71;
}

/* Inactive – เทาอ่อนสดใส */
.form-group.status.INACTIVE .flex-content span {
	background-color: #95a5a6; /* silver */
}

/* Replaced – เทาอ่อนสดใส */
.form-group.status.REPLACED .flex-content span {
	background-color: #95a5a6; /* silver */
}

.hide {
	display: none;
}

.item-group-row {
	border-bottom: 1px solid #ddd;
	margin-top: 1rem;
}

.item-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 6px 0 1.2rem 0;
	border-bottom: 1px solid #ddd;
	font-size: 14px;
	transition: background-color 0.2s ease;
	flex-wrap: wrap;
}

.item-group-row .item-row {
	border-bottom: none;
}

/* แถวที่ถูกเลือก */
.item-row.selected {
	background-color: #ecfef0; /* ฟ้าอ่อน */
}

.item-row .left {
	font-size: 16px;
	display: flex;
	align-items: flex-start;
	text-align: left;
	/* gap: 10px; */
	flex: 0.8;
	padding: 0 0.8rem;
}

.item-row .left .image-card img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 8px;
}

.item-row .left .text-block {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.2rem;
}

.item-row .detail, .item-row .form-group.detail label, .item-row  .form-group span.flex-content.detail
	{
	font-size: 14px;
	color: #888;
}

.item-row .right {
	display: flex;
	justify-content: flex-end;
	gap: 0.4rem;
	color: #888;
	/* flex: 1; */
	padding: 0 0.8rem;
	align-items: center;
	position: relative;
}

.item-row flex-content {
	padding: 0 0.8rem;
}

.item-row .form-group.w-150 {
	width: initial;
}

.item-row .form-group input.w-150 {
	width: 150px;
}

.item-row .form-group span.flex-content svg {
	position: relative;
	top: 0.4rem;
}

.item-row .flex-content.align-right .unit {
	padding-left: 0.2rem;
}

.row-flex {
	display: flex;
	align-items: center; /* ให้ข้อความกับปุ่มอยู่กึ่งกลางแนวตั้ง */
	justify-content: space-between; /* ข้อความซ้าย, switch ขวา */
	gap: 10px;
}

.row-flex .title {
	flex: 1; /* ดันข้อความไปทางซ้าย */
	font-weight: 500;
}

.switch-group {
	display: inline-flex;
	overflow: hidden;
	gap: 0.2rem;
}

.switch-group input[type="radio"] {
	display: none;
}

.switch-group label {
	padding: 6px 6px;
	cursor: pointer;
	background: inherit;
	font-size: 12px;
	margin: 0;
	display: flex;
	align-items: center;
	flex: 1;
	text-align: center;
	justify-content: center;
	border-radius: 10rem;
	width: 38px;
	height: 38px;
}

.switch-group input[type="radio"] {
	border: none;
}

.icon-wrapper {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%; /* ทำให้เป็นวงกลม */
}

.icon-pass {
	color: #888;
} /* เขียว */
.icon-fail {
	color: #888;
} /* แดง */
.switch-group input[type="radio"]:checked+label {
	color: #fff;
	font-weight: 600;
}

.switch-group input[type="radio"]:checked+label .icon-pass,
	.switch-group .flex-content .icon-pass {
	background-color: #16a34a; /* เขียว */
	color: #fff;
} /* เขียว */
.switch-group input[type="radio"]:checked+label .icon-fail,
	.switch-group .flex-content .icon-fail {
	background-color: #ef4444; /* แดง */
	color: #fff;
} /* แดง */
.delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #888;
	padding: 2px;
	transition: color 0.2s;
	width: 24px;
	height: 24px;
	margin: 0;
	display: block;
}

.delete-btn:hover {
	color: red;
}

.item-row .right input {
	width: 6rem;
	font-size: 16px;
	margin: 0;
	background-color: transparent;
}

.item-row input[type="checkbox"], .item-row input[type="radio"] {
	width: 18px;
}

.icon-notification-wrapper {
	position: relative;
	display: inline-block;
}

.icon-notification-wrapper.has-unread::after {
	content: "";
	position: absolute;
	top: 2px;
	right: 2px;
	width: 8px;
	height: 8px;
	background-color: red;
	border-radius: 50%;
	border: 2px solid white; /* ทำให้ดูสวย แยกจากพื้นหลัง */
}

.chat-container {
	display: flex;
	flex-direction: column;
	height: 100vh; /* เต็มหน้าจอ */
	padding: 0;
}

.chat-room {
	display: flex;
	flex-direction: column;
	height: 90vh;
}

.chat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #ddd;
	padding: 0 1rem;
	flex: 0 0 auto; /* สูงตามเนื้อหา */
}

.chat-info {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.chat-info .btn {
	width: fit-content;
	margin: auto;
}

.chat-messages {
	flex: 1 1 auto; /* กินพื้นที่ที่เหลือ */
	padding: 1rem;
	overflow-y: auto;
	background: #fafafa;
	height: 400px;
}

.message {
	/*margin-bottom: 1rem;
	max-width: 60%;
	padding: 0.5rem 1rem;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	text-align: justify;*/
	margin-bottom: 12px;
}

.message.mine {
	/*margin-left: auto;
	background: #dcf8c6;*/ /* เขียวอ่อนเหมือน Line/WhatsApp */
	align-items: flex-end; /* ชิดขวา */
}

.message-bubble-wrapper {
	display: flex;
	gap: 0.4rem;
}

.message.mine .message-bubble-wrapper {
	flex-direction: row-reverse;
}

.message-bubble {
	max-width: 60%;
	padding: 0.5rem 1rem;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	text-align: justify;
}

.message.mine .message-bubble {
	background: #dcf8c6;
}

.message-meta {
	font-size: 12px;
	color: #666;
	margin-top: 4px;
	align-self: flex-end;
}

.message-sender {
	font-weight: bold;
	font-size: 0.9rem;
}

.message-text {
	margin: 0.2rem 0;
}

.message-time {
	font-size: 0.8rem;
	color: gray;
	text-align: right;
}

.chat-input {
	flex: 0 0 auto; /* สูงตามเนื้อหา */
	border-top: 1px solid #ddd;
	padding: 0.5rem 0;
	background: #fff;
}

.chat-input .chat-form {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.chat-input .chat-form textarea {
	flex: 1;
	min-height: 40px;
	max-height: 120px; /* กัน textarea สูงเกินไป */
	resize: none; /* ปิด resize ด้านข้าง */
	padding: 0.5rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 16px;
	margin: auto;
}

.chat-input .chat-form .btn-attach {
	width: fit-content;
}

.chat-input .chat-form .btn-submit {
	width: fit-content;
}

.chat-messages .no-data {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	color: #9a9a9a;
	font-weight: 400;
	font-size: .875rem;
}

.message-seen {
	font-size: 0.75rem; /* ตัวเล็กกว่าเนื้อความ */
	color: #888; /* สีเทาอ่อน */
	margin-top: 2px; /* เว้นระยะนิดหน่อย */
	text-align: right; /* ชิดขวา (กรณี messageOwner = mine) */
}

.message.mine .message-seen {
	color: #4caf50; /* สีเขียวอ่อน ถ้าเป็นของตัวเอง */
	font-weight: 500;
}

.chat-messages.private .message-seen span {
	display: none;
}

/* กรอบข้อความระบบ */
.message.system {
	margin: auto;
	font-size: 0.85rem;
	font-style: italic;
	text-align: center;
	color: #666;
	position: relative;
	background-color: transparent;
	box-shadow: none;
}

.message.system .message-bubble-wrapper {
	justify-content: center;
	display: block;
}

.message.system .message-bubble {
	background-color: transparent;
	box-shadow: none;
	margin: auto;
	max-width: 100%;
	text-align: center;
}

/* ไม่แสดงชื่อ sender */
.message.system .message-sender {
	display: none;
}

.message.system .message-attachments {
	display: none;
}

/* ตัวข้อความหลัก */
.message.system .message-text {
	display: inline-block;
	background: #f2f2f2;
	color: #444;
	padding: 6px 12px;
	border-radius: 12px;
	max-width: 80%;
}

/* เวลาเล็กๆ ใต้ข้อความ */
.message.system .message-time {
	display: block;
	margin: 2px auto;
	font-size: 0.7rem;
	color: #999;
	text-align: center;
}

.btn-attach {
	padding: 0.4rem;
	border: none;
	background: #fff;
	cursor: pointer;
	border-radius: 4px;
	font-size: .875rem;
	letter-spacing: .057em;
	transition: box-shadow .42s cubic-bezier(.165, .84, .44, 1), color .42s
		cubic-bezier(.165, .84, .44, 1), background .42s
		cubic-bezier(.165, .84, .44, 1);
	height: 2.5rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	justify-content: center;
	margin: auto;
}

.btn-attach svg {
	width: 24px;
	height: 24px;
}

.message-attachments {
	display: flex;
	flex-direction: column;
	gap: 0.75rem; /* เว้นระหว่างไฟล์แต่ละอัน */
	margin: 0.5rem 0;
}

.message-attachments .attachment {
	display: flex;
	align-items: center;
	gap: 0;
	background: #f9f9f9; /* พื้นหลังเทาอ่อน */
	border: 1px solid #e0e0e0; /* เส้นขอบบาง */
	border-radius: 8px; /* มุมโค้ง */
	padding: 0.75rem;
	transition: background 0.2s ease;
}

.message-attachments .attachment:hover {
	background: #f0f8ff; /* ฟ้าอ่อนเมื่อ hover */
}

.message-attachments .attachment a.file-download-link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	min-height: 64px;
	color: #333;
	text-decoration: none;
}

.message-attachments .attachment a.file-download-link:hover svg {
	stroke: #007bff; /* เปลี่ยนสีไอคอนเมื่อ hover */
}

.message-attachments .attachment .content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.25rem;
	flex: 1;
	padding: 0.4rem;
}

.message-attachments .attachment .content .image-info {
	font-size: 0.95rem;
	font-weight: 500;
	color: #333;
	word-break: break-word; /* กันชื่อไฟล์ยาวเกิน */
}

.message-attachments .attachment .content .time-info {
	font-size: 0.8rem;
	color: #777;
}

#attachment-form textarea {
	flex: 1;
	min-height: 40px;
	max-height: 120px; /* กัน textarea สูงเกินไป */
	resize: none; /* ปิด resize ด้านข้าง */
	padding: 0.5rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 16px;
	margin: auto;
	width: 100%;
}

.signature-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
	width: -webkit-fill-available;
	padding: 0 0.5rem;
	position: relative;
}

.signature-wrapper canvas {
	width: -webkit-fill-available;
	border: 1px solid #ccc;
	border-radius: 6px;
}

.signature-buttons {
	display: flex;
	justify-content: flex-end;
	width: -webkit-fill-available;
	margin: 1rem 0.5rem 0;
}

.btn-clear {
	background-color: #f8f8f8;
	color: #333;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 4px 10px;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	width: 100%;
}

.btn-clear:hover {
	background-color: #f0f0f0;
}

.priority>span {
	padding: 0.4rem 0.75rem;
	border-radius: 17px;
}

.form-group.priority .flex-content span {
	padding: 0.2rem 0.75rem 0.2rem 0.75rem;
	border-radius: 17px;
}

.icon-no-image {
	--empty-primary: #9a9a9a;
	--empty-accent: #dff0d5;
	--empty-stroke: #dff0d5;
	--empty-text-fill: #239825;
}

.icon-no-data {
	--empty-primary: #9a9a9a;
	--empty-accent: #dff0d5;
	--empty-stroke: #dff0d5;
	--empty-text-fill: #239825;
}

.login-user-icon {
	text-align: center;
}

.login-user-icon .icon-group {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1rem;
}

.login-user-icon .btn {
	width: -webkit-fill-available;
	background-color: #c7f0d4;
	border: 1px solid #c7f0d4;
	text-align: center;
	cursor: pointer;
	display: flex;
	border-radius: 17px;
	padding: 1rem;
	gap: 1rem;
	justify-content: space-between;
}

.login-user-icon .btn:hover span {
	transform: scale(1.03);
	transition: all 0.2s ease;
}

.login-user-icon .btn img {
	width: 80px;
	height: 80px;
}

.login-user-icon .btn span {
	padding: 0.4rem;
	border-radius: 17px;
	display: inline-block;
	border: 0rem solid;
}

.login-user-icon .btn p {
	font-size: larger;
	font-weight: 500;
	margin: 0;
	width: 150px;
	text-align: justify;
	color: #2c4b61; /* สีข้อความเข้ม */
}

.login-user-icon .btn .content {
	font-size: smaller;
	font-weight: 400;
	color: #819caf;
	padding: 0;
	text-align: left;
}

.login-user-icon .btn.customer-icon span {
	background-color: #F8FAFC; /* ฟ้าอ่อนเทา */
	border-color: #2c4b61;
}

.login-user-icon .btn.technician-icon span {
	background-color: #ff8147;
	border-color: #f8f9f4;
}

.no-data {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.no-data>svg {
	width: 150px !important;
	max-width: 150px !important;
}

/* Bottom Navigation */
.bottom-nav-form-actions {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: #fff;
	border-top: 1px solid #ddd;
	display: flex;
	margin: 0 auto;
	z-index: 99;
	height: 3.5rem;
	align-items: center;
	padding-bottom: env(safe-area-inset-bottom);
	text-align: center;
}

.bottom-nav-form-actions .form-actions {
	flex-direction: row;
	max-width: 400px;
	margin: auto;
	width: 100%;
}

.bottom-nav-form-actions button {
	flex: 1;
}

.bottom-nav-form-actions a {
	flex: 1;
}

#map {
	z-index: 50;
}

.menu-bar {
	overflow-x: auto;
	white-space: nowrap;
	background: #fff;
	border-bottom: 1px solid #ddd;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
	width: -webkit-fill-available;
	scrollbar-width: none; /* สำหรับ Firefox */
	-ms-overflow-style: none; /* สำหรับ IE และ Edge เก่า */
}

.menu-container {
	display: flex;
	flex-wrap: nowrap;
	padding: 0.4rem;
	background: inherit;
	gap: 0.4rem;
	width: fit-content;
}

.menu-item {
	padding: 0.4rem 0.8rem;
	border: none;
	background: #fff6f3;
	font-size: small;
	cursor: pointer;
	color: #ff5934;
	transition: all 0.2s ease;
	margin: 0;
	border-radius: 17px;
}

.form-group>span.hint {
	display: flex;
	font-size: small;
	color: #ff6161;
}

.form-group input.form-control.flex-1 {
	flex: 1;
	justify-items: unset;
	text-align: right;
}

.switch-wrapper {
	display: inline-block;
	position: relative;
	width: 50px;
	height: 28px;
	margin-right: 0.8rem;
}

.switch-wrapper input {
	opacity: 0;
	width: 0;
	height: 0;
}

.switch-wrapper label.switch {
	position: absolute;
	cursor: pointer;
	background-color: #ccc;
	border-radius: 34px;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	transition: 0.3s;
	width: 22px;
	margin: inherit;
	height: inherit;
}

.switch::before {
	content: "";
	position: absolute;
	height: 22px;
	width: 22px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	border-radius: 50%;
	transition: 0.3s;
}

.switch-wrapper input:checked+.switch {
	background-color: #4CAF50; /* สีเมื่อเปิด */
}

.switch-wrapper input:checked+.switch::before {
	transform: translateX(22px);
}

.image-card audio {
	width: 100%;
	height: 120px;
	object-fit: cover;
}

audio::-webkit-media-controls-volume-slider, audio::-webkit-media-controls-mute-button
	{
	display: none !important;
}

.required-star {
	color: red;
	font-weight: bold;
}

#success-modal {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

#success-modal .modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	/* ✅ ปิดการกดทั้งหมดที่พื้นหลัง */
	pointer-events: all;
}

#success-modal .modal-content {
	position: relative;
	background: white;
	padding: 1.5rem 2rem;
	border-radius: 16px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	text-align: center;
	z-index: 1;
	animation: fadeIn 0.3s ease;
	width: 100%;
	margin: 0 1rem;
	max-width: 400px;
	transform: scale(0.7);
	opacity: 0;
	transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s
		ease;
}

#success-modal .modal-content.show {
	transform: scale(1);
	opacity: 1;
}

#success-modal .modal-icon {
	font-size: 3rem;
	color: #4BB543; /* สีเขียวสำเร็จ */
	margin-bottom: 0.5rem;
}

#success-modal .modal-message {
	font-size: 1rem;
	color: #333;
	margin-bottom: 1rem;
}

#success-modal .modal-close {
	background: #4BB543;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: bold;
}

#success-modal .modal-close:hover {
	background: #4BB543;
}

.fab {
	position: fixed;
	bottom: 3.0rem;
	right: 1.0rem;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: #007bff;
	color: white;
	border: none;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: background 0.3s, transform 0.2s;
	z-index: 99;
}

.fab:hover {
	background-color: #0056b3;
	transform: scale(1.05);
}

#error-modal {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

#error-modal .modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	/* ✅ ปิดการกดทั้งหมดที่พื้นหลัง */
	pointer-events: all;
}

#error-modal .modal-content {
	position: relative;
	background: white;
	padding: 1.5rem 2rem;
	border-radius: 16px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	text-align: center;
	z-index: 1;
	animation: fadeIn 0.3s ease;
	width: 100%;
	margin: 0 1rem;
	max-width: 400px;
	transform: scale(0.7);
	opacity: 0;
	transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s
		ease;
}

#error-modal .modal-content.show {
	transform: scale(1);
	opacity: 1;
}

#error-modal .modal-icon {
	font-size: 3rem;
	color: #e53935;
	margin-bottom: 0.5rem;
}

#error-modal .modal-message {
	font-size: 1rem;
	color: #333;
	margin-bottom: 1rem;
}

#error-modal .modal-close {
	background: #e53935;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: bold;
}

#error-modal .modal-close:hover {
	background: #d32f2f;
}

.form-control-wrapper {
	position: relative;
	margin-bottom: 0.5rem;
	justify-items: flex-start;
	width: -webkit-fill-available;
}