﻿/* Giao diện chung các màn SmartSoftware.ModularMonolith.Purchase.Blazor (gốc .sm-page): khung trang, thanh lọc, bảng, chi tiết, nút, hộp thoại — chép từ màn Vật tư, hàng hoá. */
.sm-page.ob {
	--bg: #f4f6fa;
	--card: #fff;
	--line: #e6eaf1;
	--line-soft: #eef1f6;
	--line-hover: #d8dee9;
	--txt: #1f2937;
	--txt2: #5b6577;
	--txt3: #6b7280;
	--pri: #2563eb;
	--pri-hover: #1d4ed8;
	--pri-strong: #1e3a8a;
	--pri-soft: #eef4ff;
	--pri-line: #c7dbff;
	--ok: #16a34a;
	--ok-strong: #15803d;
	--ok-soft: #eaf7ef;
	--warn: #f59e0b;
	--warn-text: #854d0e;
	--warn-soft: #fff7e8;
	--warn-line: #f7dfae;
	--dan: #dc2626;
	--dan-soft: #fdecec;
	--dan-line: #f3c7c7;
	--gray-soft: #f1f3f7;
	--r: 10px;
	--r-sm: 7px;
	--sh: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
	--sh-md: 0 4px 16px rgba(16, 24, 40, .10);
	--sh-lg: 0 18px 48px rgba(16, 24, 40, .20);
	min-height: 100%;
	background: var(--bg);
	color: var(--txt);
	font: 14px/1.5 Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}

.sm-page.ob button, .sm-page.ob input, .sm-page.ob textarea {
	font-family: inherit;
}

.sm-page.ob .mono {
	font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
	font-weight: 600;
}

/* Khung nội dung như màn Người dùng: cách hàng tiêu đề 6, hai bên 8, đáy 8, các khung xếp chồng cách nhau 8 */
.sm-page .ob-wrap {
	padding: 6px 8px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sm-page .ob-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r);
	box-shadow: var(--sh);
}

.sm-page .ob-empty {
	padding: 26px;
	text-align: center;
	color: var(--txt3);
}

.sm-page .ob-empty small {
	font-size: 13px;
}

.sm-page .ob-muted {
	font-size: 13px;
	color: var(--txt3);
}

.sm-page .ob-faint {
	color: var(--txt3);
}

.sm-page .ob-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Nút (cả khi màn đưa nút lên hàng tiêu đề trang .app-page-actions) */
.sm-page .ob-btn, .app-page-actions .ob-btn {
	height: 28px;
	padding: 0 12px;
	display: inline-flex;
	gap: 7px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	background: #fff;
	border-radius: var(--r-sm);
	cursor: pointer;
	color: var(--txt);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.sm-page .ob-btn:hover:not(:disabled), .app-page-actions .ob-btn:hover:not(:disabled) {
	background: var(--bg);
	border-color: var(--line-hover);
}

.sm-page .ob-btn.icon, .app-page-actions .ob-btn.icon {
	width: 28px;
	padding: 0;
	color: var(--txt2);
}

.sm-page .ob-btn.grow, .app-page-actions .ob-btn.grow {
	flex-grow: 1;
}

.sm-page .ob-btn.primary, .app-page-actions .ob-btn.primary {
	background: var(--pri);
	border-color: var(--pri);
	color: #fff;
}

.sm-page .ob-btn.primary:hover:not(:disabled), .app-page-actions .ob-btn.primary:hover:not(:disabled) {
	background: var(--pri-hover);
	border-color: var(--pri-hover);
}

.sm-page .ob-btn.success, .app-page-actions .ob-btn.success {
	background: var(--ok);
	border-color: var(--ok);
	color: #fff;
}

.sm-page .ob-btn.success:hover:not(:disabled), .app-page-actions .ob-btn.success:hover:not(:disabled) {
	background: var(--ok-strong);
	border-color: var(--ok-strong);
}

.sm-page .ob-btn.danger, .app-page-actions .ob-btn.danger {
	color: var(--dan);
	border-color: var(--dan-line);
}

.sm-page .ob-btn.danger:hover:not(:disabled), .app-page-actions .ob-btn.danger:hover:not(:disabled) {
	background: var(--dan-soft);
}

.sm-page .ob-btn.dangerfill, .app-page-actions .ob-btn.dangerfill {
	background: var(--dan);
	border-color: var(--dan);
	color: #fff;
}

.sm-page .ob-btn.dangerfill:hover:not(:disabled), .app-page-actions .ob-btn.dangerfill:hover:not(:disabled) {
	background: #b91c1c;
	border-color: #b91c1c;
}

.sm-page .ob-btn:disabled, .app-page-actions .ob-btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

.sm-page .ob-iconbtn {
	width: 26px;
	height: 26px;
	border: 0;
	background: transparent;
	border-radius: var(--r-sm);
	cursor: pointer;
	color: var(--txt3);
	display: inline-flex;
	vertical-align: middle;
	align-items: center;
	justify-content: center;
}

.sm-page .ob-iconbtn:hover {
	background: var(--pri-soft);
	color: var(--pri);
}

/* Đầu trang */
.sm-page .ob-pghead {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r);
	box-shadow: var(--sh);
	padding: 12px 14px;
}

.sm-page .ob-pghead .pg-ic {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--pri-soft);
	color: var(--pri);
	display: grid;
	place-items: center;
	flex: none;
}

.sm-page .ob-pghead .grow {
	flex: 1;
	min-width: 0;
}

.sm-page .ob-pghead h1 {
	margin: 0;
	font-size: 16.5px;
	font-weight: 680;
	letter-spacing: -.2px;
	color: var(--txt);
}

.sm-page .ob-pghead p {
	margin: 3px 0 0;
	color: var(--txt3);
	font-size: 14px;
}

