/* Mindwalker brand theme for Frappe Desk (user decision 2026-11-17).
 *
 * Tokens follow Mindwalker UI (https://ui.hokacristian.com, "Bento Sorot"): cool neutral greys (hue 258),
 * Plus Jakarta Sans, monochrome primary buttons (Frappe's --primary already is). The accent (links, focus,
 * active menu, progress, blue pills) is the logo blue instead of Mindwalker UI's default garnet.
 * Only Espresso / legacy CSS variables are overridden, loaded after Desk's own CSS (app_include_css), so
 * Frappe / ERPNext code is untouched. Light and dark (Frappe's [data-theme="dark"]).
 */

@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: italic;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-italic-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: italic;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-italic-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme="light"] {
	--font-stack: "Plus Jakarta Sans", "InterVariable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", sans-serif;

	/* Neutrals: Mindwalker UI greys (bg 0.945, fill 0.958, border 0.91, fg 0.21, muted 0.45) on Espresso's scale */
	--gray-50: oklch(0.976 0.003 258);
	--gray-100: oklch(0.958 0.004 258);
	--gray-200: oklch(0.915 0.005 258);
	--gray-300: oklch(0.87 0.006 258);
	--gray-400: oklch(0.78 0.007 258);
	--gray-500: oklch(0.66 0.008 258);
	--gray-600: oklch(0.55 0.01 258);
	--gray-700: oklch(0.45 0.012 258);
	--gray-800: oklch(0.33 0.012 258);
	--gray-900: oklch(0.21 0.012 258);
	--gray-950: oklch(0.15 0.01 258);

	/* Blue = the logo (#0f3faa navy, #1e73ff blue, #38bdf8 sky) */
	--blue-50: #eef5ff;
	--blue-100: #dceaff;
	--blue-200: #bdd6ff;
	--blue-300: #93bbff;
	--blue-400: #5c97ff;
	--blue-500: #1e73ff;
	--blue-600: #1660e8;
	--blue-700: #124fc4;
	--blue-800: #0f3faa;
	--blue-900: #0d3384;
	--blue-950: #0a2352;

	--mw-accent: #1e73ff;
	--mw-accent-ink: #1660e8;
	--mw-accent-soft: #e8f0ff;
	--mw-page: oklch(0.945 0.004 258);

	--surface-sidebar: var(--mw-page);
	--surface-alpha-sidebar: var(--mw-page);
	--sidebar-select-color: var(--mw-accent-soft);
	--brand-color: var(--mw-accent);
	--progress-bar-bg: var(--mw-accent);
	--focus-default: 0 0 0 2px rgb(30 115 255 / 0.35);
	--focus-outline-default: 2px solid rgb(30 115 255 / 0.45);
	--focus-blue: var(--focus-default);
	--focus-outline-blue: var(--focus-outline-default);
}

[data-theme="dark"],
.dark {
	/* Mindwalker UI dark: bg 0.145, surface 0.2, fill 0.25, border 0.29, fg 0.96, muted 0.74 */
	--gray-50: oklch(0.97 0.003 258);
	--gray-100: oklch(0.93 0.004 258);
	--gray-200: oklch(0.78 0.007 258);
	--gray-300: oklch(0.7 0.008 258);
	--gray-400: oklch(0.6 0.008 258);
	--gray-450: oklch(0.48 0.008 258);
	--gray-500: oklch(0.4 0.008 258);
	--gray-600: oklch(0.34 0.008 258);
	--gray-700: oklch(0.29 0.008 258);
	--gray-800: oklch(0.25 0.007 258);
	--gray-900: oklch(0.2 0.006 258);
	--gray-950: oklch(0.145 0.005 258);

	--blue-50: #dbe8ff;
	--blue-100: #bcd4ff;
	--blue-200: #93bbff;
	--blue-300: #6ea2ff;
	--blue-400: #4d8cff;
	--blue-500: #3a7bf0;
	--blue-600: #2c66d6;
	--blue-700: #2153b0;
	--blue-800: #1a4188;
	--blue-900: #15335f;
	--blue-950: #0f2442;

	--mw-accent: #6ea2ff;
	--mw-accent-ink: #93bbff;
	--mw-accent-soft: rgb(110 162 255 / 0.16);
	--mw-page: oklch(0.145 0.005 258);

	--surface-sidebar: var(--mw-page);
	--surface-alpha-sidebar: var(--mw-page);
	--sidebar-select-color: var(--mw-accent-soft);
	--brand-color: var(--mw-accent);
	--progress-bar-bg: var(--mw-accent);
	--focus-default: 0 0 0 3px rgb(110 162 255 / 0.35);
	--focus-outline-default: 3px solid rgb(110 162 255 / 0.45);
	--focus-blue: var(--focus-default);
	--focus-outline-blue: var(--focus-outline-default);
}

