body.has-sidebar {
  --sidebar-width:clamp(164px,13vw,184px);
  background:#f4f7fa;
  --accent:#0752ec;
  --accent-light:#edf2ff
}

body.has-sidebar.sidebar-collapsed {
  --sidebar-width:64px
}

.app-sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:var(--sidebar-width);
  display:flex;
  flex-direction:column;
  background:#f9fbfd;
  border-right:1px solid #e8edf4;
  z-index:60
}

.app-sidebar[hidden] {
  display:none
}

.sidebar-brand {
  height:54px;
  min-height:54px;
  padding:10px 12px;
  display:flex;
  align-items:center
}

.sidebar-brand>a {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:var(--tms-ink)
}

.sidebar-mark {
  font-size:28px;
  font-weight:850;
  color:var(--tms-link);
  letter-spacing:-2px;
  line-height:1
}

.sidebar-brand-text {
  display:flex;
  flex-direction:column;
  gap:3px;
  white-space:nowrap
}

.sidebar-brand-text b {
  font-size:12px
}

.sidebar-brand-text small {
  font-size:8px;
  color:var(--tms-secondary)
}

.sidebar-nav {
  padding:8px;
  overflow:auto;
  flex:1;
  min-height:0
}

.sidebar-link {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:38px;
  padding:10px 12px;
  margin-bottom:2px;
  color:#536071;
  font-size:12px;
  border:0;
  background:none;
  width:100%;
  text-align:left;
  border-radius:8px;
  white-space:nowrap;
  cursor:pointer
}

.sidebar-link>.ui-icon {
  flex-shrink:0;
  color:#6b788b
}

.sidebar-link:hover {
  background:#edf2fa;
  color:#0752ec
}

.sidebar-link.on {
  color:#0752ec;
  background:#e8efff;
  font-weight:650
}

.sidebar-link.on>.ui-icon {
  color:inherit
}

.sidebar-divider {
  height:1px;
  background:#edf0f5;
  margin:12px 8px
}

.sidebar-bottom {
  padding:8px;
  border-top:1px solid #edf0f5
}

.sidebar-more {
  margin-top:8px
}

.sidebar-more>summary {
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px 12px;
  color:#7a879a;
  cursor:pointer;
  font-size:11px;
  list-style:none;
  border-radius:8px
}

.sidebar-more>summary::-webkit-details-marker {
  display:none
}

.sidebar-more>summary .ui-icon:last-child {
  margin-left:auto
}

.sidebar-more .sidebar-link {
  font-size:11px;
  min-height:34px
}

.sidebar-collapse {
  font-size:11px;
  color:#8993a4
}

.sidebar-collapsed .sidebar-label,.sidebar-collapsed .sidebar-brand-text,.sidebar-collapsed .sidebar-more>summary>.ui-icon:last-child {
  display:none
}

.sidebar-collapsed .sidebar-link,.sidebar-collapsed .sidebar-more>summary {
  justify-content:center;
  padding:10px
}

.sidebar-collapsed .sidebar-brand {
  justify-content:center;
  padding:10px 0
}

body.has-sidebar #topbar {
  margin-left:var(--sidebar-width);
  min-height:48px;
  height:48px;
  padding:0 20px;
  gap:16px;
  background:#fff;
  z-index:50
}

body.has-sidebar #app {
  margin-left:var(--sidebar-width);
  margin-right:0;
  max-width:none;
  padding:18px 20px;
  width:auto;
  min-width:0
}

body.has-sidebar #app.load-wide {
  width:auto
}

body.has-sidebar #depBan,body.has-sidebar #managementBands,body.has-sidebar #sysBan {
  margin-left:var(--sidebar-width)
}

body.has-sidebar .shell-route-nav {
  display:flex;
  align-items:center;
  min-width:0
}

.shell-route-nav .qt-tabs {
  display:flex;
  margin:0;
  border:0;
  background:none;
  gap:16px;
  padding:0;
  white-space:nowrap
}

