{
  --primary: #0f766e;
  --primary-color: #0f766e;
  --btn-primary: #0f766e;
  --btn-primary-hover: #0d5c56;
  --text-on-primary: #ffffff;

  /* Eye-Cool Soft Sage-Slate Surfaces */
  --bg-color: #eef3f2;
  --subtle-fg: #e4ecea;
  --subtle-accent: #d8e5e2;
  --fg-color: #f8fbfa;
  --card-bg: #f8fbfa;
  --navbar-bg: #f4f8f7;
  --sidebar-bg: #e5edeb;
  --control-bg: #eef4f3;
  --control-bg-on-gray: #e2ecea;
  --border-color: #d2dfdc;
  --dark-border-color: #bccdc9;
  --focus-default: 0 0 0 2px rgba(15, 118, 110, 0.22);
}html[data-stt-theme="sage-teal"] /* Main Desk Canvas & Page Wrapper */
body
.main-section
.page-container
.layout-main
.layout-main-section-wrapper,
html[data-stt-theme="sage-teal"] /* Main Desk Canvas & Page Wrapper */
body
.main-section
.page-container
.layout-main
.layout-main-section-wrapper {
  background-color: #eef3f2 !important;
}html[data-stt-theme="sage-teal"] /* Left Sidebar & Module Rail */
.layout-side-section
.desk-sidebar
.standard-sidebar
.body-sidebar-container
.body-sidebar
.app-sidebar,
html[data-stt-theme="sage-teal"] /* Left Sidebar & Module Rail */
.layout-side-section
.desk-sidebar
.standard-sidebar
.body-sidebar-container
.body-sidebar
.app-sidebar {
  background-color: #e5edeb !important;
  border-right: 1px solid #d2dfdc !important;
}html[data-stt-theme="sage-teal"] /* Elevated Cards,
html[data-stt-theme="sage-teal"] /* Elevated Cards,
html[data-stt-theme="sage-teal"] Form Sections & List Rows (Soft Off-White instead of Stark White) */
.frappe-card
.widget
.form-section
.form-dashboard
.list-row-container
.page-head
.std-form-layout > .form-layout > .form-page,
html[data-stt-theme="sage-teal"] Form Sections & List Rows (Soft Off-White instead of Stark White) */
.frappe-card
.widget
.form-section
.form-dashboard
.list-row-container
.page-head
.std-form-layout > .form-layout > .form-page {
  background-color: #f8fbfa !important;
  border-color: #d2dfdc !important;
}html[data-stt-theme="sage-teal"] .page-head,
html[data-stt-theme="sage-teal"] .page-head {
  border-bottom: 1px solid #d2dfdc !important;
}html[data-stt-theme="sage-teal"] /* Top Navbar */
header.navbar,
html[data-stt-theme="sage-teal"] /* Top Navbar */
header.navbar {
  background-color: #f4f8f7 !important;
  border-bottom: 2px solid #0f766e !important;
}html[data-stt-theme="sage-teal"] /* Primary Buttons across Desk,
html[data-stt-theme="sage-teal"] /* Primary Buttons across Desk,
html[data-stt-theme="sage-teal"] Login,
html[data-stt-theme="sage-teal"] Login,
html[data-stt-theme="sage-teal"] Forms & Portal */
.btn-primary
.btn-primary:focus
.btn-primary:active
.page-actions .btn-primary
.form-message.blue,
html[data-stt-theme="sage-teal"] Forms & Portal */
.btn-primary
.btn-primary:focus
.btn-primary:active
.page-actions .btn-primary
.form-message.blue {
  background-color: #0f766e !important;
  border-color: #0f766e !important;
  color: #ffffff !important;
}html[data-stt-theme="sage-teal"] .btn-primary:hover,
html[data-stt-theme="sage-teal"] .btn-primary:hover {
  background-color: #0d5c56 !important;
  border-color: #0d5c56 !important;
}html[data-stt-theme="sage-teal"] /* Sidebar Active & Hover States */
.desk-sidebar .standard-sidebar-item:hover
.standard-sidebar .standard-sidebar-item:hover,
html[data-stt-theme="sage-teal"] /* Sidebar Active & Hover States */
.desk-sidebar .standard-sidebar-item:hover
.standard-sidebar .standard-sidebar-item:hover {
  background-color: #d8e5e2 !important;
}html[data-stt-theme="sage-teal"] .desk-sidebar .standard-sidebar-item.selected
.standard-sidebar .standard-sidebar-item.selected,
html[data-stt-theme="sage-teal"] .desk-sidebar .standard-sidebar-item.selected
.standard-sidebar .standard-sidebar-item.selected {
  background-color: #cde0dc !important;
  color: #0b4f4a !important;
  font-weight: 600;
}html[data-stt-theme="sage-teal"] .desk-sidebar .standard-sidebar-item.selected svg
.desk-sidebar .standard-sidebar-item.selected .sidebar-item-icon,
html[data-stt-theme="sage-teal"] .desk-sidebar .standard-sidebar-item.selected svg
.desk-sidebar .standard-sidebar-item.selected .sidebar-item-icon {
  stroke: #0f766e !important;
  color: #0f766e !important;
}html[data-stt-theme="sage-teal"] /* Links & Form Inputs */
a:not(.btn):not(.navbar-brand):not(.nav-link):not(.dropdown-item),
html[data-stt-theme="sage-teal"] /* Links & Form Inputs */
a:not(.btn):not(.navbar-brand):not(.nav-link):not(.dropdown-item) {
  color: #0f766e;
}html[data-stt-theme="sage-teal"] .form-control
input.form-control
select.form-control
textarea.form-control,
html[data-stt-theme="sage-teal"] .form-control
input.form-control
select.form-control
textarea.form-control {
  background-color: #eef4f3 !important;
  border-color: #c8d7d4 !important;
}html[data-stt-theme="sage-teal"] .form-control:focus
input:focus
select:focus
textarea:focus,
html[data-stt-theme="sage-teal"] .form-control:focus
input:focus
select:focus
textarea:focus {
  background-color: #ffffff !important;
  border-color: #0f766e !important;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18) !important;
}html[data-stt-theme="sage-teal"] /* Checkboxes & Toggles */
input[type="checkbox"]:checked,
html[data-stt-theme="sage-teal"] /* Checkboxes & Toggles */
input[type="checkbox"]:checked {
  background-color: #0f766e !important;
  border-color: #0f766e !important;
}html[data-stt-theme="sage-teal"] /* Detail Forms (Sales Order,
html[data-stt-theme="sage-teal"] /* Detail Forms (Sales Order,
html[data-stt-theme="sage-teal"] Invoice,
html[data-stt-theme="sage-teal"] Invoice,
html[data-stt-theme="sage-teal"] Quotation,
html[data-stt-theme="sage-teal"] Quotation,
html[data-stt-theme="sage-teal"] Customer,
html[data-stt-theme="sage-teal"] Customer,
html[data-stt-theme="sage-teal"] Item) */
.form-layout
.form-page
.form-tabs-list
.form-tabs
.form-dashboard-section
.form-links
.form-heatmap
.form-assignments
.form-attachments
.form-shared
.form-tags
.form-sidebar
.comment-box
.timeline-item .timeline-content,
html[data-stt-theme="sage-teal"] Item) */
.form-layout
.form-page
.form-tabs-list
.form-tabs
.form-dashboard-section
.form-links
.form-heatmap
.form-assignments
.form-attachments
.form-shared
.form-tags
.form-sidebar
.comment-box
.timeline-item .timeline-content {
  background-color: #f3f7f6 !important;
  border-color: #d2dfdc !important;
}html[data-stt-theme="sage-teal"] .form-tabs-list,
html[data-stt-theme="sage-teal"] .form-tabs-list {
  background-color: #e7efed !important;
  border-bottom: 1px solid #cddbd8 !important;
}html[data-stt-theme="sage-teal"] .form-tabs .nav-link.active,
html[data-stt-theme="sage-teal"] .form-tabs .nav-link.active {
  background-color: #f3f7f6 !important;
  color: #0f766e !important;
  border-bottom: 2px solid #0f766e !important;
  font-weight: 600;
}html[data-stt-theme="sage-teal"] /* Child Tables (Items,
html[data-stt-theme="sage-teal"] /* Child Tables (Items,
html[data-stt-theme="sage-teal"] Taxes & Charges,
html[data-stt-theme="sage-teal"] Taxes & Charges,
html[data-stt-theme="sage-teal"] Payment Schedule) */
.frappe-control .form-grid
.grid-heading-row
.grid-body
.grid-row
.grid-footer
.data-row,
html[data-stt-theme="sage-teal"] Payment Schedule) */
.frappe-control .form-grid
.grid-heading-row
.grid-body
.grid-row
.grid-footer
.data-row {
  background-color: #f3f7f6 !important;
  border-color: #d2dfdc !important;
}html[data-stt-theme="sage-teal"] .grid-heading-row,
html[data-stt-theme="sage-teal"] .grid-heading-row {
  background-color: #e4ecea !important;
  color: #132a2e !important;
}html[data-stt-theme="sage-teal"] .grid-row:hover .data-row
.list-row:hover,
html[data-stt-theme="sage-teal"] .grid-row:hover .data-row
.list-row:hover {
  background-color: #e8f0ee !important;
}html[data-stt-theme="sage-teal"] /* List View & Report Tables */
.frappe-list
.list-row
.list-row-head
.datatable .dt-cell
.datatable .dt-header .dt-cell,
html[data-stt-theme="sage-teal"] /* List View & Report Tables */
.frappe-list
.list-row
.list-row-head
.datatable .dt-cell
.datatable .dt-header .dt-cell {
  background-color: #f3f7f6 !important;
  border-color: #d2dfdc !important;
}html[data-stt-theme="sage-teal"] .list-row-head
.datatable .dt-header .dt-cell,
html[data-stt-theme="sage-teal"] .list-row-head
.datatable .dt-header .dt-cell {
  background-color: #e4ecea !important;
}html[data-stt-theme="sage-teal"] /* Modals,
html[data-stt-theme="sage-teal"] /* Modals,
html[data-stt-theme="sage-teal"] Popovers & Awesomebar Search */
.modal-content
.modal-header
.modal-body
.modal-footer
.awesomplete > ul,
html[data-stt-theme="sage-teal"] Popovers & Awesomebar Search */
.modal-content
.modal-header
.modal-body
.modal-footer
.awesomplete > ul {
  background-color: #f3f7f6 !important;
  border-color: #c8d7d4 !important;
}html[data-stt-theme="sage-teal"] /* Frappe v16 Surface Custom Properties & Utility Overrides */
body,
html[data-stt-theme="sage-teal"] /* Frappe v16 Surface Custom Properties & Utility Overrides */
body {
  --surface-white: #f2f6f5 !important;
  --surface-gray-1: #e9f0ee !important;
  --surface-gray-2: #e0eae7 !important;
  --surface-gray-3: #d5e2df !important;
  --bg-surface: #f2f6f5 !important;
  --fg-color: #f2f6f5 !important;
  --subtle-fg: #e7efed !important;
  --bg-color: #e8efed !important;
  --card-bg: #f2f6f5 !important;
  --sidebar-bg: #e1eae8 !important;
}html[data-stt-theme="sage-teal"] /* Override Frappe v16 Tailwind bg-white / bg-gray-50 inside Desk (/app) */
body[data-route] .bg-white
.layout-main .bg-white
.page-body .bg-white
.form-layout .bg-white
.std-form-layout .bg-white
.form-section
.form-column
.section-body
.form-dashboard
.form-tabs-list
.page-card
.layout-main-section,
html[data-stt-theme="sage-teal"] /* Override Frappe v16 Tailwind bg-white / bg-gray-50 inside Desk (/app) */
body[data-route] .bg-white
.layout-main .bg-white
.page-body .bg-white
.form-layout .bg-white
.std-form-layout .bg-white
.form-section
.form-column
.section-body
.form-dashboard
.form-tabs-list
.page-card
.layout-main-section {
  background-color: #f2f6f5 !important;
}html[data-stt-theme="sage-teal"] body[data-route] .bg-gray-50
.layout-main .bg-gray-50
.page-body .bg-gray-50,
html[data-stt-theme="sage-teal"] body[data-route] .bg-gray-50
.layout-main .bg-gray-50
.page-body .bg-gray-50 {
  background-color: #e7efed !important;
}html[data-stt-theme="sage-teal"] /* Read-only / Disabled Field Boxes inside Forms */
.like-disabled-input
.control-value.like-disabled-input,
html[data-stt-theme="sage-teal"] /* Read-only / Disabled Field Boxes inside Forms */
.like-disabled-input
.control-value.like-disabled-input {
  background-color: #e6eeec !important;
  border-color: #cddbd8 !important;
  color: #132a2e !important;
}

