:root {
	--ws-bg: #f6f7f9;
	--ws-surface: #ffffff;
	--ws-surface-2: #fafbfc;
	--ws-border: #e4e7eb;
	--ws-border-strong: #cbd2d9;
	--ws-text: #1f2933;
	--ws-text-muted: #616e7c;
	--ws-text-dim: #9aa5b1;
	--ws-primary: #4338ca;
	--ws-primary-soft: #eef2ff;
	--ws-success: #047857;
	--ws-success-soft: #ecfdf5;
	--ws-warning: #b45309;
	--ws-warning-soft: #fffbeb;
	--ws-danger: #b91c1c;
	--ws-danger-soft: #fef2f2;
	--ws-info: #0e7490;
	--ws-info-soft: #ecfeff;
	--ws-radius: 8px;
	--ws-radius-lg: 12px;
	--ws-shadow-sm: 0 1px 2px rgba(20, 24, 28, 0.04);
	--ws-shadow: 0 1px 3px rgba(20, 24, 28, 0.06), 0 1px 2px rgba(20, 24, 28, 0.04);
	--ws-shadow-lg: 0 8px 24px rgba(20, 24, 28, 0.08);
}

/* Layout shell */
body.ws-app {
	background: var(--ws-bg);
	color: var(--ws-text);
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ws-shell {
	display: grid;
	grid-template-columns: 240px 1fr;
	min-height: 100vh;
}

/* Embedded mode (rendered inside a Frappe desk Page via iframe) */
.ws-shell.ws-shell-embedded {
	grid-template-columns: 1fr;
	min-height: 100vh;
	background: var(--ws-bg);
}

.ws-shell.ws-shell-embedded .ws-main {
	min-width: 0;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
}

.ws-shell.ws-shell-embedded .ws-content {
	padding: 24px 28px 48px;
}

@media (max-width: 700px) {
	.ws-shell.ws-shell-embedded .ws-content {
		padding: 16px 14px 32px;
	}
}

/* Desk-page iframe wrapper (used by /app/workshop-* Page docs) */
.ea-page-frame {
	/* Frappe desk page already has 15px lr padding + 10px top from main wrapper.
	   Pull the iframe flush to the page-content area so the embedded site fills it. */
	margin: 0 -15px;
	height: calc(100vh - 100px);
	min-height: 600px;
	background: var(--ws-bg);
	border-radius: 0;
}

.ea-page-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: var(--ws-bg);
}

/* Mobile/touch: a bit smaller header room available */
@media (max-width: 700px) {
	.ea-page-frame {
		margin: 0 -10px;
		height: calc(100vh - 90px);
	}
}

.ws-sidebar {
	background: var(--ws-surface);
	border-right: 1px solid var(--ws-border);
	padding: 20px 12px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}

.ws-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px 24px;
	border-bottom: 1px solid var(--ws-border);
	margin-bottom: 16px;
}

.ws-brand-mark {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--ws-primary), #6d28d9);
	color: white;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 14px;
}

.ws-brand-name {
	font-weight: 600;
	font-size: 15px;
	letter-spacing: -0.01em;
}

.ws-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ws-nav-section {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ws-text-dim);
	padding: 12px 12px 6px;
}

.ws-nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--ws-text-muted);
	text-decoration: none;
	font-size: 14px;
	transition: background-color 120ms, color 120ms;
}

.ws-nav-link:hover {
	background: var(--ws-surface-2);
	color: var(--ws-text);
	text-decoration: none;
}

.ws-nav-link.active {
	background: var(--ws-primary-soft);
	color: var(--ws-primary);
	font-weight: 500;
}

.ws-nav-link .ws-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.ws-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.ws-topbar {
	background: var(--ws-surface);
	border-bottom: 1px solid var(--ws-border);
	padding: 12px 24px;
	display: flex;
	align-items: center;
	gap: 16px;
	position: sticky;
	top: 0;
	z-index: 10;
}

.ws-topbar-title {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-right: auto;
}

.ws-topbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ws-content {
	padding: 24px;
	flex: 1;
}

/* Cards */
.ws-card {
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius-lg);
	box-shadow: var(--ws-shadow-sm);
}