.shell-route-nav .qt-tabs>a {
  padding:18px 4px 16px;
  color:#374151;
  font-size:11px;
  font-weight:500;
  display:flex;
  align-items:center;
  gap:6px;
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  background:none
}

.shell-route-nav .qt-tabs>a.on {
  color:#0752ec;
  font-weight:650;
  border-bottom-color:#0752ec;
  background:none
}

.shell-route-nav .qt-tabs>a>.ui-icon {
  display:none
}

.shell-tab-count {
  font-size:10px;
  background:#f1f4f8;
  border-radius:5px;
  padding:1px 4px;
  color:#68758a
}

.on>.shell-tab-count {
  color:#0752ec;
  background:#eaf1ff
}

.shell-page-label {
  font-size:16px;
  font-weight:650;
  color:#283449
}

body.has-sidebar.has-page-heading #topbar { height:auto; min-height:48px; }
body.has-sidebar.has-page-heading .shell-route-nav { flex-direction:column; align-items:flex-start; gap:2px; padding:8px 0; }
.has-page-heading .shell-route-nav .qt-tabs>a { padding:4px 4px 3px; }
.page-heading-actions > .orders-title-sub { margin:0; }

.shell-route-nav .shell-page-title {
  margin:0;
  font-size:16px;
  line-height:1.3;
  letter-spacing:0;
  white-space:nowrap;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis
}

.page-heading-actions-only {
  justify-content:flex-end
}

.page-heading-actions[hidden] {
  display:none!important
}

.has-sidebar #app .qt-tabs {
  display:none
}

.orders-page .page-head {
  margin-bottom:0;
  align-items:flex-start
}

.orders-page .page-head h1 {
  font-size:26px;
  line-height:1.15;
  letter-spacing:-.5px;
  margin:0
}

.orders-page .page-head .acts {
  padding-top:4px;
  gap:10px
}

.orders-page .page-head .btn {
  font-size:12px;
  border-radius:7px;
  padding:10px 14px
}

.shell-search {
  position:relative;
  display:flex;
  align-items:center;
  margin-left:auto;
  max-width:320px;
  min-width:140px;
  flex:1
}

.shell-search>.ui-icon {
  position:absolute;
  left:10px;
  color:#929cac;
  width:14px;
  height:14px
}

.shell-search>.inp {
  padding:7px 48px 7px 30px;
  font-size:11px;
  border-color:#e7ebf1;
  border-radius:7px;
  background:#fcfdff
}

.shell-search>kbd {
  position:absolute;
  right:8px;
  color:#9aa3b0;
  font-size:10px;
  font-family:inherit
}

.shell-search #shellSearchResults {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  width:360px;
  max-width:calc(100vw - 24px);
  max-height:65vh;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 12px 36px #18233524;
  background:#fff;
  z-index:70;
  padding:6px
}

.shell-search #shellSearchResults a {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:6px;
  color:#344054;
  font-size:12px
}

.shell-search #shellSearchResults a:hover,.shell-search #shellSearchResults a:focus {
  background:#eef3ff
}

.shell-search #shellSearchResults a small {
  display:block;
  font-size:11px;
  color:#8490a1;
  margin-top:4px
}

.shell-search-empty {
  padding:14px;
  color:#8490a1;
  font-size:12px
}

.shell-user {
  display:flex;
  flex-direction:column;
  gap:3px;
  text-align:left;
  max-width:155px;
  overflow:hidden
}

.shell-user b {
  font-size:11px;
  font-weight:650;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden
}

.shell-user small {
  font-size:10px;
  color:#8993a4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

body.has-sidebar .me-btn {
  border:0;
  background:none;
  display:flex;
  align-items:center;
  gap:10px;
  padding:4px 0;
  border-radius:6px
}

body.has-sidebar .me-btn .av {
  height:30px;
  width:30px;
  background:#758398;
  color:#fff;
  font-size:11px
}

.has-sidebar .top-r {
  gap:20px;
  margin-left:0
}

.has-sidebar .bell-btn {
  border:0;
  background:transparent
}

.shell-menu-toggle {
  display:none
}

#sidebarBackdrop {
  display:none
}

