html, body {
	margin: 0;
	max-width: 100%;
}

.main{
	padding:8px;
	display:flex;
	flex-direction:column;
	align-items:stretch;
	width: 100%;
	box-sizing: border-box;
}


/* ---------- Shared tokens ---------- */

:root {
	--lm-blue: #2563eb;
	--lm-blue-dark: #1d4ed8;
	--lm-navy: #2c5282;
	--lm-ink: #1e293b;
	--lm-ink-soft: #334155;
	--lm-muted: #64748b;
	--lm-border: #c5d4e8;
	--lm-field-border: #b8c9de;
	--lm-surface: #f4f8fc;
	--lm-surface-2: #eef3f9;
	--lm-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* ---------- Loader (used by decrypt flow) ---------- */

.loader-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.75);
	z-index: 2000;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 16px;
}

.loader-overlay.is-visible {
	display: flex;
}

.loader {
    border: 10px solid #f3f3f3;
    border-top: 10px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.loader-text {
	font-size: 1rem;
	font-weight: 600;
	color: var(--lm-ink-soft);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.lm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}

.lm-btn:focus-visible {
	outline: none;
	box-shadow: var(--lm-focus);
}

.lm-btn-primary {
	background: var(--lm-blue);
	border-color: var(--lm-blue);
	color: #fff;
}

.lm-btn-primary:hover {
	background: var(--lm-blue-dark);
	border-color: var(--lm-blue-dark);
}

.lm-btn-ghost {
	background: #fff;
	border-color: var(--lm-field-border);
	color: var(--lm-ink-soft);
}

.lm-btn-ghost:hover {
	background: var(--lm-surface);
	border-color: #94a3b8;
}

.lm-btn[disabled] {
	cursor: not-allowed;
	opacity: .7;
}

.lm-btn-spinner,
.lm-btn-loading-text {
	display: none;
}

.lm-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin .8s linear infinite;
}

.lm-btn.is-loading {
	opacity: 1;
	cursor: progress;
}

.lm-btn.is-loading .lm-btn-spinner,
.lm-btn.is-loading .lm-btn-loading-text {
	display: inline-block;
}

.lm-btn.is-loading .lm-btn-text {
	display: none;
}

.lm-modal-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #dbeafe;
	color: var(--lm-blue);
	font-size: 1.2rem;
}

/* ---------- Modal ---------- */

.lm-modal .modal-content {
	border: 0;
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
	overflow: hidden;
}

.modal-backdrop.show {
	opacity: .55;
	background-color: #0f172a;
}

.lm-modal-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--lm-border);
	background: linear-gradient(180deg, var(--lm-surface) 0%, var(--lm-surface-2) 100%);
}

.lm-modal-heading {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.lm-modal-icon {
	width: 40px;
	height: 40px;
	font-size: 1.05rem;
}

.lm-modal .modal-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--lm-navy);
}

.lm-modal-subtitle {
	font-size: .85rem;
	color: var(--lm-muted);
}

.lm-modal-body {
	padding: 20px;
	background: #fff;
}

.lm-modal-footer {
	padding: 12px 20px;
	border-top: 1px solid var(--lm-border);
	background: var(--lm-surface);
}

.lm-footer-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	width: 100%;
	margin: 0;
}

.lm-fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.lm-fieldset[disabled] {
	opacity: .65;
}

/* ---------- Form sections ---------- */

.lm-section + .lm-section {
	margin-top: 22px;
}

.lm-section-title {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--lm-border);
	font-size: .8rem;
	font-weight: 700;
	color: var(--lm-navy);
	letter-spacing: .06em;
	text-transform: uppercase;
}

.lm-grid {
	display: grid;
	gap: 14px 16px;
}

.lm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.lm-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.lm-field label {
	margin: 0;
	font-size: .85rem;
	font-weight: 600;
	color: var(--lm-ink-soft);
}

.lm-field input[type="text"],
.lm-field input[type="date"],
.lm-field select {
	width: 100%;
	height: 40px;
	padding: 6px 12px;
	border: 1px solid var(--lm-field-border);
	border-radius: 6px;
	background: #fff;
	font-size: .95rem;
	color: var(--lm-ink);
	box-sizing: border-box;
}

.lm-field input:focus,
.lm-field select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: var(--lm-focus);
}

