/* === workorders.css ==================================================
	 The page sections of the work orders client (design template README, section 6): layout only, on the Layer 1
	 tokens of theme.css. theme.css and custom.css are a verbatim mirror of pos.srvd/pos (the tokens, the kit and
	 the POS shell) so they can be refreshed from there as one file; everything this client adds on top lives here.
	 Kit classes (.srvd-*) and shell classes (.pos-*) are composed, never restyled. */

/* page: workorders ==================================================
	 The board: the header (clock, statistics, department) over a horizontal row of columns, one card per work
	 order; each card scrolls its own lines. The stage of a card (current / next / far / previous) tints its header
	 with the status colours, the timer takes the same colours from its type. */

/* ---- HEADER: the clock and date, the three statistics centred, the department and its tags right ---- */
.wo-header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 32px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--pos-hairline);
}
.wo-header__time { flex: 0 0 auto; display: flex; align-items: stretch; gap: 16px; }
.wo-clock {
	margin: 0;
	font-size: 44px;
	line-height: 48px;
	font-weight: 700;
	letter-spacing: -0.44px;
	font-variant-numeric: tabular-nums;
	color: var(--pos-text);
}
/* the day and date centre on the clock's height, behind a hairline that spans that height */
.wo-date { margin: 0; padding-left: 16px; border-left: 1px solid var(--pos-hairline); display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.wo-date__day {
	font-size: 13px;
	line-height: 16px;
	letter-spacing: -0.08px;
	text-transform: uppercase;
	color: var(--pos-muted);
}
.wo-date__value { font-size: 16px; line-height: 19px; font-weight: 700; color: var(--pos-text); }

.wo-stats { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; justify-content: center; gap: 40px; }
.wo-stat { display: flex; flex-direction: column; gap: 4px; padding-left: 32px; border-left: 1px solid var(--pos-hairline); }
.wo-stat__label { font-size: 13px; line-height: 16px; letter-spacing: -0.08px; font-weight: 400; color: var(--pos-muted); white-space: nowrap; }
.wo-stat__value {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 24px;
	line-height: 29px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--pos-text);
}
.wo-stat__icon { flex: 0 0 auto; font-size: 22px; line-height: 1; color: var(--pos-muted); }
svg.wo-stat__icon { display: block; width: 24px; height: 24px; }
.wo-stat__icon--fast { color: var(--pos-success); }
.wo-stat__icon--medium { color: var(--pos-warning); }
.wo-stat__icon--slow { color: var(--pos-danger); }