/* Active menu item: accent text on a soft accent fill */
.active-sidebar .item-anchor,
.active-sidebar .item-anchor .sidebar-item-label,
.active-sidebar .item-anchor svg {
	color: var(--mw-accent-ink) !important;
	--icon-stroke: var(--mw-accent-ink);
}

/* Links inside text (comments, timeline, rich text) take the accent; buttons stay monochrome */
.ql-editor a,
.timeline-content a:not(.btn),
.comment-content a,
.form-dashboard a.badge-link,
.markdown-preview a {
	color: var(--mw-accent-ink);
}

/* Login page (website bundle): brand font and accent */
body[data-path="login"],
body.login-page {
	font-family: var(--font-stack);
}

/* Frappe's letter-spacing (0.01-0.02em on 111 text styles) is tuned for Inter; with Plus Jakarta Sans it hides the
   gaps between words ("Ikhwan Nasution" read as one word). Normal tracking + a touch of word spacing instead. */
* {
	letter-spacing: normal !important;
}
body {
	word-spacing: 0.06em;
}
input,
textarea,
select,
button {
	word-spacing: inherit;
}

/* Login page: the logo carries "mindwalker.ai", show it large enough to read */
.page-card-head img.app-logo {
	height: 64px !important;
	max-height: none !important;
	width: auto !important;
}

/* ---------------------------------------------------------------------------------------------------------------
 * "Bento Sorot" layout (Mindwalker UI, 2026-11-18), from the library's component sources (ui.hokacristian.com/r/*.json):
 *   Panel   = bg-surface, rounded-xl, shadow-panel, p-[18px], title 15px medium -0.012em
 *   Stat    = text-[40px] font-extralight leading-none tracking-[-0.05em] tabular-nums, label text-xs fg-muted
 *   Button  = rounded-pill; primary bg-fg / text-surface; secondary bg-fill
 *   Sidebar = items h-9 rounded-pill px-3 text-[13px] fg-muted, on the bg canvas
 *   Topbar  = sticky, bg-bg/85 backdrop-blur
 *   Status  = coloured dot + text, no coloured pill;  hl = one highlight per screen (progress bar, switch)
 * Desk content sits in white panels on the grey canvas; nothing here changes Desk behaviour.
 * ------------------------------------------------------------------------------------------------------------- */

:root,
[data-theme="light"] {
	--mw-surface: oklch(1 0 258);
	--mw-hl: oklch(0.64 0.16 298); /* lilac */
	--mw-hl-fg: oklch(0.2 0.03 298);
	--mw-radius-panel: 14px;
	--mw-shadow-panel: 0 1px 2px oklch(0.21 0.012 258 / 0.05), 0 0 0 1px oklch(0.21 0.012 258 / 0.04);
	--progress-bar-bg: var(--mw-hl);
}
[data-theme="dark"],
.dark {
	--mw-surface: oklch(0.2 0.006 258);
	--mw-hl: oklch(0.88 0.16 98); /* sulfur */
	--mw-hl-fg: oklch(0.2 0.03 98);
	--mw-shadow-panel: 0 0 0 1px oklch(0.29 0.007 258);
	--progress-bar-bg: var(--mw-hl);
}

/* Canvas: the whole desk page is the grey bg; the page head floats on it like the Topbar */
body,
.page-container {
	background-color: var(--mw-page);
}
.page-container .page-head {
	background-color: color-mix(in oklch, var(--mw-page) 85%, transparent) !important;
	backdrop-filter: blur(4px);
	border-bottom: 0 !important;
}