.lm-field input:disabled,
.lm-field select:disabled {
	opacity: .8;
	cursor: not-allowed;
	background: #f1f5f9;
	color: var(--lm-muted);
}

.lm-field.is-invalid input,
.lm-field.is-invalid select {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.lm-options-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 14px;
}

/* Toggle switch for cluster */
.lm-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	cursor: pointer;
	user-select: none;
}

.lm-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.lm-switch-track {
	position: relative;
	width: 38px;
	height: 22px;
	border-radius: 11px;
	background: #cbd5e1;
	transition: background-color .15s;
}

.lm-switch-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
	transition: transform .15s;
}

.lm-switch input:checked + .lm-switch-track {
	background: var(--lm-blue);
}

.lm-switch input:checked + .lm-switch-track::after {
	transform: translateX(16px);
}

.lm-switch input:focus-visible + .lm-switch-track {
	box-shadow: var(--lm-focus);
}

.lm-switch-label {
	font-weight: 600;
	color: var(--lm-ink-soft);
}

/* Preset chips (feature based) */
.lm-presets {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.lm-presets-label {
	font-size: .8rem;
	font-weight: 600;
	color: var(--lm-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}

.lm-chip {
	padding: 5px 12px;
	border: 1px solid var(--lm-field-border);
	border-radius: 999px;
	background: #fff;
	font-size: .85rem;
	font-weight: 600;
	color: var(--lm-ink-soft);
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.lm-chip:hover {
	background: var(--lm-surface);
	border-color: #94a3b8;
}

.lm-chip:focus-visible {
	outline: none;
	box-shadow: var(--lm-focus);
}

.evaluation-mode-btn.active {
	background: #dbeafe;
	border-color: var(--lm-blue);
	color: var(--lm-blue-dark);
}

/* ---------- Features list ---------- */

.license-features-panel {
	width: 100%;
	margin-top: 16px;
	min-width: 0;
}

.lm-features-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.lm-features-title {
	font-size: .85rem;
	font-weight: 600;
	color: var(--lm-ink-soft);
}

.lm-badge {
	padding: 2px 10px;
	border-radius: 999px;
	background: #dbeafe;
	color: var(--lm-blue-dark);
	font-size: .78rem;
	font-weight: 700;
}

.license-features-scroll {
	max-height: 42vh;
	overflow-x: hidden;
	overflow-y: auto;
	width: 100%;
	border: 1px solid var(--lm-border);
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
}

.license-features-list {
	columns: 300px;
	column-gap: 12px;
	padding: 8px;
	box-sizing: border-box;
}

.license-feature-item {
	break-inside: avoid;
	display: grid;
	grid-template-columns: 18px 32px minmax(0, 1fr);
	grid-template-rows: auto auto;
	gap: 2px 8px;
	align-items: start;
	min-width: 0;
	margin: 0 0 4px;
	padding: 6px 8px;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
}

.license-feature-item.is-fixed .license-feature-cb {
	pointer-events: none;
}

.license-feature-cb {
	grid-row: 1 / span 2;
	margin-top: 3px;
}

.license-feature-id {
	grid-column: 2;
	grid-row: 1;
	font-weight: bold;
	color: #555;
}

.license-feature-label {
	grid-column: 3;
	grid-row: 1;
	font-size: 0.95em;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.license-feature-name {
	grid-column: 2 / 4;
	grid-row: 2;
	margin-top: 0;
	font-size: 0.8em;
	color: #888;
	font-family: monospace;
	overflow-wrap: anywhere;
}

.license-feature-item:hover {
	background-color: #f8f9fa;
}

.license-feature-item:has(.license-feature-cb:checked) {
	background-color: #e0edfb;
	border-color: #bcd5ef;
}

.license-feature-item:has(.license-feature-cb:checked):hover {
	background-color: #d4e6f8;
}

/* ---------- Result states ---------- */

.result:empty {
	display: none;
}

.result {
	margin-bottom: 16px;
}

.result-error {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid #fca5a5;
	border-left: 4px solid #dc2626;
	border-radius: 8px;
	background: #fef2f2;
	color: #991b1b;
	font-weight: 600;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.result-error::before {
	content: "\f071";
	font-family: FontAwesome;
	font-weight: normal;
	flex: 0 0 auto;
}

.result-success {
	padding: 10px 14px;
	border: 1px solid #86efac;
	border-left: 4px solid #16a34a;
	border-radius: 8px;
	background: #f0fdf4;
	color: #166534;
	font-weight: 500;
}

.lm-success-view {
	padding: 28px 8px 20px;
	text-align: center;
}

.lm-success-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	font-size: 1.8rem;
}

.lm-success-title {
	margin: 0 0 6px;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--lm-ink);
}

.lm-success-text {
	margin: 0 0 10px;
	color: var(--lm-muted);
}

.lm-success-file {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 8px 14px;
	border: 1px solid var(--lm-border);
	border-radius: 8px;
	background: var(--lm-surface);
	font-family: monospace;
	font-size: .9rem;
	color: var(--lm-ink);
	overflow-wrap: anywhere;
}

.lm-success-meta {
	margin: 12px 0 0;
	font-size: .85rem;
	color: var(--lm-muted);
}

/* ---------- Phone width ---------- */

@media (max-width: 767.98px) {
	.lm-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
	.lm-grid-2,
	.lm-grid-3 { grid-template-columns: minmax(0, 1fr); }

	.lm-modal .modal-content { border-radius: 0; }

	.lm-modal-header,
	.lm-modal-body { padding: 14px 16px; }

	.lm-modal-footer { padding: 10px 16px; }

	.lm-modal-subtitle { display: none; }

	.license-features-scroll { max-height: none; overflow: visible; }

	.lm-footer-actions .lm-btn { flex: 1 1 0; }
}

/* =====================================================================
   Home dashboard — design system
   ===================================================================== */

:root {
	--ds-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--ds-bg: #f6f7f9;
	--ds-surface: #ffffff;
	--ds-surface-2: #fafbfc;
	--ds-line: rgba(15, 23, 42, .08);
	--ds-line-strong: rgba(15, 23, 42, .14);

	--ds-text: #0b1220;
	--ds-text-2: #475467;
	--ds-text-3: #8a94a6;

	--ds-brand: #1d5bd8;
	--ds-brand-2: #2f6bef;
	--ds-brand-ink: #1745b0;

	--ds-act: #2563eb;
	--ds-act-rgb: 37, 99, 235;
	--ds-xfer: #d97706;
	--ds-xfer-rgb: 217, 119, 6;
	--ds-call: #0d9488;
	--ds-call-rgb: 13, 148, 136;
	--ds-key: #7c3aed;
	--ds-key-rgb: 124, 58, 237;

	--ds-up: #067647;
	--ds-up-bg: #ecfdf3;
	--ds-down: #b42318;
	--ds-down-bg: #fef3f2;

	--ds-r-sm: 8px;
	--ds-r: 12px;
	--ds-r-lg: 14px;

	--ds-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
	--ds-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--ds-shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .12);
	--ds-ring: 0 0 0 3px rgba(47, 107, 239, .28);

	--ds-ease: cubic-bezier(.2, .7, .2, 1);
	--ds-fast: .16s;
}

body {
	font-family: var(--ds-font);
	font-feature-settings: "cv11", "ss01", "ss03";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: var(--ds-text);
	background:
		radial-gradient(1200px 320px at 50% -120px, rgba(47, 107, 239, .10), transparent 70%),
		var(--ds-bg);
	background-attachment: fixed;
}

.lm-ico {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.main.lm-home {
	padding: 0;
	min-height: 100vh;
}

.lm-container {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 32px;
	box-sizing: border-box;
}

/* ---------- Top bar ---------- */

.lm-topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, .92);
	border-bottom: 1px solid var(--ds-line);
}

.lm-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 60px;
}

