/**
 * Workshop UI — layout, light theme polish, desktop
 */

/* ─── Shell ─── */

.app-shell {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	max-width: none;
	margin: 0;
}

.app-sidebar {
	flex-shrink: 0;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: relative;
}

.app-sidebar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: linear-gradient(
		to right,
		#d32f2f 0,
		#d32f2f 33.33%,
		#388e3c 33.33%,
		#388e3c 66.66%,
		#1976d2 66.66%,
		#1976d2 100%
	);
}

.sidebar-head {
	padding: calc(0.75rem + var(--safe-top)) 1rem 0.75rem;
}

.app-sidebar .brand-badge {
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.app-sidebar .brand-logo {
	width: 130px;
	height: auto;
}

.sidebar-nav {
	display: flex;
	border-top: 1px solid var(--line);
	background: var(--paper-raised);
}

.sidebar-link {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.8rem 0.65rem;
	min-height: 48px;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color 0.12s ease, background 0.12s ease;
}

.sidebar-link.is-active {
	color: var(--navy);
	background: var(--paper);
	border-bottom-color: var(--navy);
}

.sidebar-count {
	font-size: 0.72rem;
	font-weight: 700;
	padding: 0.05rem 0.35rem;
	background: var(--wash-dark);
	color: var(--ink-muted);
	min-width: 1.15rem;
	text-align: center;
	border-radius: var(--radius-sm);
}

.sidebar-link.is-active .sidebar-count {
	background: var(--navy);
	color: #fff;
}

.sidebar-cta,
.sidebar-foot,
.sidebar-spacer {
	display: none;
}

.sidebar-foot-link,
.sidebar-foot-button {
	display: block;
	padding: 0.45rem 0;
	font-size: 0.84rem;
	color: var(--ink-muted);
	text-decoration: none;
	background: none;
	border: none;
	font: inherit;
	cursor: pointer;
	text-align: left;
	width: 100%;
}

.sidebar-foot-link:hover,
.sidebar-foot-button:hover {
	color: var(--ink);
}

.app-frame {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--wash);
}

.app-topbar {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.65rem 1rem;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.app-topbar--minimal {
	justify-content: flex-end;
}

.topbar-search {
	flex: 1;
	min-width: 0;
}

.topbar-search input[type="search"] {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 0.55rem 0.75rem;
	font: inherit;
	font-size: 0.9rem;
	background: var(--wash);
	color: var(--ink);
}

.topbar-search input[type="search"]:focus {
	outline: 1px solid var(--brand);
	border-color: var(--brand);
	background: var(--paper);
}

.topbar-new {
	flex-shrink: 0;
}

.topbar-user {
	flex-shrink: 0;
	text-align: right;
	line-height: 1.3;
	padding-left: 0.65rem;
	border-left: 1px solid var(--line);
}

.topbar-label {
	display: none;
	font-size: 0.68rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ink-faint);
}

.topbar-name {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ink);
}

.topbar-account {
	position: relative;
	flex-shrink: 0;
	padding-left: 0.65rem;
	border-left: 1px solid var(--line);
}