.sm-page .pg-act {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.sm-page .pg-act .xls,
.sm-page .slt .xls,
.app-page-actions .xls {
	color: var(--ok);
}

.sm-page .dm {
	position: relative;
}

.sm-page .dm-veil {
	position: fixed;
	inset: 0;
	z-index: 50;
}

.sm-page .dm-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 60;
	min-width: 186px;
	padding: 4px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	box-shadow: var(--sh-md);
}

.sm-page .dm-menu button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 4px 9px;
	border-radius: 6px;
	color: var(--txt);
	font-size: 14px;
	font-weight: 530;
	text-align: left;
	cursor: pointer;
	min-height: 28px;
}

.sm-page .dm-menu button:hover:not(:disabled) {
	background: var(--bg);
}

.sm-page .dm-menu button:disabled {
	opacity: .45;
	cursor: default;
}

/* Menu "Thao tác khác" (…) khi màn đưa lên hàng tiêu đề trang (.app-page-actions): cùng kiểu như trên, neo phải, nổi trên bảng. */
.app-page-actions .dm {
	position: relative;
}

.app-page-actions .dm-veil {
	position: fixed;
	inset: 0;
	z-index: 50;
}

.app-page-actions .dm-menu {
	position: absolute;
	right: 0;
	left: auto;
	top: calc(100% + 6px);
	z-index: 60;
	min-width: 186px;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	box-shadow: 0 4px 16px rgba(16, 24, 40, .10);
}

.app-page-actions .dm-menu button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	border: 0;
	background: transparent;
	padding: 0 9px;
	border-radius: 6px;
	color: var(--txt);
	font-weight: 530;
	text-align: left;
	cursor: pointer;
}

.app-page-actions .dm-menu button:hover:not(:disabled) {
	background: var(--bg);
}

.app-page-actions .dm-menu button:disabled {
	opacity: .45;
	cursor: default;
}

/* Khung rà soát */
.sm-page .ob-review {
	background: var(--warn-soft);
	border: 1px solid var(--warn-line);
	border-radius: var(--r);
	padding: 8px 14px;
}

.sm-page .ob-review.ok {
	background: var(--ok-soft);
	border-color: #c6ead4;
}

.sm-page .rv-head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 26px;
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 14px;
	font-weight: 650;
	color: var(--warn-text);
	text-align: left;
	cursor: pointer;
}

.sm-page .ob-review.ok .rv-head {
	color: var(--ok-strong);
	cursor: default;
}

.sm-page .rv-head .more {
	margin-left: auto;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
}

.sm-page .ob-review ul {
	margin: 6px 0 2px;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px 24px;
}

.sm-page .ob-review li button {
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
	padding: 3px 0;
	font-size: 14px;
	color: #6b4a12;
	display: flex;
	gap: 10px;
	align-items: baseline;
	width: 100%;
}

.sm-page .ob-review li button:hover span:last-child {
	text-decoration: underline;
}

.sm-page .ob-review li .mono {
	min-width: 56px;
	color: var(--txt);
	font-size: 14px;
}

