.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: transparent;
  color: inherit;
}

.theme-toggle svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
.theme-toggle svg[hidden] { display: none; }
.theme-toggle .theme-label { color: inherit; font-size: 12px; }
.theme-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.login-theme-actions { display: flex; justify-content: flex-end; margin: -8px 0 8px; }

/* Approved A login: scoped to the staff entry; customer auth stays independent. */
.shop-login.login-wrap {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100svh;
  padding: 96px 24px 64px;
  background: var(--film-canvas);
  color: var(--film-ink);
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shop-login::before, .shop-login::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: 112px;
  height: 112px;
  border-color: var(--film-control-border);
  border-style: solid;
  opacity: .42;
}
.shop-login::before { left: max(8%, calc(50% - 412px)); top: 17%; border-width: 1px 0 0 1px; }
.shop-login::after { right: max(8%, calc(50% - 412px)); bottom: 14%; border-width: 0 1px 1px 0; }
.shop-login-tools { position: absolute; top: 24px; right: 32px; display: flex; align-items: center; gap: 12px; z-index: 2; }
.shop-login-tools .theme-toggle, .shop-login-tools .language-setting-trigger { min-height: 44px; border: 1px solid var(--film-border); border-radius: 6px; background: var(--film-surface); color: var(--film-muted); padding: 8px 12px; font-size: 12px; }
.shop-login-tools .language-setting-menu { position: relative; width: auto; }
.shop-login-tools .language-setting-trigger { display: flex; align-items: center; gap: 8px; }
.shop-login-tools .language-setting-options { position: absolute; right: 0; top: 100%; min-width: 180px; margin: 8px 0 0; padding: 8px; border: 1px solid var(--film-border); border-radius: 8px; background: var(--film-surface); }
.shop-login-tools .language-setting-option { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--film-ink); text-align: left; font-size: 13px; }
.shop-login-tools .language-setting-option[aria-pressed="true"] { background: var(--film-accent-soft); color: var(--film-button); }
.shop-login-composition { width: 100%; max-width: 432px; }
.shop-login-identity { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; }
.shop-login-mark { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid currentColor; background: var(--film-surface); color: var(--film-accent); font-family: Georgia, serif; font-size: 25px; }
.shop-login-mark > span { position: absolute; right: 4px; bottom: 4px; width: 3px; height: 3px; background: currentColor; }
.shop-login-identity strong { font-size: 16px; letter-spacing: 3px; font-weight: 600; }
.shop-login-identity small { display: block; margin-top: 5px; color: var(--film-muted); font-size: 9px; letter-spacing: 3px; }
.shop-login-panel { overflow: hidden; background: var(--film-surface); border: 1px solid var(--film-border); border-radius: 12px; box-shadow: 0 8px 24px color-mix(in srgb, var(--film-ink) 4%, transparent); }
.shop-login-heading { padding: 28px 32px 24px; background: var(--film-inset); border-bottom: 1px solid var(--film-border); }
.shop-login-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 11px; line-height: 1.5; letter-spacing: 1px; color: var(--film-muted); }
.shop-login-eyebrow > span { width: 14px; height: 14px; border: 1px solid var(--film-accent); position: relative; flex: 0 0 auto; }
.shop-login-eyebrow > span::after { content: ""; position: absolute; inset: 3px; border-top: 1px solid var(--film-accent); border-left: 1px solid var(--film-accent); }
.shop-login h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.35; font-weight: 600; letter-spacing: -.6px; text-wrap: balance; }
.shop-login-heading p { margin: 0; color: var(--film-muted); font-size: 13px; line-height: 1.6; }
.shop-login form { padding: 28px 32px 24px; }
.shop-login-fields { display: grid; gap: 20px; }
.shop-login .field { display: block; min-width: 0; margin: 0; font-size: 12px; font-weight: 500; color: var(--film-ink); }
.shop-login input { display: block; width: 100%; min-width: 0; height: 48px; margin: 10px 0 0; padding: 12px; border: 1px solid var(--film-control-border); border-radius: 6px; background: var(--film-inset); color: var(--film-ink); font-size: 14px; font-weight: 400; }
.shop-login input::placeholder { color: var(--film-muted); opacity: 1; }
.shop-login-password-label { display: flex; align-items: center; justify-content: space-between; min-height: 24px; gap: 12px; }
.shop-login-password-label label { font-size: 12px; font-weight: 500; }
.shop-login-show-password { min-height: 44px; margin: -10px 0; padding: 10px 0 10px 12px; border: 0; background: transparent; color: var(--film-muted); font-size: 11px; }
.shop-login .shop-login-submit { width: 100%; min-height: 48px; margin-top: 28px; padding: 12px; border: 0; border-radius: 6px; background: var(--film-button); color: var(--film-button-text); font-size: 13px; font-weight: 500; }
.shop-login .shop-login-submit:hover { background: var(--film-button-hover); color: var(--film-button-text); }
.shop-login .shop-login-submit:disabled { cursor: wait; opacity: .65; }
.shop-login-secondary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; padding: 12px 24px; border-top: 1px solid var(--film-border); background: var(--film-inset); }
.shop-login-secondary > span { color: var(--film-muted); font-size: 11px; }
.shop-login-secondary a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px; color: var(--film-ink); text-decoration: none; font-size: 12px; }
.shop-login-secondary a:hover, .shop-login-show-password:hover { color: var(--film-accent); }
.shop-login-tools .theme-toggle:hover, .shop-login-tools .language-setting-trigger:hover, .shop-login-tools .language-setting-option:hover { background: var(--film-inset); color: var(--film-ink); }
.shop-login :is(button, input, summary, a):focus-visible { outline: 2px solid var(--film-focus); outline-offset: 4px; }
.shop-login :is(button, a, summary) { transition-property: background-color, color; transition-duration: var(--motion-feedback); transition-timing-function: var(--motion-ease-feedback); }
html[data-theme="dark"] .shop-login-panel { box-shadow: none; }
@media (max-width: 600px) {
  .shop-login.login-wrap { padding: 96px 16px 36px; }
  .shop-login::before, .shop-login::after { display: none; }
  .shop-login-tools { top: 20px; right: 16px; gap: 8px; }
  .shop-login-identity { margin-bottom: 24px; }
  .shop-login-heading, .shop-login form { padding: 24px; }
  .shop-login-eyebrow { margin-bottom: 12px; }
  .shop-login-secondary { padding: 12px 20px; }
  .shop-login input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-login :is(button, a, summary) { transition: none; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-canvas: #1a1a1a;
  --theme-surface: #242424;
  --theme-raised: #2c2c2c;
  --theme-inset: #1c1c1c;
  --theme-text: #ececec;
  --theme-muted: #aaa;
  --theme-border: rgba(255, 255, 255, .1);
  --theme-accent: #e5e5e5;
  --theme-accent-soft: #383838;
  --theme-selected: #383838;
  --theme-focus: #bdbdbd;
  --theme-success-bg: #26372c;
  --theme-success-text: #a7d9b3;
  --theme-warning-bg: #45351f;
  --theme-warning-text: #f1c875;
  --theme-danger-bg: #472a2a;
  --theme-danger-text: #ffb4ab;
  --theme-neutral-bg: #303236;
  --theme-neutral-text: #c0c4ca;
  --theme-pending-bg: #352b46;
  --theme-pending-text: #d2b6f0;
  --theme-info-bg: #24384b;
  --theme-info-text: #9bc7ed;
  --film-canvas: var(--theme-canvas);
  --film-surface: var(--theme-surface);
  --film-raised: var(--theme-raised);
  --film-inset: var(--theme-inset);
  --film-ink: var(--theme-text);
  --film-muted: var(--theme-muted);
  --film-border: var(--theme-border);
  --film-control-border: rgba(255, 255, 255, .18);
  --film-accent: var(--theme-accent);
  --film-accent-soft: var(--theme-accent-soft);
  --film-focus: var(--theme-focus);
  --film-danger: var(--theme-danger-text);
  --film-button: var(--theme-accent);
  --film-button-hover: #f1f1f1;
  --film-button-text: #202020;
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] #app {
  min-height: 100%;
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="dark"] .shell,
html[data-theme="dark"] .support-shell,
html[data-theme="dark"] .anonymous-shell,
html[data-theme="dark"] .login-wrap {
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff {
  --ops-bg: var(--theme-canvas);
  --ops-surface: var(--theme-surface);
  --ops-border: var(--theme-border);
  --ops-ink: var(--theme-text);
  --ops-muted: var(--theme-muted);
  --ops-accent: var(--theme-accent);
  --ops-accent-soft: var(--theme-accent-soft);
  --ops-warning: var(--theme-warning-text);
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .layout,
html[data-theme="dark"] .staff .workspace,
html[data-theme="dark"] .staff main,
html[data-theme="dark"] .management-shell .layout,
html[data-theme="dark"] .management-shell main {
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .shop-sidebar,
html[data-theme="dark"] .staff .top,
html[data-theme="dark"] .staff .panel,
html[data-theme="dark"] .staff .stat,
html[data-theme="dark"] .staff .order-card,
html[data-theme="dark"] .staff .roll-card,
html[data-theme="dark"] .staff .order-inspector,
html[data-theme="dark"] .staff .orders-table-scroll,
html[data-theme="dark"] .staff .dashboard-queue-item,
html[data-theme="dark"] .staff .client-link,
html[data-theme="dark"] .staff .management-kpi,
html[data-theme="dark"] .staff .permission-pair,
html[data-theme="dark"] .staff .impact-preview {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .orders-table th,
html[data-theme="dark"] .staff .meta div,
html[data-theme="dark"] .staff .delivery,
html[data-theme="dark"] .staff .equipment-assignment,
html[data-theme="dark"] .staff .inventory-status,
html[data-theme="dark"] .staff .service-history-item {
  background-color: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(h1, h2, h3, strong, th, td, dt, dd, legend, label),
html[data-theme="dark"] .management-shell :is(h1, h2, h3, strong, th, td, dt, dd, legend, label) {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(.muted, .field, .field small, .queue-row small, .nav-scroll-hint, .side-environment small, .side-brand small, .side-account small, .orders-table th, .orders-table td, .orders-empty, .inspector-header small, .inspector-customer span, .inspector-summary, .inspector-roll dt, .inspector-roll dd, .event, .event time, .roll-head small, .meta label, .management-kpi small),
html[data-theme="dark"] .management-shell :is(.muted, .field, .field small, .queue-row small, .event, .event time, .management-kpi small) {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff h1,
html[data-theme="dark"] .staff h2,
html[data-theme="dark"] .staff h3,
html[data-theme="dark"] .staff .section-heading h2,
html[data-theme="dark"] .staff .order-row-open strong,
html[data-theme="dark"] .staff .order-row-title,
html[data-theme="dark"] .staff .inspector-customer strong,
html[data-theme="dark"] .staff .inspector-roll-heading strong,
html[data-theme="dark"] .staff .inspector-roll dd,
html[data-theme="dark"] .staff .orders-empty strong {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .eyebrow,
html[data-theme="dark"] .management-shell .eyebrow {
  color: #fff;
}

html[data-theme="dark"] .staff .business-nav .nav-item,
html[data-theme="dark"] .staff .shop-sidebar .side-tool,
html[data-theme="dark"] .staff .workspace-name,
html[data-theme="dark"] .staff .orders-table td,
html[data-theme="dark"] .staff .order-row-open span,
html[data-theme="dark"] .staff .order-row-open small,
html[data-theme="dark"] .staff .receipt-count,
html[data-theme="dark"] .staff .attention-cell,
html[data-theme="dark"] .staff .side-environment strong,
html[data-theme="dark"] .staff .management-kpi strong {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .business-nav .nav-item:hover,
html[data-theme="dark"] .staff .side-tool:hover,
html[data-theme="dark"] .staff .dashboard-queue-item:hover {
  background-color: var(--theme-raised);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .business-nav .nav-item.active {
  background: var(--theme-selected);
  color: #ffffff;
}

html[data-theme="dark"] .staff .shop-sidebar .business-nav .nav-item .nav-count {
  background: var(--theme-raised);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .side-environment strong {
  background: var(--theme-accent-soft);
  color: #fff;
}

html[data-theme="dark"] .staff .side-environment,
html[data-theme="dark"] .staff .top-search input,
html[data-theme="dark"] .staff .orders-table th,
html[data-theme="dark"] .staff .order-preview {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .top-search {
  background: var(--theme-raised);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .staff .top-search .top-search-submit,
html[data-theme="dark"] .staff .button.secondary {
  background: var(--theme-accent-soft);
  color: #fff;
}

html[data-theme="dark"] .staff .top .right .pill {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .top .right {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .button.light,
html[data-theme="dark"] .staff .icon-button {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .button:not(.light):not(.secondary):not(.warn) {
  background: #fff;
  color: #000;
}

html[data-theme="dark"] .staff .button:not(.light):not(.secondary):not(.warn):hover {
  background: rgba(255, 255, 255, .82);
}

html[data-theme="dark"] .staff .button.warn,
html[data-theme="dark"] .staff .badge.amber,
html[data-theme="dark"] .staff .notice.amber {
  background: var(--theme-warning-bg);
  border-color: rgba(255, 255, 255, .34);
  color: var(--theme-warning-text);
}

html[data-theme="dark"] .staff .badge,
html[data-theme="dark"] .staff .notice,
html[data-theme="dark"] .staff .step {
  background: var(--theme-success-bg);
  color: var(--theme-success-text);
}

html[data-theme="dark"] .staff .badge.red,
html[data-theme="dark"] .staff .notice.red {
  background: var(--theme-danger-bg);
  color: var(--theme-danger-text);
}

html[data-theme="dark"] .staff .badge.gray {
  background: var(--theme-neutral-bg);
  color: var(--theme-neutral-text);
}

html[data-theme="dark"] .staff .badge.purple {
  background: var(--theme-pending-bg);
  color: var(--theme-pending-text);
}

html[data-theme="dark"] .staff .badge.blue {
  background: var(--theme-info-bg);
  color: var(--theme-info-text);
}

html[data-theme="dark"] .staff .staff-order-roll-state .badge.orange-soft { background: #463a2d; color: #dbb78b; }
html[data-theme="dark"] .staff .staff-order-roll-state .badge.orange { background: var(--theme-warning-bg); color: var(--theme-warning-text); }
html[data-theme="dark"] .staff .staff-order-roll-state .badge.blue-soft { background: #293b4f; color: #a7c4e5; }
html[data-theme="dark"] .staff .staff-order-roll-state .badge.purple-soft { background: #382f46; color: #cfbce1; }

html[data-theme="dark"] .staff .step.done {
  background: var(--theme-success-bg);
  color: #fff;
}

html[data-theme="dark"] .staff .trend-column,
html[data-theme="dark"] .staff .trend-column small,
html[data-theme="dark"] .staff .management-kpi strong small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .trend-column i,
html[data-theme="dark"] .staff .trend-bar rect {
  fill: var(--theme-raised);
  background: var(--theme-raised);
}

html[data-theme="dark"] .staff .trend-column i.has-value,
html[data-theme="dark"] .staff .trend-bar rect.has-value {
  fill: var(--theme-accent);
  background: var(--theme-accent);
}

html[data-theme="dark"] .staff .order-preview-backdrop {
  background: rgba(0, 0, 0, .72);
}

html[data-theme="dark"] :is(.panel, .stat, .order-card, .roll-card, .delivery, .permission-pair, .management-kpi, .impact-preview, .client-link, .customer-service, .customer-order-card, .customer-order-preview, .customer-preview-roll, .orders-empty, .finance-line, .timeline, .event, .negative-choice, .equipment-assignment, .inventory-card, .coupon-card, .benefit-card, .gallery-card) {
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] :is(.panel, .stat, .order-card, .roll-card, .delivery, .permission-pair, .management-kpi, .impact-preview, .client-link, .customer-service, .customer-order-card, .customer-order-preview, .customer-preview-roll, .login-box, .support-shell .panel, .anonymous-shell .panel, .modal) {
  background-color: var(--theme-surface);
}

html[data-theme="dark"] :is(.muted, .field, .field small, .queue-row small, .customer-preview-roll, .finance-line, .event, .event time, .customer-service small, .customer-service span, .customer-order-card small, .customer-order-preview small, .demo-accounts, .login-box p, .login-box .eyebrow) {
  color: var(--theme-muted);
}

html[data-theme="dark"] :is(h1, h2, h3, p, strong, label, legend, dt, dd, th, td) {
  color: var(--theme-text);
}

html[data-theme="dark"] a {
  color: #fff;
}

html[data-theme="dark"] a:hover {
  color: rgba(255, 255, 255, .82);
}

html[data-theme="dark"] .eyebrow {
  color: #fff;
}

html[data-theme="dark"] .customer-nav,
html[data-theme="dark"] .customer-nav button[aria-current="page"],
html[data-theme="dark"] .customer-nav button:hover {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .customer-nav button[aria-current="page"],
html[data-theme="dark"] .customer-nav button:hover {
  background-color: var(--theme-accent-soft);
  color: #fff;
}

html[data-theme="dark"] .customer-hero {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .customer-hero p {
  color: var(--theme-muted);
}

html[data-theme="dark"] .customer-hero:after {
  border-color: rgba(255, 255, 255, .22);
}

html[data-theme="dark"] .customer-hero p,
html[data-theme="dark"] .order-card p,
html[data-theme="dark"] .stat span {
  color: var(--theme-muted);
}

html[data-theme="dark"] .login-box,
html[data-theme="dark"] .support-shell main,
html[data-theme="dark"] .anonymous-shell main {
  color: var(--theme-text);
}

html[data-theme="dark"] .demo-accounts,
html[data-theme="dark"] .login-box .demo-accounts {
  border-top-color: var(--theme-border);
}

html[data-theme="dark"] .field,
html[data-theme="dark"] .login-box .field,
html[data-theme="dark"] .modal .field {
  color: var(--theme-muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color-scheme: dark;
  background-color: var(--theme-inset);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(255, 255, 255, .68);
  opacity: 1;
}

html[data-theme="dark"] select option {
  background: var(--theme-surface);
  color: var(--theme-text);
}

html[data-theme="dark"] :is(.field select, .orders-filters select) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%23adbed3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
  accent-color: var(--theme-accent);
}

html[data-theme="dark"] :is(.button.light, .button.secondary) {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .button.warn {
  background: var(--theme-warning-bg);
  color: var(--theme-warning-text);
}

html[data-theme="dark"] .button:disabled,
html[data-theme="dark"] button:disabled {
  background: rgba(0, 0, 0, .72);
  border-color: rgba(255, 255, 255, .28);
  color: var(--theme-muted);
}

html[data-theme="dark"] :is(.badge, .notice) {
  background: var(--theme-success-bg);
  color: var(--theme-success-text);
}

html[data-theme="dark"] :is(.badge.amber, .notice.amber) {
  background: var(--theme-warning-bg);
  color: var(--theme-warning-text);
}

html[data-theme="dark"] :is(.badge.red, .notice.red, .toast.error) {
  background: var(--theme-danger-bg);
  color: var(--theme-danger-text);
}

html[data-theme="dark"] .badge.gray {
  background: var(--theme-neutral-bg);
  color: var(--theme-neutral-text);
}

/* Keep sidebar scrolling and count/tool colors aligned with the active theme. */
@media (min-width: 651px) {
  .staff .shop-sidebar {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overscroll-behavior-y: contain;
  }
}
.staff .shop-sidebar,
.staff .shop-sidebar .business-nav {
  scrollbar-color: rgba(255, 255, 255, .68) transparent;
  scrollbar-width: thin;
}
html[data-theme="dark"] .staff .shop-sidebar,
html[data-theme="dark"] .staff .shop-sidebar .business-nav {
  scrollbar-color: rgba(255, 255, 255, .58) transparent;
}
.staff .shop-sidebar .nav-item .nav-count {
  background: var(--film-accent-soft);
  color: var(--film-button);
}
.staff .shop-sidebar .side-tool { color: var(--film-ink); }
.staff .shop-sidebar .side-tool:hover,
.staff .shop-sidebar .side-tool.active {
  background: var(--film-accent-soft);
  color: var(--film-button);
}
.staff .creation-progress li[aria-current="step"] span {
  color: var(--film-button-text);
}

/* Staff topbar: greeting and account actions stay together; search anchors right. */
.staff .staff-topbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.4vw, 36px);
  min-height: 84px;
  padding: 12px clamp(18px, 2.4vw, 36px);
  overflow: visible;
}
.staff-topbar-leading,
.staff-greeting { display: flex; align-items: center; }
.staff-topbar-leading { gap: 15px; min-width: 0; flex: 0 1 auto; }
.staff-topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.staff-greeting { gap: 13px; min-width: 0; }
.staff-user-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid var(--film-border);
  border-radius: 50%;
  background: var(--film-accent-soft);
  color: var(--film-button);
  font-size: 19px;
  font-weight: 750;
}
.staff-greeting-copy { display: grid; min-width: 0; gap: 4px; }
.staff-greeting-copy strong {
  overflow: hidden;
  color: var(--film-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-greeting-copy small { overflow: hidden; color: var(--film-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.staff-account-menu { position: relative; flex: 0 0 auto; }
/* Lift the native popover stacking context above the sibling search controls. */
.staff .staff-topbar .staff-account-menu[open] { z-index: 20; }
.staff-account-menu > summary {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--film-ink);
  cursor: pointer;
  list-style: none;
}
.staff-account-menu > summary::-webkit-details-marker { display: none; }
.staff-account-menu > summary:hover,
.staff-account-menu[open] > summary { background: var(--film-accent-soft); color: var(--film-button); }
.staff-account-menu > summary:focus-visible { outline: 3px solid var(--film-focus); outline-offset: 2px; }
.staff-account-menu > summary svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.staff-account-menu-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  z-index: 20;
  display: grid;
  width: 236px;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--film-border);
  border-radius: 14px;
  background: var(--film-surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .14);
}
.staff-account-menu-panel .theme-toggle,
.staff-account-menu-panel .account-menu-item {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--film-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.staff-account-menu-panel .theme-toggle:hover,
.staff-account-menu-panel .account-menu-item:hover { background: var(--film-accent-soft); color: var(--film-button); }
.staff-account-menu-panel .language-setting-trigger { min-height: 44px; border: 1px solid var(--film-border); border-radius: 9px; background: var(--film-surface); }
.staff-account-menu-panel .language-setting-trigger:hover,
.staff-account-menu-panel .language-setting-menu[open] > .language-setting-trigger { background: var(--film-accent-soft); color: var(--film-button); }
.staff-account-menu-panel .language-setting-trigger:focus-visible { outline: 2px solid var(--film-focus); outline-offset: 1px; }
.staff-account-menu-panel .theme-toggle svg { width: 18px; height: 18px; }
.staff-account-menu-panel .theme-toggle .theme-label { color: inherit; font-size: inherit; }
.staff-account-menu-panel .account-menu-icon { display: grid; width: 20px; place-items: center; color: var(--film-muted); font-size: 18px; }
.staff-account-menu-panel .account-menu-logout { margin-top: 3px; border-top: 1px solid var(--film-border); border-radius: 0 0 9px 9px; padding-top: 11px; }
.staff-account-menu-panel > small { padding: 6px 10px 3px; color: var(--film-muted); font-size: 11px; }
.language-setting-menu { width: 100%; interpolate-size: allow-keywords; }
.language-setting-trigger { box-sizing: border-box; cursor: pointer; list-style: none; }
.language-setting-trigger::-webkit-details-marker { display: none; }
.language-setting-current { flex: 1; min-width: 0; }
.language-setting-icon { flex: 0 0 20px; font-size: 16px; font-weight: 700; }
.language-setting-icon svg { width: 20px; height: 20px; }
.language-setting-chevron { display: block; width: 15px; height: 15px; flex: 0 0 auto; margin-left: auto; color: var(--film-muted); transition: transform var(--motion-panel) var(--motion-ease-move); }
.language-setting-menu[open] .language-setting-chevron { transform: rotate(90deg); }
.language-setting-options { display: grid; gap: 4px; margin: 5px 0 2px; padding-left: 30px; }
.staff-account-menu-panel .language-setting-option { min-height: 36px; padding: 7px 10px; font-size: 13px; font-weight: 500; }
.staff-account-menu-panel .language-setting-option[aria-pressed="true"] { background: var(--film-accent-soft); color: var(--film-button); }
.customer-settings { position: relative; }
.customer-settings > summary { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid currentColor; border-radius: 8px; cursor: pointer; list-style: none; }
.customer-settings > summary::-webkit-details-marker { display: none; }
.customer-settings > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.customer-settings .staff-account-menu-panel { right: 0; left: auto; }
.notification-menu { position: relative; flex: 0 0 auto; }
.notification-menu > summary {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--film-ink);
  cursor: pointer;
  list-style: none;
}
.notification-menu > summary::-webkit-details-marker { display: none; }
.notification-menu > summary:hover,
.notification-menu[open] > summary { background: var(--film-accent-soft); color: var(--film-button); }
.notification-menu > summary:focus-visible { outline: 3px solid var(--film-focus); outline-offset: 2px; }
.notification-menu > summary svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--film-surface);
  border-radius: 999px;
  background: var(--film-accent);
  color: var(--film-button-text);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  right: auto;
  z-index: 30;
  display: flex;
  width: min(360px, calc(100vw - 28px));
  max-height: min(70vh, 540px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--film-border);
  border-radius: 14px;
  background: var(--film-surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .14);
}
.notification-panel-head { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--film-border); }
.notification-panel-head > span { display: grid; gap: 3px; }
.notification-panel-head strong { color: var(--film-ink); font-size: 14px; }
.notification-panel-head small { color: var(--film-muted); font-size: 11px; }
.notification-panel .notification-panel-head > button { min-height: 34px; padding: 6px 9px; border: 0; border-radius: 8px; background: var(--film-accent-soft); color: var(--film-button); font-size: 12px; font-weight: 700; }
.notification-list { min-height: 0; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.notification-panel button.notification-item { display: grid; width: 100%; min-height: 0; gap: 5px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--film-ink); text-align: left; }
.notification-panel button.notification-item:hover { background: var(--film-raised); }
.notification-panel button.notification-item.is-unread { background: var(--film-accent-soft); }
.notification-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notification-item-head strong { color: var(--film-button); font-size: 11px; }
.notification-item-head time { color: var(--film-muted); font-size: 10px; white-space: nowrap; }
.notification-item-title { color: var(--film-ink); font-size: 13px; font-weight: 700; line-height: 1.35; }
.notification-item small { overflow-wrap: anywhere; color: var(--film-muted); font-size: 12px; line-height: 1.45; }
.notification-empty { margin: 0; padding: 24px 12px; color: var(--film-muted); font-size: 12px; text-align: center; }
@media (max-width: 899px) {
  .staff-topbar-actions { gap: 1px; }
  .notification-menu .notification-panel { position: fixed; top: var(--notification-mobile-top, 12px); right: max(14px, env(safe-area-inset-right)); left: auto; }
}
.staff .top-search {
  display: flex;
  width: min(100%, 520px);
  max-width: 520px;
  min-width: min(320px, 48vw);
  flex: 0 1 520px;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.staff .top-search-control {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  padding: 3px 4px 3px 13px;
  border: 1px solid var(--film-control-border);
  border-radius: 12px;
  background: var(--film-inset);
}
.staff .top-search-control:focus-within { border-color: var(--film-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--film-focus) 16%, transparent); }
.staff .top-search .top-search-control input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 4px 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--film-ink);
  font-size: 14px;
}
.staff .top-search .top-search-control input:focus-visible { border: 0; box-shadow: none; }
.staff .top-search .top-search-scan {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--film-muted) !important;
}
.staff .top-search .top-search-scan:hover { background: var(--film-accent-soft) !important; color: var(--film-button) !important; }
.staff .top-search .top-search-scan:focus-visible,
.staff .top-search .top-search-submit:focus-visible { outline: 3px solid var(--film-focus); outline-offset: 2px; }
.staff .top-search .top-search-scan svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.staff .top-search .top-search-submit {
  width: auto;
  min-width: 72px;
  height: 48px;
  flex: 0 0 auto;
  padding: 0 18px !important;
  border: 1px solid var(--film-accent) !important;
  border-radius: 10px !important;
  background: var(--film-accent) !important;
  color: var(--film-button-text) !important;
  font-size: 14px !important;
  font-weight: 700;
}
.staff .top-search .top-search-submit:hover { background: var(--film-button-hover) !important; }
@media (max-width: 899px) {
  .staff .staff-topbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 11px; }
  .staff .top-search { width: 100%; max-width: none; min-width: 0; flex: none; margin: 0; }
}
@media (max-width: 650px) {
  .staff .staff-topbar { grid-template-columns: minmax(0,1fr); min-height: 0; gap: 10px; padding: 12px 14px; }
  .staff-topbar-leading { width: 100%; justify-content: space-between; gap: 8px; }
  .staff-greeting { gap: 10px; }
  .staff-user-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 17px; }
  .staff-greeting-copy strong { max-width: min(60vw, 260px); font-size: 15px; }
  .staff-greeting-copy small { max-width: min(62vw, 280px); font-size: 11px; }
  .staff-account-menu-panel { right: 0; left: auto; width: min(236px, calc(100vw - 32px)); }
  .staff .top-search { grid-column: 1; gap: 7px; }
  .staff .top-search .top-search-control { border-radius: 10px; }
  .staff .top-search .top-search-submit { min-width: 66px; height: 46px; padding-inline: 13px !important; }
}

html[data-theme="dark"] .step {
  background: var(--theme-raised);
  color: var(--theme-muted);
}

html[data-theme="dark"] .step.done {
  background: var(--theme-success-bg);
  color: var(--theme-success-text);
}

html[data-theme="dark"] :is(.queue-row, .finance-line, .customer-preview-roll, .inspector-header, .inspector-customer, .inspector-footer, .inspector-roll, .side-account, .side-brand) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .meta div,
html[data-theme="dark"] .delivery,
html[data-theme="dark"] .equipment-assignment,
html[data-theme="dark"] .impact-preview,
html[data-theme="dark"] .customer-order-preview {
  background-color: var(--theme-raised);
}

html[data-theme="dark"] .event {
  border-left-color: rgba(255, 255, 255, .34);
}

html[data-theme="dark"] .event strong,
html[data-theme="dark"] .order-preview strong,
html[data-theme="dark"] .order-preview span {
  color: var(--theme-text);
}

html[data-theme="dark"] .divider,
html[data-theme="dark"] hr {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, .72);
}

html[data-theme="dark"] .modal {
  background: var(--theme-raised);
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .label-preview-card {
  background: #fff;
  color: #000;
}

html[data-theme="dark"] .label-preview-card small,
html[data-theme="dark"] .label-preview-card strong {
  color: #000;
}

html[data-theme="dark"] .gallery-preview {
  background-color: var(--theme-inset);
  background-image: conic-gradient(var(--theme-raised) 25%, transparent 0 50%, var(--theme-raised) 0 75%, transparent 0);
}

html[data-theme="dark"] .trend-column i,
html[data-theme="dark"] .trend-bar rect {
  fill: var(--theme-raised);
  background: var(--theme-raised);
}

html[data-theme="dark"] .trend-column i.has-value,
html[data-theme="dark"] .trend-bar rect.has-value {
  fill: var(--theme-accent);
  background: var(--theme-accent);
}

html[data-theme="dark"] .staff .equipment-tabs {
  border-bottom-color: var(--theme-border);
}

html[data-theme="dark"] .staff .equipment-tab {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .equipment-tab.active {
  color: var(--theme-accent);
  border-bottom-color: var(--theme-accent);
}

html[data-theme="dark"] .staff .equipment-row {
  border-top-color: var(--theme-border);
}

html[data-theme="dark"] .staff .equipment-row strong,
html[data-theme="dark"] .staff .equipment-assignment strong {
  color: #fff;
}

html[data-theme="dark"] .staff .equipment-row small,
html[data-theme="dark"] .staff .equipment-assignment small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .negative-choice {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .staff .negative-choice legend,
html[data-theme="dark"] .staff .negative-choice small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .negative-options label {
  background: var(--theme-inset);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .negative-options label:has(input:checked),
html[data-theme="dark"] .staff .negative-preference-actions .button[aria-pressed="true"] {
  background: var(--theme-accent-soft);
  border-color: var(--theme-accent);
  color: rgba(255, 255, 255, .82);
}

html[data-theme="dark"] .staff .choice-button:not(.creation-source-card):not(.creation-choice-card) {
  border-color: var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
}
html[data-theme="dark"] .staff .choice-button:not(.creation-source-card):not(.creation-choice-card):hover {
  border-color: var(--theme-accent);
  background: var(--theme-raised);
  color: var(--theme-text);
}
html[data-theme="dark"] .staff .choice-button:not(.creation-source-card):not(.creation-choice-card)[aria-pressed="true"],
html[data-theme="dark"] .staff .choice-button:has(input:checked) {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

html[data-theme="dark"] .staff .creation-choice-card[aria-pressed="true"] {
  border-color: var(--theme-focus);
  background: var(--theme-selected);
  color: var(--theme-text);
  box-shadow: inset 0 0 0 1px var(--theme-border);
}

html[data-theme="dark"] .staff .creation-choice-card[aria-pressed="true"] small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .impact-preview p {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .period-control {
  background: var(--theme-inset);
}

html[data-theme="dark"] .staff .period-control button {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .period-control button.active {
  background: var(--theme-raised);
  color: #fff;
}

html[data-theme="dark"] .staff .setting-shortcuts button,
html[data-theme="dark"] .staff .catalog-row {
  background: transparent;
  border-top-color: var(--theme-border);
  color: #fff;
}

html[data-theme="dark"] .staff .setting-shortcuts button:hover,
html[data-theme="dark"] .staff .catalog-row:hover,
html[data-theme="dark"] .staff .catalog-row.active {
  background: var(--theme-raised);
}

html[data-theme="dark"] .staff .setting-shortcuts button small,
html[data-theme="dark"] .staff .catalog-row small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .one-time-code {
  color: #fff;
}

html[data-theme="dark"] .gallery-card figcaption,
html[data-theme="dark"] .gallery-card p,
html[data-theme="dark"] .delivery small {
  color: var(--theme-muted);
}

html[data-theme="dark"] .theme-toggle {
  border: 1px solid var(--theme-border);
  background: transparent;
  color: inherit;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .staff .top [data-act="toggle-theme"]:hover {
  background: var(--theme-raised);
}

html[data-theme="dark"] .staff .top [data-act="toggle-theme"] {
  border-color: var(--theme-border);
  background: var(--theme-raised);
  color: var(--theme-text);
}

html[data-theme="dark"] :is(button, a, input, select, textarea):focus-visible {
  outline-color: var(--theme-focus);
}

html[data-theme="dark"] ::selection {
  background: var(--theme-accent-soft);
  color: var(--theme-text);
}

html[data-theme="dark"] .notice:not(.amber):not(.red),
html[data-theme="dark"] .staff .notice:not(.amber):not(.red) {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}
html[data-theme="dark"] .staff .receiving-order.is-urgent,
html[data-theme="dark"] .staff .receiving-counts .shortage {
  background: var(--theme-warning-bg);
  border-color: rgba(255, 255, 255, .34);
  color: var(--theme-warning-text);
}
html[data-theme="dark"] .staff .workbench-task-row.selected {
  background: var(--theme-accent-soft);
}
html[data-theme="dark"] .staff :is(.workbench-line-button, .workbench-process-card, .workbench-queue-button):not(.active),
html[data-theme="dark"] .staff .workbench-reason {
  color: var(--theme-muted);
}
html[data-theme="dark"] .staff .workbench-state {
  color: var(--theme-text);
}
html[data-theme="dark"] .staff .workbench-reason.warning {
  color: var(--theme-warning-text);
}
html[data-theme="dark"] .staff .workbench-reason.warning {
  background: var(--theme-warning-bg);
}
html[data-theme="dark"] .staff .workbench-task-row {
  border-color: var(--theme-border);
}
html[data-theme="dark"] .customer-nav button,
html[data-theme="dark"] .customer .roll-head :is(small, p) {
  color: var(--theme-muted);
}
html[data-theme="dark"] .customer .button:not(.light):not(.secondary):not(.warn) {
  background: var(--theme-accent);
  color: var(--theme-canvas);
}
html[data-theme="dark"] .login-box .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .support-shell .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .anonymous-shell .button:not(.light):not(.secondary):not(.warn) {
  background: var(--theme-accent);
  color: var(--theme-canvas);
}
html[data-theme="dark"] .staff .orders-table td small,
html[data-theme="dark"] .staff .client-link span { color: var(--theme-muted); }

html[data-theme="dark"] :not(.shop-sidebar):not(.business-nav)::-webkit-scrollbar-thumb {
  background: #555;
}

html[data-theme="dark"] .staff .staff-order-roll-expanded > .roll-card.compact-ledger-roll-card {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-text);
  box-shadow: none;
}

html[data-theme="dark"] .staff :is(.inspector-order-note, .inspector-order-intent, .inspector-stage-progress, .inspector-stage-empty, .roll-progress-block) {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .compact-ledger-roll-card .roll-progress-block {
  background: transparent;
}

html[data-theme="dark"] .staff :is(.workbench-order-group[open], .order-table-row:hover, .order-table-row:focus-within) {
  background: var(--theme-raised);
}

html[data-theme="dark"] .staff .creation-customer-status.is-warning {
  background: var(--theme-danger-bg);
  border-color: var(--theme-danger-text);
  color: var(--theme-danger-text);
}

html[data-theme="dark"] .staff :is(.roll-progress-heading, .inspector-stage small, .roll-progress-stage small) {
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff :is(.inspector-stage strong, .roll-progress-stage strong) {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(.inspector-stage.is-active, .inspector-stage.is-current, .roll-progress-stage.is-current) :is(strong, small) {
  color: var(--theme-info-text);
}

html[data-theme="dark"] .staff :is(.inspector-stage.is-done, .roll-progress-stage.is-done) :is(strong, small) {
  color: var(--theme-success-text);
}

html[data-theme="dark"] .staff .inspector-current-stage {
  background: var(--theme-info-bg);
  color: var(--theme-info-text);
}

html[data-theme="dark"] .staff .orders-calendar-day.is-endpoint {
  color: var(--film-button-text);
}

html[data-theme="dark"] .staff .receiving-orders-row.is-urgent {
  background: var(--theme-warning-bg);
}

html[data-theme="dark"] .staff .receiving-counts .shortage b {
  color: var(--theme-warning-text);
}

html[data-theme="dark"] .staff .orders-home-table .order-row-cancelled .order-preview-toggle {
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .staff-roll-queue-item.is-current .staff-roll-queue-index {
  color: var(--film-button-text);
}

html[data-theme="dark"] .sidebar-nav-tooltip,
html[data-theme="dark"] .staff .sidebar-toggle::after {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

/* Dark shop filters keep the same outlined control affordance as other fields. */
html[data-theme="dark"] .staff :is(.catalog-filter-buttons .catalog-filter-button, .orders-source-tab) {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff :is(.catalog-filter-buttons .catalog-filter-button, .orders-source-tab):hover {
  border-bottom-color: var(--theme-border);
  background: transparent;
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(.catalog-filter-buttons .catalog-filter-button.active, .orders-source-tab.active) {
  border-bottom-color: var(--theme-text);
  background: transparent;
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .orders-search-control {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-inset);
}

html[data-theme="dark"] .staff .orders-search-control:focus-within {
  border-color: var(--theme-focus);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .staff .orders-search-control input {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .staff :is(.orders-status-trigger, .orders-supplement-source-trigger, .orders-date-trigger, .shared-date-trigger) {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-inset);
  box-shadow: none;
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(.orders-status-dropdown, .orders-supplement-source-dropdown, .orders-date-dropdown, .shared-date-dropdown):is(:hover, [open]) > summary {
  border-color: var(--theme-focus);
  background: var(--theme-raised);
  color: var(--theme-text);
}

/* Keep disabled wizard steps on the same charcoal surface. */
html[data-theme="dark"] button:disabled {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .creation-progress-button:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--theme-muted);
}

html[data-theme="dark"] .staff .creation-progress-button.is-current {
  background: transparent;
  color: var(--theme-text);
}

/* Keep the search field and its scan affordance on one continuous surface. */
html[data-theme="dark"] .staff .top-search {
  background: transparent;
}

html[data-theme="dark"] .staff .top-search-control {
  background: var(--theme-inset);
}

html[data-theme="dark"] .staff .top-search .top-search-control input {
  background: transparent !important;
}

html[data-theme="dark"] .staff .top-search .top-search-scan {
  background: transparent !important;
  color: var(--theme-muted) !important;
}

html[data-theme="dark"] .staff .top-search .top-search-scan:hover {
  background: var(--theme-selected) !important;
  color: var(--theme-text) !important;
}

/* Preserve the workflow status colors after the shared neutral badge reset. */
html[data-theme="dark"] .staff .badge.green {
  background: var(--theme-success-bg);
  color: var(--theme-success-text);
}

html[data-theme="dark"] .staff .badge.blue {
  background: var(--theme-info-bg);
  color: var(--theme-info-text);
}

html[data-theme="dark"] .staff .badge.amber {
  background: var(--theme-warning-bg);
  color: var(--theme-warning-text);
}

html[data-theme="dark"] .staff .badge.red {
  background: var(--theme-danger-bg);
  color: var(--theme-danger-text);
}

html[data-theme="dark"] .staff .badge.gray {
  background: var(--theme-neutral-bg);
  color: var(--theme-neutral-text);
}

html[data-theme="dark"] .staff .badge.purple {
  background: var(--theme-pending-bg);
  color: var(--theme-pending-text);
}

@media (max-width: 650px) {
  .theme-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }
  .theme-toggle .theme-label { display: none; }
  .staff .top .workspace-name {
    grid-column: 1;
    grid-row: 1;
  }
  .staff .top .right {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 4px;
  }
  .staff .top-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .customer .top .right {
    gap: 6px;
  }
}

html[data-theme="dark"] .staff .top .right > button:is([data-act="toggle-theme"], [data-act="lock"], [data-act="logout"]) {
  border-color: var(--theme-border);
  background: var(--theme-raised);
  color: var(--theme-text);
}
html[data-theme="dark"] .staff .top .right > button:is([data-act="toggle-theme"], [data-act="lock"], [data-act="logout"]):hover {
  border-color: var(--theme-border);
  background: rgba(0, 0, 0, .72);
  color: var(--theme-text);
}
html[data-theme="dark"] .staff .top .right > button:is([data-act="toggle-theme"], [data-act="lock"], [data-act="logout"]):focus-visible {
  outline-color: var(--theme-focus);
}

/* Neutral charcoal dark theme surfaces and interaction states. */
html[data-theme="dark"] .staff .shop-sidebar,
html[data-theme="dark"] .staff .top {
  background: #202020;
}

html[data-theme="dark"] .staff :is(.panel, .stat, .order-card, .roll-card, .orders-table-scroll, .dashboard-queue-item, .client-link, .management-kpi, .permission-pair, .impact-preview, .staff-account-menu-panel, .notification-panel) {
  background-color: var(--theme-surface);
}

html[data-theme="dark"] .staff :is(.meta div, .delivery, .equipment-assignment, .inventory-status, .service-history-item, .orders-table th, .side-environment) {
  background-color: var(--theme-raised);
}

html[data-theme="dark"] .staff :is(.business-nav .nav-item:hover, .side-tool:hover, .dashboard-queue-item:hover, .catalog-row:hover, .catalog-row.active, .setting-shortcuts button:hover) {
  background-color: #303030;
  color: var(--theme-text);
}

html[data-theme="dark"] .staff :is(.business-nav .nav-item.active, .workbench-subnav-item.active, .sidebar-flyout-item.active, .workbench-task-row.selected, .period-control button.active, .choice-button[aria-pressed="true"], .notification-item.is-unread, .customer-nav button[aria-current="page"]) {
  background-color: var(--theme-selected);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .sidebar-nav-highlight,
html[data-theme="dark"] .staff .sidebar-nav-highlight[data-level="secondary"] {
  background: var(--theme-selected) !important;
  box-shadow: none;
}

html[data-theme="dark"] .staff .shop-sidebar .business-nav .nav-item.active,
html[data-theme="dark"] .staff .shop-sidebar .business-nav .nav-item.active svg,
html[data-theme="dark"] .staff .shop-sidebar .business-nav[data-highlight-moving="true"] [data-highlight-target="true"],
html[data-theme="dark"] .staff .shop-sidebar .business-nav[data-highlight-moving="true"] [data-highlight-target="true"] svg,
html[data-theme="dark"] .staff .sidebar-highlight-label-overlay,
html[data-theme="dark"] .staff .sidebar-highlight-label-overlay svg {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .staff .workbench-subnav-item.active,
html[data-theme="dark"] .staff .business-nav .workbench-subnav-item.active {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .staff .workbench-subnav-item.active small,
html[data-theme="dark"] .staff .business-nav .workbench-subnav-item.active small {
  background: var(--theme-raised);
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .staff .top-search .top-search-submit,
html[data-theme="dark"] .customer .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .login-box .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .support-shell .button:not(.light):not(.secondary):not(.warn),
html[data-theme="dark"] .anonymous-shell .button:not(.light):not(.secondary):not(.warn) {
  background: var(--theme-accent) !important;
  color: var(--film-button-text) !important;
}

html[data-theme="dark"] .staff .button:not(.light):not(.secondary):not(.warn):hover,
html[data-theme="dark"] .staff .top-search .top-search-submit:hover {
  background: var(--film-button-hover) !important;
}

html[data-theme="dark"] .staff :is(.button.light, .button.secondary, .button.warn, .icon-button) {
  border-color: var(--theme-border);
}

html[data-theme="dark"] .staff :is(.button.light, .button.secondary, .icon-button):hover {
  background: #303030;
  color: var(--theme-text);
}

html[data-theme="dark"] .staff .step:not(.done) {
  background: var(--theme-neutral-bg);
  border-color: var(--theme-border);
  color: var(--theme-neutral-text);
}

html[data-theme="dark"] .staff .step.done {
  background: var(--theme-success-bg);
  color: var(--theme-success-text);
}

html[data-theme="dark"] .staff :is(.trend-column i, .trend-bar rect) {
  fill: var(--theme-raised);
  background: var(--theme-raised);
}

html[data-theme="dark"] .staff :is(.trend-column i.has-value, .trend-bar rect.has-value) {
  fill: var(--theme-accent);
  background: var(--theme-accent);
}

html[data-theme="dark"] .staff .modal-backdrop,
html[data-theme="dark"] .staff .order-preview-backdrop {
  background: rgba(0, 0, 0, .72);
}

html[data-theme="dark"] :not(.shop-sidebar):not(.business-nav)::-webkit-scrollbar-thumb {
  background: #555;
}
