:root {
  --bg: #f2f1ed;
  --surface: #ffffff;
  --surface-soft: #f7f7f3;
  --surface-muted: #ecece6;
  --ink: #1d2927;
  --ink-soft: #3e4c49;
  --muted: #71807c;
  --line: #dfe1da;
  --line-strong: #c9cec6;
  --sidebar: #17211f;
  --sidebar-soft: #222e2b;
  --sidebar-muted: #94a29e;
  --accent: #2e6b62;
  --accent-dark: #23534d;
  --accent-soft: #dfece8;
  --amber: #aa6d19;
  --amber-soft: #f5e7ce;
  --red: #ae4d42;
  --red-soft: #f6e2de;
  --blue: #356d8b;
  --blue-soft: #e0ebf1;
  --green: #3d7652;
  --green-soft: #dfecdf;
  --purple: #6b5b86;
  --purple-soft: #e9e4ef;
  --shadow-sm: 0 1px 2px rgba(23, 33, 31, .05), 0 4px 12px rgba(23, 33, 31, .035);
  --shadow-lg: 0 22px 64px rgba(18, 27, 25, .22);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

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

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

svg {
  display: block;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 238px;
  flex-direction: column;
  padding: 18px 12px 14px;
  background: var(--sidebar);
  color: #eaf0ed;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 10px 22px;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e8ad55;
  color: #1d2825;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-copy small {
  display: none;
}

.main-nav,
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item,
.nav-subitem {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9eaaa7;
  text-align: left;
}

.nav-item:hover,
.nav-subitem:hover {
  background: rgba(255, 255, 255, .055);
  color: #eef3f1;
}

.nav-item.is-active {
  background: #2a3734;
  color: #ffffff;
  box-shadow: inset 2px 0 0 #e8ad55;
}

.nav-item svg,
.nav-subitem svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav-item span,
.nav-subitem span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item em,
.nav-subitem em {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .09);
  color: #cbd4d1;
  font-size: 9px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.nav-section {
  margin-top: 24px;
}

.nav-section > span {
  padding: 0 10px 7px;
  color: #64716e;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
}

.nav-subitem {
  height: 35px;
  color: #879590;
}

.nav-subitem svg {
  width: 15px;
  height: 15px;
}

.nav-subitem span {
  font-size: 11px;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.workspace-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
  color: #dde6e2;
  text-align: left;
}

.workspace-card:hover {
  background: rgba(255, 255, 255, .065);
}

.workspace-avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #344541;
  color: #e8ad55;
}

.workspace-avatar svg {
  width: 16px;
  height: 16px;
}

.workspace-card > span:nth-child(2),
.user-row > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.workspace-card strong,
.user-row strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card small,
.user-row small {
  overflow: hidden;
  margin-top: 2px;
  color: #7f8d88;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card > svg {
  width: 14px;
  height: 14px;
  color: #778580;
}

.user-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 2px 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.user-row:hover {
  color: #ffffff;
}

.user-avatar {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dfe9e5;
  color: #35564f;
  font-size: 10px;
  font-weight: 800;
}

.main-shell {
  min-height: 100vh;
  margin-left: 238px;
}

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

.page-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.page-kicker {
  display: none;
}

.page-heading h1 {
  margin: 2px 0 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.global-search {
  display: flex;
  width: min(360px, 32vw);
  min-width: 220px;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.global-search:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.global-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
}

.global-search kbd {
  display: inline-flex;
  width: 22px;
  height: 21px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.text-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  font-weight: 650;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 13px;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(35, 83, 77, .18);
}

.primary-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.secondary-button:hover {
  border-color: #a8b0a8;
  background: var(--surface-soft);
}

.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
}

.ghost-button:hover {
  background: var(--surface-muted);
}

.icon-button {
  width: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.icon-button:hover {
  border-color: #a8b0a8;
  background: var(--surface-soft);
}

.text-button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.text-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.primary-button svg,
.secondary-button svg,
.ghost-button svg,
.icon-button svg,
.text-button svg {
  width: 16px;
  height: 16px;
}

.page-content {
  padding: 22px 26px 40px;
}

.page-inner {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi-item {
  position: relative;
  min-width: 0;
  min-height: 110px;
  padding: 17px 18px 16px;
  border-right: 1px solid var(--line);
}

.kpi-item:last-child {
  border-right: 0;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.kpi-label svg {
  width: 14px;
  height: 14px;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1;
}

.kpi-value small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.kpi-foot strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.kpi-item.is-warning .kpi-label,
.kpi-item.is-warning .kpi-value {
  color: var(--red);
}

.kpi-item.is-positive .kpi-value {
  color: var(--green);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.panel-title strong {
  font-size: 13px;
  font-weight: 750;
}

.panel-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.panel-link svg {
  width: 13px;
  height: 13px;
}

.focus-list {
  display: flex;
  flex-direction: column;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(130px, .8fr) 100px 34px;
  min-height: 67px;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

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

.focus-row:hover {
  background: #fafbf8;
}

.order-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

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

.order-identity code {
  width: fit-content;
  color: var(--accent-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 9px;
  font-weight: 700;
}

.order-identity strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-identity small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-progress {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.compact-progress > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
}

.compact-progress strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.progress-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5e8e2;
}

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

.due-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.due-cell strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.due-cell small {
  color: var(--muted);
  font-size: 8px;
}

.due-cell.is-overdue strong,
.due-cell.is-overdue small {
  color: var(--red);
}

.due-cell.is-soon strong {
  color: var(--amber);
}

.row-arrow {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a4afaa;
}

.focus-row:hover .row-arrow {
  background: var(--surface-muted);
  color: var(--ink);
}

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

.pipeline-list {
  display: flex;
  flex-direction: column;
  padding: 7px 0 10px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
}

.pipeline-row > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.pipeline-row > strong {
  color: var(--ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pipeline-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #eef0eb;
}

.pipeline-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6f8b84;
}

.pipeline-row:nth-child(2) .pipeline-bar span {
  background: #6f8b84;
}

.pipeline-row:nth-child(3) .pipeline-bar span {
  background: #547c91;
}

.pipeline-row:nth-child(4) .pipeline-bar span {
  background: #8c7458;
}

.pipeline-row:nth-child(5) .pipeline-bar span {
  background: #9b6a3e;
}

.pipeline-row:nth-child(6) .pipeline-bar span {
  background: #746482;
}

.pipeline-row:nth-child(7) .pipeline-bar span {
  background: #4d795c;
}

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

.delivery-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 115px 100px;
  min-height: 55px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

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

.delivery-row:hover {
  background: #fafbf8;
}

.date-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}

.date-block strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.date-block small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.delivery-product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.delivery-product strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-product small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
}

.mini-avatar,
.owner-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e5ebe7;
  color: #42635b;
  font-size: 8px;
  font-weight: 800;
}

.mini-avatar {
  width: 22px;
  height: 22px;
}

.owner-avatar {
  width: 26px;
  height: 26px;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

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

.activity-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent);
}

.activity-icon svg {
  width: 13px;
  height: 13px;
}

.activity-body {
  min-width: 0;
}

.activity-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.activity-body p strong {
  color: var(--ink);
}

.activity-body span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.empty-block {
  display: flex;
  min-height: 136px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-block svg {
  width: 27px;
  height: 27px;
  color: #aab4af;
}

.empty-block strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-block p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

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

.section-toolbar h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

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

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

.orders-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.orders-panel {
  min-height: calc(100vh - 175px);
}

.orders-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.status-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-muted);
}