/* Split-Screen List + Form Pane View */

html[data-stt-theme="sage-teal"] .body-sidebar-container,
html[data-stt-theme="sage-teal"] .body-sidebar-container,
html[data-stt-theme="sage-teal"] .body-sidebar,
html[data-stt-theme="sage-teal"] .body-sidebar,
html[data-stt-theme="sage-teal"] .dock,
html[data-stt-theme="sage-teal"] .dock,
html[data-stt-theme="sage-teal"] .sidebar-panel,
html[data-stt-theme="sage-teal"] .sidebar-panel {
  background-color: #e5edeb !important;
  border-right: 1px solid #d2dfdc !important;
}

body.stt-split-active .page-container:not([style*="display: none"]) .layout-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 12px;
  height: calc(100vh - 115px) !important;
  overflow: hidden !important;
}

body.stt-split-active .page-container:not([style*="display: none"]) .layout-side-section {
  display: none !important;
}

body.stt-split-active .page-container:not([style*="display: none"]) .layout-main-section-wrapper {
  flex: 0 0 40% !important;
  max-width: 40% !important;
  height: 100% !important;
  overflow-y: auto !important;
  margin: 0 !important;
}

.stt-split-right-pane {
  flex: 1 1 60% !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f2f6f5;
  border: 1px solid #c8d7d4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(19, 42, 46, 0.06);
}