/* Thanh công cụ */
/* Thanh lọc của báo cáo: ít ô thì gọn một dòng, nhiều ô thì xuống dòng (ô chọn co giãn 150–230px, ô tìm 220–320px) */
.sm-page .ob-toolbar {
	padding: 8px 12px;
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.sm-page .ob-search {
	flex-grow: 1;
	min-width: 220px;
	max-width: 320px;
	height: var(--smart-search-h, 28px);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 0 10px;
	color: var(--txt3);
	background: #fff;
	margin: 0;
}

.sm-page .ob-search:focus-within {
	border-color: var(--pri-line);
	box-shadow: 0 0 0 3px var(--pri-soft);
	color: var(--pri);
}

.sm-page .ob-search input {
	border: 0;
	outline: none;
	flex-grow: 1;
	min-width: 0;
	font-size: 14px;
	color: var(--txt);
	background: transparent;
	height: var(--smart-search-in-h, 26px);
}

.sm-page .ob-search kbd {
	font-family: inherit;
	font-size: 13px;
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 0 5px;
	color: var(--txt3);
	background: var(--bg);
	box-shadow: none;
}

.sm-page .ob-toggle {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	color: var(--txt2);
	cursor: pointer;
	white-space: nowrap;
	margin: 0;
}

.sm-page .ob-toggle input {
	width: 15px;
	height: 15px;
	accent-color: var(--pri);
	margin: 0;
}

/* Bộ lọc nhóm rà soát đang áp dụng: bấm để bỏ */
.sm-page .ob-chip {
	height: 30px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0 10px;
	border: 1px solid var(--warn-line);
	border-radius: 20px;
	background: var(--warn-soft);
	color: var(--warn-text);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.sm-page .ob-chip:hover {
	border-color: var(--warn);
}

.sm-page .ob-review li button.on span:last-child {
	font-weight: 700;
	text-decoration: underline;
}

.sm-page .ob-review li button.on .mono {
	color: var(--warn-text);
}

/* Nhóm thiếu thông tin (không phải lỗi): chữ nhạt hơn nhóm lỗi */
.sm-page .ob-review li button.light {
	color: var(--txt2);
}

/* Bảng + chi tiết: hai khung cách nhau 8 (bằng gap mặc định --sdt-gap của nút thu / mở chi tiết SmartDetailToggle) */
.sm-page .ob-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 8px;
	align-items: start;
}

.sm-page .ob-table {
	overflow: hidden;
}

.sm-page .ob-scroll {
	overflow-x: auto;
}

/* Lưới bảng; min-width = tổng min cột + gap × (n − 1) + đệm 28.
   Hàng hoá: mã 130 + tên 220 + nhóm VTHH 160 + ĐVT 100 + giá bán 110 + VAT 64 + trạng thái 120 + 6 gap 72 + đệm 28 = 1004 */
.sm-page .g {
	display: grid;
	gap: 12px;
	align-items: center;
	padding: 0 14px;
}

.sm-page .k-product .g {
	grid-template-columns: 130px minmax(220px, 1.6fr) minmax(160px, 1fr) 100px 110px 64px 120px;
	min-width: 1004px;
}

/* Cột số (giá bán) canh phải */
.sm-page .g > .num {
	text-align: right;
}

/* Đang nạp trang: mờ bảng, chặn bấm */
.sm-page .ob-table.busy .ob-scroll {
	opacity: .55;
	pointer-events: none;
	transition: opacity .15s;
}

.sm-page .thead {
	min-height: 32px;
	background: #f8fafc;
	border-bottom: 1px solid var(--line-soft);
	font-size: var(--tbl-fs-head, 14px);
	font-weight: 620;
	color: var(--txt2);
}

.sm-page .trow {
	min-height: 32px;
	border-bottom: 1px solid var(--line-soft);
	background: #fff;
	cursor: pointer;
	font-size: var(--tbl-fs, 14px);
	outline: none;
}

.sm-page .trow:hover {
	background: #fafcff;
}

.sm-page .trow.sel {
	background: var(--pri-soft);
}

.sm-page .trow:focus-visible {
	box-shadow: inset 0 0 0 2px var(--pri-line);
}

.sm-page .trow.off {
	color: var(--txt3);
}

.sm-page .cell {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sm-page .keycell {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.sm-page .code {
	font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
	font-weight: 600;
	font-size: 14px;
	background: var(--pri-soft);
	color: var(--pri-strong);
	border-radius: 6px;
	padding: 2px 7px;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Ô tên / đơn vị tính: dòng chính, dòng nhỏ xám là tính chất / đơn vị ưu tiên */
.sm-page .ob-name {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 4px 0;
}

.sm-page .ob-name b, .sm-page .ob-name small {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sm-page .ob-name b {
	font-weight: 600;
}

.sm-page .ob-name small {
	font-size: 14px;
	color: var(--txt3);
}

.sm-page .ob-name small.none {
	font-style: italic;
}

.sm-page .trow .mono {
	font-size: 14px;
}

/* Giá trị sai dạng */
.sm-page .ob-bad {
	color: var(--dan);
	text-decoration: underline wavy var(--dan);
	text-underline-offset: 3px;
}

.sm-page .trow.off .ob-bad {
	color: inherit;
}

.sm-page .wdot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--warn);
	flex-shrink: 0;
}

.sm-page .pill {
	display: inline-flex;
	align-items: center;
	padding: 2.5px 8px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	background: var(--c-soft, var(--gray-soft));
	color: var(--c, var(--txt2));
}

.sm-page .c-blue {
	--c: #2563eb;
	--c-soft: #eef4ff;
}

.sm-page .c-orange {
	--c: #b45309;
	--c-soft: #fff7e8;
}

.sm-page .c-purple {
	--c: #6d28d9;
	--c-soft: #f3eeff;
}

.sm-page .c-green {
	--c: #15803d;
	--c-soft: #eaf7ef;
}

.sm-page .c-cyan {
	--c: #0e7490;
	--c-soft: #e6f6fa;
}

.sm-page .c-gray {
	--c: var(--txt2);
	--c-soft: var(--gray-soft);
}

.sm-page .c-red {
	--c: #b91c1c;
	--c-soft: #fdecec;
}

/* Chi tiết */
.sm-page .ob-detail {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.sm-page .d-top {
	display: flex;
	flex-direction: column;
	gap: 5px;
	align-items: flex-start;
}

.sm-page .d-crumb {
	font-size: 14px;
	color: var(--txt3);
}

.sm-page .d-key {
	font-size: 20px;
	color: var(--pri-strong);
}

.sm-page .d-name {
	font-size: 15px;
	font-weight: 650;
	line-height: 1.35;
}

.sm-page .d-miss {
	background: var(--gray-soft);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 7px 10px;
	font-size: 14px;
	color: var(--txt2);
}

.sm-page .status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ok-strong);
}

.sm-page .status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ok);
}

.sm-page .status.off {
	color: var(--txt3);
}

.sm-page .status.off::before {
	background: #c9cdd4;
}

.sm-page .d-warn {
	background: var(--warn-soft);
	border: 1px solid var(--warn-line);
	border-radius: var(--r-sm);
	padding: 8px 10px;
	font-size: 14px;
	color: #6b4a12;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.sm-page .d-warn b {
	color: var(--warn-text);
}

.sm-page .d-sec h5 {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 650;
	color: var(--txt2);
}

.sm-page .kv {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	overflow: hidden;
}

.sm-page .kv > div {
	padding: 7px 10px;
	font-size: 14px;
	border-bottom: 1px solid var(--line-soft);
	min-width: 0;
	overflow-wrap: anywhere;
}

.sm-page .kv > div:nth-child(odd) {
	color: var(--txt2);
	background: #fbfcfe;
}

.sm-page .kv > div:nth-last-child(-n+2) {
	border-bottom: 0;
}

.sm-page .d-meta {
	font-size: 13px;
	color: var(--txt3);
	overflow-wrap: anywhere;
}

.sm-page .d-none {
	border: 1px dashed var(--line-hover);
	border-radius: var(--r-sm);
	padding: 8px 10px;
	font-size: 14px;
	color: var(--txt3);
}

/* Danh sách con ở panel chi tiết: mỗi mục một khối */
.sm-page .d-list {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	overflow: hidden;
}

.sm-page .d-item {
	padding: 8px 10px;
	border-bottom: 1px solid var(--line-soft);
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	font-size: 14px;
	overflow-wrap: anywhere;
}

.sm-page .d-item:last-child {
	border-bottom: 0;
}

.sm-page .d-item-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.sm-page .d-item-top .mono {
	font-size: 14px;
	color: var(--pri-strong);
}

.sm-page .d-item-top .mono.acc {
	font-size: 14px;
}

.sm-page .d-item-name {
	flex: 1;
	min-width: 0;
	text-align: right;
	color: var(--txt2);
}

.sm-page .d-item-bank {
	font-size: 14px;
	display: flex;
	gap: 6px;
	align-items: baseline;
	flex-wrap: wrap;
}

