/* ezmes Desk chrome.

 * WHAT THIS FILE IS FOR
 *   Tokens our Custom HTML Block panels read (--ez-*), and the machine-state
 *   chips we draw. It restyles NOTHING of Frappe's own chrome.
 *
 * 2026-09-04 D-320 — Desk chrome back to stock Frappe (Mohan).
 *   The 44px control floor, focus ring and transitions on .btn/.form-control
 *   were removed; --ez-target-desk / --ez-focus-desk stay as tokens for our
 *   own panels only. Frappe's controls now render exactly as Frappe ships them.
 *
 * 2026-08-31 D-314 — kit orange remap WITHDRAWN.
 *   The :root remap of Frappe --primary / --btn-primary / --bg-color /
 *   --green-500 / border-radius onto brand-kit hex (#D46A1F orange, kit
 *   status greens, 4px radius) is the look Mohan called "not good at all".
 *   Brand kit v5 = marks (navbar / login / favicon / workspace icons). It
 *   does not paint Desk chrome.
 *
 * Raven (read 2026-08-31, local copy /Users/mohanrachuri/code/raven):
 *   SPA ThemeProvider (App.tsx:204, ThemeProvider.tsx:17/27):
 *     accentColor = 'iris'  → Radix iris-9 #5B5BD6 (measured unpkg
 *                             @radix-ui/colors@3.0.0 iris.css)
 *     light chrome          → #FFFFFF
 *     dark chrome           → #191919
 *   Desk-embedded CSS (raven/public/scss/chat.scss) consumes Frappe's own
 *     --border-color, --control-bg, --gray-8. It does NOT remap --primary.
 *   Stealing iris onto Frappe --primary is the same remap class that failed.
 *   Radix is refused in Desk (D-091, D-309). So: Frappe defaults for chrome.
 *
 * Machine state stays Okabe-Ito (D-296). Those tokens drive OUR .ez-state
 * chips, not Frappe's --green-500.
 */

:root {
	--ez-target-desk: 44px;
	--ez-text-desk-sm: 13px;
	--ez-text-desk: 14px;
	--ez-line-desk: 1.5;
	--ez-space-1: 4px;
	--ez-space-2: 8px;
	--ez-space-3: 12px;
	--ez-space-4: 16px;
	--ez-space-5: 24px;
	--ez-space-6: 32px;
	--ez-radius-1: 4px;
	--ez-dur-fast: 120ms;
	--ez-dur: 200ms;

	/* Named for OUR panels. Frappe already bundles Inter. We do not remap
	 * --font-stack / --primary / --bg-color onto these. */
	--ez-font: "Inter", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
		system-ui, sans-serif;

	/* Kit hex kept as named tokens for print / SVG that already reference
	 * them. Not remapped onto Frappe chrome. */
	--ez-brand-charcoal: #2B2F33;
	--ez-brand-grey: #6B7177;
	--ez-brand-orange: #D46A1F;
	--ez-brand-grey-light: #E6E8EB;
	--ez-brand-off-white: #F5F6F7;

	/* Okabe-Ito machine state — D-296. Not Frappe status. */
	--ez-state-run: #009e73;
	--ez-state-run-fg: #000000;
	--ez-state-idle: #6b7280;
	--ez-state-idle-fg: #ffffff;
	--ez-state-setup: #0072b2;
	--ez-state-setup-fg: #ffffff;
	--ez-state-down: #d55e00;
	--ez-state-down-fg: #000000;
	--ez-state-alarm: #d32f2f;
	--ez-state-alarm-fg: #ffffff;
	--ez-state-planned: #e69f00;
	--ez-state-planned-fg: #000000;
	--ez-state-hold: #cc79a7;
	--ez-state-hold-fg: #000000;
	--ez-state-nodata: #3f4348;
	--ez-state-nodata-fg: #9ca3af;

	--ez-focus-desk: 0 0 0 3px var(--ez-state-setup);
}