.wo-header__department { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.wo-department__name {
	margin: 0;
	max-width: 100%;
	font-size: 20px;
	line-height: 25px;
	font-weight: 700;
	letter-spacing: -0.1px;
	text-transform: uppercase;
	color: var(--pos-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wo-department__tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wo-department__tags .bi { font-size: 14px; line-height: 1; }

/* the controls right of the department: kit icon buttons; the menu is a kit dropdown the page hangs under its trigger */
.wo-header__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding-left: 24px; border-left: 1px solid var(--pos-hairline); }
.wo-header__actions .bi { font-size: 22px; line-height: 1; }
.wo-menu { position: relative; }
.wo-menu__dropdown { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 300px; }
.wo-menu__icon { margin-right: 12px; font-size: 18px; line-height: 1; vertical-align: -2px; }

/* ---- BOARD: the row of columns fills the rest of the screen panel and scrolls sideways; the number of
	 columns follows the viewport (five on a wide kitchen display, four on an 11" tablet, three below) ---- */
.wo-body { flex: 1 1 auto; min-height: 0; display: flex; }
.wo-board {
	--wo-columns: 5;
	--wo-column-gap: 16px;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	display: flex;
	align-items: stretch;
	gap: var(--wo-column-gap);
	padding: 24px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
}
.wo-board::-webkit-scrollbar { display: none; }
.wo-board[hidden] { display: none; }
@media (max-width: 1399.98px) { .wo-board { --wo-columns: 4; } }
@media (max-width: 1099.98px) { .wo-board { --wo-columns: 3; } }
.wo-column {
	flex: 0 0 auto;
	width: calc((100% - (var(--wo-columns) - 1) * var(--wo-column-gap)) / var(--wo-columns));
	min-width: 280px;
	max-height: 100%;
	display: flex;
	align-items: flex-start;
}

/* no open orders: the kit empty state centred in the board area */
.wo-board-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px; }
.wo-board-empty[hidden] { display: none; }
.wo-board-empty__box { width: 100%; max-width: 420px; }

/* ---- CARD: a card on the Layer 1 secondary surface with a hairline ring; the header carries the stage
	 colour as a 4px top edge and a wash, the lines scroll below it ---- */
.wo-card {
	--wo-stage: transparent;
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	border-radius: 24px;
	background: var(--pos-card);
	box-shadow: inset 0 0 0 1px var(--pos-hairline);
	color: var(--pos-text);
	overflow: hidden;
}
.wo-card--current { --wo-stage: var(--pos-success); }
.wo-card--next { --wo-stage: var(--pos-warning); }
.wo-card--far { --wo-stage: var(--pos-danger); }
.wo-card--previous { --wo-stage: var(--pos-faint); opacity: 0.6; }

.wo-card__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px;
	border-bottom: 1px solid var(--pos-hairline);
	box-shadow: inset 0 4px 0 var(--wo-stage);
	background: linear-gradient(180deg, color-mix(in srgb, var(--wo-stage) 22%, transparent) 0%, transparent 100%);
}
.wo-card__heading { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wo-card__title {
	margin: 0;
	font-size: 20px;
	line-height: 24px;
	font-weight: 700;
	letter-spacing: -0.1px;
	color: var(--pos-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wo-card__employee {
	margin-left: 8px;
	padding-left: 8px;
	border-left: 1px solid var(--pos-hairline);
	font-size: 13px;
	font-weight: 400;
	color: var(--pos-muted);
}
.wo-card__timer {
	margin: 0;
	font-size: 16px;
	line-height: 19px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--pos-muted);
}
.wo-card__timer--fast { color: var(--pos-success); }
.wo-card__timer--medium { color: var(--pos-warning); }
.wo-card__timer--slow { color: var(--pos-danger); }
.wo-card__timer--paused { color: var(--pos-muted); }
.wo-card__timer .bi { font-size: 14px; vertical-align: -1px; }
.wo-card__actions { flex: 0 0 auto; display: flex; gap: 8px; }

.wo-card__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.wo-card__body::-webkit-scrollbar { display: none; }

/* ---- LINES: a course is a group with its own header (the course tag and its action); every line is the
	 quantity, an optional photo, the name with its components and remark, and the check on the right ---- */
.wo-section__title { margin: 0; padding: 12px 16px 4px; }
.wo-section__title .bi { font-size: 12px; line-height: 1; }

.wo-course__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 16px;
	background: var(--pos-tile);
}
.wo-course__header .bi { font-size: 16px; line-height: 1; }
.wo-course--current .wo-course__header {
	background: color-mix(in srgb, var(--pos-success) 18%, transparent);
	animation: wo-course-pulse 1.6s ease-in-out infinite;
}
@keyframes wo-course-pulse {
	0%, 100% { background: color-mix(in srgb, var(--pos-success) 10%, transparent); }
	50% { background: color-mix(in srgb, var(--pos-success) 28%, transparent); }
}
/* a course not started yet is dimmed and cannot be tapped; its header stays live */
.wo-course--not-started .wo-line { opacity: 0.35; pointer-events: none; }

.wo-line {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--pos-hairline);
}
.wo-line--future { opacity: 0.5; }
.wo-line--cancelled { color: var(--pos-muted); }
.wo-line--done .wo-line__name, .wo-line--done .wo-line__components,
.wo-line--cancelled .wo-line__name, .wo-line--cancelled .wo-line__components { text-decoration: line-through; }
.wo-line__qty {
	flex: 0 0 2.5rem;
	text-align: right;
	font-size: 16px;
	line-height: 19px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.wo-line__thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: var(--pos-tile);
	overflow: hidden;
}
.wo-line__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the "no image" webp is any colour: brightness(0) collapses it to a silhouette, invert() lifts it to a grey that
	 reads on both themes */