body.has-sidebar .nav-more {
  display:none!important
}

@media(max-width:1550px) {
  .has-sidebar .top-r>.pp-wrap {
    display:none
  }
}

@media(max-width:1100px) {
  body.has-sidebar #topbar {
    padding:0 14px;
    gap:12px
  }
  .shell-route-nav .qt-tabs {
    gap:8px
  }
  .shell-route-nav .qt-tabs>a {
    font-size:10px
  }
  .shell-user {
    max-width:90px
  }
  .shell-search>kbd {
    display:none
  }
  .shell-search>.inp {
    padding-right:9px
  }
  .has-sidebar .top-r {
    gap:12px
  }
}

@media(max-width:900px) {
  body.has-sidebar {
    --sidebar-width:0px
  }
  body.has-sidebar #topbar {
    margin-left:0;
    padding:0 12px;
    gap:10px;
    position:sticky;
    top:0
  }
  .app-sidebar {
    width:220px;
    transform:translateX(-100%);
    visibility:hidden;
    z-index:90;
    box-shadow:8px 0 40px #20365722
  }
  .sidebar-mobile-open .app-sidebar {
    transform:none;
    visibility:visible
  }
  .sidebar-mobile-open #sidebarBackdrop {
    display:block;
    position:fixed;
    inset:0;
    border:0;
    background:#18223555;
    z-index:80
  }
  .sidebar-mobile-open {
    overflow:hidden
  }
  .shell-menu-toggle {
    display:grid;
    place-items:center;
    flex-shrink:0
  }
  .shell-user {
    display:none
  }
  .shell-search {
    min-width:90px;
    max-width:220px
  }
  .shell-route-nav .qt-tabs>a {
    padding:17px 2px;
    font-size:10px
  }
  .shell-route-nav .qt-tabs {
    gap:10px
  }
  .shell-route-nav .qt-tabs>a:last-child {
    display:none
  }
  body.has-sidebar #app {
    padding:16px 12px
  }
  .sidebar-more .sidebar-link {
    min-height:38px;
    font-size:12px
  }
  .sidebar-bottom {
    padding:10px
  }
  .sidebar-collapse .ui-icon {
    transform:rotate(180deg)
  }
}

@media(max-width:580px) {
  .shell-search {
    max-width:none
  }
  .shell-route-nav {
    display:none!important
  }
  body.has-sidebar.has-page-heading #topbar {
    height:auto;
    padding-top:8px;
    padding-bottom:10px;
    flex-wrap:wrap
  }
  body.has-sidebar.has-page-heading .shell-route-nav {
    display:flex!important;
    order:1;
    flex-basis:100%;
    padding:0
  }
  .has-page-heading .shell-page-title {
    white-space:normal;
    overflow-wrap:anywhere
  }
  .has-sidebar .top-r {
    gap:6px
  }
  .has-sidebar .top-r .cloud-st {
    display:none
  }
  body.has-sidebar #topbar {
    gap:8px
  }
  .shell-search #shellSearchResults {
    right:-70px;
    width:340px
  }
  .sidebar-brand {
    height:60px
  }
  .orders-page .page-head h1 {
    font-size:25px
  }
  .orders-page .page-head {
    gap:12px
  }
  .has-sidebar .test-badge {
    font-size:9px
  }
}

@media print {
  .app-sidebar,#sidebarBackdrop,.shell-route-nav,.shell-search {
    display:none!important
  }
  body.has-sidebar #app,body.has-sidebar #topbar,body.has-sidebar #depBan,body.has-sidebar #managementBands,body.has-sidebar #sysBan {
    margin-left:0
  }
  body.has-sidebar {
    --sidebar-width:0px
  }
}

