.vmm-wrap {
	--vmm-accent: #4f46e5;
	--vmm-accent-hover: #4338ca;
	--vmm-accent-soft: #eef2ff;
	--vmm-success: #059669;
	--vmm-success-soft: #ecfdf5;
	--vmm-danger: #dc2626;
	--vmm-danger-soft: #fef2f2;
	--vmm-warning: #b45900;
	--vmm-warning-soft: #fff7ed;
	--vmm-text: #111827;
	--vmm-muted: #6b7280;
	--vmm-border: #e5e7eb;
	--vmm-bg: #f9fafb;
	--vmm-card-bg: #ffffff;
	--vmm-radius: 10px;
	--vmm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--vmm-shadow-hover: 0 6px 16px rgba(16, 24, 40, .1);

	max-width: 960px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--vmm-text);
}

.vmm-wrap * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------- *
 *  Icons
 * ---------------------------------------------------------------------- */

.vmm-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.vmm-icon-chevron {
	transition: transform .18s ease;
}

.vmm-toggle-visit-details.vmm-open .vmm-icon-chevron {
	transform: rotate(180deg);
}

/* ---------------------------------------------------------------------- *
 *  Header
 * ---------------------------------------------------------------------- */

.vmm-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding: 18px 20px;
	background: var(--vmm-card-bg);
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	box-shadow: var(--vmm-shadow);
}

.vmm-header-title {
	display: flex;
	align-items: center;
	gap: 14px;
}

.vmm-header-badge {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: var(--vmm-accent-soft);
	color: var(--vmm-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.vmm-header-badge .vmm-icon {
	width: 22px;
	height: 22px;
}

.vmm-header h2 {
	margin: 0;
	font-size: 1.3em;
}

.vmm-muted {
	color: var(--vmm-muted);
	font-size: 0.9em;
	margin: 0;
}

/* ---------------------------------------------------------------------- *
 *  Buttons
 * ---------------------------------------------------------------------- */

.vmm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 8px;
	border: 1px solid var(--vmm-border);
	background: #fff;
	color: var(--vmm-text);
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

.vmm-btn:hover {
	background: var(--vmm-bg);
	border-color: #d1d5db;
}

.vmm-btn:active {
	transform: translateY(1px);
}

.vmm-btn-primary {
	background: var(--vmm-accent);
	border-color: var(--vmm-accent);
	color: #fff;
	box-shadow: 0 1px 2px rgba(79, 70, 229, .35);
}

.vmm-btn-primary:hover {
	background: var(--vmm-accent-hover);
	border-color: var(--vmm-accent-hover);
}

.vmm-btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--vmm-accent);
	padding: 6px 10px;
	font-size: 13px;
}

.vmm-btn-ghost:hover {
	background: var(--vmm-accent-soft);
}

.vmm-logout {
	text-decoration: none;
}

/* ---------------------------------------------------------------------- *
 *  Stat cards
 * ---------------------------------------------------------------------- */

.vmm-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.vmm-stat-card {
	background: var(--vmm-card-bg);
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: var(--vmm-shadow);
	transition: box-shadow .18s ease, transform .18s ease;
}

.vmm-stat-card:hover {
	box-shadow: var(--vmm-shadow-hover);
	transform: translateY(-2px);
}

.vmm-stat-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--vmm-accent-soft);
	color: var(--vmm-accent);
	flex-shrink: 0;
}

.vmm-stat-icon .vmm-icon {
	width: 20px;
	height: 20px;
}

.vmm-stat-value {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.15;
	color: var(--vmm-text);
}

.vmm-stat-label {
	font-size: .82em;
	color: var(--vmm-muted);
	margin-top: 2px;
}

/* ---------------------------------------------------------------------- *
 *  Toolbar / search
 * ---------------------------------------------------------------------- */

.vmm-toolbar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.vmm-search-wrap {
	position: relative;
	flex: 1 1 260px;
	display: flex;
	align-items: center;
}

.vmm-search-wrap .vmm-icon {
	position: absolute;
	left: 11px;
	color: var(--vmm-muted);
	pointer-events: none;
}

.vmm-toolbar #vmm-search-input {
	width: 100%;
	padding: 9px 12px 9px 34px;
}

