/* STT visual system. Loaded after legacy component layouts; no workflow rules. */
:root body .operation-receipt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.operation-receipt > div { flex: 1 1 300px; min-width: 0; overflow-wrap: anywhere; }
.operation-receipt strong { font-size: 14px; }
:root body .operation-receipt p { margin: 5px 0 0; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
:root body .operation-receipt-link { display: inline-flex; align-items: center; padding: 9px 14px; color: #ffffff; background: var(--ui-accent); border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 650; }
:root body .action-unavailable { display: block; flex: 1 1 100%; color: var(--ui-muted); font-size: 11px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
:root body .action-blocker { flex: 1 1 100%; min-width: 0; margin-top: 5px; text-align: left; }
:root body .action-blocker > summary { color: var(--ui-link); cursor: pointer; font-size: 11px; line-height: 1.5; list-style: none; }
.action-blocker > summary::before { content: '+ '; }
.action-blocker[open] > summary::before { content: '- '; }
.action-blocker > div { padding: 8px 0; white-space: normal; overflow-wrap: anywhere; }
:root body .action-blocker strong { color: var(--ui-warning-text); font-size: 12px; }
:root body .action-blocker p { margin: 5px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
:root body .workshop-receipt-copy .workshop-receipt-warning { padding: 8px; border-radius: 6px; color: var(--ui-warning-text); background: var(--ui-warning-bg); }
.workspace-guide[hidden], .workspace-guide-ring[hidden] { display: none !important; }
:root body .workspace-guide-trigger { gap: 6px; white-space: nowrap; }
.workspace-guide-trigger > span { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; }
:root body .workspace-guide {
  position: fixed;
  z-index: 20000;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-top: 3px solid var(--ui-focus);
  border-radius: 16px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 12px 40px #00000030;
  font: 400 14px/1.55 var(--font-body);
  animation: workspace-guide-arrive 160ms ease-out both;
}
:root body .workspace-guide button { min-height: 34px; padding: 5px 10px; font-size: 13px; color: var(--ui-text); background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 8px; box-shadow: none; }
:root body .workspace-guide button.primary { color: #ffffff; background: var(--ui-accent); border-color: var(--ui-accent); }
:root body .workspace-guide button:hover:not(:disabled) { outline: 1px solid var(--ui-focus); }
:root body .workspace-guide button:disabled { opacity: .55; cursor: not-allowed; }
.workspace-guide-head, .workspace-guide-head > div, .workspace-guide footer, .workspace-guide-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-guide-eyebrow { color: var(--ui-muted); font-size: 10px; letter-spacing: .12em; font-weight: 700; }
:root body .workspace-guide h2 { margin: 14px 0 8px; color: var(--ui-text); font: 650 22px/1.18 var(--font-display); letter-spacing: -.025em; }
:root body .workspace-guide p { margin: 8px 0 14px; color: var(--ui-muted); font-size: 14px; line-height: 1.55; }
.workspace-guide-topics { display: grid; gap: 7px; }
:root body .workspace-guide-topics button { display: flex; text-align: left; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; }
.workspace-guide-topics small { color: var(--ui-muted); font-size: 10px; white-space: nowrap; }
:root body .workspace-guide .workspace-guide-warning { padding: 10px; color: var(--ui-warning-text); background: var(--ui-warning-bg); border-radius: 8px; font-size: 13px; }
.workspace-guide-progress { display: flex; gap: 4px; margin: 16px 0 12px; }
.workspace-guide-progress span { flex: 1; height: 3px; border-radius: 2px; background: var(--ui-line-soft); }
.workspace-guide-progress span.active { background: var(--ui-focus); }
.workspace-guide footer > span { font-size: 12px; color: var(--ui-muted); }
.workspace-guide-links { margin-top: 10px; }
:root body .workspace-guide-links button { border-color: transparent; background: transparent; color: var(--ui-link); font-size: 12px; }
:root body .workspace-guide .workspace-guide-safety { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--ui-line-soft); font-size: 11px; }
:root body .workspace-guide .workspace-guide-note { font-size: 12px; }
.workspace-guide-ring { position: fixed; z-index: 19999; pointer-events: none; box-sizing: border-box; border: 2px solid var(--ui-focus); border-radius: 8px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-focus) 16%, transparent); }
@keyframes workspace-guide-arrive { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { :root body .workspace-guide { animation: none; } }
@media (max-width: 1500px) { :root body .workspace-jump-trigger kbd { display: none; } }
@font-face {
  font-family: "STT Sans";
  src: url("./brand-assets/fonts/stt-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --font-body: "STT Sans", "Aptos", sans-serif;
  --font-display: "STT Sans", "Aptos Display", sans-serif;
  --ui-canvas: #f1f4f0;
  --ui-surface: #ffffff;
  --ui-raised: #f6f8f5;
  --ui-hover: #e6f3ec;
  --ui-line: #cad8d0;
  --ui-line-soft: #e1e8e3;
  --ui-text: #1b302b;
  --ui-muted: #526b61;
  --ui-accent: #00786c;
  --ui-link: #146493;
  --ui-focus: #007f91;
  --ui-shadow: 0 6px 24px #193c2b08, 0 1px 3px #193c2b05;
  --ui-success-bg: #e5f4ed;
  --ui-success-text: #176044;
  --ui-warning-bg: #fff3d9;
  --ui-warning-text: #805000;
  --ui-danger-bg: #fdeceb;
  --ui-danger-text: #a5302c;
  --ui-info-bg: #e8f2fb;
  --ui-info-text: #215c89;
}

:root body[data-theme="dark"] {
  color-scheme: dark;
  --ui-canvas: #0b161b;
  --ui-surface: #11252b;
  --ui-raised: #183037;
  --ui-hover: #214139;
  --ui-line: #365750;
  --ui-line-soft: #294039;
  --ui-text: #eef6f1;
  --ui-muted: #acc5bb;
  --ui-accent: #00786c;
  --ui-link: #6dccff;
  --ui-focus: #45dfc0;
  --ui-shadow: 0 10px 30px #00000012;
  --ui-success-bg: #153d36;
  --ui-success-text: #83e0b5;
  --ui-warning-bg: #3c3220;
  --ui-warning-text: #f4ca78;
  --ui-danger-bg: #442b32;
  --ui-danger-text: #ffaaa6;
  --ui-info-bg: #18384f;
  --ui-info-text: #93d3ff;
}

:root body {
  color-scheme: light;
  --bg: var(--ui-canvas);
  --bg2: var(--ui-surface);
  --bg3: var(--ui-raised);
  --bg4: var(--ui-line-soft);
  --panel: var(--ui-surface);
  --panel-strong: var(--ui-surface);
  --text: var(--ui-text);
  --text2: var(--ui-muted);
  --text3: var(--ui-muted);
  --border: var(--ui-line-soft);
  --border2: var(--ui-line);
  --border3: var(--ui-line);
  font-family: var(--font-body);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

:root body :is(button, input, select, textarea) {
  font-family: var(--font-body);
}
:root body :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}
:root body :is(button, a, summary) {
  touch-action: manipulation;
}
:root body input[type="checkbox"] {
  accent-color: var(--ui-accent);
}

/* Product and sign-in: one identity, with the form taking priority on mobile. */
body.public-site,
#loginView.login-shell {
  color-scheme: dark;
  --site-bg: #08131f;
  --site-panel: #0e2131;
  --site-line: #294658;
  --site-cyan: #51cfff;
  --site-mint: #35e1b2;
  --login-bg: #08131f;
  --login-panel: #0e2131;
  --login-panel-2: #122a3c;
  --login-muted: #b0c5d5;
  background:
    radial-gradient(ellipse at 8% 8%, #153b503f, transparent 55%), #08131f;
}
.public-site .site-header {
  background: #08131fed;
}
.public-site .site-header-inner,
.public-site .site-shell,
.public-site .site-footer {
  width: min(1320px, calc(100% - 64px));
}
.public-site .site-header-inner {
  min-height: 74px;
}
.public-site .site-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.public-site .site-nav a {
  font-size: 13px;
  font-weight: 600;
}
.public-site .site-nav a.site-nav-login {
  background: var(--site-mint);
  border-color: var(--site-mint);
  border-radius: 8px;
}
.public-site .site-shell {
  padding-top: 44px;
}
.public-site .site-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.public-site .site-hero-copy {
  min-height: 0;
  padding: 32px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.public-site .site-hero-copy::before,
.public-site .site-hero-copy::after {
  display: none;
}
.public-site .site-hero-copy h1 {
  margin: 24px 0;
  font-size: clamp(43px, 5.1vw, 74px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.public-site .site-hero-copy p {
  font-size: 16px;
  line-height: 1.65;
}
.public-site .eyebrow {
  min-height: 0;
  padding: 0;
  color: var(--site-orange);
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.6;
}
.public-site :is(.primary, .secondary) {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 600;
}
.public-site .site-hero-actions {
  margin-top: 28px;
}
.public-site .site-capability-strip {
  margin-top: 32px;
  gap: 12px;
}
.public-site .site-capability-strip > span {
  padding: 0;
  border: 0;
  background: none;
  font-size: 10px;
}
.public-site .site-capability-strip b {
  border-radius: 5px;
}
.public-site .site-hero-panel {
  min-height: 0;
  padding: 20px;
  border-radius: 16px;
  border-top: 2px solid var(--site-cyan);
  box-shadow: 0 24px 80px #0004;
  background-size: 32px 32px;
}
.public-site .site-demo-toolbar {
  padding: 0 0 18px;
  font-size: 9px;
}
.public-site .site-demo-order {
  margin-top: 4px;
  padding: 20px 16px;
  border-radius: 10px;
}
.public-site .site-flow-list {
  gap: 10px;
}
.public-site .site-flow-step {
  min-height: 76px;
  padding: 15px 12px;
  border-radius: 10px;
}
.public-site .site-flow-step strong {
  font-size: 14px;
  font-weight: 600;
}
.public-site .site-flow-step small {
  font-size: 11px;
  line-height: 1.5;
}
.public-site .site-flow-state {
  font-size: 8px;
}
.public-site .site-demo-footer {
  margin-top: 16px;
  font-size: 8px;
}
.public-site .site-section {
  margin-top: 72px;
  scroll-margin-top: 96px;
}
.public-site
  :is(.site-section-head h2, .site-pricing-card h2, .site-contact-card h2) {
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}
.public-site
  :is(
    .site-card,
    .site-visual-card,
    .site-pricing-card,
    .site-contact-card,
    .site-product-window
  ) {
  border-radius: 14px;
  box-shadow: none;
}
.public-site .site-visual-card {
  border-top-width: 2px;
}
.public-site .site-card {
  padding: 24px;
  background: #0b1b29;
}
.public-site :is(.site-card h3, .site-visual-copy h3) {
  font-weight: 600;
  letter-spacing: -0.025em;
}
.public-site .site-contact-form :is(input, textarea) {
  font-size: 14px;
  border-radius: 7px;
}

#loginView.login-shell {
  padding: 24px 32px;
}
#loginView .login-stage {
  width: min(1240px, 100%);
  min-height: 0;
  gap: 48px;
}
#loginView .login-topbar {
  padding: 0 0 20px;
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid var(--login-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}
#loginView .login-logo-lockup {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
#loginView .login-logo-lockup .hero-logo {
  width: 38px;
  height: 38px;
}
#loginView .login-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.85fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
#loginView .login-hero {
  min-height: 0;
  padding: 16px 0;
  gap: 28px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#loginView .login-hero::before,
#loginView .login-hero::after {
  display: none;
}
#loginView .login-hero h1 {
  margin: 18px 0;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.045em;
}
#loginView .hero-copy {
  font-size: 15px;
  line-height: 1.65;
  max-width: 510px;
}
#loginView .login-hero .eyebrow,
#loginView .login-form-wrap .eyebrow {
  border: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 10px;
}
#loginView .login-integration-strip {
  gap: 8px;
  margin-top: 22px;
}
#loginView .login-operation-preview {
  padding: 16px;
  border-radius: 12px;
  box-shadow: none;
}
#loginView .login-preview-step {
  padding: 10px;
  gap: 6px;
  border-radius: 7px;
}
#loginView .login-preview-step strong {
  font-size: 11px;
}
#loginView .login-preview-step small {
  color: #adc3d3;
  font-size: 10px;
}
#loginView .login-preview-footer {
  font-size: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
#loginView .login-access-panel {
  padding: 0;
  border-radius: 14px;
  background: none;
  box-shadow: 0 20px 70px #0003;
}
#loginView .login-form-wrap {
  padding: 32px;
  border: 0;
  border-radius: 14px;
}
#loginView .login-form-wrap::before {
  height: 3px;
  background: var(--login-mint);
}
#loginView .login-access-number {
  margin-bottom: 20px;
  color: #8aa9be;
  font-size: 10px;
}
#loginView .login-form-wrap h2 {
  margin: 12px 0 10px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
#loginView .login-form-wrap > p {
  margin-bottom: 24px;
}
#loginView .login-form-wrap label {
  font-size: 12px;
  font-weight: 500;
}
#loginView .login-form-wrap input {
  min-height: 46px;
  border-radius: 7px;
  font-size: 16px;
}
#loginView .login-form-wrap input::placeholder {
  color: #92adbf;
}
#loginView .login-form-wrap .primary {
  min-height: 46px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
}
#loginView .login-access-signals {
  padding: 16px 0;
  margin-top: 12px;
  gap: 8px;
}
#loginView .login-form-foot {
  padding-top: 20px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Workspace primitives. Extra root scope wins over legacy per-theme rules. */
:root body #appView:not(.hidden) {
  --im-canvas: var(--ui-canvas);
  --im-paper: var(--ui-surface);
  --im-paper-cool: var(--ui-raised);
  --im-line: var(--ui-line);
  --im-line-soft: var(--ui-line-soft);
  --im-text: var(--ui-text);
  --im-muted: var(--ui-muted);
  --im-teal: var(--ui-accent);
  --im-teal-dark: var(--ui-accent);
  --im-blue: var(--ui-link);
  font-size: 13px;
}
:root body:has(#appView:not(.hidden)) {
  background: var(--ui-canvas);
}
:root body #appView:not(.hidden) .header {
  min-height: 58px;
  border-bottom: 1px solid #2d4253;
  background: #091724;
  padding: 8px 24px;
}
:root body #appView:not(.hidden) .header::after {
  display: none;
}
:root body #appView:not(.hidden) .brand-mark {
  background: #32deb4;
  color: #092731;
  border-radius: 9px;
  font-weight: 700;
}
:root body #appView:not(.hidden) .brand-title {
  font-weight: 600;
  font-size: 15px;
}
:root body #appView:not(.hidden) .brand-subtitle {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.09em;
}
:root body #appView:not(.hidden) .header-right {
  gap: 8px;
}
/* Account actions share a native disclosure; the main header stays compact. */
:root body #appView:not(.hidden) .account-menu { position: relative; }
:root body #appView:not(.hidden) .account-menu > summary {
  display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer;
  min-height: 34px; padding: 7px 12px; border: 1px solid #375259;
  border-radius: 7px; color: #f2fff9; background: #19343a; font-size: 13px;
}
.account-menu > summary::-webkit-details-marker { display: none; }
:root body #appView:not(.hidden) .account-menu > summary:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
:root body #appView:not(.hidden) .account-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 150;
  display: grid; gap: 8px; width: min(280px, calc(100vw - 24px)); padding: 14px;
  max-height: calc(100dvh - 120px); overflow-y: auto;
  color: #f2fff9; background: #10282d; border: 1px solid #375259;
  border-radius: 10px; box-shadow: 0 12px 36px #0005;
}
:root body #appView:not(.hidden) .account-menu-panel .user-chip { display: block; min-width: 0; padding: 4px 0 12px; border-bottom: 1px solid #375259; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) .account-menu-panel .user-chip .meta { display: block; }
:root body #appView:not(.hidden) .account-menu-panel button { width: 100%; justify-content: space-between; text-align: left; }
:root body #appView:not(.hidden) .search-camera { flex: 0 0 38px; width: 38px; min-height: 38px; padding: 8px; }
.search-camera svg { display: block; width: 20px; height: 20px; }
:root body .workspace-guide .workspace-guide-release { font-size: 12px; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) .main-tabs {
  top: 58px;
  min-height: 48px;
  padding: 5px 24px;
  gap: 6px;
  background: #0d2030;
  border-bottom-color: #294354;
}
:root body #appView:not(.hidden) .nav-item {
  min-height: 36px;
  padding: 7px 11px;
  gap: 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}