.sidebar-more>summary {
  white-space:nowrap;
  gap:8px
}

.sidebar-more>summary .sidebar-label {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis
}

.sidebar-bottom {
  position:relative
}

.sidebar-collapse {
  position:absolute;
  right:-11px;
  top:auto;
  bottom:calc(100dvh - 90px);
  width:22px;
  min-height:22px;
  height:22px;
  border:1px solid #dde5ef;
  background:white;
  padding:0;
  display:grid;
  place-items:center;
  box-shadow:0 2px 5px #2036570a
}

.sidebar-collapse .sidebar-label {
  display:none
}

.sidebar-collapse>.ui-icon {
  width:14px;
  height:14px
}

.sidebar-collapsed .sidebar-collapse {
  padding:0
}

body.has-sidebar #fbBtn {
  position:absolute;
  left:auto;
  right:10px;
  bottom:16px;
  width:26px;
  height:26px;
  background:none;
  border:0;
  box-shadow:none;
  z-index:1
}

body.sidebar-collapsed #fbBtn {
  display:none
}

@media(max-width:900px) {
  .sidebar-collapse {
    position:absolute;
    top:14px;
    right:12px;
    bottom:auto;
    width:28px;
    height:28px;
    min-height:28px;
    border:0
  }
  .sidebar-collapse>.ui-icon {
    width:18px;
    height:18px;
    transform:none
  }
}