.stt-split-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background-color: #e4ecea;
  border-bottom: 1px solid #c8d7d4;
  color: #132a2e;
  font-size: 13px;
  flex-shrink: 0;
}

#stt-split-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #f2f6f5;
}

.stt-split-selected-row,
.stt-split-selected-row .list-row {
  background-color: #d4e6e2 !important;
  border-left: 3px solid #0f766e !important;
}

@media (max-width: 991px) {
  body.stt-split-active .page-container:not([style*="display: none"]) .layout-main {
    flex-direction: column !important;
    height: auto !important;
  }
  body.stt-split-active .page-container:not([style*="display: none"]) .layout-main-section-wrapper,
  .stt-split-right-pane {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-height: 500px;
  }
}

/* Draggable Split-Pane Divider */
body.stt-split-active .page-container:not([style*="display: none"]) .layout-main {
  gap: 0 !important;
}

.stt-split-resizer {
  flex: 0 0 10px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  user-select: none;
  z-index: 20;
  transition: background-color 0.15s ease;
}

.stt-split-resizer:hover,
.stt-split-resizer.stt-dragging {
  background-color: rgba(15, 118, 110, 0.14);
}

.stt-split-grip {
  width: 3px;
  height: 38px;
  border-radius: 3px;
  background-color: #9fb5b0;
  transition: background-color 0.15s ease, height 0.15s ease;
}

