:root {
	--sales-topbar-height: 56px;
	--sales-bottom-nav-height: 64px;
	--sales-running-total-height: 72px;
	--sales-tap-target: 44px;

	--sales-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
	--sales-shadow-list: 0 1px 3px rgba(0, 0, 0, 0.04);
	--sales-shadow-numpad: 0 1px 2px rgba(0, 0, 0, 0.05);
	--sales-shadow-running-total: 0 -2px 8px rgba(0, 0, 0, 0.05);
	--sales-shadow-wrap: 0 0 24px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] {
	--sales-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
	--sales-shadow-list: 0 1px 3px rgba(0, 0, 0, 0.35);
	--sales-shadow-numpad: 0 1px 2px rgba(0, 0, 0, 0.35);
	--sales-shadow-running-total: 0 -2px 8px rgba(0, 0, 0, 0.45);
	--sales-shadow-wrap: 0 0 24px rgba(0, 0, 0, 0.5);
}

.logo-dark { display: inline-block; }
.logo-light { display: none; }
[data-bs-theme="dark"] .logo-dark { display: none; }
[data-bs-theme="dark"] .logo-light { display: inline-block; }

body.sales-app {
	background: var(--theme-tertiary-bg);
	padding-bottom: var(--sales-bottom-nav-height);
	padding-top: var(--sales-topbar-height);
	-webkit-tap-highlight-color: transparent;
}

body.sales-app.sales-auth {
	padding: 0;
	background: var(--theme-body-bg);
}

.sales-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--sales-topbar-height);
	background: var(--theme-secondary-bg);
	border-bottom: 1px solid var(--theme-border-color);
	z-index: 1030;
	display: flex;
	align-items: center;
}

.sales-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0 0.75rem;
	gap: 0.5rem;
}

.sales-topbar-btn {
	min-width: var(--sales-tap-target);
	min-height: var(--sales-tap-target);
	border: 0;
	background: transparent;
	color: var(--theme-body-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	position: relative;
}

.sales-topbar-btn:active {
	background: var(--theme-tertiary-bg);
}

.sales-topbar-brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
	font-weight: 700;
	flex: 1;
	justify-content: center;
}

.sales-topbar-logo {
	height: 28px;
	width: auto;
}

.sales-topbar-title {
	font-size: 1.05rem;
	letter-spacing: 0.02em;
}

.sales-topbar-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.sales-topbar-location {
	padding: 0.35rem 0.6rem;
	font-size: 0.72rem;
}

.sales-topbar .topbar-link {
	min-width: var(--sales-tap-target);
	min-height: var(--sales-tap-target);
	border: 0;
	background: transparent;
	color: var(--theme-body-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	position: relative;
	font-weight: var(--theme-font-weight-medium);
}

.sales-topbar .topbar-link:hover,
.sales-topbar .topbar-link:focus {
	color: var(--theme-body-color);
}

.sales-topbar .topbar-link:active {
	background: var(--theme-tertiary-bg);
}

.sales-topbar .topbar-link .topbar-link-icon {
	font-size: 20px;
}

.sales-topbar .topbar-badge {
	position: absolute;
	top: 4px;
	right: 4px;
	font-size: 0.6rem;
}

.sales-main {
	min-height: calc(100vh - var(--sales-topbar-height) - var(--sales-bottom-nav-height));
}

.sales-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: var(--sales-bottom-nav-height);
	background: var(--theme-secondary-bg);
	border-top: 1px solid var(--theme-border-color);
	display: flex;
	align-items: stretch;
	z-index: 1030;
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.sales-bottom-nav-item {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	color: var(--theme-secondary-color);
	text-decoration: none;
	border: 0;
	background: transparent;
	font-size: 0.68rem;
	line-height: 1.1;
	padding: 0.35rem 0.25rem;
	min-height: var(--sales-tap-target);
}

.sales-bottom-nav-item span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.sales-bottom-nav-item.active,
.sales-bottom-nav-item:active {
	color: var(--theme-primary);
}

.sales-bottom-nav-highlight {
	position: relative;
}

.sales-bottom-nav-highlight-circle {
	background-color: var(--theme-primary);
	color: #fff;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: -14px;
	box-shadow: 0 4px 14px rgba(var(--theme-primary-rgb), 0.35);
	font-size: 1.5rem;
	line-height: 1;
}

.sales-menu-drawer {
	max-width: 320px;
}

.sales-card {
	border-radius: 12px;
	background: var(--theme-secondary-bg);
	box-shadow: var(--sales-shadow-card);
	padding: 1rem;
	margin-bottom: 1rem;
}

.sales-card-title {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--theme-secondary-color);
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.sales-btn-tap {
	min-height: var(--sales-tap-target);
	padding: 0.65rem 1rem;
	font-weight: 500;
}

.sales-input-tap,
.sales-input-tap.form-control {
	min-height: var(--sales-tap-target);
	font-size: 1rem;
}

.sales-list-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	background: var(--theme-secondary-bg);
	border-radius: 10px;
	margin-bottom: 0.5rem;
	box-shadow: var(--sales-shadow-list);
	text-decoration: none;
	color: inherit;
	min-height: var(--sales-tap-target);
}

.sales-list-item:active {
	background: var(--theme-tertiary-bg);
}

.sales-pin-display {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.sales-pin-dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--theme-tertiary-bg);
	border: 2px solid var(--theme-border-color);
	transition: background 120ms, border-color 120ms, transform 120ms;
}

.sales-pin-dot.filled {
	background: var(--theme-primary);
	border-color: var(--theme-primary);
	transform: scale(1.05);
}