.sm-page .d-item-bank .mono {
	font-size: 14px;
	color: var(--txt2);
}

.sm-page .d-item-meta {
	font-size: 13px;
	color: var(--txt3);
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
}

.sm-page .d-item-meta b {
	color: var(--txt2);
	font-size: 13px;
}

/* Nhóm nhãn */
.sm-page .d-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

/* Giá / thuế ở panel chi tiết canh phải */
.sm-page .kv.num > div:nth-child(even) {
	text-align: right;
}

/* Đang nạp lại chi tiết của cùng hàng hoá */
.sm-page .d-top.busy {
	opacity: .6;
}

/* Hộp thoại */
.sm-page .ob-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, .42);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 1050;
}

.sm-page .ob-modal {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 720px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	box-shadow: var(--sh-lg);
	margin: 0;
}

.sm-page .ob-modal.small {
	max-width: 440px;
}

/* Hộp thoại form hàng hoá (2 tab): rộng tới 1080px (94vw), cao tối đa 92vh; thân form tự cuộn bên trong */
.sm-page .ob-modal.form {
	max-width: min(1080px, 94vw);
	max-height: 92vh;
	overflow: hidden;
}

.sm-page .m-head {
	min-height: var(--dlg-bar-h, 46px);
	box-sizing: border-box;
	padding: 8px 10px 8px 14px;
	border-bottom: 1px solid var(--line-soft);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.sm-page .m-head h2 {
	margin: 0;
	font-size: 14px;
	font-weight: 660;
	color: var(--txt);
}

.sm-page .m-body {
	padding: 16px;
	overflow: auto;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sm-page .m-foot {
	min-height: var(--dlg-bar-h, 46px);
	box-sizing: border-box;
	padding: 8px 12px;
	border-top: 1px solid var(--line-soft);
	display: flex;
	gap: 8px;
	background: #fbfcfe;
	border-radius: 0 0 12px 12px;
	flex-shrink: 0;
	align-items: center;
}

.sm-page .m-foot .sp {
	flex-grow: 1;
}

.sm-page .m-foot .tip {
	font-size: 13px;
	color: var(--txt3);
}

.sm-page .ob-deltext {
	line-height: 1.55;
}

/* Câu báo của máy chủ khi không xoá được (hiện nguyên văn) */
.sm-page .ob-delerr {
	margin-top: 10px;
	padding: 8px 10px;
	border: 1px solid var(--dan-line);
	border-radius: var(--r-sm);
	background: var(--dan-soft);
	color: #b91c1c;
	font-size: 14px;
	font-weight: 600;
}

.sm-page.ob mark {
	background: #fff8e1;
	box-shadow: 0 0 0 1px #fde68a;
	color: inherit;
	border-radius: 3px;
}

/* Ô lọc nhóm vật tư, hàng hóa / trạng thái trên thanh công cụ */
.sm-page.ob .ob-filter {
	width: 240px;
}

.sm-page.ob .ob-status {
	width: 170px;
}

/* Câu báo lỗi máy chủ trong vùng bảng / chi tiết */
.sm-page .ob-err {
	color: #b91c1c;
	font-weight: 600;
}

/* Ô đơn vị tính: dòng đầu chữ thường (không đậm) */
.sm-page .ob-name b.plain {
	font-weight: 400;
}

/* Nút chân hộp thoại: cùng kiểu tô nền (fill), màu theo nghĩa */
.sm-page .m-foot .ob-btn {
	height: 28px;
	background: #64748b;
	border-color: #64748b;
	color: #fff;
}

.sm-page .m-foot .ob-btn:hover:not(:disabled) {
	background: #475569;
	border-color: #475569;
	color: #fff;
}

.sm-page .m-foot .ob-btn.primary {
	background: var(--pri);
	border-color: var(--pri);
	color: #fff;
}

.sm-page .m-foot .ob-btn.primary:hover:not(:disabled) {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}

.sm-page .m-foot .ob-btn.success {
	background: var(--ok);
	border-color: var(--ok);
	color: #fff;
}

.sm-page .m-foot .ob-btn.success:hover:not(:disabled) {
	background: #15803d;
	border-color: #15803d;
	color: #fff;
}

.sm-page .m-foot .ob-btn.danger, .sm-page .m-foot .ob-btn.dangerline, .sm-page .m-foot .ob-btn.dangerfill {
	background: var(--dan);
	border-color: var(--dan);
	color: #fff;
}

.sm-page .m-foot .ob-btn.danger:hover:not(:disabled), .sm-page .m-foot .ob-btn.dangerline:hover:not(:disabled), .sm-page .m-foot .ob-btn.dangerfill:hover:not(:disabled) {
	background: #b91c1c;
	border-color: #b91c1c;
	color: #fff;
}

/* Hàng nút thao tác trên một bản ghi: giãn đều, mỗi nút ít nhất vừa đủ chữ; thiếu chỗ thì tự xuống dòng */
.sm-page .act-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.sm-page .act-btn {
	--a: #2563eb;
	--a-soft: #eef4ff;
	--a-line: #c7dbff;
	--a-strong: #1d4ed8;
	flex: 1 1 118px;
	min-width: min(max-content, 100%);
	height: 28px;
	padding: 0 10px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 1px solid var(--a-line);
	border-radius: 7px;
	background: var(--a-soft);
	color: var(--a);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
}

.sm-page .act-btn:hover:not(:disabled) {
	background: var(--a);
	border-color: var(--a);
	color: #fff;
}

.sm-page .act-btn svg {
	flex: none;
}

.sm-page .act-btn:focus-visible {
	outline: 2px solid var(--a-line);
	outline-offset: 1px;
}

.sm-page .act-btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

.sm-page .act-btn.c-blue {
	--a: #2563eb;
	--a-soft: #eef4ff;
	--a-line: #c7dbff;
}

.sm-page .act-btn.c-purple {
	--a: #7c3aed;
	--a-soft: #f3eeff;
	--a-line: #ddd0fb;
}

.sm-page .act-btn.c-orange {
	--a: #d97706;
	--a-soft: #fff7e8;
	--a-line: #f7dfae;
}

.sm-page .act-btn.c-green {
	--a: #16a34a;
	--a-soft: #eaf7ef;
	--a-line: #c3e6d0;
}

.sm-page .act-btn.c-red {
	--a: #dc2626;
	--a-soft: #fdecec;
	--a-line: #f3c7c7;
}

.sm-page .act-btn.c-pink {
	--a: #db2777;
	--a-soft: #fdf0f6;
	--a-line: #f6c6dc;
}

/* Bảng danh sách co giãn: ẩn bớt cột phụ khi màn hẹp */
.sm-page .nowrap {
	white-space: nowrap;
}
/* Màn hẹp: gộp tên vào ô mã thành 2 hàng */
.sm-page .ob-cn-sub, .sm-page .ob-cn-sub-h {
	display: none;
}

.sm-page .trow .ob-cn-sub {
	flex-basis: 100%;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 400;
	color: var(--txt2);
}

.sm-page .trow.off .ob-cn-sub {
	color: inherit;
}

/* Hộp xác nhận xoá: nổi bật hẳn so với hộp thường — đầu hộp nền đỏ nhạt, tiêu đề đỏ, icon cảnh báo trong vòng tròn đỏ */
.sm-page .ob-modal.danger {
	box-shadow: 0 18px 50px rgba(220, 38, 38, .28);
}

.sm-page .ob-modal.danger .m-head {
	background: #fdecec;
	border-bottom-color: #f6caca;
	border-radius: 8px 8px 0 0;
}

.sm-page .ob-modal.danger .m-head h2 {
	color: #dc2626;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sm-page .ob-modal.danger .m-body {
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	font-size: 14px;
}

.sm-page .ob-modal.danger .m-body > div {
	flex: 1;
	min-width: 0;
}

.sm-page .danger-ic {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fdecec;
	color: #dc2626;
	display: grid;
	place-items: center;
	flex: none;
	box-shadow: 0 0 0 6px #fef5f5;
}

/* Panel chi tiết nhận focus khi chọn đúp dòng (không có quyền sửa): viền nhấn để thấy đã chuyển tới. */
.sm-page .ob-detail:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--pri-line), var(--sh);
}

