/* Komposix product themes. One class picks the product: on <html> in Desk (komposix.js, from boot),
   on <body> in web pages and the login page (site config website_context.body_class).
   Surfaces are themed in light mode only; in dark mode only the brand accents change. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&family=Nunito:wght@400;600;700;800;900&family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Source+Sans+3:wght@400;500;600;700&family=Lora:wght@500;600;700&family=Lato:wght@400;700;900&family=Manrope:wght@400;500;600;700;800&display=swap");

/* ---------- tokens per product ---------- */
.kx-hrms {
	--kx-brand: #6d28d9; --kx-brand-2: #f97360; --kx-brand-ink: #ffffff;
	--kx-tint: #f6f3ff; --kx-tint-2: #ede7fe; --kx-sidebar: #f3effe; --kx-sidebar-ink: #3b1d7a;
	--kx-font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; --kx-head: var(--kx-font);
	--kx-radius: 14px; --kx-radius-btn: 999px;
	--kx-hero: linear-gradient(135deg, #6d28d9 0%, #a855f7 55%, #f97360 100%);
}
.kx-business {
	--kx-brand: #1e3a8a; --kx-brand-2: #c99a2e; --kx-brand-ink: #ffffff;
	--kx-tint: #f5f7fb; --kx-tint-2: #e6ecf8; --kx-sidebar: #0f1d45; --kx-sidebar-ink: #dbe4ff;
	--kx-font: "IBM Plex Sans", system-ui, sans-serif; --kx-head: var(--kx-font);
	--kx-radius: 4px; --kx-radius-btn: 4px;
	--kx-hero: linear-gradient(120deg, #0f1d45 0%, #1e3a8a 70%, #c99a2e 140%);
}
.kx-restaurant {
	--kx-brand: #c2410c; --kx-brand-2: #f59e0b; --kx-brand-ink: #ffffff;
	--kx-tint: #fff8ef; --kx-tint-2: #ffedd5; --kx-sidebar: #fff1e0; --kx-sidebar-ink: #7c2d12;
	--kx-font: "Nunito", system-ui, sans-serif; --kx-head: var(--kx-font);
	--kx-radius: 18px; --kx-radius-btn: 12px;
	--kx-hero: linear-gradient(135deg, #9a3412 0%, #c2410c 45%, #f59e0b 100%);
}
.kx-education {
	--kx-brand: #0f766e; --kx-brand-2: #4338ca; --kx-brand-ink: #ffffff;
	--kx-tint: #f2f8f7; --kx-tint-2: #dcefec; --kx-sidebar: #e8f3f1; --kx-sidebar-ink: #134e4a;
	--kx-font: "Source Sans 3", system-ui, sans-serif; --kx-head: "Fraunces", Georgia, serif;
	--kx-radius: 10px; --kx-radius-btn: 8px;
	--kx-hero: linear-gradient(135deg, #134e4a 0%, #0f766e 50%, #4338ca 110%);
}
.kx-legal {
	--kx-brand: #7f1d1d; --kx-brand-2: #a16207; --kx-brand-ink: #fffaf0;
	--kx-tint: #fbf8f1; --kx-tint-2: #f3ecdc; --kx-sidebar: #2b1414; --kx-sidebar-ink: #f3e7d3;
	--kx-font: "Lato", system-ui, sans-serif; --kx-head: "Lora", Georgia, serif;
	--kx-radius: 2px; --kx-radius-btn: 2px;
	--kx-hero: linear-gradient(120deg, #2b1414 0%, #7f1d1d 75%, #a16207 140%);
}
.kx-pharma {
	--kx-brand: #047857; --kx-brand-2: #0891b2; --kx-brand-ink: #ffffff;
	--kx-tint: #f3faf8; --kx-tint-2: #d9f2ea; --kx-sidebar: #ffffff; --kx-sidebar-ink: #064e3b;
	--kx-font: "Manrope", system-ui, sans-serif; --kx-head: var(--kx-font);
	--kx-radius: 8px; --kx-radius-btn: 8px;
	--kx-hero: linear-gradient(120deg, #064e3b 0%, #047857 50%, #0891b2 100%);
}

/* ---------- map tokens onto Frappe's ---------- */
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) {
	--primary: var(--kx-brand);
	--primary-color: var(--kx-brand);
	--brand-color: var(--kx-brand);
	--btn-primary: var(--kx-brand);
	--border-primary: var(--kx-brand);
	--checkbox-color: var(--kx-brand);
	--ink-blue-link: var(--kx-brand);
	--font-stack: var(--kx-font);
	--radius: var(--kx-radius);
	--radius-md: var(--kx-radius);
	--radius-lg: calc(var(--kx-radius) + 4px);
	--border-radius: var(--kx-radius);
	--border-radius-md: var(--kx-radius);
	--border-radius-lg: calc(var(--kx-radius) + 4px);
	font-family: var(--kx-font);
}
html:not([data-theme="dark"]):is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma),
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) {
	--bg-color: var(--kx-tint);
	--surface-sidebar: var(--kx-sidebar);
	--navbar-bg: var(--kx-sidebar);
	--sidebar-select-color: var(--kx-tint-2);
}
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .btn.btn-primary {
	background: var(--kx-brand);
	color: var(--kx-brand-ink);
	border-radius: var(--kx-radius-btn);
	--icon-stroke: currentColor;
}
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .btn.btn-primary:hover {
	filter: brightness(1.08);
}
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .btn {
	border-radius: var(--kx-radius-btn);
}
:is(.kx-education, .kx-legal) :is(.page-title .title-text, h1, h2, h3, .kx-hero h1, .ce-header) {
	font-family: var(--kx-head);
	letter-spacing: 0;
}
:is(.kx-education, .kx-legal) .page-title .title-text { font-weight: 600; }

/* Dark sidebars (Ledger, Counsel) in light mode */
html:not([data-theme="dark"]):is(.kx-business, .kx-legal) :is(.body-sidebar, .body-sidebar-container, .dock) {
	--ink-gray-5: color-mix(in srgb, var(--kx-sidebar-ink) 70%, transparent);
	--ink-gray-6: color-mix(in srgb, var(--kx-sidebar-ink) 80%, transparent);
	--ink-gray-7: var(--kx-sidebar-ink);
	--ink-gray-8: var(--kx-sidebar-ink);
	--ink-gray-9: #ffffff;
	--text-color: var(--kx-sidebar-ink);
	--icon-stroke: var(--kx-sidebar-ink);
	--sidebar-select-color: rgba(255, 255, 255, 0.12);
	--surface-gray-2: rgba(255, 255, 255, 0.1);
	--surface-gray-3: rgba(255, 255, 255, 0.14);
	--outline-gray-1: rgba(255, 255, 255, 0.12);
	--border-color: rgba(255, 255, 255, 0.12);
	--surface-white: rgba(255, 255, 255, 0.14);
	--surface-base: rgba(255, 255, 255, 0.14);
	--surface-menu-bar: transparent;
	color: var(--kx-sidebar-ink);
	background: var(--kx-sidebar);
}

/* ---------- login page ---------- */
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) {
	background: var(--kx-tint);
	font-family: var(--kx-font);
}
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .for-login,
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .for-forgot,
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .for-signup {
	position: relative;
}
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .page-card {
	border-radius: calc(var(--kx-radius) + 4px);
	border: 1px solid var(--kx-tint-2);
	box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--kx-brand) 45%, transparent);
	background: #fff;
}
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .page-card-head h4 {
	font-family: var(--kx-head);
	color: var(--kx-brand);
	font-weight: 700;
}
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .btn-login,
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .btn-primary {
	background: var(--kx-brand);
	border-color: var(--kx-brand);
	color: var(--kx-brand-ink);
	border-radius: var(--kx-radius-btn);
}
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) main::before {
	content: "";
	position: fixed;
	inset: 0 0 auto 0;
	height: 42vh;
	background: var(--kx-hero);
	z-index: -1;
}
body.kx-legal main::before { height: 34vh; }
body:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .navbar { background: transparent; border: 0; }

