/**
 * Engineered Inventory — design tokens.
 *
 * The theming contract. Runtime values for the branded vars are injected
 * as an inline :root block from Settings → Branding (see Core\Assets);
 * these are the fallbacks. Every component in later phases consumes
 * tokens only — no raw colors/sizes in component CSS.
 *
 * All selectors are scoped under .evi-* so nothing leaks into the theme.
 */

:root {
	/* Brand (overridden from settings) */
	--evi-primary: #1ba4e0;
	--evi-ink: #0f1b2d;
	--evi-money: #0f7a3d;
	--evi-sale: #d92d20;
	--evi-surface: #ffffff;
	--evi-page-bg: #f5f7fa;
	--evi-radius: 14px;

	/* Derived neutrals */
	--evi-ink-muted: color-mix(in srgb, var(--evi-ink) 62%, #ffffff);
	--evi-ink-faint: color-mix(in srgb, var(--evi-ink) 38%, #ffffff);
	--evi-line: color-mix(in srgb, var(--evi-ink) 12%, #ffffff);
	--evi-primary-soft: color-mix(in srgb, var(--evi-primary) 12%, #ffffff);

	/* Elevation */
	--evi-shadow-card: 0 1px 2px rgb(15 27 45 / 0.06), 0 4px 14px rgb(15 27 45 / 0.06);
	--evi-shadow-card-hover: 0 2px 4px rgb(15 27 45 / 0.08), 0 12px 28px rgb(15 27 45 / 0.12);
	--evi-shadow-drawer: 0 -8px 32px rgb(15 27 45 / 0.18);

	/* Spacing scale */
	--evi-space-1: 0.25rem;
	--evi-space-2: 0.5rem;
	--evi-space-3: 0.75rem;
	--evi-space-4: 1rem;
	--evi-space-5: 1.5rem;
	--evi-space-6: 2rem;
	--evi-space-7: 3rem;

	/* Type scale (system stack; the host theme's brand face still wins on headings if it sets one on body) */
	--evi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
	--evi-text-xs: 0.75rem;
	--evi-text-sm: 0.875rem;
	--evi-text-md: 1rem;
	--evi-text-lg: 1.125rem;
	--evi-text-xl: 1.375rem;
	--evi-text-2xl: 1.75rem;

	/* Motion */
	--evi-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--evi-dur-fast: 150ms;
	--evi-dur-med: 260ms;

	/* Focus ring — visible, brand-tinted, non-negotiable for a11y */
	--evi-focus-ring: 0 0 0 3px color-mix(in srgb, var(--evi-primary) 40%, transparent);
}

/* Global a11y primitives for all plugin UI */
.evi-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

[class^="evi-"]:focus-visible,
[class*=" evi-"]:focus-visible {
	outline: none;
	box-shadow: var(--evi-focus-ring);
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	[class^="evi-"],
	[class^="evi-"]::before,
	[class^="evi-"]::after,
	[class*=" evi-"],
	[class*=" evi-"]::before,
	[class*=" evi-"]::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