/* Co giãn theo bề ngang thật của màn (container ob-page = .ob, đã trừ menu trái dù mở hay đóng), không theo cửa sổ;
   cột phụ của bảng ẩn theo bề ngang khung bảng (container ob-list). */
.sm-page.ob {
	container: ob-page / inline-size;
}

.sm-page .ob-table {
	container: ob-list / inline-size;
}

/* Khung bảng là container inline-size nên không có bề ngang nội tại: khi .ob-body đổi sang xếp dọc (flex, các màn *-stack)
   mà vẫn mang align-items: start của lưới thì khung bị co về 0 (thanh công cụ dồn thành cột). Luôn trải hết bề ngang cột / khung. */
/* Mọi khối trong thân màn (bảng danh sách, khung chi tiết, nút thu / mở) rộng đúng khung, không giãn theo bảng bên trong:
   bảng rộng hơn khung thì cuộn ngang trong vùng cuộn của nó. */
.sm-page .ob-wrap,
.sm-page .ob-wrap > *,
.sm-page .ob-body > *,
.sm-page .ob-detail > *,
.sm-page .ob-detail {
	min-width: 0;
}

.sm-page .ob-body > .ob-detail,
.sm-page .ob-body > section {
	box-sizing: border-box;
	width: 100%;
}

.sm-page .ob-detail .d-tbl-wrap {
	max-width: 100%;
	overflow-x: auto;
}

.sm-page .ob-body > .ob-table {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
}