.wo-line__thumb img.wo-line__thumb--placeholder { object-fit: contain; padding: 6px; opacity: 0.9; filter: brightness(0) invert(0.72); }
[data-bs-theme="light"] .wo-line__thumb img.wo-line__thumb--placeholder { filter: brightness(0) invert(0.45); }
.wo-line__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wo-line__name { margin: 0; font-size: 16px; line-height: 19px; font-weight: 500; overflow-wrap: anywhere; }
.wo-line__components { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 16px; color: var(--pos-muted); }
.wo-line__remark {
	margin: 0;
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 13px;
	line-height: 16px;
	font-weight: 500;
	color: var(--pos-warning);
}
.wo-line__remark .bi { flex: 0 0 auto; font-size: 13px; line-height: 16px; }
.wo-line__check { flex: 0 0 auto; }
.wo-line__done {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	line-height: 1;
	color: var(--pos-success);
}

/* ---- NEXT-COURSE NOTICE: the pop-up material over the whole card until the course is started or the notice closed ---- */
.wo-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 24px;
	text-align: center;
	background: var(--pos-modal-surface);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}
.wo-card__overlay-title { margin: 0; font-size: 20px; line-height: 25px; font-weight: 700; color: var(--pos-text); }
.wo-card__overlay-buttons { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

/* ---- RESTORE pop-up: the kit list of finished orders (a second, muted line with the time under the label) or the
	 kit empty state ---- */
.wo-restore__list { width: 100%; }
.wo-restore__time { display: block; font-size: 13px; line-height: 16px; color: var(--pos-muted); }
.wo-restore__empty { display: flex; justify-content: center; padding: 8px 0; }

/* ---- MOBILE (<= 575.98px = below Bootstrap's sm): the header wraps (the statistics take a row of their own),
	 one card at a time slides sideways ---- */
@media (max-width: 575.98px) {
	.wo-header { flex-wrap: wrap; gap: 12px 16px; padding: 12px 16px; }
	.wo-header__time { gap: 12px; }
	.wo-clock { font-size: 32px; line-height: 36px; }
	.wo-stats { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 12px; }
	.wo-stat { padding-left: 0; border-left: 0; }
	.wo-stat__value { font-size: 20px; line-height: 24px; }
	.wo-header__department { margin-left: auto; }
	.wo-department__name { font-size: 16px; line-height: 19px; }
	.wo-header__actions { padding-left: 12px; }
	.wo-menu__dropdown { min-width: 260px; }

	.wo-board { --wo-column-gap: 12px; padding: 16px; scroll-snap-type: x mandatory; }
	.wo-column { width: 86vw; min-width: 0; scroll-snap-align: start; }
	.wo-board-empty { padding: 16px; }
}

/* page: workorders-login ============================================
	 The login card of the design (theme.css, page: login) with the department's username and password as kit
	 pill fields instead of the keypad; the framework's field feedback (form.js) renders its list items in the
	 kit's error colour. */
.login-form { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.login-form__feedback {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	line-height: 16px;
	letter-spacing: -0.08px;
	color: var(--pos-danger);
}
.login-form__feedback:empty { display: none; }
.login-form__actions { display: flex; flex-direction: column; margin-top: 8px; }

/* ---- LOGOUT: the green check badge with a soft ring over the goodbye, and one primary button back to the login ---- */
/* the brand line hangs below the logo box (login-brand, absolute): the badge and its ring start well under it, and
	 the button follows the text closer than the card's own 60px gap */
.logout-message { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.logout-badge {
	width: 84px;
	height: 84px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--pos-success);
	color: var(--pos-on-light);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 12px color-mix(in srgb, var(--pos-success) 18%, transparent);
}
.logout-badge svg { display: block; }
.logout-message__title {
	margin: 0;
	font-size: 28px;
	line-height: 34px;
	font-weight: 700;
	letter-spacing: -0.14px;
	color: var(--pos-text);
}
.logout-message__text { margin: 0; font-size: 16px; line-height: 19px; color: var(--pos-muted); }
.logout-actions { width: 300px; max-width: 100%; margin-top: -20px; display: flex; flex-direction: column; }
@media (max-width: 575.98px) {
	.logout-actions { width: 100%; }
}