:root {
  --meridian-brand: #07856b;
  --meridian-brand-strong: #056a56;
}

.desk-sidebar .sidebar-header .sidebar-logo img,
.navbar .app-logo {
  border-radius: 9px;
}

.btn-primary {
  background-color: var(--meridian-brand);
  border-color: var(--meridian-brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--meridian-brand-strong);
  border-color: var(--meridian-brand-strong);
}

/* Meridian owns the visual layer.  Retint application/workspace glyphs while
   leaving the underlying ERPNext workspaces and permission model unchanged. */
.desk-sidebar .standard-sidebar-item .item-icon,
.desk-sidebar .sidebar-item-icon,
.page-container .workspace-icon,
.page-container .module-icon,
.page-container .app-icon {
  filter: sepia(1) saturate(5) hue-rotate(112deg) brightness(.72);
}

/* Preserve the native launcher and its routes while applying Meridian's
   product color. White details remain white; blue ERP module icons become the
   Meridian green. The two native gray special cases need targeted treatment. */
.desktop-icon .app-icon {
  filter: hue-rotate(-42deg) saturate(1.35) brightness(.82);
}

/* ERPNext uses this shared icon catalogue for the app launcher, the compact
   workspace switcher, sidebar headers, and module-onboarding panels. Scope
   the recolor to that catalogue so Meridian's theme does not affect uploaded
   images, record attachments, status colors, or customer documents. */
img[src*="/assets/erpnext/icons/desktop_icons/"],
img[src*="/assets/frappe/icons/desktop_icons/"] {
  filter: sepia(1) saturate(5) hue-rotate(112deg) brightness(.72);
}

/* The compact workspace switcher creates letter icons for folders without a
   matching SVG (notably Accounting and Settings) and hard-codes them gray.
   Recolor only that fallback component, not general dropdown/status icons. */
.frappe-menu-item-icon .icon-container:has(.desktop-alphabet) {
  background-color: var(--meridian-brand) !important;
}

.frappe-menu-item-icon .desktop-alphabet {
  color: var(--white) !important;
}

.desktop-icon[data-id="Administration"] .app-icon {
  content: url("/assets/meridian_erpnext/images/meridian-logo.svg");
  filter: none;
}

.desktop-icon[data-id="Settings"] .icon-container {
  background-color: var(--meridian-brand) !important;
}

/* Workspace headers and native folder contents use different Frappe markup
   from root launcher tiles. Apply the same brand color without changing any
   workspace data or navigation behavior. */
.sidebar-header .sidebar-item-icon .header-logo img {
  filter: hue-rotate(-42deg) saturate(1.35) brightness(.82);
}

.desktop-modal-body .desktop-icon .icon-container {
  background-color: var(--meridian-brand) !important;
}

.desktop-modal-body .desktop-icon .app-icon {
  filter: sepia(1) saturate(5) hue-rotate(112deg) brightness(.72);
}

.desktop-modal-body .desktop-icon .icon-container .icon {
  color: var(--white) !important;
}