:root body #appView:not(.hidden) .nav-item.active {
  background: var(--im-teal-dark);
  color: #ffffff;
  border-color: var(--im-teal-dark);
  box-shadow: inset 0 -2px #50e6be;
}
:root body #appView:not(.hidden) .nav-prefix,
:root body #appView:not(.hidden) .nav-item.active .nav-prefix {
  min-width: 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  color: inherit;
  background: none;
}
:root body #appView:not(.hidden) .nav-prefix svg {
  width: 18px;
  height: 18px;
  display: block;
}
:root body #appView:not(.hidden) .workspace-stage {
  width: min(1840px, calc(100% - 48px));
  padding-top: 20px;
}
:root body #appView:not(.hidden) .workspace-stage .view-header {
  min-height: 64px;
  padding: 0 0 18px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
:root body #appView:not(.hidden) .workspace-stage .view-header::after {
  display: none;
}
:root body #appView:not(.hidden) .view-header h2 {
  color: var(--ui-text);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 4px;
}
:root body #appView:not(.hidden) .view-header p {
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 400;
}
:root body #appView:not(.hidden) .workspace-appearance {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
:root
  body
  #appView:not(.hidden):not(
    :has(
      :is(#view-orders, #view-warehouse, #view-shipments, #view-catalog).active
    )
  )
  .workspace-appearance {
  display: none;
}
:root body #appView:not(.hidden) .appearance-label {
  color: var(--ui-muted);
  font-size: 11px;
}
:root body #appView:not(.hidden) .density-control {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
}
:root body #appView:not(.hidden) .density-control button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  min-height: 32px;
  background: transparent;
  color: var(--ui-muted);
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
:root body #appView:not(.hidden) .density-control button[aria-pressed="true"] {
  background: var(--ui-hover);
  border-color: var(--ui-line);
  color: var(--ui-text);
}
:root body #appView:not(.hidden) .density-control svg {
  width: 14px;
  height: 14px;
}
:root body #appView:not(.hidden) .workspace-stage :is(.toolbar, .factory-tabs) {
  width: 100%;
  max-width: none;
  margin: 0 0 10px;
  border-color: var(--ui-line);
  border-radius: 9px;
  box-shadow: none;
  background: var(--ui-surface);
}
:root body #appView:not(.hidden) .workspace-stage .toolbar {
  padding: 10px;
  gap: 10px;
}
:root body #appView:not(.hidden) .toolbar-actions {
  gap: 7px;
}
:root body #appView:not(.hidden) .search-box {
  min-height: 36px;
  font-size: 13px;
}
:root
  body
  #appView:not(.hidden)
  :is(input, select, textarea, .search-box, .search-clear, .segmented) {
  color: var(--ui-text);
  background: var(--ui-raised);
  border-color: var(--ui-line);
  border-radius: 6px;
}
:root body #appView:not(.hidden) :is(input, textarea)::placeholder {
  color: var(--ui-muted);
}
:root
  body
  #appView:not(.hidden)
  :is(.primary, .secondary, .table-action, .row-actions-menu > summary) {
  min-height: 32px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
:root
  body
  #appView:not(.hidden)
  :is(.secondary, .table-action, .row-actions-menu > summary) {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-line);
  box-shadow: none;
}
:root body #appView:not(.hidden) .toolbar-actions :is(.secondary, .primary) {
  font-size: 12px;
  font-weight: 600;
}
:root
  body
  #appView:not(.hidden)
  :is(.primary, .toolbar-actions .primary, .primary.table-action) {
  color: #ffffff;
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  box-shadow: none;
}
:root
  body
  #appView:not(.hidden)
  :is(.secondary, .table-action, .row-actions-menu > summary):hover {
  color: var(--ui-text);
  background: var(--ui-hover);
  border-color: var(--ui-focus);
}
:root body #appView:not(.hidden) .primary:hover {
  color: #ffffff;
  background: #00675d;
  transform: none;
}
:root body #appView:not(.hidden) :is(button, input, select, textarea):disabled {
  color: var(--ui-muted);
  background: var(--ui-raised);
  border-color: var(--ui-line-soft);
  opacity: 0.6;
}
:root
  body
  #appView:not(.hidden)
  .header
  :is(.secondary, .version-badge, .date-label) {
  color: #c7d9e5;
  background: #112b3d;
  border-color: #304d61;
  font-size: 11px;
}
:root body #appView:not(.hidden) .segmented button {
  font-weight: 500;
  font-size: 12px;
}
:root body #appView:not(.hidden) .segmented button.is-active {
  background: var(--ui-accent);
  color: #ffffff;
}
:root body #appView:not(.hidden) .factory-tab {
  font-weight: 600;
  font-size: 12px;
  border-radius: 5px;
}
:root
  body
  #appView:not(.hidden)
  .workspace-stage
  .stats-bar.orders-kpi-strip:not(.hidden) {
  width: 100%;
  max-width: none;
  margin: 0 0 8px;
  background: var(--ui-surface);
  border-color: var(--ui-line);
}
:root body #appView:not(.hidden) .orders-kpi-strip .stat {
  padding: 14px 10px 12px;
  border-right-color: var(--ui-line-soft);
}
:root body #appView:not(.hidden) .orders-kpi-strip .stat::before {
  display: none;
}
:root body #appView:not(.hidden) .orders-kpi-strip .stat-val {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  color: var(--ui-text);
}
:root body #appView:not(.hidden) .orders-kpi-strip .stat-label {
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
:root body #appView:not(.hidden) .orders-kpi-strip .stat-label::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--metric-color);
}
:root body #appView:not(.hidden) .orders-pager {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 0;
  background: none;
  border: 0;
  box-shadow: none;
}
:root body #appView:not(.hidden) .workspace-stage .content-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
}
:root body #appView:not(.hidden) .panel {
  padding: 16px;
  border-color: var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
:root body #appView:not(.hidden) .panel-top-gap {
  margin-top: 8px;
}
:root body #appView:not(.hidden) .panel h3 {
  color: var(--ui-text);
  font: 600 14px/1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
:root body #appView:not(.hidden) .panel h3::before {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--ui-accent);
}
:root
  body
  #appView:not(.hidden)
  :is(#view-orders, #view-warehouse, #view-shipments, #view-catalog)
  > .panel-top-gap {
  padding: 0;
  overflow: hidden;
}
:root
  body
  #appView:not(.hidden)
  :is(#view-orders, #view-warehouse, #view-shipments, #view-catalog)
  > .panel-top-gap
  > h3 {
  display: none;
}
:root body #appView:not(.hidden) .table-wrap {
  border: 0;
  border-radius: 9px;
  background: var(--ui-surface);
}
:root body #appView:not(.hidden) .data-table {
  background: var(--ui-surface);
  font-size: 13px;
}
:root body #appView:not(.hidden) .data-table th {
  color: var(--ui-muted);
  background: var(--ui-raised);
  padding: 12px 10px;
  border-bottom: 1px solid var(--ui-line);
  font: 600 10px/1.4 var(--font-body);
  letter-spacing: 0.06em;
}
:root body #appView:not(.hidden) .data-table td {
  color: var(--ui-text);
  padding: 12px 10px;
  background: var(--ui-surface);
  border-bottom-color: var(--ui-line-soft);
}
:root body #appView:not(.hidden) .data-table tbody tr:nth-child(even),
:root body #appView:not(.hidden) .data-table tbody tr:nth-child(even) td {
  background: var(--ui-raised);
}
:root body #appView:not(.hidden) .data-table tbody tr:hover td {
  background: var(--ui-hover);
}
:root
  body
  #appView:not(.hidden)
  .data-table
  tr:has(input[type="checkbox"]:checked)
  > td {
  background: var(--ui-hover);
}
:root
  body
  #appView:not(.hidden)
  :is(.cell-title, .stock-primary, .metric .value) {
  color: var(--ui-text);
  font-weight: 600;
}
:root
  body
  #appView:not(.hidden)
  :is(.cell-sub, .stock-breakdown, .stock-hint, .muted) {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 400;
}
:root body #appView:not(.hidden) .table-link {
  color: var(--ui-link);
  font-weight: 600;
}
:root body #appView:not(.hidden) .stock-primary {
  font-size: 14px;
}
:root
  body
  #appView:not(.hidden)
  :is(.tag, .badge, .status-badge, .action-badge, .stock-state) {
  border-radius: 5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
:root body #appView:not(.hidden) .order-actions-primary {
  gap: 6px;
}
:root body #appView:not(.hidden) .tag {
  box-shadow: none;
}
:root
  body
  #appView:not(.hidden)
  .tag:is(
    .active,
    .yes,
    .received,
    .received-poland,
    .shipped,
    .delivered,
    .gr-confirmed,
    .gr-ok
  ) {
  color: var(--ui-success-text);
  background: var(--ui-success-bg);
  border-color: transparent;
}
:root
  body
  #appView:not(.hidden)
  .tag:is(.pending, .gray, .planned, .next, .next-slice, .in-transit) {
  color: var(--ui-warning-text);
  background: var(--ui-warning-bg);
  border-color: transparent;
}
:root body #appView:not(.hidden) .tag:is(.red, .problem, .blocked) {
  color: var(--ui-danger-text);
  background: var(--ui-danger-bg);
  border-color: transparent;
}
:root
  body
  #appView:not(.hidden)
  .tag:is(.partial, .invoiced, .invoice, .blue, .review) {
  color: var(--ui-info-text);
  background: var(--ui-info-bg);
  border-color: transparent;
}
:root body #appView:not(.hidden) .row-actions-secondary .danger-quiet {
  color: var(--ui-danger-text);
}
:root body #appView:not(.hidden) .view.active {
  animation: workspace-enter 160ms ease-out;
}
@keyframes workspace-enter {
  from {
    opacity: 0.94;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
:root body #appView:not(.hidden) #view-workshop .workshop-column {
  border-radius: 9px;
  border-color: var(--ui-line);
  border-top-color: var(--column-accent);
  background: var(--ui-raised);
}
:root body #appView:not(.hidden) #view-workshop .workshop-card {
  background: var(--ui-surface);
  border-radius: 7px;
  box-shadow: 0 2px 5px #00000009;
}
:root body #appView:not(.hidden) #view-workshop .workshop-metric {
  border-radius: 7px;
  background: var(--ui-raised);
  border-color: var(--ui-line-soft);
}

/* Dialogs are siblings of appView, so they share body-level surface tokens. */
:root body .modal-shell {
  background: #03101ab3;
  backdrop-filter: blur(5px);
}
:root body .modal-shell .modal-card {
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  box-shadow: 0 24px 90px #0005;
}
:root body .modal-shell .modal-head {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-line-soft);
}
:root body .modal-shell .modal-head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
}
:root body .modal-shell .modal-card :is(input, select, textarea) {
  color: var(--ui-text);
  background: var(--ui-raised);
  border-color: var(--ui-line);
  border-radius: 6px;
  font-size: 14px;
}
:root body .modal-shell .modal-card :is(input, textarea)::placeholder {
  color: var(--ui-muted);
}
:root body .modal-shell .modal-card :is(label, .form-row label) {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
}
:root body .modal-shell :is(.secondary, .table-action) {
  color: var(--ui-text);
  background: var(--ui-raised);
  border-color: var(--ui-line);
  border-radius: 7px;
  font-weight: 600;
}
:root body .modal-shell .primary {
  color: #ffffff;
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  border-radius: 7px;
  box-shadow: none;
  font-weight: 600;
}
:root body .modal-shell .modal-card :is(input, select, textarea):disabled {
  opacity: 0.65;
}
:root body .modal-shell .modal-card :is(.panel, .import-meta-card, .kv-item) {
  color: var(--ui-text);
  background: var(--ui-raised);
  border-color: var(--ui-line-soft);
  border-radius: 8px;
  box-shadow: none;
}
:root body .modal-shell .modal-card :is(th, .data-table th) {
  color: var(--ui-muted);
  background: var(--ui-raised);
  border-bottom-color: var(--ui-line);
  font: 600 11px/1.4 var(--font-body);
  letter-spacing: 0.04em;
}
:root
  body
  .modal-shell
  .modal-card
  :is(td, .data-table td, .cell-title, .import-meta-card strong) {
  color: var(--ui-text);
}
:root body .modal-shell .modal-card :is(.cell-sub, .muted, .import-meta-label) {
  color: var(--ui-muted);
}
:root body #orderEditModal #orderHeaderComment {
  width: 100%;
  min-height: 68px;
  resize: vertical;
}