.topbar-account-btn {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.5rem;
	margin: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.topbar-account-btn[aria-expanded="true"] {
	border-color: var(--brand);
	box-shadow: 0 0 0 1px var(--brand);
}

.topbar-account-chevron {
	width: 0.45rem;
	height: 0.45rem;
	border-right: 2px solid var(--ink-muted);
	border-bottom: 2px solid var(--ink-muted);
	transform: rotate(45deg) translateY(-1px);
	transition: transform 0.12s ease;
}

.topbar-account-btn[aria-expanded="true"] .topbar-account-chevron {
	transform: rotate(-135deg) translateY(1px);
}

.topbar-account-panel {
	position: absolute;
	top: calc(100% + 0.35rem);
	right: 0;
	z-index: 40;
	min-width: 12.5rem;
	padding: 0.35rem 0;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.topbar-account-email {
	margin: 0;
	padding: 0.45rem 0.85rem 0.55rem;
	font-size: 0.75rem;
	color: var(--ink-muted);
	border-bottom: 1px solid var(--line);
	word-break: break-all;
}

.topbar-account-link,
.topbar-account-button {
	display: block;
	width: 100%;
	padding: 0.55rem 0.85rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
	color: var(--ink);
	background: transparent;
	border: none;
	cursor: pointer;
}

.topbar-account-link:hover,
.topbar-account-button:hover {
	background: var(--paper-raised);
	color: var(--navy);
}

.topbar-account-logout {
	margin: 0.25rem 0 0;
	padding-top: 0.25rem;
	border-top: 1px solid var(--line);
}

.topbar-account-button {
	color: var(--bad);
}

.serial-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.85em;
}

.panel--danger {
	margin-top: 1rem;
	border-color: #f5c2c0;
	background: #fff8f8;
}

.field-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.field-check input {
	width: auto;
}

.app-main {
	flex: 1;
	padding: 1rem;
	padding-bottom: calc(1rem + var(--safe-bottom));
}

.app-footer--mobile {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1.25rem;
	background: var(--paper);
	border-top: 1px solid var(--line);
}

.footer-link {
	color: var(--ink-muted);
}

/* ─── Mobile navigation ─── */

.mobile-header,
.mobile-tabbar,
.mobile-drawer {
	display: none;
}

@media (max-width: 959px) {
	:root {
		--mobile-header-h: 3.25rem;
		--mobile-tabbar-h: 4.25rem;
	}

	.app-sidebar {
		display: none;
	}

	.app-footer--mobile {
		display: none;
	}

	.has-mobile-nav .app-topbar,
	.has-mobile-header .app-topbar,
	.parts-desk-page:not(.parts-scan-page) .app-topbar {
		display: none;
	}

	.has-mobile-nav .mobile-header,
	.has-mobile-nav .mobile-tabbar,
	.has-mobile-header .mobile-header,
	.parts-desk-page:not(.parts-scan-page) .mobile-header,
	.parts-desk-page:not(.parts-scan-page) .mobile-tabbar {
		display: flex;
	}

	.has-mobile-nav .mobile-drawer,
	.parts-desk-page:not(.parts-scan-page) .mobile-drawer {
		display: block;
	}

	.mobile-header {
		position: sticky;
		top: 0;
		z-index: 35;
		align-items: center;
		justify-content: space-between;
		gap: 0.5rem;
		min-height: var(--mobile-header-h);
		padding: calc(0.45rem + var(--safe-top)) 0.75rem 0.45rem;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
	}

	.mobile-header--simple {
		justify-content: space-between;
		padding-inline: 1rem;
	}

	.mobile-header-icon,
	.mobile-header-new,
	.mobile-drawer-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.75rem;
		height: 2.75rem;
		padding: 0;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		background: var(--paper-raised);
		color: var(--ink);
		text-decoration: none;
		cursor: pointer;
		flex-shrink: 0;
		-webkit-tap-highlight-color: transparent;
	}

	.mobile-header-new {
		background: var(--navy);
		border-color: var(--navy);
		color: #fff;
	}

	.mobile-header-back {
		flex-shrink: 0;
		min-height: 2.75rem;
		padding: 0 0.65rem;
		display: inline-flex;
		align-items: center;
		font-size: 0.875rem;
		font-weight: 600;
		color: var(--navy);
		text-decoration: none;
		border-radius: var(--radius);
		background: var(--paper-raised);
		border: 1px solid var(--line);
	}

	.mobile-header-brand {
		flex: 1;
		display: flex;
		justify-content: center;
		min-width: 0;
		text-decoration: none;
	}

	.mobile-header--simple .mobile-header-brand {
		justify-content: flex-start;
	}

	.mobile-header-logo {
		display: block;
		width: auto;
		height: 1.75rem;
		max-width: 8.5rem;
		object-fit: contain;
	}

	.mobile-header-actions {
		display: flex;
		align-items: center;
		gap: 0.4rem;
		flex-shrink: 0;
	}

	.mobile-header-account {
		padding-left: 0;
		border-left: none;
	}

	.mobile-account-btn {
		width: 2.75rem;
		height: 2.75rem;
		padding: 0;
		justify-content: center;
		border-radius: 999px;
	}

	.mobile-account-initial {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 1.85rem;
		height: 1.85rem;
		border-radius: 999px;
		background: var(--navy);
		color: #fff;
		font-size: 0.82rem;
		font-weight: 700;
	}

	.mobile-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 35;
		align-items: stretch;
		justify-content: space-around;
		gap: 0;
		min-height: var(--mobile-tabbar-h);
		padding: 0.35rem 0.25rem calc(0.35rem + var(--safe-bottom));
		background: var(--paper);
		border-top: 1px solid var(--line);
		box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
	}

	.mobile-tab {
		position: relative;
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.15rem;
		min-height: 3.25rem;
		padding: 0.25rem 0.15rem;
		border: none;
		background: transparent;
		color: var(--ink-muted);
		text-decoration: none;
		font: inherit;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.mobile-tab.is-active {
		color: var(--navy);
	}

	.mobile-tab-icon {
		display: block;
		flex-shrink: 0;
	}

	.mobile-tab-label {
		font-size: 0.68rem;
		font-weight: 650;
		line-height: 1.1;
	}

	.mobile-tab-badge {
		position: absolute;
		top: 0.15rem;
		right: calc(50% - 1.35rem);
		min-width: 1.1rem;
		height: 1.1rem;
		padding: 0 0.25rem;
		border-radius: 999px;
		background: var(--wash-dark);
		color: var(--ink-muted);
		font-size: 0.62rem;
		font-weight: 700;
		line-height: 1.1rem;
		text-align: center;
	}

	.mobile-tab-badge--alert {
		background: var(--bad);
		color: #fff;
	}

	.mobile-drawer[hidden] {
		display: none !important;
	}

	.mobile-drawer-backdrop {
		position: fixed;
		inset: 0;
		z-index: 45;
		background: rgba(15, 23, 42, 0.45);
	}

	.mobile-drawer-panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		max-height: min(88dvh, 640px);
		padding: 0 1rem calc(1rem + var(--safe-bottom));
		background: var(--paper);
		border-top-left-radius: 1rem;
		border-top-right-radius: 1rem;
		box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		transform: translateY(0);
		animation: mobile-drawer-in 0.22s ease;
	}

	@keyframes mobile-drawer-in {
		from {
			transform: translateY(100%);
		}

		to {
			transform: translateY(0);
		}
	}

	.mobile-drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		padding: 0.85rem 0 0.65rem;
		position: sticky;
		top: 0;
		background: var(--paper);
		z-index: 1;
	}

	.mobile-drawer-title {
		margin: 0;
		font-size: 1.05rem;
		font-weight: 700;
	}

	.mobile-drawer-search {
		margin-bottom: 0.75rem;
	}

	.mobile-drawer-search-label {
		display: block;
		margin-bottom: 0.35rem;
		font-size: 0.72rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--ink-faint);
	}

	.mobile-drawer-search-row {
		display: flex;
		gap: 0.5rem;
	}

	.mobile-drawer-search-row input[type="search"] {
		flex: 1;
		min-width: 0;
		min-height: 2.75rem;
		padding: 0.65rem 0.85rem;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		font: inherit;
		font-size: 1rem;
		background: var(--wash);
		color: var(--ink);
	}

	.mobile-drawer-nav {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
	}

	.mobile-drawer-link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		min-height: 3rem;
		padding: 0.75rem 0.85rem;
		border-radius: var(--radius);
		font-size: 1rem;
		font-weight: 600;
		color: var(--ink);
		text-decoration: none;
		background: var(--paper-raised);
		border: 1px solid var(--line);
	}

	.mobile-drawer-link.is-active {
		border-color: var(--navy);
		background: var(--active);
		color: var(--navy);
	}

	.mobile-drawer-link--primary {
		background: var(--navy);
		border-color: var(--navy);
		color: #fff;
		justify-content: center;
		margin-bottom: 0.35rem;
	}

	.mobile-drawer-count {
		font-size: 0.78rem;
		font-weight: 700;
		padding: 0.15rem 0.45rem;
		border-radius: var(--radius-sm);
		background: var(--wash-dark);
		color: var(--ink-muted);
	}

	body.mobile-menu-open {
		overflow: hidden;
	}

	.has-mobile-nav .app-main,
	.parts-desk-page:not(.parts-scan-page) .app-main {
		padding-bottom: calc(1rem + var(--mobile-tabbar-h) + var(--safe-bottom));
	}

	.has-mobile-header .app-main {
		padding-top: 0.75rem;
	}

	.filter-tabs {
		position: sticky;
		top: calc(var(--mobile-header-h) + var(--safe-top));
		z-index: 12;
		margin-left: -1rem;
		margin-right: -1rem;
		padding-left: 0.25rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.filter-tabs::-webkit-scrollbar {
		display: none;
	}

	.filter-tab {
		min-height: 3rem;
		padding: 0.75rem 1rem;
		font-size: 0.9rem;
	}

	.job-row {
		position: relative;
		padding: 1.05rem 3rem 1.05rem 1rem;
		min-height: 4.75rem;
	}

	.job-row-enter-wrap {
		position: absolute;
		inset: 0;
		grid-column: 1 / -1;
		grid-row: 1 / -1;
		z-index: 2;
		align-self: stretch;
		justify-self: stretch;
	}

	.job-row-enter {
		width: 100%;
		height: 100%;
		opacity: 0;
		border: none;
		background: transparent;
	}

	.job-row-enter-icon {
		display: none;
	}

	.job-row::after {
		content: "";
		position: absolute;
		right: 1rem;
		top: 50%;
		width: 0.55rem;
		height: 0.55rem;
		border-right: 2px solid var(--ink-muted);
		border-bottom: 2px solid var(--ink-muted);
		transform: translateY(-50%) rotate(-45deg);
		pointer-events: none;
		z-index: 1;
	}

	.job-row-title {
		font-size: 1.1rem;
	}

	.btn,
	.btn-sm {
		min-height: 2.75rem;
	}

	.page-title {
		font-size: 1.45rem;
	}

	.flash {
		margin-left: 0;
		margin-right: 0;
	}
}

/* Hide legacy dark-layout hooks */
.app-header,
.app-nav,
.header-meta,
.toolbar-row {
	display: none !important;
}

/* ─── Page ─── */

.page-head,
.page-toolbar {
	margin-bottom: 1rem;
}

.page-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--ink);
}

.page-sub {
	margin: 0.25rem 0 0;
	font-size: 0.88rem;
	color: var(--ink-muted);
}

.panel--narrow {
	max-width: 420px;
}

/* ─── Filter tabs ─── */

.filter-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--line);
	overflow-x: auto;
	background: var(--paper);
	border: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.filter-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.65rem 0.9rem;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	white-space: nowrap;
}

.filter-tab.is-active {
	color: var(--navy);
	border-bottom-color: var(--navy);
	background: var(--paper-raised);
}

.filter-tab-count {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--ink-faint);
}

.filter-tab.is-active .filter-tab-count {
	color: var(--ink-muted);
}

/* ─── Job rows ─── */

.job-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	background: var(--line);
	border: 1px solid var(--line);
}

.job-list-header {
	display: none;
}

.job-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 2.75rem;
	column-gap: 0.75rem;
	row-gap: 0.5rem;
	padding: 1rem;
	background: var(--paper);
	border-left: 3px solid var(--line-strong);
	align-items: start;
}

.job-row-status {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
}

.job-row-main {
	grid-column: 1;
	grid-row: 2;
	min-width: 0;
}

.job-row-meta {
	grid-column: 1;
	grid-row: 3;
	min-width: 0;
}

.job-row-enter-wrap {
	grid-column: 2;
	grid-row: 1 / span 3;
	align-self: center;
	justify-self: end;
}

.job-row--open {
	border-left-color: var(--warn);
}

.job-row--waiting_parts {
	border-left-color: var(--bad);
}

.job-row--fixed {
	border-left-color: var(--ok);
}

.job-row--shipped,
.job-row--done {
	border-left-color: var(--ink-faint);
}

.job-row--waiting {
	background: var(--paper-raised);
}