.stt-split-resizer:hover .stt-split-grip,
.stt-split-resizer.stt-dragging .stt-split-grip {
  background-color: #0f766e;
  height: 54px;
}

.stt-split-right-pane {
  flex: 1 1 auto !important;
  min-width: 280px;
}

@media (max-width: 991px) {
  .stt-split-resizer {
    display: none !important;
  }
}

/* Mobile Viewport Fix: remove left vertical accent border & stack panes cleanly */
@media (max-width: 767px) {
  body,
  .main-section,
  .page-container,
  .layout-main,
  .layout-main-section-wrapper,
  .layout-main-section,
  .form-layout,
  .page-head {
    border-left: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .stt-split-resizer,
  #stt-split-toggle-btn {
    display: none !important;
  }

  body.stt-split-active .layout-main {
    flex-direction: column !important;
  }

  .stt-split-right-pane {
    min-width: 100% !important;
    width: 100% !important;
    border-left: none !important;
    border-top: 2px solid #0f766e !important;
  }
}

/* Collapse Frappe v16 Desk Sidebar on Mobile Screens */
@media (max-width: 768px) {
  .body-sidebar-container:not(.expanded) {
    display: none !important;
    width: 0 !important;
    border: none !important;
  }
  .body-sidebar-placeholder {
    display: none !important;
    width: 0 !important;
  }
}