/* ---------------------------------------------------------------------- *
 *  Panels
 * ---------------------------------------------------------------------- */

.vmm-panel {
	background: var(--vmm-card-bg);
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	padding: 18px 20px;
	margin-bottom: 16px;
	box-shadow: var(--vmm-shadow);
}

.vmm-panel h3 {
	margin-top: 0;
}

/* ---------------------------------------------------------------------- *
 *  Forms
 * ---------------------------------------------------------------------- */

.vmm-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
	margin-bottom: 12px;
}

.vmm-form-grid.vmm-readonly > div {
	padding: 4px 0;
}

.vmm-form-grid label,
.vmm-wrap form > label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-weight: 600;
	font-size: 0.92em;
}

.vmm-form-grid label.vmm-full,
.vmm-wrap form > label.vmm-full {
	grid-column: 1 / -1;
}

.vmm-wrap input[type="text"],
.vmm-wrap input[type="password"],
.vmm-wrap input[type="email"],
.vmm-wrap input[type="number"],
.vmm-wrap input[type="date"],
.vmm-wrap textarea,
.vmm-wrap select {
	font-weight: normal;
	font-family: inherit;
	padding: 8px 10px;
	border: 1px solid var(--vmm-border);
	border-radius: 7px;
	width: 100%;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}

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

.vmm-form-msg {
	margin: 8px 0;
	font-size: 0.9em;
	font-weight: 500;
}

.vmm-form-msg.vmm-error {
	color: var(--vmm-danger);
}

.vmm-form-msg.vmm-success {
	color: var(--vmm-success);
}

/* ---------------------------------------------------------------------- *
 *  Spare parts editor / readonly table
 * ---------------------------------------------------------------------- */

.vmm-parts-table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
}

.vmm-parts-table th,
.vmm-parts-table td {
	border: 1px solid var(--vmm-border);
	padding: 7px 9px;
	text-align: left;
	font-size: 0.92em;
}

.vmm-parts-table th {
	background: var(--vmm-bg);
	font-weight: 600;
}

.vmm-parts-table input {
	width: 100%;
	min-width: 60px;
}

.vmm-remove-line {
	background: none;
	border: none;
	color: var(--vmm-danger);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	transition: transform .1s ease;
}

.vmm-remove-line:hover {
	transform: scale(1.15);
}

/* ---------------------------------------------------------------------- *
 *  Vehicle rows (search results / client vehicle list)
 * ---------------------------------------------------------------------- */

.vmm-vehicle-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	transition: box-shadow .15s ease, border-color .15s ease;
}

.vmm-vehicle-row:last-child {
	margin-bottom: 0;
}

.vmm-vehicle-row:hover {
	box-shadow: var(--vmm-shadow-hover);
	border-color: #d1d5db;
}

.vmm-vehicle-row-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vmm-vehicle-row-title .vmm-icon {
	color: var(--vmm-accent);
}

.vmm-vehicle-row-pending {
	border-style: dashed;
	background: var(--vmm-bg);
}

/* ---------------------------------------------------------------------- *
 *  Field hints (e.g. "where's my VIN?") and the ownership-transfer notice
 * ---------------------------------------------------------------------- */

.vmm-field-hint {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: -6px 0 12px;
	font-size: .82em;
	color: var(--vmm-muted);
}

.vmm-field-hint .vmm-icon {
	margin-top: 2px;
	color: var(--vmm-accent);
	flex-shrink: 0;
}

.vmm-transfer-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	background: var(--vmm-accent-soft);
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	padding: 10px 14px;
	font-size: .88em;
	color: var(--vmm-text);
	margin: 0 0 16px;
}

.vmm-transfer-notice .vmm-icon {
	color: var(--vmm-accent);
	margin-top: 2px;
}

.vmm-transfer-notice a {
	color: var(--vmm-accent);
	font-weight: 600;
}

/* ---------------------------------------------------------------------- *
 *  Visit history -- card list (client dashboard, pooled across centers)
 * ---------------------------------------------------------------------- */

.vmm-visits-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.vmm-visit-card {
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	padding: 14px 16px;
	transition: box-shadow .15s ease, border-color .15s ease;
}

