:root {
  --ink: #1d2d3d;
  --ink-soft: #46596c;
  --muted: #6d7e8f;
  --muted-light: #90a0af;
  --primary: #2d7fc3;
  --primary-strong: #2469a5;
  --primary-deep: #184f82;
  --mint: #e3f1fb;
  --mint-soft: #f1f7fc;
  --mint-bright: #cee7f8;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --line: #dfe5ea;
  --line-strong: #ccd6de;
  --success: #137a52;
  --success-bg: #e3f5eb;
  --warning: #8a6227;
  --warning-bg: #fbf2df;
  --error: #b64052;
  --error-deep: #8f2638;
  --error-bg: #fbe8eb;
  --info: #2d6fa8;
  --info-bg: #e8f2fb;
  --shadow-xs: 0 1px 2px rgba(24, 45, 65, 0.04);
  --shadow-sm: 0 8px 24px rgba(24, 45, 65, 0.06);
  --shadow-md: 0 18px 50px rgba(24, 45, 65, 0.1);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --transition: 150ms ease;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.chz-control-panel {
  margin: 0 auto 24px;
  max-width: var(--content-width, 1440px);
}

.chz-control-description {
  margin: 8px 0 0;
  color: var(--text-muted, #64748b);
  max-width: 720px;
}

.chz-control-badge {
  align-self: flex-start;
  padding: 9px 14px;
  border: 1px solid #c8e1f4;
  border-radius: 999px;
  background: #edf7ff;
  color: #17679e;
  font-weight: 700;
}

.chz-control-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 20px;
}

.chz-control-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #d9e6ef;
  border-radius: 16px;
  background: #f8fbfd;
}

.chz-control-summary span {
  color: #64748b;
}

.chz-control-summary strong {
  color: #13283a;
  font-size: 1.35rem;
}

.chz-control-table-wrap td strong,
.chz-control-table-wrap td small {
  display: block;
}

.chz-control-table-wrap td small {
  margin-top: 4px;
  color: #7a8c9d;
  font-size: .78rem;
}

.chz-state-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff4d8;
  color: #8b5a10;
  font-size: .8rem;
  font-weight: 750;
}

.chz-state-badge.is-rejected,
.chz-state-badge.is-critical-incident {
  background: #fee7e9;
  color: #ad3341;
}

.chz-state-badge.is-verified {
  background: #e2f5ea;
  color: #18734a;
}

.chz-control-empty {
  margin: 0 24px 24px;
}

