/* Optional low-glare palette. Layout and operational/status rules stay unchanged. */
html[data-theme="comfort"] {
  color-scheme: dark;
  --visual-color-ink: #eaf3fa;
  --visual-color-muted: #cfdeea;
  --visual-color-border: #688398;
  --visual-color-surface-soft: #38556a;
  --visual-color-disabled-bg: #486073;
  --visual-color-disabled-text: #bbcad4;
  background: #30495d;
  color: #edf5fa;
}
html[data-theme="comfort"] body,
html[data-theme="comfort"] .main-area,
html[data-theme="comfort"] .desktop-page-body,
html[data-theme="comfort"] .desktop-home,
html[data-theme="comfort"] .desktop-home .desktop-body,
html[data-theme="comfort"] .desktop-home .desktop-canvas,
html[data-theme="comfort"] .content,
html[data-theme="comfort"] .content.search-layout-page,
html[data-theme="comfort"] .content.catalog-list-page,
html[data-theme="comfort"] .main-area:has(.catalog-list-page, .search-layout-page),
html[data-theme="comfort"] .desktop-page-body:has(.catalog-list-page, .search-layout-page) {
  background-color: #30495d;
  color: #edf5fa;
}
html[data-theme="comfort"] .desktop-home .desktop-canvas:not(.has-terminal-wallpaper) { background-image: none; }