.sales-code-display {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.sales-code-cell {
	width: 42px;
	height: 52px;
	border-radius: 8px;
	background: var(--theme-secondary-bg);
	border: 2px solid var(--theme-border-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--theme-emphasis-color);
}

.sales-code-cell.filled {
	border-color: var(--theme-primary);
	background: rgba(var(--theme-primary-rgb), 0.08);
}

.sales-numpad {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
	max-width: 320px;
	margin: 0 auto;
}

.sales-numpad-btn {
	min-height: 64px;
	min-width: 64px;
	border-radius: 16px;
	background: var(--theme-secondary-bg);
	border: 1px solid var(--theme-border-color);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--theme-emphasis-color);
	box-shadow: var(--sales-shadow-numpad);
	transition: background 80ms, transform 80ms;
}

.sales-numpad-btn:active {
	background: var(--theme-primary);
	border-color: var(--theme-primary);
	color: #fff;
	transform: scale(0.96);
	box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.2);
}

.sales-numpad-btn.sales-numpad-action {
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--theme-secondary-color);
}

.sales-numpad-btn.sales-numpad-action:active {
	background: var(--theme-tertiary-bg);
	border-color: transparent;
	color: var(--theme-body-color);
	box-shadow: none;
	transform: scale(0.96);
}

.sales-numpad-placeholder {
	visibility: hidden;
}

.sales-auth .auth-box-form {
	border-radius: 0;
	min-height: 100vh;
}

.sales-auth-logo {
	text-align: center;
	margin-bottom: 1.5rem;
}

.sales-auth-logo img {
	max-height: 60px;
	width: auto;
}

.sales-running-total {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--sales-bottom-nav-height);
	min-height: var(--sales-running-total-height);
	background: var(--theme-secondary-bg);
	border-top: 1px solid var(--theme-border-color);
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	z-index: 1020;
	box-shadow: var(--sales-shadow-running-total);
}

.sales-running-total-label {
	font-size: 0.8rem;
	color: var(--theme-secondary-color);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.sales-running-total-amount {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--theme-primary);
}

/* More specific than `body.sales-app` (which sets the base bottom padding) so the extra
   reserve for the fixed running-total bar actually applies and the last card clears it. */
body.sales-app.sales-has-running-total {
	padding-bottom: calc(var(--sales-bottom-nav-height) + var(--sales-running-total-height));
}

.sales-signature-canvas {
	width: 100%;
	min-height: 220px;
	background: var(--theme-secondary-bg);
	border: 2px dashed var(--theme-border-color);
	border-radius: 8px;
	touch-action: none;
}

.sales-qrcode-wrapper {
	display: flex;
	justify-content: center;
	padding: 1rem;
	background: #fff;
	border-radius: 12px;
	margin: 1rem 0;
}

.sales-qrcode-wrapper canvas,
.sales-qrcode-wrapper img {
	max-width: 240px;
	height: auto;
}

.sales-product-search-result {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	background: var(--theme-secondary-bg);
	border-radius: 10px;
	margin-bottom: 0.5rem;
}

.sales-quick-action-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.sales-quick-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 96px;
	border-radius: 12px;
	background: var(--theme-secondary-bg);
	border: 1px solid var(--theme-border-color);
	color: inherit;
	text-decoration: none;
	font-weight: 500;
	padding: 0.75rem;
}

.sales-quick-action i {
	font-size: 1.75rem;
	color: var(--theme-primary);
}

.sales-quick-action:active {
	background: var(--theme-tertiary-bg);
}

.sales-status-badge {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	font-weight: 600;
}

.sales-empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--theme-secondary-color);
}

.sales-empty-state i {
	font-size: 3rem;
	margin-bottom: 0.75rem;
	opacity: 0.4;
	display: block;
}

@media (min-width: 992px) {
	body.sales-app {
		max-width: 560px;
		margin: 0 auto;
		background: var(--theme-secondary-bg);
		box-shadow: var(--sales-shadow-wrap);
		min-height: 100vh;
	}
	.sales-topbar,
	.sales-bottom-nav,
	.sales-running-total {
		max-width: 560px;
		margin: 0 auto;
	}
}

/* Full-width alert bars (2FA reminder, impersonation banner) pinned ABOVE the fixed
   topbar: the bar takes top 0, the topbar and the body padding shift down by the
   bar height (set as --sales-topbar-banner-height by the bar template). */
.sales-topbar-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1031;
}

body.has-sales-topbar-banner .sales-topbar {
	top: var(--sales-topbar-banner-height, 0px);
}

body.sales-app.has-sales-topbar-banner {
	padding-top: calc(var(--sales-topbar-height) + var(--sales-topbar-banner-height, 0px));
}

@media (min-width: 992px) {
	.sales-topbar-banner {
		max-width: 560px;
		margin: 0 auto;
	}
}

/* De regel-editor (uitgeklede Summernote) werkt intern met <p>-blokken terwijl opslag en weergave
   <br>-regels gebruiken — plat de alineamarge zodat de editor dezelfde regelafstand toont als de
   regelweergave en de PDF. */
textarea[data-meriad-summernote-toolbar="minimal"] + .note-editor .note-editable p {
	margin-bottom: 0;
}

.gap-1-5 {
	gap: 0.5625rem !important;
}

/* A switch that opens its form-group has no group label above it, so its own label
   carries the field name and has to match the weight of a .form-label. Switches that
   sit underneath a group label are not :first-child, so they keep the normal body
   weight and the group label stays the only bold text in the block. */
.form-group > .form-check:first-child .form-check-label {
	font-weight: var(--theme-font-weight-semibold);
}