/* Hide inner left sidebar inside Split View pane */
.split-view .layout-side-section,
.split-view-container .layout-side-section,
.split-pane .layout-side-section,
[data-view="Split"] .layout-side-section,
.split-view .desk-sidebar,
.split-view-container .desk-sidebar,
.split-pane .desk-sidebar {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
}

.split-view .layout-main-section-wrapper,
.split-view-container .layout-main-section-wrapper,
.split-pane .layout-main-section-wrapper,
[data-view="Split"] .layout-main-section-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* Hide left sidebar rail & list sidebar when Split View is active */
body.stt-split-active .body-sidebar-container,
body.stt-split-active .body-sidebar,
body.stt-split-active .desk-sidebar,
body.stt-split-active .layout-side-section {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
}

/* Hide Frappe v16 vertical app icon rail when inside Split View iframe */
html.stt-in-iframe .body-sidebar-container,
html.stt-in-iframe .body-sidebar-placeholder,
html.stt-in-iframe .body-sidebar,
html.stt-in-iframe .desk-sidebar,
html.stt-in-iframe .layout-side-section {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  visibility: hidden !important;
}

html.stt-in-iframe,
html.stt-in-iframe body {
  --sidebar-width: 0px !important;
}

html.stt-in-iframe .main-section,
html.stt-in-iframe .page-container,
html.stt-in-iframe .layout-main-section-wrapper {
  margin-left: 0 !important;
  padding-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}


/* Restore native Frappe Light/Dark palette when user explicitly selects Light or Dark */
html[data-stt-active="0"] body,
html[data-stt-active="0"] .main-section,
html[data-stt-active="0"] .page-container {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

/* Theme Switcher Modal Preview Card for Sage Teal */
.theme-preview-container[data-theme="sage-teal"] .theme-preview-frame {
  background: #f0fdfa !important;
  border-color: #0f766e !important;
}
.theme-preview-container[data-theme="sage-teal"] .theme-preview-titlebar {
  background: #132a2e !important;
}
.theme-preview-container[data-theme="sage-teal"] .theme-preview-sidebar {
  background: #e6f4f1 !important;
}
.theme-preview-container[data-theme="sage-teal"] .theme-preview-header-action {
  background: #0f766e !important;
}