html[data-theme="comfort"] .desktop-home .desktop-menubar,
html[data-theme="comfort"] .desktop-home .desktop-toolbar,
html[data-theme="comfort"] .desktop-home .desktop-status,
html[data-theme="comfort"] .desktop-home .desktop-rail,
html[data-theme="comfort"] .desktop-home .desktop-toolbar-brand,
html[data-theme="comfort"] .desktop-home .desktop-shortcut,
html[data-theme="comfort"] .desktop-menubar,
html[data-theme="comfort"] .desktop-toolbar,
html[data-theme="comfort"] .desktop-status,
html[data-theme="comfort"] .desktop-rail,
html[data-theme="comfort"] .desktop-toolbar-brand,
html[data-theme="comfort"] .desktop-shortcut,
html[data-theme="comfort"] .desktop-page-menubar,
html[data-theme="comfort"] .topbar {
  background: #3b586d;
  border-color: #688398;
  color: #edf5fa;
  box-shadow: none;
}
html[data-theme="comfort"] .desktop-home .desktop-menu summary,
html[data-theme="comfort"] .desktop-home .desktop-menu-pending,
html[data-theme="comfort"] .desktop-home .desktop-menu-exit,
html[data-theme="comfort"] .desktop-home .desktop-toolbar-brand strong,
html[data-theme="comfort"] .desktop-home .desktop-shortcut,
html[data-theme="comfort"] .desktop-home .desktop-status,
html[data-theme="comfort"] .desktop-menu summary,
html[data-theme="comfort"] .desktop-menu-pending,
html[data-theme="comfort"] .desktop-menu-exit,
html[data-theme="comfort"] .desktop-toolbar-brand strong,
html[data-theme="comfort"] .desktop-shortcut,
html[data-theme="comfort"] .desktop-status,
html[data-theme="comfort"] .desktop-status strong { color: #edf5fa; }
html[data-theme="comfort"] .desktop-home .desktop-menu summary:hover,
html[data-theme="comfort"] .desktop-home .desktop-menu[open] summary,
html[data-theme="comfort"] .desktop-home .desktop-shortcut:hover:not(:disabled),
html[data-theme="comfort"] .desktop-menu summary:hover,
html[data-theme="comfort"] .desktop-menu[open] summary,
html[data-theme="comfort"] .desktop-shortcut:hover:not(:disabled),
html[data-theme="comfort"] .desktop-menu-items button:hover { background: #4b6c82; color: #fff; }
html[data-theme="comfort"] .desktop-menu-items { background: #3b586d; border-color: #7894a8; color: #edf5fa; }
html[data-theme="comfort"] .desktop-menu-items button { background: #3b586d; color: #edf5fa; }
html[data-theme="comfort"] .desktop-submenu-items {
  background: #3b586d;
  border-color: #7894a8;
  color: #edf5fa;
  box-shadow: 0 14px 28px rgb(9 24 36 / 35%);
}
html[data-theme="comfort"] .desktop-submenu-items button {
  background: #3b586d;
  color: #edf5fa;
}
html[data-theme="comfort"] .desktop-submenu-items button:hover:not(:disabled),
html[data-theme="comfort"] .desktop-menu-items button:hover:not(:disabled) {
  background: #56778d;
  color: #fff;
}
html[data-theme="comfort"] .desktop-menu-items .desktop-menu-item-pending,
html[data-theme="comfort"] .desktop-submenu-items .desktop-menu-item-pending,
html[data-theme="comfort"] .desktop-menu-items .desktop-menu-item-pending:hover {
  background: #405a6e;
  color: #b9cbd7;
}
html[data-theme="comfort"] .desktop-menu-item-pending small { color: #b9cbd7; }
html[data-theme="comfort"] .desktop-menu-station,
html[data-theme="comfort"] .desktop-menu-info { border-color: #7894a8; color: #e1edf4; }
html[data-theme="comfort"] .desktop-home .desktop-shortcut.unavailable {
  background: #40596b;
  border-color: #60798a;
  color: #b8c7d1;
  box-shadow: none;
}
html[data-theme="comfort"] .desktop-home .desktop-shortcut.unavailable:hover { background: #40596b; }
html[data-theme="comfort"] .desktop-shortcut.unavailable,
html[data-theme="comfort"] .desktop-shortcut.unavailable:hover {
  background: #40596b;
  border-color: #60798a;
  color: #b8c7d1;
  box-shadow: none;
  opacity: 1;
  filter: none;
}
html[data-theme="comfort"] .desktop-shortcut.unavailable .desktop-shortcut-icon img { opacity: .5; }
html[data-theme="comfort"] .desktop-status span { border-color: #688398; }
html[data-theme="comfort"] .desktop-menu[open] summary { box-shadow: inset 0 -2px #20b9c4; }

html[data-theme="comfort"] .panel,
html[data-theme="comfort"] .stat,
html[data-theme="comfort"] .search-layout-page > .panel,
html[data-theme="comfort"] .catalog-list-page > .panel {
  background: #6e8aa0;
  border-color: #829bae;
  box-shadow: 0 8px 24px rgb(12 30 44 / 16%);
  color: #112e43;
}
html[data-theme="comfort"] .panel-head,
html[data-theme="comfort"] .search-layout-page > .panel > .panel-head,
html[data-theme="comfort"] .catalog-list-page > .panel > .panel-head {
  background: #7793a9;
  border-color: #8ba4b6;
  color: #112e43;
}
html[data-theme="comfort"] .page-head h1,
html[data-theme="comfort"] .page-head p { color: #edf5fa; }
html[data-theme="comfort"] .panel-head h2,
html[data-theme="comfort"] .search-layout-page .panel-head h2,
html[data-theme="comfort"] .catalog-list-page .panel-head h2 { color: #102b3f; }
html[data-theme="comfort"] .panel-head p,
html[data-theme="comfort"] .search-layout-page .panel-head p,
html[data-theme="comfort"] .catalog-list-page .panel-head p { color: #233e51; }
html[data-theme="comfort"] .panel-head .grid-action-bar,
html[data-theme="comfort"] .panel-head .grid-action-bar > span { color: #233e51; }
html[data-theme="comfort"] .eyebrow,
html[data-theme="comfort"] .search-layout-page .eyebrow,
html[data-theme="comfort"] .catalog-list-page .eyebrow { color: #006d79; }
html[data-theme="comfort"] .panel .eyebrow { color: #006d79; }

html[data-theme="comfort"] .table-scroll,
html[data-theme="comfort"] .panel > .table-scroll,
html[data-theme="comfort"] .search-layout-page > .panel > .table-scroll,
html[data-theme="comfort"] .catalog-list-page > .panel > .table-scroll { background: #304c61; color: #edf5fa; }
html[data-theme="comfort"] th,
html[data-theme="comfort"] .search-layout-page > .panel > .table-scroll th,
html[data-theme="comfort"] .catalog-list-page > .panel > .table-scroll th {
  background: #425f75;
  border-color: #708ba0;
  color: #dbeaf4;
}
html[data-theme="comfort"] td,
html[data-theme="comfort"] .search-layout-page > .panel > .table-scroll td,
html[data-theme="comfort"] .catalog-list-page > .panel > .table-scroll td { border-color: #617d92; color: inherit; }
html[data-theme="comfort"] tbody tr { background: #304c61; color: #edf5fa; }
html[data-theme="comfort"] tbody tr:nth-child(even) { background: #39566b; }
html[data-theme="comfort"] tbody tr:hover,
html[data-theme="comfort"] .catalog-list-page > .panel > .table-scroll tbody tr:hover { background: #4a6d84; }
html[data-theme="comfort"] .grid-selectable-row.selected,
html[data-theme="comfort"] .search-layout-page .grid-selectable-row.selected,
html[data-theme="comfort"] .catalog-list-page .grid-selectable-row.selected,
html[data-theme="comfort"] .catalog-list-page .product-result-row.selected {
  background: #a8cbe9 !important;
  box-shadow: inset 3px 0 #098c98;
}
html[data-theme="comfort"] .grid-selectable-row.selected td,
html[data-theme="comfort"] .catalog-list-page .product-result-row.selected td { color: #102b40; }
/* The cash ledger uses color to encode entry nature; keep that semantic cue. */
html[data-theme="comfort"] .cash-flow-grid .cash-income td { background: #b9e8cb; color: #123a2c !important; }
html[data-theme="comfort"] .cash-flow-grid .cash-expense td { background: #efc3c3; color: #4a2020 !important; }
html[data-theme="comfort"] .cash-flow-grid .cash-bank td { background: #ead8a8; color: #473916 !important; }
html[data-theme="comfort"] .cash-flow-grid tr[data-cash-row].selected td { background: #a8cbe9 !important; color: #102b40 !important; }
/* Pastel status rows must use dark ink, including the selected receivable. */
html[data-theme="comfort"] .receivables-grid .receivable-overdue td,
html[data-theme="comfort"] .transfer-pending td { background: #efc3c3; color: #4a2020 !important; }
html[data-theme="comfort"] .receivables-grid .receivable-current td,
html[data-theme="comfort"] .transfer-delivered td { background: #b9e8cb; color: #123a2c !important; }
html[data-theme="comfort"] .receivables-grid .receivable-paid td { background: #c8dfec; color: #17384c !important; }
html[data-theme="comfort"] .transfer-partial td { background: #ead8a8; color: #473916 !important; }
html[data-theme="comfort"] .receivables-grid .receivable-row.selected td {
  box-shadow: inset 0 2px #174f67, inset 0 -2px #174f67;
}
/* Status colors used by product and customer registrations. */
html[data-theme="comfort"] .catalog-list-page .product-result-row.product-stock-zero {
  background: #e7d7be;
  color: #3c2e1d;
}
html[data-theme="comfort"] .catalog-list-page .product-result-row.product-stock-negative {
  background: #e9bfc0;
  color: #4e2024;
}
html[data-theme="comfort"] .catalog-list-page .product-result-row.product-stock-uncontrolled {
  background: #c9d8e2;
  color: #17384c;
}
html[data-theme="comfort"] .catalog-list-page .customer-blocked { background: #e9bfc0; color: #4e2024; }
html[data-theme="comfort"] .catalog-list-page .customer-spc { background: #e9d0ad; color: #48341b; }
html[data-theme="comfort"] .catalog-list-page .customer-collection { background: #dfc0de; color: #48244a; }
html[data-theme="comfort"] .catalog-list-page :is(.product-stock-zero, .product-stock-negative, .product-stock-uncontrolled, .customer-blocked, .customer-spc, .customer-collection) td {
  color: inherit;
}
html[data-theme="comfort"] .catalog-list-page :is(.product-stock-zero, .product-stock-negative, .product-stock-uncontrolled, .customer-blocked, .customer-spc, .customer-collection) .link:not(.danger-link) { color: #07566b; }
html[data-theme="comfort"] .catalog-list-page .product-result-row.selected td,
html[data-theme="comfort"] .catalog-list-page .product-result-row.selected .link:not(.danger-link) { color: #102b40; }
html[data-theme="comfort"] .product-stock-zero .product-stock-label { color: #63431b; }
html[data-theme="comfort"] .product-stock-negative .product-stock-label { color: #74292e; }
html[data-theme="comfort"] .product-stock-uncontrolled .product-stock-label { color: #36566b; }
html[data-theme="comfort"] .table-scroll .link:not(.danger-link) { color: #c8f1f3; }
html[data-theme="comfort"] .product-load-status {
  background: #56748a;
  border-color: #819bad;
  color: #eff6fa;
}
html[data-theme="comfort"] .product-stock-detail,
html[data-theme="comfort"] .customer-summary {
  background: #6e8aa0;
  border-color: #829bae;
  color: #102b40;
}
html[data-theme="comfort"] .product-stock-detail .subtle,
html[data-theme="comfort"] .customer-summary > span,
html[data-theme="comfort"] .customer-summary div span { color: #234256; }
html[data-theme="comfort"] .page-numbers button {
  background: #496a80;
  border-color: #8ba4b6;
  color: #f1f7fa;
}
html[data-theme="comfort"] .page-numbers button.active { background: #115b75; color: #fff; }
html[data-theme="comfort"] .page-numbers button:disabled { background: #587286; color: #d5e1e9; }
html[data-theme="comfort"] .cash-summary tr.cash-total td { background: #c8dce7; color: #17384c; }

html[data-theme="comfort"] :is(.catalog-list-page, .search-layout-page) > .search-panel > :is(.search-grid, .sales-period-filters),
html[data-theme="comfort"] .search-grid,
html[data-theme="comfort"] .sales-period-filters { background: #7793a9; color: #102b40; }
html[data-theme="comfort"] :is(.catalog-list-page, .search-layout-page) > .search-panel .field > span,
html[data-theme="comfort"] .search-panel .field > span { color: #102b40; }
html[data-theme="comfort"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="comfort"] select,
html[data-theme="comfort"] textarea,
html[data-theme="comfort"] :is(.catalog-list-page, .search-layout-page) > .search-panel :is(input:not([type="checkbox"]), select) {
  background: #3d5b70;
  border-color: #718da2;
  color: #f2f8fc;
}
html[data-theme="comfort"] input::placeholder,
html[data-theme="comfort"] textarea::placeholder { color: #c4d5e0; opacity: 1; }
html[data-theme="comfort"] input:focus,
html[data-theme="comfort"] select:focus,
html[data-theme="comfort"] textarea:focus { border-color: #79d0d6; box-shadow: 0 0 0 3px rgb(121 208 214 / 24%); }
html[data-theme="comfort"] .primary,
html[data-theme="comfort"] :is(.catalog-list-page, .search-layout-page) > .search-panel .search-actions button { background: #008b93; border-color: #008b93; color: #fff; }
html[data-theme="comfort"] .primary:hover:not(:disabled),
html[data-theme="comfort"] :is(.catalog-list-page, .search-layout-page) > .search-panel .search-actions button:hover { background: #00767e; }
html[data-theme="comfort"] .secondary { background: #4a6a80; border-color: #a5c0d2; color: #f3f8fb; }
html[data-theme="comfort"] .secondary:hover:not(:disabled) { background: #5a7c93; border-color: #c5dce9; }
html[data-theme="comfort"] .link:not(.danger-link),
html[data-theme="comfort"] .search-layout-page .link,
html[data-theme="comfort"] .catalog-list-page .link { color: #d6f8fa; }
html[data-theme="comfort"] .panel .link:not(.danger-link) { color: #003e52; }
html[data-theme="comfort"] .paging { background: #6e8aa0; border-color: #829bae; color: #102b40; }
html[data-theme="comfort"] .muted,
html[data-theme="comfort"] .empty { color: #d5e4ee; }
/* Dialogs remain a low-glare light surface so their established field/status cues survive. */
html[data-theme="comfort"] .modal,
html[data-theme="comfort"] .modal.erp-registration-modal,
html[data-theme="comfort"] .modal-backdrop .product-modal {
  color-scheme: light;
  background: #d9e5ed;
  color: #173449;
  border-color: #9bb2c2;
}
html[data-theme="comfort"] .modal-body,
html[data-theme="comfort"] .erp-registration-modal > .modal-body,
html[data-theme="comfort"] .product-modal .modal-body,
html[data-theme="comfort"] .product-modal form { background: #d9e5ed; color: #173449; }
html[data-theme="comfort"] .erp-registration-modal > .modal-body > form,
html[data-theme="comfort"] .erp-registration-modal.customer-modal > .customer-form,
html[data-theme="comfort"] .product-modal .product-legacy-sheet,
html[data-theme="comfort"] .product-modal .product-compatibility-section {
  background: #e9f1f5;
  color: #173449;
  border-color: #adc1ce;
}
html[data-theme="comfort"] .modal input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="comfort"] .modal select,
html[data-theme="comfort"] .modal textarea {
  background: #f1f6f9;
  color: #173449;
  border-color: #9db5c3;
}
html[data-theme="comfort"] .modal input::placeholder,
html[data-theme="comfort"] .modal textarea::placeholder { color: #607b8b; }
html[data-theme="comfort"] .modal .subtle { color: #456579; }
