/*
 * SolarNext theme for desk and website.
 * Mirrors the Vue PWA palette (tailwind.config.ts) onto Frappe's Espresso tokens.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@500;600;700;800&display=swap");

:root {
	/* Slate scale from the SolarNext PWA, mapped onto Espresso's gray scale. */
	--gray-50: #f8fafc;
	--gray-100: #f1f5f9;
	--gray-200: #e2e8f0;
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-500: #64748b;
	--gray-600: #475569;
	--gray-700: #334155;
	--gray-800: #1e293b;
	--gray-900: #0f172a;
	--gray-950: #0b1120;

	/* SolarNext accents. */
	--amber-50: #fffbeb;
	--amber-100: #fef3c7;
	--amber-200: #fde68a;
	--amber-300: #fcd34d;
	--amber-400: #fbbf24;
	--amber-500: #f39c12;
	--amber-600: #e08e0b;
	--amber-700: #b45309;

	--red-50: #fef2f2;
	--red-100: #fee2e2;
	--red-500: #dc2626;
	--red-600: #b91c1c;
	--green-100: #dcfce7;
	--green-500: #16a34a;
	--green-600: #15803d;
	--blue-100: #dbeafe;
	--blue-500: #2563eb;
	--blue-600: #1d4ed8;
	--violet-100: #ede9fe;
	--violet-500: #7c3aed;
	--violet-600: #6d28d9;

	--primary: #f39c12;
	--primary-color: #f39c12;
	--brand-color: #f39c12;
	--progress-bar-bg: #f39c12;
	--checkbox-gradient: linear-gradient(180deg, #f39c12 -124.51%, #f39c12 100%);
	--date-active-bg: var(--gray-900);
	--date-active-text: var(--gray-50);
	--focus-default: 0 0 0 2px rgba(243, 156, 18, 0.35);
	--navbar-bg: #0f172a;
}

:root,
[data-theme="light"] {
	--bg-color: #f8fafc;
	--fg-color: #ffffff;
	--card-bg: #ffffff;
	--modal-bg: #ffffff;
	--popover-bg: #ffffff;
	--control-bg: #f1f5f9;
}

[data-theme="dark"],
.dark {
	--bg-color: var(--surface-base);
	--fg-color: var(--surface-base);
	--card-bg: var(--surface-base);
	--modal-bg: var(--surface-base);
	--popover-bg: var(--surface-base);
	--control-bg: var(--surface-gray-2);
}

body,
input,
textarea,
select,
button,
.btn {
	font-family: "Inter", system-ui, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.page-title,
.title-text,
.navbar-brand {
	font-family: "Montserrat", system-ui, sans-serif;
	font-weight: 700;
}

/* Primary action: amber surface with navy ink, as in the PWA. */
.btn.btn-primary,
.es-button[data-variant="solid"]:not([data-theme="red"]) {
	background-color: #f39c12 !important;
	border-color: #f39c12 !important;
	color: #0f172a !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active,
.es-button[data-variant="solid"]:not([data-theme="red"]):hover,
.es-button[data-variant="solid"]:not([data-theme="red"]):active,
.es-button[data-variant="solid"]:not([data-theme="red"])[aria-expanded="true"] {
	background-color: #e08e0b !important;
	border-color: #e08e0b !important;
	color: #0f172a !important;
}

.btn.btn-danger,
.es-button[data-theme="red"][data-variant="solid"] {
	background-color: #b91c1c !important;
	border-color: #b91c1c !important;
	color: #ffffff !important;
}

/* Secondary actions: white surface, slate border, navy ink. */
.btn.btn-default,
.btn.btn-secondary {
	background-color: var(--surface-base) !important;
	border: 1px solid var(--outline-gray-2) !important;
	color: var(--text-color) !important;
}

.btn.btn-default:hover,
.btn.btn-secondary:hover,
.btn.btn-default:focus,
.btn.btn-secondary:focus {
	background-color: var(--surface-gray-1) !important;
	border-color: var(--outline-gray-3) !important;
	color: var(--text-color) !important;
}

/* Navy navbars and page top bars. The JS adds .solarnext-themed-bar so the
 * dynamically rendered bars get these colours too. The desk workspace at
 * /desk uses .page-head directly, so theme it even before the class lands. */
.navbar,
.desktop-navbar,
.page-head,
.sidebar-header,
.workspace-header,
.solarnext-themed-bar {
	background-color: #0f172a !important;
	border-bottom-color: #1e293b !important;
	color: #f8fafc !important;
}

/* /desk desktop page navbar (frappe/desk/page/desktop/desktop.html). */
body.desktop-page .desktop-navbar {
	--icon-stroke: #cbd5e1;
}

body.desktop-page .desktop-navbar .desktop-navbar-title {
	color: #f8fafc !important;
}

body.desktop-page .desktop-navbar .nav-link,
body.desktop-page .desktop-navbar .text-muted,
body.desktop-page .desktop-navbar .desktop-notification-icon,
body.desktop-page .desktop-navbar .desktop-cloud-settings {
	color: #cbd5e1 !important;
}

body.desktop-page .desktop-navbar .nav-link:hover,
body.desktop-page .desktop-navbar .desktop-notification-icon:hover,
body.desktop-page .desktop-navbar .desktop-cloud-settings:hover {
	background-color: #1e293b !important;
	color: #f8fafc !important;
}

body.desktop-page .desktop-navbar .search-widget-button {
	background-color: #1e293b !important;
	color: #f8fafc !important;
}

body.desktop-page .desktop-navbar .search-widget-button:hover {
	background-color: #334155 !important;
}

body.desktop-page .desktop-navbar .search-widget-icon svg {
	stroke: #f8fafc !important;
}

body.desktop-page .desktop-navbar .search-widget-shortcut {
	color: #cbd5e1 !important;
}

body.desktop-page .desktop-navbar .icon {
	--icon-stroke: currentColor;
}

/* Left app/module dock (#desk-dock): navy tray, light glyphs, amber active tile. */
#desk-dock {
	--dock-bg: #0f172a;
	--dock-ink: #cbd5e1;
	--dock-ink-hover: #f8fafc;
	--dock-ink-active: #f8fafc;
	background-color: #0f172a !important;
	border-right-color: #1e293b !important;
}

#desk-dock .dock-logo {
	border-bottom-color: #1e293b !important;
	color: #f8fafc !important;
}