.vmm-visit-card:hover {
	box-shadow: var(--vmm-shadow-hover);
	border-color: #d1d5db;
}

.vmm-visit-summary {
	display: grid;
	grid-template-columns: 108px 1fr 1.6fr 100px auto;
	gap: 14px;
	align-items: center;
}

.vmm-visit-label {
	display: block;
	font-size: .72em;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--vmm-muted);
	margin-bottom: 2px;
}

.vmm-visit-summary-cell span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.vmm-visit-summary-cell .vmm-icon {
	color: var(--vmm-muted);
}

.vmm-visit-cost strong {
	color: var(--vmm-accent);
}

.vmm-visit-full {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--vmm-border);
}

/* ---------------------------------------------------------------------- *
 *  Visit history -- item list (staff view of a single vehicle)
 * ---------------------------------------------------------------------- */

.vmm-visit-item {
	padding: 12px 0;
	border-bottom: 1px solid var(--vmm-border);
}

.vmm-visit-item:last-child {
	border-bottom: none;
}

.vmm-visit-item-head {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 4px;
}

/* ---------------------------------------------------------------------- *
 *  Tabs (client login/register)
 * ---------------------------------------------------------------------- */

.vmm-tabs {
	display: inline-flex;
	background: var(--vmm-bg);
	border: 1px solid var(--vmm-border);
	border-radius: 10px;
	padding: 4px;
	gap: 4px;
	margin-bottom: 16px;
}

.vmm-tab-btn {
	padding: 8px 18px;
	border: none;
	background: transparent;
	border-radius: 7px;
	cursor: pointer;
	font-weight: 500;
	font-family: inherit;
	color: var(--vmm-muted);
	transition: background-color .15s ease, color .15s ease;
}

.vmm-tab-btn.active {
	background: #fff;
	color: var(--vmm-text);
	box-shadow: var(--vmm-shadow);
}

.vmm-tab-panel {
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
	padding: 18px 20px;
	background: var(--vmm-card-bg);
	box-shadow: var(--vmm-shadow);
}

/* ---------------------------------------------------------------------- *
 *  Credentials box
 * ---------------------------------------------------------------------- */

.vmm-credentials {
	border-color: var(--vmm-accent);
	background: var(--vmm-accent-soft);
}

.vmm-credentials code {
	background: rgba(255, 255, 255, .7);
	padding: 2px 6px;
	border-radius: 4px;
}

#vmm-new-client-fields {
	margin-top: 10px;
}

#vmm-client-lookup-result {
	margin: 6px 0 4px;
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------- *
 *  Loading spinner + content fade-in
 * ---------------------------------------------------------------------- */

.vmm-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid var(--vmm-border);
	border-top-color: var(--vmm-accent);
	border-radius: 50%;
	animation: vmm-spin .7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}

@keyframes vmm-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes vmm-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.vmm-fade-in {
	animation: vmm-fade-in .25s ease-out;
}

/* ---------------------------------------------------------------------- *
 *  Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 600px) {
	.vmm-form-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.vmm-visit-summary {
		grid-template-columns: 1fr 1fr;
	}

	.vmm-visit-summary .vmm-toggle-visit-details,
	.vmm-visit-summary .vmm-print-visit {
		grid-column: 1 / -1;
		justify-content: center;
	}
}

/* ---------------------------------------------------------------------- *
 *  Service reminder badge
 * ---------------------------------------------------------------------- */

.vmm-service-reminder {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	padding: 6px 10px;
	background: var(--vmm-success-soft);
	color: var(--vmm-success);
	border-radius: 7px;
	font-size: .85em;
	font-weight: 600;
	width: fit-content;
}

.vmm-service-reminder .vmm-icon {
	color: var(--vmm-success);
}

/* ---------------------------------------------------------------------- *
 *  Cross-center visit awareness (staff view) -- date & reason only
 * ---------------------------------------------------------------------- */

.vmm-other-center-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.vmm-other-center-list li {
	padding: 10px 12px;
	border: 1px solid var(--vmm-border);
	border-radius: 8px;
	background: var(--vmm-bg);
}

.vmm-other-center-list li p {
	margin: 4px 0 0;
}