.lm-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.lm-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--ds-r-sm);
	color: #fff;
	background: linear-gradient(180deg, var(--ds-brand-2), var(--ds-brand));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(23, 69, 176, .35);
}

.lm-brand-mark .lm-ico {
	width: 15px;
	height: 15px;
	stroke-width: 2;
}

.lm-brand-name {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ds-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lm-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 16px 0 12px;
	border: 1px solid #1a4fc7;
	border-radius: 10px;
	font: 600 14px/1 var(--ds-font);
	letter-spacing: -.005em;
	color: #fff;
	white-space: nowrap;
	cursor: pointer;
	background: linear-gradient(180deg, var(--ds-brand-2) 0%, var(--ds-brand) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .22),
		0 1px 2px rgba(16, 24, 40, .12),
		0 4px 12px -2px rgba(29, 91, 216, .38);
	transition: transform var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease), filter var(--ds-fast) var(--ds-ease);
}

.lm-cta-plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .18);
}

.lm-cta-plus .lm-ico {
	width: 14px;
	height: 14px;
	stroke-width: 2.25;
}

.lm-cta:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .22),
		0 2px 4px rgba(16, 24, 40, .12),
		0 10px 20px -6px rgba(29, 91, 216, .5);
}

.lm-cta:active {
	transform: translateY(0);
	filter: brightness(.97);
}