.status-tag {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	padding: 0.2rem 0.45rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 1px solid var(--line);
	background: var(--wash);
	color: var(--ink-muted);
	border-radius: var(--radius-sm);
}

.status-tag--open {
	border-color: #e8d4a8;
	color: var(--warn);
	background: var(--status-warn-bg);
}

.status-tag--waiting_parts {
	border-color: #e8c4c0;
	color: var(--bad);
	background: var(--status-bad-bg);
}

.status-tag--fixed {
	border-color: #b8dcc8;
	color: var(--ok);
	background: var(--status-ok-bg);
}

.job-row-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 650;
	line-height: 1.25;
	color: var(--ink);
}

.job-row-serial {
	margin: 0.2rem 0 0;
	font-size: 0.82rem;
	color: var(--ink-muted);
}

.job-row-problem {
	margin: 0.4rem 0 0;
	font-size: 0.875rem;
	color: var(--ink-muted);
	line-height: 1.45;
}

.field--compact {
	margin: 0;
	gap: 0.2rem;
}

.field--compact .field-label {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ink-faint);
}

.field--compact select {
	font-size: 0.875rem;
	padding: 0.4rem 0.5rem;
	background: var(--wash);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

.job-row-hint {
	margin: 0.45rem 0 0;
	font-size: 0.82rem;
	color: var(--ink-muted);
}

.job-row-location-text {
	margin: 0 0 0.35rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink);
}

.job-row-location-text--unset {
	color: var(--ink-faint);
	font-weight: 500;
}

.job-row-enter {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--wash);
	color: var(--ink-muted);
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.job-row-enter:hover {
	background: var(--paper-hover);
	border-color: var(--line-strong);
	color: var(--ink);
	transform: translateX(2px);
}

.job-row-enter-icon {
	display: block;
}

.job-detail {
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.job-detail.is-deleting,
.js-hold-delete-form.is-deleting {
	animation: job-delete-out 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	pointer-events: none;
}

@keyframes job-delete-out {
	0% {
		opacity: 1;
		transform: scale(1) translateY(0);
		filter: none;
	}

	25% {
		opacity: 1;
		transform: scale(1.015);
		filter: brightness(1.05);
		box-shadow: inset 0 0 0 2px rgba(196, 74, 68, 0.35);
	}

	55% {
		opacity: 0.85;
		transform: scale(0.98) translateY(-4px);
		filter: brightness(0.95);
	}

	100% {
		opacity: 0;
		transform: scale(0.9) translateY(-18px);
		filter: blur(6px);
		max-height: 0;
		margin: 0;
		padding: 0;
		overflow: hidden;
	}
}

.job-options {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}

.job-options-title {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
	font-weight: 650;
	color: var(--ink);
}

.job-options-lead {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--ink-muted);
	line-height: 1.45;
}

.job-options-location {
	margin-bottom: 0.75rem;
}

.danger-zone {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px dashed var(--line-strong);
}

.danger-zone-warn {
	margin: 0 0 0.65rem;
	font-size: 0.82rem;
	color: var(--bad);
	line-height: 1.4;
}

.hold-delete-btn {
	position: relative;
	display: block;
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(196, 74, 68, 0.45);
	border-radius: var(--radius-sm);
	background: var(--paper);
	color: var(--bad);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.hold-delete-btn:hover {
	border-color: var(--bad);
	background: rgba(196, 74, 68, 0.04);
}

.hold-delete-btn.is-holding {
	border-color: var(--bad);
	background: rgba(196, 74, 68, 0.08);
}

.hold-delete-btn.is-armed {
	border-color: var(--bad);
	background: rgba(196, 74, 68, 0.12);
}

.hold-delete-btn.is-deleting {
	opacity: 0.7;
}

.hold-delete-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: linear-gradient(90deg, rgba(196, 74, 68, 0.18), rgba(196, 74, 68, 0.28));
	pointer-events: none;
	transition: width 0.05s linear;
}

.hold-delete-text {
	position: relative;
	z-index: 1;
}

.btn-ghost {
	background: transparent;
	border: 1px solid transparent;
	color: var(--ink-faint);
	font-weight: 500;
}

.btn-ghost:hover {
	color: var(--bad);
	border-color: var(--line);
}

.btn-primary {
	border-radius: var(--radius-sm);
	box-shadow: none;
}

.btn-secondary {
	border-radius: var(--radius-sm);
	background: var(--paper);
	border-color: var(--line-strong);
	color: var(--ink);
}

.empty-state {
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--paper);
}

.panel {
	border-radius: var(--radius-sm);
	box-shadow: none;
	border: 1px solid var(--line);
}

.flash {
	margin: 0 1rem;
	border-radius: var(--radius-sm);
}

.job-row-meta .pipeline {
	margin-top: 0.55rem;
}

.process-flow-step.is-current {
	background: var(--navy);
	color: #fff;
	border-color: var(--navy);
}

/* ─── Login ─── */

.login-body {
	background: var(--wash);
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.login-wrap {
	width: 100%;
	max-width: 380px;
	padding: 2rem 1.75rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	position: relative;
	overflow: hidden;
}

.login-wrap::before {
	content: "";
	display: block;
	height: 3px;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: linear-gradient(
		to right,
		#d32f2f 0,
		#d32f2f 33.33%,
		#388e3c 33.33%,
		#388e3c 66.66%,
		#1976d2 66.66%,
		#1976d2 100%
	);
}

.login-brand {
	margin-bottom: 1.25rem;
	text-align: center;
}

.login-logo {
	width: 180px;
	margin: 0 auto;
}

.login-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	text-align: center;
	color: var(--ink);
}

.login-tagline {
	margin: 0.3rem 0 1.25rem;
	font-size: 0.88rem;
	color: var(--ink-muted);
	text-align: center;
}

.login-form .btn,
.login-form input {
	border-radius: var(--radius-sm);
}

.login-remember {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0.15rem 0 1rem;
	font-size: 0.9rem;
	color: var(--ink-muted);
	cursor: pointer;
}

.login-remember input {
	width: 1.05rem;
	height: 1.05rem;
	margin: 0;
	flex-shrink: 0;
}

/* ─── Desktop ─── */

@media (min-width: 960px) {
	.app-shell {
		flex-direction: row;
		align-items: flex-start;
	}

	.app-sidebar {
		width: var(--sidebar-w);
		height: 100dvh;
		max-height: 100dvh;
		position: sticky;
		top: 0;
		align-self: flex-start;
		display: flex;
		flex-direction: column;
		border-bottom: none;
		border-right: 1px solid var(--line);
		box-shadow: var(--shadow-sm);
		overflow-y: auto;
		overscroll-behavior: contain;
		z-index: 20;
	}

	.app-sidebar::after {
		left: auto;
		top: 0;
		bottom: 0;
		right: 0;
		width: 3px;
		height: auto;
	}

	.sidebar-head {
		padding: 1.35rem 1.25rem 1rem;
		border-bottom: 1px solid var(--line);
	}

	.app-sidebar .brand-logo {
		max-width: 168px;
	}

	.sidebar-nav {
		flex-direction: column;
		border-top: none;
		background: transparent;
		padding: 0.75rem 0;
		gap: 0;
	}

	.sidebar-link {
		flex: none;
		justify-content: space-between;
		padding: 0.6rem 1.25rem;
		min-height: 40px;
		border-bottom: none;
		border-left: 3px solid transparent;
		border-radius: 0;
	}

	.sidebar-link.is-active {
		border-bottom-color: transparent;
		border-left-color: var(--navy);
		background: var(--active);
	}

	.sidebar-cta {
		display: block;
		padding: 0 1rem 0.75rem;
	}

	.sidebar-spacer {
		display: block;
		flex: 1;
	}

	.sidebar-foot {
		display: block;
		padding: 1rem 1.25rem 1.25rem;
		border-top: 1px solid var(--line);
	}

	.app-topbar {
		padding: 0.85rem 1.75rem;
	}

	.topbar-new {
		display: none;
	}

	.topbar-label {
		display: block;
	}

	.topbar-user {
		min-width: 110px;
	}

	.app-main {
		padding: 1.5rem 1.75rem 2rem;
	}

	.app-frame {
		min-height: 100dvh;
	}

	.app-footer--mobile {
		display: none;
	}

	.page-title {
		font-size: 1.65rem;
	}

	.page-head {
		padding-bottom: 0.75rem;
		border-bottom: 1px solid var(--line);
		margin-bottom: 1rem;
	}

	.filter-tabs {
		margin-top: 0;
	}

	.job-list-header {
		display: grid;
		grid-template-columns: 9rem minmax(0, 1.5fr) minmax(0, 1.1fr) 2.75rem;
		column-gap: 1.25rem;
		padding: 0.5rem 1rem;
		font-size: 0.68rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		color: var(--ink-faint);
		background: var(--paper-raised);
		border: 1px solid var(--line);
		border-bottom: none;
	}

	.job-list {
		margin-top: 1rem;
	}

	.job-row {
		grid-template-columns: 9rem minmax(0, 1.5fr) minmax(0, 1.1fr) 2.75rem;
		column-gap: 1.25rem;
		row-gap: 0;
		align-items: start;
		padding: 0.85rem 1rem;
	}

	.job-row-status {
		grid-column: 1;
		grid-row: 1;
	}

	.job-row-main {
		grid-column: 2;
		grid-row: 1;
	}

	.job-row-meta {
		grid-column: 3;
		grid-row: 1;
	}

	.job-row-enter-wrap {
		grid-column: 4;
		grid-row: 1;
		align-self: center;
		padding-top: 0;
	}

	@media (hover: hover) {
		.job-row:hover {
			background: var(--paper-hover);
		}
	}

	.job-row-enter-wrap {
		justify-self: end;
	}

	.process-screen,
	.stack-form.panel.process-screen {
		max-width: 520px;
	}

	.flash {
		margin-left: 1.75rem;
		margin-right: 1.75rem;
		max-width: 480px;
	}
}