#desk-dock .dock-logo .shell-header {
	color: #f8fafc !important;
	--icon-stroke: currentColor;
}

#desk-dock .dock-utilities:not(:empty) {
	border-bottom-color: #1e293b !important;
}

#desk-dock .dock-item,
#desk-dock .dock-utilities .dock-item {
	color: #cbd5e1 !important;
	--icon-stroke: currentColor;
}

#desk-dock .dock-item:hover,
#desk-dock .dock-item:focus-visible,
#desk-dock .dock-utilities .dock-item:hover,
#desk-dock .dock-utilities .dock-item:focus-visible {
	background-color: #1e293b !important;
	color: #f8fafc !important;
}

#desk-dock .dock-item.active,
#desk-dock .dock-items .dock-item.active {
	background-color: #f39c12 !important;
	color: #0f172a !important;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3) !important;
}

#desk-dock .dock-utilities .dock-item[aria-expanded="true"] {
	background-color: #334155 !important;
	color: #f8fafc !important;
	box-shadow: none !important;
}

#desk-dock .dock-item-dot {
	border-color: #0f172a !important;
	background-color: #f39c12 !important;
}

#desk-dock .dock-user-button:hover,
#desk-dock .dock-user-button.user-menu-active {
	background-color: #1e293b !important;
}

.page-head a:not(.dropdown-item),
.page-head .page-title,
.page-head .title-area,
.page-head .navbar-breadcrumbs,
.page-head .navbar-breadcrumbs a,
.page-head .es-breadcrumbs,
.page-head .es-breadcrumbs__item,
.page-head .es-breadcrumbs__label,
.sidebar-header .header-title,
.sidebar-header .header-logo,
.sidebar-header .drop-icon {
	color: #f8fafc;
}

.page-head .es-breadcrumbs li + li::before,
.solarnext-themed-bar .es-breadcrumbs li + li::before {
	color: #94a3b8 !important;
}

.page-head .es-breadcrumbs li:last-child .es-breadcrumbs__item,
.solarnext-themed-bar .es-breadcrumbs li:last-child .es-breadcrumbs__item {
	color: #f8fafc !important;
}

.page-head .es-button[data-variant="ghost"],
.sidebar-header .drop-icon {
	background-color: transparent !important;
	border-color: transparent !important;
	color: #f8fafc !important;
}

.page-head .btn-default,
.page-head .btn-secondary,
.page-head .es-button:not([data-variant]),
.page-head .es-button[data-variant="subtle"],
.page-head .es-button[data-variant="outline"] {
	background-color: #1e293b !important;
	border-color: #334155 !important;
	color: #f8fafc !important;
}