/* ---------- Komposix home page (page kx-home) ---------- */
.kx-home { max-width: 1180px; margin: 0 auto; padding: 8px 4px 48px; font-family: var(--kx-font); }
.kx-hero {
	background: var(--kx-hero);
	color: #fff;
	border-radius: calc(var(--kx-radius) + 6px);
	padding: 32px 36px;
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 28px;
	align-items: center;
	box-shadow: 0 20px 50px -28px color-mix(in srgb, var(--kx-brand) 70%, black);
}
.kx-hero .kx-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; font-weight: 700; opacity: 0.8; }
.kx-hero h1 { font-family: var(--kx-head); font-size: 30px; line-height: 1.15; margin: 8px 0 8px; color: #fff; font-weight: 700; }
.kx-hero p { margin: 0; opacity: 0.9; font-size: 15px; }
.kx-ask { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--kx-radius); padding: 16px; backdrop-filter: blur(6px); }
.kx-ask .kx-ask-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.kx-ask .kx-chip {
	display: block; width: 100%; text-align: left; margin-top: 6px; padding: 8px 12px;
	background: rgba(255, 255, 255, 0.95); color: var(--kx-brand); border: 0; border-radius: var(--kx-radius-btn);
	font-weight: 600; font-size: 13px; cursor: pointer;
}
.kx-ask .kx-chip:hover { background: #fff; transform: translateY(-1px); }
.kx-section-title { font-family: var(--kx-head); font-weight: 700; font-size: 15px; margin: 28px 0 12px; color: var(--heading-color); }
.kx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kx-card {
	background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--kx-radius);
	padding: 16px; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; position: relative; overflow: hidden;
}
.kx-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--kx-brand); opacity: 0.85; }
.kx-card:nth-child(even)::before { background: var(--kx-brand-2); }
.kx-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--kx-brand) 60%, transparent); }
.kx-card .kx-num { font-size: 28px; font-weight: 800; color: var(--heading-color); font-variant-numeric: tabular-nums; }
.kx-card .kx-lbl { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.kx-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.kx-link {
	display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
	background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--kx-radius);
	color: var(--text-color); font-weight: 600; font-size: 13px; text-decoration: none !important;
}
.kx-link:hover { border-color: var(--kx-brand); color: var(--kx-brand); }
.kx-link span.kx-arrow { color: var(--kx-brand); }
.kx-legal .kx-hero { border-radius: 2px; border-top: 4px solid #a16207; }
.kx-restaurant .kx-card .kx-num { color: var(--kx-brand); }
.kx-business .kx-card .kx-num { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
@media (max-width: 760px) {
	.kx-hero { grid-template-columns: 1fr; padding: 22px; }
	.kx-hero h1 { font-size: 24px; }
}

/* v16 Espresso buttons (login page, dialogs, new Desk components) */
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .es-button {
	--bt-solid-bg: var(--kx-brand);
	--bt-solid-bg-hover: color-mix(in srgb, var(--kx-brand) 86%, black);
	--bt-solid-bg-active: color-mix(in srgb, var(--kx-brand) 76%, black);
	--bt-solid-fg: var(--kx-brand-ink);
	border-radius: var(--kx-radius-btn);
}

/* the icon dock: brand tint on every product; the active app in the brand colour */
html:not([data-theme="dark"]):is(.kx-hrms, .kx-restaurant, .kx-education, .kx-pharma) .dock { background: var(--kx-sidebar); }
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .dock-item.active,
:is(.kx-hrms, .kx-business, .kx-restaurant, .kx-education, .kx-legal, .kx-pharma) .dock-item[aria-current] {
	background: color-mix(in srgb, var(--kx-brand) 18%, transparent);
	color: var(--kx-brand);
}
html:not([data-theme="dark"]):is(.kx-business, .kx-legal) .dock-item.active { color: #fff; background: rgba(255, 255, 255, 0.16); }

/* the selected sidebar item: brand tint (light sidebars), translucent white (dark sidebars) */
html:not([data-theme="dark"]):is(.kx-hrms, .kx-restaurant, .kx-education, .kx-pharma) .standard-sidebar-item.active-sidebar {
	background: var(--kx-tint-2);
	--text-color: var(--kx-sidebar-ink);
	--ink-gray-8: var(--kx-sidebar-ink);
	color: var(--kx-sidebar-ink);
	font-weight: 600;
}
html:not([data-theme="dark"]):is(.kx-business, .kx-legal) .standard-sidebar-item.active-sidebar {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	box-shadow: inset 3px 0 0 var(--kx-brand-2);
	font-weight: 600;
}