.status-tab {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-tab strong {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(83, 99, 94, .1);
  color: var(--ink-soft);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.status-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.status-tab.is-active strong {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.filter-row {
  display: flex;
  min-height: 51px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.filter-group {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.select-control {
  display: inline-flex;
  height: 33px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
}

.select-control svg {
  width: 13px;
  height: 13px;
}

.select-control select {
  max-width: 125px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  outline: none;
}

.filter-note {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.orders-table th,
.orders-table td {
  height: 58px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  vertical-align: middle;
}

.orders-table th:last-child,
.orders-table td:last-child {
  border-right: 0;
}

.orders-table thead th {
  height: 38px;
  background: #f5f5f1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.orders-table tbody tr {
  cursor: pointer;
}

.orders-table tbody tr:hover td {
  background: #fafbf8;
}

.orders-table tbody tr:last-child td {
  border-bottom: 0;
}

.orders-table .col-order {
  width: 195px;
}

.orders-table .col-product {
  width: 220px;
}

.orders-table .col-stage {
  width: 200px;
}

.orders-table .col-owner {
  width: 120px;
}

.orders-table .col-due {
  width: 120px;
}

.orders-table .col-priority {
  width: 88px;
}

.orders-table .col-actions {
  width: 112px;
}

.table-order {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.table-order code {
  color: var(--accent-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 9px;
  font-weight: 700;
}

.table-order span {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.table-product strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-product small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.stage-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stage-label-row > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.stage-label-row > small {
  color: var(--muted);
  font-size: 8px;
}

.micro-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

.micro-stages i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #e5e8e2;
}

.micro-stages i.is-done {
  background: #6f9488;
}

.micro-stages i.is-current {
  background: var(--amber);
}

.owner-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.owner-cell span:last-child {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-badge,
.status-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.priority-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.priority-normal {
  background: #ecefea;
  color: #66746f;
}

.priority-urgent {
  background: var(--amber-soft);
  color: #8b5811;
}

.priority-critical {
  background: var(--red-soft);
  color: #983e35;
}

.order-reminder-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 7px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(29, 41, 39, .18);
}

.order-reminder-badge.is-compact {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  box-shadow: none;
}

.order-reminder-badge.milestone-15,
.order-reminder-badge.milestone-30 {
  background: #e6532e;
}

.status-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-completed {
  background: #e11d2e;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(190, 18, 36, .24);
}

.status-paused {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-cancelled {
  background: var(--surface-muted);
  color: var(--muted);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

.table-icon-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.table-icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.table-icon-button.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

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

.table-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
}

.pagination {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 11px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  font-size: 11px;
}

.pagination > span {
  color: var(--muted);
  font-size: 11px;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-buttons button {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.page-buttons button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-head {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.calendar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.calendar-title strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

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

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.calendar-nav .icon-button {
  width: 31px;
  min-height: 31px;
}

.calendar-nav .secondary-button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 9px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f5f5f1;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-day {
  position: relative;
  min-height: 112px;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-outside {
  background: #fafaf7;
  color: #b1b9b5;
}

.calendar-day.is-today {
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #e1b36d;
}

.calendar-day > span {
  display: inline-flex;
  width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.calendar-day.is-today > span {
  background: var(--amber);
  color: #fff;
}

.calendar-orders {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 3px;
}

.calendar-order {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 3px 5px;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  background: var(--accent-soft);
  color: #305c53;
  font-size: 7px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-order.is-urgent {
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #7c5017;
}

.calendar-order.is-overdue {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #8d3d34;
}

.calendar-more {
  padding: 0 3px;
  color: var(--muted);
  font-size: 7px;
}

.calendar-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.month-summary {
  padding: 14px 15px;
}

.month-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.month-stat {
  min-height: 62px;
  padding: 10px;
  background: var(--surface-soft);
}

.month-stat span {
  color: var(--muted);
  font-size: 11px;
}

.month-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.deadline-list {
  display: flex;
  flex-direction: column;
}

.deadline-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.deadline-row:hover {
  background: var(--surface-soft);
}

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

.deadline-date {
  display: flex;
  width: 34px;
  height: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--surface-muted);
}

.deadline-date strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.deadline-date small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
}

.deadline-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.deadline-body strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-tag {
  width: fit-content;
  margin-top: 2px;
  padding: 1px 5px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 7px;
  font-weight: 700;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 26, 23, .42);
  backdrop-filter: blur(2px);
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-small {
  width: min(500px, 100%);
}

.modal-wide {
  width: min(860px, 100%);
}

.modal-order {
  width: min(1080px, 100%);
}

.modal-head,
.drawer-head {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.modal-head p,
.drawer-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.modal-form {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.field > span em {
  margin-left: 2px;
  color: var(--red);
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
}

.field input,
.field select {
  height: 38px;
  padding: 0 10px;
}

.field select {
  cursor: pointer;
}

.field textarea {
  min-height: 78px;
  padding: 9px 10px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.input-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 7px;
}

.priority-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.priority-option {
  position: relative;
}

.priority-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.priority-option span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.priority-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.form-error {
  display: none;
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
}

.form-error.is-visible {
  display: block;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 18px;
}

.order-reminder-modal {
  width: min(640px, 100%);
}

.order-reminder-modal .modal-head {
  background: #f8faf8;
}

.order-reminder-modal .modal-head h2 {
  font-size: 19px;
}

.order-reminder-modal .modal-head p {
  font-size: 12px;
}

.order-reminder-list {
  display: flex;
  max-height: min(56vh, 480px);
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 16px;
}

.order-reminder-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.order-reminder-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.order-reminder-row strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.order-reminder-row small {
  color: var(--muted);
  font-size: 12px;
}

.order-reminder-actions {
  margin-top: 0;
  padding: 0 16px 16px;
}

.data-action-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}

.data-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  text-align: left;
}

.data-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.data-action > svg:first-child {
  width: 18px;
  height: 18px;
  justify-self: center;
  color: var(--accent);
}

.data-action > svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.data-action > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.data-action strong {
  font-size: 10px;
}

.data-action small {
  color: var(--muted);
  font-size: 8px;
}

.data-action.is-danger > svg:first-child,
.data-action.is-danger strong {
  color: var(--red);
}

.settings-separator {
  height: 1px;
  margin: 17px 0;
  background: var(--line);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.local-storage-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
}

.local-storage-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.local-storage-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.local-storage-copy strong {
  font-size: 10px;
}

.local-storage-copy code {
  overflow: hidden;
  color: var(--accent-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-storage-copy small {
  color: var(--muted);
  font-size: 8px;
}

.local-storage-card .secondary-button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 9px;
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(1140px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  animation: drawer-in .18s ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(22px);
    opacity: .6;
  }
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 76px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
}

.drawer-head-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.drawer-head-main > div {
  min-width: 0;
}

.drawer-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.drawer-actions .icon-button {
  width: 31px;
  min-height: 31px;
  border-color: transparent;
  background: transparent;
}

.drawer-actions .icon-button:hover {
  background: var(--surface-muted);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.drawer-section {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.drawer-section-head {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
}

.drawer-section-head strong {
  font-size: 11px;
}

.drawer-section-head small {
  color: var(--muted);
  font-size: 8px;
}

.order-overview {
  padding: 14px;
}

.order-overview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-overview-top > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-order-title {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.3;
}

.drawer-customer {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin-top: 18px;
}

.stepper::before {
  position: absolute;
  top: 9px;
  right: 8%;
  left: 8%;
  height: 2px;
  background: #e4e7e1;
  content: "";
}

.step {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.step i {
  display: inline-flex;
  width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border: 2px solid #dfe3dd;
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  font-style: normal;
}

.step i svg {
  width: 10px;
  height: 10px;
}

.step span {
  overflow: hidden;
  width: 100%;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step.is-done {
  color: var(--ink-soft);
}

.step.is-done i {
  border-color: #739187;
  background: #739187;
  color: #fff;
}

.step.is-current {
  color: var(--accent-dark);
  font-weight: 750;
}

.step.is-current i {
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.step.is-current i::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.order-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}

.fact {
  min-height: 76px;
  padding: 10px 13px;
  background: var(--surface);
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.fact strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fact > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.fact.is-warning strong {
  color: var(--red);
}

.fact.is-error strong {
  color: var(--red);
  font-weight: 800;
}

.fact.is-error > small {
  color: var(--red);
}

.order-note {
  padding: 12px 13px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: pre-wrap;
}

.order-note p {
  margin: 0 0 5px;
  font-size: 9px;
  line-height: 1.55;
}

.order-note p:last-of-type {
  margin-bottom: 0;
}

.order-note p strong {
  color: var(--ink);
}

.source-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.source-file svg {
  width: 12px;
  height: 12px;
}

.order-items-list {
  display: flex;
  flex-direction: column;
}

.item-card {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.item-card > summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 88px 86px 16px;
  min-height: 57px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.item-card > summary::-webkit-details-marker {
  display: none;
}

.item-card > summary:hover {
  background: var(--surface-soft);
}

.item-sequence {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 8px;
  font-weight: 700;
}

.item-sequence.is-complete {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(61, 118, 82, .22);
}

.item-summary-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.item-summary-main strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-summary-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-summary-qty {
  color: var(--ink-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.item-log-count {
  color: var(--amber);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.item-log-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--amber);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.item-log-toggle:hover {
  border-color: #c9b28a;
  background: var(--amber-soft);
}

.item-log-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform .15s ease;
}

.item-log-toggle.is-open svg {
  transform: rotate(180deg);
}

.item-card > summary > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform .15s ease;
}

.item-card[open] > summary > svg {
  transform: rotate(180deg);
}

.item-card-body {
  padding: 0 12px 12px 48px;
  background: #fbfbf8;
  border-top: 1px solid var(--line);
}

.item-log-details {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.item-log-details-summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  cursor: pointer;
  list-style: none;
}

.item-log-details-summary::-webkit-details-marker {
  display: none;
}

.item-log-details-summary:hover {
  background: var(--surface-soft);
}

.item-log-details-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

.item-log-details-summary strong {
  font-size: 13px;
}

.item-log-details-summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.item-log-details-summary > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform .15s ease;
}

.item-log-details[open] .item-log-details-summary > svg {
  transform: rotate(180deg);
}

.item-log-details-body {
  padding: 0 11px 11px;
  border-top: 1px solid var(--line);
}

.item-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.item-line-meta span {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.item-line-meta em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.item-line-meta strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.item-log-list {
  display: flex;
  flex-direction: column;
  padding: 5px 0;
}

.item-log-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 22px;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px dashed #e6e8e1;
}

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

.item-log-row time {
  color: var(--accent-dark);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.item-log-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.item-log-row p span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 7px;
}

.item-log-row > button {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a2ada8;
}

.item-log-row > button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.item-log-row > button svg {
  width: 12px;
  height: 12px;
}

.item-log-empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 8px;
}

.item-note-form {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 7px;
}

.item-note-form input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  font-size: 9px;
  outline: none;
}

.item-note-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.item-note-form .primary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 9px;
}

.quick-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.quick-note-row button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
}

.quick-note-row button:hover {
  border-color: #b9c8c3;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.stage-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
  gap: 8px;
  padding: 12px;
}

.stage-form select,
.stage-form input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
}

.stage-form select:focus,
.stage-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.stage-form .primary-button {
  min-height: 36px;
}

.timeline {
  padding: 5px 13px 8px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
}

.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 29px;
  bottom: -5px;
  left: 10px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
}

.timeline-dot svg {
  width: 10px;
  height: 10px;
}

.timeline-copy {
  min-width: 0;
}

.timeline-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.timeline-copy p strong {
  color: var(--ink);
}

.timeline-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

#toastRoot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.drag-overlay {
  position: fixed;
  inset: 14px;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #7ea99f;
  border-radius: 10px;
  background: rgba(236, 244, 240, .94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.drag-overlay.is-visible {
  opacity: 1;
}

.drag-overlay > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--accent-dark);
}

.drag-overlay svg {
  width: 34px;
  height: 34px;
}

.drag-overlay strong {
  font-size: 15px;
}

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

.toast {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid #3d514c;
  border-radius: 7px;
  background: #1d2b28;
  color: #f3f8f6;
  box-shadow: 0 12px 30px rgba(16, 26, 23, .2);
  font-size: 10px;
  transition: opacity .18s ease, transform .18s ease;
}

.toast svg {
  width: 15px;
  height: 15px;
  color: #a7cbbf;
}

.toast.is-danger {
  border-color: #d6aba6;
  background: #8d3d35;
}

.toast.is-danger svg {
  color: #ffe4df;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(5px);
}

.loading-page {
  display: flex;
  min-height: calc(100vh - 160px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.loading-page svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  animation: spin 1s linear infinite;
}

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

.order-maker-toolbar {
  align-items: flex-end;
}

.order-maker-actions {
  flex-wrap: wrap;
}

.maker-document-select {
  display: flex;
  width: 230px;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.maker-document-select svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.maker-document-select select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.order-maker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(350px, .82fr);
  align-items: start;
  gap: 16px;
}

.sheet-editor-panel {
  overflow: hidden;
}

#orderSheetForm {
  min-width: 0;
}

.sheet-editor-section {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

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

.sheet-editor-section-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.sheet-editor-section-head strong {
  font-size: 12px;
  font-weight: 760;
}

.sheet-editor-section-head span {
  color: var(--muted);
  font-size: 8px;
}

.sheet-meta-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) 150px minmax(120px, .8fr);
  gap: 10px;
  align-items: end;
}

.sheet-meta-summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 8px;
}

.sheet-meta-summary span {
  white-space: nowrap;
}

.sheet-meta-summary strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.sheet-table-scroll {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.sheet-items-editor-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.sheet-items-editor-table th {
  height: 36px;
  padding: 5px 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f5f5f1;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.sheet-items-editor-table th:nth-child(1) {
  width: 42px;
  text-align: center;
}

.sheet-items-editor-table th:nth-child(2) {
  width: 190px;
}

.sheet-items-editor-table th:nth-child(3) {
  width: 112px;
}

.sheet-items-editor-table th:nth-child(4) {
  width: 145px;
}

.sheet-items-editor-table th:nth-child(5) {
  width: 95px;
}

.sheet-items-editor-table th:nth-child(6) {
  width: 130px;
}

.sheet-items-editor-table th:nth-child(7) {
  width: 86px;
}

.sheet-items-editor-table th:nth-child(8) {
  width: 38px;
}

.sheet-items-editor-table th:last-child,
.sheet-items-editor-table td:last-child {
  border-right: 0;
}

.sheet-items-editor-table td {
  height: 43px;
  padding: 4px 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  vertical-align: middle;
}

.sheet-items-editor-table tbody tr:last-child td {
  border-bottom: 0;
}

.sheet-items-editor-table input {
  width: 100%;
  height: 31px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  outline: 0;
  font-size: 9px;
}

.sheet-items-editor-table input:hover {
  border-color: var(--line);
}

.sheet-items-editor-table input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(46, 107, 98, .09);
}

.sheet-row-index {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sheet-table-foot {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 2px 0;
  color: var(--muted);
  font-size: 8px;
}

.sheet-table-foot span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-table-foot svg {
  width: 12px;
  height: 12px;
}

.sheet-table-foot strong {
  color: var(--ink-soft);
  font-size: 9px;
  white-space: nowrap;
}

.sheet-note-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.sheet-note-fields .field:last-child {
  min-height: 122px;
}

.sheet-note-fields textarea {
  min-height: 78px;
}

.sheet-note-fields .field:last-child textarea {
  min-height: 122px;
}

.sheet-editor-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  background: #fafaf7;
}

.sheet-editor-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.sheet-editor-footer > span svg {
  width: 13px;
  height: 13px;
  color: var(--green);
}

.sheet-editor-footer > div {
  display: flex;
  gap: 7px;
}

.preview-column {
  position: sticky;
  top: 92px;
  min-width: 0;
}

.preview-column-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
}

.preview-column-head span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.preview-column-head svg {
  width: 13px;
  height: 13px;
}

.preview-column-head strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.order-sheet-preview {
  width: 100%;
  min-height: 570px;
  padding: 18px 16px;
  border: 1px solid #d4d1c8;
  border-radius: 3px;
  background: #fffefb;
  box-shadow: 0 10px 32px rgba(34, 41, 38, .09);
  color: #171b1a;
  font-family: "Times New Roman", "Microsoft YaHei", serif;
}

.preview-sheet-title {
  padding-bottom: 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.preview-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  padding: 3px 0;
  font-size: 8px;
}

.preview-meta-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-meta-date > span:last-child {
  text-align: left;
}

.preview-sheet-table {
  width: 100%;
  margin-top: 5px;
  border-collapse: collapse;
  table-layout: fixed;
}

.preview-sheet-table th,
.preview-sheet-table td {
  min-height: 24px;
  padding: 5px 4px;
  border: 1px solid #252827;
  font-size: 7.5px;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.preview-sheet-table th {
  font-size: 8px;
  font-weight: 700;
}

.preview-sheet-table th:nth-child(1) {
  width: 9%;
}

.preview-sheet-table th:nth-child(2) {
  width: 28%;
}

.preview-sheet-table th:nth-child(3) {
  width: 13%;
}

.preview-sheet-table th:nth-child(4) {
  width: 19%;
}

.preview-sheet-table th:nth-child(5) {
  width: 10%;
}

.preview-sheet-table th:nth-child(6) {
  width: 12%;
}

.preview-sheet-table th:nth-child(7) {
  width: 9%;
}

.preview-sheet-table tbody tr.is-group-start td {
  border-top-width: 2px;
}

.preview-product {
  font-weight: 600;
}

.preview-product.is-empty {
  color: #9b9b93;
  font-weight: 400;
}

.preview-sheet-table tfoot td {
  font-weight: 700;
}

.preview-note-list {
  min-height: 54px;
  padding-top: 10px;
}

.preview-note-list p {
  margin: 0 0 3px;
  font-size: 8px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.preview-mark {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  margin-top: 8px;
  border: 1px solid #252827;
  font-size: 8px;
}

.preview-mark > strong {
  padding: 7px 5px;
  border-right: 1px solid #252827;
  font-weight: 500;
}

.preview-mark > div {
  display: flex;
  min-height: 94px;
  flex-direction: column;
  gap: 3px;
  padding: 7px 8px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.preview-placeholder {
  color: #a29f96;
}

.source-order-modal {
  width: min(700px, 100%);
}

.source-order-list {
  display: flex;
  max-height: min(560px, calc(100vh - 160px));
  flex-direction: column;
  overflow: auto;
  padding: 8px;
}

.source-order-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) 92px 16px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}

.source-order-row:hover {
  background: var(--surface-soft);
}

.source-order-code {
  color: var(--accent-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 9px;
  font-weight: 700;
}

.source-order-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.source-order-main strong,
.source-order-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-order-main strong {
  font-size: 10px;
}

.source-order-main small {
  color: var(--muted);
  font-size: 8px;
}

.source-order-qty {
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.source-order-row > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 900px) {
  .sidebar {
    width: 72px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .brand {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .brand-copy,
  .nav-item span,
  .nav-item em,
  .nav-section,
  .workspace-card > span:nth-child(2),
  .workspace-card > svg:last-child,
  .user-row > span:last-child {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .workspace-card {
    display: flex;
    justify-content: center;
    padding: 7px;
  }

  .user-row {
    justify-content: center;
    padding: 0;
  }

  .main-shell {
    margin-left: 72px;
  }

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

  .page-content {
    padding: 16px 18px 32px;
  }

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

  .kpi-item:nth-child(2) {
    border-right: 0;
  }

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

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 10px 14px;
  }

  .topbar-actions {
    width: 100%;
  }

  .global-search {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .global-search kbd,
  .topbar-actions > .icon-button {
    display: none;
  }

  .page-content {
    padding-right: 14px;
    padding-left: 14px;
  }

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

  .status-tabs {
    overflow-x: auto;
  }

  .status-tab {
    flex: 0 0 auto;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-note {
    padding-left: 2px;
  }

  .focus-row {
    grid-template-columns: minmax(0, 1fr) 86px 28px;
  }

  .focus-row .compact-progress {
    display: none;
  }

  .delivery-row {
    grid-template-columns: 48px minmax(0, 1fr) 90px;
  }

  .delivery-row .delivery-owner {
    display: none;
  }

  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

  .calendar-day {
    min-height: 82px;
    padding: 4px;
  }

  .calendar-order {
    padding: 2px 3px;
    border-left-width: 1px;
    font-size: 6px;
  }

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

  .field-wide {
    grid-column: auto;
  }

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

  .stage-form .primary-button {
    width: 100%;
  }

  .item-card > summary {
    grid-template-columns: 26px minmax(0, 1fr) 76px 16px;
  }

  .item-summary-qty {
    display: none;
  }

  .item-card-body {
    padding-left: 10px;
  }

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

  .item-note-form .primary-button {
    width: 100%;
  }

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

  .item-production-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .import-item-preview > div {
    grid-template-columns: 22px minmax(0, 1fr) 70px;
  }

  .import-item-preview > div > small {
    display: none;
  }
}

.item-editor {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
}

.item-editor-title {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.item-editor-title > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.item-editor-title strong {
  font-size: 11px;
}

.item-editor-title span {
  color: var(--muted);
  font-size: 8px;
}

.item-editor-title .secondary-button {
  min-height: 31px;
  padding: 0 9px;
  font-size: 9px;
}

.item-editor-scroll {
  overflow-x: auto;
}

.item-editor-head,
.item-editor-row {
  display: grid;
  grid-template-columns: 30px minmax(180px, 1.45fr) 100px 100px 120px 130px 30px;
  gap: 6px;
  min-width: 1000px;
  align-items: center;
  padding: 6px 9px;
}

.item-editor-head {
  border-bottom: 1px solid var(--line);
  background: #f1f2ed;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.item-editor-row {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.item-row-number {
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 8px;
  text-align: center;
}

.item-editor-row > input,
.item-qty-input input {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
  outline: none;
}

.item-editor-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .09);
}

.item-qty-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 3px;
}

.item-remarks-input {
  margin-top: -3px;
  color: var(--muted) !important;
}

.item-link-fields {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 6px;
}

.item-link-fields label {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.item-link-fields label span {
  color: var(--muted);
  font-size: 11px;
}

.item-link-fields select,
.item-link-fields label > input {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  outline: none;
}

.field-inline-help {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.product-library-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.product-library-table thead th {
  font-size: 13px;
  font-weight: 400;
  white-space: normal;
  line-height: 1.3;
}

.product-library-table.orders-table thead th {
  font-size: 13px;
}

.product-library-table tbody td {
  font-size: 13px;
  font-weight: 400;
}

.product-library-table .product-name-col {
  width: 13%;
}

.product-library-table .factory-name-col {
  width: 13%;
}

.product-library-table .weight-col {
  width: 8%;
  padding-right: 4px;
  padding-left: 4px;
  font-size: 13px;
  white-space: nowrap;
}

.product-library-table td:nth-child(3),
.product-library-table td:nth-child(4),
.product-library-table td:nth-child(6) {
  padding-right: 4px;
  padding-left: 4px;
  font-size: 13px;
  white-space: nowrap;
}

.product-library-table .base-spec-col {
  width: 12%;
}

.product-library-table .hs-col {
  width: 10%;
  font-size: 13px;
}

.product-library-table .width-col {
  width: 8%;
}

.product-library-table .cubic-col {
  width: 12%;
}

.product-library-table th:last-child,
.product-library-table td:last-child {
  width: 82px;
}

@media (max-width: 900px) {
  .product-library-table {
    min-width: 960px;
  }
}

.product-hs-code {
  color: var(--accent-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  font-weight: 750;
}

.product-library-table .product-hs-code {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
}

.product-library-table .table-product strong {
  font-size: 13px;
  font-weight: 400;
}

.product-library-table .table-product small {
  font-size: 12px;
  font-weight: 400;
}

.product-library-table .number-cell {
  font-size: 13px;
  font-weight: 400;
}

.shipping-detail-table {
  min-width: 920px;
}

.shipping-detail-table th:nth-child(1) {
  width: 44px;
}

.shipping-detail-table th:nth-child(2) {
  width: 130px;
}

.shipping-detail-table th:nth-child(3) {
  width: 240px;
}

.shipping-detail-table th:nth-child(4) {
  width: 150px;
}

.completed-detail-table {
  min-width: 920px;
}

.completed-detail-table th:nth-child(1) {
  width: 44px;
}

.completed-detail-table th:nth-child(2) {
  width: 130px;
}

.completed-detail-table th:nth-child(3) {
  width: 240px;
}

.completed-detail-table th:nth-child(4) {
  width: 150px;
}

.selection-column {
  text-align: center !important;
}

.selection-column input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.selection-column input[type="checkbox"] {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin: 0;
  place-content: center;
  appearance: none;
  border: 2px solid #9caaa5;
  border-radius: 4px;
  background: var(--surface);
}

.selection-column input[type="checkbox"]::before {
  content: "\2713";
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transform: scale(0);
  transition: transform .12s ease;
}

.selection-column input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.selection-column input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.selection-column input[type="checkbox"]:indeterminate {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.selection-column input[type="checkbox"]:indeterminate::before {
  content: "-";
  color: var(--accent-dark);
  transform: scale(1);
}

.selection-column input:disabled {
  cursor: default;
  opacity: .7;
}

.inline-product-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}

.inline-product-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.inline-product-link select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  outline: none;
}

.inline-product-link select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.inline-product-link select:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.completed-detail-table tbody tr.is-prepared-row td {
  background: #f3f8f5;
}

.button-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .18);
  color: inherit;
  font-size: 9px;
  font-style: normal;
}

.shipping-prep-table {
  min-width: 1050px;
}

.shipping-prep-table th:nth-child(1) {
  width: 44px;
}

.shipping-prep-table th:nth-child(2) {
  width: 130px;
}

.shipping-prep-table th:nth-child(3) {
  width: 200px;
}

.shipping-prep-table th:nth-child(4) {
  width: 140px;
}

.shipping-prep-table th:nth-child(5) {
  width: 105px;
}

.shipping-prep-table th:nth-child(6) {
  width: 155px;
}

.shipping-prep-table th:nth-child(7),
.shipping-prep-table th:nth-child(8) {
  width: 105px;
}

.shipping-prep-table th:nth-child(9) {
  width: 48px;
}

.shipping-shipped-table {
  min-width: 1020px;
}

.shipping-shipped-table th:nth-child(1) {
  width: 44px;
}

.shipping-shipped-table th:nth-child(2) {
  width: 120px;
}

.shipping-shipped-table th:nth-child(3) {
  width: 170px;
}

.shipping-shipped-table th:nth-child(4) {
  width: 120px;
}

.shipping-shipped-table th:nth-child(5) {
  width: 100px;
}

.shipping-shipped-table th:nth-child(6),
.shipping-shipped-table th:nth-child(7),
.shipping-shipped-table th:nth-child(8) {
  width: 95px;
}

.shipping-shipped-table th:nth-child(9) {
  width: 120px;
}

.shipping-shipped-table tbody tr.is-selected-row td {
  background: #f3f8f5;
}

.shipped-quantity-control,
.prepared-quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shipped-quantity-input,
.prepared-quantity-input {
  width: 108px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  outline: none;
}

.shipped-quantity-input:focus,
.prepared-quantity-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, .1);
}

.shipped-quantity-control > span,
.prepared-quantity-control > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.danger-filled {
  border-color: #e11d2e;
  background: #e11d2e;
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(190, 18, 36, .18);
}

.danger-filled:hover {
  border-color: #c41627;
  background: #c41627;
  color: #ffffff;
}

.item-production-bar {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 2px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.item-production-bar > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.item-production-bar > span svg {
  width: 13px;
  height: 13px;
}

.item-production-bar > span.is-complete {
  color: var(--green);
}

.item-production-bar .text-button {
  min-height: 25px;
  padding: 0 6px;
  font-size: 8px;
}

.item-product-library {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.item-product-library > span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.item-product-library > span:first-child {
  align-items: center;
  gap: 5px;
}

.item-product-library > span:first-child svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.item-product-library strong {
  font-size: 8px;
  font-weight: 700;
}

.item-product-library small,
.item-product-library em {
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
}

.item-product-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--amber);
  font-size: 9px;
}

.item-product-warning svg {
  width: 13px;
  height: 13px;
}

.item-product-warning .text-button {
  min-height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.item-product-warning .text-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.order-note-field {
  margin-top: 13px;
}

.import-loading {
  display: flex;
  min-height: 200px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.import-loading svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  animation: spin 1s linear infinite;
}

.import-loading strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.import-loading span {
  font-size: 8px;
  line-height: 1.6;
}

.import-preview-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.import-order-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.import-order-head {
  display: flex;
  min-height: 51px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.import-order-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.import-order-head strong {
  font-size: 10px;
}

.import-order-head span:not(.status-badge) {
  color: var(--muted);
  font-size: 8px;
}

.import-item-preview {
  display: flex;
  flex-direction: column;
}

.import-item-preview > div {
  display: grid;
  grid-template-columns: 24px 150px minmax(0, 1fr) 85px;
  min-height: 33px;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-bottom: 1px solid #edefe9;
  font-size: 8px;
}

.import-item-preview > div > span {
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.import-item-preview > div > strong {
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-item-preview > div > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-item-preview > div > em {
  color: var(--ink-soft);
  font-size: 8px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.import-item-preview > p {
  margin: 0;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 8px;
}

.import-note-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #fafaf7;
  color: var(--muted);
  font-size: 8px;
}

.import-mark-preview {
  width: 100%;
  padding-top: 5px;
  border-top: 1px dashed var(--line);
  line-height: 1.7;
  white-space: pre-wrap;
}

.import-failures {
  padding: 9px 10px;
  border: 1px solid #e2bdb8;
  border-radius: 6px;
  background: var(--red-soft);
  color: #8f3e35;
}

.import-failures strong {
  font-size: 9px;
}

.import-failures p {
  margin: 4px 0 0;
  font-size: 8px;
}

.import-preserve-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.import-preserve-tip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    width: 100%;
    height: 58px;
    flex-direction: row;
    align-items: center;
    padding: 6px;
    border-top: 1px solid #303c39;
  }

  .brand,
  .sidebar-foot {
    display: none;
  }

  .main-nav {
    width: 100%;
    flex-direction: row;
  }

  .nav-item {
    height: 44px;
    flex: 1 1 0;
    flex-direction: column;
    gap: 2px;
  }

  .nav-item span {
    display: block;
    flex: 0 0 auto;
    font-size: 8px;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -2px 0 #e8ad55;
  }

  .main-shell {
    margin-left: 0;
    padding-bottom: 58px;
  }

  .topbar-actions .primary-button span {
    display: none;
  }

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

  .kpi-item {
    min-height: 98px;
    padding: 13px;
  }

  .kpi-value {
    font-size: 25px;
  }

  .focus-row {
    grid-template-columns: minmax(0, 1fr) 88px 26px;
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .delivery-row {
    grid-template-columns: 45px minmax(0, 1fr);
  }

  .delivery-row > .priority-badge {
    display: none;
  }

  .activity-row {
    padding-right: 10px;
    padding-left: 10px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 8px;
  }

  .modal {
    max-height: calc(100vh - 16px);
  }

  .drawer-body {
    padding: 9px;
  }

  .drawer-head {
    padding-right: 9px;
    padding-left: 9px;
  }

  .drawer-actions .icon-button[data-action="copy-order"] {
    display: none;
  }

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

  .calendar-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .calendar-title strong {
    font-size: 15px;
  }

  .calendar-day {
    min-height: 61px;
  }

  .calendar-orders {
    gap: 2px;
  }

  .calendar-order {
    width: 5px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: transparent;
  }

  .calendar-order.is-urgent {
    background: var(--amber);
  }

  .calendar-order.is-overdue {
    background: var(--red);
  }

  .calendar-more {
    display: none;
  }

  .calendar-day > span {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .item-card > summary {
    grid-template-columns: 24px minmax(0, 1fr) 76px 16px;
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .item-card-body {
    padding-right: 8px;
    padding-left: 8px;
  }

  .item-log-row {
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 2px;
  }

  .item-log-row time {
    grid-column: 1 / -1;
  }

  .import-order-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .local-storage-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .local-storage-card .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .stepper span {
    display: none;
  }

  .stepper {
    margin-bottom: 18px;
  }
}

@media (max-width: 1180px) {
  .order-maker-layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    position: static;
    max-width: 720px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .order-maker-toolbar {
    align-items: flex-start;
  }

  .order-maker-actions {
    justify-content: flex-start;
  }

  .sheet-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sheet-meta-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .order-maker-actions {
    width: 100%;
  }

  .maker-document-select {
    width: 100%;
  }

  .order-maker-actions .secondary-button,
  .order-maker-actions .primary-button {
    flex: 1 1 auto;
  }

  .sheet-editor-section {
    padding: 12px;
  }

  .sheet-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .sheet-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .sheet-editor-footer > div {
    width: 100%;
  }

  .sheet-editor-footer > div button {
    flex: 1 1 0;
  }

  .order-sheet-preview {
    min-height: 0;
  }

  .source-order-row {
    grid-template-columns: 80px minmax(0, 1fr) 14px;
  }

  .source-order-qty {
    display: none;
  }
}

@media (max-width: 560px) {
  .order-maker-actions .maker-document-select,
  .order-maker-actions .secondary-button,
  .order-maker-actions .primary-button {
    width: 100%;
    flex-basis: 100%;
  }

  .order-maker-actions .icon-button {
    width: 100%;
  }

  .sheet-meta-grid {
    grid-template-columns: 1fr;
  }

  .sheet-meta-summary {
    grid-column: auto;
  }

  .sheet-editor-footer > div {
    flex-direction: column;
  }

  .preview-sheet-title {
    font-size: 18px;
  }
}

/* Readability pass: keep the working UI comfortably legible on standard displays. */
body {
  font-size: 17px;
}

input,
select,
textarea {
  font-size: 15px;
}

small {
  font-size: 11px;
}

.nav-item span {
  font-size: 15px;
}

.nav-subitem span {
  font-size: 13px;
}

.nav-section > span,
.workspace-card small,
.user-row small {
  font-size: 11px;
}

.workspace-card strong,
.user-row strong {
  font-size: 13px;
}

.global-search input {
  font-size: 15px;
}

.page-kicker {
  font-size: 10px;
}

.page-heading h1 {
  font-size: 27px;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  font-size: 15px;
}

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

.section-toolbar p,
.filter-note {
  font-size: 12px;
}

.panel-title strong {
  font-size: 16px;
}

.panel-title small,
.panel-link {
  font-size: 12px;
}

.kpi-label {
  font-size: 13px;
}

.kpi-value {
  font-size: 36px;
}

.kpi-value small,
.kpi-foot {
  font-size: 12px;
}

.order-identity code,
.status-tab strong,
.mini-avatar,
.owner-avatar {
  font-size: 11px;
}

.order-identity strong,
.table-product strong,
.table-order span,
.stage-label-row > span,
.delivery-product strong {
  font-size: 13px;
}

.order-identity small,
.compact-progress > span,
.compact-progress strong,
.activity-body span,
.delivery-product small,
.delivery-owner,
.table-product small,
.stage-label-row > small,
.owner-cell span:last-child {
  font-size: 12px;
}

.due-cell strong,
.activity-body p,
.pipeline-row > strong,
.status-tab,
.select-control select {
  font-size: 13px;
}

.due-cell small,
.empty-block p,
.select-control {
  font-size: 12px;
}

.empty-block strong,
.pipeline-row > span,
.priority-badge,
.status-badge {
  font-size: 11px;
}

.orders-table thead th {
  font-size: 12px;
}

.table-order code {
  font-size: 12px;
}

.drawer-head h2 {
  font-size: 22px;
}

.drawer-head p {
  font-size: 12px;
}

.drawer-section-head strong {
  font-size: 15px;
}

.drawer-section-head small,
.fact span {
  font-size: 12px;
}

.drawer-order-title {
  font-size: 24px;
}

.drawer-customer,
.fact strong,
.order-note,
.item-summary-main strong,
.item-summary-qty,
.item-line-meta strong,
.item-log-row p,
.timeline-copy p {
  font-size: 13px;
}

.step span,
.order-note p,
.source-file,
.item-summary-main small,
.item-line-meta em,
.item-log-row time,
.item-log-empty,
.timeline-copy span {
  font-size: 11px;
}

.item-sequence,
.item-log-count,
.item-log-row p span,
.quick-note-row button,
.item-production-bar > span,
.item-product-library > span,
.item-product-library strong,
.item-product-warning {
  font-size: 11px;
}

.item-product-library small,
.item-product-library em {
  font-size: 10px;
}

.item-note-form input,
.item-note-form .primary-button,
.stage-form select,
.stage-form input {
  font-size: 14px;
}

.toast {
  font-size: 14px;
}

.maker-document-select select,
.sheet-editor-section-head strong {
  font-size: 14px;
}

.sheet-editor-section-head span,
.sheet-meta-summary,
.sheet-table-foot,
.source-order-main small,
.source-order-qty {
  font-size: 12px;
}

.sheet-meta-summary strong,
.sheet-table-foot strong,
.sheet-items-editor-table th,
.source-order-code,
.source-order-main strong {
  font-size: 13px;
}

.sheet-row-index,
.sheet-items-editor-table input {
  font-size: 13px;
}

.field > span {
  font-size: 12px;
}

.field-inline-help,
.form-error,
.form-help {
  font-size: 11px;
}

.preview-meta-row,
.preview-note-list p,
.preview-mark {
  font-size: 10px;
}

.preview-sheet-table th,
.preview-sheet-table td {
  font-size: 9.5px;
}

.preview-sheet-table th {
  font-size: 10px;
}

.calendar-title span,
.calendar-weekday,
.calendar-day > span,
.calendar-more {
  font-size: 10px;
}

.calendar-order {
  font-size: 10px;
}

.topbar {
  min-height: 82px;
}

.nav-item {
  height: 44px;
}

.nav-subitem {
  height: 40px;
}

.global-search {
  height: 44px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.text-button {
  min-height: 42px;
}

.icon-button {
  width: 42px;
}

.status-tab {
  min-height: 36px;
}

.select-control {
  height: 38px;
}

.orders-table th,
.orders-table td {
  height: 64px;
}

.orders-table thead th {
  height: 46px;
}

.field input,
.field select {
  height: 42px;
  font-size: 15px;
}

.field textarea {
  font-size: 15px;
}

.drawer-section-head {
  min-height: 50px;
}

.item-card > summary {
  min-height: 64px;
}

.focus-row {
  min-height: 72px;
}

.delivery-row {
  min-height: 62px;
}

.sheet-items-editor-table th {
  height: 42px;
}

.sheet-items-editor-table td {
  height: 48px;
}

.sheet-items-editor-table input {
  height: 36px;
}

.item-production-bar {
  min-height: 52px;
  gap: 12px;
  padding: 8px 10px;
}

.item-production-bar > span {
  font-size: 14px;
  font-weight: 650;
}

.item-production-bar > span svg {
  width: 18px;
  height: 18px;
}

.item-production-bar .text-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.item-production-action {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 750;
}

.item-production-action svg {
  width: 17px;
  height: 17px;
}

.item-product-warning {
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  font-size: 14px;
}

.item-product-warning svg {
  width: 18px;
  height: 18px;
}

.item-product-warning .text-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
}

.item-product-warning .item-product-link-action {
  min-height: 40px;
  padding: 0 15px;
  border-color: var(--accent);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(35, 83, 77, .1);
}

.item-product-warning .item-product-link-action:hover {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: #ffffff;
}

.item-product-warning .item-product-link-action svg {
  width: 18px;
  height: 18px;
}

.table-order code,
.order-identity code {
  display: inline-flex;
  width: fit-content;
  min-height: 25px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #c8ddd7;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.drawer-order-number {
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.table-order code.is-whole-complete,
.drawer-order-number.is-whole-complete,
.completed-order-number.is-whole-complete {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #e11d2e;
  border-radius: 5px;
  background: #e11d2e;
  color: #ffffff !important;
  font-weight: 850;
  box-shadow: 0 2px 7px rgba(190, 18, 36, .2);
}

.item-summary-main small.item-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  overflow: visible;
  white-space: normal;
}

.item-code-badge,
.item-color-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.item-code-badge {
  border: 1px solid #c8ddd7;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.item-color-badge {
  border: 1px solid #e6cfaa;
  background: var(--amber-soft);
  color: #7c4b0d;
}

.item-meta-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.color-token {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--amber-soft);
  color: #7c4b0d;
  font-size: 12px;
  font-weight: 800;
}

.calendar-nav .secondary-button {
  min-height: 38px;
  font-size: 13px;
}

.calendar-title strong {
  font-size: 19px;
}

.calendar-title span,
.calendar-weekday {
  font-size: 11px;
}

.calendar-day > span {
  font-size: 12px;
  font-weight: 700;
}

.item-product-library small,
.item-product-library em {
  font-size: 11px;
}

.orders-table .table-empty {
  white-space: normal;
}

.table-empty .empty-block {
  width: 100%;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: #e9e8e2;
}

.login-shell {
  display: grid;
  width: min(980px, 100%);
  min-height: 610px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  overflow: hidden;
  border: 1px solid #c9cec6;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 33, 31, .16);
}

.login-brand-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 42px;
  background: var(--sidebar);
  color: #eef4f1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand strong {
  font-size: 18px;
  font-weight: 760;
}

.login-brand small {
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
}

.login-brand-copy {
  max-width: 390px;
}

.login-eyebrow {
  color: #e8ad55;
  font-size: 12px;
  font-weight: 750;
}

.login-brand-copy h1 {
  margin: 12px 0 14px;
  font-size: 38px;
  line-height: 1.18;
}

.login-brand-copy p {
  margin: 0;
  color: #b8c5c0;
  font-size: 15px;
  line-height: 1.7;
}

.login-security-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid #34413e;
}

.login-security-note > svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: #e8ad55;
}

.login-security-note > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-security-note strong {
  font-size: 13px;
}

.login-security-note small {
  color: var(--sidebar-muted);
  font-size: 11px;
  line-height: 1.55;
}

.login-form-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 46px;
}

.login-form-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 28px;
}

.login-form-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.login-form-head h2 {
  margin: 1px 0 4px;
  font-size: 23px;
}

.login-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.login-form .field > span {
  font-size: 13px;
}

.login-form .field input {
  height: 46px;
  padding: 0 13px;
  font-size: 15px;
}

.login-error {
  margin: 0;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  margin-top: 2px;
  font-size: 15px;
}

.login-submit svg {
  width: 18px;
  height: 18px;
}

.login-submit.is-loading {
  cursor: wait;
  opacity: .72;
}

.login-footer {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 820px) {
  .login-page {
    align-items: start;
    padding: 18px;
  }

  .login-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    gap: 22px;
    padding: 26px;
  }

  .login-brand-copy h1 {
    margin: 8px 0 9px;
    font-size: 28px;
  }

  .login-brand-copy p {
    font-size: 13px;
  }

  .login-security-note {
    display: none;
  }

  .login-form-panel {
    padding: 30px 26px;
  }
}

@media (max-width: 640px) {
  .order-reminder-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .order-reminder-row .order-reminder-badge {
    min-height: 28px;
    font-size: 12px;
  }

  .order-reminder-actions .primary-button {
    width: 100%;
  }

  .login-page {
    padding: 10px;
  }

  .login-brand-panel {
    padding: 21px 20px;
  }

  .login-brand-copy h1 {
    font-size: 24px;
  }

  .login-form-panel {
    padding: 25px 20px 28px;
  }

  .login-form-head h2 {
    font-size: 20px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toolbar-actions,
  .orders-head,
  .filter-row,
  .pagination,
  .table-actions,
  #toastRoot,
  .drawer-backdrop,
  .modal-backdrop {
    display: none !important;
  }

  .main-shell {
    margin: 0;
  }

  .page-content {
    padding: 0;
  }

  .panel,
  .orders-panel,
  .kpi-grid {
    border-color: #bbb;
    box-shadow: none;
  }

  .orders-table {
    min-width: 0;
  }

  .orders-table th,
  .orders-table td {
    height: 36px;
    font-size: 8px;
  }
}