.vmm-other-center-list-head {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.vmm-other-center-list-head .vmm-muted {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

/* ---------------------------------------------------------------------- *
 *  Visits chart -- inline SVG bars, no external library
 * ---------------------------------------------------------------------- */

.vmm-chart-svg {
	width: 100%;
	height: auto;
	max-height: 180px;
	overflow: visible;
}

.vmm-chart-bar {
	fill: var(--vmm-accent);
	transition: fill .15s ease;
}

.vmm-chart-bar:hover {
	fill: var(--vmm-accent-hover);
}

.vmm-chart-label {
	font-size: 9px;
	fill: var(--vmm-muted);
}

.vmm-chart-value {
	font-size: 10px;
	font-weight: 600;
	fill: var(--vmm-text);
}

/* ---------------------------------------------------------------------- *
 *  Manage staff -- roster with deactivate/reactivate
 * ---------------------------------------------------------------------- */

.vmm-staff-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.vmm-staff-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border: 1px solid var(--vmm-border);
	border-radius: var(--vmm-radius);
}

.vmm-badge-inactive {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--vmm-danger-soft);
	color: var(--vmm-danger);
	font-size: .72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
}

/* ---------------------------------------------------------------------- *
 *  Load more (search pagination)
 * ---------------------------------------------------------------------- */

.vmm-load-more-wrap {
	text-align: center;
	margin-top: 10px;
}

/* ---------------------------------------------------------------------- *
 *  Printable visit receipt
 * ---------------------------------------------------------------------- */

@media print {
	body * {
		visibility: hidden;
	}

	.vmm-printing,
	.vmm-printing * {
		visibility: visible;
	}

	.vmm-printing {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		border: none;
		box-shadow: none;
	}

	.vmm-printing .vmm-visit-full {
		display: block !important;
	}

	.vmm-printing .vmm-print-visit,
	.vmm-printing .vmm-toggle-visit-details {
		display: none !important;
	}
}

/* ---------------------------------------------------------------------- *
 *  RTL support -- mirrors layout when the page direction is
 *  right-to-left (e.g. an Arabic-language site). Icons are symmetrical
 *  SVGs already, so only spacing/alignment needs to flip. This does not
 *  bundle Arabic translation strings -- add a vmm-ar.mo under
 *  /languages if full text translation is also needed.
 * ---------------------------------------------------------------------- */

[dir="rtl"] .vmm-wrap {
	text-align: right;
}

[dir="rtl"] .vmm-search-wrap .vmm-icon {
	left: auto;
	right: 11px;
}

[dir="rtl"] .vmm-toolbar #vmm-search-input {
	padding: 9px 34px 9px 12px;
}

[dir="rtl"] .vmm-header,
[dir="rtl"] .vmm-header-title,
[dir="rtl"] .vmm-vehicle-row-title,
[dir="rtl"] .vmm-stat-card,
[dir="rtl"] .vmm-other-center-list-head,
[dir="rtl"] .vmm-visit-summary-cell span,
[dir="rtl"] .vmm-field-hint,
[dir="rtl"] .vmm-transfer-notice,
[dir="rtl"] .vmm-service-reminder,
[dir="rtl"] .vmm-staff-row {
	flex-direction: row-reverse;
}

[dir="rtl"] .vmm-badge-inactive {
	margin-left: 0;
	margin-right: 6px;
}

/* ---------------------------------------------------------------------- *
 *  Subscription expiry notice -- bold and highlighted starting 3 days
 *  before expiry, and while expired. Notification only, never a lockout.
 * ---------------------------------------------------------------------- */

.vmm-subscription-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	border-radius: var(--vmm-radius);
	padding: 12px 16px;
	margin: 0 0 16px;
	font-weight: 700;
	font-size: .92em;
}

.vmm-subscription-notice .vmm-icon {
	margin-top: 2px;
	flex-shrink: 0;
}

.vmm-subscription-warning {
	background: var(--vmm-warning-soft);
	color: var(--vmm-warning);
	border: 1px solid var(--vmm-warning);
}

.vmm-subscription-expired {
	background: var(--vmm-danger-soft);
	color: var(--vmm-danger);
	border: 1px solid var(--vmm-danger);
}

[dir="rtl"] .vmm-subscription-notice {
	flex-direction: row-reverse;
}
