:root {
  --ink: #19231f;
  --muted: #6f7b76;
  --muted-2: #94a09b;
  --canvas: #f2f5f3;
  --panel: #ffffff;
  --line: #dfe6e2;
  --line-strong: #cbd6d0;
  --brand: #136c58;
  --brand-dark: #0e3d33;
  --brand-deeper: #0b2f28;
  --brand-soft: #e5f1ed;
  --orange: #c76820;
  --orange-soft: #fcf0e6;
  --blue: #3b6f96;
  --blue-soft: #e9f1f7;
  --red: #b44d44;
  --red-soft: #f9ebe9;
  --warning: #a85e19;
  --shadow-sm: 0 1px 2px rgba(16, 40, 33, 0.04), 0 4px 14px rgba(16, 40, 33, 0.03);
  --shadow-lg: 0 24px 70px rgba(15, 42, 34, 0.2);
  --radius: 8px;
  --sidebar-width: 232px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(19, 108, 88, 0.2);
  outline-offset: 1px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    linear-gradient(rgba(11, 47, 40, 0.94), rgba(11, 47, 40, 0.98)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.035) 18px 19px);
}

.auth-panel {
  width: min(410px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(2, 18, 13, 0.32);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.auth-brand-mark {
  color: #fff;
  background: var(--brand);
  border-color: transparent;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 17px;
  font-weight: 650;
}

.auth-brand span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.auth-copy {
  margin: 24px 0 20px;
}

.auth-kicker {
  color: var(--brand);
  font-size: 8px;
  font-weight: 700;
}

.auth-copy h1 {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 650;
}

.auth-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.auth-form label > span {
  display: block;
  margin-bottom: 6px;
  color: #4c5a54;
  font-size: 10px;
  font-weight: 500;
}

.auth-input-wrap {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  background: #fafbfa;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.auth-input-wrap:focus-within {
  background: #fff;
  border-color: #79ad9f;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.auth-input-wrap svg {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.auth-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.auth-password-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: #7c8983;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.auth-password-toggle:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.auth-password-toggle svg {
  width: 16px;
  height: 16px;
}

.auth-error {
  margin-top: 8px;
  color: var(--red);
  font-size: 10px;
}

.auth-submit {
  width: 100%;
  margin-top: 14px;
}

.auth-login-button {
  display: grid;
  min-height: 56px;
  align-items: center;
  padding: 6px 7px;
  color: #fff;
  background: var(--brand-dark);
  border: 1px solid var(--brand-dark);
  border-radius: 7px;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  text-align: left;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-login-button:hover {
  background: #0a4d40;
  box-shadow: 0 8px 20px rgba(14, 61, 51, 0.17);
}

.auth-login-button:active {
  transform: translateY(1px);
}

.auth-login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-button-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #eed5ab;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 5px;
}

.auth-button-icon svg {
  width: 18px;
  height: 18px;
}

.auth-button-copy {
  min-width: 0;
  padding: 0 10px;
}

.auth-button-copy strong,
.auth-button-copy small {
  display: block;
}

.auth-button-copy strong {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.auth-button-copy small {
  margin-top: 1px;
  color: #9db8b0;
  font-size: 8px;
  font-weight: 400;
}

.auth-button-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #c7dbd5;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  transition: transform 160ms ease, color 160ms ease;
}

.auth-button-arrow svg {
  width: 16px;
  height: 16px;
}

.auth-login-button:hover .auth-button-arrow {
  color: #fff;
  transform: translateX(2px);
}

.auth-login-button.is-loading .auth-button-arrow svg {
  animation: authPulse 900ms ease-in-out infinite;
}

@keyframes authPulse {
  50% {
    opacity: 0.35;
    transform: translateX(3px);
  }
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  color: var(--muted-2);
  border-top: 1px solid #edf1ef;
  font-size: 8px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #dbe8e3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 34%),
    var(--brand-deeper);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  height: 84px;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #e4c69d;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

.brand-mark.small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  color: var(--brand);
  background: var(--brand-soft);
  border-color: transparent;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 650;
}

.brand span {
  display: block;
  margin-top: 1px;
  color: #8fa9a1;
  font-size: 11px;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 24px 14px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: #9db3ac;
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.nav-item:hover {
  color: #edf5f2;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -14px;
  width: 3px;
  background: #e2bd86;
  border-radius: 0 3px 3px 0;
  content: "";
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item span:nth-child(2) {
  flex: 1;
}

.nav-count {
  min-width: 22px;
  padding: 1px 6px;
  color: #c9dad4;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  font-size: 11px;
  text-align: center;
}

.sidebar-foot {
  padding: 0 14px 18px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 5px 16px;
}

.sync-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: #70c9a4;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(112, 201, 164, 0.08);
}

.sync-state strong,
.sync-state span {
  display: block;
}

.sync-state strong {
  color: #c4d4cf;
  font-size: 11px;
  font-weight: 500;
}

.sync-state div span {
  margin-top: 1px;
  color: #728b83;
  font-size: 10px;
}

.factory-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.factory-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #704821;
  background: #e5caa2;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
}

.factory-card strong,
.factory-card span {
  display: block;
}

.factory-card > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.factory-logout {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: #78928a;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.factory-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.factory-logout svg {
  width: 14px;
  height: 14px;
}

.factory-card strong {
  color: #eaf1ef;
  font-size: 12px;
  font-weight: 500;
}

.factory-card span {
  margin-top: 2px;
  color: #859c95;
  font-size: 10px;
}

.workspace {
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 12px;
}

.topbar h1 {
  font-size: 21px;
  font-weight: 650;
}

.topbar p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  gap: 10px;
}

.network-health-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #ead4bf;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}

.network-health-button svg {
  width: 15px;
  height: 15px;
}

.network-health-button.blocked {
  color: #9a4e20;
  background: #fff5eb;
}

.network-health-button.blocked:hover {
  background: #ffeddf;
}

.network-health-button.ready {
  color: var(--brand);
  background: #edf7f3;
  border-color: #cfe4dc;
}

.search-box {
  display: flex;
  width: 240px;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--muted-2);
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.search-box:focus-within {
  background: #fff;
  border-color: #8dbbb0;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.search-box svg {
  width: 17px;
  height: 17px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.icon-button,
.primary-button,
.outline-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #5d6b65;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.icon-button:hover {
  color: var(--ink);
  background: #f7f9f8;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--orange);
  border: 1.5px solid #fff;
  border-radius: 50%;
}

.primary-button {
  min-height: 38px;
  gap: 7px;
  padding: 0 15px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: #0d5b4a;
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.primary-button svg,
.outline-button svg,
.text-button svg {
  width: 17px;
  height: 17px;
}

.outline-button {
  min-height: 38px;
  gap: 7px;
  padding: 0 14px;
  color: #33443d;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
}

.outline-button:hover {
  background: #f7f9f8;
  border-color: #b9c7c0;
}

.text-button {
  gap: 5px;
  padding: 4px;
  color: var(--brand);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.text-button:hover {
  color: var(--brand-dark);
}

.mobile-menu {
  display: none;
}

main {
  padding: 24px 30px 40px;
}

.page {
  display: none;
  animation: pageIn 220ms ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-grid {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  min-width: 0;
  padding: 16px 17px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #65716c;
  font-size: 12px;
}

.kpi-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 7px;
}

.kpi-icon svg {
  width: 17px;
  height: 17px;
}

.kpi-icon.teal {
  color: var(--brand);
  background: var(--brand-soft);
}

.kpi-icon.orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.kpi-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.kpi-icon.red {
  color: var(--red);
  background: var(--red-soft);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 7px 0 5px;
}

.kpi-value-row strong {
  font-size: 28px;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  color: var(--muted);
  font-size: 11px;
}

.kpi-card p {
  display: flex;
  min-height: 19px;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}

.status-chip.live,
.status-chip.positive {
  color: #1b725b;
  background: #e5f3ed;
}

.status-chip.warning {
  color: var(--warning);
  background: var(--orange-soft);
}

.status-chip.danger {
  color: var(--red);
  background: var(--red-soft);
}

.status-chip.neutral {
  color: #66736d;
  background: #eef2f0;
}

.text-danger {
  color: var(--red) !important;
}

.spark-bars {
  display: flex;
  height: 20px;
  align-items: end;
  gap: 3px;
  margin-top: 3px;
}

.spark-bars span {
  width: 9px;
  min-height: 3px;
  background: #a9cec4;
  border-radius: 2px 2px 0 0;
}

.spark-bars span:nth-last-child(-n + 2) {
  background: var(--brand);
}

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

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

.panel-head {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid #edf1ef;
}

.panel-head.compact {
  min-height: 61px;
  padding: 12px 16px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 650;
}

.panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.segmented {
  display: flex;
  padding: 3px;
  background: #f2f5f3;
  border-radius: 6px;
}

.segmented button {
  min-height: 26px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 41, 33, 0.08);
}

.production-list {
  padding: 0 18px 6px;
}

.overview-order {
  padding: 17px 0 16px;
  border-bottom: 1px solid #edf1ef;
  cursor: pointer;
}

.overview-order:last-child {
  border-bottom: 0;
}

.overview-order:hover .order-name {
  color: var(--brand);
}

.order-summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.order-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.product-tile {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #3e665b;
  background: #e9f1ee;
  border-radius: 7px;
}

.product-tile.tone-2 {
  color: #79562e;
  background: #f6eee3;
}

.product-tile.tone-3 {
  color: #3f6079;
  background: #e9eff4;
}

.product-tile.tone-4 {
  color: #75535b;
  background: #f4eaec;
}

.product-tile svg {
  width: 21px;
  height: 21px;
}

.order-name {
  color: #22302b;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.order-meta span {
  position: relative;
}

.order-meta span + span::before {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 2px;
  height: 2px;
  background: #b1bbb6;
  border-radius: 50%;
  content: "";
}

.order-right-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
}

.due-block {
  min-width: 70px;
  text-align: right;
}

.due-block strong {
  display: block;
  font-size: 11px;
  font-weight: 550;
}

.due-block span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.order-percent {
  width: 42px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px 53px;
}

.progress-track {
  position: relative;
  height: 5px;
  flex: 1;
  overflow: hidden;
  background: #edf1ef;
  border-radius: 4px;
}

.progress-track > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.progress-caption {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}

.step-dots {
  display: grid;
  margin-left: 53px;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.step-dot {
  min-width: 0;
}

.step-dot i {
  display: block;
  height: 3px;
  background: #e7ece9;
  border-radius: 3px;
}

.step-dot i.done {
  background: #47957f;
}

.step-dot i.partial {
  background: #e5a66a;
}

.step-dot span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #98a29e;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-rail {
  display: grid;
  gap: 16px;
}

.report-feed {
  padding: 2px 16px 6px;
}

.feed-item {
  position: relative;
  display: grid;
  padding: 11px 0 11px 19px;
  border-bottom: 1px solid #edf1ef;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item::before {
  position: absolute;
  top: 17px;
  left: 1px;
  width: 7px;
  height: 7px;
  background: var(--brand-soft);
  border: 2px solid #6aaa99;
  border-radius: 50%;
  content: "";
}

.feed-item strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.feed-item .feed-qty {
  color: #31483f;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.feed-item time {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  text-align: right;
}

.head-icon {
  width: 17px;
  height: 17px;
  color: var(--orange);
}

.bottleneck-list {
  padding: 3px 16px 10px;
}

.bottleneck-item {
  display: grid;
  padding: 10px 0;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #edf1ef;
}

.bottleneck-item:last-child {
  border-bottom: 0;
}

.rank-number {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #8b6a45;
  background: #f7eee2;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 650;
}

.bottleneck-item:nth-child(1) .rank-number {
  color: #a64d43;
  background: var(--red-soft);
}

.bottleneck-item strong {
  display: block;
  font-size: 11px;
  font-weight: 550;
}

.bottleneck-item p {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottleneck-qty {
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.section-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-toolbar h2 {
  font-size: 18px;
  font-weight: 650;
}

.section-toolbar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.toolbar-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.toolbar-summary strong {
  color: var(--ink);
  font-size: 17px;
}

.field {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.compact-field {
  height: 38px;
  padding: 0 12px;
  font-size: 11px;
}

.table-panel {
  overflow: hidden;
}

.data-table,
.report-table {
  width: 100%;
}

.table-row {
  display: grid;
  min-height: 68px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid #edf1ef;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 1fr) minmax(100px, 0.7fr) minmax(120px, 0.8fr) 30px;
  gap: 16px;
}

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

.table-row:not(.table-header) {
  cursor: pointer;
}

.table-row:not(.table-header):hover {
  background: #fafcfb;
}

.table-header {
  min-height: 42px;
  color: var(--muted);
  background: #f7f9f8;
  font-size: 10px;
}

.table-product {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.table-product .product-tile {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.table-product strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-product span {
  color: var(--muted);
  font-size: 9px;
}

.table-progress {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-progress .progress-track {
  height: 4px;
}

.table-progress b {
  width: 31px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

.table-cell {
  color: #4d5b55;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.table-cell small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.row-arrow {
  color: #a5afa9;
}

.row-arrow svg {
  width: 15px;
  height: 15px;
}

.report-row {
  display: grid;
  min-height: 58px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid #edf1ef;
  grid-template-columns: minmax(180px, 1.25fr) minmax(100px, 0.7fr) minmax(90px, 0.6fr) minmax(72px, 0.45fr) minmax(105px, 0.62fr) minmax(135px, 0.8fr);
  gap: 16px;
}

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

.report-row.table-header {
  min-height: 42px;
}

.report-product strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.report-product span {
  color: var(--muted);
  font-size: 9px;
}

.step-pill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 7px;
  color: #3c6257;
  background: #edf4f1;
  border-radius: 4px;
  font-size: 10px;
}

.report-quantity {
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}

.report-wage {
  color: #8a5a27;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.report-wage small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 400;
}

.report-time {
  color: var(--muted);
  font-size: 10px;
}

.qr-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.network-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.network-status > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

.network-status strong,
.network-status span {
  display: block;
}

.network-status strong {
  font-size: 11px;
  font-weight: 600;
}

.network-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.network-status.ready {
  color: var(--brand);
  background: #f0f8f5;
  border-color: #cfe4dc;
}

.network-status.blocked {
  color: #a35223;
  background: #fff7ef;
  border-color: #efd6bf;
}

.network-status.blocked span {
  color: #8a6243;
}

.network-status .outline-button {
  min-height: 30px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 9px;
  font-size: 9px;
}

.qr-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.qr-card-head {
  padding: 16px 17px 13px;
  border-bottom: 1px solid #edf1ef;
}

.qr-card-head h3 {
  font-size: 13px;
  font-weight: 600;
}

.qr-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.qr-card-body {
  display: grid;
  padding: 17px;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
}

.qr-image {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  background: #fff;
  border: 1px solid #e8ecea;
  border-radius: 6px;
}

.qr-image svg {
  width: 124px;
  height: 124px;
  stroke: none;
}

.qr-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.qr-info span {
  color: var(--muted);
  font-size: 9px;
}

.qr-info strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  font-weight: 650;
}

.qr-info p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.qr-card-actions {
  display: flex;
  padding: 0 17px 16px;
  gap: 7px;
}

.qr-card-actions .outline-button {
  min-height: 32px;
  flex: 1;
  padding: 0 8px;
  font-size: 10px;
}

.settings-panel {
  max-width: 850px;
  padding: 22px;
}

.security-panel {
  max-width: 850px;
  margin-top: 16px;
  overflow: hidden;
}

.security-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf1ef;
}

.security-icon {
  color: #8b5f2e;
  background: #f8efe4;
}

.security-panel-head > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.security-panel-head h3 {
  font-size: 14px;
  font-weight: 600;
}

.security-panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.security-badge {
  padding: 3px 7px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 4px;
  font-size: 8px;
  white-space: nowrap;
}

.password-form {
  display: grid;
  padding: 20px 22px 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.password-field > span {
  display: block;
  margin-bottom: 6px;
  color: #4c5a54;
  font-size: 10px;
  font-weight: 500;
}

.password-field input {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  font-size: 11px;
}

.password-field input:focus {
  border-color: #79ad9f;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.password-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 3px;
  grid-column: 1 / -1;
}

.password-form-foot p {
  color: var(--muted);
  font-size: 9px;
}

.password-submit {
  min-width: 122px;
  flex: 0 0 auto;
}

.password-form-message {
  min-height: 17px;
  grid-column: 1 / -1;
  font-size: 10px;
}

.password-form-message.success {
  color: var(--brand);
}

.password-form-message.error {
  color: var(--red);
}

.template-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #edf1ef;
}

.template-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

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

.template-intro h3 {
  font-size: 14px;
  font-weight: 600;
}

.template-intro p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.template-rows {
  display: grid;
  margin-top: 8px;
  gap: 7px;
}

.empty-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  place-items: center;
  color: #8fa29a;
  background: #f0f4f2;
  border-radius: 7px;
}

.empty-icon svg {
  width: 18px;
  height: 18px;
}

.empty-state strong {
  color: #50605a;
  font-size: 11px;
  font-weight: 550;
}

.empty-state span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.template-row {
  display: grid;
  align-items: center;
  padding: 7px 0;
  grid-template-columns: 26px 30px minmax(0, 1fr) minmax(120px, 0.7fr) 100px 30px;
  gap: 8px;
}

.template-row > span {
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.template-row input,
.template-row select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  font-size: 11px;
}

.template-row input:focus,
.template-row select:focus {
  border-color: #86b6aa;
}

.template-row .price-input {
  height: 36px;
}

.row-delete {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #9ba6a1;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.row-delete:hover {
  color: var(--red);
  background: var(--red-soft);
}

.row-delete svg {
  width: 15px;
  height: 15px;
}

.add-template-row {
  margin-top: 9px;
}

/* Dialogs */
.modal {
  width: min(850px, calc(100vw - 32px));
  max-height: calc(100vh - 34px);
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(8, 24, 19, 0.54);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: dialogIn 180ms ease-out;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.create-order-modal form {
  display: flex;
  max-height: calc(100vh - 34px);
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 8px;
  font-weight: 700;
}

.modal-head h2 {
  font-size: 20px;
  font-weight: 650;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.modal-body {
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.form-section + .form-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #edf1ef;
}

.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.form-section-title > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 650;
}

.form-section-title h3 {
  font-size: 13px;
  font-weight: 600;
}

.form-section-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.form-section-title.with-action .text-button {
  margin-left: auto;
}

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

.form-field {
  display: block;
  grid-column: span 1;
}

.form-field.span-2 {
  grid-column: span 2;
}

.form-field > span,
.worker-field > span {
  display: block;
  margin-bottom: 6px;
  color: #4c5a54;
  font-size: 10px;
  font-weight: 500;
}

.form-field b {
  color: var(--orange);
  font-weight: 500;
}

.form-field input,
.input-suffix {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  font-size: 11px;
}

.form-field input:focus {
  border-color: #79ad9f;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.form-field input::placeholder {
  color: #aeb7b3;
}

.input-suffix {
  display: flex;
  align-items: center;
  padding-right: 10px;
}

.input-suffix input {
  height: 100%;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.input-suffix span {
  color: var(--muted);
  font-size: 10px;
}

.process-editor-head,
.process-editor-row {
  display: grid;
  grid-template-columns: 28px 36px minmax(0, 1fr) minmax(0, 0.72fr) 94px 32px;
  align-items: center;
  gap: 9px;
}

.process-editor-head {
  padding: 0 8px 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.process-editor {
  display: grid;
  gap: 7px;
}

.process-editor-row {
  padding: 6px 7px;
  background: #f7f9f8;
  border: 1px solid #edf1ef;
  border-radius: 6px;
}

.process-editor-row.dragging,
.template-row.dragging {
  background: #edf6f2;
  border-color: #6ca895;
  opacity: 0.7;
}

.process-index {
  color: #74817b;
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.process-editor-row input,
.process-editor-row select {
  width: 100%;
  height: 33px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  font-size: 10px;
}

.process-editor-row input:focus,
.process-editor-row select:focus {
  border-color: #82b3a6;
}

.drag-handle {
  display: grid;
  width: 26px;
  height: 32px;
  place-items: center;
  color: #9aa7a1;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: grab;
  touch-action: none;
}

.drag-handle:hover {
  color: var(--brand);
  background: #e8f1ed;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 16px;
  height: 16px;
}

.price-input {
  display: flex;
  height: 33px;
  align-items: center;
  padding: 0 7px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.price-input:focus-within {
  border-color: #82b3a6;
  box-shadow: 0 0 0 2px rgba(19, 108, 88, 0.07);
}

.price-input span {
  color: var(--muted-2);
  font-size: 10px;
}

.price-input input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 0 0 3px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  font-size: 10px;
  text-align: right;
}

.process-editor-head > span:nth-child(5) {
  padding-right: 4px;
  text-align: right;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 24px;
  background: #fafbfa;
  border-top: 1px solid var(--line);
}

.modal-foot > div:last-child {
  display: flex;
  gap: 9px;
}

.modal-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.modal-hint svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.submit-order-button {
  min-width: 145px;
}

/* Detail dialog */
.order-detail-modal {
  width: min(920px, calc(100vw - 32px));
}

.network-help-modal {
  width: min(540px, calc(100vw - 32px));
}

.network-help-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.network-help-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #a75a25;
  background: #fff1e4;
  border-radius: 7px;
}

.network-help-icon svg {
  width: 19px;
  height: 19px;
}

.network-help-head > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.network-help-head h2 {
  font-size: 17px;
  font-weight: 650;
}

.network-help-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.network-help-body {
  padding: 18px 22px 21px;
}

.network-help-status {
  padding: 9px 11px;
  color: var(--muted);
  background: #f5f7f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
}

.network-help-status.blocked {
  color: #955025;
  background: #fff6ed;
  border-color: #efd8c3;
}

.network-help-status.ready {
  color: var(--brand);
  background: #eef8f4;
  border-color: #cfe5dc;
}

.network-help-steps {
  display: grid;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  gap: 8px;
}

.network-help-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: #fafbfa;
  border: 1px solid #edf1ef;
  border-radius: 6px;
}

.network-help-steps li > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 650;
}

.network-help-steps strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.network-help-steps p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.network-help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
}

.network-help-actions > span {
  color: var(--muted);
  font-size: 8px;
}

.network-help-actions .primary-button {
  flex: 0 0 auto;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-title-row h2 {
  font-size: 20px;
  font-weight: 650;
}

.detail-title-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.detail-body {
  display: grid;
  max-height: calc(100vh - 160px);
  overflow: auto;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.detail-main {
  min-width: 0;
  padding: 22px 24px 28px;
}

.detail-side {
  padding: 22px 22px;
  background: #f7f9f8;
  border-left: 1px solid var(--line);
}

.detail-stats {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-stat {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.detail-stat:last-child {
  border-right: 0;
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.detail-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  font-weight: 650;
}

.detail-stat.price-stat strong {
  color: #8a5a27;
  font-size: 15px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-section-head h3 {
  font-size: 13px;
  font-weight: 600;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 9px;
}

.detail-step-list {
  display: grid;
  border-top: 1px solid #edf1ef;
}

.detail-step {
  display: grid;
  min-height: 50px;
  align-items: center;
  border-bottom: 1px solid #edf1ef;
  grid-template-columns: 26px minmax(92px, 0.9fr) minmax(0, 1.2fr) 72px 58px 50px;
  gap: 10px;
}

.detail-step-number {
  color: var(--muted-2);
  font-size: 9px;
}

.detail-step-name strong {
  display: block;
  font-size: 10px;
  font-weight: 550;
}

.detail-step-name span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
}

.detail-step-progress {
  display: flex;
  align-items: center;
  gap: 7px;
}

.detail-step-progress .progress-track {
  height: 4px;
}

.detail-step-progress b {
  width: 29px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  text-align: right;
}

.detail-step-qty {
  color: #405049;
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-step-price {
  color: #81562d;
  font-size: 9px;
  font-weight: 550;
  text-align: right;
  white-space: nowrap;
}

.detail-step-price span {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 400;
}

.detail-step .status-chip {
  justify-self: end;
}

.detail-side h3 {
  font-size: 12px;
  font-weight: 600;
}

.detail-qr {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  margin: 12px 0;
  padding: 12px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-qr svg {
  width: 100%;
  height: 100%;
  stroke: none;
}

.detail-link {
  overflow: hidden;
  padding: 8px 9px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-qr-actions {
  display: grid;
  margin-top: 8px;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.detail-qr-actions .outline-button {
  min-height: 33px;
  padding: 0 7px;
  font-size: 9px;
}

.detail-side-note {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.detail-side-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--brand);
}

.detail-side-note.blocked {
  padding: 9px;
  color: #8d542d;
  background: #fff4e9;
  border: 1px solid #f0d5be;
  border-radius: 5px;
}

.detail-recent {
  margin-top: 22px;
}

.detail-recent .feed-item {
  padding-top: 8px;
  padding-bottom: 8px;
}

.detail-recent .feed-item::before {
  top: 13px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  width: min(330px, calc(100vw - 40px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: #f3f8f6;
  background: #173c32;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(8, 28, 21, 0.2);
  font-size: 11px;
  animation: toastIn 180ms ease-out;
}

.toast.error {
  background: #7e3833;
}

.toast svg {
  width: 16px;
  height: 16px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.sidebar-scrim {
  display: none;
}

/* Worker mobile view */
.worker-shell {
  min-height: 100vh;
  color: #1a2822;
  background: #f2f5f3;
}

.worker-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.worker-topbar .icon-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  background: transparent;
  border: 0;
}

.worker-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.worker-content,
.worker-success,
.worker-error-state {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 14px 14px 120px;
}

.worker-order-card {
  overflow: hidden;
  padding: 18px;
  color: #eef6f3;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%),
    var(--brand-dark);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 61, 51, 0.13);
}

.worker-order-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 3px 7px;
  color: #bdd4cc;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 9px;
}

.worker-order-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.worker-order-main h1 {
  font-size: 21px;
  font-weight: 650;
}

.worker-order-main p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #9db9b0;
  font-size: 10px;
}

.dot-separator {
  width: 3px;
  height: 3px;
  background: #6c8c82;
  border-radius: 50%;
}

.worker-quantity {
  flex: 0 0 auto;
  text-align: right;
}

.worker-quantity strong {
  display: block;
  color: #f0d3a8;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.1;
}

.worker-quantity span {
  display: block;
  margin-top: 3px;
  color: #8eaaa1;
  font-size: 8px;
}

.worker-order-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding-top: 12px;
  color: #9eb7af;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 9px;
}

.worker-order-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.worker-order-meta svg {
  width: 13px;
  height: 13px;
}

.worker-form-section {
  margin-top: 12px;
  padding: 16px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.worker-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.worker-section-head h2 {
  font-size: 14px;
  font-weight: 600;
}

.worker-section-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.required-label {
  padding: 2px 6px;
  color: #8c6552;
  background: #f4eee9;
  border-radius: 4px;
  font-size: 8px;
}

.worker-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.worker-step-card {
  position: relative;
  min-height: 72px;
  padding: 10px;
  color: #384841;
  background: #f8faf9;
  border: 1px solid #e2e8e5;
  border-radius: 7px;
  text-align: left;
}

.worker-step-card:hover {
  background: #f3f8f6;
  border-color: #b8cec7;
}

.worker-step-card.selected {
  color: #184f40;
  background: #ebf5f1;
  border-color: #4e9c87;
  box-shadow: inset 0 0 0 1px #4e9c87;
}

.worker-step-card.full {
  cursor: not-allowed;
  opacity: 0.55;
}

.worker-step-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.worker-step-card strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-step-card-top span {
  min-width: 22px;
  color: #9aa59f;
  font-size: 8px;
  text-align: right;
}

.worker-step-card.selected .worker-step-card-top span {
  color: var(--brand);
}

.worker-step-card p {
  overflow: hidden;
  margin-top: 3px;
  color: #8c9892;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-step-progress {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  background: #e7ece9;
  border-radius: 4px;
}

.worker-step-progress span {
  display: block;
  height: 100%;
  background: #5a9c89;
  border-radius: inherit;
}

.worker-step-check {
  position: absolute;
  top: -1px;
  right: -1px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 0 6px 0 6px;
  opacity: 0;
}

.worker-step-card.selected .worker-step-check {
  opacity: 1;
}

.worker-step-check svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}

.worker-field {
  display: block;
}

.worker-field + .worker-field {
  margin-top: 15px;
}

.worker-field > span {
  color: #4a574f;
  font-size: 10px;
}

.worker-field small {
  color: #9ca6a1;
  font-size: 8px;
  font-weight: 400;
}

.worker-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fafbfa;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  font-size: 12px;
}

.worker-field input:focus {
  background: #fff;
  border-color: #6ca895;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.quantity-input-wrap {
  display: flex;
  height: 46px;
  align-items: center;
  padding-right: 13px;
  background: #fafbfa;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.quantity-input-wrap:focus-within {
  background: #fff;
  border-color: #6ca895;
  box-shadow: 0 0 0 3px rgba(19, 108, 88, 0.08);
}

.quantity-input-wrap input {
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 20px;
  font-weight: 600;
}

.quantity-input-wrap span {
  color: var(--muted);
  font-size: 11px;
}

.worker-submit-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.worker-submit {
  display: flex;
  width: min(100%, 652px);
  height: 46px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
}

.worker-submit:active {
  background: #0b5a49;
}

.worker-submit:disabled {
  opacity: 0.6;
}

.worker-submit-bar p {
  margin: 6px auto 0;
  color: var(--muted-2);
  font-size: 8px;
  text-align: center;
}

.worker-success,
.worker-error-state {
  min-height: calc(100vh - 60px);
  padding-top: 70px;
  text-align: center;
}

.success-mark,
.error-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 9px 25px rgba(19, 108, 88, 0.2);
}

.success-mark svg,
.error-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.7;
}

.worker-success h1,
.worker-error-state h1 {
  font-size: 22px;
  font-weight: 650;
}

.worker-success > p,
.worker-error-state > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.success-receipt {
  margin: 25px 0 20px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.receipt-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid #edf1ef;
  font-size: 10px;
}

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

.receipt-row span {
  color: var(--muted);
}

.receipt-row strong {
  font-weight: 550;
}

.worker-success .worker-submit {
  margin-top: 16px;
}

.worker-success .text-button {
  margin-top: 10px;
}

.error-icon {
  color: var(--red);
  background: var(--red-soft);
  box-shadow: none;
}

.worker-error-state .outline-button {
  margin-top: 22px;
}

.delivery-reminder-banner {
  margin-bottom: 14px;
}

.delivery-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: #8a4c22;
  background: #fff7ef;
  border: 1px solid #efd6bf;
  border-radius: 7px;
}

.delivery-alert > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

.delivery-alert > div {
  min-width: 0;
  flex: 1;
}

.delivery-alert strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.delivery-alert p {
  margin-top: 2px;
  color: #8a6547;
  font-size: 9px;
}

.delivery-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.delivery-alert-list button {
  min-height: 24px;
  padding: 0 7px;
  color: #7e4b28;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #ebcfb6;
  border-radius: 4px;
  font-size: 8px;
}

.outsourced-list-panel {
  overflow: hidden;
}

.outsourced-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf1ef;
}

.outsourced-list-head h3 {
  font-size: 14px;
  font-weight: 650;
}

.outsourced-list-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.outsourced-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.outsourced-summary span {
  color: var(--muted);
  font-size: 9px;
}

.outsourced-summary strong {
  display: block;
  margin-top: 1px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

.outsourced-list {
  display: grid;
  padding: 0 18px 8px;
}

.outsourced-admin-card {
  padding: 16px 0;
  border-bottom: 1px solid #edf1ef;
  cursor: pointer;
}

.outsourced-admin-card:last-child {
  border-bottom: 0;
}

.outsourced-admin-card:hover .outsourced-name {
  color: var(--brand);
}

.outsourced-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.outsourced-card-identity {
  min-width: 0;
  flex: 1;
}

.outsourced-name {
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease;
}

.outsourced-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.outsourced-due {
  flex: 0 0 auto;
  text-align: right;
}

.outsourced-due strong {
  display: block;
  font-size: 10px;
  font-weight: 550;
}

.outsourced-due span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.outsourced-flow {
  display: grid;
  align-items: center;
  margin: 14px 0 11px 54px;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 16px minmax(0, 1fr) 16px minmax(0, 1fr);
}

.outsourced-flow-line {
  height: 1px;
  background: #e1e7e4;
}

.outsourced-flow-step {
  min-width: 0;
  padding: 8px 9px;
  background: #f7f9f8;
  border: 1px solid #e8edeb;
  border-radius: 5px;
}

.outsourced-flow-step.done {
  background: #eff8f4;
  border-color: #cfe5dc;
}

.outsourced-flow-step.current {
  border-color: #dda66d;
  box-shadow: inset 0 0 0 1px rgba(213, 140, 68, 0.2);
}

.outsourced-flow-step span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outsourced-flow-step strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 9px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outsourced-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 54px;
}

.outsourced-card-progress .progress-track {
  height: 4px;
  flex: 1;
}

.outsourced-card-progress span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
}

.create-outsourced-modal {
  width: min(760px, calc(100vw - 32px));
}

.form-field.span-4 {
  grid-column: 1 / -1;
}

.outsourced-detail-modal {
  width: min(900px, calc(100vw - 32px));
}

.outsourced-detail-body {
  display: grid;
  max-height: calc(100vh - 160px);
  overflow: auto;
  grid-template-columns: minmax(0, 1fr) 305px;
}

.outsourced-detail-main {
  padding: 22px 24px 28px;
}

.outsourced-detail-side {
  padding: 22px;
  background: #f7f9f8;
  border-left: 1px solid var(--line);
}

.outsourced-stage-list {
  display: grid;
  margin-top: 14px;
  gap: 8px;
}

.outsourced-stage-row {
  display: grid;
  min-height: 48px;
  align-items: center;
  padding: 8px 10px;
  background: #fafbfa;
  border: 1px solid #edf1ef;
  border-radius: 6px;
  grid-template-columns: 26px minmax(90px, 0.8fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.outsourced-stage-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
}

.outsourced-stage-icon svg {
  width: 14px;
  height: 14px;
}

.outsourced-stage-row strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.outsourced-stage-row small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
}

.outsourced-stage-value {
  color: #405049;
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.outsourced-timeline {
  margin-top: 18px;
  border-top: 1px solid #edf1ef;
}

.outsourced-timeline-row {
  display: grid;
  min-height: 46px;
  align-items: center;
  border-bottom: 1px solid #edf1ef;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 9px;
}

.outsourced-timeline-row span {
  color: var(--muted);
  font-size: 8px;
}

.outsourced-timeline-row strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outsourced-timeline-row b {
  color: var(--brand);
  font-size: 9px;
  font-weight: 600;
}

.outsourced-detail-qr {
  display: grid;
  aspect-ratio: 1;
  margin: 12px 0;
  padding: 12px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.outsourced-detail-qr svg {
  width: 100%;
  height: 100%;
  stroke: none;
}

.outsourced-detail-actions {
  display: grid;
  margin-top: 8px;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.outsourced-detail-actions .outline-button {
  min-height: 33px;
  padding: 0 7px;
  font-size: 9px;
}

/* Outsourced mobile reporting */
.outsourced-order-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%),
    #173f52;
}

.outsourced-progress-card {
  display: grid;
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ow-progress-item {
  min-width: 0;
}

.ow-progress-item > span,
.ow-progress-item > strong,
.ow-progress-item > small {
  display: block;
}

.ow-progress-item > span {
  color: var(--muted);
  font-size: 9px;
}

.ow-progress-item > strong {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 650;
}

.ow-progress-item > small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.ow-progress-item > i {
  display: block;
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  background: #e7ece9;
  border-radius: 3px;
}

.ow-progress-item > i > b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
}

.outsourced-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.outsourced-action-card {
  position: relative;
  min-height: 83px;
  padding: 11px;
  color: #45544d;
  background: #f8faf9;
  border: 1px solid #e2e8e5;
  border-radius: 7px;
  text-align: left;
}

.outsourced-action-card:hover {
  background: #f2f8f5;
  border-color: #b9d0c8;
}

.outsourced-action-card.selected {
  color: #184f40;
  background: #eaf5f1;
  border-color: #4e9c87;
  box-shadow: inset 0 0 0 1px #4e9c87;
}

.outsourced-action-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ow-action-icon {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 7px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
}

.ow-action-icon svg {
  width: 15px;
  height: 15px;
}

.outsourced-action-card strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.outsourced-action-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

@media (max-width: 1180px) {
  .overview-layout {
    grid-template-columns: minmax(0, 1fr) 286px;
  }

  .search-box {
    width: 190px;
  }

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

@media (max-width: 980px) {
  :root {
    --sidebar-width: 210px;
  }

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

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

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

  .topbar {
    padding-right: 20px;
    padding-left: 20px;
  }

  main {
    padding-right: 20px;
    padding-left: 20px;
  }

  .search-box {
    display: none;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .detail-qr {
    max-width: 280px;
    margin-right: auto;
    margin-left: auto;
  }

  .table-row {
    grid-template-columns: minmax(200px, 1.4fr) minmax(130px, 1fr) minmax(95px, 0.7fr) 30px;
  }

  .table-row > :nth-child(4) {
    display: none;
  }
}

@media (max-width: 760px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-panel {
    padding: 22px 18px;
  }

  .sidebar {
    width: 238px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    visibility: hidden;
    background: rgba(9, 25, 20, 0.45);
    opacity: 0;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .sidebar-scrim.open {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .topbar p {
    display: none;
  }

  .notification-button {
    display: none;
  }

  .topbar .primary-button {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .topbar .primary-button svg {
    width: 19px;
    height: 19px;
  }

  .network-health-button {
    padding: 0 8px;
    font-size: 9px;
  }

  main {
    padding: 14px 12px 28px;
  }

  .kpi-grid {
    margin-bottom: 12px;
    gap: 9px;
  }

  .kpi-card {
    padding: 13px;
  }

  .kpi-value-row strong {
    font-size: 24px;
  }

  .overview-layout {
    gap: 12px;
  }

  .panel-head {
    min-height: 60px;
    padding: 11px 13px;
  }

  .production-list {
    padding: 0 13px 5px;
  }

  .segmented button {
    padding: 0 7px;
  }

  .product-tile {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .due-block {
    display: none;
  }

  .order-progress-row,
  .step-dots {
    margin-left: 47px;
  }

  .step-dot span {
    font-size: 0;
  }

  .right-rail {
    grid-template-columns: 1fr;
  }

  .qr-gallery {
    grid-template-columns: 1fr;
  }

  .section-toolbar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .section-toolbar h2 {
    font-size: 17px;
  }

  .toolbar-actions .compact-field {
    display: none;
  }

  .table-row {
    padding: 11px 13px;
    grid-template-columns: minmax(0, 1fr) 64px 22px;
    gap: 9px;
  }

  .table-row > :nth-child(2),
  .table-row > :nth-child(3),
  .table-row > :nth-child(4),
  .table-header > :nth-child(2),
  .table-header > :nth-child(3),
  .table-header > :nth-child(4) {
    display: none;
  }

  .table-header {
    min-height: 38px;
  }

  .report-row {
    padding: 11px 13px;
    grid-template-columns: minmax(0, 1fr) 78px 76px;
    gap: 8px;
  }

  .report-row > :nth-child(2),
  .report-row > :nth-child(3),
  .report-row > :nth-child(4),
  .report-row.table-header > :nth-child(2),
  .report-row.table-header > :nth-child(3),
  .report-row.table-header > :nth-child(4) {
    display: none;
  }

  .modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .create-order-modal form {
    max-height: 100dvh;
  }

  .modal-head {
    padding: 16px;
  }

  .modal-head h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 16px;
  }

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

  .form-field.span-2 {
    grid-column: span 2;
  }

  .process-editor-head {
    display: none;
  }

  .process-editor-row {
    grid-template-columns: 24px 24px minmax(0, 1fr) 26px;
    gap: 6px;
  }

  .process-editor-row .drag-handle {
    grid-column: 1;
    grid-row: 1;
  }

  .process-editor-row .process-index {
    grid-column: 2;
    grid-row: 1;
  }

  .process-editor-row input[name="processName"] {
    grid-column: 3;
    grid-row: 1;
  }

  .process-editor-row select[name="processTeam"] {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .process-editor-row .price-input {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .process-editor-row .row-delete {
    grid-column: 4;
    grid-row: 1;
  }

  .modal-foot {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  }

  .modal-hint {
    display: none;
  }

  .modal-foot > div:last-child {
    width: 100%;
  }

  .modal-foot .outline-button {
    flex: 0 0 80px;
  }

  .modal-foot .submit-order-button {
    flex: 1;
  }

  .detail-head {
    padding: 16px;
  }

  .network-help-head {
    padding: 16px;
  }

  .network-help-body {
    padding: 15px 16px 18px;
  }

  .network-help-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .network-help-actions .primary-button {
    width: 100%;
  }

  .detail-body {
    max-height: calc(100dvh - 89px);
  }

  .detail-main {
    padding: 16px;
  }

  .detail-side {
    padding: 16px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-stat {
    padding: 10px;
  }

  .detail-stat:nth-child(2) {
    border-right: 0;
  }

  .detail-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .detail-step {
    grid-template-columns: 20px minmax(64px, 0.9fr) minmax(0, 1fr) 48px 48px;
    gap: 7px;
  }

  .detail-step .status-chip {
    display: none;
  }

  .detail-step-qty {
    grid-column: 4;
  }

  .detail-step-price {
    grid-column: 5;
  }

  .settings-panel {
    padding: 14px;
  }

  .security-panel {
    margin-top: 12px;
  }

  .security-panel-head {
    padding: 16px 14px;
  }

  .password-form {
    padding: 16px 14px 18px;
    grid-template-columns: 1fr;
  }

  .password-form-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .password-submit {
    width: 100%;
  }

  .template-row {
    grid-template-columns: 24px 22px minmax(0, 1fr) 26px;
    gap: 6px;
  }

  .template-row .drag-handle {
    grid-column: 1;
    grid-row: 1;
  }

  .template-row > span {
    grid-column: 2;
    grid-row: 1;
  }

  .template-row [data-template-name] {
    grid-column: 3;
    grid-row: 1;
  }

  .template-row [data-template-team] {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .template-row .price-input {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .template-row .row-delete {
    grid-column: 4;
    grid-row: 1;
  }

  .worker-step-grid {
    gap: 7px;
  }
}

@media (max-width: 430px) {
  .kpi-card p {
    overflow: hidden;
    white-space: nowrap;
  }

  .order-summary-row {
    gap: 8px;
  }

  .order-right-meta {
    gap: 7px;
  }

  .order-percent {
    width: 32px;
    font-size: 12px;
  }

  .panel-head h2 {
    font-size: 13px;
  }

  .segmented button {
    padding: 0 6px;
    font-size: 9px;
  }

  .qr-card-body {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .qr-image {
    width: 110px;
    height: 110px;
  }

  .qr-image svg {
    width: 102px;
    height: 102px;
  }

  .worker-order-main h1 {
    font-size: 19px;
  }

  .worker-step-card {
    min-height: 69px;
    padding: 9px;
  }

  .worker-step-card strong {
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .delivery-alert {
    padding: 10px 12px;
  }

  .delivery-alert-list {
    flex-direction: column;
  }

  .delivery-alert-list button {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .outsourced-list-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px;
  }

  .outsourced-summary {
    width: 100%;
    justify-content: space-between;
  }

  .outsourced-list {
    padding: 0 13px 6px;
  }

  .outsourced-card-head {
    align-items: flex-start;
  }

  .outsourced-flow {
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .outsourced-flow-line {
    display: none;
  }

  .outsourced-card-progress {
    margin-left: 0;
  }

  .outsourced-detail-body {
    max-height: calc(100dvh - 89px);
    grid-template-columns: 1fr;
  }

  .outsourced-detail-main,
  .outsourced-detail-side {
    padding: 16px;
  }

  .outsourced-detail-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .outsourced-detail-qr {
    max-width: 280px;
    margin-right: auto;
    margin-left: auto;
  }

  .outsourced-stage-row {
    grid-template-columns: 26px minmax(74px, 0.8fr) minmax(0, 1fr);
  }

  .outsourced-stage-row .status-chip {
    display: none;
  }

  .outsourced-progress-card {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