@media (min-width: 1200px) {
	.job-list-header,
	.job-row {
		grid-template-columns: 10rem minmax(0, 1.7fr) minmax(0, 1.2fr) 2.75rem;
		column-gap: 1.5rem;
		padding-left: 1.15rem;
		padding-right: 1.15rem;
	}
}

@media (min-width: 1600px) {
	.job-list,
	.job-list-header {
		max-width: 1500px;
	}

	.kanban-board {
		max-width: 1500px;
	}
}

/* ─── Board header + view toggle ─── */

.page-head--board {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.view-toggle {
	display: inline-flex;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--wash);
}

.view-toggle-btn {
	padding: 0.45rem 0.85rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.view-toggle-btn.is-active {
	background: var(--paper);
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--line);
}

.view-toggle-btn:not(.is-active):hover {
	color: var(--ink);
	background: var(--paper-hover);
}

/* ─── Days badge ─── */

.job-row-status {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
}

.job-row-days,
.kanban-card-days {
	display: inline-block;
	font-size: 0.65rem;
	font-weight: 700;
	padding: 0.15rem 0.35rem;
	border-radius: var(--radius-sm);
	background: var(--wash);
	color: var(--ink-faint);
	border: 1px solid var(--line);
}

.job-row-days--stale,
.kanban-card-days--stale {
	background: var(--status-warn-bg);
	color: var(--warn);
	border-color: #e8d4a8;
}

.job-row--stale {
	background: rgba(255, 248, 235, 0.5);
}

.status-tag--sm {
	font-size: 0.6rem;
	padding: 0.15rem 0.35rem;
}

/* ─── Kanban board ─── */

.kanban-board {
	display: grid;
	grid-template-columns: repeat(4, minmax(200px, 1fr));
	gap: 0.75rem;
	margin-top: 1rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	-webkit-overflow-scrolling: touch;
}

.kanban-column {
	display: flex;
	flex-direction: column;
	min-height: 12rem;
	background: var(--paper-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	min-width: 0;
}

.kanban-column-head {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.65rem 0.75rem;
	border-bottom: 1px solid var(--line);
	background: var(--paper);
}

.kanban-column-title {
	margin: 0;
	flex: 1;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ink-muted);
}

.kanban-column-count {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--ink-faint);
	background: var(--wash);
	padding: 0.1rem 0.4rem;
	border-radius: 999px;
}

.kanban-column-cards {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.5rem;
	flex: 1;
}

.kanban-empty {
	margin: 0.5rem 0;
	font-size: 0.78rem;
	color: var(--ink-faint);
	text-align: center;
	padding: 1rem 0.5rem;
}

.kanban-card {
	display: block;
	padding: 0.65rem 0.75rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	text-decoration: none;
	color: inherit;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kanban-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
	border-color: var(--line-strong);
}

.kanban-card--waiting {
	border-left: 3px solid var(--bad);
}

.kanban-card--stale {
	border-left: 3px solid var(--warn);
}

.kanban-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	margin-bottom: 0.35rem;
}

.kanban-card-title {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 650;
	line-height: 1.25;
	color: var(--ink);
}

.kanban-card-serial {
	margin: 0.15rem 0 0;
	font-size: 0.75rem;
	color: var(--ink-muted);
}

.kanban-card-location {
	margin: 0.35rem 0 0;
	font-size: 0.72rem;
	color: var(--ink-faint);
}

.process-screen--done {
	position: relative;
}

/* ─── Activity timeline ─── */

.activity-timeline {
	margin-top: 1.25rem;
}

.activity-timeline-title {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 650;
}

.activity-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.activity-item {
	display: flex;
	gap: 0.65rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.activity-emoji {
	flex-shrink: 0;
	font-size: 1rem;
	line-height: 1;
	opacity: 0.85;
}

.activity-body {
	min-width: 0;
	flex: 1;
}

.activity-note {
	margin: 0;
	font-size: 0.875rem;
	color: var(--ink);
	line-height: 1.4;
}

.activity-meta {
	margin: 0.2rem 0 0;
	font-size: 0.75rem;
	color: var(--ink-faint);
}

/* ─── Success moment (milestones only) ─── */

.celebration-layer {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 9999;
}

.success-glow {
	position: absolute;
	top: 0.75rem;
	left: 50%;
	width: min(480px, 90vw);
	height: 3.5rem;
	transform: translateX(-50%);
	border-radius: var(--radius-sm);
	background: radial-gradient(ellipse at center, rgba(72, 160, 108, 0.12) 0%, transparent 70%);
	animation: success-glow-fade 2.2s ease forwards;
}

.success-particle {
	position: absolute;
	bottom: 30%;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ok);
	opacity: 0;
	animation: success-particle-rise 2.4s ease forwards;
}

.flash-ok--success {
	animation: flash-success-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	border-color: rgba(72, 160, 108, 0.35);
	background: linear-gradient(135deg, rgba(72, 160, 108, 0.08) 0%, var(--paper) 100%);
}

@keyframes success-glow-fade {
	0% { opacity: 0; transform: translateX(-50%) scale(0.95); }
	20% { opacity: 1; }
	100% { opacity: 0; transform: translateX(-50%) scale(1.05); }
}

@keyframes success-particle-rise {
	0% {
		opacity: 0;
		transform: translateY(0) scale(0.8);
	}
	15% {
		opacity: 0.5;
	}
	100% {
		opacity: 0;
		transform: translateY(-4rem) scale(1);
	}
}