.ws-card-header {
	padding: 14px 18px;
	border-bottom: 1px solid var(--ws-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ws-card-title {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.005em;
}

.ws-card-body {
	padding: 18px;
}

/* KPI grid */
.ws-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}

.ws-kpi {
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius-lg);
	padding: 16px 18px;
	box-shadow: var(--ws-shadow-sm);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ws-kpi-label {
	font-size: 12px;
	color: var(--ws-text-muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ws-kpi-value {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--ws-text);
}

.ws-kpi-delta {
	font-size: 12px;
	color: var(--ws-text-muted);
}

.ws-kpi.is-primary { border-color: var(--ws-primary); }
.ws-kpi.is-primary .ws-kpi-value { color: var(--ws-primary); }
.ws-kpi.is-warning .ws-kpi-value { color: var(--ws-warning); }
.ws-kpi.is-success .ws-kpi-value { color: var(--ws-success); }

/* Buttons */
.ws-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid var(--ws-border);
	background: var(--ws-surface);
	color: var(--ws-text);
	cursor: pointer;
	transition: background-color 120ms, border-color 120ms;
	text-decoration: none;
}

.ws-btn:hover {
	background: var(--ws-surface-2);
	text-decoration: none;
}

.ws-btn-primary {
	background: var(--ws-primary);
	color: white;
	border-color: var(--ws-primary);
}

.ws-btn-primary:hover {
	background: #3730a3;
	color: white;
}

.ws-btn-success {
	background: var(--ws-success);
	color: white;
	border-color: var(--ws-success);
}

.ws-btn-success:hover { background: #065f46; color: white; }

.ws-btn-danger {
	background: var(--ws-danger);
	color: white;
	border-color: var(--ws-danger);
}

.ws-btn-ghost {
	background: transparent;
	border-color: transparent;
}

.ws-btn-ghost:hover {
	background: var(--ws-surface-2);
}

.ws-btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.ws-form-row {
	display: grid;
	gap: 6px;
	margin-bottom: 14px;
}

.ws-form-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.ws-form-grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 14px;
}

.ws-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--ws-text-muted);
}

.ws-input,
.ws-select,
.ws-textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--ws-border-strong);
	border-radius: 6px;
	font-size: 14px;
	background: var(--ws-surface);
	color: var(--ws-text);
	font-family: inherit;
	box-sizing: border-box;
}

.ws-input:focus,
.ws-select:focus,
.ws-textarea:focus {
	outline: none;
	border-color: var(--ws-primary);
	box-shadow: 0 0 0 3px var(--ws-primary-soft);
}

.ws-textarea { min-height: 80px; resize: vertical; }

/* Tables */
.ws-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ws-table th {
	text-align: left;
	padding: 10px 14px;
	background: var(--ws-surface-2);
	color: var(--ws-text-muted);
	font-weight: 500;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--ws-border);
}

.ws-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--ws-border);
}

.ws-table tbody tr:hover {
	background: var(--ws-surface-2);
}

.ws-table tbody tr:last-child td {
	border-bottom: none;
}

/* Badges */
.ws-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: var(--ws-surface-2);
	color: var(--ws-text-muted);
}

