/* Shared staff interface palette. Status text and icons retain their meaning. */
:root {
  --bs-info: #52c1cc;
  --bs-info-rgb: 82, 193, 204;
  --bs-info-bg-subtle: #e4f6f7;
  --bs-info-text-emphasis: #205e64;
  --bs-secondary: #704481;
  --bs-secondary-rgb: 112, 68, 129;
  --bs-secondary-bg-subtle: #f3e6fb;
  --bs-secondary-text-emphasis: #704481;
  --staff-coral: #ff603c;
  --staff-teal: #52c1cc;
  --staff-lilac: #dfbaf2;
  --staff-ink: #141414;
  --staff-paper: #ffffff;
  --staff-canvas: #f5f5f5;
  --staff-rule: #e8e8e8;
  --staff-muted: #666666;
}
html:not([data-bs-theme='dark']) .backend-theme {
  --bs-body-bg: #f5f5f5;
  --bs-body-color: #414141;
  --bs-heading-color: #141414;
  --bs-border-color: #e8e8e8;
  --bs-paper-bg: #ffffff;
  background: var(--staff-canvas);
  color: #414141;
}
.backend-theme:has(.metrics-app) .btn-primary {
  --bs-btn-color: #ffffff; --bs-btn-bg: #ce4325; --bs-btn-border-color: #ce4325;
  --bs-btn-hover-color: #ffffff; --bs-btn-hover-bg: #b53b20; --bs-btn-hover-border-color: #b53b20;
  --bs-btn-active-color: #ffffff; --bs-btn-active-bg: #b53b20; --bs-btn-active-border-color: #b53b20;
  --bs-btn-disabled-color: #ffffff; --bs-btn-disabled-bg: #ce4325; --bs-btn-disabled-border-color: #ff603c;
  background: #ce4325; color: #ffffff; border-color: #ff603c; box-shadow: none;
}
.backend-theme:has(.metrics-app) .btn-primary:is(:hover,:focus,:active), .backend-theme:has(.metrics-app) .btn-primary.active { background: #b53b20 !important; color: #ffffff !important; border-color: #b53b20 !important; }
.backend-theme :is(.btn,.pagination .page-link) { border-radius: 999px; }
.backend-theme:has(.metrics-app) .btn-label-primary, .backend-theme:has(.metrics-app) .btn-outline-primary { color: #a6361c; border-color: #ffc3b4; background: #fff0e9; }
.backend-theme:has(.metrics-app) :is(.btn-label-primary,.btn-outline-primary):hover { background: #ce4325; color: #ffffff; border-color: #ff603c; }
.backend-theme :is(.btn-label-secondary,.bg-label-secondary) { background: #f3e6fb !important; color: #704481 !important; }
.backend-theme .bg-label-primary { background: #fff0e9 !important; color: #a6361c !important; }
.backend-theme .bg-label-info { background: #e4f6f7 !important; color: #205e64 !important; }
.backend-theme .text-primary { color: #a6361c !important; }
.backend-theme .progress-bar { background-color: #ff603c; color: #141414; }
.backend-theme .progress-bar.bg-info { background-color: #52c1cc !important; }
.backend-theme .progress-bar.bg-secondary { background-color: #dfbaf2 !important; color: #141414; }
.backend-theme .bg-primary { background-color: #ce4325 !important; color: #ffffff; }
.backend-theme :is(.nav-pills .nav-link.active,.dropdown-item.active) { background: #ce4325; border-color: #ff603c; color: #ffffff; box-shadow: none; }
.backend-theme .nav-tabs .nav-link.active { color: #a6361c; border-bottom-color: #ff603c; }
.backend-theme :is(.form-control,.form-select,.input-group-text,.select2-container--default .select2-selection--single,.select2-container--default .select2-selection--multiple) { border-radius: 12px; border-color: var(--staff-rule); }
.backend-theme :is(.form-control,.form-select,.select2-selection):focus { border-color: #696cff; box-shadow: 0 0 0 3px rgb(105 108 255 / 16%); }
/* Match standalone login fields and merged password controls at every size. */
.backend-theme .vendora-auth-form { --auth-field-height: 3rem; }
.backend-theme .vendora-auth-field > .form-control,
.backend-theme .vendora-auth-field .input-group.input-group-merge {
  height: var(--auth-field-height);
  min-height: var(--auth-field-height);
  border-width: 1px;
}
.backend-theme .vendora-auth-field > .form-control:focus {
  border-color: #696cff;
  box-shadow: 0 0 0 1px #696cff;
}
/* The password group owns its border; its input and reveal control share it. */
.backend-theme .vendora-auth-field .input-group.input-group-merge {
  border: 1px solid var(--staff-rule);
  border-radius: 12px;
  background: var(--staff-paper);
}
.backend-theme .vendora-auth-field .input-group.input-group-merge:focus-within {
  border-color: #696cff;
  box-shadow: 0 0 0 1px #696cff;
}
.backend-theme .vendora-auth-field .input-group.input-group-merge::before {
  box-shadow: none;
}
.backend-theme .vendora-auth-field .input-group.input-group-merge > :is(.form-control,.input-group-text),
.backend-theme .vendora-auth-field .input-group.input-group-merge > :is(.form-control,.input-group-text):focus {
  border: 0;
  height: 100%;
  min-height: 0;
  margin-inline: 0;
  box-shadow: none;
  outline: none;
}
@media (max-width: 767.98px) {
  .backend-theme .vendora-auth-form { --auth-field-height: 2.7rem; }
}
.backend-theme .form-check-input:checked { background-color: #ff603c; border-color: #ff603c; }
.backend-theme .form-check-input:focus { border-color: #696cff; box-shadow: 0 0 0 3px rgb(105 108 255 / 16%); }
.backend-theme .form-switch .form-check-input:checked { background-color: #ff603c; }
.backend-theme .form-label { font-weight: 500; }
.backend-theme .select2-container--default .select2-results__option--highlighted[aria-selected] { background: #ce4325; color: #ffffff; }
.backend-theme .select2-container { max-width: 100%; min-width: 0; }
.backend-theme :is(a,button,summary):focus-visible { outline: 2px solid #a6361c; outline-offset: 3px; }
html:not([data-bs-theme='dark']) .backend-theme :is(.card,.order-card,.order-stat-widget,.modal-content,.offcanvas,.dropdown-menu) { background: #ffffff; border-color: #e8e8e8; box-shadow: none; }
.backend-theme :is(.card,.order-card,.order-stat-widget) { border: 1px solid var(--staff-rule); border-radius: 24px; }
.backend-theme :is(.modal-content,.dropdown-menu) { border-radius: 18px; }
html:not([data-bs-theme='dark']) .backend-theme .order-stat-widget.active-filter { background: #fff0e9; border-color: #ff603c; box-shadow: 0 0 0 1px #ff603c; }
html:not([data-bs-theme='dark']) .backend-theme .layout-navbar { background: #ffffff !important; border-radius: 22px; box-shadow: none; border: 1px solid #e8e8e8; }
.backend-theme {
  --staff-table-head: #e4f6f7;
  --staff-table-head-ink: #205e64;
  --staff-table-row-odd: #f2fafb;
  --staff-table-row-even: #fbf6fd;
  --staff-table-row-hover: #e4f6f7;
}
.backend-theme .table { --bs-table-border-color: var(--staff-rule); --bs-table-hover-bg: var(--staff-table-row-hover); --bs-table-striped-bg: var(--staff-table-row-odd); }
html:not([data-bs-theme='dark']) .backend-theme .table { --bs-table-color: #414141; --bs-table-bg: #ffffff; }
.backend-theme .table > thead > tr > :is(th,td) { --bs-table-bg: var(--staff-table-head); background: var(--staff-table-head); color: var(--staff-table-head-ink); }
/* Row variables work for plain, striped and dynamically paginated tables.
   Explicit Bootstrap status rows/cells and selected rows keep their own states. */
.backend-theme .table:not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark) > tbody > tr:not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark,.table-active,.selected):nth-child(odd) { --bs-table-bg: var(--staff-table-row-odd); --bs-table-striped-bg: var(--staff-table-row-odd); }
.backend-theme .table:not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark) > tbody > tr:not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark,.table-active,.selected):nth-child(even) { --bs-table-bg: var(--staff-table-row-even); --bs-table-striped-bg: var(--staff-table-row-even); }
.backend-theme .table > tbody > tr:not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark,.table-active,.selected):hover > :not(.table-primary,.table-secondary,.table-success,.table-danger,.table-warning,.table-info,.table-light,.table-dark,.table-active) { --bs-table-bg-state: var(--staff-table-row-hover); }
.backend-theme .table th { font-weight: 600; }
.backend-theme .table td { vertical-align: middle; }
.backend-theme .badge { border-radius: 999px; }
.backend-theme :is(.apexcharts-tooltip,.apexcharts-tooltip-title,.apexcharts-tooltip-text,.apexcharts-tooltip-series-group) { border: 0 !important; color: #ffffff !important; }
.backend-theme .apexcharts-tooltip.apexcharts-theme-light { background: #141414; }
.backend-theme .apexcharts-tooltip-title { background: #141414 !important; }
.backend-theme .apexcharts-tooltip :is(span,div) { color: #ffffff !important; }
.backend-theme :is(.tooltip-inner,.apexcharts-xaxistooltip,.apexcharts-yaxistooltip) { background: #141414; color: #ffffff; border: 0; }
.backend-theme .bs-tooltip-top { --bs-tooltip-bg: #141414; --bs-tooltip-color: #ffffff; }
html[data-bs-theme='dark'] .backend-theme { --staff-paper: #252525; --staff-canvas: #1b1b1b; --staff-rule: #444444; --staff-muted: #bdbdbd; }
html[data-bs-theme='dark'] .backend-theme .text-primary { color: #ffab96 !important; }
html[data-bs-theme='dark'] .backend-theme {
  --staff-table-head: #253f42;
  --staff-table-head-ink: #d3f2f4;
  --staff-table-row-odd: #253638;
  --staff-table-row-even: #312b39;
  --staff-table-row-hover: #304a4d;
}
html[data-bs-theme='dark'] .backend-theme .table { --bs-table-border-color: #444444; }
.backend-theme .metrics-button, .backend-theme .metrics-nav a[aria-current='page'] { background: #ce4325; color: #ffffff; }
.backend-theme .metrics-button:hover { background: #b53b20; color: #ffffff; }
/* Account management and upload actions retain the original control palette. */
.backend-theme :is(label.btn-primary:has(input[type='file']),.btn-primary:has(.bx-upload)),
.backend-theme:has(#formAccountSettings,#formAccountPassword) .btn-primary,
.backend-theme:has(#formAccountSettings,#formAccountPassword) .nav-pills .nav-link.active {
  background: #696cff; border-color: #696cff; color: #ffffff;
  --bs-btn-bg: #696cff; --bs-btn-border-color: #696cff;
  --bs-btn-disabled-bg: #696cff; --bs-btn-disabled-border-color: #696cff;
}
.backend-theme :is(label.btn-primary:has(input[type='file']),.btn-primary:has(.bx-upload)):is(:hover,:focus,:active),
.backend-theme:has(#formAccountSettings,#formAccountPassword) .btn-primary:is(:hover,:focus,:active) {
  background: #5f61e6 !important; border-color: #5456cc !important; color: #ffffff !important;
}
.backend-theme:has(#formAccountSettings,#formAccountPassword) :is(.btn-outline-primary,.btn-label-primary) { color: #696cff; border-color: #696cff; background: transparent; }
.backend-theme:has(#formAccountSettings,#formAccountPassword) :is(.btn-outline-primary,.btn-label-primary):hover { background: #696cff; color: #ffffff; }
.backend-theme input[type='file']::file-selector-button { background: #696cff; color: #ffffff; }

/* Keep the menu pin arrow legible on the active blue background. */
.backend-theme #layout-menu .menu-item.active > .menu-pin-btn,
.backend-theme #layout-menu .menu-item.active > .menu-pin-btn .toggle-icon { color: #ffffff !important; }

/* Shared summary-card surfaces for catalogue, orders and operational lists. */
.summary-blue { --summary-bg: #eeefff; --summary-rule: #dcdeff; --summary-ink: #4144a8; --summary-icon: #dfe1ff; }
.summary-lilac { --summary-bg: #f5eafa; --summary-rule: #ead7f3; --summary-ink: #714187; --summary-icon: #ead7f3; }
.summary-turquoise { --summary-bg: #e4f5f6; --summary-rule: #c8e8eb; --summary-ink: #21616a; --summary-icon: #c8e8eb; }
.summary-coral { --summary-bg: #ffede6; --summary-rule: #f9d8ca; --summary-ink: #a6361c; --summary-icon: #ffdacb; }
.backend-theme .summary-card { background: var(--summary-bg) !important; border-color: var(--summary-rule); }
.backend-theme .summary-card :is(h4,strong,.text-heading,.text-success,.text-danger,.text-warning,.text-info) { color: var(--summary-ink) !important; }
.backend-theme .summary-card :is(.text-muted,span:not([class])) { color: #45434b !important; }
.backend-theme .summary-card :is(.avatar-initial,.filter-icon-bg,.avatar[class*='bg-label-']) { background: var(--summary-icon) !important; color: var(--summary-ink) !important; }
.backend-theme .summary-card:is(.border-primary,.active-filter) { border-color: #696cff !important; outline: 2px solid #696cff; outline-offset: 2px; }
.backend-theme a.summary-card:focus-visible { outline: 3px solid #696cff; outline-offset: 3px; }
[data-bs-theme='dark'] .backend-theme .summary-card { background: #282b3d !important; border-color: #484b60; }
[data-bs-theme='dark'] .backend-theme .summary-card :is(h4,strong,.text-heading,.text-success,.text-danger,.text-warning,.text-info) { color: var(--summary-icon) !important; }
[data-bs-theme='dark'] .backend-theme .summary-card :is(.text-muted,span:not([class])) { color: #d8d6e3 !important; }