.lm-cta:focus-visible {
	outline: none;
	box-shadow: var(--ds-ring), 0 4px 12px -2px rgba(29, 91, 216, .38);
}

/* ---------- Page ---------- */

.lm-page {
	padding-top: 36px;
	padding-bottom: 56px;
}

.lm-intro {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 32px;
}

.lm-greet-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--ds-r);
	border: 1px solid var(--ds-line);
	background: var(--ds-surface);
	box-shadow: var(--ds-shadow-xs);
}

.lm-greet-icon .lm-ico { width: 20px; height: 20px; }
.lm-greet-icon .is-sun  { color: #e8a317; display: none; }
.lm-greet-icon .is-moon { color: #6366f1; display: none; }
.lm-greet-icon[data-phase="day"] .is-sun,
.lm-greet-icon[data-phase="night"] .is-moon { display: block; }

.lm-greeting {
	margin: 0;
	font-size: 26px;
	font-weight: 650;
	line-height: 1.15;
	letter-spacing: -.022em;
	color: var(--ds-text);
}

.lm-date {
	margin-top: 3px;
	font-size: 14px;
	color: var(--ds-text-3);
}

/* ---------- Section head ---------- */

.lm-dash-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.lm-dash-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ds-text);
}

.lm-live-dot {
	position: relative;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #12b76a;
}

.lm-live-dot::after {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	background: rgba(18, 183, 106, .25);
	animation: lm-pulse 2.4s var(--ds-ease) infinite;
}

@keyframes lm-pulse {
	0%   { transform: scale(.6); opacity: 1; }
	70%  { transform: scale(1.6); opacity: 0; }
	100% { opacity: 0; }
}

.lm-dash-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: var(--ds-text-3);
	font-variant-numeric: tabular-nums;
}

.lm-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r-sm);
	background: var(--ds-surface);
	color: var(--ds-text-2);
	box-shadow: var(--ds-shadow-xs);
	cursor: pointer;
	transition: color var(--ds-fast), border-color var(--ds-fast);
}

.lm-icon-btn .lm-ico { width: 15px; height: 15px; }

.lm-icon-btn:hover {
	color: var(--ds-brand);
	border-color: var(--ds-line-strong);
}

.lm-icon-btn:focus-visible {
	outline: none;
	box-shadow: var(--ds-ring);
}

.lm-icon-btn.is-spinning .lm-ico {
	animation: spin .8s linear infinite;
}

/* ---------- KPI cards ---------- */

.lm-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.lm-stat {
	--accent: var(--ds-act);
	--accent-rgb: var(--ds-act-rgb);
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	padding: 18px 20px 16px;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r-lg);
	background: var(--ds-surface);
	box-shadow: var(--ds-shadow-sm);
	text-align: left;
	font-family: var(--ds-font);
	color: var(--ds-text);
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	transition: transform .2s var(--ds-ease), box-shadow .2s var(--ds-ease), border-color .2s var(--ds-ease);
}

/* accent hairline + soft corner wash on hover */
.lm-stat::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 2px;
	background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0) 75%);
	opacity: .85;
}

.lm-stat::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(420px 160px at 100% 100%, rgba(var(--accent-rgb), .07), transparent 70%);
	opacity: 0;
	transition: opacity .25s var(--ds-ease);
}

.lm-stat:hover {
	transform: translateY(-2px);
	border-color: rgba(var(--accent-rgb), .28);
	box-shadow: var(--ds-shadow-md);
}

.lm-stat:hover::after { opacity: 1; }

.lm-stat:active { transform: translateY(0); }

.lm-stat:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .28), var(--ds-shadow-sm);
}