.ws-badge-draft     { background: #f1f5f9; color: #475569; }
.ws-badge-sent      { background: var(--ws-info-soft); color: var(--ws-info); }
.ws-badge-pending   { background: var(--ws-warning-soft); color: var(--ws-warning); }
.ws-badge-approved  { background: var(--ws-success-soft); color: var(--ws-success); }
.ws-badge-scheduled { background: var(--ws-primary-soft); color: var(--ws-primary); }
.ws-badge-progress  { background: #fdf4ff; color: #86198f; }
.ws-badge-qc        { background: #fff7ed; color: #c2410c; }
.ws-badge-completed { background: var(--ws-success-soft); color: var(--ws-success); }
.ws-badge-invoiced  { background: #f0f9ff; color: #0369a1; }
.ws-badge-delivered { background: #f5f3ff; color: #5b21b6; }
.ws-badge-rejected,
.ws-badge-cancelled { background: var(--ws-danger-soft); color: var(--ws-danger); }
.ws-badge-converted { background: #f5f3ff; color: #5b21b6; }
.ws-badge-expired   { background: #f1f5f9; color: #475569; }

/* Kanban */
.ws-kanban {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 12px;
}

.ws-kanban-col {
	flex: 0 0 280px;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius-lg);
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 200px);
}

.ws-kanban-col-header {
	padding: 12px 14px;
	border-bottom: 1px solid var(--ws-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 600;
}

.ws-kanban-count {
	background: var(--ws-surface-2);
	color: var(--ws-text-muted);
	font-size: 11px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 10px;
}

.ws-kanban-list {
	padding: 8px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.ws-jc-card {
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: 8px;
	padding: 10px 12px;
	cursor: pointer;
	transition: border-color 120ms, transform 120ms;
	text-decoration: none;
	color: inherit;
	display: block;
}

.ws-jc-card:hover {
	border-color: var(--ws-border-strong);
	box-shadow: var(--ws-shadow);
	text-decoration: none;
	color: inherit;
}

.ws-jc-card-title {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
}

.ws-jc-card-meta {
	font-size: 12px;
	color: var(--ws-text-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.ws-jc-card-footer {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 12px;
}

/* Page heads */
.ws-page-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	gap: 16px;
}

.ws-page-title {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.ws-page-subtitle {
	font-size: 13px;
	color: var(--ws-text-muted);
	margin-top: 2px;
}

.ws-section-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--ws-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 10px;
}

/* Detail two-col */
.ws-detail {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 20px;
}

@media (max-width: 1024px) {
	.ws-detail { grid-template-columns: 1fr; }
	.ws-shell { grid-template-columns: 1fr; }
	.ws-sidebar { display: none; }
	.ws-form-grid-2, .ws-form-grid-3 { grid-template-columns: 1fr; }
}

/* Empty state */
.ws-empty {
	padding: 48px 20px;
	text-align: center;
	color: var(--ws-text-muted);
	background: var(--ws-surface-2);
	border-radius: var(--ws-radius-lg);
	border: 1px dashed var(--ws-border-strong);
}

/* Toast */
.ws-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: var(--ws-text);
	color: white;
	padding: 12px 18px;
	border-radius: 8px;
	box-shadow: var(--ws-shadow-lg);
	font-size: 13px;
	z-index: 1000;
	animation: ws-toast-in 200ms ease-out;
}

.ws-toast.ws-toast-error { background: var(--ws-danger); }
.ws-toast.ws-toast-success { background: var(--ws-success); }

@keyframes ws-toast-in {
	from { transform: translateY(8px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* Capacity meter */
.ws-meter {
	height: 8px;
	background: var(--ws-surface-2);
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.ws-meter-fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--ws-primary), #6d28d9);
	transition: width 200ms ease-out;
}

.ws-meter-fill.is-warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.ws-meter-fill.is-danger  { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.ws-meter-fill.is-success { background: linear-gradient(90deg, #10b981, #047857); }

/* Bar chart (horizontal) */
.ws-bar-row {
	display: grid;
	grid-template-columns: 140px 1fr 60px;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	font-size: 13px;
}

.ws-bar-row + .ws-bar-row { border-top: 1px solid var(--ws-border); }

.ws-bar-label {
	color: var(--ws-text);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ws-bar-track {
	height: 22px;
	background: var(--ws-surface-2);
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.ws-bar-fill {
	height: 100%;
	background: var(--ws-primary);
	border-radius: 4px;
	transition: width 200ms;
}

.ws-bar-row[data-status="Draft"] .ws-bar-fill { background: #94a3b8; }
.ws-bar-row[data-status="Approved"] .ws-bar-fill { background: var(--ws-success); }
.ws-bar-row[data-status="Scheduled"] .ws-bar-fill { background: var(--ws-primary); }
.ws-bar-row[data-status="In Progress"] .ws-bar-fill { background: #c026d3; }
.ws-bar-row[data-status="Quality Check"] .ws-bar-fill { background: #ea580c; }
.ws-bar-row[data-status="Completed"] .ws-bar-fill { background: var(--ws-success); }
.ws-bar-row[data-status="Invoiced"] .ws-bar-fill { background: #0369a1; }
.ws-bar-row[data-status="Delivered"] .ws-bar-fill { background: #5b21b6; }
.ws-bar-row[data-status="Cancelled"] .ws-bar-fill { background: var(--ws-danger); }

.ws-bar-value {
	text-align: right;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	color: var(--ws-text-muted);
}

/* Trend chart (vertical bars) */
.ws-trend {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 140px;
	padding: 8px 0;
}

.ws-trend-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	min-width: 20px;
}

.ws-trend-stack {
	width: 100%;
	display: flex;
	flex-direction: column-reverse;
	border-radius: 3px;
	overflow: hidden;
	min-height: 1px;
}

.ws-trend-segment {
	width: 100%;
	min-height: 0;
	transition: height 200ms;
}

.ws-trend-segment.is-parts { background: var(--ws-primary); }
.ws-trend-segment.is-labor { background: #6d28d9; }

.ws-trend-col:hover .ws-trend-stack {
	box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.2);
}

.ws-trend-label {
	font-size: 10px;
	color: var(--ws-text-dim);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ws-legend {
	display: flex;
	gap: 14px;
	font-size: 12px;
	color: var(--ws-text-muted);
	padding-top: 8px;
	border-top: 1px solid var(--ws-border);
	margin-top: 4px;
}

.ws-legend-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	margin-right: 6px;
	vertical-align: middle;
}

/* Alert tiles */
.ws-alert {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid var(--ws-border);
	background: var(--ws-surface-2);
	font-size: 13px;
}

.ws-alert.is-danger  { background: var(--ws-danger-soft);  border-color: var(--ws-danger);  color: var(--ws-danger); }
.ws-alert.is-warning { background: var(--ws-warning-soft); border-color: var(--ws-warning); color: var(--ws-warning); }
.ws-alert.is-info    { background: var(--ws-info-soft);    border-color: var(--ws-info);    color: var(--ws-info); }

.ws-alert-mark {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
}

.ws-alert-body {
	flex: 1;
}

.ws-alert-title {
	font-weight: 600;
	margin-bottom: 2px;
}

.ws-alert-detail {
	font-size: 12px;
	opacity: 0.8;
}

/* Two-column for manager sections */
.ws-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

@media (max-width: 1024px) {
	.ws-grid-2 { grid-template-columns: 1fr; }
}

/* Technician (mobile-first) */
.ws-tech-shell {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 12px 96px;
}

.ws-tech-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 4px 12px;
	border-bottom: 1px solid var(--ws-border);
	margin-bottom: 12px;
}

.ws-tech-name {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ws-tech-status {
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--ws-success);
	background: var(--ws-success-soft);
	padding: 3px 8px;
	border-radius: 999px;
}

.ws-tech-section-title {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
	color: var(--ws-text-muted);
	padding: 14px 4px 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ws-tech-job {
	display: block;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 8px;
	box-shadow: var(--ws-shadow-sm);
	text-decoration: none;
	color: inherit;
}

.ws-tech-job:hover {
	border-color: var(--ws-border-strong);
	text-decoration: none;
	color: inherit;
}

.ws-tech-job.is-active {
	border-color: var(--ws-primary);
	background: linear-gradient(180deg, var(--ws-primary-soft) 0%, var(--ws-surface) 40%);
}

.ws-tech-job-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.ws-tech-job-plate {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ws-tech-job-meta {
	font-size: 13px;
	color: var(--ws-text-muted);
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.ws-tech-job-complaint {
	margin-top: 8px;
	font-size: 13px;
	color: var(--ws-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ws-tech-checklist-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ws-border);
	gap: 12px;
}

.ws-tech-checklist-item:last-child {
	border-bottom: none;
}

.ws-tech-checklist-label {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
}

.ws-tech-checklist-cat {
	font-size: 11px;
	color: var(--ws-text-muted);
	margin-top: 2px;
	font-weight: 400;
}

.ws-tech-toggle {
	display: flex;
	gap: 4px;
}

.ws-tech-toggle-btn {
	min-width: 38px;
	height: 36px;
	border: 1px solid var(--ws-border-strong);
	background: var(--ws-surface);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ws-text-muted);
	cursor: pointer;
	transition: all 120ms;
	padding: 0 10px;
}

.ws-tech-toggle-btn:hover {
	border-color: var(--ws-text-muted);
}

.ws-tech-toggle-btn.is-active[data-result="OK"] {
	background: var(--ws-success-soft);
	border-color: var(--ws-success);
	color: var(--ws-success);
}

.ws-tech-toggle-btn.is-active[data-result="Failed"] {
	background: var(--ws-danger-soft);
	border-color: var(--ws-danger);
	color: var(--ws-danger);
}

.ws-tech-toggle-btn.is-active[data-result="Not Applicable"] {
	background: var(--ws-surface-2);
	border-color: var(--ws-text-muted);
	color: var(--ws-text-muted);
}

.ws-tech-labor-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ws-border);
}

.ws-tech-labor-row:last-child {
	border-bottom: none;
}

.ws-tech-labor-info {
	flex: 1;
	min-width: 0;
}

.ws-tech-labor-name {
	font-weight: 500;
	font-size: 14px;
}

.ws-tech-labor-meta {
	font-size: 12px;
	color: var(--ws-text-muted);
	margin-top: 2px;
}

.ws-tech-labor-action {
	flex-shrink: 0;
	min-width: 110px;
	text-align: right;
}

.ws-tech-timer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(135deg, #1f2933 0%, #323f4b 100%);
	color: white;
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 12px;
}

.ws-tech-timer-display {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ws-tech-timer-label {
	font-size: 12px;
	opacity: 0.7;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ws-tech-timer-btn {
	padding: 12px 20px;
	border-radius: 10px;
	border: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ws-tech-timer-btn.is-start {
	background: #10b981;
	color: white;
}

.ws-tech-timer-btn.is-stop {
	background: #ef4444;
	color: white;
	animation: ws-pulse 1.4s ease-in-out infinite;
}

@keyframes ws-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
	50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.ws-tech-fab {
	position: fixed;
	bottom: 16px;
	left: 16px;
	right: 16px;
	z-index: 50;
	max-width: 720px;
	margin: 0 auto;
}

.ws-tech-fab .ws-btn {
	width: 100%;
	padding: 14px 18px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(67, 56, 202, 0.3);
}

/* Modal */
.ws-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 24, 28, 0.5);
	z-index: 100;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.ws-modal {
	background: var(--ws-surface);
	width: 100%;
	max-width: 560px;
	border-radius: 16px 16px 0 0;
	max-height: 86vh;
	overflow-y: auto;
	animation: ws-modal-up 220ms ease-out;
}

@keyframes ws-modal-up {
	from { transform: translateY(20px); opacity: 0.4; }
	to { transform: translateY(0); opacity: 1; }
}

.ws-modal-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--ws-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: sticky;
	top: 0;
	background: var(--ws-surface);
}

.ws-modal-body {
	padding: 16px 20px;
}

.ws-modal-footer {
	padding: 12px 20px;
	border-top: 1px solid var(--ws-border);
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	position: sticky;
	bottom: 0;
	background: var(--ws-surface);
}

@media (min-width: 700px) {
	.ws-modal-backdrop { align-items: center; }
	.ws-modal { border-radius: 16px; }
}

/* Customer portal */
.ws-portal-app {
	min-height: 100vh;
	background: var(--ws-bg);
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--ws-text);
}

.ws-portal-topbar {
	background: var(--ws-surface);
	border-bottom: 1px solid var(--ws-border);
	position: sticky;
	top: 0;
	z-index: 10;
}

.ws-portal-topbar-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 12px 24px;
}

.ws-portal-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
}

.ws-portal-brand:hover { text-decoration: none; color: inherit; }

.ws-portal-brand-title {
	font-weight: 700;
	font-size: 14px;
	letter-spacing: -0.005em;
}

.ws-portal-brand-sub {
	font-size: 11px;
	color: var(--ws-text-muted);
}

.ws-portal-nav {
	display: flex;
	gap: 4px;
	margin-right: auto;
	margin-left: 16px;
}

.ws-portal-nav-link {
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ws-text-muted);
	text-decoration: none;
	transition: background-color 120ms;
}

.ws-portal-nav-link:hover {
	background: var(--ws-surface-2);
	color: var(--ws-text);
	text-decoration: none;
}

.ws-portal-nav-link.active {
	background: var(--ws-primary-soft);
	color: var(--ws-primary);
}

.ws-portal-user {
	display: flex;
	align-items: center;
}

.ws-portal-main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 32px 24px 64px;
}

.ws-portal-hero {
	background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
	color: white;
	border-radius: 18px;
	padding: 28px 32px;
	margin-bottom: 24px;
	box-shadow: 0 12px 28px -10px rgba(67, 56, 202, 0.4);
}

.ws-portal-hero-eyebrow {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.85;
}

.ws-portal-hero-title {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 4px 0 6px;
}

.ws-portal-hero-sub {
	opacity: 0.9;
	font-size: 14px;
}

/* Vehicle cards */
.ws-vehicle-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 12px;
}

.ws-vehicle-card {
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: 14px;
	padding: 16px 18px;
	display: block;
	text-decoration: none;
	color: inherit;
	transition: transform 120ms, box-shadow 120ms;
	box-shadow: var(--ws-shadow-sm);
}

.ws-vehicle-card:hover {
	transform: translateY(-1px);
	box-shadow: var(--ws-shadow);
	text-decoration: none;
	color: inherit;
}

.ws-vehicle-plate {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.05em;
	background: var(--ws-text);
	color: white;
	padding: 4px 10px;
	border-radius: 6px;
	margin-bottom: 10px;
}

.ws-vehicle-title {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ws-vehicle-meta {
	font-size: 13px;
	color: var(--ws-text-muted);
	margin-top: 4px;
}

.ws-vehicle-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--ws-border);
	font-size: 12px;
	color: var(--ws-text-muted);
}

/* Status timeline (stepper) */
.ws-timeline {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 0;
	padding: 24px 8px 12px;
	margin-bottom: 18px;
	overflow-x: auto;
}

.ws-timeline-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	padding: 0 4px;
	min-width: 80px;
}

.ws-timeline-step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 14px;
	left: 50%;
	right: -50%;
	height: 2px;
	background: var(--ws-border);
	z-index: 0;
}

.ws-timeline-step.is-done::after,
.ws-timeline-step.is-current::after {
	background: var(--ws-primary);
}

.ws-timeline-dot {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ws-surface);
	border: 2px solid var(--ws-border);
	color: var(--ws-text-muted);
	display: grid;
	place-items: center;
	font-size: 12px;
	font-weight: 700;
	z-index: 1;
	position: relative;
}

.ws-timeline-step.is-done .ws-timeline-dot {
	background: var(--ws-primary);
	border-color: var(--ws-primary);
	color: white;
}

.ws-timeline-step.is-current .ws-timeline-dot {
	background: white;
	border-color: var(--ws-primary);
	color: var(--ws-primary);
	box-shadow: 0 0 0 4px var(--ws-primary-soft);
}

.ws-timeline-label {
	margin-top: 8px;
	font-size: 11px;
	font-weight: 500;
	text-align: center;
	color: var(--ws-text-muted);
	white-space: nowrap;
}

.ws-timeline-step.is-current .ws-timeline-label {
	color: var(--ws-primary);
	font-weight: 600;
}

/* Stage explainer */
.ws-stage-card {
	background: var(--ws-primary-soft);
	border: 1px solid var(--ws-primary);
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 18px;
}

.ws-stage-card-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--ws-primary);
	margin-bottom: 4px;
}

.ws-stage-card-body {
	font-size: 13px;
	color: var(--ws-text);
}

/* History timeline (vertical) */
.ws-history {
	border-left: 2px solid var(--ws-border);
	padding-left: 22px;
	margin-left: 8px;
	position: relative;
}

.ws-history-item {
	position: relative;
	padding-bottom: 22px;
}

.ws-history-item::before {
	content: "";
	position: absolute;
	left: -29px;
	top: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ws-surface);
	border: 2px solid var(--ws-primary);
}

.ws-history-date {
	font-size: 12px;
	color: var(--ws-text-muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
}

.ws-history-title {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 4px;
}

.ws-history-body {
	font-size: 13px;
	color: var(--ws-text-muted);
}

@media (max-width: 700px) {
	.ws-portal-topbar-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
	.ws-portal-nav { order: 3; width: 100%; margin: 0; }
	.ws-portal-main { padding: 18px 16px 64px; }
	.ws-portal-hero { padding: 22px 22px; }
	.ws-portal-hero-title { font-size: 22px; }
	.ws-timeline { grid-template-columns: repeat(8, minmax(70px, 1fr)); }
}

/* Selected-customer card (and reusable for any "selected entity" pill) */
.ea-selected-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--ws-border);
	border-radius: 10px;
	background: var(--ws-surface);
	min-height: 60px;
	transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}

.ea-selected-card.is-empty {
	border-style: dashed;
	background: var(--ws-surface-2);
	color: var(--ws-text-muted);
}

.ea-selected-card.is-selected {
	border-color: var(--ws-primary);
	background: linear-gradient(180deg, var(--ws-primary-soft) 0%, var(--ws-surface) 60%);
	box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.06);
}

.ea-selected-avatar {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -0.01em;
	background: var(--ws-surface-2);
	color: var(--ws-text-muted);
}

.ea-selected-card.is-selected .ea-selected-avatar {
	background: linear-gradient(135deg, var(--ws-primary), #6d28d9);
	color: white;
}

.ea-selected-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ea-selected-name {
	font-weight: 600;
	font-size: 14px;
	letter-spacing: -0.005em;
	color: var(--ws-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ea-selected-card.is-empty .ea-selected-name {
	color: var(--ws-text-muted);
	font-weight: 500;
}

.ea-selected-meta {
	font-size: 12px;
	color: var(--ws-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	gap: 4px;
	align-items: center;
}

.ea-selected-card .ws-btn-ghost {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: var(--ws-text-muted);
	border-radius: 50%;
}

.ea-selected-card .ws-btn-ghost:hover {
	color: var(--ws-danger);
	background: var(--ws-danger-soft);
}

/* Typeahead picker (used in line-item tables) */
.ea-typeahead {
	position: relative;
}

.ea-typeahead-input {
	width: 100%;
}

.ea-typeahead-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	min-width: 280px;
	max-height: 280px;
	overflow-y: auto;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border-strong);
	border-radius: 8px;
	box-shadow: var(--ws-shadow-lg);
	z-index: 50;
	padding: 4px;
}

.ea-typeahead-row {
	padding: 8px 10px;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 80ms;
}

.ea-typeahead-row:hover {
	background: var(--ws-primary-soft);
}

.ea-typeahead-row + .ea-typeahead-row {
	margin-top: 1px;
}

.ea-typeahead-row-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--ws-text);
	margin-bottom: 2px;
}

.ea-typeahead-row-meta {
	font-size: 11px;
	color: var(--ws-text-muted);
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	align-items: center;
}

.ea-typeahead-empty {
	padding: 14px;
	text-align: center;
	color: var(--ws-text-muted);
	font-size: 12px;
}

/* Public approval page */
.ws-portal {
	min-height: 100vh;
	background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
	padding: 32px 16px;
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ws-portal-card {
	max-width: 720px;
	margin: 0 auto;
	background: white;
	border-radius: 16px;
	box-shadow: 0 20px 50px -10px rgba(20, 24, 28, 0.15);
	overflow: hidden;
}

.ws-portal-head {
	padding: 28px 32px;
	border-bottom: 1px solid var(--ws-border);
	background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
	color: white;
}

.ws-portal-body {
	padding: 28px 32px;
}

/* Misc utility */
.ws-flex { display: flex; gap: 8px; align-items: center; }
.ws-flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ws-stack { display: flex; flex-direction: column; gap: 8px; }
.ws-mt-2 { margin-top: 8px; }
.ws-mt-3 { margin-top: 12px; }
.ws-mt-4 { margin-top: 16px; }
.ws-muted { color: var(--ws-text-muted); }
.ws-text-sm { font-size: 12px; }
.ws-text-right { text-align: right; }
.ws-grow { flex: 1; }
.ws-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ============================================================================
   Public Estimate Approval Page  (customer-facing link)
   --------------------------------------------------------------------------
   Mirrors the SPA "Customer Preview" tab exactly — a clean centered card on
   a soft neutral background. No registration marks, no stamps, no dark
   chrome. Big Shoulders Display heading + Atkinson Hyperlegible body +
   JetBrains Mono for any number/identifier. Classes are prefixed
   `ws-pep-` ("public estimate page") so they don't collide with the
   logged-in portal's `ws-portal*` classes.
   ========================================================================== */

.ws-pep-shell {
	--pep-bg:        #f6f6f4;
	--pep-card:      #ffffff;
	--pep-ink:       #15151a;
	--pep-ink-soft:  #4a4a52;
	--pep-ink-dim:   #8a8a92;
	--pep-rule:      #e7e5df;
	--pep-go:        #1e7a3f;
	--pep-go-soft:   #e6f3ec;
	--pep-stop:      #9b1c1c;
	--pep-stop-soft: #f9eaea;
	--pep-warn:      #92400e;
	--pep-warn-soft: #fbf3e1;

	min-height: 100vh;
	padding: clamp(24px, 5vw, 64px) clamp(12px, 4vw, 24px);
	background: var(--pep-bg);
	color: var(--pep-ink);
	font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ws-pep-shell * { box-sizing: border-box; }

/* Card -------------------------------------------------------------------*/
.ws-pep-card {
	max-width: 640px;
	margin: 0 auto;
	padding: clamp(28px, 5vw, 48px);
	background: var(--pep-card);
	border: 1px solid var(--pep-rule);
	border-radius: 18px;
	box-shadow:
		0 1px 2px rgba(20, 24, 28, 0.04),
		0 12px 32px -16px rgba(20, 24, 28, 0.18);
	animation: ws-pep-rise 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ws-pep-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Eyebrow + heading ------------------------------------------------------*/
.ws-pep-eyebrow {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--pep-ink-dim);
}
.ws-pep-dot { color: var(--pep-rule); }

.ws-pep-heading {
	margin: 12px 0 0;
	font-family: 'Big Shoulders Display', sans-serif;
	font-weight: 800;
	font-size: clamp(28px, 5vw, 36px);
	letter-spacing: -0.01em;
	line-height: 1.1;
	color: var(--pep-ink);
}
.ws-pep-heading-error { color: var(--pep-stop); }

.ws-pep-sub {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pep-ink-soft);
}
.ws-pep-sub strong { color: var(--pep-ink); font-weight: 700; }

/* Rules + section labels ------------------------------------------------*/
.ws-pep-rule {
	border: 0;
	border-top: 1px solid var(--pep-rule);
	margin: 20px 0;
}

.ws-pep-section-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--pep-ink-dim);
}

.ws-pep-prose {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pep-ink);
}
.ws-pep-prose-dim { color: var(--pep-ink-dim); }

/* Line items -------------------------------------------------------------*/
.ws-pep-lines {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
}
.ws-pep-line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.ws-pep-line-desc {
	min-width: 0;
	flex: 1;
	color: var(--pep-ink);
	overflow-wrap: break-word;
}
.ws-pep-line-opt {
	margin-left: 4px;
	font-size: 12px;
	color: var(--pep-ink-dim);
}
.ws-pep-line-amt {
	flex-shrink: 0;
	font-size: 13px;
	color: var(--pep-ink);
}

.ws-pep-mono {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-feature-settings: 'tnum' 1;
}

/* Grand total row -------------------------------------------------------*/
.ws-pep-total-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.ws-pep-total-num {
	font-size: clamp(24px, 4vw, 30px);
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--pep-ink);
}

