/*
 * Quantum Byte OS theme for ERPNext's own screens (desk at /app) and website pages (login etc.).
 * Same look as the /os screens: colours, fonts and 14px card corners from CLAUDE.md ("Design").
 * Loaded by qb_os/hooks.py (app_include_css + web_include_css). ERPNext/Frappe files are NOT edited:
 * this file only re-points Frappe's colour tokens. Selector `html:root` (and `html:root[data-theme]`)
 * outranks Frappe's own `:root` / `[data-theme=...]` blocks. Every login is set back to the dark desk theme
 * when the person logs in (qb_os/theme.py), so a manual "Toggle theme" only lasts until the next login.
 * Printouts and PDFs keep their own white page (print preview is a separate page).
 *
 * Palette: page #0E1116, sidebar #12161E, cards #161B24, border #262D3B, text #ECEEF2,
 * secondary text #A1A9B8, accent #5B8DEF (text on it #0E1116), warning #F5A04A, good #4CC38A.
 */

@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("/assets/qb_os/fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Space Grotesk";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("/assets/qb_os/fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}

html:root,
html:root[data-theme] {
	color-scheme: dark;

	/* ---- Frappe "espresso" design tokens ---- */
	--surface-base: #0e1116;
	--surface-white: #161b24;
	--surface-cards: #161b24;
	--surface-modal: #161b24;
	--surface-menu-bar: #12161e;
	--surface-sidebar: #12161e;
	--surface-selected: #1d2330;
	--surface-gray-1: #12161e;
	--surface-gray-2: #1d2330;
	--surface-gray-3: #262d3b;
	--surface-gray-4: #313949;
	--surface-gray-5: #3b4456;
	--surface-gray-6: #4a5468;
	--surface-gray-7: #a1a9b8;
	--surface-gray-8: #d5dae2;
	--surface-gray-9: #eceef2;
	--surface-gray-10: #5b8def;

	--ink-base: #0e1116;
	--ink-gray-1: #262d3b;
	--ink-gray-2: #8b94a5;
	--ink-gray-3: #8b94a5;
	--ink-gray-9: #eceef2;
	--ink-gray-8: #eceef2;
	--ink-gray-7: #d5dae2;
	--ink-gray-6: #a1a9b8;
	--ink-gray-5: #a1a9b8;
	--ink-gray-4: #8b94a5;

	--outline-gray-1: #262d3b;
	--outline-gray-2: #313949;
	--outline-gray-3: #3b4456;
	--outline-gray-4: #4a5468;
	--outline-gray-modals: #262d3b;

	/* ---- Frappe's older names (still used by most ERPNext screens) ---- */
	--bg-color: #0e1116;
	--fg-color: #161b24;
	--card-bg: #161b24;
	--modal-bg: #161b24;
	--popover-bg: #161b24;
	--navbar-bg: #12161e;
	--desk-sidebar-bg: #12161e;
	--control-bg: #0e1116;
	--control-bg-on-gray: #12161e;
	--subtle-accent: #12161e;
	--subtle-fg: #1d2330;
	--fg-hover-color: #1d2330;
	--awesomebar-focus-bg: #0e1116;
	--awesomplete-hover-bg: #1d2330;
	--text-color: #eceef2;
	--heading-color: #eceef2;
	--text-muted: #a1a9b8;
	--text-light: #a1a9b8;
	--border-color: #262d3b;
	--dark-border-color: #313949;
	--primary: #5b8def;
	--primary-color: #5b8def;
	--brand-color: #5b8def;
	--btn-primary: #5b8def;
	--progress-bar-bg: #5b8def;

	--font-stack: "Inter", "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html:root body {
	background-color: #0e1116;
	color: #eceef2;
}

/* Headings in Space Grotesk */
html:root h1,
html:root h2,
html:root h3,
html:root h4,
html:root .page-title .title-text,
html:root .widget-title,
html:root .page-card-head h4,
html:root .modal-title {
	font-family: "Space Grotesk", "Inter", sans-serif;
	letter-spacing: 0;
}

/* Cards: #161B24, 1px #262D3B border, 14px corners */
html:root .frappe-card,
html:root .widget,
html:root .modal-content,
html:root .page-card,
html:root .form-page,
html:root .layout-main-section.frappe-card {
	background-color: #161b24;
	border: 1px solid #262d3b;
	border-radius: 14px;
}

/* Buttons: accent blue with dark text */
html:root .btn.btn-primary,
html:root .btn.btn-primary:hover,
html:root .btn.btn-primary:focus {
	background-color: #5b8def;
	border-color: #5b8def;
	color: #0e1116;
	--icon-stroke: #0e1116;
}
html:root .btn.btn-primary:hover,
html:root .btn.btn-primary:active {
	background-color: #7aa3f2 !important;
	color: #0e1116 !important;
}

/* Frappe's newer buttons and toasts (dark text on light grey would be unreadable) */
html:root .es-button.es-button-solid:hover,
html:root .es-button[data-variant="solid"]:hover {
	background-color: #7aa3f2;
	color: #0e1116;
}
html:root .es-toast {
	background-color: #1d2330;
	color: #eceef2;
	border: 1px solid #313949;
}

/* Calendar: today's date number sits on the accent colour */
html:root .fc-day-today .fc-daygrid-day-number {
	color: #0e1116 !important;
}

/* Dialogs: inputs and borders in our palette (Frappe resets them to neutral grey inside .modal) */
html:root .modal,
html:root .form-in-grid {
	--control-bg: #0e1116;
	--border-color: #262d3b;
}

/* Visible keyboard focus everywhere */
html:root :focus-visible {
	outline: 2px solid #5b8def;
	outline-offset: 2px;
}

/* Status chips: only the three CLAUDE.md colours (green = done, blue = in progress, orange = attention) */
html:root .indicator-pill.green,
html:root .indicator-pill.dark-green {
	background-color: #1d3b2e;
	color: #7fe0b0;
}
html:root .indicator-pill.blue,
html:root .indicator-pill.light-blue,
html:root .indicator-pill.cyan,
html:root .indicator-pill.purple,
html:root .indicator-pill.pink {
	background-color: #213252;
	color: #a9c4f7;
}
html:root .indicator-pill.orange,
html:root .indicator-pill.yellow,
html:root .indicator-pill.amber,
html:root .indicator-pill.red {
	background-color: #3a2a1a;
	color: #f5c089;
}
html:root .indicator-pill.gray,
html:root .indicator-pill.grey,
html:root .indicator-pill.darkgrey {
	background-color: #1d2330;
	color: #a1a9b8;
}

/* Notification count dot on the desk dock: accent with dark text (was light-on-light) */
html:root .notification-count.dock-item-dot {
	background-color: #5b8def !important;
	color: #0e1116 !important;
}

/* Inputs */
html:root .form-control,
html:root .awesomplete > input,
html:root select.form-control {
	background-color: #0e1116;
	color: #eceef2;
	border: 1px solid #313949;
}
html:root .form-control::placeholder {
	color: #8b94a5;
}

/* Website pages (login, messages): page background */
html:root .page-content-wrapper,
html:root .for-login,
html:root .for-forgot,
html:root .for-signup {
	background-color: #0e1116;
}

/* ---- ERPNext website pages (login, 404, "not permitted", update password, /me, future agency portal).
   They use fixed light Bootstrap colours, so set ours explicitly. Desk screens are not affected
   (only website pages have body[data-path]). ---- */
html:root body[data-path] {
	background-color: #0e1116;
	color: #eceef2;
}
html:root body[data-path] a:not(.btn) {
	color: #5b8def;
}
html:root body[data-path] h1,
html:root body[data-path] h2,
html:root body[data-path] h3,
html:root body[data-path] h4,
html:root body[data-path] h5,
html:root body[data-path] h6,
html:root body[data-path] .h1,
html:root body[data-path] .h2,
html:root body[data-path] .h3,
html:root body[data-path] .h4 {
	color: #eceef2;
}
html:root body[data-path] .text-muted,
html:root body[data-path] small {
	color: #a1a9b8 !important;
}
html:root body[data-path] .card,
html:root body[data-path] .list-group-item,
html:root body[data-path] .dropdown-menu,
html:root body[data-path] .modal-content,
html:root body[data-path] .web-form-container,
html:root body[data-path] .page-card {
	background-color: #161b24;
	color: #eceef2;
	border-color: #262d3b;
}
html:root body[data-path] .dropdown-item {
	color: #eceef2;
}
html:root body[data-path] .dropdown-item:hover,
html:root body[data-path] .dropdown-item:focus {
	background-color: #1d2330;
	color: #eceef2;
}
html:root body[data-path] .navbar,
html:root body[data-path] .navbar-light,
html:root body[data-path] .web-footer,
html:root body[data-path] footer {
	background-color: #12161e !important;
	color: #eceef2;
	border-color: #262d3b;
}
html:root body[data-path] .navbar-light .navbar-nav .nav-link,
html:root body[data-path] .navbar-light .navbar-brand {
	color: #eceef2;
}
html:root body[data-path] .table,
html:root body[data-path] table {
	color: #eceef2;
}
html:root body[data-path] .bg-white,
html:root body[data-path] .bg-light {
	background-color: #161b24 !important;
}
html:root .avatar-frame.standard-image {
	background-color: #1d2330 !important;
	color: #eceef2 !important;
}