.lm-stat-blue  { --accent: var(--ds-act);  --accent-rgb: var(--ds-act-rgb); }
.lm-stat-amber { --accent: var(--ds-xfer); --accent-rgb: var(--ds-xfer-rgb); }
.lm-stat-teal  { --accent: var(--ds-call); --accent-rgb: var(--ds-call-rgb); }
.lm-stat-violet { --accent: var(--ds-key); --accent-rgb: var(--ds-key-rgb); }

.lm-stat-top {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lm-stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: var(--ds-r-sm);
	color: var(--accent);
	background: rgba(var(--accent-rgb), .08);
	box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .16);
}

.lm-stat-icon .lm-ico { width: 16px; height: 16px; }

.lm-stat-label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13.5px;
	font-weight: 550;
	color: var(--ds-text-2);
}

.lm-stat-go {
	display: inline-flex;
	color: var(--ds-text-3);
	opacity: 0;
	transform: translate(-4px, 4px);
	transition: opacity var(--ds-fast) var(--ds-ease), transform var(--ds-fast) var(--ds-ease), color var(--ds-fast);
}

.lm-stat-go .lm-ico { width: 16px; height: 16px; }

.lm-stat:hover .lm-stat-go,
.lm-stat:focus-visible .lm-stat-go {
	opacity: 1;
	transform: none;
	color: var(--accent);
}

.lm-stat-body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 16px;
}

.lm-stat-figures {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.lm-stat-value {
	font-size: 34px;
	font-weight: 650;
	line-height: 1;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
	color: var(--ds-text);
}

.lm-stat-delta {
	min-height: 22px;
	font-size: 12.5px;
	line-height: 22px;
	color: var(--ds-text-3);
	font-variant-numeric: tabular-nums;
}

.lm-stat-delta b {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	height: 20px;
	margin-right: 4px;
	padding: 0 7px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	vertical-align: 1px;
}

.lm-stat-delta b.up   { color: var(--ds-up);   background: var(--ds-up-bg);   box-shadow: inset 0 0 0 1px rgba(6, 118, 71, .12); }
.lm-stat-delta b.down { color: var(--ds-down); background: var(--ds-down-bg); box-shadow: inset 0 0 0 1px rgba(180, 35, 24, .12); }

/* seven-day bars */
.lm-spark {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 5px;
	width: 100%;
	height: 44px;
	padding-bottom: 1px;
	border-bottom: 1px solid var(--ds-line);
	box-sizing: border-box;
}

.lm-spark-bar {
	flex: 1 1 0;
	min-height: 3px;
	border-radius: 4px 4px 1px 1px;
	background: rgba(var(--accent-rgb), .16);
	transform-origin: bottom;
	animation: lm-grow .5s var(--ds-ease) both;
	transition: background-color var(--ds-fast) var(--ds-ease);
}

.lm-spark-bar:nth-child(2) { animation-delay: .03s; }
.lm-spark-bar:nth-child(3) { animation-delay: .06s; }
.lm-spark-bar:nth-child(4) { animation-delay: .09s; }
.lm-spark-bar:nth-child(5) { animation-delay: .12s; }
.lm-spark-bar:nth-child(6) { animation-delay: .15s; }
.lm-spark-bar:nth-child(7) { animation-delay: .18s; }

.lm-stat:hover .lm-spark-bar { background: rgba(var(--accent-rgb), .24); }
.lm-stat .lm-spark-bar:hover { background: rgba(var(--accent-rgb), .5); }

.lm-spark-bar.is-today,
.lm-stat:hover .lm-spark-bar.is-today {
	background: linear-gradient(180deg, rgba(var(--accent-rgb), .8), var(--accent));
	box-shadow: 0 4px 10px -4px rgba(var(--accent-rgb), .6);
}

@keyframes lm-grow {
	from { transform: scaleY(0); }
	to   { transform: scaleY(1); }
}

/* placeholder before the first response */
.lm-spark:empty {
	border-radius: 6px 6px 0 0;
	background: linear-gradient(90deg, rgba(15, 23, 42, .03) 0%, rgba(15, 23, 42, .07) 50%, rgba(15, 23, 42, .03) 100%);
	background-size: 200% 100%;
	animation: lm-shimmer 1.2s linear infinite;
}

@keyframes lm-shimmer {
	from { background-position: 200% 0; }
	to   { background-position: -200% 0; }
}

.lm-dash-error {
	margin-top: 12px;
	padding: 10px 14px;
	border: 1px solid rgba(180, 35, 24, .16);
	border-radius: var(--ds-r-sm);
	background: var(--ds-down-bg);
	font-size: 13px;
	color: var(--ds-down);
}

/* ---------- Navigation ---------- */

.lm-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 28px;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r-lg);
	background: var(--ds-surface);
	box-shadow: var(--ds-shadow-sm);
	overflow: hidden;
}

