﻿/* 修改者：KevinHua
   修改日期：2026-10-31
   修改目的：一級選單高亮只認 active_btn，避免 aria-expanded 多亮
   =============================================================================
   SmartBusiness Theme v1.1 — 對齊 Oil 模組的專業／簡約／商務風格
   開關：Web.config EnableSbTheme=1
   - body.sb-theme：內容區主題（POS 結帳 Sales 除外）
   - body.sb-theme-dialogs：Dialog＋側欄字體（含 POS，始終開啟）
   內容區容器為 .dash__body（非 dash__right）。
   中文優先：Microsoft JhengHei UI／Microsoft JhengHei（微軟正黑體）
   ============================================================================= */

/* 變數同時掛在 sb-theme 與 sb-theme-dialogs，避免 POS 頁缺變數 */
.sb-theme,
.sb-theme-dialogs {
	/* 商務主色：與側欄 mean #2B55B1 同系，取代偏鮮的 Fluent #0078d4 */
	--sb-primary: #2b55b1;
	--sb-primary-hover: #244a9a;
	--sb-primary-pressed: #1d3d82;
	--sb-primary-soft: #e8eef8;
	/* 一級選中／懸停／強調：與按鈕同一商務藍 */
	--sb-nav-active-bg: var(--sb-primary);
	--sb-nav-active-hover: var(--sb-primary-hover);
	--sb-nav-hover-bg: var(--sb-primary-soft);
	--sb-nav-accent: var(--sb-primary);
	--sb-text: #1a1a2e;
	/* 輔助字用偏黑深灰，避免淺灰難辨識 */
	--sb-text-secondary: #323130;
	--sb-text-muted: #3b3a39;
	--sb-border: #e6e8ed;
	--sb-border-strong: #d0d4de;
	--sb-page-bg: #f7f9fc; /* 接近白的冷灰，降低視覺疲勞；白卡片／圖不突兀 */
	--sb-surface: #ffffff;
	--sb-surface-muted: #f3f2f1;
	--sb-thead: #e8edf3;
	--sb-row-hover: #f3f9fd;
	--sb-success: #107c10;
	--sb-success-hover: #0b6a0b;
	--sb-success-soft: #dff6dd;
	--sb-danger: #d13438;
	--sb-danger-hover: #a4262c;
	--sb-danger-soft: #fde7e9;
	--sb-warning: #8a6116;
	--sb-warning-hover: #6c4b0f;
	--sb-warning-soft: #fff4ce;
	--sb-radius: 4px;
	--sb-radius-lg: 8px;
	--sb-shadow: 0 1px 2px rgba(26, 26, 46, 0.05), 0 0 0 1px rgba(26, 26, 46, 0.02);
	--sb-input-shadow: 0 1px 2px rgba(26, 26, 46, 0.04);
	/* Open Sans（西文）＋微軟正黑體（繁中，筆畫均勻）；勿用 Nunito 作菜單／正文 */
	--sb-font: "Open Sans", "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
	/* 表頭／側欄繁中為主：正黑優先；字重改 --sb-thead-font-weight 即可全站調整 */
	--sb-thead-font: "Microsoft JhengHei UI", "Microsoft JhengHei", "Open Sans", "PingFang TC", "Noto Sans TC", sans-serif;
	--sb-thead-font-weight: 600;
	--sb-nav-font: "Microsoft JhengHei UI", "Microsoft JhengHei", "Open Sans", "PingFang TC", "Noto Sans TC", sans-serif;
	/* 正黑僅 Regular／Bold；一級／二級皆 16px（一級由 18 小一號） */
	--sb-nav-font-size: 16px;
	--sb-nav-font-size-l2: 16px;
	--sb-nav-font-weight: 600;
	--sb-title-font-weight: 600;
	--sb-btn-font: 14px;
	--sb-btn-pad-y: 5px;
	--sb-btn-pad-x: 14px;
}

/* ----- 母版：頂欄／側欄白；畫布冷灰；覆蓋 pos/style 的 nunito !important ----- */
body.sb-theme {
	background: var(--sb-page-bg);
	font-family: var(--sb-font) !important;
	font-weight: 400;
}

body.sb-theme .header,
body.sb-theme .dash__body {
	font-family: var(--sb-font) !important;
}

/* 側欄字體：掛在 sb-theme-dialogs（含 POS Sales），全站一致、不隨頁面跳動 */
body.sb-theme-dialogs .dash__left,
body.sb-theme-dialogs .dash__menu,
body.sb-theme-dialogs .dash_menu_title,
body.sb-theme-dialogs .dash__menu > ul > li > a,
body.sb-theme-dialogs .dash__menu > ul > li > a p,
body.sb-theme-dialogs .dash__menu .submenu li a {
	font-family: var(--sb-nav-font) !important;
}

body.sb-theme-dialogs .dash__menu > ul > li > a,
body.sb-theme-dialogs .dash__menu > ul > li > a p {
	font-size: var(--sb-nav-font-size, 16px) !important;
	font-weight: var(--sb-nav-font-weight, 600) !important;
	/* 輕描邊略補小字級筆畫；隨字重調低一併減弱 */
	-webkit-text-stroke: 0.2px currentColor;
	paint-order: stroke fill;
}

body.sb-theme-dialogs .dash__menu .submenu li a,
body.sb-theme-dialogs .dash__menu .submenu li a.active {
	font-size: var(--sb-nav-font-size-l2, 16px) !important;
	font-weight: var(--sb-nav-font-weight, 600) !important;
	-webkit-text-stroke: 0.2px currentColor;
	paint-order: stroke fill;
}

body.sb-theme .header,
body.sb-theme .dash__left {
	background: var(--sb-surface) !important;
}

body.sb-theme .dash,
body.sb-theme .dash__flex {
	background: var(--sb-page-bg) !important;
}

/* 側欄右緣收起箭頭：Fluent 圓鈕，貼在邊線上 */
body.sb-theme .sb-sidebar-toggle {
	border-color: var(--sb-border-strong);
	background: var(--sb-surface);
	color: var(--sb-text-secondary);
	box-shadow: 0 1px 2px rgba(26, 26, 46, 0.08), 0 0 0 1px rgba(26, 26, 46, 0.02);
}

body.sb-theme .sb-sidebar-toggle:hover {
	background: var(--sb-primary-soft);
	color: var(--sb-primary);
	border-color: var(--sb-primary);
	box-shadow: 0 2px 6px rgba(43, 85, 177, 0.16);
}

body.sb-theme .sb-sidebar-toggle:focus {
	box-shadow: 0 0 0 2px rgba(43, 85, 177, 0.28);
}

body.sb-theme .dash__left.activee .sb-sidebar-toggle {
	top: 28px;
}

/* =============================================================================
   側欄一級／二級選單：選中用商務藍（字重見上方 sb-theme-dialogs，全站統一）
   DOM：div.dash__menu > ul > li > a（勿用 .dash__menu > li，會選不中）
   ============================================================================= */
body.sb-theme .dash__menu > ul > li > a {
	height: 44px !important;
	margin: 2px 10px 6px !important;
	padding: 0 12px 0 12px !important;
	border-radius: 8px !important;
	border: 1px solid transparent !important;
	border-left: 3px solid transparent !important;
	background: transparent !important;
	color: var(--sb-text) !important;
	box-shadow: none !important;
	transition:
		background-color 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease,
		transform 0.16s ease;
}

body.sb-theme .dash__menu > ul > li > a p {
	color: inherit !important;
	transition: color 0.18s ease;
}

body.sb-theme .dash__menu > ul > li > a span img {
	transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
	opacity: 0.88;
}

/* 鼠標劃過：淡底＋左側細線，略微右移（字級沿用 mean 16px） */
body.sb-theme .dash__menu > ul > li > a:hover {
	background: var(--sb-nav-hover-bg) !important;
	border-color: #b4c4e0 !important;
	border-left-color: var(--sb-nav-accent) !important;
	color: var(--sb-nav-accent) !important;
	transform: translateX(2px);
	box-shadow: 0 1px 2px rgba(43, 85, 177, 0.1) !important;
}

body.sb-theme .dash__menu > ul > li > a:hover span img {
	opacity: 1;
	transform: scale(1.06);
	filter: none !important;
}

/* 選中：僅 active_btn 高亮（勿用 aria-expanded，否則展開多組會同時亮） */
body.sb-theme .dash__menu > ul > li > a.active_btn,
body.sb-theme .dash__menu > ul > li > a.active,
body.sb-theme .dash__menu a.active_btn {
	background: var(--sb-nav-active-bg) !important;
	border: 1px solid var(--sb-primary-hover) !important;
	border-left: 3px solid var(--sb-primary-pressed) !important;
	color: #fff !important;
	box-shadow: 0 1px 3px rgba(43, 85, 177, 0.22) !important;
	transform: none;
}

body.sb-theme .dash__menu > ul > li > a.active_btn p,
body.sb-theme .dash__menu > ul > li > a.active p,
body.sb-theme .dash__menu a.active_btn p {
	color: #fff !important;
	font-weight: var(--sb-nav-font-weight, 600) !important;
}

body.sb-theme .dash__menu > ul > li > a.active_btn img,
body.sb-theme .dash__menu > ul > li > a.active img,
body.sb-theme .dash__menu a.active_btn img {
	filter: invert(100%) sepia(0%) saturate(0%) brightness(104%) contrast(101%) !important;
	opacity: 1;
}

body.sb-theme .dash__menu > ul > li > a.active_btn:hover,
body.sb-theme .dash__menu > ul > li > a.active:hover,
body.sb-theme .dash__menu a.active_btn:hover {
	background: var(--sb-nav-active-hover) !important;
	border-left-color: var(--sb-primary-pressed) !important;
	color: #fff !important;
	transform: none;
}

/* 二級選單：間距／懸停（字級 16px、字重由 sb-theme-dialogs 統一） */
body.sb-theme .dash__menu .submenu {
	padding-left: 28px !important;
	margin: 0 8px 8px !important;
	border-left: 1px solid var(--sb-border);
	max-width: none !important;
}