/* Staff TMS only. The dark palette is opt-in on the root element. */
@media screen {
  body.has-sidebar {
    --tms-calendar-scheme:light;
    --tms-bg:#fdf9ec;
    --tms-surface:#fff;
    --tms-soft:#fffdf6;
    --tms-border:#ede5cc;
    --tms-row:#f5efdc;
    --tms-strong:#dcd0a8;
    --tms-ink:#1f2a27;
    --tms-secondary:#5f5a48;
    --tms-muted:#8a8470;
    --tms-brand:#1d8171;
    --tms-hover:#176b5e;
    --tms-link:#176b5e;
    --tms-on-brand:#fff;
    --tms-accent:#f2b632;
    --tms-success-bg:#e3f1ec;
    --tms-success:#11574c;
    --tms-info-bg:#e3edf8;
    --tms-info:#1e4e86;
    --tms-warning-bg:#fce3c4;
    --tms-warning:#7a4600;
    --tms-error-bg:#fbe4e0;
    --tms-error:#8e1b12;
    --tms-neutral-bg:#f1ede0;
    --tms-neutral:#5f5a48;
    background-color:var(--tms-bg);
  }
  html[data-tms-theme="dark"] body.has-sidebar {
    --tms-calendar-scheme:dark;
    --tms-bg:#1c1b17;
    --tms-surface:#24231e;
    --tms-soft:#2b2a24;
    --tms-border:#3a372d;
    --tms-row:#302e26;
    --tms-strong:#4a4638;
    --tms-ink:#f1ede0;
    --tms-secondary:#b5ae98;
    --tms-muted:#8c8672;
    --tms-brand:#2a9b88;
    --tms-hover:#33ae99;
    --tms-link:#7fcfc1;
    --tms-on-brand:#1c1b17;
    --tms-success-bg:#123c36;
    --tms-success:#9fddd1;
    --tms-info-bg:#16304d;
    --tms-info:#a9c8ee;
    --tms-warning-bg:#4a3314;
    --tms-warning:#f5c98a;
    --tms-error-bg:#4a1e19;
    --tms-error:#f4a99e;
    --tms-neutral-bg:#2b2a24;
    --tms-neutral:#b5ae98;
  }

  body.has-sidebar #appSidebar { background:var(--tms-soft); border-color:var(--tms-border); }
  #appSidebar .sidebar-bottom { border-color:var(--tms-border); }
  #appSidebar .sidebar-link, #appSidebar summary { color:var(--tms-secondary); }
  #appSidebar .sidebar-link:hover, #appSidebar summary:hover { background:var(--tms-row); }
  #appSidebar .sidebar-link.on { color:var(--tms-link); background:var(--tms-success-bg); }
  #appSidebar .sidebar-link > .ui-icon { color:inherit; }
  #appSidebar .sidebar-divider { background:var(--tms-border); }
  body.has-sidebar #topbar { background:var(--tms-surface); border-color:var(--tms-border); }
  #topbar :is(.shell-page-title,.shell-page-label,.shell-user b,.me-btn,.shell-menu-toggle) { color:var(--tms-ink); }
  #topbar :is(.shell-user small,.qt-tabs a,.shell-search kbd,.shell-search > .ui-icon) { color:var(--tms-secondary); }
  #topbar .qt-tabs a.on { color:var(--tms-link); border-color:var(--tms-brand); }
  #topbar .shell-search .inp { color:var(--tms-ink); background:var(--tms-soft); border-color:var(--tms-border); }
  #topbar .shell-search .inp::placeholder { color:var(--tms-secondary); opacity:1; }
  body.has-sidebar #topbar :is(.nt-wrap > .bell,.diagnostics-cloud-actions > .btn-ghost) {
    background-color:var(--tms-surface); color:var(--tms-ink); border-color:var(--tms-border);
    &:hover { background-color:var(--tms-row); }
    &:focus-visible { outline:2px solid var(--tms-link); outline-offset:2px; }
  }
  #topbar .me-btn .av { color:var(--tms-link); background:var(--tms-success-bg); }

  #appSidebar .sidebar-collapse { background:var(--tms-surface); border-color:var(--tms-border); }
  #appSidebar .sidebar-collapse:hover { background:var(--tms-row); }

  /* Order stages carry a configurable inline tint. Retain the tint and border;
     the stage name needs a separate foreground on a dark table row. */
  html[data-tms-theme="dark"] #app .orders-table .st-badge[style] { color:var(--tms-ink)!important; }

  /* Embedded boards, branded documents and previews own their palettes. */
  body.has-sidebar :is(#app,#modalRoot):not(:has(.bb-board,.doc,.rcpt,.office-receipt,.idcp-office-price-sheet)),
  /* These staff overlays mount directly under body. Exclude embedded branded screens. */
  body.has-sidebar:not(:has(.bb-board,.doc,.rcpt,.office-receipt,.idcp-office-price-sheet)) > #idcpDecisionRoot,
  body.has-sidebar:where(:has(:is(#app,#modalRoot) .dr-trigger[aria-expanded="true"])):not(:has(.bb-board,.doc,.rcpt,.office-receipt,.idcp-office-price-sheet)) > .dr-popup,
  body.has-sidebar:where(:has(:is(#app,#modalRoot) .ss-trigger[aria-expanded="true"])):not(:has(.bb-board,.doc,.rcpt,.office-receipt,.idcp-office-price-sheet)) > .ss-popup {
    --bg:var(--tms-bg);
    --card:var(--tms-surface);
    --panel:var(--tms-surface);
    --text:var(--tms-ink);
    --muted:var(--tms-secondary);
    --border:var(--tms-border);
    --accent:var(--tms-link);
    --accent-light:var(--tms-success-bg);
    --green:var(--tms-success);
    --green-light:var(--tms-success-bg);
    --amber:var(--tms-warning);
    --amber-light:var(--tms-warning-bg);
    --danger:var(--tms-error);
    --danger-light:var(--tms-error-bg);
    --grey:var(--tms-neutral);
    --grey-light:var(--tms-neutral-bg);
    --purple:var(--tms-info);
    --purple-light:var(--tms-info-bg);
    --star:var(--tms-accent);
    color:var(--text);

    &.dr-popup {
      input[type="date"] { color-scheme:var(--tms-calendar-scheme); }
      input[type="date"]:focus { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:1px; }
      .dr-presets button:is(:active,.on) { background:var(--tms-brand); color:var(--tms-on-brand); }
    }
    .order-workspace {
      --workspace-ink:var(--text);
      --workspace-muted:var(--muted);
      --workspace-blue:var(--tms-link);
      --workspace-line:var(--border);
      --workspace-green:var(--tms-success);
    }
    :is(.card,.kpi,.oc-tile,.cc-k,.workspace-card,.workspace-print-wrap,.workspace-hero,.workspace-tabs-bar,
        .table-ui-card,.orders-table,.modal,.modal-head,.modal-body,.modal-foot,.table-ui-popup,
        .order-save-bar,.att,.pos,.pos-b,.order-card-view,.workspace-button) {
      background:var(--panel); border-color:var(--border); color:var(--text);
    }
    :is(.btn-ghost,.icon-btn,.inp,.ss-trigger,.dr-trigger,.code-inp,.cbc-inp,.modal-close,
        .table-ui-pager select,.order-list-number,.orders-row-menu,.orders-search,.btn[class="btn btn-sm"],.mk-chip,.dlv-c,.cc-chk button,.oc-det summary) {
      color:var(--text); border-color:var(--border); background-color:var(--panel);
    }
    :is(input,textarea)::placeholder { color:var(--muted); opacity:1; }
    :is(.modal label,.help,.hint,.opt,.order-list-deal,.order-list-created,.sub,.orders-selection,
        .orders-pagination,.order-list-code,.workspace-meta small,.field > label,.upsell-eyebrow) { color:var(--muted); }
    :is(.btn-ghost:hover,.icon-btn:hover,.orders-table tbody tr:hover,.orders-table tbody tr:hover td) {
      background-color:var(--tms-row);
    }
    :is(.orders-table th,.seg,.cc-seg,.cc-k.off,.pos-h,.workspace-manager-comment,.code) {
      background:var(--tms-soft); border-color:var(--border); color:var(--muted);
    }
    .orders-table td { border-color:var(--border); }
    :is(.seg button,.cc-seg button,.order-card-tab,.table-sort-button) { color:var(--muted); }
    :is(.seg button.on,.cc-seg button.on,.mk-chip.on,.dlv-c.on,.att.on,.workspace-avatar,.order-card-tab[aria-selected="true"]) {
      color:var(--tms-link); background:var(--tms-success-bg); border-color:var(--tms-brand);
    }
    :is(.btn-primary,.btn-green,.workspace-save):not(:disabled) {
      background:var(--tms-brand); border-color:var(--tms-brand); color:var(--tms-on-brand);
    }
    :is(.btn-primary,.btn-green,.workspace-save):not(:disabled):hover {
      background:var(--tms-hover); border-color:var(--tms-hover); color:var(--tms-on-brand);
    }
    :is(.btn-primary,.btn-green,.workspace-save):disabled {
      background:var(--tms-neutral-bg); border-color:var(--tms-strong); color:var(--tms-secondary);
    }
    :is(.b-green,.workspace-service-number,.workspace-assignment-status,.workspace-status) { background:var(--green-light); color:var(--green); }
    :is(.b-blue,.b-purple,.workspace-assignment-status.working) { background:var(--tms-info-bg); color:var(--tms-info); }
    :is(.b-amber,.cc-plate.amb,.oc-pin,.rt-soon,.workspace-assignment-status.waiting) { background:var(--amber-light); color:var(--amber); }
    :is(.b-red,.rt-late,.workspace-status.cancelled) { background:var(--danger-light); color:var(--danger); }
    .b-grey { background:var(--grey-light); color:var(--grey); }
    .workspace-assignment-status.overdue { background:var(--danger-light)!important; color:var(--danger)!important; }
    .workspace-status > span { background:currentColor; }
    .upsell-progress {
      background:linear-gradient(var(--panel),var(--panel)) padding-box,
        conic-gradient(var(--tms-brand) var(--upsell-progress,0%),var(--border) 0) border-box;
    }
    .oc-acts .btn-primary.pa-btn:not(.pa-pay,.pa-bill) {
      background:var(--tms-soft); color:var(--text); border-color:var(--border);
    }
    .workspace-rating { color:var(--tms-warning); }
    .cc-urg .seg button.on { background:var(--tms-accent); color:#1f2a27; }
    :is(button,a,input,select,textarea,summary):focus-visible {
      outline:2px solid var(--tms-link); outline-offset:2px;
    }
  }
  body.has-sidebar #modalRoot .modal {
    :is(.pm-t,.dt-box,.dt-dd) { background-color:var(--tms-surface); }
    :is(.pm-t.def,.pm-sel) { background-color:var(--tms-success-bg); }
    .dt-box input { background:transparent; color:var(--tms-ink); }
    :is(.dt-prev,.dt-dd .g) { background-color:var(--tms-soft); }
    :is(.dt-tag,.dt-tag i,.dt-tag button,.dt-chipl span) { color:var(--tms-info); }
    .dt-dd .cb { border-color:var(--tms-strong); }
    :is(.dt-lb .n,.dt-dd .cb.on) { background:var(--tms-brand); color:var(--tms-on-brand); }
    .cn-pay { background-color:var(--tms-soft); border-color:var(--tms-border); }
  }
  body.has-sidebar:not(:has(.bb-board,.doc,.rcpt,.office-receipt,.idcp-office-price-sheet)) > #idcpDecisionRoot .btn-danger {
    background-color:var(--tms-error-bg); color:var(--tms-error); border-color:var(--tms-error);
  }
  body.has-sidebar.orders-page {
    #topbar .shell-tab-count { background:var(--tms-neutral-bg); color:var(--tms-secondary); }
    #topbar .on > .shell-tab-count { background:var(--tms-success-bg); color:var(--tms-link); }

    #app {
      /* Tint the row awaiting review. The margin stripe and priority warning have their own meaning. */
      .orders-table tbody tr.order-unread:not(.order-priority) {
        --order-row-base:var(--tms-success-bg);
        > td { background-color:var(--order-row-base); }
        &:hover > td { background-color:color-mix(in srgb,var(--tms-brand) 12%,var(--order-row-base)); }
      }
      .orders-table tbody tr:not(.order-priority):has(.orders-check-col input:checked) {
        > td { background-color:color-mix(in srgb,var(--tms-brand) 22%,var(--order-row-base,var(--tms-surface))); }
        &:hover > td { background-color:color-mix(in srgb,var(--tms-brand) 30%,var(--order-row-base,var(--tms-surface))); }
      }
      .orders-table :is(.order-list-number,.orders-row-menu) { background-color:transparent; }
      .orders-table input[type=checkbox],.orders-selection input[type=checkbox] { accent-color:var(--tms-brand); }
      .orders-row-menu summary { color:var(--tms-secondary); }
      .orders-row-menu > div,.orders-date-range,.orders-stat { background:var(--tms-surface); border-color:var(--tms-border); }
      .orders-row-menu button:not(.del) { color:var(--tms-ink); }
      .orders-row-menu button:hover,.orders-row-menu summary:hover { background:var(--tms-row); }
      .orders-reset { color:var(--tms-link); }
      :is(.orders-search,.orders-date-range) > .ui-icon,.orders-stat-label,.orders-stat-note { color:var(--tms-secondary); }
      .orders-stat.blue .orders-stat-icon { background:var(--tms-success-bg); color:var(--tms-link); }
      .orders-filter-count,.orders-page-buttons [aria-current=page] { background:var(--tms-brand); color:var(--tms-on-brand); }
    }
  }
  :is(#appSidebar,#topbar) :is(.sidebar-link,.sidebar-brand a,.shell-menu-toggle,.me-btn,#shellSearch):focus-visible {
    outline:2px solid var(--tms-link); outline-offset:2px;
  }
}
