/*! Quick Order B2B Grid — shared core sales-rep 1.0.2 (hub shared/sales-rep/; never edit a copy) */
/**
 * Quick Order Grid — ordering on behalf of a customer.
 *
 * The bar sits above the grid and stays visible while the mode is on, so it is
 * always clear whose order is being prepared.
 */

.qog-staff-bar {
	position: sticky;
	top: 0;
	z-index: 6;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qog-space-md, 12px);
	margin-bottom: var(--qog-space-md, 12px);
	padding: var(--qog-space-md, 12px) var(--qog-space-lg, 16px);
	border: 1px solid var(--qog-border-color, #e2e8f0);
	border-radius: 8px;
	background: var(--qog-staff-bg, #f8fafc);
}

.qog-staff-mode .qog-staff-bar {
	border-color: var(--qog-primary-color, #2563eb);
	box-shadow: inset 4px 0 0 var(--qog-primary-color, #2563eb);
}

/* One line at every width. The customer and the way out are all the bar owes
   the staff member; the running total and the primary action stay in the grid
   footer, where the ordinary grid keeps them. */
.qog-staff-active {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: var(--qog-space-md, 12px);
	min-height: 32px;
	min-width: 0;
}

.qog-staff-who {
	display: inline-flex;
	align-items: center;
	gap: var(--qog-space-sm, 8px);
	min-width: 0;
	font-weight: 600;
}

.qog-staff-dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--qog-primary-color, #2563eb);
}

.qog-staff-help {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid var(--qog-border-color, #cbd5e1);
	border-radius: 50%;
	background: #fff;
	color: var(--qog-text-color, #475569);
	font: inherit;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.qog-staff-help:hover {
	background: var(--qog-button-hover-bg, #f1f5f9);
}

/* The second of the two signals this mode leans on, and the one that costs no
   height at all: a frame the staff member cannot scroll away from. */
.qog-staff-frame {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 20;
	border: 3px solid var(--qog-primary-color, #2563eb);
	pointer-events: none;
}

.qog-staff-mode .qog-staff-frame {
	display: block;
}

/* How much is waiting while the table is not yet showing this customer's prices
   and the footer totals are therefore hidden. */
.qog-staff-lines {
	font-size: 0.85em;
	opacity: 0.8;
	white-space: nowrap;
}

.qog-staff-lines:empty {
	display: none;
}

.qog-staff-entry {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qog-space-md, 12px);
}

.qog-staff-entry-hint {
	font-size: 0.9em;
	opacity: 0.8;
}

.qog-staff-exit-confirm {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.qog-staff-exit-ask {
	font-weight: 600;
}

.qog-staff-for {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qog-staff-note {
	margin: 0 0 var(--qog-space-md, 12px);
	padding: var(--qog-space-md, 12px) var(--qog-space-lg, 16px);
	border: 1px solid var(--qog-border-color, #e2e8f0);
	border-inline-start: 3px solid var(--qog-primary-color, #2563eb);
	border-radius: 6px;
	background: var(--qog-staff-bg, #f8fafc);
	font-size: 0.85em;
}

.qog-staff-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-inline-start: auto;
}

/* The footer's sums are hidden by the platform while the table is not this customer's price (the module toggles
   qog-staff-hide-totals on the wrapper; which element holds the sums is the platform's — see README). The
   personal cart and saved templates are hidden by the platform in setStaffMode(). */

/* Text for screen readers only (the "?" button's name). */
.qog-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* The summary can be long. The list scrolls, the confirmation stays reachable. */
.qog-staff-modal .qog-modal-content {
	display: flex;
	flex-direction: column;
	max-width: 720px;
	width: 100%;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	text-align: start;
}

.qog-staff-modal .qog-modal-header {
	flex: 0 0 auto;
}

/* The summary can be long. The confirmation stays on screen while the list
   scrolls, so the footer is pinned and never scrolls out of reach. */
.qog-staff-modal .qog-modal-footer {
	position: sticky;
	bottom: 0;
	flex: 0 0 auto;
	background: var(--qog-modal-bg, #fff);
	border-top: 1px solid var(--qog-border-color, #e2e8f0);
}

.qog-staff-modal .qog-modal-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: start;
	-webkit-overflow-scrolling: touch;
}

.qog-staff-label {
	display: block;
	margin: 8px 0 4px;
	font-weight: 600;
}

.qog-staff-label input,
.qog-staff-label textarea {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 8px;
	border: 1px solid var(--qog-border-color, #e2e8f0);
	border-radius: 6px;
	font: inherit;
}

.qog-staff-hint,
.qog-staff-status {
	margin: 4px 0;
	font-size: 0.85em;
	opacity: 0.8;
}

.qog-staff-results {
	max-height: 320px;
	margin: 8px 0 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.qog-staff-result {
	display: flex;
	flex-direction: column;
	gap: var(--qog-space-xs, 4px);
	padding: var(--qog-space-md, 12px);
	border: 1px solid transparent;
	/* A separator, so two customers with similar names read as two rows. The
	   bottom border is on the row and the last one is dropped, which keeps a
	   scrolled list from ending on a line that looks like a cut-off row. */
	border-bottom-color: var(--qog-border-color, #e5e7eb);
	border-radius: 6px;
	cursor: pointer;
	min-height: 44px;
}

.qog-staff-result:last-child {
	border-bottom-color: transparent;
}

.qog-staff-result:hover,
.qog-staff-result:focus {
	border-color: var(--qog-primary-color, #2563eb);
	outline: none;
	background: var(--qog-staff-bg, #f1f5f9);
}

.qog-staff-result-meta {
	font-size: 0.85em;
	opacity: 0.75;
}

.qog-staff-section {
	margin-bottom: 16px;
}

.qog-staff-section h3 {
	margin: 0 0 8px;
	font-size: 1em;
}

.qog-staff-table {
	width: 100%;
	border-collapse: collapse;
}

.qog-staff-table th,
.qog-staff-table td {
	padding: var(--qog-space-sm, 8px) var(--qog-space-md, 12px);
	border-bottom: 1px solid var(--qog-border-color, #e2e8f0);
	text-align: start;
}

/* The outer cells give up their horizontal padding so the first column starts
   on the same line as the heading above the table and the last column ends on
   the dialog's inset, instead of each being indented by a cell. */
.qog-staff-table th:first-child,
.qog-staff-table td:first-child {
	padding-inline-start: 0;
}

.qog-staff-table th:last-child,
.qog-staff-table td:last-child {
	padding-inline-end: 0;
}

.qog-staff-table td:last-child,
.qog-staff-table th:last-child {
	text-align: end;
	font-variant-numeric: tabular-nums;
}

.qog-staff-rate {
	display: block;
	padding: var(--qog-space-sm, 8px) 0;
	min-height: 32px;
}

.qog-staff-total-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin: 4px 0;
}

.qog-staff-total-value {
	font-variant-numeric: tabular-nums;
}

.qog-staff-totals .qog-staff-total-row:last-child {
	font-weight: 600;
}

.qog-staff-notice {
	margin: 0 0 var(--qog-space-md, 12px);
	padding: var(--qog-space-md, 12px) var(--qog-space-lg, 16px);
	border-inline-start: 3px solid var(--qog-primary-color, #2563eb);
	background: var(--qog-staff-bg, #f1f5f9);
	font-weight: 600;
}

/* Nothing is left to do once the order exists. The selector is deliberate: the
   narrow screen rules below give the footer its own display. */
.qog-modal-content.qog-staff-done .qog-modal-footer {
	display: none !important;
}

/* The outcome of a confirmation. Named apart from .qog-staff-result, which is a
   row in the customer picker: one class for both let this heading's size and
   weight leak into every row of that list. */
.qog-staff-outcome {
	margin: 8px 0 4px;
	font-size: 1.1em;
	font-weight: 600;
}

.qog-staff-outcome-note {
	margin: 0 0 16px;
	opacity: 0.85;
}

.qog-staff-outcome-action {
	min-height: 44px;
}

.qog-staff-errors {
	margin-bottom: var(--qog-space-lg, 16px);
	padding: var(--qog-space-md, 12px) var(--qog-space-lg, 16px);
	border: 1px solid #b91c1c;
	border-radius: 6px;
	background: #fef2f2;
	color: #7f1d1d;
}

/*
 * Vyradené riadky nie sú chyba — ponuka pod nimi je platná a dá sa potvrdiť.
 * Červená ako pri chybe by hovorila „niečo je pokazené, nepokračuj"; toto
 * hovorí „pozri sa na to, než potvrdíš".
 */
.qog-staff-excluded {
	border-color: #b45309;
	background: #fffbeb;
	color: #78350f;
}

.qog-staff-excluded .qog-staff-notice {
	margin: var(--qog-space-sm, 8px) 0 0;
	font-size: 0.9em;
}

.qog-staff-field-error {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
	font-weight: 400;
	color: #b91c1c;
}

.qog-staff-errors-title {
	margin: 0 0 var(--qog-space-sm, 8px);
	font-weight: 600;
}

.qog-staff-error-list {
	margin: 0;
	padding-inline-start: var(--qog-space-xl, 24px);
}

/* The summary moves focus here so the problem is announced. Only a keyboard
   user should see a ring: :focus would box the item for everyone, which reads
   as a second error frame drawn inside the first. */
.qog-staff-error-list li:focus-visible {
	outline: 2px solid #b91c1c;
	outline-offset: 2px;
}

.qog-staff-validity {
	margin: 0;
	margin-inline-end: auto;
	font-size: 0.85em;
	opacity: 0.8;
}

.qog-staff-result {
	scroll-margin: 8px;
}

@media (max-width: 782px) {
	/* The bar is pinned on a phone, so it stays on one line here too. The exit
	   keeps its icon and drops its words rather than wrapping the bar. */
	.qog-staff-bar {
		gap: var(--qog-space-sm, 8px);
		padding: var(--qog-space-sm, 8px) var(--qog-space-md, 12px);
	}

	.qog-staff-exit-confirm {
		flex-wrap: wrap;
	}

	.qog-staff-modal .qog-modal-content {
		max-width: none;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	/* The dialog fills the screen here, so the customer list gets the height
	   instead of stopping short and leaving the rest of the screen empty. */
	#qog-staff-customer-modal .qog-modal-body {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	#qog-staff-customer-modal .qog-staff-results {
		flex: 1 1 auto;
		max-height: none;
		min-height: 0;
	}

	.qog-staff-modal .qog-modal-footer {
		flex-wrap: wrap;
	}

	.qog-staff-modal .qog-modal-footer .qog-btn {
		flex: 1 1 45%;
	}

	.qog-staff-outcome-action {
		width: 100%;
	}

	.qog-staff-validity {
		flex: 1 1 100%;
		margin-inline-end: 0;
	}
}

@media (max-width: 600px) {
	/* A phone: the buttons took the whole line and left the customer as "O.." (iOS Safari, 1.11.2026).
	   Who the order is for gets its own line; the actions go under it. */
	.qog-staff-active {
		flex-wrap: wrap;
		row-gap: var(--qog-space-sm, 8px);
	}

	.qog-staff-active .qog-staff-who {
		flex: 1 1 100%;
	}
}