body.sb-theme .dash__menu .submenu li a {
	margin: 2px 0 !important;
	padding: 7px 10px 7px 14px !important;
	height: auto !important;
	border-radius: 0 6px 6px 0 !important;
	border-left: 3px solid transparent !important;
	color: var(--sb-text) !important;
	background: transparent !important;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

body.sb-theme .dash__menu .submenu li a:hover {
	background: var(--sb-nav-hover-bg) !important;
	border-left-color: var(--sb-nav-accent) !important;
	color: var(--sb-nav-accent) !important;
	padding-left: 16px !important;
	border-radius: 0 6px 6px 0 !important;
}

body.sb-theme .dash__menu .submenu li a.active {
	background: transparent !important;
	border-left: 3px solid var(--sb-nav-accent) !important;
	color: var(--sb-nav-accent) !important;
	border-radius: 0 !important;
}

/* 側欄收合時：一級選單仍用商務藍高亮 */
body.sb-theme .dash__left.activee .dash__menu > ul > li > a.active_btn,
body.sb-theme .dash__left.activee .dash__menu > ul > li > a.active,
body.sb-theme .dash__left.activee .dash__menu a.active_btn {
	background: var(--sb-nav-active-bg) !important;
	color: #fff !important;
}

/* 側欄公司名：單行省略、寬度跟一級選單一致、配色貼合 Fluent */
body.sb-theme .dash_menu_title {
	margin: 0 0 12px !important;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

body.sb-theme .dash_menu_title h6 {
	margin: 0 !important;
	padding: 0 12px 0 14px !important;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	height: 36px !important;
	line-height: 36px !important;
	font-family: var(--sb-font);
	font-size: 0.8125rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em;
	color: var(--sb-text) !important;
	background: var(--sb-primary-soft) !important;
	border: 1px solid #d6e6f5 !important;
	border-left: 3px solid var(--sb-primary) !important;
	border-radius: 0 8px 8px 0;
}

body.sb-theme .header {
	border-bottom-color: #e1e4ea !important;
	padding-top: 8px;
	padding-bottom: 8px;
}

/* 右上角工具列：壓低 mean 原 24px 字級，語言／退出與身份垂直居中 */
body.sb-theme .header__right a {
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: var(--sb-text) !important;
	margin-left: 0 !important;
}

body.sb-theme .header__right a i {
	padding-bottom: 0 !important;
}

body.sb-theme .header__username {
	font-family: var(--sb-font);
	font-size: 18px !important;
	font-weight: 700 !important;
	color: var(--sb-text);
}

body.sb-theme .header__actions {
	border-left-color: #e1e4ea;
	gap: 10px;
}

body.sb-theme .header__lun {
	display: flex;
	align-items: center;
}

body.sb-theme .header__lun .nice-select {
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 36px !important;
	height: 36px !important;
	min-height: 36px !important;
	margin-left: 0 !important;
	padding: 0 30px 0 12px !important;
	border: 1px solid #e1e4ea !important;
	border-radius: 6px !important;
	background: #f7f9fc !important;
	color: var(--sb-text) !important;
}

body.sb-theme .header__lun .nice-select:after {
	border-color: #605e5c !important;
	height: 7px;
	width: 7px;
	right: 10px;
	margin-top: -5px;
}

body.sb-theme .header__logout {
	display: flex;
	align-items: center;
}

body.sb-theme .header__logout #btnLogout,
body.sb-theme .header__logout a {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	border: 1px solid transparent;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

body.sb-theme .header__logout #btnLogout:hover,
body.sb-theme .header__logout a:hover {
	background: #f3f6fa;
	border-color: #e1e4ea;
}

body.sb-theme .header__logout img {
	width: 28px;
	height: 28px;
	display: block;
}

body.sb-theme .site-role-badge .role-tag {
	font-family: var(--sb-font);
	background: var(--sb-primary-soft);
	color: var(--sb-primary);
}

body.sb-theme .site-role-badge .role-tag.manager {
	background: #fff4ce;
	color: #8a6116;
}

/* ----- 內容區：冷灰底（對齊原始 Wholesales/Edit 體感） ----- */
.sb-theme .dash__body {
	background: var(--sb-page-bg);
	font-family: var(--sb-font);
	color: var(--sb-text);
	text-align: left;
	box-sizing: border-box;
	/* 隨視窗微調左右內距，避免固定 40px 在窄屏擠、寬屏卻不伸展 */
	padding: 16px clamp(12px, 1.8vw, 24px) 48px !important;
}

/* ----- 版面：標題與內容預設靠左；取消全域 .container 居中限寬 ----- */
.sb-theme .dash__body .container,
.sb-theme .dash__body .container-fluid {
	max-width: 100% !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	text-align: left;
}

.sb-theme .dash__body .body-content {
	margin-top: 8px;
	max-width: 100% !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-bottom: 16px;
	text-align: left;
	box-sizing: border-box;
}

.sb-theme .dash__body h1,
.sb-theme .dash__body h2,
.sb-theme .dash__body h3,
.sb-theme .dash__body h4,
.sb-theme .dash__body .page-title,
.sb-theme .dash__body h2.clearfix,
.sb-theme .dash__body .clearfix {
	color: var(--sb-text);
	/* 標題繁中為主：正黑優先，與側欄同一套字形 */
	font-family: var(--sb-nav-font) !important;
	font-weight: var(--sb-title-font-weight, 600);
	letter-spacing: -0.01em;
	text-align: left !important;
}

.sb-theme .dash__body h2 {
	/* 略小於原 1.45rem，配合 650 讓標題視覺略細 */
	font-size: 1.35rem;
	margin-bottom: 0.75rem;
}

.sb-theme .dash__body form:not(.form-inline),
.sb-theme .dash__body .card,
.sb-theme .dash__body .panel,
.sb-theme .dash__body .alert {
	text-align: left;
}

.sb-theme .dash__body form,
.sb-theme .dash__body .table,
.sb-theme .dash__body table[id^="tbl"],
.sb-theme .dash__body .overflow-x,
.sb-theme .dash__body .overflowXauto,
.sb-theme .dash__body .table-responsive,
.sb-theme .dash__body .dataTables_wrapper {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

@media (max-width: 992px) {
	.sb-theme .dash__body {
		padding: 12px 12px 40px !important;
	}
}

/* ----- 篩選列／工具列：靠左，與頁面背景融合 ----- */
.sb-theme .dash__body #filterblk,
.sb-theme .dash__body .sb-filter-bar,
.sb-theme .dash__body .sb-page-header {
	text-align: left !important;
	width: 100%;
}

.sb-theme .dash__body #filterblk .justify-content-center,
.sb-theme .dash__body .sb-filter-bar .justify-content-center,
.sb-theme .dash__body form .justify-content-center,
.sb-theme .dash__body .row.justify-content-center {
	justify-content: flex-start !important;
}

.sb-theme .dash__body #filterblk .text-center,
.sb-theme .dash__body #filterblk .mx-auto,
.sb-theme .dash__body .sb-filter-bar .text-center,
.sb-theme .dash__body .sb-filter-bar .mx-auto,
.sb-theme .dash__body > .text-center,
.sb-theme .dash__body .body-content > .text-center {
	text-align: left !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.sb-theme .dash__body #filterblk,
.sb-theme .dash__body .sb-filter-bar {
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	padding: 4px 0 8px;
}

/* ----- 列表頁篩選工具列：靠左、關鍵字定寬，避免 form-control 被拉滿 ----- */
.sb-theme .dash__body .sb-list-filter {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	max-width: 100%;
}

.sb-theme .dash__body .sb-list-filter__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	width: 100%;
}

.sb-theme .dash__body .sb-list-filter__keyword,
.sb-theme .dash__body .sb-list-filter input.sb-list-filter__keyword.form-control {
	width: 16rem !important;
	max-width: min(16rem, 100%) !important;
	min-width: 12rem;
	flex: 0 1 16rem !important;
}

.sb-theme .dash__body .sb-list-filter__modes {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
}

.sb-theme .dash__body .sb-list-filter__modes .form-check-inline {
	margin-right: 0;
}

.sb-theme .dash__body .sb-list-filter__actions {
	gap: 10px;
}

.sb-theme .dash__body .sb-list-filter .sb-dates-range {
	margin: 0;
}

/* 取得最新記錄數：標籤＋下拉同一行（Enquiry／Attendance 等共用 partial） */
.sb-theme .dash__body .sb-latest-record-count {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
}

.sb-theme .dash__body .sb-latest-record-count label {
	margin-bottom: 0 !important;
	white-space: nowrap;
	font-size: 0.9rem !important;
	font-weight: 500 !important;
}

.sb-theme .dash__body .sb-latest-record-count #drpLatestRecordCount,
.sb-theme .dash__body .sb-latest-record-count select.form-control {
	width: 6.5rem !important;
	max-width: 6.5rem !important;
	min-width: 5rem;
	flex: 0 0 6.5rem !important;
	display: inline-block !important;
}

/* 獨立設計的窄卡表單（CreateVipUser 等）：改為全寬靠左自適應 */
.sb-theme .dash__body .sb-form-card,
.sb-theme .dash__body > .card,
.sb-theme .dash__body .body-content > .card {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.sb-theme .dash__body .row > [class*="col-md-6"].mx-auto,
.sb-theme .dash__body .row > [class*="col-md-8"],
.sb-theme .dash__body .row > [class*="col-md-6"]:only-child {
	/* 若頁面仍包在置中 row 內，拉開可用寬度 */
	max-width: 100%;
}

.sb-theme .dash__body .row.justify-content-center > [class*="col-md-"] {
	flex: 0 0 100%;
	max-width: 100%;
}

/* 無外邊框表單區：靠左、適中寬度，避免拉滿整屏 */
.sb-theme .dash__body .sb-form-panel {
	max-width: 720px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
}

.sb-theme .dash__body .log-section,
.sb-theme .dash__body .sb-panel {
	background: transparent;
}

/* =============================================================================
   設定頁表單標準（sb-settings）— BasicSettings 為範本，其他設定頁複用
   結構：.sb-settings > .sb-settings__banner / __section / __actions
   ============================================================================= */
.sb-theme .dash__body .sb-settings,
.sb-settings {
	max-width: none;
	width: 95%;
	margin: 0;
	padding: 0 0 72px;
	font-family: var(--sb-font, "Segoe UI", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif);
	color: var(--sb-text, #1a1a2e);
	text-align: left;
}

.sb-theme .dash__body .sb-settings > h2,
.sb-settings > h2 {
	margin: 0 0 12px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--sb-text, #1a1a2e);
	text-align: left;
}

.sb-settings__banner {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 20px;
	padding: 10px 14px;
	border: 1px solid #b4c4e0;
	border-radius: 6px;
	background: var(--sb-primary-soft, #e8eef8);
	color: #1a2f5c;
	font-size: 13px;
	line-height: 1.45;
}

.sb-settings__banner strong {
	font-weight: 700;
}

.sb-settings__section {
	margin: 0 0 18px;
	padding: 18px 20px 8px;
	border: 1px solid var(--sb-border, #e6e8ed);
	border-radius: 8px;
	background: var(--sb-surface, #fff);
	box-shadow: var(--sb-shadow, 0 1px 2px rgba(26, 26, 46, 0.05));
}

.sb-settings__section-title {
	margin: 0 0 14px;
	padding: 0 0 10px;
	border-bottom: 1px solid var(--sb-border, #e6e8ed);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--sb-text, #1a1a2e);
}

.sb-settings__field {
	display: grid;
	grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
	gap: 8px 20px;
	align-items: start;
	margin: 0 0 16px;
}

.sb-settings__field > label,
.sb-settings__label {
	margin: 0;
	padding-top: 7px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--sb-text-secondary, #605e5c);
}

.sb-settings__control {
	min-width: 0;
	width: 100%;
	text-align: left;
}

.sb-settings__control .form-control,
.sb-settings__control select.form-control,
.sb-settings__control textarea.form-control {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: auto;
	text-align: left;
}

.sb-settings__hint {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--sb-text-muted, #3b3a39);
}

.sb-settings__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	align-items: center;
}

.sb-settings__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 10px;
	border: 1px solid var(--sb-border, #e6e8ed);
	border-radius: 6px;
	background: var(--sb-page-bg, #f7f9fc);
	min-height: 34px;
}

.sb-settings__check .form-check-input {
	margin: 0;
	position: static;
}

.sb-settings__check .form-check-label {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--sb-text, #1a1a2e);
	cursor: pointer;
}

.sb-settings__inline {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 20px;
	align-items: center;
}

.sb-settings__inline .form-inline,
.sb-settings__pair {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sb-settings__pair > span,
.sb-settings__pair > label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--sb-text-secondary, #605e5c);
	white-space: nowrap;
}

.sb-settings__pair .form-control {
	width: 14rem;
	max-width: 100%;
	text-align: left;
}

.sb-settings__radios {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	align-items: center;
	padding-top: 4px;
}

.sb-settings__radios .form-check-inline {
	margin: 0;
	padding: 6px 10px;
	border: 1px solid transparent;
	border-radius: 6px;
}

.sb-settings__actions {
	display: flex;
	justify-content: flex-start;
	gap: 10px;
	margin-top: 8px;
	padding-top: 4px;
}

.sb-settings__actions .btn {
	min-width: 7rem;
}

@media (max-width: 720px) {
	.sb-theme .dash__body .sb-settings,
	.sb-settings {
		width: 100%;
	}

	.sb-settings__field {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.sb-settings__field > label,
	.sb-settings__label {
		padding-top: 0;
	}

	.sb-settings__control .form-control,
	.sb-settings__control select.form-control,
	.sb-settings__control textarea.form-control {
		max-width: 100%;
	}
}

/* ----- DataTables／條紋表：與主題淺灰底協調，避免白塊突兀 ----- */
.sb-theme .dash__body .dataTables_wrapper {
	background: var(--sb-surface);
	border: 1px solid var(--sb-border);
	border-radius: var(--sb-radius-lg);
	box-shadow: var(--sb-shadow);
	padding: 12px 14px 8px;
	color: #000000;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_length,
.sb-theme .dash__body .dataTables_wrapper .dataTables_filter,
.sb-theme .dash__body .dataTables_wrapper .dataTables_info,
.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate {
	color: #000000 !important;
	font-size: 13px;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_filter input,
.sb-theme .dash__body .dataTables_wrapper .dataTables_length select {
	border: 1px solid var(--sb-border-strong) !important;
	border-radius: 8px !important;
	padding: 4px 8px !important;
	background: #fff !important;
	color: #000 !important;
	box-shadow: var(--sb-input-shadow) !important;
}

.sb-theme .dash__body table.dataTable,
.sb-theme .dash__body table.dataTable.no-footer {
	border: none !important;
	box-shadow: none !important;
	background: transparent !important;
	width: 100% !important;
}

.sb-theme .dash__body table.dataTable thead th,
.sb-theme .dash__body table.dataTable thead td {
	background: var(--sb-thead) !important;
	color: #000000 !important;
	font-family: var(--sb-thead-font) !important;
	font-weight: var(--sb-thead-font-weight, 600) !important;
	font-size: 14px !important;
	letter-spacing: 0 !important;
	border-left: none !important;
	border-right: none !important;
	border-bottom: 1px solid #d8dee8 !important;
	padding: 10px 12px !important;
}

.sb-theme .dash__body table.dataTable tbody td {
	color: #000000 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	border-top: none !important;
	border-left: none !important;
	border-right: none !important;
	border-bottom: 1px solid #eef0f4 !important;
	padding: 9px 12px !important;
	background: transparent !important;
}

.sb-theme .dash__body table.dataTable.stripe tbody tr.odd,
.sb-theme .dash__body table.dataTable.display tbody tr.odd,
.sb-theme .dash__body table.dataTable.stripe tbody tr.odd > .sorting_1,
.sb-theme .dash__body table.dataTable.display tbody tr.odd > .sorting_1,
.sb-theme .dash__body .table-striped tbody tr:nth-of-type(odd) td:not([class*="statusbg"]):not(.paidout):not(.cancelled):not(.pending4payment) {
	background-color: #fafbfc !important;
}

.sb-theme .dash__body table.dataTable.hover tbody tr:hover,
.sb-theme .dash__body table.dataTable.hover tbody tr:hover > .sorting_1,
.sb-theme .dash__body table.dataTable.display tbody tr:hover,
.sb-theme .dash__body table.dataTable.display tbody tr:hover > .sorting_1,
.sb-theme .dash__body table.dataTable tbody tr:hover td {
	background-color: var(--sb-row-hover) !important;
}

.sb-theme .dash__body table.dataTable.no-footer,
.sb-theme .dash__body .dataTables_wrapper.no-footer .dataTables_scrollBody {
	border-bottom: none !important;
}

/* table-responsive 包在 DataTables 外時避免雙層白框 */
.sb-theme .dash__body .dataTables_wrapper .table-responsive,
.sb-theme .dash__body .table-responsive .dataTables_wrapper {
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 0;
}

.sb-theme .dash__body .table-responsive:not(:has(.dataTables_wrapper)) {
	background: var(--sb-surface);
	border: 1px solid var(--sb-border);
	border-radius: var(--sb-radius-lg);
	box-shadow: var(--sb-shadow);
}

/* 欄位標籤：對齊原始 Edit 頁（清晰、偏粗）；勿套用 Oil 的 0.72rem 小標籤 */
.sb-theme .dash__body label:not(.form-check-label):not(.small),
.sb-theme .dash__body .control-label,
.sb-theme .dash__body .form-label,
.sb-theme .dash__body .col-form-label {
	font-family: var(--sb-font);
	font-weight: 600;
	font-size: 0.95rem; /* ~15px，明顯大於備註／help 小字 */
	line-height: 1.35;
	color: var(--sb-text);
	letter-spacing: -0.01em;
}

/* 備註／說明／輔助小字：略小但用偏黑深灰，保證可讀 */
.sb-theme .dash__body .form-text,
.sb-theme .dash__body small,
.sb-theme .dash__body .small,
.sb-theme .dash__body label.small,
.sb-theme .dash__body .help-block,
.sb-theme .dash__body .text-muted,
.sb-theme .dash__body .sb-settings__hint {
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--sb-text-muted, #3b3a39) !important;
}

/* =============================================================================
   按鈕體系（Windows Fluent 商務風）
   角色：提交／搜尋＝Accent；新增＝Accent；重載＝Standard；
         匯出 Excel＝Success 輕量；列印＝Standard；刪除＝Danger 輕量
   表格內按鈕不套用工具列尺寸（避免影響列寬）
   ============================================================================= */
.sb-theme .dash__body .btn,
.sb-theme .dash__body a.btn,
.sb-theme .dash__body button.btn,
.sb-theme .dash__body input.btn,
.sb-theme .dash__body .btn-deep-blue {
	border-radius: var(--sb-radius) !important;
	font-family: var(--sb-font) !important;
	font-weight: 600 !important;
	font-size: var(--sb-btn-font) !important;
	padding: var(--sb-btn-pad-y) var(--sb-btn-pad-x) !important;
	border-width: 1px !important;
	border-style: solid !important;
	box-shadow: none !important;
	transform: none !important;
	min-height: 32px;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.35;
	letter-spacing: 0;
}

.sb-theme .dash__body .btn-sm,
.sb-theme .dash__body .btnsmall,
.sb-theme .dash__body .btnexsmall,
.sb-theme .dash__body .btnsmall40,
.sb-theme .dash__body .btnsmall50,
.sb-theme .dash__body .btnsmall60,
.sb-theme .dash__body .btnsmall70,
.sb-theme .dash__body .btnsmall80 {
	padding: 3px 12px !important;
	font-size: 13px !important;
	min-height: 28px;
	border-radius: var(--sb-radius) !important;
}

/* 搜尋／重新載入圖示鈕：固定方鈕，壓過上方 btn 通用 padding */
.sb-theme .dash__body .sb-icon-btn,
.sb-theme .dash__body button.sb-icon-btn,
.sb-theme .dash__body a.sb-icon-btn {
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	padding: 0 !important;
	margin-left: 6px !important;
	margin-right: 0 !important;
	font-size: 14px !important;
	line-height: 1 !important;
	border-radius: 6px !important;
}
.sb-theme .dash__body .sb-icon-btn > i {
	margin: 0 !important;
	font-size: 14px !important;
}

/* —— Accent：提交／搜尋／新增／主操作 —— */
.sb-theme .dash__body .btn-primary,
.sb-theme .dash__body .btn-info,
.sb-theme .dash__body .btn-deep-blue,
.sb-theme .dash__body a.btn-primary,
.sb-theme .dash__body a.btn-info,
.sb-theme .dash__body #btnSearch,
.sb-theme .dash__body #btnSubmit,
.sb-theme .dash__body button[type="submit"].btn:not(.btn-danger):not(.btn-secondary):not(.btn-default),
.sb-theme .dash__body h2 > a.btn,
.sb-theme .dash__body h2 > .btn {
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	color: #fff !important;
}

.sb-theme .dash__body .btn-primary:hover,
.sb-theme .dash__body .btn-primary:focus,
.sb-theme .dash__body .btn-info:hover,
.sb-theme .dash__body .btn-info:focus,
.sb-theme .dash__body .btn-deep-blue:hover,
.sb-theme .dash__body .btn-deep-blue:focus,
.sb-theme .dash__body a.btn-primary:hover,
.sb-theme .dash__body a.btn-info:hover,
.sb-theme .dash__body #btnSearch:hover,
.sb-theme .dash__body #btnSubmit:hover,
.sb-theme .dash__body h2 > a.btn:hover,
.sb-theme .dash__body h2 > .btn:hover {
	background: var(--sb-primary-hover) !important;
	border-color: var(--sb-primary-hover) !important;
	color: #fff !important;
}

.sb-theme .dash__body .btn-primary:active,
.sb-theme .dash__body .btn-info:active,
.sb-theme .dash__body #btnSearch:active,
.sb-theme .dash__body #btnSubmit:active {
	background: var(--sb-primary-pressed) !important;
	border-color: var(--sb-primary-pressed) !important;
}

/* —— Standard：重載／取消／次要 —— */
.sb-theme .dash__body .btn-secondary,
.sb-theme .dash__body .btn-default,
.sb-theme .dash__body .btn-light,
.sb-theme .dash__body .btn-outline-secondary,
.sb-theme .dash__body #btnReload,
.sb-theme .dash__body #btnCancel {
	background: #ffffff !important;
	border-color: #8a8886 !important;
	color: #323130 !important;
}

.sb-theme .dash__body .btn-secondary:hover,
.sb-theme .dash__body .btn-default:hover,
.sb-theme .dash__body .btn-light:hover,
.sb-theme .dash__body .btn-outline-secondary:hover,
.sb-theme .dash__body #btnReload:hover,
.sb-theme .dash__body #btnCancel:hover {
	background: var(--sb-surface-muted) !important;
	border-color: #8a8886 !important;
	color: #201f1e !important;
}

/* Reload 即使帶 btn-info 也走 Standard */
.sb-theme .dash__body #btnReload.btn-info,
.sb-theme .dash__body #btnReload.btn-primary {
	background: #ffffff !important;
	border-color: #8a8886 !important;
	color: #323130 !important;
}

.sb-theme .dash__body #btnReload.btn-info:hover,
.sb-theme .dash__body #btnReload.btn-primary:hover {
	background: var(--sb-surface-muted) !important;
	color: #201f1e !important;
}

/* —— 匯出 Excel：柔和成功色（非高飽和填色） —— */
.sb-theme .dash__body .btn-success,
.sb-theme .dash__body #btnExport,
.sb-theme .dash__body #btnExportExcel,
.sb-theme .dash__body [id*="ExportExcel"],
.sb-theme .dash__body [id*="btnExport"]:not([id*="Logs"]),
.sb-theme .dash__body .btn:has(> .fa-file-excel),
.sb-theme .dash__body .btn:has(> .fas.fa-file-excel),
.sb-theme .dash__body a.btn:has(> .fa-file-excel) {
	background: var(--sb-success-soft) !important;
	border-color: #9fd89f !important;
	color: var(--sb-success) !important;
}

.sb-theme .dash__body .btn-success:hover,
.sb-theme .dash__body .btn-success:focus,
.sb-theme .dash__body #btnExport:hover,
.sb-theme .dash__body #btnExportExcel:hover,
.sb-theme .dash__body [id*="ExportExcel"]:hover,
.sb-theme .dash__body [id*="btnExport"]:not([id*="Logs"]):hover,
.sb-theme .dash__body .btn:has(> .fa-file-excel):hover,
.sb-theme .dash__body a.btn:has(> .fa-file-excel):hover {
	background: #c9efc7 !important;
	border-color: var(--sb-success) !important;
	color: var(--sb-success-hover) !important;
}

/* Search 若誤用 btn-success，仍走 Accent */
.sb-theme .dash__body #btnSearch.btn-success,
.sb-theme .dash__body #btnSubmit.btn-success {
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	color: #fff !important;
}

.sb-theme .dash__body #btnSearch.btn-success:hover,
.sb-theme .dash__body #btnSubmit.btn-success:hover {
	background: var(--sb-primary-hover) !important;
	border-color: var(--sb-primary-hover) !important;
	color: #fff !important;
}

/* —— 列印：Standard + 主色字 —— */
.sb-theme .dash__body #btnPrint,
.sb-theme .dash__body [id*="btnPrint"],
.sb-theme .dash__body .btn:has(> .fa-print),
.sb-theme .dash__body .btn:has(> .fas.fa-print),
.sb-theme .dash__body a.btn:has(> .fa-print) {
	background: #ffffff !important;
	border-color: #8a8886 !important;
	color: var(--sb-primary) !important;
}

.sb-theme .dash__body #btnPrint:hover,
.sb-theme .dash__body [id*="btnPrint"]:hover,
.sb-theme .dash__body .btn:has(> .fa-print):hover,
.sb-theme .dash__body a.btn:has(> .fa-print):hover {
	background: var(--sb-primary-soft) !important;
	border-color: var(--sb-primary) !important;
	color: var(--sb-primary-hover) !important;
}

/* —— 刪除：柔和危險色 —— */
.sb-theme .dash__body .btn-danger,
.sb-theme .dash__body #btnDelete,
.sb-theme .dash__body [id*="btnDelete"],
.sb-theme .dash__body .btn:has(> .fa-trash),
.sb-theme .dash__body .btn:has(> .fa-trash-can),
.sb-theme .dash__body .btn:has(> .fas.fa-trash) {
	background: var(--sb-danger-soft) !important;
	border-color: #f1bbbc !important;
	color: var(--sb-danger) !important;
}

.sb-theme .dash__body .btn-danger:hover,
.sb-theme .dash__body .btn-danger:focus,
.sb-theme .dash__body #btnDelete:hover,
.sb-theme .dash__body [id*="btnDelete"]:hover,
.sb-theme .dash__body .btn:has(> .fa-trash):hover,
.sb-theme .dash__body .btn:has(> .fa-trash-can):hover {
	background: #f9d2d3 !important;
	border-color: var(--sb-danger) !important;
	color: var(--sb-danger-hover) !important;
}

/* Warning：內斂琥珀（非霓虹黃） */
.sb-theme .dash__body .btn-warning {
	background: var(--sb-warning-soft) !important;
	border-color: #f0d185 !important;
	color: var(--sb-warning) !important;
}

.sb-theme .dash__body .btn-warning:hover {
	background: #ffe9a8 !important;
	border-color: var(--sb-warning) !important;
	color: var(--sb-warning-hover) !important;
}

.sb-theme .dash__body .btn-outline-primary {
	background: #ffffff !important;
	border-color: var(--sb-primary) !important;
	color: var(--sb-primary) !important;
}

.sb-theme .dash__body .btn-outline-primary:hover {
	background: var(--sb-primary-soft) !important;
	color: var(--sb-primary-hover) !important;
}

.sb-theme .dash__body .btn:disabled,
.sb-theme .dash__body .btn.disabled {
	opacity: 0.45 !important;
	cursor: not-allowed !important;
}

/* —— 表格內按鈕：接近原 Bootstrap 尺寸；純圖示鈕改正方形加大點擊區 —— */
.sb-theme .dash__body table .btn,
.sb-theme .dash__body table a.btn,
.sb-theme .dash__body table button.btn,
.sb-theme .dash__body .dataTables_wrapper table .btn,
.sb-theme .dash__body td .btn,
.sb-theme .dash__body th .btn {
	font-size: 14px !important;
	font-weight: 500 !important;
	padding: 0.375rem 0.75rem !important;
	min-height: 32px !important;
	min-width: 32px;
	line-height: 1.2 !important;
	gap: 4px !important;
	border-radius: var(--sb-radius) !important;
	box-sizing: border-box;
}

/* 僅一個圖示元素時（文字節點也算）：固定 32 方塊，只顯示圖示 */
.sb-theme .dash__body table .btn:has(> i:only-child),
.sb-theme .dash__body table .btn:has(> .fa:only-child),
.sb-theme .dash__body table .btn:has(> .fas:only-child),
.sb-theme .dash__body table .btn:has(> .far:only-child),
.sb-theme .dash__body table .btn:has(> span.fa:only-child),
.sb-theme .dash__body table .btn:has(> span.fas:only-child),
.sb-theme .dash__body table a.btn:has(> i:only-child),
.sb-theme .dash__body table a.btn:has(> .fa:only-child),
.sb-theme .dash__body table a.btn:has(> span.fa:only-child) {
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	max-width: 32px !important;
	padding: 0 !important;
	font-size: 0 !important; /* 隱藏旁掛文字節點，避免擠進方塊變形 */
	gap: 0 !important;
	overflow: hidden;
	white-space: nowrap;
}

.sb-theme .dash__body table .btn:has(> i:only-child) > i,
.sb-theme .dash__body table .btn:has(> .fa:only-child) > .fa,
.sb-theme .dash__body table .btn:has(> .fas:only-child) > .fas,
.sb-theme .dash__body table .btn:has(> .far:only-child) > .far,
.sb-theme .dash__body table .btn:has(> span.fa:only-child) > span.fa,
.sb-theme .dash__body table .btn:has(> span.fas:only-child) > span.fas,
.sb-theme .dash__body table a.btn:has(> i:only-child) > i,
.sb-theme .dash__body table a.btn:has(> .fa:only-child) > .fa,
.sb-theme .dash__body table a.btn:has(> span.fa:only-child) > span.fa {
	font-size: 14px !important;
	line-height: 1 !important;
	margin: 0 !important;
	width: auto !important;
}

/* 表格內還原較中性的 Bootstrap 語義色，避免工具列柔和色佔滿單元格 */
.sb-theme .dash__body table .btn-primary,
.sb-theme .dash__body table .btn-info,
.sb-theme .dash__body table a.btn-primary,
.sb-theme .dash__body table a.btn-info {
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	color: #fff !important;
}

.sb-theme .dash__body table .btn-success {
	background: #107c10 !important;
	border-color: #107c10 !important;
	color: #fff !important;
}

.sb-theme .dash__body table .btn-danger {
	background: #d13438 !important;
	border-color: #d13438 !important;
	color: #fff !important;
}

.sb-theme .dash__body table .btn-secondary,
.sb-theme .dash__body table .btn-default {
	background: #fff !important;
	border-color: #8a8886 !important;
	color: #323130 !important;
}

.sb-theme .dash__body table .btn-warning {
	background: #fff4ce !important;
	border-color: #f0d185 !important;
	color: #8a6116 !important;
}

/* =============================================================================
   表格：橫向分隔為主（對齊 Oil），去掉突兀豎線；外框／陰影更輕
   ============================================================================= */
.sb-theme .dash__body table.table,
.sb-theme .dash__body .table,
.sb-theme .dash__body table[id^="tbl"] {
	width: 100%;
	background: var(--sb-surface) !important;
	border: 1px solid #e6e8ed !important;
	border-radius: var(--sb-radius-lg);
	border-collapse: separate !important;
	border-spacing: 0;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(26, 26, 46, 0.04);
	font-size: 14px !important;
	color: #000000;
}

.sb-theme .dash__body table.table thead,
.sb-theme .dash__body .table thead,
.sb-theme .dash__body table[id^="tbl"] thead {
	background: var(--sb-thead) !important;
}

.sb-theme .dash__body table.table thead th,
.sb-theme .dash__body table.table thead td,
.sb-theme .dash__body .table thead th,
.sb-theme .dash__body .table thead td,
.sb-theme .dash__body table[id^="tbl"] thead th,
.sb-theme .dash__body table[id^="tbl"] thead td,
.sb-theme .dash__body #tblCustomer thead th,
.sb-theme .dash__body #tblGrid thead th,
.sb-theme .dash__body #tblGridm thead th,
.sb-theme .dash__body #tblItem thead th,
.sb-theme .dash__body thead.gray-header th,
.sb-theme .dash__body tr.gray-header th,
.sb-theme .dash__body .gray-header th {
	background: var(--sb-thead) !important;
	color: #000000 !important;
	/* 全站表頭：正黑優先＋--sb-thead-font-weight（500 在正黑會落 Regular 偏細） */
	font-family: var(--sb-thead-font) !important;
	font-weight: var(--sb-thead-font-weight, 600) !important;
	letter-spacing: 0 !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	border: none !important;
	border-bottom: 1px solid #d8dee8 !important;
	padding: 10px 12px !important;
	vertical-align: middle !important;
	white-space: nowrap;
	/* 預設靠左；勿 !important，以免蓋掉 text-right／text-center */
	text-align: left;
}

/* 表頭對齊與 Bootstrap／內容列一致 */
.sb-theme .dash__body table thead th.text-right,
.sb-theme .dash__body table thead th.text-end,
.sb-theme .dash__body table thead td.text-right,
.sb-theme .dash__body table thead td.text-end,
.sb-theme .dash__body table[id^="tbl"] thead th.text-right,
.sb-theme .dash__body table[id^="tbl"] thead th.text-end,
.sb-theme .dash__body table.dataTable thead th.text-right,
.sb-theme .dash__body table.dataTable thead th.text-end {
	text-align: right !important;
}

.sb-theme .dash__body table thead th.text-center,
.sb-theme .dash__body table thead td.text-center,
.sb-theme .dash__body table[id^="tbl"] thead th.text-center,
.sb-theme .dash__body table.dataTable thead th.text-center {
	text-align: center !important;
}

.sb-theme .dash__body table thead th.text-left,
.sb-theme .dash__body table thead th.text-start,
.sb-theme .dash__body table[id^="tbl"] thead th.text-left,
.sb-theme .dash__body table[id^="tbl"] thead th.text-start {
	text-align: left !important;
}

.sb-theme .dash__body table.table td,
.sb-theme .dash__body .table td,
.sb-theme .dash__body table[id^="tbl"] td,
.sb-theme .dash__body table.table th,
.sb-theme .dash__body .table th,
.sb-theme .dash__body table[id^="tbl"] th {
	padding: 9px 12px !important;
	border-top: none !important;
	border-left: none !important;
	border-right: none !important;
	border-bottom: 1px solid #eef0f4 !important;
	color: #000000 !important;
	vertical-align: middle !important;
	background-color: transparent;
	font-size: 14px !important;
	line-height: 1.4 !important;
	font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Open Sans", "Segoe UI", sans-serif;
}

/* 表格內容字重：與客戶列表一致，略加粗以利辨識 */
.sb-theme .dash__body table.table tbody td,
.sb-theme .dash__body .table tbody td,
.sb-theme .dash__body table[id^="tbl"] tbody td,
.sb-theme .dash__body table.dataTable tbody td {
	font-weight: 500 !important;
}

/* 內容對齊 utility（確保不被其他規則蓋掉） */
.sb-theme .dash__body table td.text-right,
.sb-theme .dash__body table td.text-end,
.sb-theme .dash__body table th.text-right,
.sb-theme .dash__body table th.text-end {
	text-align: right !important;
}

.sb-theme .dash__body table td.text-center,
.sb-theme .dash__body table th.text-center {
	text-align: center !important;
}

.sb-theme .dash__body table td.text-left,
.sb-theme .dash__body table td.text-start,
.sb-theme .dash__body table th.text-left,
.sb-theme .dash__body table th.text-start {
	text-align: left !important;
}

/* Bootstrap table-bordered／預設單元格豎線一律取消 */
.sb-theme .dash__body table.table-bordered,
.sb-theme .dash__body .table-bordered {
	border: 1px solid #e6e8ed !important;
}

.sb-theme .dash__body table.table-bordered > :not(caption) > * > *,
.sb-theme .dash__body .table-bordered > :not(caption) > * > *,
.sb-theme .dash__body table.table > :not(caption) > * > *,
.sb-theme .dash__body .table > :not(caption) > * > *,
.sb-theme .dash__body table[id^="tbl"] > :not(caption) > * > *,
.sb-theme .dash__body table.dataTable thead th,
.sb-theme .dash__body table.dataTable thead td,
.sb-theme .dash__body table.dataTable tbody td {
	border-left: none !important;
	border-right: none !important;
}

.sb-theme .dash__body table.table-bordered > :not(caption) > *,
.sb-theme .dash__body .table-bordered > :not(caption) > * {
	border-width: 0 !important;
}

/* 狀態色儲存格：保留／覆寫為統一柔和色（勿被 transparent 蓋掉） */
.sb-theme .dash__body table td[class*="statusbg"],
.sb-theme .dash__body table td[class*="Statusbg"],
.sb-theme .dash__body table td.paidout,
.sb-theme .dash__body table td.cancelled,
.sb-theme .dash__body table td.pending4payment {
	font-weight: 600 !important;
	border-radius: 0;
}

.sb-theme .dash__body table.table tbody tr:last-child td,
.sb-theme .dash__body table[id^="tbl"] tbody tr:last-child td {
	border-bottom: none !important;
}

.sb-theme .dash__body table.table tbody tr:hover td:not([class*="statusbg"]):not(.paidout):not(.cancelled):not(.pending4payment),
.sb-theme .dash__body .table-hover tbody tr:hover td:not([class*="statusbg"]):not(.paidout):not(.cancelled):not(.pending4payment),
.sb-theme .dash__body table[id^="tbl"] tbody tr:hover td:not([class*="statusbg"]):not(.paidout):not(.cancelled):not(.pending4payment),
.sb-theme .dash__body #tblGridm.table tbody tr:hover td:not([class*="statusbg"]) {
	background: var(--sb-row-hover) !important;
}

.sb-theme .dash__body table tbody tr:hover td[class*="statusbg"],
.sb-theme .dash__body table tbody tr:hover td.paidout,
.sb-theme .dash__body table tbody tr:hover td.cancelled,
.sb-theme .dash__body table tbody tr:hover td.pending4payment {
	/* 保留狀態底色，僅略微加深 */
	filter: brightness(0.97);
}

.sb-theme .dash__body .table-striped tbody tr:nth-of-type(odd) td:not([class*="statusbg"]):not(.paidout):not(.cancelled):not(.pending4payment) {
	background-color: #fafbfc;
}

.sb-theme .dash__body .table .colheader,
.sb-theme .dash__body table[id^="tbl"] .colheader {
	color: #000000 !important;
	cursor: pointer;
}

/* 表格右上角 Total／筆數：標籤與數字同一字重，避免一細一粗 */
.sb-theme .dash__body .total-count-display,
.sb-theme .dash__body .total-badge {
	font-family: var(--sb-thead-font);
	font-weight: 500 !important;
	font-size: 0.95rem;
	color: var(--sb-text);
	letter-spacing: 0;
}

.sb-theme .dash__body .total-badge strong,
.sb-theme .dash__body .total-badge b,
.sb-theme .dash__body .total-badge__num {
	font-weight: 500 !important;
}

/* 排序箭頭：th 上掛 fa fa-sort-up/down；勿被表頭 Nunito !important 蓋掉圖標字體 */
.sb-theme .dash__body table thead th.fa::before,
.sb-theme .dash__body table thead th.fas::before,
.sb-theme .dash__body table thead th.far::before,
.sb-theme .dash__body table thead th.fal::before,
body.sb-theme-dialogs table thead th.fa::before,
body.sb-theme-dialogs table thead th.fas::before,
body.sb-theme-dialogs .gray-header th.fa::before {
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
	font-weight: 900 !important;
	font-style: normal !important;
	display: inline-block;
	margin-right: 0.35em;
	speak: never;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* 包一層類似 Oil 的表外框感（列表頁常見 overflow 容器） */
.sb-theme .dash__body .overflow-x,
.sb-theme .dash__body .overflowXauto,
.sb-theme .dash__body .table-responsive {
	background: var(--sb-surface);
	border: 1px solid var(--sb-border);
	border-radius: var(--sb-radius-lg);
	box-shadow: var(--sb-shadow);
	overflow-x: auto;
}

.sb-theme .dash__body .overflow-x > table,
.sb-theme .dash__body .overflowXauto > table,
.sb-theme .dash__body .table-responsive > table {
	border: none !important;
	box-shadow: none;
	border-radius: 0;
}

/* =============================================================================
   表單
   ============================================================================= */
.sb-theme .dash__body .form-control,
.sb-theme .dash__body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(.flex):not(.paymenttype),
.sb-theme .dash__body select:not(.flex):not(.select2-hidden-accessible),
.sb-theme .dash__body textarea:not(.flex) {
	max-width: none;
	padding: 6px 10px;
	border-radius: 8px !important;
	border: 1px solid var(--sb-border-strong) !important;
	font-size: 0.88rem;
	background: var(--sb-surface) !important;
	color: var(--sb-text);
	box-shadow: var(--sb-input-shadow) !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sb-theme .dash__body .form-control:hover,
.sb-theme .dash__body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):hover,
.sb-theme .dash__body select:not(.flex):not(.select2-hidden-accessible):hover,
.sb-theme .dash__body textarea:not(.flex):hover {
	border-color: #b8bec9 !important;
	box-shadow: 0 2px 6px rgba(26, 26, 46, 0.07) !important;
}

.sb-theme .dash__body .form-control:focus,
.sb-theme .dash__body input:not([type="checkbox"]):not([type="radio"]):focus,
.sb-theme .dash__body select:focus,
.sb-theme .dash__body textarea:focus {
	outline: none !important;
	border-color: var(--sb-primary) !important;
	box-shadow: 0 0 0 3px rgba(43, 85, 177, 0.12), var(--sb-input-shadow) !important;
}

.sb-theme .dash__body .form-control:disabled,
.sb-theme .dash__body .form-control[readonly] {
	background-color: var(--sb-surface-muted) !important;
}

/* =============================================================================
   Alert / Modal / Pagination
   ============================================================================= */
.sb-theme .dash__body .alert {
	border-radius: var(--sb-radius) !important;
	border: 1px solid transparent;
	font-size: 0.9rem;
	box-shadow: none;
}

.sb-theme .dash__body .alert-info {
	background: var(--sb-primary-soft) !important;
	border-color: #b3d4f0 !important;
	color: #0b5cab !important;
}

.sb-theme .dash__body .alert-success {
	background: #e6f4ea !important;
	border-color: #a8d5b5 !important;
	color: #0d6635 !important;
}

.sb-theme .dash__body .alert-warning {
	background: #fff8e1 !important;
	border-color: #ffe082 !important;
	color: #8a6d00 !important;
}

/* 無資料提示：保留暖色，去掉邊框，改為更內斂的空狀態樣式 */
.sb-theme .dash__body #norecord.alert,
.sb-theme .dash__body #norecord.alert-warning,
body.sb-theme-dialogs #norecord.alert,
body.sb-theme-dialogs #norecord.alert-warning {
	display: inline-block;
	margin: 12px 0;
	padding: 10px 16px !important;
	border: none !important;
	border-radius: 8px !important;
	background: #fff8e1 !important;
	color: #8a6116 !important;
	font-size: 0.9rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.01em;
	line-height: 1.45;
	box-shadow: none !important;
	position: static !important;
}

/* 有資料時 .hide 必須生效（上方 #norecord 的 display 會蓋掉一般 .hide） */
.sb-theme .dash__body #norecord.hide,
.sb-theme .dash__body #norecord.d-none,
body.sb-theme-dialogs #norecord.hide,
body.sb-theme-dialogs #norecord.d-none {
	display: none !important;
}

.sb-theme .dash__body .alert-danger {
	background: #fdecea !important;
	border-color: #f5c2c0 !important;
	color: #a82222 !important;
}

.sb-theme .dash__body .card,
.sb-theme .dash__body .panel,
.sb-theme .dash__body .modal-content {
	border: 1px solid var(--sb-border) !important;
	border-radius: var(--sb-radius-lg) !important;
	box-shadow: var(--sb-shadow) !important;
	background: var(--sb-surface);
}

.sb-theme .dash__body .card-header,
.sb-theme .dash__body .panel-heading,
.sb-theme .dash__body .modal-header {
	background: var(--sb-thead) !important;
	border-bottom: 1px solid var(--sb-border-strong) !important;
	color: var(--sb-text);
	font-weight: 600;
}

/* =============================================================================
   分頁：白底＋深字（覆寫 pos/style 深灰底藍字），選中用主題藍
   ============================================================================= */
.sb-theme .dash__body .pagination {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 12px 0;
	padding-left: 0;
}

.sb-theme .dash__body .pagination > li {
	display: inline-block;
	margin: 0 !important;
}

.sb-theme .dash__body .pagination > li > a,
.sb-theme .dash__body .pagination > li > span,
.sb-theme .dash__body .pagination .page-link {
	display: inline-block;
	min-width: 32px;
	padding: 5px 11px !important;
	margin: 0 !important;
	line-height: 1.35 !important;
	text-align: center;
	text-decoration: none !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	font-family: var(--sb-font) !important;
	color: #323130 !important;
	background: #ffffff !important;
	border: 1px solid #d0d4de !important;
	border-radius: 6px !important;
	box-shadow: none !important;
	float: none !important;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.sb-theme .dash__body .pagination > li > a:hover,
.sb-theme .dash__body .pagination > li > span:hover,
.sb-theme .dash__body .pagination > li > a:focus,
.sb-theme .dash__body .pagination > li > span:focus,
.sb-theme .dash__body .pagination .page-link:hover,
.sb-theme .dash__body .pagination .page-link:focus {
	color: #1a1a2e !important;
	background: #f3f2f1 !important;
	border-color: #8a8886 !important;
	z-index: 1;
}

.sb-theme .dash__body .pagination > .active > a,
.sb-theme .dash__body .pagination > .active > span,
.sb-theme .dash__body .pagination > .active > a:hover,
.sb-theme .dash__body .pagination > .active > span:hover,
.sb-theme .dash__body .pagination > .active > a:focus,
.sb-theme .dash__body .pagination > .active > span:focus,
.sb-theme .dash__body .pagination .page-item.active .page-link,
.sb-theme .dash__body .pagination li.active a.page-link {
	color: #ffffff !important;
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	font-weight: 600 !important;
	cursor: default;
	z-index: 2;
}

.sb-theme .dash__body .pagination > .disabled > a,
.sb-theme .dash__body .pagination > .disabled > span,
.sb-theme .dash__body .pagination > .disabled > a:hover,
.sb-theme .dash__body .pagination > .disabled > span:hover,
.sb-theme .dash__body .pagination > .disabled > a:focus,
.sb-theme .dash__body .pagination > .disabled > span:focus,
.sb-theme .dash__body .pagination .page-item.disabled .page-link {
	color: #a19f9d !important;
	background: #f8f9fb !important;
	border-color: #e6e8ed !important;
	cursor: not-allowed;
	pointer-events: none;
}

/* DataTables 分頁按鈕 */
.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate {
	margin-top: 12px !important;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button {
	display: inline-block !important;
	min-width: 32px;
	box-sizing: border-box;
	padding: 5px 11px !important;
	margin: 0 2px !important;
	border: 1px solid #d0d4de !important;
	border-radius: 6px !important;
	background: #ffffff !important;
	color: #323130 !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	font-family: var(--sb-font) !important;
	line-height: 1.35 !important;
	cursor: pointer;
	box-shadow: none !important;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
	background: #f3f2f1 !important;
	border-color: #8a8886 !important;
	color: #1a1a2e !important;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	color: #ffffff !important;
	font-weight: 600 !important;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.sb-theme .dash__body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
	background: #f8f9fb !important;
	border-color: #e6e8ed !important;
	color: #a19f9d !important;
	cursor: not-allowed !important;
}

.sb-theme .dash__body .dataTables_wrapper .dataTables_filter input,
.sb-theme .dash__body .dataTables_wrapper .dataTables_length select {
	border: 1px solid var(--sb-border-strong);
	border-radius: var(--sb-radius);
	padding: 4px 8px;
}

.sb-theme .dash__body hr {
	border-top-color: var(--sb-border);
}

/* =============================================================================
   階段 2：jQuery UI Datepicker 皮膚（對齊 Oil；不改插件／JS／z-index 邏輯）
   日曆通常掛在 body 下，故用 body.sb-theme 而非 .dash__body
   ============================================================================= */
body.sb-theme .form-control.datepicker,
body.sb-theme .form-control.range,
body.sb-theme .form-control.datetimepicker,
body.sb-theme .dash__body .form-control.datepicker,
body.sb-theme .dash__body .form-control.range,
body.sb-theme .dash__body .form-control.datetimepicker {
	border-radius: 8px !important;
	border-color: var(--sb-border-strong) !important;
	box-shadow: var(--sb-input-shadow) !important;
}

body.sb-theme .ui-datepicker,
body.sb-theme #ui-datepicker-div {
	width: 17.5em;
	padding: 0;
	border: 1px solid #e6e8ed !important;
	border-radius: 12px !important;
	background: #ffffff !important;
	box-shadow: 0 8px 24px rgba(26, 26, 46, 0.12) !important;
	font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", "Open Sans", "Segoe UI", sans-serif !important;
	font-size: 13px !important;
	color: #000000 !important;
	overflow: hidden;
}

body.sb-theme .ui-datepicker .ui-datepicker-header {
	background: var(--sb-primary) !important;
	border: none !important;
	border-radius: 0 !important;
	color: #ffffff !important;
	padding: 8px 6px;
	font-weight: 600;
}

body.sb-theme .ui-datepicker .ui-datepicker-title {
	margin: 0 2.2em;
	line-height: 1.6;
	color: #ffffff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
}

body.sb-theme .ui-datepicker .ui-datepicker-title select {
	margin: 0 2px;
	padding: 2px 4px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff !important;
	font-size: 12px;
}

body.sb-theme .ui-datepicker .ui-datepicker-prev,
body.sb-theme .ui-datepicker .ui-datepicker-next {
	top: 8px;
	width: 1.6em;
	height: 1.6em;
	border-radius: 6px;
	cursor: pointer;
}

body.sb-theme .ui-datepicker .ui-datepicker-prev {
	left: 6px;
}

body.sb-theme .ui-datepicker .ui-datepicker-next {
	right: 6px;
}

body.sb-theme .ui-datepicker .ui-datepicker-prev span,
body.sb-theme .ui-datepicker .ui-datepicker-next span {
	display: none;
}

/* 用簡潔箭頭，避免依賴 jQuery UI 圖示精靈圖發虛 */
body.sb-theme .ui-datepicker .ui-datepicker-prev::after,
body.sb-theme .ui-datepicker .ui-datepicker-next::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.45em;
	height: 0.45em;
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
	transform: translate(-40%, -50%) rotate(-135deg);
}

body.sb-theme .ui-datepicker .ui-datepicker-next::after {
	transform: translate(-60%, -50%) rotate(45deg);
}

body.sb-theme .ui-datepicker .ui-datepicker-prev:hover,
body.sb-theme .ui-datepicker .ui-datepicker-next:hover,
body.sb-theme .ui-datepicker .ui-datepicker-prev-hover,
body.sb-theme .ui-datepicker .ui-datepicker-next-hover {
	background: rgba(255, 255, 255, 0.18) !important;
	border: none !important;
	top: 8px;
}

body.sb-theme .ui-datepicker .ui-datepicker-calendar {
	margin: 8px 10px 10px;
	width: calc(100% - 20px);
}

body.sb-theme .ui-datepicker .ui-datepicker-calendar th {
	padding: 4px 0;
	color: #000000 !important;
	font-weight: 700 !important;
	font-size: 12px !important;
	border: 0;
	background: transparent;
}

body.sb-theme .ui-datepicker .ui-datepicker-calendar td {
	padding: 1px;
	border: 0;
}

body.sb-theme .ui-datepicker .ui-datepicker-calendar td a,
body.sb-theme .ui-datepicker .ui-datepicker-calendar td span,
body.sb-theme .ui-datepicker td .ui-state-default {
	display: block;
	text-align: center;
	padding: 0.45em 0.2em !important;
	border: 1px solid transparent !important;
	border-radius: 6px !important;
	background: transparent !important;
	color: #000000 !important;
	font-weight: 500 !important;
	text-decoration: none !important;
}

body.sb-theme .ui-datepicker .ui-datepicker-calendar td a:hover,
body.sb-theme .ui-datepicker td .ui-state-hover {
	background: #e6f0fa !important;
	border-color: #b3d4f0 !important;
	color: #000000 !important;
}

/* 今天 */
body.sb-theme .ui-datepicker .ui-datepicker-today a,
body.sb-theme .ui-datepicker .ui-datepicker-today .ui-state-highlight,
body.sb-theme .ui-datepicker td .ui-state-highlight {
	background: #e8edf3 !important;
	border-color: #d0d4de !important;
	color: #000000 !important;
	font-weight: 700 !important;
}

/* 選中日 */
body.sb-theme .ui-datepicker .ui-datepicker-current-day a,
body.sb-theme .ui-datepicker td .ui-state-active,
body.sb-theme .ui-datepicker .ui-state-active {
	background: var(--sb-primary) !important;
	border-color: var(--sb-primary) !important;
	color: #ffffff !important;
	font-weight: 700 !important;
}

/* 非本月日期 */
body.sb-theme .ui-datepicker .ui-datepicker-other-month .ui-state-default,
body.sb-theme .ui-datepicker td.ui-datepicker-other-month span,
body.sb-theme .ui-datepicker .ui-priority-secondary {
	color: #9aa0ae !important;
	opacity: 1 !important;
}

/* 禁用 */
body.sb-theme .ui-datepicker td.ui-state-disabled,
body.sb-theme .ui-datepicker td.ui-state-disabled span {
	opacity: 0.35;
}

body.sb-theme .ui-datepicker .ui-datepicker-buttonpane {
	border-top: 1px solid #e6e8ed !important;
	background: #f5f7fa !important;
	margin: 0;
	padding: 6px 8px;
}

body.sb-theme .ui-datepicker .ui-datepicker-buttonpane button {
	border-radius: 6px !important;
	border: 1px solid #d0d4de !important;
	background: #ffffff !important;
	color: #000000 !important;
	font-size: 12px !important;
	padding: 3px 10px !important;
	opacity: 1 !important;
}

body.sb-theme .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
	background: var(--sb-primary-soft) !important;
	border-color: var(--sb-primary) !important;
	color: var(--sb-primary) !important;
	font-weight: 600 !important;
}

body.sb-theme .ui-datepicker .ui-datepicker-buttonpane button:hover {
	background: #e8eaee !important;
}

/* =============================================================================
   選商品／客戶等 jQuery UI Dialog（掛在 body，不在 .dash__body）
   body.sb-theme-dialogs：批發／採購有整頁主題；進階零售僅 Dialog 主題
   ============================================================================= */
body.sb-theme-dialogs .ui-dialog {
	border: 1px solid #e6e8ed !important;
	border-radius: 12px !important;
	background: #ffffff !important;
	box-shadow: 0 12px 32px rgba(26, 26, 46, 0.16) !important;
	padding: 0 !important;
	overflow: hidden;
	font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", "Open Sans", "Segoe UI", sans-serif !important;
}

/* 抬頭：比表頭 thead（#e8edf3）略深一點的淺藍灰 */
body.sb-theme-dialogs .ui-dialog .ui-dialog-titlebar {
	background: #d8e0ea !important;
	border: none !important;
	border-bottom: 1px solid #c5ced9 !important;
	border-radius: 0 !important;
	color: #1a1a2e !important;
	padding: 10px 14px !important;
	font-weight: 600 !important;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-title {
	color: #1a1a2e !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	width: calc(100% - 2.5em);
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-titlebar-close {
	right: 10px;
	top: 50%;
	margin-top: -10px;
	border: none !important;
	background: rgba(26, 26, 46, 0.08) !important;
	border-radius: 6px !important;
	width: 20px;
	height: 20px;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-titlebar-close:hover {
	background: rgba(26, 26, 46, 0.14) !important;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-content {
	padding: 12px 16px 8px !important;
	background: #f5f7fa !important;
	color: #000000 !important;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-buttonpane {
	border-top: 1px solid #e6e8ed !important;
	background: #ffffff !important;
	margin: 0 !important;
	padding: 10px 14px !important;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-buttonpane button,
body.sb-theme-dialogs .ui-dialog .ui-dialog-buttonpane .ui-button {
	border-radius: 4px !important;
	border: 1px solid #8a8886 !important;
	background: #ffffff !important;
	color: #323130 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	padding: 5px 14px !important;
	min-height: 32px;
	box-shadow: none !important;
}

body.sb-theme-dialogs .ui-dialog .ui-dialog-buttonpane button:hover,
body.sb-theme-dialogs .ui-dialog .ui-dialog-buttonpane .ui-button:hover {
	background: #f3f2f1 !important;
}

/* Dialog 內表單／按鈕 */
body.sb-theme-dialogs .ui-dialog .btn,
body.sb-theme-dialogs .ui-dialog button.btn {
	border-radius: 4px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	padding: 5px 14px !important;
	min-height: 32px;
	box-shadow: none !important;
}

body.sb-theme-dialogs .ui-dialog .btn-primary,
body.sb-theme-dialogs .ui-dialog .btn-info {
	background: var(--sb-primary, #2b55b1) !important;
	border-color: var(--sb-primary, #2b55b1) !important;
	color: #fff !important;
}

body.sb-theme-dialogs .ui-dialog .btn-default,
body.sb-theme-dialogs .ui-dialog .btn-secondary {
	background: #ffffff !important;
	border-color: #8a8886 !important;
	color: #323130 !important;
}

body.sb-theme-dialogs .ui-dialog .btn-success {
	background: #dff6dd !important;
	border-color: #9fd89f !important;
	color: #107c10 !important;
}

body.sb-theme-dialogs .ui-dialog .btn-danger {
	background: #fde7e9 !important;
	border-color: #f1bbbc !important;
	color: #d13438 !important;
}

body.sb-theme-dialogs .ui-dialog .form-control {
	border-radius: 6px !important;
	border: 1px solid #d0d4de !important;
	font-size: 13px !important;
	color: #000000 !important;
}

body.sb-theme-dialogs .ui-dialog .form-control:focus {
	border-color: var(--sb-primary, #2b55b1) !important;
	box-shadow: 0 0 0 3px rgba(43, 85, 177, 0.12) !important;
}

/* 選商品／客戶等表格（含 gray-header 舊樣式覆蓋） */
body.sb-theme-dialogs .ui-dialog table.table,
body.sb-theme-dialogs .ui-dialog table[id^="tbl"],
body.sb-theme-dialogs #itemModal #tblItem,
body.sb-theme-dialogs #cusModal table,
body.sb-theme-dialogs #accountModal table {
	width: 100%;
	background: #ffffff !important;
	border: 1px solid #e6e8ed !important;
	border-radius: 12px;
	border-collapse: separate !important;
	border-spacing: 0;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
	font-size: 14px !important;
	color: #000000 !important;
}

body.sb-theme-dialogs .ui-dialog table.table thead,
body.sb-theme-dialogs .ui-dialog table[id^="tbl"] thead,
body.sb-theme-dialogs #itemModal #tblItem thead,
body.sb-theme-dialogs .ui-dialog tr.gray-header,
body.sb-theme-dialogs .ui-dialog .gray-header {
	background: #e8edf3 !important;
}

body.sb-theme-dialogs .ui-dialog table.table thead th,
body.sb-theme-dialogs .ui-dialog table.table thead td,
body.sb-theme-dialogs .ui-dialog table[id^="tbl"] thead th,
body.sb-theme-dialogs #itemModal #tblItem thead th,
body.sb-theme-dialogs .ui-dialog tr.gray-header th,
body.sb-theme-dialogs .ui-dialog .gray-header th {
	background: var(--sb-thead) !important;
	color: #000000 !important;
	font-weight: var(--sb-thead-font-weight, 600) !important;
	font-size: 14px !important;
	font-family: var(--sb-thead-font) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	border: none !important;
	border-bottom: 1px solid #d0d4de !important;
	padding: 10px 12px !important;
	vertical-align: middle !important;
	text-align: left;
}

body.sb-theme-dialogs .ui-dialog table thead th.text-right,
body.sb-theme-dialogs .ui-dialog table thead th.text-end,
body.sb-theme-dialogs .ui-dialog table td.text-right,
body.sb-theme-dialogs .ui-dialog table td.text-end,
body.sb-theme-dialogs .ui-dialog table th.text-right,
body.sb-theme-dialogs .ui-dialog table th.text-end {
	text-align: right !important;
}

body.sb-theme-dialogs .ui-dialog table thead th.text-center,
body.sb-theme-dialogs .ui-dialog table td.text-center,
body.sb-theme-dialogs .ui-dialog table th.text-center {
	text-align: center !important;
}

body.sb-theme-dialogs .ui-dialog table.table td,
body.sb-theme-dialogs .ui-dialog table[id^="tbl"] td,
body.sb-theme-dialogs #itemModal #tblItem td {
	padding: 9px 12px !important;
	border-top: none !important;
	border-left: none !important;
	border-right: none !important;
	border-bottom: 1px solid #eef0f4 !important;
	color: #000000 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	vertical-align: middle !important;
	background: transparent !important;
}

body.sb-theme-dialogs .ui-dialog table.table-bordered > :not(caption) > * > *,
body.sb-theme-dialogs .ui-dialog .table-bordered > :not(caption) > * > * {
	border-left: none !important;
	border-right: none !important;
}

body.sb-theme-dialogs .ui-dialog table.table tbody tr:hover td,
body.sb-theme-dialogs .ui-dialog table[id^="tbl"] tbody tr:hover td,
body.sb-theme-dialogs #itemModal #tblItem tbody tr:hover td {
	background: #f6f8fb !important;
	cursor: pointer;
}

body.sb-theme-dialogs .ui-widget-overlay {
	background: #1a1a2e !important;
	opacity: 0.35 !important;
}

/* =============================================================================
   統一狀態顯示（Windows Fluent 柔和色）
   - .sb-status：膠囊標籤（客戶跟進等）
   - *statusbg：表格儲存格整格柔和底色（批發／採購／訂單等既有 class）
   ============================================================================= */
.sb-theme .dash__body .sb-status,
.sb-theme .dash__body span.followupstatus,
body.sb-theme-dialogs .sb-status {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	border: 1px solid transparent;
	white-space: nowrap;
	max-width: 100%;
}

.sb-theme .dash__body .sb-status-info,
.sb-theme .dash__body .sb-status-need {
	background: var(--sb-primary-soft);
	border-color: #b4c4e0;
	color: var(--sb-primary);
}
.sb-theme .dash__body .sb-status-success,
.sb-theme .dash__body .sb-status-completed {
	background: #dff6dd;
	border-color: #9fd89f;
	color: #0b6a0b;
}
.sb-theme .dash__body .sb-status-warning,
.sb-theme .dash__body .sb-status-following,
.sb-theme .dash__body .sb-status-pending,
.sb-theme .dash__body .sb-status-draft {
	background: #fff4ce;
	border-color: #f0d185;
	color: #8a6116;
}
.sb-theme .dash__body .sb-status-danger,
.sb-theme .dash__body .sb-status-failed,
.sb-theme .dash__body .sb-status-rejected {
	background: #fde7e9;
	border-color: #f1bbbc;
	color: #a4262c;
}
.sb-theme .dash__body .sb-status-neutral,
.sb-theme .dash__body .sb-status-noneed {
	background: #f3f2f1;
	border-color: #e1dfdd;
	color: #605e5c;
}
.sb-theme .dash__body .sb-status-muted,
.sb-theme .dash__body .sb-status-undefined {
	background: #faf9f8;
	border-color: #edebe9;
	color: #8a8886;
}
.sb-theme .dash__body .sb-status-purple {
	background: #f3e8fd;
	border-color: #dcbef5;
	color: #5c2d91;
}
.sb-theme .dash__body .sb-status-teal {
	background: #e0f6f4;
	border-color: #9fdad3;
	color: #006666;
}
.sb-theme .dash__body .sb-status-orange {
	background: #ffefe0;
	border-color: #f7c89b;
	color: #8a5100;
}

/* 既有 *statusbg 整格柔和化（提高優先級以蓋過通用 td 規則） */
.sb-theme .dash__body table td.draftstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.draftstatusbg {
	background-color: #fff4ce !important;
	color: #8a6116 !important;
}
.sb-theme .dash__body table td.createdstatusbg,
.sb-theme .dash__body table td.createdbg,
.sb-theme .dash__body table td.approvedstatusbg,
.sb-theme .dash__body table td.approved_sp_statusbg,
.sb-theme .dash__body table[id^="tbl"] td.createdstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.createdbg,
.sb-theme .dash__body table[id^="tbl"] td.approvedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.approved_sp_statusbg {
	background-color: #dff6dd !important;
	color: #0b6a0b !important;
}
.sb-theme .dash__body table td.requestingstatusbg,
.sb-theme .dash__body table td.requesting_sp_statusbg,
.sb-theme .dash__body table td.needstatusbg,
.sb-theme .dash__body table td.orderstatusbg,
.sb-theme .dash__body table td.orderbg,
.sb-theme .dash__body table td.kpendingstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.requestingstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.requesting_sp_statusbg,
.sb-theme .dash__body table[id^="tbl"] td.needstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.orderstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.orderbg,
.sb-theme .dash__body table[id^="tbl"] td.kpendingstatusbg {
	background-color: #fff4ce !important;
	color: #8a6116 !important;
}
.sb-theme .dash__body table td.passedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.passedstatusbg {
	background-color: #f3e8fd !important;
	color: #5c2d91 !important;
}
.sb-theme .dash__body table td.deliverstatusbg,
.sb-theme .dash__body table td.deliverystatusbg,
.sb-theme .dash__body table td.deliverbg,
.sb-theme .dash__body table td.deliverybg,
.sb-theme .dash__body table[id^="tbl"] td.deliverstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.deliverystatusbg,
.sb-theme .dash__body table[id^="tbl"] td.deliverbg,
.sb-theme .dash__body table[id^="tbl"] td.deliverybg {
	background-color: #e0f6f4 !important;
	color: #006666 !important;
}
.sb-theme .dash__body table td.partialdeliverstatusbg,
.sb-theme .dash__body table td.partialdeliverystatusbg,
.sb-theme .dash__body table td.partialdeliverbg,
.sb-theme .dash__body table td.partialreceivalstatusbg,
.sb-theme .dash__body table td.partialreceivalbg,
.sb-theme .dash__body table[id^="tbl"] td.partialdeliverstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.partialdeliverystatusbg,
.sb-theme .dash__body table[id^="tbl"] td.partialdeliverbg,
.sb-theme .dash__body table[id^="tbl"] td.partialreceivalstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.partialreceivalbg {
	background-color: #ffefe0 !important;
	color: #8a5100 !important;
}
.sb-theme .dash__body table td.openedstatusbg,
.sb-theme .dash__body table td.invoicestatusbg,
.sb-theme .dash__body table td.completedstatusbg,
.sb-theme .dash__body table td.completestatusbg,
.sb-theme .dash__body table td.openedbg,
.sb-theme .dash__body table td.invoicebg,
.sb-theme .dash__body table td.billbg,
.sb-theme .dash__body table[id^="tbl"] td.openedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.invoicestatusbg,
.sb-theme .dash__body table[id^="tbl"] td.completedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.completestatusbg,
.sb-theme .dash__body table[id^="tbl"] td.openedbg,
.sb-theme .dash__body table[id^="tbl"] td.invoicebg,
.sb-theme .dash__body table[id^="tbl"] td.billbg {
	background-color: var(--sb-primary-soft) !important;
	color: var(--sb-primary) !important;
}
.sb-theme .dash__body table td.rejectedstatusbg,
.sb-theme .dash__body table td.rejectedbg,
.sb-theme .dash__body table td.returnedbg,
.sb-theme .dash__body table[id^="tbl"] td.rejectedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.rejectedbg,
.sb-theme .dash__body table[id^="tbl"] td.returnedbg {
	background-color: #fde7e9 !important;
	color: #a4262c !important;
}
.sb-theme .dash__body table td.voidedstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.voidedstatusbg {
	background-color: #f3f2f1 !important;
	color: #323130 !important;
}
.sb-theme .dash__body table td.depositsettlingstatusbg,
.sb-theme .dash__body table td.presettlingstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.depositsettlingstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.presettlingstatusbg {
	background-color: #fff4ce !important;
	color: #8a6116 !important;
}
.sb-theme .dash__body table td.depositsettledstatusbg,
.sb-theme .dash__body table td.presettledstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.depositsettledstatusbg,
.sb-theme .dash__body table[id^="tbl"] td.presettledstatusbg {
	background-color: #dff6dd !important;
	color: #0b6a0b !important;
}
.sb-theme .dash__body table td.paidout,
.sb-theme .dash__body table[id^="tbl"] td.paidout {
	background-color: #dff6dd !important;
	color: #0b6a0b !important;
}
.sb-theme .dash__body table td.cancelled,
.sb-theme .dash__body table[id^="tbl"] td.cancelled {
	background-color: #fde7e9 !important;
	color: #a4262c !important;
}
.sb-theme .dash__body table td.pending4payment,
.sb-theme .dash__body table[id^="tbl"] td.pending4payment {
	background-color: #fff4ce !important;
	color: #8a6116 !important;
}

.sb-theme .dash__body table td.status,
.sb-theme .dash__body table[id^="tbl"] td.status {
	background-color: transparent !important;
	color: #000000 !important;
}

/* ----- 表格鑽取／收起（全站統一；範本：InventoryAudit）-----
   標記：button.btn.btn-sm.btn-link.sb-drill-toggle
   圖示：收起 fas fa-chevron-right；展開 fas fa-chevron-down
   舊頁 .toggle-details 一併對齊，避免兩套外觀。 */
.sb-drill-toggle,
.sb-theme .dash__body .sb-drill-toggle,
.sb-theme .dash__body .toggle-details {
	padding: 0.15rem 0.35rem;
	margin: 0;
	line-height: 1;
	border: none;
	background: transparent;
	box-shadow: none;
	color: var(--sb-primary, #2b55b1);
	vertical-align: middle;
	text-decoration: none !important;
}

.sb-drill-toggle:hover,
.sb-drill-toggle:focus,
.sb-theme .dash__body .sb-drill-toggle:hover,
.sb-theme .dash__body .sb-drill-toggle:focus,
.sb-theme .dash__body .toggle-details:hover,
.sb-theme .dash__body .toggle-details:focus {
	color: var(--sb-primary-hover, #244a9a);
	background: transparent;
	box-shadow: none;
	text-decoration: none !important;
}

.sb-drill-toggle i,
.sb-theme .dash__body .sb-drill-toggle i,
.sb-theme .dash__body .toggle-details i {
	font-size: 0.85rem;
	width: 1em;
	text-align: center;
}

.sb-drill-toggle.is-open,
.sb-theme .dash__body .sb-drill-toggle.is-open {
	color: var(--sb-primary-pressed, #1d3d82);
}

/* =============================================================================
   手機：批發／採購流程表可橫滑，避免字元直排（≥768px 桌面規則不變）
   ============================================================================= */
@media (max-width: 767.98px) {
	/* 主規則不用 :has，避免舊瀏覽器整段失效 */
	.sb-theme .dash__body .sb-ops-table-scroll,
	.sb-theme .dash__body #tblblk {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
	}

	.sb-theme .dash__body .overflow-auto:has(#tblWSI),
	.sb-theme .dash__body .overflow-auto:has(#tblPSI),
	.sb-theme .dash__body .table-responsive:has(#tblWSI),
	.sb-theme .dash__body .table-responsive:has(#tblPSI),
	.sb-theme .dash__body .table-responsive:has(#tblPrePurchase) {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
	}

	.sb-theme .dash__body .sb-ops-table-scroll > table,
	.sb-theme .dash__body #tblblk > table,
	.sb-theme .dash__body #tblWholeSales,
	.sb-theme .dash__body #tblPurchase,
	.sb-theme .dash__body #tblQuotation,
	.sb-theme .dash__body #tblPrePurchase,
	.sb-theme .dash__body #tblsalesorder,
	.sb-theme .dash__body #tblpurchaseorder,
	.sb-theme .dash__body #tblWSI,
	.sb-theme .dash__body #tblPSI,
	.sb-theme .dash__body #tblPayment {
		display: table !important;
		width: max-content !important;
		min-width: 720px !important;
		max-width: none !important;
		overflow: visible !important;
	}

	.sb-theme .dash__body #tblWSI,
	.sb-theme .dash__body #tblPSI {
		min-width: 900px !important;
	}

	.sb-theme .dash__body .sb-ops-table-scroll th,
	.sb-theme .dash__body .sb-ops-table-scroll td,
	.sb-theme .dash__body #tblblk th,
	.sb-theme .dash__body #tblblk td,
	.sb-theme .dash__body #tblWholeSales th,
	.sb-theme .dash__body #tblWholeSales td,
	.sb-theme .dash__body #tblPurchase th,
	.sb-theme .dash__body #tblPurchase td,
	.sb-theme .dash__body #tblQuotation th,
	.sb-theme .dash__body #tblQuotation td,
	.sb-theme .dash__body #tblPrePurchase th,
	.sb-theme .dash__body #tblPrePurchase td,
	.sb-theme .dash__body #tblsalesorder th,
	.sb-theme .dash__body #tblsalesorder td,
	.sb-theme .dash__body #tblpurchaseorder th,
	.sb-theme .dash__body #tblpurchaseorder td,
	.sb-theme .dash__body #tblWSI th,
	.sb-theme .dash__body #tblWSI td,
	.sb-theme .dash__body #tblPSI th,
	.sb-theme .dash__body #tblPSI td {
		white-space: nowrap !important;
		word-break: normal !important;
		overflow: visible !important;
		text-overflow: clip !important;
	}

	.sb-theme .dash__body .sb-list-filter__keyword,
	.sb-theme .dash__body .sb-list-filter input.sb-list-filter__keyword.form-control {
		min-width: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		flex: 1 1 auto !important;
	}
}

/* 批發客戶／採購供應商 Select2：編號／名稱／幣種分色分粗細（深色可讀；字級略小於默認 14px） */
.sb-party-opt {
	display: inline;
	line-height: 1.35;
	font-size: 13px;
	font-family: var(--sb-font, "Open Sans", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif);
}
.select2-container .select2-selection__rendered .sb-party-opt,
.select2-results__option .sb-party-opt {
	font-size: 13px;
}
.sb-party-opt__code {
	font-weight: 700;
	color: #2b55b1;
}
.sb-party-opt__name {
	font-weight: 400;
	color: #1a1a2e;
}
.sb-party-opt__ccy {
	font-weight: 600;
	color: #0b6a0b;
}
.select2-results__option--highlighted .sb-party-opt__code,
.select2-results__option--highlighted .sb-party-opt__name,
.select2-results__option--highlighted .sb-party-opt__ccy {
	color: #ffffff;
}
.select2-results__option--highlighted .sb-party-opt__code {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.select2-results__option--highlighted .sb-party-opt__ccy {
	font-weight: 700;
	opacity: 0.95;
}

/* 空白明細：原價標籤無內容時隱藏，避免佔位；選商品寫入後顯示原價＋實價 */
.sb-theme .original-price:empty,
.original-price:empty {
	display: none;
}

/* -------------------------------------------------------------------------
   原價／實價差異（批發／採購）：規則不變——升價藍、降價紅；僅柔化外觀
   ------------------------------------------------------------------------- */
.sb-price-pair {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	width: 100%;
	min-height: 32px;
}
.sb-price-pair .original-price,
.sb-price-pair .price1 {
	flex: 0 1 auto;
	margin: 0;
	padding: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--sb-text-muted, #3b3a39);
	white-space: nowrap;
}
.sb-price-pair .price2 {
	flex: 0 1 auto;
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sb-text, #1a1a2e);
	white-space: nowrap;
}
.sb-price-sep {
	flex: 0 0 auto;
	margin: 0 2px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	color: #8a8886;
	opacity: 0.85;
}
td.sb-price-cell {
	position: relative;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
/* 實價高於原價 → 升價藍 */
td.sb-price-cell.sb-price-up {
	background-color: #eef3fb !important;
	box-shadow: inset 3px 0 0 0 #2b55b1;
}
td.sb-price-cell.sb-price-up .price2,
td.sb-price-cell.sb-price-up .price {
	color: #1d3d82;
	font-weight: 600;
}
td.sb-price-cell.sb-price-up .original-price,
td.sb-price-cell.sb-price-up .price1 {
	color: #5b6b86;
}
/* 實價低於原價 → 降價紅 */
td.sb-price-cell.sb-price-down {
	background-color: #fdf2f2 !important;
	box-shadow: inset 3px 0 0 0 #c4314b;
}
td.sb-price-cell.sb-price-down .price2,
td.sb-price-cell.sb-price-down .price {
	color: #a4262c;
	font-weight: 600;
}
td.sb-price-cell.sb-price-down .original-price,
td.sb-price-cell.sb-price-down .price1 {
	color: #8a5a5e;
}