.lm-tile {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
	padding: 18px 20px;
	border: 0;
	background: transparent;
	text-align: left;
	font-family: var(--ds-font);
	color: var(--ds-text);
	cursor: pointer;
	transition: background-color var(--ds-fast) var(--ds-ease);
}

.lm-tile + .lm-tile {
	box-shadow: -1px 0 0 var(--ds-line);
}

.lm-tile:hover {
	background: var(--ds-surface-2);
}

.lm-tile:focus-visible {
	outline: none;
	z-index: 1;
	box-shadow: inset 0 0 0 2px rgba(47, 107, 239, .45);
}

.lm-tile-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--ds-line);
	background: linear-gradient(180deg, #fff, #f4f6f9);
	color: var(--ds-text-2);
	box-shadow: var(--ds-shadow-xs);
	transition: color var(--ds-fast) var(--ds-ease), border-color var(--ds-fast) var(--ds-ease), background var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease);
}

.lm-tile:hover .lm-tile-icon {
	color: #fff;
	border-color: #1a4fc7;
	background: linear-gradient(180deg, var(--ds-brand-2), var(--ds-brand));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 10px -3px rgba(29, 91, 216, .45);
}

.lm-tile-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.lm-tile-title {
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--ds-text);
}

.lm-tile-sub {
	font-size: 13px;
	color: var(--ds-text-3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lm-tile-arrow {
	color: var(--ds-text-3);
	opacity: .7;
	transition: transform var(--ds-fast) var(--ds-ease), color var(--ds-fast) var(--ds-ease), opacity var(--ds-fast);
}

.lm-tile:hover .lm-tile-arrow {
	color: var(--ds-brand);
	opacity: 1;
	transform: translateX(3px);
}

/* ---------- Entrance ---------- */

.lm-enter {
	animation: lm-rise .45s var(--ds-ease) both;
	animation-delay: calc(var(--i, 0) * 50ms);
}

@keyframes lm-rise {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.lm-enter,
	.lm-spark-bar,
	.lm-live-dot::after { animation: none; }
	.lm-stat,
	.lm-cta { transition: none; }
}

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

@media (max-width: 900px) {
	.lm-container { padding: 0 20px; }
	.lm-stats { gap: 12px; }
	.lm-stat { padding: 16px 16px 14px; }
	.lm-stat-value { font-size: 30px; }
	.lm-tiles { grid-template-columns: minmax(0, 1fr); }
	.lm-tile + .lm-tile { box-shadow: 0 -1px 0 var(--ds-line); }
}

@media (max-width: 700px) {
	.lm-stats { grid-template-columns: minmax(0, 1fr); }

	/* figures left, bars right */
	.lm-stat-body {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
		gap: 16px;
		margin-top: 14px;
	}

	.lm-spark {
		flex: 0 0 44%;
		width: auto;
		height: 48px;
	}

	.lm-stat-go { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
	.lm-container { padding: 0 16px; }
	.lm-topbar-inner { height: 56px; gap: 10px; }
	.lm-brand-mark { width: 26px; height: 26px; }
	.lm-brand-name { max-width: 140px; font-size: 10.5px; line-height: 1.3; letter-spacing: .07em; white-space: normal; }
	.lm-cta { height: 36px; padding: 0 12px 0 9px; font-size: 13.5px; gap: 6px; }
	.lm-page { padding-top: 24px; padding-bottom: 40px; }
	.lm-intro { margin-bottom: 24px; gap: 12px; }
	.lm-greet-icon { width: 40px; height: 40px; }
	.lm-greeting { font-size: 22px; }
	.lm-date { font-size: 13px; }
	.lm-tile { padding: 16px; }
}

/* narrow phones: back to stacked figures so the comparison never wraps */
@media (max-width: 420px) {
	.lm-stat-body {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.lm-spark {
		flex: none;
		width: 100%;
		height: 40px;
	}
}

/* ---------- Persistent section nav (same as backend/pages.css .pg-nav) ---------- */

.lm-topbar .lm-topbar-inner { max-width: 1280px; justify-content: flex-start; }
.lm-topbar .lm-cta { margin-left: auto; }

.lm-nav {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: 28px;
	padding: 3px;
	border: 1px solid var(--ds-line);
	border-radius: 10px;
	background: var(--ds-surface-2);
}

.lm-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 12px;
	border-radius: 7px;
	font-size: 13.5px;
	font-weight: 550;
	color: var(--ds-text-2);
	text-decoration: none;
	white-space: nowrap;
	transition: color .15s var(--ds-ease), background-color .15s var(--ds-ease);
}

.lm-nav-link .lm-ico { width: 16px; height: 16px; }
.lm-nav-link:hover { color: var(--ds-text); background: rgba(15, 23, 42, .04); }

.lm-nav-link.is-active {
	color: var(--ds-text);
	background: var(--ds-surface);
	box-shadow: var(--ds-shadow-sm), inset 0 0 0 1px var(--ds-line);
}

.lm-nav-link:focus-visible { outline: none; box-shadow: var(--ds-ring); }

@media (max-width: 1040px) {
	.lm-topbar .lm-brand-name { display: none; }
}

@media (max-width: 900px) {
	.lm-nav-link.is-home span { display: none; }
}

@media (max-width: 720px) {
	.lm-topbar .lm-topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
	.lm-topbar .lm-brand-name { display: block; }
	.lm-nav { order: 3; flex: 1 0 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
	.lm-nav::-webkit-scrollbar { display: none; }
	.lm-topbar .lm-brand { flex: 1 1 0; }
	.lm-nav-link { flex: 1 0 auto; justify-content: center; padding: 0 8px; font-size: 12.5px; }
}
@media (max-width: 480px) {
	.lm-nav-link:not(.is-home) .lm-ico { display: none; }
}

/* top bar identical to the list pages (backend/pages.css) so it doesn't shift between pages */
.lm-topbar .lm-topbar-inner { max-width: none; }
.lm-topbar .lm-brand-name { line-height: 1.25; }
.lm-topbar .lm-brand-mark { flex: 0 0 auto; }

/* four KPI cards: 4 across on wide screens, 2x2 in between, stacked on phones */
.lm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) and (min-width: 701px) { .lm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .lm-stats { grid-template-columns: minmax(0, 1fr); } }

/* SolidCAM sign as the brand mark (same rule in backend/pages.css) */
.lm-brand-mark.is-logo { width: 32px; height: 32px; background: none; box-shadow: none; border-radius: 0; }
.lm-brand-mark.is-logo img { display: block; width: 100%; height: 100%; }
@media (max-width: 480px) { .lm-brand-mark.is-logo { width: 30px; height: 30px; } }

/* ---------- Big clock + last update (dashboard header) ---------- */

.lm-intro .lm-clock {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	margin-left: auto;
	text-align: right;
}

.lm-clock-time {
	font-size: 64px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -.04em;
	color: var(--ds-text);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum", "cv11", "ss01";
}

.lm-clock-colon { position: relative; top: -.06em; margin: 0 .02em; animation: lm-blink 2s steps(1) infinite; }
@keyframes lm-blink { 50% { opacity: .25; } }

.lm-clock-updated {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border: 1px solid var(--ds-line);
	border-radius: 999px;
	background: var(--ds-surface);
	box-shadow: var(--ds-shadow-xs);
	font-size: 15px;
	font-weight: 550;
	color: var(--ds-text-2);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.lm-clock-updated .lm-live-dot { margin: 0; }
.lm-clock-updated.is-stale { color: #b42318; border-color: rgba(180, 35, 24, .2); background: #fef3f2; }
.lm-clock-updated.is-stale .lm-live-dot { background: #f04438; }
.lm-clock-updated.is-stale .lm-live-dot::after { display: none; }

@media (max-width: 700px) {
	.lm-intro { flex-wrap: wrap; }
	.lm-intro .lm-clock { flex: 1 0 100%; flex-direction: row; align-items: center; justify-content: space-between; margin: 6px 0 0; }
	.lm-clock-time { font-size: 48px; }
	.lm-clock-updated { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) { .lm-clock-colon { animation: none; } }

/* chart bars: the whole column is the hover target for the day tooltip */
.lm-spark-bar { position: relative; }
.lm-spark-bar::before { content: ""; position: absolute; left: -2.5px; right: -2.5px; bottom: 0; height: 44px; }