/* ---- State chips for ezmes reports/dashboards rendered in Desk ----------
 * D-095 rule 4: never colour alone. */
.ez-state {
	display: inline-flex;
	align-items: center;
	gap: var(--ez-space-2);
	padding: var(--ez-space-1) var(--ez-space-3);
	border-radius: var(--ez-radius-1);
	font-weight: 600;
	font-size: var(--ez-text-desk-sm);
	line-height: var(--ez-line-desk);
}

.ez-state--run {
	background: var(--ez-state-run);
	color: var(--ez-state-run-fg);
}

.ez-state--idle {
	background: var(--ez-state-idle);
	color: var(--ez-state-idle-fg);
	border: 1px solid var(--border-color, #e5e5e5);
}

.ez-state--setup {
	background: var(--ez-state-setup);
	color: var(--ez-state-setup-fg);
}

.ez-state--down {
	background: var(--ez-state-down);
	color: var(--ez-state-down-fg);
	border-left: 6px solid var(--text-color, #1a1a1a);
}

.ez-state--alarm {
	background: var(--ez-state-alarm);
	color: var(--ez-state-alarm-fg);
}

.ez-state--planned {
	background: repeating-linear-gradient(
		45deg,
		var(--ez-state-planned),
		var(--ez-state-planned) 6px,
		#f5c451 6px,
		#f5c451 12px
	);
	color: var(--ez-state-planned-fg);
}

.ez-state--hold {
	background: var(--ez-state-hold);
	color: var(--ez-state-hold-fg);
}

.ez-state--nodata {
	background-color: var(--ez-state-nodata);
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 4px,
		rgb(255 255 255 / 0.18) 4px,
		rgb(255 255 255 / 0.18) 8px
	);
	color: var(--ez-state-nodata-fg);
}

/* Sidebar header mark — NOT SOLVED. frappe.utils.desktop_icon() has no image
 * branch. Needs v16.33 (D-283) or a client override we refuse. Logo IS ours
 * on navbar + login via branding.py, not this file. */

/* ---- Route strip on Work Order / Job Card forms (public/js/route_strip.js)
 * D-095: state is text + shape (✓ ▶ ·), never colour alone. */
.ez-route { font-size: var(--ez-text-desk); line-height: var(--ez-line-desk); }
.ez-route__head { margin-bottom: var(--ez-space-2); }
.ez-route__strip { display: flex; flex-wrap: wrap; gap: var(--ez-space-1); }
.ez-route-cell {
	display: flex; flex-direction: column; justify-content: center;
	min-height: var(--ez-target-desk); min-width: 120px; flex: 1 1 0;
	padding: var(--ez-space-1) var(--ez-space-3);
	border: 1px solid var(--border-color, #e5e5e5); border-radius: var(--ez-radius-1);
	color: var(--text-color, #1a1a1a); text-decoration: none; background: var(--card-bg, #fff);
}
.ez-route-cell:hover { text-decoration: none; border-color: var(--ez-brand-grey); }
.ez-route-cell__op { font-weight: 500; }
.ez-route-cell__state { font-size: var(--ez-text-desk-sm); color: var(--text-muted, #6b7177); }
.ez-route-cell--done { background: var(--ez-brand-off-white); }
.ez-route-cell--now { font-weight: 700; border: 2px solid var(--ez-brand-orange); }
.ez-route-cell--now .ez-route-cell__state { color: var(--ez-brand-orange); }
.ez-route-cell--this { outline: 2px dashed var(--ez-brand-charcoal); outline-offset: 2px; }
.ez-route-msg {
	padding: var(--ez-space-3); border-radius: var(--ez-radius-1);
	background: var(--ez-brand-off-white); color: var(--text-muted, #6b7177);
	font-size: var(--ez-text-desk); font-style: italic;
}
.ez-route-msg--err { border-left: 4px solid var(--ez-state-down); font-style: normal; }
