/* Kiểu dùng chung của ứng dụng (khối bậc thưởng, ...) không thuộc thư viện giao diện. */

/* Khối bậc thưởng: mỗi dòng một bậc (nhãn bậc · khoảng · ưu đãi) */
.theme-promo .tierbox {
	margin-top: 6px;
	padding: 8px 10px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-sm);
	background: #fbfcfe;
}

.theme-promo .tierrow {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 24px;
	padding: 3px 0;
	font-size: 14px;
}

.theme-promo .tierrow .lv {
	flex: none;
	width: 52px;
	font-weight: 650;
	color: var(--pri);
}

.theme-promo .tierrow .rg {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--txt2);
}

.theme-promo .tierrow .rw {
	flex: none;
	font-weight: 620;
	white-space: nowrap;
}

.theme-promo .tierrow .rw.muted {
	font-weight: 500;
	color: var(--txt3);
}

.theme-promo .tierrow .rw-go {
	cursor: pointer;
	border-bottom: 1px dashed transparent;
}

.theme-promo .tierrow .rw-go:hover {
	color: var(--pri);
	border-bottom-color: var(--pri);
}

/* Ô nhập trong dòng bậc (form thêm / sửa chỉ tiêu): cùng cỡ chữ 13px, bo, đệm với ô nhập chuẩn (dòng bậc dạng xem vẫn chữ nhỏ) */
.theme-promo .tierrow :is(input, select) {
	padding: 0 9px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	background-color: #fff;
	color: var(--txt);
	font: inherit;
	font-size: 14px;
}

.theme-promo .tierrow :is(.mc-sel-btn, .lts-btn, .ltd-box) {
	font-size: 14px;
}


/* ---------- Sơ đồ nhóm điều kiện của KM (dùng chung tab Điều kiện và tab Logic kết hợp, 22/10) ----------
   Nhóm là khối bo góc, tiêu đề "Nhóm A - OR (3 điều kiện)", chip điều kiện dính viền nhau (cao 32px), nối nhau bằng pill phép nối. */
.theme-promo .flow {
	display: flex;
	align-items: stretch;
	gap: 8px;
	flex-wrap: wrap;
	padding: 0 14px 14px;
	min-width: 0;
}

.theme-promo .flow .joint,
.theme-promo .flow .flow-end {
	display: grid;
	place-items: center;
	flex: none;
}

.theme-promo .flow .grp {
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 9px 11px;
	background: #fcfdff;
	flex: 1 1 260px;
	min-width: 0;
	max-width: 440px;
}