/* Panels: the main section (list, form, report, workspace) and the form's right sidebar */
.page-container .page-content .layout-main-section {
	background-color: var(--mw-surface);
	border-radius: var(--mw-radius-panel);
	box-shadow: var(--mw-shadow-panel);
	margin-top: 8px;
	margin-bottom: 16px;
}
.page-container .page-content .layout-main-section .page-form,
.page-container .page-content .layout-main-section .form-layout,
.page-container .page-content .layout-main-section .std-form-layout {
	background-color: transparent;
}
.page-container .page-content .layout-main-section .list-page-form {
	border-radius: var(--mw-radius-panel) var(--mw-radius-panel) 0 0;
}
.page-container .page-content .layout-side-section .form-sidebar {
	background-color: var(--mw-surface);
	border-radius: var(--mw-radius-panel);
	box-shadow: var(--mw-shadow-panel);
	margin: 8px 0 16px 12px;
	padding: 6px 14px;
}
.page-container .page-content .layout-side-section .form-sidebar .sidebar-section:last-child {
	border-bottom: 0;
}
/* list header row: fill 55% on surface, softer separators (Espresso surface/outline tokens flip with the theme) */
.page-container .list-row-head,
.page-container .list-row-head .level-right {
	background-color: color-mix(in oklch, var(--surface-gray-2) 55%, var(--mw-surface)) !important;
}
.page-container .list-row-container,
.page-container .list-row-head {
	border-color: color-mix(in oklch, var(--outline-gray-2) 65%, transparent) !important;
}
/* the sticky right column of each row must match the panel, not the canvas */
.page-container .list-row-container .list-row .level-right {
	background-color: var(--mw-surface);
}

/* Buttons: pills; primary stays monochrome */
.btn,
.btn-group > .btn:first-child,
.btn-group > .btn:last-child {
	border-radius: 999px;
}
.btn-group > .btn:not(:first-child):not(:last-child) {
	border-radius: 0;
}
.btn-group > .btn:first-child:not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child) {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

/* Left sidebar: 36px pills, 13px, the active one a white pill on the canvas with the accent text */
.body-sidebar .item-anchor,
.body-sidebar .standard-sidebar-item {
	border-radius: 999px !important;
}
.body-sidebar .active-sidebar,
.body-sidebar .active-sidebar .item-anchor {
	background-color: var(--mw-surface) !important;
	box-shadow: var(--mw-shadow-panel);
	border-radius: 999px !important;
}

/* Status: coloured dot + text, no coloured pill (v16 renders status as .es-badge; scoped to list rows and page titles
   so count badges elsewhere keep their pill) */
.list-row-container .es-badge:not([data-variant="solid"]),
.page-head .es-badge:not([data-variant="solid"]) {
	background: transparent;
	border-color: transparent;
	padding-inline: 0;
	gap: 6px;
	font-weight: 500;
}
.list-row-container .es-badge:not([data-variant="solid"])::before,
.page-head .es-badge:not([data-variant="solid"])::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background-color: currentColor;
	flex-shrink: 0;
}
/* the timeline's "Activity" title sits on the canvas, below the form panel */
.new-timeline .activity-title,
.new-timeline .timeline-actions {
	background-color: transparent;
}
.indicator-pill {
	background-color: transparent !important;
	padding-left: 0 !important;
	font-weight: 500;
}

/* Stat numerals: large and thin (workspace number cards) */
.number-card .widget-content .number,
.widget.number-widget-box .number {
	font-size: 40px !important;
	font-weight: 200 !important;
	line-height: 1 !important;
	letter-spacing: -0.05em !important;
	font-variant-numeric: tabular-nums;
}

/* Workspace widgets and dashboard cards as panels */
.widget.shortcut-widget-box,
.widget.links-widget-box,
.widget.number-widget-box,
.widget.dashboard-widget-box,
.frappe-card {
	border-radius: var(--mw-radius-panel) !important;
	box-shadow: var(--mw-shadow-panel);
}

/* Highlight: switches when on use the one highlight colour */
.frappe-control input[type="checkbox"].switch:checked,
.switch input:checked + .slider {
	background-color: var(--mw-hl) !important;
}