/* Panel chi tiết xuống dưới bảng khi màn hẹp hơn: đệm 24 + lưới đủ cột 1004 + viền bảng 2 + gap 12 + chi tiết 340 = 1382 → 1390. */
@container ob-page (max-width: 1389.98px) {
	.sm-page .k-product .ob-body {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Màn < 660px: danh sách rà soát một cột (đệm khung giữ như màn rộng). */
@container ob-page (max-width: 659.98px) {
	.sm-page .ob-review ul {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Lợi nhuận gộp âm */
.sm-page .ob-loss {
	color: var(--dan);
}

.sm-page .d-pct {
	margin-left: 4px;
	font-family: Inter, "Segoe UI", system-ui, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: var(--txt3);
}

/* Bảng đơn vị chuyển đổi ở panel chi tiết */
.sm-page .d-tbl-wrap {
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	overflow-x: auto;
}

.sm-page .d-tbl {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--tbl-fs, 14px);
}

.sm-page .d-tbl th {
	background: #f8fafc;
	color: var(--txt2);
	font-size: var(--tbl-fs-head, 14px);
	font-weight: 620;
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid var(--line-soft);
	white-space: nowrap;
}

.sm-page .d-tbl td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--line-soft);
	vertical-align: top;
	overflow-wrap: anywhere;
}

.sm-page .d-tbl tbody tr:last-child td {
	border-bottom: 0;
}

.sm-page .d-tbl td b {
	font-weight: 600;
}

.sm-page .d-tbl .num {
	text-align: right;
	white-space: nowrap;
}

.sm-page .d-tbl .mono {
	font-size: var(--tbl-fs-mono, 14px);
}

.sm-page .d-tbl tr.off td {
	color: var(--txt3);
}

/* Đặc tính sản phẩm: giữ xuống dòng như khi nhập */
.sm-page .d-text {
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 8px 10px;
	font-size: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: #fbfcfe;
}

/* ---------------------------------------------------------------- Khung chi tiết chứng từ (mọi màn SalesManagement)
   Giữ một khối trắng; bảng thông tin và bảng dòng hàng viền, nền nhãn, đầu cột đậm hơn để nổi trên nền;
   khối hai cột (…-cols) cách nhau rõ, hẹp thì xuống một cột. */
.sm-page .ob-detail {
	padding: 16px;
	gap: 16px;
}

.sm-page .ob-detail .d-sec {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.sm-page .ob-detail .d-sec h5 {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #1e3a8a;
}

.sm-page .ob-detail .kv {
	grid-template-columns: minmax(130px, .8fr) minmax(0, 1.4fr);
	border: 1px solid #cfd8e3;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.sm-page .ob-detail .kv > div {
	padding: 9px 12px;
	line-height: 1.45;
	border-bottom-color: #e2e8f0;
}

.sm-page .ob-detail .kv > div:nth-child(odd) {
	background: #eef2f7;
	color: #334155;
	font-weight: 550;
	border-right: 1px solid #e2e8f0;
}

.sm-page .ob-detail [class$="-cols"] {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

@container ob-page (max-width: 899.98px) {
	.sm-page .ob-detail [class$="-cols"] {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sm-page .ob-detail [class$="-flow"] {
	padding: 0;
}

/* Bảng trong khung chi tiết dưới danh sách (ob-detail, vl-detail) cùng kiểu lưới danh sách phía trên:
   tiêu đề nền #f8fafc chữ 11.5px 620, hàng 32px chữ 13px nền trắng kẻ mờ, rê chuột / dòng chọn chỉ tô nền, dòng Cộng như dòng tổng. */
.sm-page .ob-detail .d-tbl-wrap {
	border: 1px solid var(--line);
	border-radius: 8px;
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl {
	font-size: var(--tbl-fs, 14px);
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl > thead > tr:not(.lt-filter-row) > th,
.sm-page :is(.ob-detail, .vl-detail) .d-tbl > :is(tbody, tfoot) > tr > td {
	height: 32px;
	padding: 0 10px;
	vertical-align: middle;
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl > thead > tr:not(.lt-filter-row) > th {
	background: #f8fafc;
	color: var(--txt2);
	font-size: var(--tbl-fs-head, 14px);
	font-weight: 620;
	border-bottom: 1px solid var(--line-soft);
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl td {
	border-bottom-color: var(--line-soft);
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl .mono {
	font-size: var(--tbl-fs-mono, 14px);
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl tbody tr:hover td {
	background: #fafcff;
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl tbody tr:is(.on, .sel) td {
	background: var(--pri-soft);
}

/* Dòng tổng cộng cuối lưới danh sách (theo toàn bộ bộ lọc); ô dùng cùng lớp ẩn/hiện như đầu cột */
.sm-page .tsum {
	min-height: 32px;
	background: #eef2f7;
	border-top: 1px solid #cfd8e3;
	font-size: 14px;
	font-weight: 650;
	color: #1f2937;
	cursor: default;
}

.sm-page .tsum > .tsum-label {
	white-space: nowrap;
	color: #1e3a8a;
	font-weight: 700;
}

.sm-page .tsum > .num {
	white-space: nowrap;
}

/* Dòng cộng cuối bảng chi tiết */
.sm-page .d-tbl tfoot td {
	padding: 6px 10px;
	border-top: 1px solid #cfd8e3;
	background: #eef2f7;
	font-weight: 650;
	white-space: nowrap;
}

.sm-page .d-tbl tfoot .d-tfoot-label {
	color: #1e3a8a;
	font-weight: 700;
}

/* Bảng chi tiết có phân trang: một khung chung cho bảng và thanh phân trang */
.sm-page .d-tbl-box {
	border: 1px solid #cfd8e3;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
	overflow: hidden;
}

.sm-page .d-tbl-box .d-tbl-wrap {
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.sm-page .d-tbl-box .ltp {
	padding: 6px 10px;
	gap: 6px 10px;
}

/* Luật bảng: tiêu đề cột căn THEO Ô DỮ LIỆU bên dưới — chữ trái, số / ngày phải (lớp num), cột ngắn / thao tác / # giữa (lớp c, c-act, c-idx);
   ô số / ngày căn phải, còn lại căn trái; chữ dài một dòng, hiện … (22/10: bỏ luật tiêu đề căn giữa) */
.sm-page .g.thead > *,
.sm-page .d-tbl thead th {
	text-align: left;
}

.sm-page .g.thead > .num,
.sm-page .d-tbl thead th.num {
	text-align: right;
}

.sm-page .g.thead > :is(.c, .c-act, .c-idx),
.sm-page .d-tbl thead th:is(.c, .c-act, .c-idx) {
	text-align: center;
}

.sm-page .d-tbl tbody td,
.sm-page .d-tbl tfoot td {
	white-space: nowrap;
	overflow-wrap: normal;
	max-width: 360px;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Chiều cao dòng bảng chuẩn 32px (luật gọn chiều cao): đệm ngang 8px, không đệm dọc, căn giữa dọc, dòng chữ gọn;
   dòng nhiều chữ vẫn nở theo nội dung (height của ô là tối thiểu), ô nhập / nút <= 28px nằm gọn trong 32px. */
.sm-page .d-tbl > thead > tr:not(.lt-filter-row) > th,
.sm-page .d-tbl > :is(tbody, tfoot) > tr > td {
	box-sizing: border-box;
	height: 32px;
	padding-block: 0;
	vertical-align: middle;
	line-height: 1.25;
}

.sm-page .trow {
	box-sizing: border-box;
	line-height: 1.25;
}

/* Cột # (số thứ tự) đầu lưới danh sách div.g: số màu chữ phụ, căn giữa */
.sm-page .g > .c-idx,
.sm-page .g.thead > .c-idx {
	text-align: center;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

/* Cột # (số thứ tự) trong bảng chi tiết / popup: bề ngang và đệm theo css/lt-grid.css */
.sm-page table.d-tbl th.c-idx,
.sm-page table.d-tbl td.c-idx {
	text-align: center;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

/* Cột # ghim trái mặc định khi cuộn ngang; nền theo dòng. Ô # của hàng tiêu đề / dòng Cộng: nền độ ưu tiên 0 để màu riêng
   của hàng tiêu đề / dòng Cộng trong CSS từng màn (vd nền xanh của lưới form phiếu) vẫn thắng. */
.sm-page table.d-tbl th.c-idx,
.sm-page table.d-tbl td.c-idx {
	position: sticky;
	left: 0;
	z-index: 1;
}

.sm-page table.d-tbl > tbody > tr > .c-idx {
	background-color: var(--lt-row-bg, #fff);
}

:where(.sm-page table.d-tbl > :is(thead, tfoot) > tr > .c-idx) {
	background-color: var(--lt-row-bg, #f8fafc);
}

.sm-page table.d-tbl thead th.c-idx {
	z-index: 3;
}

.sm-page table.d-tbl tr.alt td.c-idx {
	background-color: var(--lt-row-bg, #fafbfd);
}

/* Dòng Cộng / Tổng cộng cùng màu với hàng tiêu đề của bảng đó */
.sm-page .tsum {
	background: #f8fafc;
}

.sm-page .d-tbl tfoot td {
	background: #f8fafc;
}

.sm-page :is(.ob-detail, .vl-detail) .d-tbl tfoot td {
	background: #f8fafc;
	border-top: 1px solid #cfd8e3;
	color: #1f2937;
	font-size: var(--tbl-fs, 14px);
	font-weight: 650;
}

/* Bảng trong hộp thoại (lịch sử, phân bổ CK…): khung bảng lấp phần còn lại của thân hộp, vùng bảng tự cuộn, thanh phân trang luôn hiện */
.sm-page .m-body > .d-tbl-box {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.sm-page .m-body > .d-tbl-box > .d-tbl-wrap {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
}

.sm-page .m-body > .d-tbl-box > .d-tbl-wrap > .d-tbl > thead > tr:first-child > th {
	position: sticky;
	top: 0;
	z-index: 3;
}

.sm-page .m-body > .d-tbl-box > :not(.d-tbl-wrap) {
	flex: none;
}

/* Dòng Cộng luôn nằm cuối khung bảng (dính đáy vùng cuộn), không phải cuộn xuống mới thấy */
.sm-page .d-tbl > tfoot > tr > td {
	position: sticky;
	bottom: 0;
	z-index: 3;
	box-shadow: 0 -1px 0 #cfd8e3;
}

/* ---------- 22/10: dùng chung cho thanh nút dưới form (SmartFormFrame) / chân hộp — nút tô đặc theo nghĩa ----------
   neutral = xám (Huỷ / Đóng), warnfill = cam, violetfill = tím (Kiểm tra trùng…), draftfill = xanh dương (Lưu nháp). */
.sm-page .ob-btn:is(.neutral, .warnfill, .violetfill, .draftfill, .histfill) {
	color: #fff;
}

.sm-page .ob-btn.neutral { background: #64748b; border-color: #64748b; }
.sm-page .ob-btn.neutral:hover:not(:disabled) { background: #475569; border-color: #475569; }
.sm-page .ob-btn.warnfill { background: #d97706; border-color: #d97706; }
.sm-page .ob-btn.warnfill:hover:not(:disabled) { background: #b45309; border-color: #b45309; }
.sm-page .ob-btn.violetfill { background: #7c3aed; border-color: #7c3aed; }
.sm-page .ob-btn.violetfill:hover:not(:disabled) { background: #6d28d9; border-color: #6d28d9; }
.sm-page .ob-btn.draftfill { background: #2563eb; border-color: #2563eb; }
.sm-page .ob-btn.histfill { background: #0f766e; border-color: #0f766e; }
.sm-page .ob-btn.histfill:hover:not(:disabled) { background: #115e59; border-color: #115e59; }
.sm-page .ob-btn.draftfill:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }

/* Nút nhỏ trong thẻ / bảng con (thay .btn-xs của bản mẫu KM) */
.sm-page .ob-btn.sm {
	height: 24px;
	padding: 0 8px;
	font-size: 14px;
	gap: 5px;
}

/* Nút nhạt màu nhấn (thay .btn-soft của bản mẫu KM) */
.sm-page .ob-btn.soft {
	background: var(--pri-soft);
	border-color: var(--pri-line);
	color: var(--pri);
}

.sm-page .ob-btn.soft:hover:not(:disabled) {
	background: #e0edff;
}

/* Màu thêm cho .pill (đủ bộ SmartTone) */
.sm-page .c-pink {
	--c: #db2777;
	--c-soft: #fdeef6;
}

.sm-page .c-draft {
	--c: #334155;
	--c-soft: #e8ecf2;
}

/* ob-iconbtn biến thể xoá / nhân bản (thay .icobtn.del / .icobtn.cp) */
.sm-page .ob-iconbtn.del:hover {
	background: var(--dan-soft);
	color: var(--dan);
}

.sm-page .ob-iconbtn.cp:hover {
	background: #f3eeff;
	color: #7c3aed;
}

.sm-page .ob-iconbtn:disabled {
	opacity: .4;
	cursor: not-allowed;
}

/* Thanh lọc nằm trong cùng thẻ với bảng (báo cáo bán hàng): không viền riêng, chỉ kẻ mảnh phía dưới */
.sm-page .ob-table > .ob-toolbar {
	flex: none;
	border-bottom: 1px solid #eef1f6;
}

/* ===== Bảng báo cáo có nhóm cột (table.rpt) — lấy theo báo cáo Nhập – xuất – tồn kho (thủ kho) =====
   Tiêu đề hai hàng: hàng 1 nhóm (th.metric, colspan) + cột đơn (rowspan 2), hàng 2 cột con (th.bl cột đầu nhóm); kẻ đậm ở ranh giới nhóm (.bl), kẻ mảnh giữa các dòng. */
.rpt-box {
	--rpt-surface: #f3f7fd;
	--rpt-line: #e3e9f2;
	--rpt-line-strong: #c9d4e3;
	--rpt-head-fg: #1e40af;
	--rpt-total: #eaf0fa;
	--rpt-h: 34px;
}

table.rpt {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	margin: 0;
	font-size: var(--tbl-fs, 14px);
	font-variant-numeric: tabular-nums;
}

.rpt th,
.rpt td {
	padding: 6px 9px;
	border-bottom: 1px solid var(--rpt-line);
	border-left: 1px solid var(--rpt-line);
	white-space: nowrap;
}

.rpt th.c-idx,
.rpt td.c-idx {
	border-left: 0;
}

.rpt thead th {
	position: sticky;
	z-index: 3;
	box-sizing: border-box;
	height: var(--rpt-h);
	background: var(--rpt-surface);
	color: var(--rpt-head-fg);
	font-weight: 600;
	text-align: center;
	border-bottom: 1px solid var(--rpt-line-strong);
}

.rpt thead tr:nth-child(1) th {
	top: 0;
}

.rpt thead tr:nth-child(2) th {
	top: var(--rpt-h);
}

.rpt thead tr.rpt-filter th {
	top: calc(var(--rpt-h) * 2);
	height: auto;
	padding: 3px 9px;
	background: #fff;
	font-weight: 400;
}

.rpt thead tr.rpt-filter ::deep .slf-in,
.rpt thead tr.rpt-filter .slf-in {
	width: 100%;
	min-width: 0;
	height: 28px;
	box-sizing: border-box;
	padding: 0 8px;
	border: 1px solid #d6dee9;
	border-radius: 6px;
	background: #fff;
	color: #1f2937;
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	outline: none;
}

/* Mọi ô lọc trong hàng lọc (ô gõ, khoảng số, khoảng ngày, danh sách chọn) cùng một khuôn: cao 28, đệm 8, viền #d6dee9, bo 6, chữ 14, chữ gợi ý xám */
.rpt thead tr.rpt-filter th input.slf-in,
.rpt thead tr.rpt-filter th .snr-btn,
.rpt thead tr.rpt-filter th .sdr-btn,
.rpt thead tr.rpt-filter th .lts-btn {
	box-sizing: border-box;
	width: 100%;
	height: 28px;
	min-height: 28px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid #d6dee9;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 26px;
	text-align: left;
	outline: none;
}

.rpt thead tr.rpt-filter th input.slf-in {
	color: #1f2937;
}

.rpt thead tr.rpt-filter th input.slf-in::placeholder {
	color: #6b7280;
	opacity: 1;
}

.rpt thead tr.rpt-filter th input.slf-in:focus {
	border-color: #93b4ef;
	box-shadow: 0 0 0 2px #eef4ff;
}

.rpt thead tr.rpt-filter th input.slf-in:not(:placeholder-shown) {
	border-color: #93b4ef;
	background: #f7faff;
}

.rpt thead tr:first-child th.metric,
.rpt th.bl,
.rpt td.bl {
	border-left: 1px solid var(--rpt-line-strong);
}

.rpt td.num {
	text-align: right;
}

.rpt td.c-idx,
.rpt th.c-idx {
	text-align: center;
	color: #6b7280;
}

.rpt tbody tr {
	cursor: pointer;
}

.rpt tbody tr:hover td {
	background: #f7faff;
}

.rpt tbody tr.sel td {
	background: #eaf2ff;
}

.rpt tfoot td {
	position: sticky;
	bottom: 0;
	z-index: 2;
	background: var(--rpt-total);
	font-weight: 700;
	border-top: 1px solid var(--rpt-line-strong);
	border-bottom: 0;
}

/* Báo cáo: ô dữ liệu chữ thường, không đậm (kể cả mã / số dạng mono) */
.rpt tbody td,
.sm-page.ob .rpt tbody td.mono,
.sm-page.ob .rpt tbody td > .mono {
	font-weight: 400;
}

.rpt td.empty {
	padding: 28px;
	text-align: center;
	color: #8a94a6;
	white-space: normal;
}

/* Hàng lọc của table.rpt: ô tiêu đề (th dính, mỗi ô là một lớp xếp chồng riêng) đang mở hộp lọc thì nổi lên trên các ô khác, để lớp phủ bấm-ra-ngoài của hộp phủ được cả các ô lọc còn lại: bấm sang cột khác sẽ đóng hộp của cột trước, không để hai hộp mở cùng lúc */
.rpt thead tr.rpt-filter th:has(.snr.open, .lts.open, .sdr.open) {
	z-index: 12;
}

/* Tiêu đề bảng báo cáo căn giữa mọi cột; cột đủ rộng để ô lọc dưới tiêu đề hiện đủ chữ */
.rpt thead tr th {
	text-align: center;
}

.rpt thead tr:nth-child(2) th,
.rpt thead tr:first-child th[rowspan]:not(.c-idx) {
	min-width: 116px;
}

/* Tiêu đề cột sắp xếp được: mũi tên đặt tuyệt đối sát mép phải nên không đẩy chữ lệch khỏi giữa ô; chữ căn giữa dọc */
.rpt thead tr th {
	vertical-align: middle;
}

/* Cột hẹp, tiêu đề hai dòng (vd Hệ số / quy đổi): cột co vừa dòng dài nhất, mỗi dòng .hw giữ nguyên */
.rpt thead tr:first-child th[rowspan].c-wrap,
.rpt thead tr:nth-child(2) th.c-wrap {
	width: 1px;
	min-width: 0;
	white-space: normal;
}

.rpt thead th.c-wrap .hw {
	white-space: nowrap;
}

.rpt thead th.lt-sort {
	padding-left: 16px;
	padding-right: 16px;
}

.rpt thead th.lt-sort::after {
	position: absolute;
	right: 4px;
	top: 50%;
	margin: 0;
	transform: translateY(-50%);
}

/* Ô lọc có nhãn trên thanh lọc báo cáo: nhãn đứng trước ô, cùng hàng, chữ thường như nhãn Từ ngày / Đến ngày */
.rf-fld {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-size: 14px;
	color: #5b6577;
	white-space: nowrap;
}