.navbar a:not(.dropdown-item),
.navbar .nav-link,
.navbar .navbar-brand,
.navbar .navbar-toggler,
.solarnext-themed-bar a:not(.dropdown-item),
.solarnext-themed-bar .nav-link,
.solarnext-themed-bar .navbar-brand,
.solarnext-themed-bar .navbar-toggler {
	color: #f8fafc;
}

.navbar .nav-link:hover,
.navbar .navbar-brand:hover,
.solarnext-themed-bar .nav-link:hover,
.solarnext-themed-bar .navbar-brand:hover {
	color: #fbbf24;
}

.navbar .search-icon,
.solarnext-themed-bar .search-icon {
	background-color: #1e293b;
}

.navbar .search-icon svg,
.solarnext-themed-bar .search-icon svg {
	stroke: #f8fafc;
}

.navbar .vertical-bar,
.solarnext-themed-bar .vertical-bar {
	border-right-color: #334155;
}

.solarnext-themed-bar svg {
	--icon-stroke: currentColor;
}

.solarnext-themed-bar .navbar-breadcrumbs,
.solarnext-themed-bar .navbar-breadcrumbs a,
.solarnext-themed-bar .page-title,
.solarnext-themed-bar .title-area,
.solarnext-themed-bar .header-title,
.solarnext-themed-bar .header-logo {
	color: #f8fafc;
}

.solarnext-themed-bar .navbar-breadcrumbs a {
	color: #cbd5e1;
}

.solarnext-themed-bar .navbar-breadcrumbs li:last-child a {
	color: #f8fafc;
}

/* Espresso breadcrumbs (v16 uses .es-breadcrumbs__item, including spans and buttons). */
.solarnext-themed-bar .es-breadcrumbs,
.solarnext-themed-bar .es-breadcrumbs__item,
.solarnext-themed-bar .es-breadcrumbs li > a:not(.es-breadcrumbs__item),
.solarnext-themed-bar .es-breadcrumbs li > span:not(.es-breadcrumbs__item) {
	color: #cbd5e1 !important;
}

.navbar .es-breadcrumbs__label,
.solarnext-themed-bar .es-breadcrumbs__label {
	color: #f8fafc !important;
}

.solarnext-themed-bar .es-breadcrumbs li + li::before {
	color: #94a3b8 !important;
}

.solarnext-themed-bar .es-breadcrumbs li:last-child .es-breadcrumbs__item,
.solarnext-themed-bar .es-breadcrumbs li:last-child .es-breadcrumbs__label {
	color: #f8fafc !important;
}

.solarnext-themed-bar .es-breadcrumbs a.es-breadcrumbs__item:hover,
.solarnext-themed-bar .es-breadcrumbs button.es-breadcrumbs__item:hover {
	color: #fbbf24 !important;
}

.solarnext-themed-bar .es-breadcrumbs__item > svg {
	color: #cbd5e1;
}

.solarnext-themed-bar .drop-icon,
.solarnext-themed-bar .drop-icon svg {
	color: #f8fafc;
	--icon-stroke: #f8fafc;
}

/* Secondary and ghost actions inside the navy bars. */
.solarnext-themed-bar .btn-default,
.solarnext-themed-bar .btn-secondary,
.solarnext-themed-bar .es-button[data-variant="outline"],
.solarnext-themed-bar .es-button[data-variant="subtle"],
.solarnext-themed-bar .es-button:not([data-variant]) {
	background-color: #1e293b !important;
	border-color: #334155 !important;
	color: #f8fafc !important;
}

.solarnext-themed-bar .es-button[data-variant="ghost"] {
	background-color: transparent !important;
	border-color: transparent !important;
	color: #f8fafc !important;
}

.solarnext-themed-bar .btn-default:hover,
.solarnext-themed-bar .btn-secondary:hover,
.solarnext-themed-bar .es-button[data-variant="outline"]:hover,
.solarnext-themed-bar .es-button[data-variant="subtle"]:hover,
.solarnext-themed-bar .es-button:not([data-variant]):hover {
	background-color: #334155 !important;
	border-color: #475569 !important;
	color: #f8fafc !important;
}

.solarnext-themed-bar .es-button[data-variant="ghost"]:hover {
	background-color: #1e293b !important;
	border-color: transparent !important;
	color: #f8fafc !important;
}

/* The page top bar's solid primary action stays amber. */
.solarnext-themed-bar .btn-primary,
.solarnext-themed-bar .es-button[data-variant="solid"]:not([data-theme="red"]) {
	background-color: #f39c12 !important;
	border-color: #f39c12 !important;
	color: #0f172a !important;
}