.theme-promo .flow .grp.gA { border-color: #cfe0ff; background: #f7faff; }
.theme-promo .flow .grp.gB { border-color: #e6d8ff; background: #faf7ff; }
.theme-promo .flow .grp.gC { border-color: #cdeef5; background: #f5fdff; }

.theme-promo .flow .grp-t {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 28px;
	min-width: 0;
	margin-bottom: 7px;
	font-size: var(--tbl-fs-head, 14px);
	font-weight: 680;
}

.theme-promo .flow .grp-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.theme-promo .flow .grp-name .cnt {
	font-weight: 500;
	color: var(--txt3);
}

.theme-promo .flow .gA .grp-t { color: #1d4ed8; }
.theme-promo .flow .gB .grp-t { color: #6d28d9; }
.theme-promo .flow .gC .grp-t { color: #0e7490; }

.theme-promo .flow .cond-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	min-height: 32px;
	min-width: 0;
	padding: 0 8px;
	background: #fff;
	border: 1px solid var(--line);
	border-top-width: 0;
	font-size: var(--tbl-fs, 13px);
}

.theme-promo .flow .grp-t + .cond-chip { border-top-width: 1px; border-radius: 7px 7px 0 0; }
.theme-promo .flow .cond-chip:last-child { border-radius: 0 0 7px 7px; }
.theme-promo .flow .grp-t + .cond-chip:last-child { border-radius: 7px; }

.theme-promo .flow .cond-chip .k {
	flex: none;
	max-width: 45%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--txt3);
}

.theme-promo .flow .cond-chip .v {
	flex: 1 1 auto;
	min-width: 0;
	margin-left: auto;
	text-align: right;
	font-weight: 620;
	color: var(--txt);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.theme-promo .flow .cond-chip svg { flex: none; color: var(--pri); }
.theme-promo .flow .gA .cond-chip svg { color: #1d4ed8; }
.theme-promo .flow .gB .cond-chip svg { color: #6d28d9; }
.theme-promo .flow .gC .cond-chip svg { color: #0e7490; }

@container sff (max-width: 560px) {
	.theme-promo .flow { padding: 0 8px 8px; }
	.theme-promo .flow .grp { flex-basis: 100%; max-width: none; }
	.theme-promo .flow .joint { flex: 1 1 100%; }
}


/* Nút Tiện ích: gom các nút phụ (Lịch sử, Xuất Excel...) vào menu xổ lên */
.ft-util { position: relative; display: inline-flex; align-items: center; }

.ft-util-mask { position: fixed; inset: 0; z-index: 40; }

.ft-util-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 6px);
	z-index: 41;
	min-width: 180px;
	display: flex;
	flex-direction: column;
	padding: 4px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}

.ft-util-menu button {
	padding: 8px 12px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #1e293b;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
	white-space: nowrap;
}

.ft-util-menu button:hover:not(:disabled) { background: #f1f5f9; }
.ft-util-menu button:disabled { color: #94a3b8; cursor: default; }

/* Mục Xoá trong menu Tiện ích: chữ đỏ */
.ft-util-menu button.ft-util-danger { color: #dc2626; }
.ft-util-menu button.ft-util-danger:hover:not(:disabled) { background: #fef2f2; }

/* Nút mũi tên cạnh nút In (mở menu mẫu in): dính liền nút In */
html body footer .ob-btn.ft-caret {
	padding: 0 8px;
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

html body footer .ob-btn.printfill:has(+ .ft-caret) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}


/* Nút Tiện ích và nút mũi tên: mũi tên nhỏ vẽ bằng CSS (chữ V ngược), không dùng biểu tượng */
.ft-util > .ob-btn::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate(-135deg) translate(-1px, -1px);
	margin-left: 4px;
	opacity: .75;
}

html body footer .ob-btn.ft-caret { min-width: 30px; padding: 0 8px; }
html body footer .ob-btn.ft-caret svg { display: none; }
html body footer .ob-btn.ft-caret::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate(-135deg) translate(-1px, -1px);
}

.ft-util-menu { padding: 6px; min-width: 170px; }
.ft-util-menu button { padding: 9px 14px; font-weight: 500; }

/* Nút chia đôi (nút chính + mũi tên) ở chân form, vd nút In nhiều mẫu: hai nút dính liền như nút Cất và In */
html body footer .ft-btn-split {
	display: inline-flex !important;
	align-items: stretch;
	gap: 0 !important;
	position: relative;
}

html body footer .ft-btn-split > .ob-btn:first-child {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

html body footer .ft-btn-split > .ob-btn.ft-caret {
	margin-left: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	box-shadow: inset 1px 0 0 rgba(255, 255, 255, .55);
}


/* Hộp thoại Cấp voucher rộng 90vw. */
.smd.pv-issue-dlg {
	width: 90vw !important;
	max-width: 90vw !important;
}


/* Dòng tổng dưới form đơn / phiếu (khối *-totals trong thanh *-sumbar) luôn dồn sang phải, kể cả khi xuống hàng. */
[class*="-sumbar"] [class$="-totals"] {
	margin-left: auto;
	justify-content: flex-end;
}


/* Đầu form đơn / phiếu không nền: ô nhập, dropdown, ô ngày đang khoá (chỉ xem / không được sửa) vẫn nền trắng để không lẫn với nền thân form; chữ mờ cho biết không sửa được. */
.ob.sm-page [class*="-head"] :is(input, textarea, select):is(:disabled, [readonly]),
.ob.sm-page [class*="-head"] .lta.off,
.ob.sm-page [class*="-head"] .ltd.off .ltd-box {
	background-color: #fff;
}


html body footer .sof-print { display: inline-flex; align-items: center; position: relative; }