@media (max-width: 760px) {
  .chz-control-summary {
    grid-template-columns: 1fr;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  min-width: 320px;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(145deg, #eef4f9, #f8fafc 58%, #edf3f8);
}

body.is-auth-required {
  overflow: hidden;
}

body.is-auth-required .app-header,
body.is-auth-required > main,
body.is-auth-required .skip-link {
  display: none;
}

.auth-card {
  width: min(100%, 438px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(27, 39, 42, 0.13);
}

.auth-brand {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.auth-brand img {
  display: block;
  width: min(220px, 100%);
  height: auto;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 12px rgba(31, 105, 164, 0.13));
}

.auth-intro {
  margin-top: 18px;
}

.auth-intro h1 {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.auth-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  margin-top: 25px;
  gap: 15px;
}

.auth-form label {
  display: grid;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfcfc;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.auth-form input:focus {
  border-color: #73acd8;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(45, 127, 195, 0.12);
}

.auth-error {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid #efcbd1;
  border-radius: 10px;
  color: var(--error-deep);
  background: #fff6f7;
  font-size: 11px;
}

.primary-button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(45, 127, 195, 0.22);
  font-size: 13px;
  font-weight: 750;
  gap: 10px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.primary-button:hover {
  background: var(--primary-strong);
  box-shadow: 0 12px 25px rgba(45, 127, 195, 0.27);
}

.primary-button:active {
  transform: scale(0.985);
}

.primary-button:disabled {
  opacity: 0.68;
}

.primary-button svg,
.auth-safety-note svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-ukeps .auth-alternative > span,
.auth-ukeps .auth-alternative > small { display: none; }
.auth-gate .text-button {
  min-height: 44px; padding: 10px 14px; border: 0; border-radius: 10px;
  background: transparent; color: #39748a; font: inherit; font-size: 13px;
  cursor: pointer;
}
.auth-gate .text-button:hover { background: #edf5f8; }
.auth-gate .ukeps-login-link:focus-visible,
.auth-gate .text-button:focus-visible { outline: 2px solid #247b9b; outline-offset: 3px; }
.auth-ukeps .ukeps-login-link { background: #17799f; border-color: #17799f; color: white; }
.auth-ukeps .ukeps-login-link:hover { background: #126887; color: white; }
.auth-alternative {
  display: grid;
  margin-top: 17px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  gap: 7px;
}

.auth-alternative > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-alternative > span::before,
.auth-alternative > span::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.ukeps-login-link {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: border-color var(--transition), background var(--transition);
}

.ukeps-login-link:hover {
  border-color: #73acd8;
  background: #f4f9fd;
}

.auth-safety-note {
  display: flex;
  align-items: flex-start;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  gap: 9px;
}

.auth-safety-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--primary);
}

.auth-safety-note strong {
  color: var(--ink-soft);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary-deep);
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select):focus-visible {
  outline: 3px solid #67afe5;
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid rgba(204, 210, 211, 0.9);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(15px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  width: min(1520px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 52px;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
  max-height: 48px;
  flex: 0 0 176px;
  filter: drop-shadow(0 6px 8px rgba(31, 105, 164, 0.15));
  object-fit: contain;
  object-position: left center;
}

.primary-nav {
  display: flex;
  align-items: center;
  height: 72px;
  gap: 6px;
}

.admin-nav-menu {
  position: relative;
  display: inline-flex;
}

.admin-menu-toggle {
  border: 0;
  background: transparent;
  gap: 5px;
}

.admin-menu-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}

.admin-menu-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.admin-menu-list {
  position: absolute;
  z-index: 45;
  top: calc(100% + 10px);
  left: 50%;
  display: grid;
  width: max-content;
  min-width: 190px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(25, 61, 82, .16);
  transform: translateX(-50%);
}

.admin-menu-list a {
  min-height: 39px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 680;
}

.admin-menu-list a:hover,
.admin-menu-list a:focus-visible {
  color: var(--primary-strong);
  background: var(--mint);
  outline: none;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.nav-link[hidden] {
  display: none;
}

.nav-link:hover {
  color: var(--primary-strong);
  background: var(--mint-soft);
}

.nav-link.is-active {
  color: var(--primary-strong);
  background: var(--mint);
}

.nav-link.is-active::after {
  position: absolute;
  right: 14px;
  bottom: -15px;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  content: "";
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 10px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #c9dfef;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--mint-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  gap: 7px;
}

.mode-badge-icon {
  color: var(--success);
  font-size: 15px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--surface);
  transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
}

.icon-button:hover {
  border-color: #b9d4e8;
  color: var(--primary-strong);
  background: var(--mint-soft);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button svg,
.secondary-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.is-spinning svg,
.secondary-button.is-spinning svg {
  animation: spin 700ms linear infinite;
}

.user-chip {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 220px;
  min-height: 48px;
  padding-left: 5px;
  gap: 9px;
}

.logout-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.logout-button:hover {
  border-color: var(--line);
  color: var(--error-deep);
  background: #fff5f6;
}

.logout-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #55a5de);
  box-shadow: 0 5px 12px rgba(45, 127, 195, 0.2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.user-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.user-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

main {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 48px;
}

main[tabindex="-1"]:focus {
  outline: none;
}

.write-lock-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 68px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--primary), var(--shadow-xs);
  gap: 13px;
}

.write-lock-banner[hidden] {
  display: none;
}

.write-lock-banner.is-unsafe {
  border-color: #edc6ce;
  background: linear-gradient(112deg, #fcecef, #fff7f8 70%);
  box-shadow: inset 4px 0 0 var(--error), var(--shadow-xs);
}

.write-lock-banner.is-unsafe .lock-illustration,
.write-lock-banner.is-unsafe .banner-state {
  color: var(--error);
  background: #f9dfe4;
}

.lock-illustration {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(35, 103, 157, 0.09);
}

.lock-illustration svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.banner-copy {
  display: grid;
  min-width: 0;
}

.banner-copy strong {
  color: var(--primary-deep);
  font-size: 14px;
  font-weight: 750;
}

.banner-copy span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-state {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--success);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  gap: 6px;
}

.banner-state span {
  color: #1e9b69;
  font-size: 10px;
}

.context-bar {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(600px, 1.5fr);
  align-items: end;
  margin: 14px 0 16px;
  gap: 30px;
}

.context-heading h1,
.panel-header h2,
.agent-title-row h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.025em;
}

.context-heading h1 {
  margin-top: 3px;
  font-size: clamp(25px, 2vw, 32px);
  line-height: 1.15;
}

.context-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.context-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(220px, 1.2fr);
  align-items: end;
  gap: 11px;
}

.partner-workspace-view .assembly-safety-note { display: none; }

.context-selection-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #f2b8c1;
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.field-label {
  display: grid;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  gap: 6px;
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap select,
.filter-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  appearance: none;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: 650;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select-wrap select:hover:not(:disabled),
.filter-field select:hover:not(:disabled) {
  border-color: #b9d4e8;
}

.select-wrap select:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  opacity: 1;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 19px;
  height: 19px;
  pointer-events: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
}

.context-selector,
.warehouse-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  gap: 9px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.context-selector:hover,
.warehouse-chip:hover {
  border-color: #b9d4e8;
}

.context-selector:focus-within,
.warehouse-chip:focus-within {
  border-color: #56a8df;
  box-shadow: 0 0 0 3px rgba(48, 145, 207, .17), var(--shadow-xs);
}

.context-selector select:focus-visible,
.warehouse-chip select:focus-visible {
  outline: none;
}

.context-selector-icon,
.warehouse-chip-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--mint);
}

.context-selector-icon svg,
.warehouse-chip-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-selector-selection,
.warehouse-selection {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.context-selector-selection .select-wrap,
.warehouse-selection .select-wrap {
  margin-top: 3px;
}

.context-selector-selection select,
.warehouse-selection select {
  min-height: 24px;
  padding: 0 25px 0 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.context-selector small,
.context-selector strong,
.warehouse-chip small,
.warehouse-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-selector small,
.warehouse-chip small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.context-selector strong,
.warehouse-chip strong {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.state-dot,
.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--muted-light);
  box-shadow: 0 0 0 2px #dce6ee;
}

.state-dot.is-ok,
.live-dot.is-ok {
  background: #1f9b69;
  box-shadow: 0 0 0 2px #d8f0e5;
}

.state-dot.is-warning,
.live-dot.is-warning {
  background: #c18a3d;
  box-shadow: 0 0 0 2px #f6e8ca;
}

.state-dot.is-error,
.live-dot.is-error {
  background: var(--error);
  box-shadow: 0 0 0 2px #f4dce1;
}

.state-dot.is-loading,
.state-dot.is-live,
.live-dot {
  animation: breathe 1.8s ease-in-out infinite;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 17px;
  gap: 12px;
}

.metric-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 118px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  gap: 14px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.metric-card:hover {
  border-color: #c6d9e8;
  box-shadow: 0 12px 30px rgba(24, 70, 108, 0.09);
  transform: translateY(-1px);
}

.metric-card.metric-primary {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card.metric-primary::after {
  display: none;
}

.metric-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #55a5de);
  box-shadow: 0 8px 18px rgba(45, 127, 195, 0.2);
}

.metric-icon.is-mint {
  color: var(--success);
  background: var(--success-bg);
  box-shadow: none;
}

.metric-icon.is-sand {
  color: var(--warning);
  background: var(--warning-bg);
  box-shadow: none;
}

.metric-icon.is-rose {
  color: var(--error);
  background: var(--error-bg);
  box-shadow: none;
}

.metric-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.metric-copy > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.metric-copy strong {
  margin: 6px 0 5px;
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.metric-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.panel-header.compact {
  min-height: 70px;
}

.panel-header > div:first-child {
  display: grid;
  gap: 2px;
}

.panel-header h2,
.agent-title-row h2 {
  font-size: 18px;
}

.orders-count {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--mint);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.orders-header-controls {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.orders-header-controls .search-field {
  width: min(390px, 48vw);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  gap: 10px;
}

.orders-selection-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  gap: 12px;
}

.select-all-orders {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  gap: 8px;
}

.select-all-orders input,
.order-selection-checkbox {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.select-all-orders input:disabled,
.order-selection-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.orders-selection-count,
.orders-selection-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.orders-selection-spacer {
  flex: 1 1 auto;
}

.build-supply-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--primary);
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(45, 127, 195, 0.16);
  font-size: 11px;
  font-weight: 850;
  gap: 7px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.build-supply-button:hover:not(:disabled) {
  background: var(--primary-strong);
  box-shadow: 0 7px 18px rgba(45, 127, 195, 0.22);
}

.build-supply-button:active:not(:disabled) {
  transform: translateY(1px);
}

.build-supply-button:disabled {
  border-color: var(--line-strong);
  color: #8a99a7;
  background: #edf2f6;
  box-shadow: none;
}

.build-supply-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field {
  position: relative;
  display: flex;
  width: min(410px, 100%);
  align-items: center;
}

.search-field > svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 39px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field input::placeholder {
  color: #8a99a7;
}

.search-field input:focus {
  border-color: #78b1dd;
  box-shadow: 0 0 0 3px rgba(45, 127, 195, 0.12);
}

kbd {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.filter-field select {
  min-width: 145px;
  min-height: 42px;
  padding-right: 12px;
  font-size: 12px;
}

.table-wrap {
  min-height: 356px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfc;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.orders-panel th:nth-child(1) { width: 5%; }
.orders-panel th:nth-child(2) { width: 15%; }
.orders-panel th:nth-child(3) { width: 35%; }
.orders-panel th:nth-child(4) { width: 18%; }
.orders-panel th:nth-child(5) { width: 13%; }
.orders-panel th:nth-child(6) { width: 14%; }

tbody tr {
  border-bottom: 1px solid #e7edf2;
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: 0;
}

tbody tr:not(.loading-row):hover {
  background: #f7f9fb;
}

.orders-panel tbody tr.is-selected {
  background: #eef7fd;
}

.orders-panel tbody tr.is-selected:hover {
  background: #e7f3fb;
}

.order-selection-cell {
  text-align: center;
}

td {
  color: var(--ink-soft);
  font-size: 12px;
}

.order-id {
  display: grid;
  gap: 2px;
}

.order-id strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.order-id small,
.product-cell small,
.barcode-cell small,
.date-cell small {
  color: var(--muted);
  font-size: 10px;
}

.product-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-cell strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barcode-cell,
.date-cell {
  display: grid;
  gap: 2px;
}

.barcode-cell code {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-cell {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.stock-cell {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  gap: 6px;
}

.stock-cell::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-light);
  content: "";
}

.stock-cell.is-available {
  color: var(--success);
}

.stock-cell.is-available::before {
  background: #1f9b69;
}

.stock-cell.is-warning {
  color: var(--warning);
}

.stock-cell.is-warning::before {
  background: #c18a3d;
}

.stock-cell.is-error {
  color: var(--error);
}

.stock-cell.is-error::before {
  background: var(--error);
}

.order-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2f6;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.order-status.is-new {
  color: var(--info);
  background: var(--info-bg);
}

.order-status.is-available,
.order-status.is-ready,
.order-status.is-reserved {
  color: var(--success);
  background: var(--success-bg);
}

.order-status.is-awaiting-reserve,
.order-status.is-assembling {
  color: var(--warning);
  background: var(--warning-bg);
}

.order-status.is-attention,
.order-status.is-conflict,
.order-status.is-missing {
  color: var(--error);
  background: var(--error-bg);
}

.loading-row td {
  height: 58px;
}

.skeleton-line {
  display: block;
  width: 88%;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf3f7 20%, #f8fafc 40%, #edf3f7 60%);
  background-size: 260% 100%;
  animation: skeleton 1.4s ease infinite;
}

.skeleton-line.is-short { width: 65%; }
.skeleton-line.is-medium { width: 78%; }

.empty-state {
  display: grid;
  min-height: 356px;
  place-items: center;
  align-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 18px;
  color: var(--primary);
  background: var(--mint-soft);
}

.empty-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  max-width: 390px;
  margin: 5px 0 0;
  font-size: 12px;
}

.orders-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 54px;
  align-items: center;
  padding: 8px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  gap: 14px;
}

.orders-pager-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.page-size-field {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  gap: 7px;
}

.page-size-field select {
  min-width: 70px;
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface);
  font: inherit;
}

.orders-pagination > .orders-count {
  justify-self: end;
}

.pager-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--primary-strong);
  background: var(--surface);
  font-size: 11px;
  font-weight: 750;
  gap: 5px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.pager-button:hover:not(:disabled) {
  border-color: #9fc9e7;
  background: var(--mint-soft);
}

.pager-button:active:not(:disabled) {
  transform: scale(0.97);
}

.pager-button:disabled {
  opacity: 0.45;
}

.pager-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orders-page-label {
  min-width: 112px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.panel-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  gap: 12px;
}

.keyboard-hint {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
}

.side-column {
  display: grid;
  gap: 14px;
}

.integration-list {
  display: grid;
  padding: 5px 13px;
}

.integration-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 67px;
  border-bottom: 1px solid #e7edf2;
  gap: 10px;
}

.integration-row:last-child {
  border-bottom: 0;
}

.service-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.service-one-c {
  color: #9b441f;
  background: #fff1cf;
}

.service-ozon { background: #eaf0fb; color: #496b9e; }
.integration-row[data-service="ozon"] .service-copy small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}

.service-wb {
  color: #7c3e85;
  background: #f4e8f7;
}

.service-chz {
  color: #8a681e;
  background: #fff3ce;
}

.service-server { color: #3f6b5a; background: #e6f3ee; }
.integration-row[data-service="server"] .service-copy small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}

.service-chz svg,
.service-server svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-print {
  color: #626d79;
  background: #eef0f3;
}

.service-print svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-copy {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.service-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.service-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2f6;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.status-label.is-ok {
  color: var(--success);
  background: var(--success-bg);
}

.status-label.is-warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.status-label.is-error {
  color: var(--error);
  background: var(--error-bg);
}

.status-label.is-loading {
  color: var(--muted);
  background: #edf2f6;
}

.integration-footer {
  display: flex;
  min-height: 51px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  gap: 10px;
}

.integration-footer-status {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
}

.print-agent-restart-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #cbddec;
  border-radius: 9px;
  color: var(--primary-strong);
  background: #fff;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.print-agent-restart-button:hover:not(:disabled) {
  border-color: #9fc4e2;
  background: #edf7ff;
}

.print-agent-restart-button:active:not(:disabled) {
  transform: translateY(1px);
}

.print-agent-restart-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.print-agent-restart-button svg {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.print-agent-restart-button.is-restarting svg {
  animation: spin 850ms linear infinite;
}

.agent-panel {
  position: relative;
  padding: 17px;
  overflow: hidden;
}

.agent-visual {
  position: absolute;
  top: -18px;
  right: -11px;
  color: rgba(45, 127, 195, 0.08);
}

.agent-visual svg {
  width: 118px;
  height: 118px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-title-row > div {
  display: grid;
  gap: 2px;
}

.agent-panel > p {
  position: relative;
  max-width: 270px;
  margin: 12px 0 15px;
  color: var(--muted);
  font-size: 11px;
}

.agent-facts {
  position: relative;
  display: grid;
  margin: 0 0 15px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-soft);
}

.agent-facts > div {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.agent-facts > div:last-child {
  border-bottom: 0;
}

.agent-facts dt,
.agent-facts dd {
  margin: 0;
  font-size: 10px;
}

.agent-facts dt {
  color: var(--muted);
}

.agent-facts dd {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-facts dd.is-ok { color: var(--success); }
.agent-facts dd.is-warning { color: var(--warning); }
.agent-facts dd.is-error { color: var(--error); }

.secondary-button {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid #bed8eb;
  border-radius: 12px;
  color: var(--primary-strong);
  background: var(--mint-soft);
  font-size: 11px;
  font-weight: 750;
  gap: 8px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.secondary-button:hover {
  border-color: #9fc9e7;
  background: var(--mint);
}

.secondary-button:active {
  transform: scale(0.985);
}

.secondary-button:disabled {
  opacity: 0.65;
}

.support-note {
  display: flex;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #d5e5f0;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  gap: 10px;
}

.support-note > span {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-strong);
  background: var(--mint);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.support-note p {
  margin: 1px 0 0;
  font-size: 10px;
}

.support-note strong {
  color: var(--ink-soft);
}

.page-status {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition);
}

.page-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-status.is-success {
  display: flex;
  align-items: center;
  border-color: #9ed8bc;
  color: #0f6744;
  background: #edfaf3;
  box-shadow: 0 16px 38px rgba(19, 122, 82, 0.18);
  font-weight: 700;
  gap: 9px;
}

.page-status.is-success::before {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  content: "✓";
  font-size: 12px;
  font-weight: 850;
}

.page-status.is-error {
  display: block;
  border-color: #edc6ce;
  color: var(--error-deep);
  background: #fff7f8;
}

.warehouse-error-overlay {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #fff;
  background: rgba(166, 37, 57, 0.96);
  pointer-events: none;
}

.warehouse-error-content {
  display: grid;
  max-width: 650px;
  place-items: center;
  text-align: center;
}

.warehouse-error-symbol {
  display: grid;
  width: 86px;
  height: 86px;
  margin-bottom: 25px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}

.warehouse-error-content strong {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

.warehouse-error-content p {
  margin: 16px 0 0;
  font-size: clamp(18px, 2.5vw, 28px);
}

.warehouse-error-hint {
  margin-top: 30px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(80, 10, 22, 0.24);
  font-size: 13px;
  font-weight: 650;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  50% { opacity: 0.42; }
}

@keyframes skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.assembly-panel {
  margin: 0 0 18px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assembly-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.assembly-form {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto;
  align-items: end;
  margin-top: 22px;
  gap: 14px;
}

.assembly-form label {
  display: grid;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  gap: 7px;
}

.assembly-form input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.assembly-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45, 127, 195, 0.13);
}

.assembly-form input:disabled {
  color: var(--muted);
  background: #eef2f5;
}

.assembly-form label > small {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.assembly-scan-control {
  position: relative;
  display: block;
}

.assembly-scan-control svg {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 15px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.assembly-scan-control input {
  padding-left: 49px;
  border-width: 2px;
}

.assembly-submit {
  display: inline-flex;
  min-width: 154px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 22px rgba(45, 127, 195, 0.2);
  font-weight: 750;
  gap: 9px;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.assembly-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 13px 27px rgba(45, 127, 195, 0.25);
}

.assembly-submit:disabled {
  opacity: 0.58;
}

.assembly-result {
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) minmax(230px, 1fr) auto;
  align-items: center;
  margin-top: 8px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-soft);
  gap: 14px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.assembly-result.is-success {
  border-color: rgba(19, 122, 82, 0.25);
  background: var(--success-bg);
  box-shadow: 0 10px 28px rgba(19, 122, 82, 0.08);
}

.assembly-result.is-error {
  border-color: rgba(182, 64, 82, 0.25);
  background: var(--error-bg);
}

.assembly-result.is-info {
  border-color: rgba(32, 129, 190, 0.28);
  background: var(--info-bg);
}

.assembly-result.is-warning {
  border-color: rgba(193, 138, 61, 0.34);
  background: var(--warning-bg);
  box-shadow: 0 10px 28px rgba(193, 138, 61, 0.08);
}

.assembly-result-icon {
  display: grid;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--info-bg);
  place-items: center;
}

.assembly-result.is-success .assembly-result-icon {
  color: var(--success);
  background: rgba(255, 255, 255, 0.65);
}

.assembly-result.is-error .assembly-result-icon {
  color: var(--error);
  background: rgba(255, 255, 255, 0.65);
}

.assembly-result.is-info .assembly-result-icon {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
}

.assembly-result.is-warning .assembly-result-icon {
  color: var(--warning);
  background: rgba(255, 255, 255, 0.7);
}

.assembly-result-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assembly-result-copy {
  display: grid;
  gap: 3px;
}

.assembly-result-copy strong {
  font-size: 15px;
}

.assembly-result-copy span {
  color: var(--muted);
  font-size: 12px;
}

.assembly-result-facts {
  display: grid;
  grid-template-columns: minmax(95px, 0.7fr) minmax(0, 1.3fr);
  margin: 0;
  padding-left: 17px;
  border-left: 1px solid rgba(109, 126, 143, 0.18);
  gap: 12px;
}

.assembly-result-facts div {
  min-width: 0;
}

.assembly-result-facts dt {
  color: var(--muted);
  font-size: 10px;
}

.assembly-result-facts dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assembly-reprint {
  white-space: nowrap;
  justify-self: end;
  padding: 9px 14px;
  border: 1px solid rgba(45, 127, 195, 0.32);
  border-radius: 11px;
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 750;
  transition: transform var(--transition), border-color var(--transition), opacity var(--transition);
}

#assembly-deliver.is-blocked:not(:disabled) { opacity: 0.58; cursor: pointer; }
#assembly-readiness-summary { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
#assembly-blockers { max-height: 50vh; overflow-y: auto; padding-left: 22px; overflow-wrap: anywhere; }
#assembly-blockers li + li { margin-top: 8px; }

.assembly-reprint:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.assembly-reprint:disabled {
  opacity: 0.58;
}

.assembly-test-print-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.assembly-test-print {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(45, 127, 195, 0.34);
  border-radius: 12px;
  color: var(--primary-strong);
  background: rgba(232, 246, 255, 0.78);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), opacity var(--transition);
}

.assembly-test-print:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.assembly-test-print:disabled {
  cursor: default;
  opacity: 0.58;
}

.assembly-reference-test-print {
  border-color: rgba(190, 132, 31, 0.42);
  color: #80591e;
  background: rgba(255, 247, 224, 0.92);
}

.assembly-safety-note {
  display: flex;
  align-items: flex-start;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
  gap: 8px;
}

.assembly-safety-note > span {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--info);
  background: var(--info-bg);
  font-size: 11px;
  font-weight: 800;
  place-items: center;
}

.assembly-safety-note p {
  margin: 0;
}

@media (max-width: 1240px) {
  .assembly-form {
    grid-template-columns: minmax(320px, 1fr) auto;
  }

  .assembly-submit {
    grid-column: auto;
    justify-self: end;
    margin: 0;
  }

  .assembly-result {
    grid-template-columns: auto 1fr;
  }

  .assembly-result-facts {
    grid-column: 1 / -1;
    padding: 13px 0 0;
    border-top: 1px solid rgba(109, 126, 143, 0.18);
    border-left: 0;
  }
  .header-inner,
  main {
    width: min(100% - 32px, 1180px);
  }

  .header-inner {
    grid-template-columns: minmax(190px, 1fr) auto minmax(250px, 1fr);
    gap: 14px;
  }

  .mode-badge {
    display: none;
  }

  .context-bar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
  }

  .context-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .orders-panel th:nth-child(1) { width: 5%; }
  .orders-panel th:nth-child(2) { width: 16%; }
  .orders-panel th:nth-child(3) { width: 34%; }
  .orders-panel th:nth-child(4) { width: 18%; }
  .orders-panel th:nth-child(5) { width: 13%; }
  .orders-panel th:nth-child(6) { width: 14%; }

  .assembly-job-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

@media (max-width: 1000px) {
  html {
    scroll-padding-top: 124px;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 8px 0 9px;
    row-gap: 5px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .primary-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 44px;
    padding: 2px;
    overflow-x: auto;
    border: 1px solid rgba(92, 119, 145, 0.14);
    border-radius: 14px;
    background: #f4f8fb;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 1 0 auto;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
  }

  .nav-link.is-active::after {
    right: 18px;
    bottom: -3px;
    left: 18px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-note {
    grid-column: 1 / -1;
  }

  .table-wrap {
    min-height: 300px;
  }

}

@media (max-width: 700px) {
  .primary-nav .admin-menu-list {
    right: 0;
    left: auto;
    transform: none;
  }

  .assembly-panel {
    padding: 0;
  }

  .assembly-form {
    grid-template-columns: 1fr;
  }

  .assembly-submit {
    grid-column: 1;
    width: 100%;
    justify-self: stretch;
    margin: 0;
  }

  .assembly-result-facts {
    grid-template-columns: 1fr 1fr;
  }

  html {
    scroll-padding-top: 120px;
  }

  .app-header {
    backdrop-filter: none;
  }

  .header-inner,
  main {
    width: min(100% - 24px, 660px);
  }

  .header-inner {
    min-height: 64px;
  }

  .auth-gate {
    align-items: start;
    padding: 18px 12px;
  }

  .auth-card {
    margin-top: max(4vh, 12px);
    padding: 25px 21px;
    border-radius: 20px;
  }

  .auth-intro {
    margin-top: 25px;
  }

  .auth-intro h1 {
    font-size: 28px;
  }

  .brand-logo {
    width: 158px;
    max-height: 43px;
    flex-basis: 158px;
  }

  .primary-nav {
    height: 42px;
  }

  .nav-link {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .user-copy {
    display: none;
  }

  .user-chip {
    width: auto;
    padding: 0;
    gap: 5px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  main {
    padding-top: 14px;
  }

  .write-lock-banner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    border-radius: var(--radius-md);
  }

  .banner-copy span {
    white-space: normal;
  }

  .banner-state {
    display: none;
  }

  .context-bar {
    margin-top: 22px;
  }

  .context-controls {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    min-height: 126px;
    align-items: flex-start;
    padding: 14px;
    flex-direction: column;
    gap: 10px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .metric-icon svg {
    width: 20px;
    height: 20px;
  }

  .metric-copy strong {
    margin: 4px 0;
    font-size: 24px;
  }

  .metric-copy small {
    white-space: normal;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .panel-header {
    padding: 13px 14px;
  }

  .orders-header {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-header-controls,
  .orders-header-controls .search-field {
    width: 100%;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-selection-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 11px 12px;
    gap: 7px 10px;
  }

  .orders-selection-spacer {
    display: none;
  }

  .orders-selection-state {
    grid-column: 1 / -1;
  }

  .build-supply-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-field {
    width: 100%;
  }

  .table-wrap {
    min-height: auto;
    padding: 8px;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100% !important;
  }

  thead {
    position: absolute;
    width: 1px !important;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    gap: 10px 14px;
  }

  tbody tr:last-child {
    margin-bottom: 0;
  }

  td {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .orders-panel td:nth-child(1) {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: flex-end;
  }

  .orders-panel td:nth-child(1)::before {
    display: none;
  }

  .orders-panel td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 34px;
  }

  .orders-pagination {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
  }

  .orders-pager-controls {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .page-size-field {
    grid-column: 1;
    grid-row: 2;
  }

  .orders-pagination > .orders-count {
    grid-column: 2;
    grid-row: 2;
  }

  .loading-row {
    display: block;
    padding: 14px;
  }

  .loading-row td {
    height: 14px;
  }

  .loading-row td::before {
    display: none;
  }

  .panel-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .empty-state {
    min-height: 280px;
  }
}

@media (max-width: 410px) {
  .brand-logo {
    width: 144px;
    flex-basis: 144px;
  }

  .header-actions {
    gap: 6px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 96px;
    align-items: center;
    flex-direction: row;
  }
}

.assembly-job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 16px;
  margin-top: 0;
}

.assembly-job-list {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line, #dfe4ea);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.assembly-job-list-heading,
.assembly-job-header,
.assembly-delivery-panel,
.assembly-delivery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.assembly-job-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
  text-align: left;
  color: #24303b;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.assembly-job-card:hover,
.assembly-job-card.is-active {
  border-color: #78b1dd;
  box-shadow: 0 0 0 2px rgba(45, 127, 195, .1);
}

.assembly-job-card.is-completed {
  padding-right: 44px;
  background: #f4f6f8;
}

.assembly-job-card.is-completed > :not(.assembly-completed-check) {
  opacity: .62;
  filter: saturate(.55);
}

.assembly-job-card.is-completed:hover > :not(.assembly-completed-check),
.assembly-job-card.is-completed.is-active > :not(.assembly-completed-check) {
  opacity: .9;
  filter: none;
}

.assembly-history-heading {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.assembly-history-more {
  width: 100%;
  margin-top: 10px;
}

.assembly-job-card span,
.assembly-job-card small,
.assembly-jobs-empty span {
  color: #687581;
}

.assembly-job-card .assembly-completed-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
}
.assembly-completed-check.is-ok { color: #18745d; background: #d8efe3; }
.assembly-completed-check.is-warning { color: #925619; background: #ffe8bd; }

.assembly-jobs-empty {
  display: grid;
  gap: 6px;
  padding: 22px 8px 8px;
}

.assembly-job-workspace {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.assembly-job-header {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e6eaee;
}

.assembly-job-header h3 {
  margin: 3px 0;
  font-size: 1.3rem;
}

.assembly-progress {
  display: grid;
  min-width: 130px;
  padding: 12px;
  text-align: center;
  border-radius: 12px;
  background: var(--mint-soft);
}

.assembly-progress strong {
  font-size: 1.35rem;
  color: var(--primary-strong);
}

.assembly-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.assembly-filter-row button,
.assembly-inline-action {
  padding: 7px 10px;
  color: #4c5965;
  border: 1px solid #d7dde3;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.assembly-filter-row button.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.assembly-items-table-wrap {
  margin-top: 16px;
}

.assembly-items-table-wrap table {
  width: 1000px;
  min-width: 1000px;
  max-width: 1000px;
}

#assembly-qr-jobs {
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

@media (max-width: 700px) {
  .assembly-items-table-wrap table { width: 100%; min-width: 0; max-width: 100%; }
  .assembly-items-table-wrap colgroup { display: none; }
  .assembly-items-table-wrap tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .assembly-delivery-actions { flex-wrap: wrap; }
}

.assembly-items-table-wrap col.assembly-photo-column { width: 58px; }
.assembly-items-table-wrap col.assembly-sticker-column { width: 120px; }
.assembly-items-table-wrap col.assembly-product-column { width: 241px; }
.assembly-items-table-wrap col.assembly-gtin-column { width: 120px; }
.assembly-items-table-wrap col.assembly-status-column { width: 142px; }
.assembly-items-table-wrap col.assembly-print-column { width: 35px; }

.assembly-items-table-wrap th:nth-child(4),
.assembly-items-table-wrap td:nth-child(4),
.assembly-items-table-wrap th:nth-child(5),
.assembly-items-table-wrap td:nth-child(5),
.assembly-items-table-wrap th:nth-child(6),
.assembly-items-table-wrap td:nth-child(6),
.assembly-items-table-wrap th:nth-child(7),
.assembly-items-table-wrap td:nth-child(7) {
  padding-right: 10px;
  padding-left: 10px;
}

.assembly-items-table-wrap td strong,
.assembly-items-table-wrap td small {
  display: block;
}

.assembly-photo-cell {
  padding-right: 4px;
}

.assembly-product-photo {
  position: relative;
  display: grid;
  width: 48px;
  height: 60px;
  overflow: hidden;
  border: 1px solid #dce6ed;
  border-radius: 10px;
  color: #9aabb8;
  background: #f2f6f8;
  place-items: center;
}

.assembly-product-photo > svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assembly-product-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition);
}

.assembly-product-photo.is-loaded > img {
  opacity: 1;
}

.assembly-sticker-number {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  white-space: nowrap;
  gap: 4px;
}

.sticker-part-a {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.sticker-part-b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .01em;
}

.assembly-inline-action {
  display: block;
  margin-top: 7px;
  border-radius: 8px;
  color: var(--primary-strong);
}

.assembly-inline-action.is-secondary {
  color: #58636d;
}

.assembly-print-cell {
  padding-right: 10px;
  padding-left: 10px;
  text-align: center;
  white-space: nowrap;
}

.assembly-reprint-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid #c5dceb;
  border-radius: 8px;
  color: var(--primary-strong);
  background: var(--mint-soft);
  cursor: pointer;
  margin: 0;
}

.assembly-reprint-icon:hover {
  border-color: #91bfdf;
  background: var(--mint);
}

.assembly-reprint-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assembly-delivery-panel {
  align-items: flex-end;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  background: var(--surface-soft);
}

.assembly-status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2f6;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.assembly-status.is-success {
  color: var(--success);
  background: var(--success-bg);
}

.assembly-status.is-progress {
  color: var(--info);
  background: var(--info-bg);
}

.assembly-status.is-pending {
  color: var(--warning);
  background: var(--warning-bg);
}

.assembly-status.is-error {
  color: var(--error);
  background: var(--error-bg);
}

#assembly-deliver {
  white-space: nowrap;
}

.delivery-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(22, 55, 82, .24);
}

.delivery-dialog::backdrop {
  background: rgba(25, 44, 60, .38);
  backdrop-filter: blur(2px);
}

.delivery-form {
  padding: 24px;
}

.delivery-dialog-header,
.delivery-dialog-actions,
.delivery-search-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delivery-dialog-header {
  justify-content: space-between;
  margin-bottom: 20px;
}

.delivery-dialog-header h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.delivery-dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.delivery-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.delivery-city-field,
.delivery-point-field,
.delivery-waybill-field,
.delivery-cargo-field {
  grid-column: 1 / -1;
}

.delivery-fields input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font: inherit;
}

.delivery-fields input:focus {
  border-color: #78b1dd;
  box-shadow: 0 0 0 3px rgba(45, 127, 195, .12);
}

.delivery-search-control input {
  min-width: 0;
  flex: 1 1 auto;
}

.delivery-search-control .secondary-button {
  width: auto;
  min-width: 130px;
  flex: 0 0 auto;
}

.delivery-point-field small,
.delivery-cargo-field small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.delivery-form-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #efc4cb;
  border-radius: 11px;
  color: var(--error);
  background: var(--error-bg);
  font-size: 12px;
  font-weight: 650;
}

.workplace-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.workplace-step { padding: 14px 0; border-top: 1px solid var(--border, #dfe4ea); min-width: 0; }
.workplace-step h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.workplace-step h3 > span { display: inline-grid; place-items: center; width: 24px; height: 24px; background: #e6f4fb; color: #287caf; border-radius: 8px; font-size: 12px; }
.workplace-step h3 small { font-size: 11px; font-weight: 500; overflow-wrap: anywhere; color: var(--muted); }
.workplace-step p { margin: 7px 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.workplace-step .workplace-hint { font-size: 12px; color: var(--muted); }
.workplace-step fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.workplace-step .integration-row { padding: 10px 0; gap: 10px; }
.workplace-step .service-copy small { white-space: normal; overflow-wrap: anywhere; }
.workplace-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.workplace-actions a, .workplace-step > button { font-size: 12px; text-decoration: none; padding: 10px 12px; }
.workplace-dialog [hidden] { display: none !important; }
@media(max-width: 520px) { .workplace-dialog .delivery-fields { grid-template-columns: 1fr; } .workplace-step .integration-row { flex-wrap: wrap; } }

.delivery-dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.delivery-dialog-actions .secondary-button,
.delivery-dialog-actions .primary-button {
  width: auto;
  min-width: 130px;
}

.assembly-delivery-panel ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #9b3f3f;
}

.assembly-delivery-panel li.is-ready {
  color: #16734b;
}

@media (max-width: 900px) {
  .assembly-job-layout {
    grid-template-columns: 1fr;
  }

  .assembly-job-list,
  .assembly-job-workspace {
    grid-column: 1;
  }

  .assembly-job-list {
    grid-row: 2;
  }

  .assembly-job-workspace {
    grid-row: 1;
  }

  .assembly-job-header,
  .assembly-delivery-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-fields {
    grid-template-columns: 1fr;
  }

  .delivery-date-field,
  .delivery-fields > .field-label {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .metric-card,
  .panel,
  .write-lock-banner,
  .context-selector,
  .warehouse-chip,
  .support-note {
    border: 1px solid CanvasText;
  }

  .state-dot,
  .live-dot {
    border: 1px solid CanvasText;
  }
}
/* Keep the common shell stable until the authenticated workspace and route are rendered.
   No cached identity or permissions are used for this transition. */
#workspace-loading { display: none; }
.workspace-booting #workspace-loading { display: block; position: fixed; inset: 120px 24px auto; text-align: center; color: #526875; }
.workspace-booting #main-content, .workspace-booting .header-actions,
.workspace-booting .primary-nav, .workspace-booting #auth-gate { visibility: hidden; }

/* Previous shipping point hint in the WB delivery dialog (10.10.2026). */
.delivery-last-point { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: 8px; background: #eef6f1; color: #2f5b45; font-size: 0.9rem; }
.delivery-last-point[hidden] { display: none; }

/* WB handover and passes (10.10.2026). */
.assembly-handover { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #eef3fb; color: #2d4a73; }
.assembly-handover[hidden] { display: none; }
.assembly-handover.is-warning { background: #fff4df; color: #7a5310; }
.wb-pass-dialog form, .wb-pass-dialog .wb-pass-fields { display: grid; gap: 10px; }
.wb-pass-dialog .wb-driver-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.wb-pass-dialog .wb-driver-form[hidden] { display: none; }
.wb-pass-dialog .wb-pass-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* WB delivery dialog: searchable shipping-point list (11.10.2026). */
.delivery-point-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.delivery-point-option { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 500; }
.delivery-point-option:hover, .delivery-point-option.is-selected { border-color: #78b1dd; box-shadow: 0 0 0 2px rgba(45, 127, 195, .12); }
.delivery-point-option input { margin: 0; width: auto; min-height: 0; box-shadow: none; }
.delivery-point-badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef3fb; color: #2d4a73; white-space: nowrap; }
.delivery-point-option.is-last .delivery-point-badge { background: #eef6f1; color: #2f5b45; }
.delivery-point-option strong { display: block; font-weight: 600; }
.delivery-point-option small { display: block; color: var(--muted); font-weight: 500; }
.delivery-point-note { margin: 0; color: var(--muted); font-size: .9rem; }
/* "Передать в доставку" sits under the active assembly card, like "Удалить сборку" (owner request 11.10.2026). */
.assembly-job-list > div > .primary-button { width: 100%; margin-top: 8px; }