/* Notes + buttons --------------------------------------------------------*/
.ws-pep-notes {
	margin-top: 20px;
}
.ws-pep-textarea {
	width: 100%;
	margin-top: 8px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 14px;
	color: var(--pep-ink);
	background: #fafaf8;
	border: 1px solid var(--pep-rule);
	border-radius: 10px;
	resize: vertical;
	min-height: 88px;
	transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.ws-pep-textarea:focus {
	outline: none;
	background: #ffffff;
	border-color: var(--pep-ink);
	box-shadow: 0 0 0 3px rgba(30, 122, 63, 0.15);
}

.ws-pep-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}
.ws-pep-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border: 1px solid;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 120ms ease, background 120ms, color 120ms, box-shadow 120ms;
}
.ws-pep-btn:hover { transform: translateY(-1px); }
.ws-pep-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(30, 122, 63, 0.25);
}
.ws-pep-btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.ws-pep-btn-approve {
	background: var(--pep-stop);
	color: #ffffff;
	border-color: var(--pep-stop);
}
.ws-pep-btn-approve:hover { background: #831a1a; }
.ws-pep-btn-approve:focus-visible {
	box-shadow: 0 0 0 3px rgba(155, 28, 28, 0.25);
}

.ws-pep-btn-reject {
	background: var(--pep-card);
	color: var(--pep-ink);
	border-color: var(--pep-rule);
}
.ws-pep-btn-reject:hover {
	background: #f3f1ec;
	border-color: var(--pep-ink-soft);
}

.ws-pep-fineprint {
	margin: 12px 0 0;
	text-align: center;
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pep-ink-dim);
}

/* Banners (approved / rejected / expired) -------------------------------*/
.ws-pep-banner {
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid;
	font-size: 13px;
	line-height: 1.5;
}
.ws-pep-banner strong { font-weight: 700; }
.ws-pep-banner-go   { background: var(--pep-go-soft);   color: var(--pep-go);   border-color: color-mix(in srgb, var(--pep-go) 25%, transparent); }
.ws-pep-banner-stop { background: var(--pep-stop-soft); color: var(--pep-stop); border-color: color-mix(in srgb, var(--pep-stop) 25%, transparent); }
.ws-pep-banner-warn { background: var(--pep-warn-soft); color: var(--pep-warn); border-color: color-mix(in srgb, var(--pep-warn) 25%, transparent); }

/* Mobile niceties --------------------------------------------------------*/
@media (max-width: 480px) {
	.ws-pep-actions { flex-direction: column; }
	.ws-pep-btn { flex: 0 0 auto; }
}