@media (min-width: 761px) {
  :root
    body
    #appView:not(.hidden)[data-density="compact"]
    .workspace-table-scroll
    .stock-breakdown {
    margin-top: 2px;
  }
  :root
    body
    #appView:not(.hidden)[data-density="compact"]
    .workspace-table-scroll
    .stock-foot {
    margin-top: 3px;
    gap: 3px 6px;
  }
  :root body #appView:not(.hidden) .workspace-table-scroll {
    max-height: min(72vh, 860px);
    overflow: auto;
    scrollbar-color: var(--ui-line) var(--ui-surface);
    scrollbar-width: thin;
    scroll-padding-top: 46px;
  }
  :root body #appView:not(.hidden) .workspace-table-scroll:focus-visible {
    outline: 2px solid var(--ui-focus);
    outline-offset: -2px;
  }
  :root
    body
    #appView:not(.hidden)
    .workspace-table-scroll
    > table
    > thead
    > tr
    > th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px var(--ui-line);
  }
  /* Pin the identifier, not action controls. Expanded shipment rows stay full-width. */
  :root
    body
    #appView:not(.hidden)
    :is(#view-orders, #view-shipments)
    .workspace-table-scroll
    > table
    > :is(thead, tbody)
    > tr
    > :is(th, td):nth-child(2):not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 1px solid var(--ui-line);
  }
  :root
    body
    #appView:not(.hidden)
    :is(#view-orders, #view-shipments)
    .workspace-table-scroll
    > table
    > thead
    > tr
    > th:nth-child(2):not([colspan]) {
    z-index: 4;
  }
  :root
    body
    #appView:not(.hidden)[data-density="compact"]
    .workspace-table-scroll
    > table
    > tbody
    > tr
    > td {
    padding-block: 7px;
  }
  :root
    body
    #appView:not(.hidden)[data-density="compact"]
    .workspace-table-scroll
    :is(.table-action, .row-actions-menu > summary) {
    min-height: 28px;
    padding-block: 4px;
  }
}
@media (max-width: 1000px) {
  .public-site .site-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .public-site .site-hero-copy {
    max-width: 700px;
  }
  .public-site .site-hero-panel {
    width: 100%;
  }
  #loginView .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 24px;
  }
  #loginView .login-form-wrap {
    padding: 24px;
  }
  #loginView .login-preview-flow {
    grid-template-columns: 1fr;
  }
  #loginView .login-preview-step {
    min-height: 0;
    grid-template-columns: 28px 1fr auto;
  }
  #loginView .login-preview-step > b {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }
  :root body #appView:not(.hidden) .header {
    padding-inline: 16px;
  }
  :root body #appView:not(.hidden) .header .date-label {
    display: none;
  }
  :root body #appView:not(.hidden) .workspace-stage {
    width: calc(100% - 32px);
  }
  :root body #appView:not(.hidden) .appearance-label {
    display: none;
  }
}
@media (max-width: 760px) {
  .public-site .site-header-inner,
  .public-site .site-shell,
  .public-site .site-footer {
    width: calc(100% - 32px);
  }
  .public-site .site-shell {
    padding-top: 24px;
  }
  .public-site .site-hero-copy {
    padding: 16px 0;
  }
  .public-site .site-hero-copy h1 {
    font-size: clamp(36px, 9.5vw, 58px);
  }
  .public-site .site-hero-panel {
    padding: 14px;
  }
  .public-site .site-demo-toolbar > span:nth-child(2) {
    display: none;
  }
  .public-site .site-section {
    margin-top: 48px;
  }
  #loginView.login-shell {
    padding: 16px;
  }
  #loginView .login-stage {
    gap: 24px;
  }
  #loginView .login-topbar {
    min-height: 58px;
    padding-bottom: 14px;
  }
  #loginView .login-status-pill {
    display: none;
  }
  #loginView .login-product-link {
    font-size: 11px;
    padding-inline: 9px;
  }
  #loginView .login-layout {
    grid-template-columns: 1fr;
  }
  #loginView .login-access-panel {
    order: -1;
  }
  #loginView .login-hero h1 {
    font-size: 36px;
  }
  #loginView .login-hero {
    padding: 16px 8px;
  }
  :root body #appView:not(.hidden) .workspace-stage {
    width: calc(100% - 24px);
    padding-top: 16px;
  }
  :root body #appView:not(.hidden) .workspace-stage .view-header {
    min-height: 0;
    padding-bottom: 14px;
  }
  :root body #appView:not(.hidden) .workspace-appearance {
    display: none;
  }
  :root body #appView:not(.hidden) .view-header h2 {
    font-size: 26px;
  }
  :root body #appView:not(.hidden) .main-tabs {
    top: 0;
    padding-inline: 12px;
  }
  :root body #appView:not(.hidden) .data-table td {
    padding: 8px 10px;
  }
  :root
    body
    #appView:not(.hidden)
    :is(#view-orders, #view-shipments)
    .data-table
    tbody
    tr
    td {
    color: var(--ui-text);
    background: var(--ui-raised);
    border-color: var(--ui-line-soft);
  }
  :root
    body
    #appView:not(.hidden)
    :is(#view-orders, #view-shipments)
    .data-table
    tbody
    tr
    td::before {
    color: var(--ui-muted);
  }
  :root
    body
    #appView:not(.hidden)
    :is(#view-orders, #view-shipments)
    .data-table
    tbody
    tr
    td
    .table-link {
    color: var(--ui-link);
  }
  :root
    body
    #appView:not(.hidden)
    .data-table
    tr:has(input[type="checkbox"]:checked) {
    border-color: var(--ui-focus);
  }
  :root body #appView:not(.hidden) .orders-kpi-strip .stat-val {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root body *,
  :root body *::before,
  :root body *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.warehouse-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.warehouse-photo {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  min-height: 56px;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ui-line);
  cursor: zoom-in;
}

.warehouse-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.warehouse-photo.is-missing {
  display: grid;
  place-items: center;
  background: var(--ui-raised);
  color: var(--ui-muted);
  cursor: pointer;
}
.warehouse-photo svg { width: 24px; height: 24px; margin-bottom: 9px; }
.warehouse-photo-hint {
  position: absolute;
  inset: auto 0 0;
  padding: 2px 0;
  background: #0b2232e8;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
}
.warehouse-photo.is-missing .warehouse-photo-hint { background: var(--ui-raised); color: var(--ui-muted); }
.warehouse-photo img[hidden], .warehouse-item-image img[hidden] { display: none; }
.warehouse-product-copy { min-width: 0; }
.warehouse-table-intro {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 13px 16px;
  color: var(--ui-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.warehouse-table-intro strong { color: var(--ui-text); font-weight: 600; }
:root body #appView:not(.hidden) .warehouse-table { min-width: 1040px; table-layout: auto; }
:root body #appView:not(.hidden) .warehouse-table td { vertical-align: middle; }
:root body #appView:not(.hidden) .warehouse-table :is(th, td):first-child { width: 35%; min-width: 280px; }
:root body #appView:not(.hidden) .warehouse-table tbody tr { cursor: pointer; }
:root body #appView:not(.hidden) .warehouse-table tbody tr:focus-within td { background: var(--ui-hover); }
:root body #appView:not(.hidden) :is(.warehouse-item-link, .warehouse-pn-link) {
  display: block;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  color: var(--ui-link);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
:root body #appView:not(.hidden) .warehouse-item-link { color: var(--ui-text); font-weight: 600; }
:root body #appView:not(.hidden) :is(.warehouse-item-link, .warehouse-pn-link):hover { color: var(--ui-link); text-decoration: underline; text-underline-offset: 3px; }
.warehouse-location { font-size: 11px; font-weight: 600; padding: 4px 8px; border: 1px solid var(--ui-line); border-radius: 5px; white-space: nowrap; }
.warehouse-other-stock { display: block; margin-top: 7px; white-space: nowrap; }
.warehouse-stock { display: inline-block; min-width: 46px; padding: 6px 8px; border-radius: 6px; font-size: 15px; font-weight: 600; text-align: right; }
.warehouse-stock.stock-new { color: var(--ui-info-text); background: var(--ui-info-bg); }
.warehouse-stock.stock-repair { color: var(--ui-success-text); background: var(--ui-success-bg); }
.warehouse-stock.stock-zero { color: var(--ui-muted); background: var(--ui-raised); font-weight: 400; }
:root body #appView:not(.hidden) .warehouse-row-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
:root body #appView:not(.hidden) .warehouse-row-actions .table-action { flex: 0 0 auto; width: auto; max-width: none; white-space: nowrap; overflow: visible; }
:root body #appView:not(.hidden) .warehouse-row-actions .warehouse-open { color: var(--ui-link); border-color: var(--ui-line); gap: 12px; }
:root body #appView:not(.hidden)[data-density="compact"] .warehouse-photo { flex-basis: 40px; width: 40px; height: 40px; min-height: 40px; }
:root body #appView:not(.hidden)[data-density="compact"] .warehouse-photo-hint { display: none; }

.warehouse-item-dialog {
  box-sizing: border-box;
  width: min(1020px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  box-shadow: 0 32px 100px #0006;
  overscroll-behavior: contain;
}
.warehouse-item-dialog::backdrop { background: #03101acc; backdrop-filter: blur(5px); }
.warehouse-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 24px; border-bottom: 1px solid var(--ui-line-soft); }
.warehouse-eyebrow { color: var(--ui-link); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.warehouse-item-header h2 { font-size: clamp(18px, 2vw, 25px); line-height: 1.3; letter-spacing: -.02em; margin: 9px 0 0; overflow-wrap: anywhere; }
.warehouse-item-header button { flex-shrink: 0; }
.warehouse-item-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 24px; }
.warehouse-item-media { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.warehouse-item-image { display: grid; place-items: center; width: 100%; aspect-ratio: 1.2; padding: 16px; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; cursor: zoom-in; overflow: hidden; }
.warehouse-item-image img { display: block; width: 100%; height: 100%; max-height: 330px; object-fit: contain; }
.warehouse-photo-status { min-height: 18px; margin: 0; color: var(--ui-muted); font-size: 12px; }
.warehouse-item-no-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; aspect-ratio: 1.2; border: 1px dashed var(--ui-line); border-radius: 12px; background: var(--ui-raised); color: var(--ui-muted); text-align: center; padding: 20px; }
.warehouse-item-no-photo svg { width: 48px; height: 48px; }
.warehouse-item-no-photo strong { color: var(--ui-text); }
.warehouse-identifiers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 24px; }
.warehouse-identifiers dt { font-size: 11px; color: var(--ui-muted); margin-bottom: 6px; }
.warehouse-identifiers dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.warehouse-stock-panel { padding: 18px; background: var(--ui-raised); border: 1px solid var(--ui-line); border-top: 3px solid var(--ui-focus); border-radius: 10px; }
.warehouse-stock-panel h3, .warehouse-other-locations h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: 0; text-transform: none; }
.warehouse-stock-panel h3::before, .warehouse-other-locations h3::before { display: none; }
.warehouse-stock-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.warehouse-stock-pair > div { display: flex; flex-direction: column; gap: 5px; }
.warehouse-stock-pair span { color: var(--ui-muted); font-size: 12px; }
.warehouse-stock-pair strong { font-size: 30px; color: var(--ui-info-text); line-height: 1.2; }
.warehouse-stock-pair > div:last-child strong { color: var(--ui-success-text); }
.warehouse-stock-pair small { font-size: 12px; font-weight: 400; }
.warehouse-stock-panel p, .warehouse-other-locations p { margin: 14px 0 0; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
.warehouse-other-locations { margin-top: 18px; }
.warehouse-location-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 14px 0; }
.warehouse-location-filter label { display: grid; gap: 6px; min-width: 200px; max-width: 100%; color: var(--ui-text); }
.warehouse-location-filter select { max-width: 100%; }
.warehouse-location-filter p { flex: 1 1 240px; margin: 0; color: var(--ui-muted); font-size: 13px; }
.warehouse-location-filter p strong, .warehouse-location-filter p span { display: block; }
.warehouse-location-filter p strong { margin-bottom: 5px; color: var(--ui-text); }
.warehouse-location-balances { width: 100%; border-collapse: collapse; font-size: 12px; }
.warehouse-location-balances :is(th, td) { padding: 10px 6px; border-bottom: 1px solid var(--ui-line); }
.warehouse-location-balances th { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.warehouse-location-balances td { text-align: right; font-variant-numeric: tabular-nums; }
.warehouse-other-locations p { overflow-wrap: anywhere; }
.warehouse-item-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; background: var(--ui-raised); border-top: 1px solid var(--ui-line-soft); }
.warehouse-item-footer > span { color: var(--ui-muted); font-size: 12px; }
.warehouse-item-footer > div { display: flex; gap: 8px; flex-shrink: 0; }
:root body :is(.warehouse-item-dialog, .catalog-photo-dialog) .secondary { background: var(--ui-raised); color: var(--ui-text); border: 1px solid var(--ui-line); box-shadow: none; padding: 9px 14px; font-size: 13px; }
:root body .warehouse-item-dialog .primary { background: var(--ui-accent); color: #fff; border: 1px solid var(--ui-accent); padding: 9px 14px; font-size: 13px; }
@media (max-width: 700px) {
  .warehouse-item-body { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
  .warehouse-item-header { padding: 16px; gap: 12px; }
  .warehouse-item-image { aspect-ratio: 1.8; }
  .warehouse-item-image img { max-height: 200px; }
  .warehouse-item-footer { padding: 16px; flex-direction: column; align-items: stretch; }
  .warehouse-item-footer > div { justify-content: flex-end; }
}

.catalog-photo-dialog {
  box-sizing: border-box;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: 0 24px 80px #0006;
}

.catalog-photo-dialog::backdrop {
  background: #06121bcc;
}

.catalog-photo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.catalog-photo-full {
  display: block;
  width: 100%;
  max-height: 65dvh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.catalog-photo-full[hidden] {
  display: none;
}
.catalog-photo-stage { overflow: auto; max-height: 65dvh; border-radius: 8px; }
.catalog-photo-stage.is-zoomed .catalog-photo-full { width: 180%; max-width: none; max-height: none; }
.catalog-photo-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.catalog-photo-tools p { margin: 0; }

/* Catalog browsing stays separate from the inventory movement interface. */
.catalog-browser { margin-top: 18px; }
.catalog-browser-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.catalog-browser-head strong { font-size: 15px; color: var(--ui-text); font-weight: 600; }
.catalog-browser-head p { margin: 5px 0 0; color: var(--ui-muted); font-size: 12px; }
.catalog-layout-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); }
:root body #appView:not(.hidden) .catalog-layout-switch button { padding: 7px 16px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ui-muted); font: 600 12px/1.4 var(--font-body); box-shadow: none; }
:root body #appView:not(.hidden) .catalog-layout-switch button[aria-pressed="true"] { color: var(--ui-text); background: var(--ui-hover); border-color: var(--ui-line); }
.catalog-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.catalog-product-grid[hidden], #catalogList[hidden], .catalog-product-photo img[hidden] { display: none; }
.catalog-product-card { min-width: 0; display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); transition: border-color 140ms ease; }
.catalog-product-card:hover, .catalog-product-card:focus-within { border-color: var(--ui-focus); }
:root body #appView:not(.hidden) .catalog-product-photo { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 100%; height: 156px; padding: 15px 18px 30px; overflow: hidden; background: #fff; border: 1px solid var(--ui-line-soft); border-radius: 7px; cursor: zoom-in; box-shadow: none; }
.catalog-product-photo img { display: block; min-width: 0; min-height: 0; width: 100%; height: 108px; object-fit: contain; }
:root body #appView:not(.hidden) .catalog-product-photo.is-missing { background: var(--ui-raised); color: var(--ui-muted); border-style: dashed; cursor: pointer; }
.catalog-product-photo svg { width: 38px; height: 38px; }
.catalog-photo-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 5px 8px; background: #edf3f7; color: #385264; text-align: center; font: 500 10px/1.4 var(--font-body); }
.catalog-product-photo.is-missing .catalog-photo-caption { background: transparent; color: var(--ui-muted); }
.catalog-product-copy { padding: 14px 6px 4px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; }
.catalog-category { display: inline-block; max-width: 100%; color: var(--ui-info-text); background: var(--ui-info-bg); padding: 3px 7px; border-radius: 4px; font: 500 10px/1.4 var(--font-body); overflow-wrap: anywhere; }
.catalog-pn-label { margin-top: 16px; font: 600 9px/1.4 var(--font-body); letter-spacing: .09em; color: var(--ui-muted); }
:root body #appView:not(.hidden) .catalog-product-copy h3 { margin: 3px 0 0; padding: 0; letter-spacing: 0; text-transform: none; line-height: 1.35; }
:root body #appView:not(.hidden) .catalog-product-copy h3::before { display: none; }
:root body #appView:not(.hidden) .catalog-part-link { padding: 0; min-height: 0; border: 0; border-radius: 2px; background: transparent; color: var(--ui-text); font: 600 18px/1.4 var(--font-body); text-align: left; box-shadow: none; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) .catalog-part-link:hover { color: var(--ui-link); text-decoration: underline; text-underline-offset: 4px; }
.catalog-description { margin: 9px 0 16px; color: var(--ui-text); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.catalog-references { display: flex; flex-direction: column; width: 100%; gap: 5px; margin: auto 0 14px; color: var(--ui-muted); font-size: 11px; }
.catalog-references > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.catalog-references dt { font-weight: 400; }
.catalog-references dd { margin: 0; text-align: right; color: var(--ui-text); overflow-wrap: anywhere; }
:root body #appView:not(.hidden) .catalog-open { display: flex; align-items: center; justify-content: space-between; width: 100%; background: var(--ui-raised); padding: 8px 10px; color: var(--ui-link); }
.catalog-empty { grid-column: 1 / -1; margin: 0; padding: 40px 20px; border: 1px dashed var(--ui-line); border-radius: 10px; color: var(--ui-muted); text-align: center; font-size: 14px; }
:root body #appView:not(.hidden) .catalog-product-table { table-layout: auto; min-width: 840px; }
:root body #appView:not(.hidden) .catalog-product-table td { vertical-align: middle; }
:root body #appView:not(.hidden) .catalog-product-table :is(th,td):first-child { width: 45%; }
.catalog-list-product { display: flex; align-items: center; gap: 16px; min-width: 240px; }
:root body #appView:not(.hidden) .catalog-list-product .catalog-product-photo { width: 76px; height: 76px; padding: 5px 5px 20px; }
.catalog-list-product .catalog-description { margin: 4px 0 0; }
:root body #appView:not(.hidden) .catalog-list-product .catalog-part-link { font-size: 14px; }
.catalog-list-product .catalog-photo-caption { padding: 2px; font-size: 8px; }
.catalog-list-product .catalog-product-photo img { height: 48px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-grid { gap: 12px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-grid .catalog-product-photo { height: 124px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-grid .catalog-product-photo img { height: 76px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-copy { padding-top: 10px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-pn-label { margin-top: 10px; }
.catalog-product-table .catalog-references { margin: 0; max-width: 220px; }
.catalog-tools { position: relative; }
.catalog-tools > summary { padding: 10px 14px; border: 1px solid var(--ui-line); border-radius: 6px; background: var(--ui-raised); color: var(--ui-text); cursor: pointer; font: 600 12px/1.4 var(--font-body); }
.catalog-tools-menu { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; display: grid; width: 235px; padding: 10px; gap: 5px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-surface); box-shadow: 0 12px 36px #0004; }
.catalog-tools-menu > span { font-size: 9px; color: var(--ui-muted); letter-spacing: .08em; padding: 7px 4px; }
:root body #appView:not(.hidden) .catalog-tools-menu button { width: 100%; text-align: left; padding: 9px; }
:root body #catalogEditModal .modal-card { width: min(1080px, calc(100vw - 32px)); max-width: none; }
:root body #catalogEditModal .catalog-editor-grid { display: grid; grid-template-columns: minmax(220px, .95fr) repeat(2, minmax(0, 1fr)); gap: 18px; }
:root body #catalogEditModal .catalog-editor-media { grid-column: 1; grid-row: 1 / span 5; align-self: start; display: flex; flex-direction: column; gap: 12px; }
:root body #catalogEditModal .form-row:has(#catalogEditDescription), :root body #catalogEditModal .form-row:has(#catalogEditNote) { grid-column: 2 / span 2; }
:root body #catalogEditModal .catalog-media-preview { height: 270px; min-height: 0; background: #fff; }
:root body #catalogEditModal .catalog-media-preview:has(.catalog-media-image.hidden) { background: var(--ui-raised); }
:root body #catalogEditModal .catalog-media-image { width: 100%; height: 100%; max-height: none; object-fit: contain; }
:root body #catalogEditModal .catalog-media-card { padding: 10px; border: 1px solid var(--ui-line); background: var(--ui-raised); }
:root body #catalogEditModal .catalog-media-actions { display: flex; flex-wrap: wrap; gap: 8px; }
:root body #catalogEditModal .catalog-media-placeholder { color: var(--ui-muted); }
:root body #catalogEditModal textarea { min-height: 82px; }
@media (max-width: 760px) {
  .catalog-browser-head { flex-wrap: wrap; gap: 12px; }
  .catalog-product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .catalog-tools-menu { right: auto; left: 0; }
  :root body #catalogEditModal .catalog-editor-grid { grid-template-columns: minmax(0, 1fr); }
  :root body #catalogEditModal .catalog-editor-grid > .form-row { grid-column: 1; grid-row: auto; }
  :root body #catalogEditModal .catalog-media-preview { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-product-card { transition: none; }
}
/* Group 888 keeps individual destinations under one navigation tab. */
.other-factory-filter { display: flex; align-items: center; gap: 10px; margin-left: 12px; color: var(--ui-text); font-size: 13px; }
.other-factory-filter select { max-width: 360px; }
.factory-identity-grid, .factory-party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.factory-party-grid { margin: 16px 0; }
:root body .modal-card .factory-party { padding: 20px; border-top: 3px solid var(--ui-accent); }
.factory-party h3 { margin-top: 0; }
.factory-party p { margin: 6px 0 18px; }
.factory-extra-fields summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
@media (max-width: 700px) { .factory-party-grid, .factory-identity-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .other-factory-filter { width: 100%; margin: 8px 0 0; } .other-factory-filter select { min-width: 0; flex: 1; } }

/* Workshop work cards: one explicit next action, with technical detail folded away. */
:root body #appView:not(.hidden):has(#view-workshop.active #workshopKanbanPanel:not(.hidden)) .workspace-stage > .view-header { display: none; }
:root body #appView:not(.hidden) #view-workshop [hidden] { display: none !important; }
:root body #appView:not(.hidden) #view-workshop .workshop-board-panel { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
:root body #appView:not(.hidden) #view-workshop .workshop-board-heading { position: relative; isolation: isolate; align-items: center; gap: 20px; margin-bottom: 0; padding: 20px 24px; border: 1px solid var(--ui-line); border-top: 3px solid var(--ui-accent); border-radius: 16px; background: radial-gradient(ellipse at 65% 0%, #14b8a621, transparent 60%), linear-gradient(120deg, var(--ui-surface), var(--ui-raised)); box-shadow: 0 10px 30px #06202a08; }
:root body #appView:not(.hidden) #view-workshop #workshopSimpleTitle { font: 700 clamp(24px, 2.4vw, 32px)/1.15 var(--font-display); letter-spacing: -.035em; text-transform: none; margin: 0; }
:root body #appView:not(.hidden) #view-workshop #workshopSimpleTitle::before { display: none; }
#workshopSimpleIntro { color: var(--ui-muted); max-width: 680px; font-size: 14px; line-height: 1.5; margin: 8px 0 0; }
.workshop-hero-copy, .workshop-access-note { position: relative; z-index: 1; }
.workshop-eyebrow { color: var(--ui-accent); font: 650 10px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
body[data-theme="dark"] .workshop-eyebrow { color: #7de7ca; }
.workshop-hero-drawing { position: absolute; z-index: -1; right: 320px; top: 0; height: 100%; width: 260px; max-width: 28%; pointer-events: none; overflow: hidden; stroke: var(--ui-muted); opacity: .45; }
.workshop-drawing-grid { stroke-width: .5; opacity: .18; }
.workshop-drawing-part { stroke: var(--ui-accent); stroke-width: 1.2; }
.workshop-drawing-route { stroke: var(--ui-link); stroke-width: 1.5; }
.workshop-drawing-node { stroke: none; fill: var(--ui-link); }
:root body #appView:not(.hidden) #view-workshop .workshop-factory-filter { font-size: 11px; color: var(--ui-muted); font-weight: 600; letter-spacing: 0; text-transform: none; gap: 6px; }
:root body #appView:not(.hidden) #view-workshop .workshop-factory-filter select { height: 40px; width: auto; min-width: 130px; max-width: 200px; font-size: 13px; }
:root body #appView:not(.hidden) #view-workshop .workshop-mode-tabs { padding: 4px; gap: 4px; background: var(--ui-raised); border: 1px solid var(--ui-line); box-shadow: none; margin-bottom: 16px; }
:root body #appView:not(.hidden) #view-workshop .workshop-mode-tabs button { min-height: 40px; font-size: 13px; padding: 10px 18px; border-radius: 6px; color: var(--ui-muted); }
:root body #appView:not(.hidden) #view-workshop .workshop-mode-tabs button.active { color: var(--ui-text); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.workshop-simple-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; padding: 18px 0; }
.workshop-simple-filters [role="group"] { display: flex; flex-wrap: wrap; gap: 6px; }
.workshop-simple-filters label { display: grid; gap: 5px; color: var(--ui-muted); font-size: 12px; }
:root body #appView:not(.hidden) #view-workshop .workshop-simple-filters button { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; padding: 8px 12px; background: var(--ui-surface); color: var(--ui-muted); border-color: var(--ui-line); border-radius: 8px; }
:root body #appView:not(.hidden) #view-workshop .workshop-simple-filters button[aria-pressed="true"] { background: var(--ui-info-bg); color: var(--ui-info-text); border-color: var(--ui-info-text); box-shadow: inset 0 -2px var(--ui-info-text); }
:root body #appView:not(.hidden) #view-workshop .workshop-simple-filters [data-workshop-status="hold"][aria-pressed="true"] { background: var(--ui-danger-bg); color: var(--ui-danger-text); border-color: var(--ui-danger-text); box-shadow: inset 0 -2px var(--ui-danger-text); }
:root body #appView:not(.hidden) #view-workshop .workshop-simple-filters [data-workshop-status="ready"][aria-pressed="true"] { background: var(--ui-success-bg); color: var(--ui-success-text); border-color: var(--ui-success-text); box-shadow: inset 0 -2px var(--ui-success-text); }
.workshop-simple-filters button strong { display: grid; place-items: center; min-width: 28px; min-height: 26px; padding: 2px 6px; border: 1px solid currentColor; border-radius: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
:root body #appView:not(.hidden) #view-workshop .workshop-board.workshop-simple-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; align-items: stretch; overflow: visible; padding: 0; }
:root body #appView:not(.hidden) #view-workshop .workshop-board:not(.workshop-simple-grid) { grid-template-columns: repeat(8, minmax(290px, 1fr)); }
:root body #appView:not(.hidden) #view-workshop .workshop-job { --job-color: var(--ui-info-text); --job-tint: var(--ui-info-bg); display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ui-line); border-top: 3px solid var(--job-color); border-radius: 14px; padding: 16px; background: linear-gradient(155deg, var(--job-tint), transparent 120px), var(--ui-surface); color: var(--ui-text); box-shadow: 0 3px 4px #071c2603, 0 12px 24px #071c2607; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) #view-workshop .workshop-job[data-workshop-stage="READY_ASSEMBLY"] { --job-color: var(--ui-warning-text); --job-tint: var(--ui-warning-bg); }
:root body #appView:not(.hidden) #view-workshop .workshop-job:is([data-workshop-stage="QC"], .is-finished) { --job-color: var(--ui-success-text); --job-tint: var(--ui-success-bg); }
:root body #appView:not(.hidden) #view-workshop .workshop-job.is-held { --job-color: var(--ui-danger-text); --job-tint: var(--ui-danger-bg); }
:root body #appView:not(.hidden) #view-workshop .workshop-job:focus-within { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
.workshop-job[aria-busy="true"] { cursor: progress; }
.workshop-job-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ui-muted); }
.workshop-job-header > strong { font-family: var(--font-mono); font-size: 11px; letter-spacing: .025em; color: var(--ui-text); }
.workshop-job-priority { border-radius: 4px; padding: 4px 7px; background: var(--ui-raised); color: var(--ui-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.workshop-job-priority.priority-high { background: var(--ui-warning-bg); color: var(--ui-warning-text); }
.workshop-job-priority.priority-urgent { background: var(--ui-danger-bg); color: var(--ui-danger-text); }
.workshop-job-part { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 18px 0 14px; }
.workshop-job-photo { width: 68px; height: 72px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-raised); display: grid; place-items: center; overflow: hidden; box-shadow: 0 3px 9px #0415220d; }
.workshop-job-photo span { text-align: center; font-size: 11px; padding: 6px; color: var(--ui-muted); }
.workshop-job-photo img { width: 100%; height: 100%; object-fit: contain; background: white; }
:root body #appView:not(.hidden) #view-workshop .workshop-job h4 { margin: 0; font: 700 21px/1.2 var(--font-body); color: var(--ui-text); letter-spacing: -.02em; }
.workshop-job-part p { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--ui-muted); }
.workshop-job-quantity { display: grid; gap: 2px; text-align: right; max-width: 90px; font-variant-numeric: tabular-nums; }
.workshop-job-qty { font-size: 27px; line-height: 1; letter-spacing: -.035em; }
.workshop-job-quantity > span { font-size: 12px; color: var(--ui-muted); }
.workshop-job-context { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--ui-muted); font-size: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--ui-line-soft); }
.workshop-job-context b { color: var(--ui-text); }
.workshop-job.is-overdue .workshop-job-context > span:last-child { color: var(--ui-danger-text); font-weight: 650; }
.workshop-job-step { flex: 1; margin: 14px 0; }
.workshop-job-step-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--ui-muted); font-size: 11px; }
.workshop-job-step-meta small { font-size: 11px; font-weight: 650; color: var(--job-color); text-transform: uppercase; letter-spacing: .07em; }
.workshop-job-step-title { display: flex; gap: 10px; align-items: center; }
.workshop-job-step-number { display: grid; place-items: center; flex: 0 0 32px; height: 32px; background: var(--job-tint); color: var(--job-color); border: 1px solid var(--ui-line); border-radius: 9px; font: 650 13px/1 var(--font-mono); }
:root body #appView:not(.hidden) #view-workshop .workshop-job-step h4 { font-size: 18px; line-height: 1.25; }
.workshop-job-progress { display: flex; gap: 4px; margin: 12px 0; }
.workshop-job-progress > span { flex: 1; height: 5px; border-radius: 3px; background: var(--ui-line); }
.workshop-job-progress > .is-done { background: var(--job-color); opacity: .45; }
.workshop-job-progress > .is-current { position: relative; background: var(--job-color); box-shadow: 0 0 8px var(--job-tint); }
.workshop-job-progress > .is-current::after { content: ''; position: absolute; top: -2px; right: 0; width: 9px; height: 9px; border: 2px solid var(--ui-surface); border-radius: 50%; background: var(--job-color); }
.workshop-job-step p { font-size: 13px; line-height: 1.5; margin: 8px 0 0; color: var(--ui-muted); }
.workshop-job-step .workshop-job-next { font-size: 12px; }
.workshop-job-next strong { color: var(--ui-text); }
.workshop-job-reason { display: block; margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--ui-danger-text); border-radius: 4px; background: var(--ui-danger-bg); color: var(--ui-danger-text); font-size: 14px; line-height: 1.4; }
.workshop-job-actions { display: grid; gap: 6px; }
:root body #appView:not(.hidden) #view-workshop .workshop-job-actions button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; white-space: normal; font-size: 14px; font-weight: 650; padding: 12px 14px; line-height: 1.3; border-radius: 7px; text-align: left; }
.workshop-job-actions svg { flex-shrink: 0; }
:root body #appView:not(.hidden) #view-workshop .workshop-job-actions .primary { position: relative; background: #00786c; background-image: linear-gradient(115deg, #00786c, #00665c); color: #fff; border-color: #00786c; box-shadow: inset 0 1px #ffffff26, 0 4px 10px #00695c18; }
:root body #appView:not(.hidden) #view-workshop .workshop-job-actions .primary:hover:not(:disabled) { background: #005e55; border-color: #005e55; }
:root body #appView:not(.hidden) #view-workshop .workshop-job-actions .workshop-problem-button { color: var(--ui-danger-text); background: var(--ui-surface); border-color: transparent; min-height: 44px; font-size: 13px; }
:root body #appView:not(.hidden) #view-workshop .workshop-job-actions .workshop-problem-button:hover:not(:disabled) { background: var(--ui-danger-bg); border-color: var(--ui-danger-text); }
.workshop-job-details { margin-top: 8px; border-top: 1px solid var(--ui-line-soft); padding-top: 4px; font-size: 12px; color: var(--ui-muted); }
.workshop-job-details summary { cursor: pointer; padding: 10px 0 4px; }
.workshop-job-review { display: grid; gap: 8px; font-size: 13px; }
.workshop-simple-empty { grid-column: 1/-1; padding: 48px 20px; text-align: center; border: 1px dashed var(--ui-line); border-radius: 12px; color: var(--ui-muted); }
.workshop-manager-summary { border-bottom: 1px solid var(--ui-line-soft); margin-bottom: 6px; }
.workshop-manager-summary > summary { padding: 12px 0; cursor: pointer; color: var(--ui-muted); }
.workshop-intake-advanced { grid-column: 1/-1; }
.workshop-intake-advanced summary { cursor: pointer; padding: 12px 0; color: var(--ui-muted); }
.workshop-intake-advanced label { display: inline-grid; min-width: 220px; margin: 8px 16px 8px 0; }
:root body .workshop-problem-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--ui-line); border-radius: 16px; padding: 28px; background: var(--ui-surface); color: var(--ui-text); }
.workshop-problem-dialog::backdrop { background: #03101dba; }
.workshop-problem-dialog h3 { font-size: 26px; margin: 12px 0; }
.workshop-problem-dialog :is(p, small) { color: var(--ui-muted); line-height: 1.5; }
.workshop-problem-dialog fieldset { display: grid; gap: 9px; padding: 0; border: 0; margin: 22px 0; }
.workshop-problem-dialog legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.workshop-problem-dialog fieldset label { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-raised); cursor: pointer; }
.workshop-problem-dialog fieldset label:has(input:checked) { border-color: var(--ui-focus); outline: 1px solid var(--ui-focus); }
.workshop-problem-dialog input[type="radio"] { width: 20px; height: 20px; accent-color: var(--ui-accent); }
.workshop-problem-dialog textarea { display: block; width: 100%; margin-top: 8px; padding: 12px; background: var(--ui-raised); color: var(--ui-text); border: 1px solid var(--ui-line); border-radius: 8px; }
.workshop-problem-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
:root body .workshop-problem-dialog button { min-height: 46px; padding: 12px 16px; font-size: 14px; }
.workshop-problem-dialog [data-problem-error] { color: var(--ui-danger-text); }
/* Confirm a real server write; never celebrate a pending command or a failure. */
:root body #appView:not(.hidden) #view-workshop .workshop-receipt { position: fixed; z-index: 1100; right: 24px; bottom: 24px; width: min(480px, calc(100vw - 32px)); display: flex; align-items: start; gap: 14px; margin: 0; padding: 18px; background: var(--ui-surface); color: var(--ui-text); border: 1px solid var(--ui-success-text); border-left: 4px solid var(--ui-success-text); border-radius: 14px; box-shadow: 0 16px 60px #001b3033; }
:root body #appView:not(.hidden) #view-workshop .workshop-receipt.is-held { border-color: var(--ui-danger-text); }
.workshop-receipt-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; color: var(--ui-success-text); background: var(--ui-success-bg); border-radius: 12px; }
.workshop-receipt-icon svg { width: 30px; height: 30px; }
.workshop-receipt.is-held .workshop-receipt-icon { color: var(--ui-danger-text); background: var(--ui-danger-bg); }
.workshop-receipt-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.workshop-receipt-copy > strong { font-size: 16px; line-height: 1.3; }
.workshop-receipt-copy p { margin: 5px 0 10px; font-size: 12px; line-height: 1.4; color: var(--ui-muted); }
.workshop-receipt-route { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; color: var(--ui-muted); }
.workshop-receipt-route b { color: var(--ui-success-text); }
.workshop-receipt.is-held .workshop-receipt-route b { color: var(--ui-danger-text); }
:root body #appView:not(.hidden) #view-workshop .workshop-receipt-close { flex: 0 0 32px; height: 32px; display: grid; place-items: center; padding: 0; font-size: 22px; line-height: 1; color: var(--ui-muted); background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 7px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  :root body #appView:not(.hidden) #view-workshop .workshop-job:hover { border-color: var(--job-color); box-shadow: 0 6px 18px #061b3014, 0 0 0 1px var(--job-tint); }
  :root body #appView:not(.hidden) #view-workshop .workshop-job-actions .primary:active:not(:disabled) { transform: translateY(1px); }
}
@media (max-width: 1120px) { .workshop-hero-drawing { display: none; } }
@media (max-width: 700px) {
  :root body #appView:not(.hidden) #view-workshop .workshop-board-heading { flex-direction: column; align-items: stretch; padding: 18px; }
  :root body #appView:not(.hidden) #view-workshop .workshop-access-note { flex-direction: row; flex-wrap: wrap; }
  .workshop-simple-filters label, .workshop-simple-filters select { width: 100%; }
  .workshop-simple-filters [role="group"] { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  :root body #appView:not(.hidden) #view-workshop .workshop-simple-filters button { justify-content: space-between; }
  :root body #appView:not(.hidden) #view-workshop .workshop-receipt { right: 16px; bottom: 16px; padding: 14px; gap: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  #workshopKanbanPanel:not(.hidden) .workshop-board-heading { animation: workshop-board-arrive .24s ease-out both; }
  #view-workshop.active .workshop-drawing-route { stroke-dasharray: 300; stroke-dashoffset: 0; animation: workshop-route-draw 1s ease-out both; }
  #view-workshop.active .workshop-job { transition: border-color .18s ease, box-shadow .18s ease; }
  #view-workshop.active .workshop-job-photo img { transition: transform .25s ease; }
  #view-workshop.active .workshop-job:hover .workshop-job-photo img { transform: scale(1.035); }
  #view-workshop.active .workshop-receipt { animation: workshop-receipt-arrive .3s cubic-bezier(.2,.7,.3,1) both; }
  #view-workshop.active .workshop-receipt-check { stroke-dasharray: 30; animation: workshop-check-draw .35s ease-out both; }
  #view-workshop.active .workshop-job[aria-busy="true"] .primary svg { visibility: hidden; }
  #view-workshop.active .workshop-job[aria-busy="true"] .primary::after { content: ''; position: absolute; right: 16px; width: 16px; height: 16px; border: 2px solid #ffffff55; border-top-color: white; border-radius: 50%; animation: workshop-saving .7s linear infinite; }
  @keyframes workshop-board-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes workshop-receipt-arrive { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
  @keyframes workshop-route-draw { from { stroke-dashoffset: 300; } to { stroke-dashoffset: 0; } }
  @keyframes workshop-check-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
  @keyframes workshop-saving { to { transform: rotate(360deg); } }
}

/* Order desk: quiet hierarchy, contextual tools and a persistent next action. */
:root body #appView:not(.hidden) .workspace-stage .toolbar.orders-toolbar {
  display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px;
  padding: 10px 12px; background: linear-gradient(115deg, var(--ui-surface), var(--ui-raised)); overflow: visible;
}
:root body #appView:not(.hidden) .orders-toolbar :is(.toolbar-meta, .toolbar-spacer) { display: none; }
:root body #appView:not(.hidden) .orders-toolbar .toolbar-actions { display: contents; }
:root body #appView:not(.hidden) .orders-toolbar .search-inline { grid-area: 1 / 1; width: 100%; min-width: 0; }
:root body #appView:not(.hidden) .orders-toolbar .search-box { width: 100%; min-width: 0; height: 38px; }
:root body #appView:not(.hidden) .orders-toolbar-main { grid-area: 1 / 2; display: flex; align-items: center; gap: 8px; }
:root body #appView:not(.hidden) .orders-toolbar-main > button { min-height: 38px; white-space: nowrap; }
:root body #appView:not(.hidden) .orders-toolbar-filters { grid-area: 2 / 1 / auto / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
:root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters { background: transparent; border: 0; padding: 0; gap: 4px; }
:root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters button { min-height: 34px; padding: 6px 12px; border-radius: 6px; }
:root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters button.is-active { background: var(--ui-hover); color: var(--ui-text); box-shadow: inset 0 -2px var(--ui-focus); }
:root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters .is-active .orders-filter-count { color: #ffffff; background: var(--ui-accent); border-color: var(--ui-accent); }
:root body #appView:not(.hidden) .orders-toolbar .orders-archive-filter { margin-left: auto; background: transparent; }
:root body #appView:not(.hidden) .orders-tools { position: relative; }
:root body #appView:not(.hidden) .orders-tools > summary {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 12px; list-style: none;
  border: 1px solid var(--ui-line); border-radius: 6px; color: var(--ui-text); font-size: 12px; font-weight: 600; cursor: pointer;
}
:root body #appView:not(.hidden) .orders-tools > summary::after { content: '+'; color: var(--ui-muted); }
:root body #appView:not(.hidden) .orders-tools[open] > summary::after { content: '-'; }
:root body #appView:not(.hidden) :is(.orders-tools, .order-stock-details) > summary::-webkit-details-marker { display: none; }
:root body #appView:not(.hidden) .orders-tools-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 220px; display: grid; gap: 5px; padding: 12px;
  border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); box-shadow: 0 12px 36px #0003;
}
:root body #appView:not(.hidden) .orders-tools-menu > span { color: var(--ui-muted); font-size: 9px; letter-spacing: .1em; padding: 8px 4px 4px; }
:root body #appView:not(.hidden) .orders-tools-menu > button { text-align: left; justify-content: flex-start; }
:root body #appView:not(.hidden) .orders-filters-menu {
  left: 0; right: auto; width: 300px; max-width: calc(100vw - 32px);
  max-height: min(560px, 65dvh); overflow-y: auto;
}
:root body #appView:not(.hidden) .orders-filters-menu .orders-archive-filter { margin-left: 0; }
:root body #appView:not(.hidden) .orders-filters-menu .orders-query-controls { display: grid; gap: 12px; }
:root body #appView:not(.hidden) .orders-filters-menu .orders-query-controls label { display: grid; gap: 6px; }
:root body #appView:not(.hidden) .orders-filters-menu select { width: 100%; min-width: 0; }
:root body #appView:not(.hidden) .orders-filters-menu .is-active { color: var(--ui-text); background: var(--ui-hover); border-color: var(--ui-focus); }
:root body #appView:not(.hidden) .orders-active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ui-text); font-size: 13px; }
:root body #appView:not(.hidden) .orders-active-filters > span { padding: 6px 10px; border-radius: 6px; background: var(--ui-hover); }
:root body #appView:not(.hidden) .orders-selection-bar {
  grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px;
  background: var(--ui-hover); border: 1px solid var(--ui-line); border-left: 3px solid var(--ui-focus); border-radius: 7px;
}
:root body #appView:not(.hidden) .orders-selection-bar[hidden] { display: none; }
:root body #appView:not(.hidden) .orders-selection-bar > strong { color: var(--ui-text); font-size: 13px; }
:root body #appView:not(.hidden) .orders-selection-help { color: var(--ui-muted); font-size: 12px; flex: 1 1 230px; }
:root body #appView:not(.hidden) .orders-kpi-strip .stat { text-align: left; padding: 11px 12px; min-width: 110px; }
:root body #appView:not(.hidden) .orders-kpi-strip .stat-value { min-width: 156px; }
:root body #appView:not(.hidden) .orders-kpi-strip :is(.stat-orders, .stat-value) { background: linear-gradient(135deg, var(--ui-hover), transparent); }
:root body #appView:not(.hidden) .orders-kpi-strip .stat-val { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
:root body #appView:not(.hidden) .orders-kpi-strip .stat-label { justify-content: flex-start; font-size: 9px; }
:root body #appView:not(.hidden) #view-orders .orders-table td { vertical-align: middle; padding: 12px 10px; }
:root body #appView:not(.hidden) #view-orders .orders-table tr:nth-child(even) td { background: var(--ui-surface); }
:root body #appView:not(.hidden) #view-orders .orders-table tr:hover td,
:root body #appView:not(.hidden) #view-orders .orders-table tr:has(input:checked) td { background: var(--ui-hover); }
:root body #appView:not(.hidden) #view-orders .order-reference { gap: 6px; flex-wrap: nowrap; }
:root body #appView:not(.hidden) #view-orders .order-reference .table-link { font-size: 13px; white-space: nowrap; letter-spacing: -.01em; }
:root body #appView:not(.hidden) #view-orders .order-description { display: block; max-width: none; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin-top: 5px; }
:root body #appView:not(.hidden) #view-orders .order-part-number { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
:root body #appView:not(.hidden) #view-orders .order-line-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--ui-muted); font-size: 11px; }
:root body #appView:not(.hidden) #view-orders .order-line-meta .tag { padding: 2px 5px; font-size: 9px; }
:root body #appView:not(.hidden) #view-orders .order-factory-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
:root body #appView:not(.hidden) #view-orders .order-factory-chip::before { content: ''; width: 3px; height: 16px; border-radius: 2px; background: var(--order-factory-color); flex-shrink: 0; }
:root body #appView:not(.hidden) #view-orders .order-stock-details > summary { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; list-style: none; cursor: pointer; padding-block: 2px; }
:root body #appView:not(.hidden) #view-orders .order-stock-details > summary::after { content: '+'; grid-area: 1 / 2 / 3 / 3; align-self: center; color: var(--ui-muted); }
:root body #appView:not(.hidden) #view-orders .order-stock-details[open] > summary::after { content: '-'; }
:root body #appView:not(.hidden) #view-orders .order-stock-lane { grid-column: 1; color: var(--ui-muted); font-size: 11px; }
:root body #appView:not(.hidden) #view-orders .order-stock-details .stock-breakdown { padding-top: 6px; border-top: 1px solid var(--ui-line); margin-top: 7px; }
:root body #appView:not(.hidden) #view-orders .order-stock-details .stock-foot { gap: 5px; margin-top: 5px; }
:root body #appView:not(.hidden) #view-orders .order-stock-details .stock-hint { line-height: 1.5; white-space: normal; }
:root body #appView:not(.hidden) #view-orders .order-progress-cell > .tag { white-space: nowrap; font-size: 10px; }
:root body #appView:not(.hidden) #view-orders .order-status-line { margin-top: 5px; }
:root body #appView:not(.hidden) #view-orders .order-status-line .tag { background: none; padding: 0; font-size: 11px; text-transform: none; font-weight: 400; }
:root body #appView:not(.hidden) #view-orders .order-status-line .tag.gray { color: var(--ui-muted); }
:root body #appView:not(.hidden) #view-orders .order-quantity { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
:root body #appView:not(.hidden) #view-orders .row-actions-secondary { background: var(--ui-raised); border-color: var(--ui-line); border-left-color: var(--ui-focus); }
:root body #appView:not(.hidden) #view-orders .order-actions-primary { gap: 6px; }
:root body #appView:not(.hidden) #view-orders .order-actions-primary > .table-action { width: auto; }
:root body #appView:not(.hidden) #view-orders .order-actions-primary .primary { background: #00786c; background-image: linear-gradient(120deg, #00786c, #00645d); }
:root body #appView:not(.hidden) #view-orders :is(summary, .table-link):focus-visible,
:root body #appView:not(.hidden) .orders-tools > summary:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 3px; border-radius: 4px; }
@media (min-width: 761px) {
  :root body #appView:not(.hidden) #view-orders .orders-table { min-width: 1180px; table-layout: fixed; }
  /* Share spare width between fields instead of giving it all to the PO column. */
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(1):not([colspan]) { width: 3%; padding-inline: 8px; overflow: visible; text-overflow: clip; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(1) input { margin: 0; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(2):not([colspan]) { width: 24%; min-width: 0; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(3):not([colspan]) { width: 11%; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(4):not([colspan]) { width: 7%; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(5):not([colspan]) { width: 11%; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(6):not([colspan]) { width: 12%; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(7):not([colspan]) { width: 9%; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):nth-child(8):not([colspan]) { width: 7%; text-align: right; white-space: nowrap; text-overflow: clip; }
  :root body #appView:not(.hidden) #view-orders .orders-table :is(th, td):last-child:not([colspan]) { width: 16%; position: sticky; right: 0; z-index: 2; border-left: 1px solid var(--ui-line); box-shadow: -6px 0 12px #00000006; }
  :root body #appView:not(.hidden) #view-orders .orders-table thead th:last-child:not([colspan]) { z-index: 5; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices { min-width: 1180px; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(2):not([colspan]) { width: 16%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(3):not([colspan]) { width: 10%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(4):not([colspan]) { width: 5%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(5):not([colspan]) { width: 8%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(6):not([colspan]) { width: 8%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(7):not([colspan]) { width: 9%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(8):not([colspan]) { width: 5%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(9):not([colspan]) { width: 13%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):nth-child(10):not([colspan]) { width: 10%; text-align: right; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices :is(th, td):last-child:not([colspan]) { width: 13%; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices th:nth-child(4) { padding-inline: 4px; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices .order-actions-primary { gap: 4px; }
  :root body #appView:not(.hidden) #view-orders .orders-with-prices .order-actions-primary :is(.table-action, .row-actions-menu > summary) { padding-inline: 8px; }
  :root body #appView:not(.hidden)[data-density="compact"] #view-orders .orders-table tbody td { padding-block: 7px; }
}
.orders-table [data-order-price-heading][hidden] { display: none !important; }
#view-orders { --order-price-ink: #654600; --order-price-surface: #f3f1e5; }
body[data-theme="dark"] #view-orders { --order-price-ink: #ffe39a; --order-price-surface: #213b3d; }
:root body #appView:not(.hidden) #view-orders .orders-table tbody tr > td.order-price-cell {
  background: var(--order-price-surface); box-shadow: inset 1px 0 var(--ui-line);
}
:root body #appView:not(.hidden) #view-orders .orders-table th[data-order-price-heading] { color: var(--ui-text); font-size: 12px; font-weight: 800; }
:root body #appView:not(.hidden) #view-orders .orders-table .order-value-cell { font-size: 16px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.order-price-cell strong, .order-value-cell { font-variant-numeric: tabular-nums; }
.order-price-cell .order-price-amount { display: inline-block; box-sizing: border-box; max-width: 100%; font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -.025em; color: var(--order-price-ink, var(--ui-text)); white-space: normal; overflow-wrap: anywhere; }
.order-price-cell .order-price-amount > [aria-hidden] { font-size: .65em; }
.order-price-cell .price-needs-review-amount { padding: 3px 4px; border: 1px solid currentColor; border-radius: 5px; color: var(--ui-danger-text); background: var(--ui-danger-bg); }
.order-price-cell .order-price-expected { display: block; margin-top: 5px; color: var(--ui-text); font-size: 12px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.order-price-cell .order-price-review-link { display: block; margin-top: 5px; padding: 0; min-height: 28px; background: transparent; border: 0; color: var(--ui-link); text-align: left; white-space: normal; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.order-price-cell .price-needs-review { color: var(--ui-danger-text); font-weight: 600; }
.order-price-cell .price-unverified { color: var(--ui-warning-text); }
.order-price-cell .order-price-stop { display: block; margin-bottom: 6px; color: var(--ui-danger-text); font-size: 11px; font-weight: 800; line-height: 1.4; letter-spacing: .035em; white-space: normal; }
:root body #appView:not(.hidden) #view-orders .orders-table .order-row-price-blocked > td:first-child { border-left: 4px solid var(--ui-danger-text); }
:root body #appView:not(.hidden) #view-orders .orders-table .order-row-price-blocked > .order-price-cell { background: var(--ui-danger-bg); }
.order-row-price-blocked .order-actions-primary { flex-wrap: wrap; }
.order-row-price-blocked .order-resolve-price { color: var(--ui-danger-text); background: var(--ui-danger-bg); border: 1px solid var(--ui-danger-text); font-weight: 700; }
.order-row-price-blocked .action-blocker > summary { color: var(--ui-danger-text); font-weight: 600; }
@media (max-width: 760px) {
  :root body #appView:not(.hidden) .workspace-stage .toolbar.orders-toolbar { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  :root body #appView:not(.hidden) .orders-toolbar-main { grid-area: 2 / 1; flex-wrap: wrap; }
  :root body #appView:not(.hidden) .orders-toolbar-filters { grid-area: 3 / 1; gap: 6px; }
  :root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters { flex-wrap: wrap; }
  :root body #appView:not(.hidden) .orders-toolbar .orders-fulfillment-filters button { padding-inline: 8px; }
  :root body #appView:not(.hidden) .orders-toolbar .orders-archive-filter { margin-left: 0; }
  :root body #appView:not(.hidden) #view-orders .orders-table td { text-align: left; }
  :root body #appView:not(.hidden) #view-orders .order-progress-cell { flex-wrap: wrap; }
  :root body #appView:not(.hidden) #view-orders .order-description { white-space: normal; }
  :root body #appView:not(.hidden) #view-orders .orders-table .order-price-cell { grid-column: 1 / -1; grid-row: 3; }
  :root body #appView:not(.hidden) #view-orders .orders-table .order-row-price-blocked { border-left: 4px solid var(--ui-danger-text); }
  :root body #appView:not(.hidden) #view-orders .orders-table .order-row-price-blocked > td:first-child { border-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  :root body #appView:not(.hidden) #view-orders .orders-table td { transition: background-color .14s ease; }
  :root body #appView:not(.hidden) .orders-selection-bar:not([hidden]) { animation: orders-context-arrive .18s ease-out; }
  @keyframes orders-context-arrive { from { opacity: .5; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
}

/* Workspace edition: one visual language for every operational surface. */
:root body #appView:not(.hidden) {
  --ws-accent: #368f72;
  --ws-side: 208px;
}
:root body #appView[data-workspace="warehouse"] { --ws-accent: #238da5; }
:root body #appView[data-workspace="poland"] { --ws-accent: #d49a35; }
:root body #appView[data-workspace="workshop"] { --ws-accent: #35a986; }
:root body #appView[data-workspace="shipments"] { --ws-accent: #4b8ec5; }
:root body #appView[data-workspace="catalog"] { --ws-accent: #74a54b; }
:root body #appView[data-workspace="reports"] { --ws-accent: #c48450; }
:root body #appView[data-workspace="settings"] { --ws-accent: #809c96; }
:root body:has(#appView:not(.hidden)) {
  background-color: var(--ui-canvas);
  background-image: radial-gradient(ellipse at 90% 0%, #5cbb9120, transparent 55%);
  background-attachment: fixed;
}
:root body #appView:not(.hidden) .header {
  background: linear-gradient(110deg, #0b282c, #10232b 60%);
  border-bottom-color: #2b494b; box-shadow: 0 2px 14px #0000000a;
}
:root body #appView:not(.hidden) .brand-mark { background: #cef48b; color: #16362a; border: 1px solid #e5ffc1; box-shadow: 0 3px 16px #b1ff6d18; border-radius: 11px 11px 11px 4px; }
:root body #appView:not(.hidden) .brand-title { font-size: 14px; letter-spacing: -.02em; }
:root body #appView:not(.hidden) .header :is(.secondary, .version-badge, .date-label) { background: #19343a; border-color: #375259; border-radius: 7px; }
:root body #appView:not(.hidden) .main-tabs { background: #0e282d; border-color: #35514e; }
:root body #appView:not(.hidden) .main-tabs .nav-item { color: #bbd0ca; background: transparent; border: 1px solid transparent; }
:root body #appView:not(.hidden) .main-tabs .nav-item:hover { color: #f2fff9; background: #1b3b3f; border-color: #315450; }
:root body #appView:not(.hidden) .main-tabs .nav-item.active { color: #153b2c; background: #cef1d7; border-color: #dfffe7; box-shadow: 0 3px 10px #00000012; }
:root body #appView:not(.hidden) .main-tabs .nav-item.active .nav-prefix { color: #185b40; }
:root body #appView:not(.hidden) :is(.workspace-nav-caption, .workspace-nav-foot, .nav-index) { display: none; }
:root body #appView:not(.hidden) .workspace-stage { padding-top: 22px; padding-bottom: 40px; }
:root body #appView:not(.hidden) .workspace-stage .view-header {
  position: relative; display: flex; align-items: center; gap: 20px;
  width: 100%; max-width: none;
  min-height: 108px; margin-bottom: 16px; padding: 18px 22px;
  background: var(--ui-surface);
  background-image: linear-gradient(110deg, var(--ui-surface) 65%, color-mix(in srgb, var(--ws-accent) 11%, var(--ui-surface)));
  border: 1px solid var(--ui-line); border-radius: 14px;
  box-shadow: var(--ui-shadow); overflow: hidden;
}
:root body #appView:not(.hidden) .workspace-stage .view-header::after {
  content: ''; display: block; position: absolute; right: 12%; top: -110px;
  z-index: 0; padding: 0; margin: 0; background: transparent;
  width: 260px; height: 260px; border: 1px solid color-mix(in srgb, var(--ws-accent) 15%, transparent);
  border-radius: 50%; box-shadow: 0 0 0 28px color-mix(in srgb, var(--ws-accent) 4%, transparent); pointer-events: none;
}
:root body #appView:not(.hidden) .workspace-heading { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; min-width: 0; }
:root body #appView:not(.hidden) .workspace-heading > div { min-width: 0; }
:root body #appView:not(.hidden) .workspace-eyebrow { display: block; margin-bottom: 6px; color: var(--ui-muted); font: 600 9px/1.2 var(--font-mono); letter-spacing: .13em; text-transform: uppercase; }
:root body #appView:not(.hidden) .workspace-view-symbol {
  position: relative; display: grid; place-items: center; width: 60px; height: 60px; flex-shrink: 0;
  color: var(--ui-text); background: color-mix(in srgb, var(--ws-accent) 10%, var(--ui-surface));
  border: 1px solid color-mix(in srgb, var(--ws-accent) 38%, var(--ui-line)); border-radius: 16px 16px 16px 5px;
  box-shadow: inset 0 1px #ffffff25, 0 5px 14px #163f2f08;
}
:root body #appView:not(.hidden) .workspace-view-symbol svg { width: 30px; height: 30px; stroke-width: 1.25; }
:root body #appView:not(.hidden) .view-header h2 { font-size: 31px; font-weight: 650; letter-spacing: -.045em; margin: 0 0 5px; }
:root body #appView:not(.hidden) .view-header p { line-height: 1.45; }
:root body #appView:not(.hidden) .workspace-appearance { position: relative; z-index: 1; margin-left: auto; }
:root body #appView:not(.hidden) .appearance-label { display: none; }
:root body #appView:not(.hidden) .density-control { background: var(--ui-surface); box-shadow: 0 2px 8px #12382606; }
:root body #appView:not(.hidden) .workspace-stage .toolbar { border-radius: 12px; padding: 12px; box-shadow: var(--ui-shadow); }
:root body #appView:not(.hidden) .search-inline { position: relative; }
:root body #appView:not(.hidden) .search-inline::before {
  content: ''; position: absolute; top: 50%; left: 12px; width: 14px; height: 14px; transform: translateY(-50%); pointer-events: none;
  background: var(--ui-muted); opacity: .9;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8' cy='8' r='5.5' stroke='black' fill='none' stroke-width='1.6'/%3E%3Cpath d='m12 12 5 5' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
}
:root body #appView:not(.hidden) .search-box { padding-left: 36px; min-height: 38px; background: var(--ui-raised); border-radius: 8px; }
:root body #appView:not(.hidden) :is(.primary, .secondary, .table-action) { border-radius: 7px; }
:root body #appView:not(.hidden) .primary {
  background: #00786c; background-image: linear-gradient(120deg, #00786c, #006758);
  border-color: #00786c; box-shadow: inset 0 1px #ffffff20, 0 3px 8px #006d5d14;
}
:root body #appView:not(.hidden) .primary:hover { background: #006357; box-shadow: inset 0 1px #ffffff20, 0 4px 14px #006d5d22; }
:root body #appView:not(.hidden) :is(button, input, select, textarea):disabled { box-shadow: none; background-image: none; }
:root body #appView:not(.hidden) .panel { border-radius: 14px; border-color: var(--ui-line); box-shadow: var(--ui-shadow); padding: 18px; }
:root body #appView:not(.hidden) .panel h3 { font-size: 15px; letter-spacing: -.02em; font-weight: 650; }
:root body #appView:not(.hidden) .panel h3::before { height: 14px; width: 4px; background: var(--ws-accent); }
:root body #appView:not(.hidden) .panel-title-row { gap: 12px; align-items: center; }
:root body #appView:not(.hidden) .panel-meta { font: 500 10px/1.4 var(--font-body); letter-spacing: .02em; color: var(--ui-muted); text-transform: none; }
:root body #appView:not(.hidden) .data-table th { background: var(--ui-raised); border-bottom: 1px solid var(--ui-line); padding-block: 13px; font-size: 10px; letter-spacing: .045em; }
:root body #appView:not(.hidden) .data-table :is(td, th) { font-variant-numeric: tabular-nums; }
:root body #appView:not(.hidden) .table-wrap { border-radius: 12px; }
:root body #appView:not(.hidden) .data-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--ui-raised) 48%, var(--ui-surface)); }
:root body #appView:not(.hidden) .data-table tbody tr:hover td { background: var(--ui-hover); }
:root body #appView:not(.hidden) :is(.metric, .import-meta-card, .kv-item) {
  background: var(--ui-raised); border: 1px solid var(--ui-line-soft); border-radius: 10px; box-shadow: none;
}
:root body #appView:not(.hidden) .metric { position: relative; padding: 16px; overflow: hidden; }
:root body #appView:not(.hidden) .metric::after { content: ''; position: absolute; top: 14px; bottom: 14px; right: 0; width: 3px; border-radius: 3px; background: var(--ws-accent); opacity: .5; }
:root body #appView:not(.hidden) .metric .label { color: var(--ui-muted); font-size: 11px; font-weight: 500; }
:root body #appView:not(.hidden) .metric .value { color: var(--ui-text); font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.035em; margin-top: 8px; font-variant-numeric: tabular-nums; }
:root body #appView:not(.hidden) :is(.activity-item, .status-card) { border: 1px solid var(--ui-line-soft); border-radius: 10px; background: var(--ui-raised); box-shadow: none; padding: 14px; }
:root body #appView:not(.hidden) :is(.activity-title, .status-title) { font-size: 13px; font-weight: 600; color: var(--ui-text); }
:root body #appView:not(.hidden) :is(.activity-detail, .list-meta, .activity-meta) { line-height: 1.55; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) .orders-kpi-strip { border-radius: 12px; box-shadow: var(--ui-shadow); }
:root body #appView:not(.hidden) .orders-kpi-strip :is(.stat-orders, .stat-value) { background: linear-gradient(110deg, var(--ui-hover), var(--ui-surface)); }
:root body #appView:not(.hidden) :is(.warehouse-table-intro, .catalog-browser-head) { border-bottom-color: var(--ui-line); }
:root body #appView:not(.hidden) .warehouse-photo { border-radius: 10px; box-shadow: 0 3px 9px #193c2b0d; }
:root body #appView:not(.hidden) .catalog-product-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
:root body #appView:not(.hidden) .catalog-product-card { border-radius: 16px; padding: 12px; box-shadow: var(--ui-shadow); overflow: hidden; }
:root body #appView:not(.hidden) .catalog-product-grid .catalog-product-photo { border-radius: 10px; height: 180px; padding-top: 22px; border-color: #e0e9e3; background-image: linear-gradient(140deg, #fff, #f5f8f4); }
:root body #appView:not(.hidden) .catalog-product-grid .catalog-product-photo img { height: 128px; }
:root body #appView:not(.hidden) .catalog-product-grid .catalog-product-photo.is-missing { background-image: linear-gradient(140deg, var(--ui-raised), var(--ui-surface)); border-color: var(--ui-line); }
:root body #appView:not(.hidden) .catalog-product-copy { padding: 16px 6px 5px; }
:root body #appView:not(.hidden) .catalog-product-copy h3 { font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
:root body #appView:not(.hidden) .catalog-product-card:hover { border-color: var(--ws-accent); box-shadow: 0 12px 28px #153c2c13; }
:root body #appView:not(.hidden) .catalog-product-card:focus-within { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-grid .catalog-product-photo { height: 136px; }
:root body #appView:not(.hidden)[data-density="compact"] .catalog-product-grid .catalog-product-photo img { height: 86px; }
:root body #appView:not(.hidden)[data-workspace="reports"] .workspace-stage .toolbar { padding: 0; min-height: 36px; background: none; border: 0; box-shadow: none; justify-content: flex-end; }
:root body #appView[data-workspace="reports"] .toolbar :is(.search-inline, .toolbar-spacer),
:root body #appView[data-workspace="settings"] .toolbar { display: none; }
:root body #appView:not(.hidden) #view-reports .activity-item.is-empty { min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; text-align: center; border-style: dashed; }
:root body #appView:not(.hidden) #view-reports .activity-item.is-empty::before { content: ''; display: block; width: 28px; height: 8px; margin-bottom: 8px; border: 1px solid var(--ui-line); border-radius: 5px; background: var(--ui-surface); }
:root body #appView:not(.hidden) #view-workshop .workshop-board-heading { border-radius: 15px; box-shadow: var(--ui-shadow); }
:root body #appView:not(.hidden) #view-workshop .workshop-job { border-radius: 14px; box-shadow: var(--ui-shadow); }
:root body #appView:not(.hidden) #view-workshop .workshop-column { border-radius: 12px; }
:root body #appView:not(.hidden) .notice { border-radius: 10px; background: var(--ui-info-bg); color: var(--ui-info-text); border: 1px solid var(--ui-line); border-left: 4px solid var(--ui-focus); box-shadow: var(--ui-shadow); }
:root body #appView:not(.hidden) .notice.error { background: var(--ui-danger-bg); color: var(--ui-danger-text); border-left-color: var(--ui-danger-text); }
:root body #appView:not(.hidden) .notice.warning { background: var(--ui-warning-bg); color: var(--ui-warning-text); border-left-color: var(--ui-warning-text); }
:root body .modal-shell { background: #061b2555; backdrop-filter: blur(5px); }
:root body .modal-shell .modal-card { border-radius: 18px; border-color: var(--ui-line); box-shadow: 0 24px 90px #001a3040; }
:root body .modal-shell .modal-head { border-bottom: 1px solid var(--ui-line); padding-bottom: 18px; background: var(--ui-surface); }
:root body .modal-shell .modal-head :is(h3, .modal-title) { color: var(--ui-text); font-size: 25px; font-weight: 650; letter-spacing: -.035em; }
:root body .modal-shell .modal-card :is(input, select, textarea) { border-radius: 8px; background: var(--ui-raised); border-color: var(--ui-line); color: var(--ui-text); box-shadow: inset 0 1px 2px #163e2d04; }
:root body .modal-shell .modal-card :is(input, select, textarea):focus { background: var(--ui-surface); border-color: var(--ui-focus); outline: 2px solid color-mix(in srgb, var(--ui-focus) 22%, transparent); outline-offset: 1px; }
:root body .modal-shell .modal-actions { padding-top: 16px; border-top: 1px solid var(--ui-line-soft); }
:root body dialog.order-cancellation-dialog {
  width: min(580px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 32px);
  margin: auto; padding: 0; border: 0; background: transparent; overflow: auto;
  color: var(--ui-text); backdrop-filter: none;
}
:root body dialog.order-cancellation-dialog:not([open]) { display: none; }
:root body dialog.order-cancellation-dialog[open] { display: block; }
:root body dialog.order-cancellation-dialog::backdrop { background: #061b25aa; backdrop-filter: blur(4px); }
:root body dialog.order-cancellation-dialog .modal-card { width: 100%; max-height: none; box-sizing: border-box; }
:root body dialog.order-cancellation-dialog textarea { width: 100%; box-sizing: border-box; margin-top: 8px; }
:root body .modal-shell .modal-card .import-meta-card { border-radius: 10px; background: var(--ui-raised); border-color: var(--ui-line); }
:root body .modal-shell .table-wrap { background: var(--ui-surface); border-color: var(--ui-line); border-radius: 10px; }
:root body #orderEditModal .modal-actions { background: var(--ui-surface); }
#loginView .login-form-wrap { border-radius: 18px; box-shadow: inset 0 1px #b3eacd30, 0 24px 64px #0003; }
#loginView .login-form-wrap input { border-radius: 9px; }
#mfaLoginPanel [data-mfa-codes] { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.6; }
#mfaLoginPanel > .secondary { width: 100%; margin-top: 8px; }
#loginView .login-form-wrap input:focus { border-color: #80e6bd; outline: 2px solid #80e6bd30; outline-offset: 2px; }
@media (min-width: 1000px) {
  :root body #appView:not(.hidden) :is(#view-reports, #view-settings) .content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  :root body #appView:not(.hidden) :is(#view-reports, #view-settings) .content-grid > .panel { min-width: 0; margin-top: 0; }
  :root body #appView:not(.hidden) #reportsSalesSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root body #appView:not(.hidden) #polandStatusCards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 1360px) {
  :root body #appView:not(.hidden):has(.main-tabs .nav-item ~ .nav-item) .main-tabs {
    position: fixed; top: 58px; left: 0; bottom: 0; width: var(--ws-side); min-height: 0; max-height: calc(100dvh - 58px);
    display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 26px 14px 16px;
    overflow-x: hidden; overflow-y: auto; border-bottom: 0; border-right: 1px solid #31514e;
    background: radial-gradient(ellipse at 0% 100%, #28504355, transparent 60%), #0e282d;
  }
  :root body #appView:not(.hidden):has(.main-tabs .nav-item ~ .nav-item) .app-grid { margin-left: var(--ws-side); width: calc(100% - var(--ws-side)); min-height: calc(100dvh - 58px); }
  :root body #appView:not(.hidden):has(.main-tabs .nav-item ~ .nav-item) .workspace-stage { width: min(1840px, calc(100% - 48px)); }
  :root body #appView:not(.hidden) .main-tabs:has(.nav-item ~ .nav-item) .workspace-nav-caption { display: block; color: #b2c8c1; padding: 0 12px 14px; font: 500 9px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .16em; }
  :root body #appView:not(.hidden) .main-tabs:has(.nav-item ~ .nav-item) .nav-item { justify-content: flex-start; flex-shrink: 0; width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 9px; gap: 11px; }
  :root body #appView:not(.hidden) .main-tabs:has(.nav-item ~ .nav-item) .nav-index { display: block; margin-left: auto; color: inherit; font: 500 9px/1 var(--font-mono); }
  :root body #appView:not(.hidden) .main-tabs:has(.nav-item ~ .nav-item) .nav-item[data-view="reports"] { margin-top: 20px; }
  :root body #appView:not(.hidden) .main-tabs:has(.nav-item ~ .nav-item) .workspace-nav-foot { position: relative; display: block; margin-top: auto; padding: 52px 12px 100px; color: #d5e6dd; pointer-events: none; }
  :root body #appView:not(.hidden) .workspace-nav-foot > span { display: block; margin-bottom: 10px; font: 500 8px/1.4 var(--font-mono); letter-spacing: .15em; color: #acc7bc; }
  :root body #appView:not(.hidden) .workspace-nav-foot strong { font-size: 22px; font-weight: 500; line-height: 1.1; letter-spacing: -.045em; }
  :root body #appView:not(.hidden) .workspace-nav-foot svg { position: absolute; left: 10px; bottom: 0; width: 160px; height: 100px; stroke: #7abf9d; opacity: .32; stroke-width: 1; }
}
@media (max-width: 1100px) {
  :root body #appView:not(.hidden) .workspace-stage .view-header { padding: 16px; min-height: 96px; }
  :root body #appView:not(.hidden) .workspace-heading { gap: 12px; }
  :root body #appView:not(.hidden) .workspace-view-symbol { width: 48px; height: 48px; border-radius: 12px 12px 12px 4px; }
  :root body #appView:not(.hidden) .workspace-view-symbol svg { width: 25px; height: 25px; }
  :root body #appView:not(.hidden) .view-header h2 { font-size: 28px; }
}
@media (max-width: 760px) {
  :root body #appView:not(.hidden) .header { height: auto; grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; gap: 8px; }
  :root body #appView:not(.hidden) .header-right { min-width: 0; flex-wrap: wrap; gap: 6px; }
  :root body #appView:not(.hidden) .header-right button { white-space: nowrap; }
  :root body #appView:not(.hidden) .workspace-stage { padding-top: 14px; }
  :root body #appView:not(.hidden) .workspace-stage .view-header { padding: 14px; margin-bottom: 12px; }
  :root body #appView:not(.hidden) .workspace-view-symbol { display: none; }
  :root body #appView:not(.hidden) .view-header p { font-size: 12px; }
  :root body #appView:not(.hidden) .workspace-eyebrow { font-size: 8px; }
  :root body #appView:not(.hidden) .main-tabs { padding-inline: 12px; }
  :root body #appView:not(.hidden) .catalog-product-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  :root body #appView:not(.hidden) .metric { padding: 12px; }
  :root body #appView:not(.hidden) .metric .value { font-size: 23px; }
  :root body .modal-shell .modal-card { border-radius: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  :root body #appView:not(.hidden) .view.active { animation: workspace-surface-in .2s ease-out; }
  :root body #appView:not(.hidden) .main-tabs .nav-prefix { transition: transform .16s ease; }
  :root body #appView:not(.hidden) .main-tabs .nav-item:hover .nav-prefix { transform: translateX(2px); }
  :root body #appView:not(.hidden) .catalog-product-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
  :root body #appView:not(.hidden) .catalog-product-card:hover { transform: translateY(-3px); }
  :root body .modal-shell:not(.hidden) .modal-card { animation: workspace-dialog-in .18s ease-out; }
  :root body #appView:has(.view.active[aria-busy="true"]) .workspace-view-symbol svg { animation: workspace-loading .9s ease-in-out infinite alternate; }
  @keyframes workspace-surface-in { from { opacity: .45; } to { opacity: 1; } }
  @keyframes workspace-dialog-in { from { opacity: .4; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
  @keyframes workspace-loading { from { opacity: .4; } to { opacity: 1; } }
}

/* Frame Orders as a work desk, not a page plus a second independently sized page. */
:root body #appView:not(.hidden)[data-workspace="orders"] .workspace-stage .view-header {
  min-height: 76px; padding: 12px 18px; margin-bottom: 10px;
}
:root body #appView:not(.hidden)[data-workspace="orders"] .workspace-view-symbol { width: 44px; height: 44px; border-radius: 12px 12px 12px 4px; }
:root body #appView:not(.hidden)[data-workspace="orders"] .workspace-view-symbol svg { width: 25px; height: 25px; }
:root body #appView:not(.hidden)[data-workspace="orders"] .workspace-eyebrow { display: none; }
:root body #appView:not(.hidden)[data-workspace="orders"] .view-header h2 { font-size: 26px; }
:root body #appView:not(.hidden) #view-orders .order-quantity { font-size: 14px; }
:root body #appView:not(.hidden) #view-orders .order-actions-primary { display: flex; flex-wrap: wrap; align-items: center; }
:root body #appView:not(.hidden) #view-orders .order-actions-primary > :is(button, details) { flex: 0 0 auto; }
:root body #appView:not(.hidden) #view-orders .order-reference .table-link { white-space: normal; overflow-wrap: anywhere; text-align: left; }
:root body #appView:not(.hidden) #view-orders .order-factory-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
:root body #appView:not(.hidden) #view-orders .order-description { white-space: normal; line-height: 1.45; }
@media (min-width: 761px) {
  :root body #appView:not(.hidden) #view-orders .order-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  :root body #appView:not(.hidden) #view-orders .orders-table td { font-size: 13px; }
  :root body #appView:not(.hidden) #view-orders .workspace-table-scroll { max-height: none; }
}
@media (min-width: 1100px) {
  :root body #appView:not(.hidden)[data-workspace="orders"] .workspace-stage .view-header { min-height: 64px; padding-block: 10px; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .workspace-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .view-header h2 { font-size: 24px; line-height: 1.2; margin: 0; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .view-header p { font-size: 13px; line-height: 1.4; }
  :root body #appView:not(.hidden) .workspace-stage .toolbar.orders-toolbar { min-height: 0; padding-block: 8px; gap: 8px; }
  :root body #appView:not(.hidden) .workspace-stage .stats-bar.orders-kpi-strip:not(.hidden) { grid-template-columns: minmax(96px, 1fr) minmax(172px, 1.4fr) repeat(7, minmax(96px, 1fr)); grid-auto-flow: row; }
  :root body #appView:not(.hidden) .orders-kpi-strip .stat { min-width: 0; padding-block: 10px; }
  :root body #appView:not(.hidden) .orders-kpi-strip .stat-val { font-size: 20px; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .orders-pager { padding-block: 6px; }
}
@media (min-width: 1100px) and (min-height: 800px) {
  :root body #appView:not(.hidden)[data-workspace="orders"] { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
  :root body #appView:not(.hidden)[data-workspace="orders"] > :is(.header, .main-tabs) { flex-shrink: 0; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .app-grid { flex: 1; min-height: 0; display: flex; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .workspace-stage { display: flex; flex-direction: column; min-height: 0; padding-top: 14px; padding-bottom: 16px; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .workspace-stage > :not(.content-shell) { flex-shrink: 0; }
  :root body #appView:not(.hidden)[data-workspace="orders"] .content-shell,
  :root body #appView:not(.hidden) #view-orders.active,
  :root body #appView:not(.hidden) #view-orders > .panel-top-gap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  :root body #appView:not(.hidden) #view-orders > .notice { flex-shrink: 0; max-height: 110px; overflow: auto; }
  :root body #appView:not(.hidden) #view-orders .workspace-table-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
}

/* Focus surfaces: motion is one-shot and never changes operational state. */
:root body #appView:not(.hidden) .workspace-jump-trigger { display: inline-flex; align-items: center; gap: 8px; }
:root body #appView:not(:has(.main-tabs .nav-item ~ .nav-item)) #workspaceJumpButton { display: none; }
.workspace-jump-trigger svg { width: 15px; height: 15px; }
.workspace-jump-trigger kbd { padding: 3px 5px; border: 1px solid #45605e; border-radius: 4px; font: 9px var(--font-mono); color: #ccded7; }
.workspace-jump-dialog {
  box-sizing: border-box; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--ui-line); border-top: 3px solid #74cfaa;
  border-radius: 20px; color: var(--ui-text); background: var(--ui-surface);
  box-shadow: 0 32px 120px #00120c80; overflow: auto; overscroll-behavior: contain;
}
.workspace-jump-dialog::backdrop { background: #041a2288; backdrop-filter: blur(8px); }
.workspace-jump-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 26px 18px; }
.workspace-jump-eyebrow { font: 500 9px/1.5 var(--font-mono); letter-spacing: .14em; color: var(--ui-muted); }
.workspace-jump-head h2 { margin: 8px 0 0; font-size: 25px; letter-spacing: -.045em; line-height: 1.2; }
:root body .workspace-jump-head .secondary { color: var(--ui-muted); background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 6px; padding: 6px 9px; font: 11px var(--font-mono); box-shadow: none; }
.workspace-jump-search { display: flex; align-items: center; gap: 12px; margin: 0 18px 10px; padding: 0 16px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-raised); }
.workspace-jump-search:focus-within { border-color: var(--ui-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-focus) 14%, transparent); }
.workspace-jump-search svg { width: 21px; height: 21px; flex-shrink: 0; color: var(--ui-link); }
:root body .workspace-jump-search input { width: 100%; min-width: 0; padding: 16px 0; border: 0; outline: 0; background: transparent; color: var(--ui-text); box-shadow: none; font: 400 17px/1.3 var(--font-body); }
.workspace-jump-search input::placeholder { color: var(--ui-muted); }
.workspace-jump-list { max-height: min(440px, 48dvh); overflow: auto; padding: 6px 12px 12px; scroll-padding: 8px; }
.workspace-jump-list [role="option"] { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.workspace-jump-list [role="option"]:hover { background: var(--ui-raised); }
.workspace-jump-list [aria-selected="true"] { background: var(--ui-hover); border-color: var(--ui-line); }
.workspace-jump-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 12px 12px 12px 4px; color: var(--ui-link); }
.workspace-jump-icon svg { width: 22px; height: 22px; }
.workspace-jump-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.workspace-jump-copy strong { font-size: 14px; font-weight: 600; }
.workspace-jump-copy small { font-size: 11px; color: var(--ui-muted); line-height: 1.45; }
.workspace-jump-indicator { margin-left: auto; font-size: 11px; color: var(--ui-muted); }
.workspace-jump-empty { padding: 24px; color: var(--ui-muted); text-align: center; }
.workspace-jump-empty[hidden] { display: none; }
.workspace-jump-dialog footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--ui-line); color: var(--ui-muted); background: var(--ui-raised); font-size: 10px; }
.workspace-jump-dialog footer kbd { padding: 2px 4px; margin-right: 3px; border: 1px solid var(--ui-line); border-radius: 4px; background: var(--ui-surface); font-family: var(--font-body); }
:root body .warehouse-item-dialog {
  position: fixed; inset: 16px 16px 16px auto; margin: 0; width: min(710px, calc(100vw - 32px));
  height: calc(100dvh - 32px); max-height: none; border-radius: 22px;
  border-top: 3px solid #74cfaa; box-shadow: -24px 0 100px #001e2440;
}
.warehouse-item-dialog::backdrop { background: #03151c77; backdrop-filter: blur(3px); }
.warehouse-item-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.warehouse-item-dialog :is(.warehouse-item-header, .warehouse-item-footer) { flex-shrink: 0; }
.warehouse-item-dialog .warehouse-item-header { position: sticky; top: 0; z-index: 2; background: var(--ui-surface); padding: 22px 24px; }
.warehouse-item-dialog .warehouse-item-header h2 { font-size: 23px; letter-spacing: -.035em; }
.warehouse-item-dialog .warehouse-item-body { grid-template-columns: 1fr; gap: 24px; min-height: 0; flex: 1; overflow: auto; align-content: start; }
.warehouse-item-dialog .warehouse-item-media { position: relative; padding: 16px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-raised); }
.warehouse-item-dialog .warehouse-item-image { aspect-ratio: auto; height: 240px; border-radius: 12px; border-color: #dce8df; background: radial-gradient(ellipse at center, #fff 45%, #edf3ef); }
.warehouse-item-dialog .warehouse-item-image img { max-height: 208px; }
.warehouse-item-dialog .warehouse-item-no-photo { aspect-ratio: auto; min-height: 180px; }
.warehouse-item-dialog .warehouse-identifiers { padding: 0 2px; }
.warehouse-item-dialog .warehouse-stock-panel { background: linear-gradient(120deg, var(--ui-raised), var(--ui-surface)); border-radius: 14px; }
.warehouse-item-dialog .warehouse-stock-pair strong { font-size: 36px; font-variant-numeric: tabular-nums; }
.warehouse-item-dialog .warehouse-item-footer { position: sticky; bottom: 0; z-index: 2; background: var(--ui-surface); box-shadow: 0 -8px 24px #12312608; }
:root body .catalog-photo-dialog { width: min(1120px, calc(100vw - 32px)); padding: 24px; border-radius: 22px; border-top: 3px solid #74cfaa; }
.catalog-photo-dialog::backdrop { background: #03151cbb; backdrop-filter: blur(8px); }
.catalog-photo-header strong { display: block; font-size: 19px; letter-spacing: -.025em; line-height: 1.35; }
.catalog-photo-header .cell-sub { margin-top: 6px; }
.catalog-photo-header button { flex-shrink: 0; }
.catalog-photo-dialog .catalog-photo-stage { border: 1px solid var(--ui-line); border-radius: 14px; background: #fff; }
.catalog-photo-dialog .catalog-photo-full { height: 58dvh; padding: 24px; background: radial-gradient(ellipse at center, #fff 50%, #f0f4f1); }
.catalog-photo-dialog .catalog-photo-stage.is-zoomed .catalog-photo-full { height: auto; padding: 0; }
:is(.workspace-jump-dialog, .warehouse-item-dialog, .catalog-photo-dialog)[data-closing] { pointer-events: none; }
:is(.workspace-jump-dialog, .warehouse-item-dialog, .catalog-photo-dialog) button:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
@media (max-width: 1100px) {
  .workspace-jump-trigger kbd { display: none; }
}
@media (max-width: 760px) {
  .workspace-jump-head { padding: 18px; }
  .workspace-jump-head h2 { font-size: 22px; }
  .workspace-jump-copy small { display: none; }
  .workspace-jump-dialog footer { padding: 12px; flex-wrap: wrap; }
  .workspace-jump-dialog footer > span:last-child { display: none; }
  :root body .warehouse-item-dialog { inset: 8px; margin: 0; width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 16px; }
  .warehouse-item-dialog .warehouse-item-header { padding: 16px; }
  .warehouse-item-dialog .warehouse-item-image { height: 190px; }
  .warehouse-item-dialog .warehouse-item-image img { max-height: 158px; }
  :root body .catalog-photo-dialog { padding: 16px; border-radius: 16px; }
  .catalog-photo-header strong { font-size: 15px; }
  .catalog-photo-tools { flex-wrap: wrap; }
  .catalog-photo-dialog .catalog-photo-full { padding: 12px; height: 50dvh; }
}
/* Invoice monitoring stays within the workspace palette in both themes. */
#invoiceRegister { min-width: 0; }
.invoice-disclaimer { color: var(--ui-muted); line-height: 1.6; font-size: .9rem; }
.invoice-overview, .invoice-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--ui-line); background: var(--ui-line); border-radius: 12px; overflow: hidden; margin: 16px 0; }
.invoice-overview > div, .invoice-totals > div { padding: 20px; display: grid; gap: 8px; background: var(--ui-surface); }
.invoice-overview strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.invoice-overview span, .invoice-totals span, .invoice-facts span, .invoice-currencies span { color: var(--ui-muted); font-size: .85rem; }
.invoice-currencies { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.invoice-currencies > div { display: grid; gap: 8px; padding: 16px 20px; border: 1px solid var(--ui-line); border-left: 3px solid var(--ui-accent, #007f72); border-radius: 8px; background: var(--ui-surface); }
.invoice-currencies strong { font-size: 1.25rem; }
.invoice-currencies small { color: var(--ui-muted); }
.invoice-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.invoice-controls label { display: flex; align-items: center; gap: 8px; color: var(--ui-text); }
.invoice-controls > span { margin-right: auto; font-size: .85rem; color: var(--ui-muted); }
.invoice-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--ui-line); border-radius: 12px; }
#view-invoices .invoice-table { width: 100%; min-width: 960px; table-layout: auto; border-collapse: collapse; }
#view-invoices .invoice-table td { padding: 16px 14px; vertical-align: top; white-space: normal; }
#view-invoices .invoice-table th { padding: 14px; text-align: left; }
#view-invoices .invoice-table td > span:not(.invoice-badge), #view-invoices .invoice-table td > small { display: block; margin-top: 7px; color: var(--ui-muted); }
.invoice-numeric { white-space: nowrap !important; font-variant-numeric: tabular-nums; }
.invoice-badge { display: inline-block; padding: 5px 8px; border: 1px solid var(--ui-line); border-radius: 6px; font-size: .78rem; font-weight: 650; color: var(--ui-text); background: var(--ui-raised); }
.invoice-badge.warning { border-color: #b17b24; }
.invoice-badge.danger, .invoice-overdue { border-color: #cc514d; }
#view-invoices .invoice-table td > .invoice-overdue { color: var(--ui-text); font-weight: 650; }
.invoice-register-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; box-sizing: border-box; overflow: auto; padding: 28px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-surface); color: var(--ui-text); box-shadow: 0 24px 100px #0006; }
.invoice-register-dialog::backdrop { background: #06121bd1; backdrop-filter: blur(5px); }
.invoice-dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; position: sticky; top: -28px; z-index: 2; background: var(--ui-surface); padding: 16px 0; border-bottom: 1px solid var(--ui-line); }
.invoice-dialog-header h2 { font-size: 2rem; margin: 8px 0; }
.invoice-eyebrow { font-size: .7rem; letter-spacing: .12em; color: var(--ui-muted); }
.invoice-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 0; border-block: 1px solid var(--ui-line); }
.invoice-facts > div { display: grid; gap: 8px; align-content: start; overflow-wrap: anywhere; }
.invoice-facts p { margin: 0; font-size: .85rem; }
.invoice-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.invoice-totals strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.invoice-register-dialog details { border: 1px solid var(--ui-line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.invoice-register-dialog summary { cursor: pointer; font-weight: 650; }
.invoice-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.invoice-form label { display: grid; gap: 8px; font-size: .85rem; }
#invoiceRegisterDialog .invoice-form label { color: var(--ui-text); }
.invoice-form input, .invoice-form select, .invoice-form textarea { width: 100%; box-sizing: border-box; min-width: 0; color: var(--ui-text); background: var(--ui-raised); border: 1px solid var(--ui-line); padding: 10px 12px; border-radius: 6px; }
.invoice-form input[readonly] { color: var(--ui-muted); }
.invoice-full, .invoice-form-error { grid-column: 1 / -1; }
.invoice-form-error { margin: 0; color: var(--ui-text); border-left: 3px solid #cc514d; padding-left: 10px; }
.invoice-form-error:empty { display: none; }
.invoice-journal { padding: 0; list-style: none; }
.invoice-journal li { border-left: 2px solid var(--ui-line); padding: 12px 16px; margin-bottom: 12px; overflow-wrap: anywhere; }
.invoice-journal p, .invoice-journal small { color: var(--ui-muted); margin: 6px 0; font-size: .85rem; }
#invoiceRegister button, #invoiceRegisterDialog button { color: var(--ui-text); background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 7px; padding: 9px 13px; cursor: pointer; font: inherit; font-size: .85rem; }
#invoiceRegister button:hover, #invoiceRegisterDialog button:hover { border-color: #008878; }
#invoiceRegister button:disabled, #invoiceRegisterDialog button:disabled { opacity: .55; cursor: default; }
#invoiceRegisterDialog button.primary { background: #007d71; color: #fff; border-color: #007d71; }
#invoiceRegister .invoice-table th { background: var(--ui-raised); border-bottom: 1px solid var(--ui-line); }
#invoiceRegister .invoice-table td { background: var(--ui-surface); border-bottom: 1px solid var(--ui-line-soft); }
#invoiceRegister .invoice-table tr:last-child td { border-bottom: 0; }
#invoiceRegister .invoice-table tr:hover td { background: var(--ui-raised); }
@media (max-width: 640px) {
  .invoice-overview { grid-template-columns: 1fr 1fr; }
  .invoice-register-dialog { padding: 18px; }
  .invoice-dialog-header { top: -18px; }
  .invoice-facts, .invoice-form, .invoice-totals { grid-template-columns: 1fr; }
  .invoice-controls > span { width: 100%; }
}

/* Governed catalog prices share the record-dialog layout on desktop and phones. */
.catalog-prices-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
.catalog-prices-dialog fieldset { border: 0; padding: 0; margin: 16px 0; display: grid; gap: 16px; min-width: 0; }
.catalog-prices-dialog label { display: grid; gap: 6px; }
.catalog-prices-dialog textarea { min-height: 90px; width: 100%; box-sizing: border-box; padding: 12px; font: inherit; color: var(--ui-text); background: var(--ui-raised); border: 1px solid var(--ui-line); border-radius: 8px; }
.catalog-prices-dialog textarea::placeholder { color: var(--ui-muted); opacity: 1; }
.catalog-price-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.catalog-price-policy { border-left: 3px solid var(--ui-accent); padding-left: 12px; }
.catalog-price-history { margin-top: 20px; }
.catalog-price-history article { border-top: 1px solid var(--ui-line); padding: 12px 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .catalog-price-inputs { grid-template-columns: minmax(0, 1fr); } }

/* Global Orders query controls use the same wrapping row on phone and desktop. */
.orders-query-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.orders-query-controls label { display: flex; align-items: center; gap: 6px; color: var(--ui-muted); font-size: 12px; }
.orders-query-controls select { max-width: 100%; min-height: 38px; }
#orderPreviewModal [data-order-preview-price-column][hidden] { display: none !important; }
#orderPreviewSelected .order-price-blocked { padding: 12px; border: 1px solid var(--ui-danger-text); border-radius: 8px; background: var(--ui-danger-bg); }
#orderPreviewSelected .order-price-stop { color: var(--ui-danger-text); font-weight: 800; }
#orderPreviewSummary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#orderPreviewSummary .order-preview-totals { grid-column: 1 / -1; min-width: 0; }
#orderPreviewSummary .order-preview-totals summary { padding: 10px 0; cursor: pointer; font-weight: 600; color: var(--ui-muted); }
#orderPreviewSummary .order-preview-totals .import-meta { margin-top: 8px; }
#orderPreviewSelected .order-price-explanation { margin-top: 12px; }
#orderPreviewSelected .order-price-equation { display: block; margin: 8px 0 12px; font-size: 28px; font-weight: 800; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#orderPreviewSelected .order-price-blocked .order-price-equation { color: var(--ui-danger-text); }
#orderPreviewSelected .order-price-reference { margin: 8px 0; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .orders-query-controls { width: 100%; }
  .orders-query-controls label { flex: 1 1 180px; justify-content: space-between; }
  .orders-query-controls select { min-height: 44px; }
  #orderPreviewSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #orderPreviewSelected .order-price-equation { font-size: 23px; }
}

.repair-service-invoice .repair-invoice-actions { margin-top: 20px; flex-wrap: wrap; }
.repair-service-invoice .repair-invoice-blocker { border-left: 3px solid var(--ui-danger-text); padding: 12px; margin-block: 12px; }
.repair-service-invoice .record-dialog-header { flex-wrap: wrap; }