@keyframes flash-success-in {
	0% {
		opacity: 0;
		transform: translateY(-6px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 1100px) {
	.kanban-board {
		grid-template-columns: repeat(4, minmax(170px, 1fr));
	}
}

@media (max-width: 768px) {
	.kanban-board {
		grid-template-columns: repeat(4, 75vw);
	}
}

/* ─── Calendar inbox ─── */

.calendar-inbox-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.calendar-setup-grid {
	display: grid;
	gap: 1rem;
	margin-bottom: 1rem;
}

@media (min-width: 900px) {
	.calendar-setup-grid {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

.calendar-setup-ol {
	margin: 0;
	padding-left: 1.2rem;
	display: grid;
	gap: 0.65rem;
	font-size: 0.92rem;
}

.calendar-setup-pre {
	margin: 0.5rem 0 0;
	padding: 0.75rem;
	background: var(--wash);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-size: 0.82rem;
	overflow-x: auto;
}

.calendar-setup-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.calendar-setup-cal-list {
	margin: 0;
	padding-left: 1.1rem;
	display: grid;
	gap: 0.35rem;
}

.calendar-setup-match {
	color: var(--green, #388e3c);
	font-weight: 600;
}

.calendar-setup-cron {
	margin-top: 1rem;
}

.alert-warn {
	background: var(--status-warn-bg);
	border: 1px solid #e8d4a8;
	color: var(--ink);
	padding: 0.75rem 1rem;
	border-radius: var(--radius-sm);
	margin-bottom: 1rem;
}

.alert-warn p {
	margin: 0.35rem 0;
}

.calendar-inbox-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.calendar-import-card {
	padding: 1rem;
}

.calendar-import-head {
	margin-bottom: 0.75rem;
}

.calendar-import-subject {
	margin: 0 0 0.25rem;
	font-size: 1rem;
	font-weight: 650;
}

.calendar-import-meta {
	font-size: 0.78rem;
	color: var(--ink-muted);
}

.calendar-import-body {
	margin-bottom: 0.75rem;
}

.calendar-import-pre {
	margin: 0.5rem 0 0;
	padding: 0.75rem;
	background: var(--wash);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-size: 0.78rem;
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 12rem;
	overflow: auto;
}

.calendar-import-fields {
	display: grid;
	gap: 0.75rem;
}

.calendar-import-buttons {
	margin-top: 0.5rem;
}

.calendar-import-skip {
	margin-top: 0.5rem;
}

.calendar-recent {
	margin-top: 2rem;
}

.calendar-recent-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
}

.calendar-recent-list li {
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.calendar-recent-status {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 0.1rem 0.35rem;
	border-radius: var(--radius-sm);
	background: var(--wash);
}

.calendar-recent-status--imported {
	background: var(--status-ok-bg);
	color: var(--ok);
}

.calendar-recent-status--skipped {
	color: var(--ink-faint);
}

.form-actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.inline-form {
	display: inline;
}

/* Parts desk */
.parts-desk-page .app-main {
	padding: 0;
}

.parts-desk-page .app-sidebar {
	display: none;
}

.parts-desk-page .app-frame {
	max-width: none;
}

.topbar-parts-back {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-decoration: none;
}

.topbar--parts {
	justify-content: space-between;
}

.parts-desk {
	min-height: calc(100dvh - 56px);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem 1rem 2rem;
	background:
		radial-gradient(circle at top, rgba(29, 78, 216, 0.06), transparent 42%),
		var(--surface, #eef1f5);
}

.parts-desk-center {
	width: 100%;
	max-width: 28rem;
}

.parts-desk--profile .parts-desk-center {
	max-width: 36rem;
}

.parts-desk-hero {
	text-align: center;
	margin-bottom: 2rem;
}

.parts-desk-hero--compact {
	margin-bottom: 1.25rem;
}

.parts-desk-kicker {
	margin: 0 0 0.35rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--ink-muted);
}

.parts-desk-title {
	margin: 0;
	font-size: clamp(1.75rem, 5vw, 2.25rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.parts-desk-lead {
	margin: 0.65rem 0 0;
	color: var(--ink-muted);
	font-size: 1rem;
}

.parts-desk-form {
	display: grid;
	gap: 0.85rem;
}

.parts-desk-field-label {
	display: block;
	margin-bottom: 0.45rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-align: center;
}

.parts-desk-input {
	width: 100%;
	padding: 1rem 1.1rem;
	border: 2px solid var(--line-strong, #c5ced8);
	border-radius: 16px;
	background: #fff;
	font-size: clamp(1.5rem, 6vw, 2rem);
	font-weight: 700;
	text-align: center;
	letter-spacing: 0.06em;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.parts-desk-input:focus {
	outline: none;
	border-color: var(--brand, #1d4ed8);
	box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.parts-desk-submit {
	min-height: 3rem;
	font-size: 1rem;
	border-radius: 12px;
}

.parts-desk-alert {
	margin: 0 0 1rem;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	font-size: 0.9375rem;
}

.parts-desk-alert--ok {
	background: var(--status-ok-bg, #ecfdf5);
	color: var(--ok, #047857);
}

.parts-desk-alert--error {
	background: #fef2f2;
	color: #b91c1c;
}

.parts-desk-empty-panel {
	margin-top: 1.5rem;
	text-align: center;
	padding: 1.5rem 1rem;
	border-radius: 16px;
	background: #fff;
	border: 1px solid var(--line, #dbe2ea);
}

.parts-desk-empty-title {
	margin: 0 0 0.35rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.parts-desk-empty {
	margin: 0 0 1rem;
	color: var(--ink-muted);
}

.parts-desk-stock-link {
	display: block;
	text-align: center;
	margin-top: 0.65rem;
	font-size: 0.875rem;
	color: var(--ink-muted);
}

.parts-desk-stock-form {
	display: grid;
	gap: 0.85rem;
	margin: 1rem 0;
	text-align: left;
}

.parts-desk-field--optional {
	margin: 0;
}

.parts-desk-stock-btn {
	min-height: 3.1rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.parts-desk-stock-cancel {
	margin-top: 0.5rem;
}

.parts-scan-flash {
	position: absolute;
	top: calc(3.25rem + env(safe-area-inset-top));
	left: 0.75rem;
	right: 0.75rem;
	z-index: 25;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	background: rgba(56, 142, 60, 0.95);
	color: #fff;
	font-size: 0.92rem;
	text-align: center;
}

.parts-scan-flash p {
	margin: 0 0 0.65rem;
}

.parts-scan-flash-btn {
	margin-top: 0.15rem;
	background: #fff;
	color: var(--green, #388e3c);
	border-color: #fff;
	font-weight: 700;
}

.parts-scan-btn-stock {
	min-height: 3.35rem;
	font-size: 1.05rem;
	font-weight: 700;
	background: var(--green, #388e3c);
	border-color: var(--green, #388e3c);
}

.parts-desk-profiles {
	display: grid;
	gap: 1rem;
	margin-top: 1.5rem;
}

.parts-desk-reset,
.parts-desk-exit {
	display: block;
	text-align: center;
	margin-top: 1rem;
	color: var(--ink-muted);
	font-size: 0.875rem;
}

.parts-desk-exit {
	margin-top: auto;
	padding-top: 2rem;
}

.parts-profile {
	background: #fff;
	border: 1px solid var(--line, #dbe2ea);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.parts-profile-match {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-wrap: wrap;
	padding: 1rem 1.15rem;
	background: linear-gradient(180deg, #f8fafc, #fff);
	border-bottom: 1px solid var(--line, #e5ebf2);
}

.parts-profile-match-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-muted);
}

.parts-profile-match-number {
	font-size: 1.25rem;
	font-weight: 700;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.04em;
}

.parts-profile-match-badge {
	margin-left: auto;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: #fff7ed;
	color: #c2410c;
}

.parts-profile-match-badge--done {
	background: var(--status-ok-bg, #ecfdf5);
	color: var(--ok, #047857);
}

.parts-profile-match-badge--warn {
	background: #f3f4f6;
	color: #6b7280;
}

.parts-profile-head {
	padding: 1.15rem 1.15rem 0.5rem;
}

.parts-profile-model {
	margin: 0.55rem 0 0;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.parts-profile-meta {
	margin: 0.35rem 0 0;
	color: var(--ink-muted);
	font-size: 0.9375rem;
}

.parts-profile-meta--sub {
	font-size: 0.8125rem;
}

.parts-profile-section {
	padding: 0.85rem 1.15rem 1rem;
	border-top: 1px solid var(--line, #eef2f6);
}

.parts-profile-section-title {
	margin: 0 0 0.65rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-muted);
}

.parts-profile-grid {
	display: grid;
	gap: 0.75rem;
}

.parts-profile-row dt {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ink-muted);
	margin-bottom: 0.15rem;
}

.parts-profile-row dd {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.parts-profile-parts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.parts-profile-part {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.55rem 0.7rem;
	border-radius: 10px;
	background: #f8fafc;
}

.parts-profile-part.is-match {
	background: #eff6ff;
	outline: 1px solid rgba(29, 78, 216, 0.18);
}

.parts-profile-part.is-arrived,
.parts-profile-part--received,
.parts-profile-part--consumed,
.parts-profile-part--spare {
	border-color: var(--line, #eef2f6);
}

.parts-profile-part-number {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 600;
}

.parts-profile-part-state {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ink-muted);
}

.parts-profile-flow {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.parts-profile-flow-step {
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	background: #f3f4f6;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ink-muted);
}

.parts-profile-flow-step.is-done {
	background: var(--status-ok-bg, #ecfdf5);
	color: var(--ok, #047857);
}

.parts-profile-hint {
	margin: 0.65rem 0 0;
	font-size: 0.875rem;
	color: var(--ink-muted);
}

.parts-profile-activity {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}

.parts-profile-activity-item {
	display: grid;
	gap: 0.15rem;
}

.parts-profile-activity-meta {
	font-size: 0.75rem;
	color: var(--ink-muted);
}

.parts-profile-activity-note {
	font-size: 0.875rem;
}

.parts-profile-actions {
	display: grid;
	gap: 0.55rem;
	padding: 1rem 1.15rem 1.15rem;
	border-top: 1px solid var(--line, #eef2f6);
}

.parts-entry-rows {
	display: grid;
	gap: 0.85rem;
	margin-bottom: 0.85rem;
}

.parts-entry-row {
	display: grid;
	gap: 0.55rem;
	padding: 0.85rem 0.95rem;
	border: 1px solid var(--line, #e5ebf2);
	border-radius: 0.65rem;
	background: var(--paper-raised, #f8fafc);
}

.parts-entry-row-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.parts-entry-status {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
}

.parts-entry-status.is-in {
	background: rgba(56, 142, 60, 0.12);
	color: #2e7d32;
}

.parts-entry-status.is-waiting {
	background: rgba(211, 47, 47, 0.1);
	color: #c62828;
}

.parts-entry-remove {
	border: none;
	background: transparent;
	color: var(--ink-muted);
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0.15rem 0;
	text-decoration: underline;
}

.parts-entry-remove:hover {
	color: var(--ink);
}

@media (min-width: 640px) {
	.parts-desk-page .app-sidebar {
		display: flex;
	}

	.parts-desk {
		min-height: calc(100dvh - 64px);
	}

	.parts-entry-row {
		grid-template-columns: 1fr 1fr;
	}
}

.parts-entry-add {
	margin-bottom: 1rem;
}

.parts-job-list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}

.parts-job-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.25rem 0.75rem;
	align-items: center;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--line, #eef2f6);
	border-radius: 10px;
	background: var(--paper, #fff);
}

.parts-job-number {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.parts-job-desc {
	font-size: 0.88rem;
	color: var(--ink-muted);
	grid-column: 1 / -1;
}

.parts-job-status {
	font-size: 0.78rem;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	white-space: nowrap;
}

.parts-job-status--waiting {
	background: #fff3e0;
	color: #e65100;
}

.parts-job-status--received {
	background: #e3f2fd;
	color: #1565c0;
}

.parts-job-status--consumed {
	background: #e8f5e9;
	color: #2e7d32;
}

.parts-job-status--spare {
	background: #f3e5f5;
	color: #6a1b9a;
}

.parts-usage {
	margin: 0 0 1.25rem;
	padding: 1rem;
	border: 1px solid var(--line, #eef2f6);
	border-radius: 12px;
	background: var(--wash, #f8fafc);
}

.parts-usage-title {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
}

.parts-usage-lead {
	margin: 0 0 0.85rem;
	font-size: 0.88rem;
	color: var(--ink-muted);
}

.parts-usage-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.65rem;
}

.parts-usage-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem 0.75rem;
	align-items: center;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--line, #eef2f6);
}

.parts-usage-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.parts-usage-number {
	display: block;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.parts-usage-desc {
	display: block;
	font-size: 0.84rem;
	color: var(--ink-muted);
	margin-top: 0.15rem;
}

.parts-usage-toggles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.35rem;
	grid-column: 1 / -1;
}

.parts-usage-option {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	padding: 0.35rem 0.5rem;
	border: 1px solid var(--line, #dde4ea);
	border-radius: 8px;
	background: var(--paper, #fff);
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
}

.parts-usage-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.parts-usage-option.is-selected {
	border-color: var(--brand);
	background: rgba(21, 101, 192, 0.08);
	color: var(--brand);
}

.parts-usage-badge {
	justify-self: end;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
}

.parts-usage-badge--waiting { background: #fff3e0; color: #e65100; }
.parts-usage-badge--received { background: #e3f2fd; color: #1565c0; }
.parts-usage-badge--consumed { background: #e8f5e9; color: #2e7d32; }
.parts-usage-badge--spare { background: #f3e5f5; color: #6a1b9a; }

.parts-profile-part-state--waiting { color: #e65100; }
.parts-profile-part-state--received { color: #1565c0; }
.parts-profile-part-state--consumed { color: #2e7d32; }
.parts-profile-part-state--spare { color: #6a1b9a; }

[data-theme="dark"] .parts-profile-part-state--waiting { color: #f0b429; }
[data-theme="dark"] .parts-profile-part-state--received { color: #6ba3e8; }
[data-theme="dark"] .parts-profile-part-state--consumed { color: #3ecf8e; }
[data-theme="dark"] .parts-profile-part-state--spare { color: #c39bd3; }

.parts-profile-match-badge--received { background: #e3f2fd; color: #1565c0; }
.parts-profile-match-badge--consumed { background: #e8f5e9; color: #2e7d32; }
.parts-profile-match-badge--spare { background: #f3e5f5; color: #6a1b9a; }

.parts-profile-usage-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.parts-profile-usage-form {
	margin: 0;
}

[data-theme="dark"] .parts-desk {
	background:
		radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 42%),
		var(--wash);
}

[data-theme="dark"] .parts-desk-input,
[data-theme="dark"] .parts-profile,
[data-theme="dark"] .panel,
[data-theme="dark"] .job-row,
[data-theme="dark"] .parts-desk-empty-panel {
	background: var(--paper);
	border-color: var(--line);
}

[data-theme="dark"] .parts-profile-match {
	background: linear-gradient(180deg, var(--paper-raised), var(--paper));
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
	background: var(--paper-raised);
	color: var(--ink);
	border-color: var(--line-strong);
}

[data-theme="dark"] .login-body {
	background: var(--wash);
}

/* Parts desk — scan entry */
.parts-desk-scan {
	min-height: 3.25rem;
	font-size: 1.05rem;
	margin-bottom: 0.35rem;
}

.parts-desk-or {
	margin: 0.35rem 0 0.85rem;
	text-align: center;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.parts-desk-submit {
	min-height: 2.85rem;
}

/* DPD shipping */
.dpd-scan-cta {
	margin-bottom: 0.35rem;
}

.dpd-scan-or {
	margin: 0.35rem 0 0.85rem;
	text-align: center;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dpd-track-link {
	display: inline-flex;
	align-items: baseline;
	gap: 0.5rem;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--brand);
	text-decoration: none;
}

.dpd-track-link:hover {
	text-decoration: underline;
}

.dpd-track-hint {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #b91c1c;
	white-space: nowrap;
}

/* Barcode scanner */
.parts-scan-page .app-topbar,
.parts-scan-page .app-footer {
	display: none;
}

.parts-scan-page .app-main {
	padding: 0;
}

.parts-scan {
	position: relative;
	min-height: 100dvh;
	background: #0b0f14;
	color: #f5f7fa;
	display: flex;
	flex-direction: column;
}

.parts-scan-camera-wrap {
	position: relative;
	flex: 1;
	min-height: 55dvh;
	background: #000;
	overflow: hidden;
}

.parts-scan-video-el {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
	z-index: 1;
}

.parts-scan-video-el[hidden] {
	display: none !important;
}

.parts-scan-reader {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 55dvh;
	z-index: 1;
}

.parts-scan-reader[hidden] {
	display: none !important;
}

.parts-scan-reader video {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

.parts-scan-reader > div {
	width: 100% !important;
	height: 100% !important;
	border: none !important;
}

.parts-scan-reader #qr-shaded-region,
.parts-scan-reader #qr-shaded-region > div {
	border-color: rgba(255, 255, 255, 0.45) !important;
}

.parts-scan-start {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.75rem;
	padding: 1rem 1rem 1.25rem;
	background: rgba(11, 15, 20, 0.92);
	overflow-y: auto;
}

.parts-scan-start[hidden] {
	display: none !important;
}

.parts-scan-start-guide {
	width: 100%;
	max-width: 22rem;
}

.parts-scan-start-kicker {
	margin: 0 0 0.25rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.65);
	text-align: center;
}

.parts-scan-start-lead {
	margin: 0 0 0.65rem;
	font-size: 0.95rem;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.92);
	text-align: center;
}

.parts-scan-start-btn {
	max-width: 18rem;
	width: 100%;
	min-height: 3.25rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.parts-scan-start-note {
	margin: 0;
	font-size: 0.88rem;
	color: rgba(255, 255, 255, 0.75);
}

.parts-scan-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.parts-scan-reticle {
	position: absolute;
	left: 50%;
	top: 42%;
	width: min(78vw, 18rem);
	height: 5.5rem;
	transform: translate(-50%, -50%);
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 0.65rem;
	pointer-events: none;
	z-index: 2;
}

.parts-scan-hint {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 1rem;
	margin: 0;
	padding: 0 1rem;
	text-align: center;
	font-size: 0.92rem;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
	z-index: 3;
}

.parts-scan-status {
	padding: 0.85rem 1rem;
	text-align: center;
	font-size: 0.92rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.85);
	background: #111820;
}

.parts-scan-fallback {
	padding: 1.25rem 1rem 2rem;
	display: grid;
	gap: 0.75rem;
}

.parts-scan-fallback[hidden] {
	display: none !important;
}

.parts-scan-fallback-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.parts-scan-fallback-text {
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
}

.parts-scan-sheet {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 30;
	padding: 0 0 calc(0.75rem + env(safe-area-inset-bottom));
	background: linear-gradient(180deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.55) 12%, rgba(11, 15, 20, 0.98) 28%);
}

.parts-scan-sheet[hidden] {
	display: none !important;
}

.parts-scan-sheet-inner {
	margin: 0 auto;
	max-width: 28rem;
	padding: 1rem 1rem 0.5rem;
	background: var(--paper);
	color: var(--ink);
	border-radius: 1rem 1rem 0 0;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.parts-scan-sheet-kicker {
	margin: 0 0 0.25rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ink-muted);
}

.parts-scan-sheet-part {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

.parts-scan-sheet-model {
	margin: 0.35rem 0 0;
	font-size: 1.25rem;
	line-height: 1.25;
}

.parts-scan-sheet-meta {
	margin: 0.35rem 0 0;
	color: var(--ink-muted);
	font-size: 0.92rem;
}

.parts-scan-sheet-note {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	color: var(--ink-muted);
}

.parts-scan-actions {
	display: grid;
	gap: 0.65rem;
	margin-top: 1.1rem;
}

.parts-scan-btn-book,
.parts-scan-btn-cancel {
	min-height: 3.35rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.parts-scan-btn-book {
	background: var(--green, #388e3c);
	border-color: var(--green, #388e3c);
}

.parts-scan-exit {
	position: absolute;
	top: calc(0.65rem + env(safe-area-inset-top));
	right: 0.75rem;
	z-index: 20;
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
}

.parts-scan-help {
	position: absolute;
	top: calc(0.65rem + env(safe-area-inset-top));
	left: 0.75rem;
	z-index: 20;
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	border: none;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
}

.parts-scan-help[hidden] {
	display: none !important;
}

.parts-scan-guide-figure {
	position: relative;
	margin: 0;
	border-radius: 0.65rem;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.parts-scan-guide-figure img {
	display: block;
	width: 100%;
	height: auto;
}

.parts-scan-guide-figure--compact {
	margin-bottom: 0.15rem;
}

.parts-scan-guide-highlight {
	position: absolute;
	left: 18%;
	top: 7.5%;
	width: 64%;
	height: 17%;
	border: 3px solid #d32f2f;
	border-radius: 0.35rem;
	box-shadow: 0 0 0 9999px rgba(211, 47, 47, 0.18);
	pointer-events: none;
	animation: parts-scan-pulse 1.6s ease-in-out infinite;
}

.parts-scan-guide-callout {
	position: absolute;
	left: 50%;
	top: 1%;
	transform: translateX(-50%);
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: #d32f2f;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	pointer-events: none;
}

@keyframes parts-scan-pulse {
	0%, 100% { border-color: #d32f2f; }
	50% { border-color: #ff6659; }
}

.parts-scan-guide {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: grid;
	place-items: end center;
	padding: 0 0 calc(0.5rem + env(safe-area-inset-bottom));
}

.parts-scan-guide[hidden] {
	display: none !important;
}

.parts-scan-guide-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.parts-scan-guide-panel {
	position: relative;
	width: min(100%, 28rem);
	margin: 0 0.75rem;
	padding: 1rem;
	border-radius: 1rem 1rem 0 0;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.parts-scan-guide-title {
	margin: 0 0 0.35rem;
	font-size: 1.15rem;
	line-height: 1.25;
}

.parts-scan-guide-text {
	margin: 0 0 0.85rem;
	font-size: 0.92rem;
	color: var(--ink-muted);
	line-height: 1.4;
}

.parts-scan-guide-btn {
	min-height: 3rem;
	font-weight: 700;
}

[data-theme="dark"] .parts-scan-guide-panel {
	background: var(--paper);
}

/* ─── Ping ─── */
.ping-device-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.ping-device-status {
	margin: 0.35rem 0 0;
	font-weight: 600;
	color: var(--ink);
}

.ping-device[data-push-state="on"] .ping-device-status {
	color: var(--ok);
	font-size: 0.9rem;
}

.ping-device[data-push-state="on"] .ping-device-status::before {
	content: "✓ ";
	font-weight: 700;
}

.ping-device-help {
	margin: 0.6rem 0 0;
	font-size: 0.8rem;
	color: var(--ink-muted);
	line-height: 1.4;
}

.ping-device-actions {
	display: flex;
	gap: 0.5rem;
	flex-shrink: 0;
}

.ping-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.chip {
	border: 1px solid var(--line, #d9dee5);
	background: var(--paper, #fff);
	color: var(--ink);
	border-radius: 999px;
	padding: 0.4rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

.chip:hover {
	border-color: var(--brand);
	color: var(--brand);
}

.ping-recipients {
	border: 0;
	padding: 0;
	margin: 0 0 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ping-recipients .field-label {
	margin-bottom: 0.35rem;
}

.ping-recipient {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--line, #e2e6ec);
	border-radius: var(--radius-sm, 8px);
	cursor: pointer;
}

.ping-recipient input {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	flex-shrink: 0;
}

.ping-recipient-name {
	font-weight: 600;
}

.ping-recipient-meta {
	font-size: 0.8rem;
	color: var(--ink-muted);
}

.ping-recipient-badge {
	margin-left: auto;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
}

.ping-recipient-badge--on {
	background: var(--status-ok-bg);
	color: var(--ok);
}

.ping-recipient-badge--off {
	background: var(--wash-dark);
	color: var(--ink-muted);
}

.ping-recipient--all {
	background: var(--paper-raised);
	font-weight: 700;
}

.empty-note {
	margin: 0;
	color: var(--ink-muted);
}

/* ─── Inbox / messages ─── */
.sidebar-count--alert {
	background: #d32f2f;
	color: #fff;
}

.message-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.message-item {
	border: 1px solid var(--line, #e2e6ec);
	border-radius: var(--radius-sm, 8px);
	padding: 0.85rem 1rem;
}

.message-item.is-unread {
	border-color: var(--brand);
	background: rgba(21, 101, 192, 0.05);
}

.message-head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.message-kind {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.18rem 0.5rem;
	border-radius: 999px;
	background: #eef1f5;
	color: #52616b;
}

.message-kind--ping {
	background: #fff3e0;
	color: #e65100;
}

.message-kind--forward {
	background: #e3f2fd;
	color: #1565c0;
}

.message-from {
	font-weight: 700;
}

.message-time {
	margin-left: auto;
	font-size: 0.8rem;
	color: var(--ink-muted);
	font-variant-numeric: tabular-nums;
}

.message-projector {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-top: 0.6rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--line, #e2e6ec);
	border-radius: var(--radius-sm, 8px);
	text-decoration: none;
	color: var(--ink);
}

.message-projector:hover {
	border-color: var(--brand);
}

.message-projector span {
	font-size: 0.85rem;
	color: var(--ink-muted);
}

.message-projector-cta {
	margin-left: auto;
	font-weight: 600;
	color: var(--brand) !important;
}

.message-body {
	margin: 0.6rem 0 0;
	line-height: 1.45;
}

.message-actions {
	margin: 0.5rem 0 0;
	display: flex;
	justify-content: flex-end;
}

[data-theme="dark"] .message-item.is-unread {
	background: rgba(21, 101, 192, 0.15);
}

[data-theme="dark"] .message-kind {
	background: rgba(255, 255, 255, 0.08);
	color: #ced4da;
}

[data-theme="dark"] .message-kind--ping {
	background: rgba(240, 116, 60, 0.18);
	color: #ffb27a;
}

[data-theme="dark"] .message-kind--forward {
	background: rgba(107, 163, 232, 0.18);
	color: #8bb8f0;
}

/* ─── Job QR label (170mm × 105mm) ─── */
.label-sheet {
	max-width: 680px;
}

.label-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 170 / 105;
	border: 2px solid #0f1e32;
	border-radius: 4px;
	background: #fff;
	color: #111;
}

.label-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 0 0 38%;
	min-height: 0;
	padding: 0.65rem 1rem 0.5rem;
	background: #0f1e32;
	color: #fff;
	text-align: center;
}

.label-logo {
	display: block;
	width: auto;
	max-width: 78%;
	height: auto;
	max-height: 58%;
	object-fit: contain;
	padding: 0.35rem 0.65rem;
	border-radius: 3px;
	background: #fff;
}

.label-company {
	margin: 0.45rem 0 0;
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: 0.03em;
}

.label-tagline {
	margin: 0.15rem 0 0;
	font-size: 0.68rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.88;
}

.label-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	padding: 0.55rem 0.75rem 0.45rem;
}

.label-content-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.4rem;
}

.label-qr {
	width: 88px;
	height: 88px;
	flex-shrink: 0;
}

.label-qr svg {
	width: 100%;
	height: 100%;
	display: block;
}

.label-ident {
	min-width: 0;
	flex: 1;
}

.label-model {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.12;
	color: #0f1e32;
}

.label-serial {
	margin: 0.2rem 0 0;
	font-size: 0.88rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #111;
}

.label-ref {
	margin: 0.25rem 0 0;
	font-size: 0.72rem;
	color: #555;
}

.label-status {
	margin: 0.2rem 0 0;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #1a4a8a;
}

.label-body {
	display: flex;
	flex-direction: column;
	gap: 0.22rem;
	flex: 1;
	min-height: 0;
	border-top: 1px solid #d8dde5;
	padding-top: 0.35rem;
}

.label-row {
	margin: 0;
	display: grid;
	grid-template-columns: 3rem 1fr;
	gap: 0.4rem;
	font-size: 0.72rem;
	line-height: 1.28;
}

.label-row--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.75rem;
}

.label-row--inline .label-row-key,
.label-row--inline .label-row-val {
	font-size: inherit;
}

.label-row-key {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #555;
}

.label-row-val {
	color: #111;
	word-break: break-word;
}

.label-body-foot {
	margin-top: auto;
	padding-top: 0.15rem;
}

.label-flags {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	color: #222;
}

.label-meta {
	margin: 0;
	font-size: 0.68rem;
	color: #555;
}

.label-footer {
	flex-shrink: 0;
	padding: 0.35rem 0.75rem;
	border-top: 1px solid #d8dde5;
	background: #f3f5f8;
	text-align: center;
}

.label-footer-note {
	margin: 0;
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #0f1e32;
}

.label-footer-scan {
	margin: 0.1rem 0 0;
	font-size: 0.58rem;
	color: #666;
}

.label-actions {
	display: flex;
	gap: 0.6rem;
	margin-top: 1rem;
	flex-wrap: wrap;
}

@media print {
	@page {
		size: 170mm 105mm;
		margin: 0;
	}

	.app-sidebar,
	.app-topbar,
	.app-footer,
	.page-toolbar,
	.no-print,
	.celebration-layer,
	.flash {
		display: none !important;
	}

	.app-shell,
	.app-frame,
	.app-main {
		display: block !important;
		margin: 0 !important;
		padding: 0 !important;
		max-width: none !important;
		width: auto !important;
	}

	html,
	body {
		width: 170mm;
		height: 105mm;
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
		overflow: hidden;
	}

	.label-sheet {
		max-width: none;
		margin: 0;
		padding: 0;
	}

	.label-card {
		width: 170mm;
		height: 105mm;
		aspect-ratio: auto;
		border: none;
		border-radius: 0;
		break-inside: avoid;
		page-break-after: avoid;
		page-break-inside: avoid;
	}

	.label-hero {
		flex: 0 0 38mm;
		padding: 2mm 4mm 1.5mm;
		background: #0f1e32 !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.label-logo {
		max-width: 120mm;
		max-height: 28mm;
		padding: 1.5mm 3mm;
	}

	.label-company {
		margin-top: 1.5mm;
		font-size: 11pt;
		color: #fff !important;
	}

	.label-tagline {
		font-size: 7pt;
		color: #fff !important;
	}

	.label-content {
		flex: 1;
		padding: 2mm 4mm 1.5mm;
	}

	.label-content-top {
		margin-bottom: 1.5mm;
		gap: 3mm;
	}

	.label-qr {
		width: 28mm;
		height: 28mm;
	}

	.label-model {
		font-size: 13pt;
		color: #000 !important;
	}

	.label-serial {
		font-size: 10pt;
	}

	.label-ref {
		font-size: 8pt;
	}

	.label-status {
		font-size: 7.5pt;
	}

	.label-body {
		padding-top: 1.5mm;
		gap: 0.8mm;
	}

	.label-row {
		font-size: 8pt;
		grid-template-columns: 11mm 1fr;
		gap: 1mm;
	}

	.label-flags,
	.label-meta {
		font-size: 7.5pt;
	}

	.label-footer {
		padding: 1.2mm 4mm;
		background: #eee !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.label-footer-note {
		font-size: 7pt;
		color: #000 !important;
	}

	.label-footer-scan {
		font-size: 6.5pt;
		color: #000 !important;
	}
}

/* ─── User guide ─── */
.guide-doc {
	max-width: 760px;
}

.guide-doc-header {
	margin-bottom: 1.5rem;
}

.guide-doc-header .page-sub {
	max-width: 42rem;
}

.guide-print-link {
	margin-top: 0.75rem;
}

.guide-toc {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper-raised);
}

.guide-toc-title {
	margin: 0 0 0.65rem;
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ink-muted);
}

.guide-toc ol {
	margin: 0;
	padding-left: 1.25rem;
}

.guide-toc li {
	margin: 0.25rem 0;
}

.guide-toc a {
	color: var(--brand);
	text-decoration: none;
}

.guide-toc a:hover {
	text-decoration: underline;
}

.guide-section {
	margin-bottom: 1.75rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--line);
}

.guide-section:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.guide-section h2 {
	margin: 0 0 0.65rem;
	font-size: 1.15rem;
}

.guide-section h3 {
	margin: 1rem 0 0.4rem;
	font-size: 0.95rem;
}

.guide-section p,
.guide-section li {
	line-height: 1.55;
	color: var(--ink);
}

.guide-section ul,
.guide-section ol {
	margin: 0.5rem 0;
	padding-left: 1.25rem;
}

.guide-section li + li {
	margin-top: 0.35rem;
}

.guide-tip {
	margin: 0.75rem 0 0;
	padding: 0.75rem 0.9rem;
	border-left: 3px solid var(--brand);
	background: var(--paper-raised);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: 0.92rem;
}

.guide-tip strong {
	color: var(--brand);
}
