:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --panel-soft: #f7fbf9;
  --text: #071d19;
  --muted: #62736f;
  --line: #d7e0dc;
  --primary: #0f6d5b;
  --primary-strong: #084f43;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #15803d;
  --blue: #2563eb;
  --sidebar: #10231d;
  --sidebar-expanded: 260px;
  --sidebar-collapsed: 76px;
  --page-zoom: 1;
  --shadow: 0 18px 45px rgba(24, 45, 38, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
}

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

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--sidebar);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1,
.brand-row h1,
.topbar h2 {
  margin: 0;
}

.login-card p,
.brand-row p,
.eyebrow,
.sub,
#modalSubtitle {
  margin: 0;
  color: var(--muted);
}

.login-card label,
.field {
  display: grid;
  gap: 6px;
}

.login-card input,
.field input,
.field select,
.field textarea,
.search {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  outline: 0;
}

.field textarea {
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}

.login-error {
  min-height: 20px;
  color: var(--red);
}

.app {
  width: calc(100vw / var(--page-zoom));
  height: calc(100vh / var(--page-zoom));
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
  overflow: hidden;
}

.app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh / var(--page-zoom));
  width: var(--sidebar-expanded);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 18px 14px;
  background: var(--sidebar);
  color: #eef8f3;
  z-index: 12;
  overflow: hidden;
  transition: width .18s ease, padding .18s ease, box-shadow .18s ease;
}

.app.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
  padding-left: 10px;
  padding-right: 10px;
}

.app.sidebar-collapsed .sidebar:hover,
.app.sidebar-collapsed.sidebar-peek .sidebar {
  width: var(--sidebar-expanded);
  padding-left: 14px;
  padding-right: 14px;
  box-shadow: 12px 0 34px rgba(0, 0, 0, .18);
}

.brand-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ffd166;
  color: #102016;
  font-weight: 900;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #eef8f3;
  cursor: pointer;
  font-weight: 900;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .16);
}

.nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
}

.nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #e8f2ee;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
  min-width: 0;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-parent {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.nav-main-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.nav-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.nav-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .09);
  color: #eef8f3;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.nav-label,
.brand-row h1,
.brand-row p,
.nav-parent small,
.nav-chevron,
.account-switch,
#logoutBtn {
  transition: opacity .14s ease, width .14s ease, transform .14s ease;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chevron {
  color: rgba(238, 248, 243, .7);
  font-size: 12px;
  transition: transform .16s ease;
}

.nav-group.expanded .nav-chevron {
  transform: rotate(180deg);
}

.nav-parent small {
  display: block;
  color: rgba(238, 248, 243, .58);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.nav-children {
  display: none;
  gap: 6px;
  padding: 2px 0 4px 12px;
}

.nav-group.expanded .nav-children {
  display: grid;
}

.nav-children button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: rgba(238, 248, 243, .82);
  font-size: 12px;
}

.nav-children .nav-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 11px;
}

.nav-children button.active,
.nav-children button:hover {
  border-color: rgba(184, 215, 202, .68);
  background: rgba(231, 242, 237, .16);
  color: #ffffff;
}

.nav button.active,
.nav button:hover {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .10);
}

.nav-children button.active,
.nav-children button:hover {
  border-color: rgba(184, 215, 202, .68);
  background: rgba(231, 242, 237, .16);
  color: #ffffff;
}

.account-switch {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.account-switch span,
.account-switch small {
  color: rgba(238, 248, 243, .78);
  font-weight: 800;
}

.account-switch select {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.account-switch select:disabled {
  opacity: .78;
}

.app.sidebar-collapsed .sidebar:not(:hover) .brand-row {
  grid-template-columns: 42px;
  justify-content: center;
  gap: 0;
}

.app.sidebar-collapsed .sidebar:not(:hover) .brand-row > div:not(.brand-mark),
.app.sidebar-collapsed .sidebar:not(:hover) .nav-label,
.app.sidebar-collapsed .sidebar:not(:hover) .nav-parent small,
.app.sidebar-collapsed .sidebar:not(:hover) .nav-chevron,
.app.sidebar-collapsed .sidebar:not(:hover) .account-switch {
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.app.sidebar-collapsed .sidebar:not(:hover) .sidebar-toggle {
  position: absolute;
  top: 12px;
  right: 8px;
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.app.sidebar-collapsed .sidebar:not(:hover) .nav {
  overflow: hidden;
  padding-right: 0;
}

.app.sidebar-collapsed .sidebar:not(:hover) .nav button {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app.sidebar-collapsed .sidebar:not(:hover) .nav-parent {
  min-height: 40px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.app.sidebar-collapsed .sidebar:not(:hover) .nav-main-line {
  justify-content: center;
}

.app.sidebar-collapsed .sidebar:not(:hover) .nav-children {
  display: none;
}

.app.sidebar-collapsed .sidebar:not(:hover) #logoutBtn {
  min-height: 40px;
  padding: 0;
  font-size: 0;
}

.app.sidebar-collapsed .sidebar:not(:hover) #logoutBtn::before {
  content: "退";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #eef8f3;
  font-size: 12px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: calc(100vh / var(--page-zoom));
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  padding: 18px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 -18px 18px;
  padding: 12px 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #eef5f2;
}

.module-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
  margin-bottom: -1px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  border-radius: 8px 8px 0 0;
  background: #e7efeb;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.module-tab.active {
  background: var(--panel);
  color: var(--primary);
  border-bottom-color: var(--panel);
}

.module-tab-close {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.module-tab-close:hover {
  background: rgba(15, 109, 91, .12);
  color: var(--primary-strong);
}

.eyebrow {
  color: var(--primary);
  font-weight: 900;
}

.top-actions,
.toolbar,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.toolbar strong {
  font-size: 14px;
}

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

.search {
  width: min(460px, 42vw);
}

.page-zoom-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
  font-weight: 800;
}

.page-zoom-control span {
  color: var(--muted);
}

.page-zoom-control select {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  font-weight: 900;
}

.btn,
.icon-btn,
.text-btn {
  border: 0;
  cursor: pointer;
}

.btn {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.btn:disabled,
.text-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.text-btn {
  background: transparent;
  color: var(--primary);
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.factory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.factory-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #f5f9f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.factory-summary span,
.factory-cost-title span {
  color: var(--muted);
  font-size: 12px;
}

.factory-summary strong {
  font-size: 20px;
}

.factory-cost-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 12px 8px;
}

.factory-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 12px;
  background: #f5f9f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.modal-panel.factory-requisition-modal {
  width: min(1480px, calc(100vw - 32px));
}

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

.metric {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: auto;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.sub-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.sub-tabs button.active {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.sub-tabs button span {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 800;
}

.ticketing-submodule-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 10px 0;
  background: var(--panel);
}

.ticketing-submodule-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.ticketing-submodule-tab.active,
.ticketing-submodule-tab:hover {
  border-color: #b8d7ca;
  background: #e7f2ed;
  color: var(--primary-strong);
}

.order-bucket-tabs {
  align-items: center;
}

.bom-style-bucket-tabs {
  padding: 10px 10px 0;
}

.style-search-field [data-style-usage-filter] {
  max-width: 180px;
}

.purchase-order-sort {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.purchase-order-sort select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.purchase-order-sort select:first-child {
  min-width: 136px;
}

.purchase-order-sort select:last-child {
  min-width: 82px;
}

.order-filter-panel,
.requirement-filter-panel,
.material-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(104px, auto);
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.requirement-filter-panel {
  grid-template-columns: repeat(5, minmax(140px, 1fr)) minmax(104px, auto);
}

.material-filter-panel {
  grid-template-columns: repeat(6, minmax(128px, 1fr)) minmax(104px, auto);
}

.order-filter-panel label,
.requirement-filter-panel label,
.material-filter-panel label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-filter-panel label span,
.requirement-filter-panel label span,
.material-filter-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-filter-panel input,
.order-filter-panel select,
.requirement-filter-panel input,
.requirement-filter-panel select,
.material-filter-panel input,
.material-filter-panel select {
  min-height: 34px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.order-filter-panel .order-page-size {
  min-width: 110px;
}

.order-filter-panel button,
.requirement-filter-panel button,
.material-filter-panel button {
  align-self: end;
}

.purchase-order-summary {
  position: fixed;
  left: 210px;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #eef5f2;
  box-shadow: 0 -12px 30px rgba(24, 45, 38, .10);
}

.purchase-order-summary-spacer {
  height: 88px;
}

.purchase-order-summary div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.purchase-order-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-order-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  word-break: break-all;
}

.text-btn.danger {
  color: #b42318;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  padding: 12px;
}

.role-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.role-head h3 {
  margin: 0;
  font-size: 16px;
}

.role-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.check-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.check-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-weight: 800;
}

.check-item input {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f5f9fb;
  color: #475a6e;
  font-weight: 900;
  z-index: 1;
}

td strong {
  font-size: 14px;
}

.copy-cell {
  min-width: 170px;
  max-width: 420px;
}

.copy-cell-text {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 3px;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
}

.copy-cell-text strong,
.copy-cell-text .sub {
  width: max-content;
  min-width: 100%;
}

.copy-cell-text strong {
  display: block;
  white-space: nowrap;
}

.copy-cell-text .sub {
  white-space: nowrap;
}

.sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.sub-inline {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}

.rpm-progress-cell {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.rpm-row-completed {
  background: #f0fdf4;
  box-shadow: inset 4px 0 0 var(--green);
}

.rpm-row-completed td {
  border-bottom-color: #bbf7d0;
}

.rpm-row-partial {
  background: #f8fbff;
}

.rpm-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rpm-progress-meta strong {
  font-size: 14px;
}

.rpm-progress-cell.complete .rpm-progress-meta strong {
  color: var(--green);
  font-size: 17px;
}

.rpm-progress-cell.partial .rpm-progress-meta strong {
  color: var(--blue);
}

.rpm-progress-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.rpm-progress-cell.complete .rpm-progress-meta span {
  color: var(--green);
}

.rpm-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0ed;
}

.rpm-progress-cell.complete .rpm-progress-bar {
  height: 12px;
  background: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .18);
}

.rpm-progress-cell.partial .rpm-progress-bar {
  background: #dbeafe;
}

.rpm-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.rpm-progress-cell.complete .rpm-progress-bar i {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.rpm-progress-cell.partial .rpm-progress-bar i {
  background: var(--blue);
}

.rpm-progress-done {
  justify-self: start;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.rpm-detail-head {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(160px, .8fr));
  gap: 12px;
  margin-bottom: 12px;
}

.rpm-detail-head > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.rpm-group-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rpm-group-lines {
  min-width: 132px;
}

.rpm-group-lines summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
  list-style-position: inside;
}

.rpm-group-line-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.rpm-group-line-item {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(74px, auto) minmax(84px, auto) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.rpm-group-line-item strong {
  color: var(--text);
  font-size: 12px;
}

.empty {
  padding: 46px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f1;
  color: var(--muted);
  font-weight: 900;
}

.badge.green {
  background: #dcfce7;
  color: var(--green);
}

.badge.amber {
  background: #fef3c7;
  color: var(--amber);
}

.badge.red {
  background: #fee2e2;
  color: var(--red);
}

.badge.blue {
  background: #dbeafe;
  color: var(--blue);
}

.requirement-qty {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-weight: 900;
  white-space: nowrap;
}

.requirement-qty sup {
  color: var(--amber);
  font-size: 13px;
  line-height: 1;
  transform: translateY(-3px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 18, .56);
}

.pdf-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: block;
  background: rgba(8, 20, 18, .72);
}

.pdf-preview-panel {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

.pdf-preview-head,
.pdf-preview-actions {
  display: flex;
  align-items: center;
}

.pdf-preview-head {
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pdf-preview-head > div:first-child {
  display: grid;
  gap: 2px;
}

.pdf-preview-head strong {
  font-size: 18px;
}

.pdf-preview-head span {
  color: var(--muted);
  font-size: 13px;
}

.pdf-preview-actions {
  gap: 8px;
}

.pdf-preview-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  background: #525659;
}

.pdf-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pdf-preview-loading {
  place-self: center;
  padding: 18px 22px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.pdf-preview-loading.error {
  color: var(--red);
}

.modal-panel {
  width: min(1180px, 100%);
  max-height: min(88vh, 780px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.modal-panel.bom-modal-panel {
  width: min(1540px, calc(100vw - 24px));
  height: min(920px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  resize: both;
  min-width: min(920px, calc(100vw - 24px));
  min-height: min(620px, calc(100vh - 24px));
}

.modal-panel.bom-modal-panel.fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  resize: none;
}

.modal-panel.order-detail-modal-panel {
  width: min(1480px, calc(100vw - 20px));
  height: min(900px, calc(100vh - 20px));
  max-height: calc(100vh - 20px);
}

.modal-panel.import-preview-modal-panel {
  width: min(1380px, calc(100vw - 24px));
  height: min(860px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
}

.modal-panel.factory-catalog-modal {
  width: min(1480px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
}

.factory-catalog-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-height: 0;
}

.factory-catalog-hero {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7fbf9;
}

.factory-catalog-hero .field {
  margin-top: 4px;
}

.factory-catalog-stats {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.factory-catalog-stats span {
  min-width: 112px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.factory-catalog-stats strong {
  margin-left: 5px;
  color: var(--ink);
}

.factory-catalog-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.factory-catalog-tool {
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.factory-catalog-tool h3,
.factory-catalog-section h3 {
  margin: 0;
  font-size: 16px;
}

.factory-catalog-tool .btn {
  justify-self: start;
}

.factory-catalog-paste {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}

.factory-catalog-paste summary {
  cursor: pointer;
  font-weight: 700;
}

.factory-catalog-paste .field {
  margin-top: 8px;
}

.factory-catalog-summary {
  color: var(--muted);
  font-size: 13px;
}

.factory-catalog-material-picker {
  grid-column: 1 / -1;
  min-width: 0;
}

.factory-catalog-material-picker .material-search-field {
  width: 100%;
}

.factory-catalog-material-picker .material-results {
  max-height: 320px;
}

.factory-catalog-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 130px;
  gap: 8px;
}

.factory-catalog-filters input,
.factory-catalog-filters select {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.factory-catalog-list {
  max-height: 420px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.factory-catalog-list .table-wrap {
  overflow: visible;
}

.factory-catalog-list table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.factory-catalog-list th,
.factory-catalog-list td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.factory-catalog-list th:nth-child(2) { width: 88px; }
.factory-catalog-list th:nth-child(3) { width: 118px; }
.factory-catalog-list th:nth-child(4) { width: 96px; }
.factory-catalog-list th:nth-child(5) { width: 112px; }

.factory-catalog-list td:first-child {
  min-width: 0;
}

.factory-catalog-list td:first-child strong {
  display: block;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.35;
}

.factory-catalog-list td:first-child .sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.factory-catalog-list .badge {
  white-space: nowrap;
}

.factory-catalog-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.factory-catalog-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.factory-catalog-pager span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px;
}

.factory-catalog-pager .btn {
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 760px) {
  .factory-catalog-hero,
  .factory-catalog-actions-grid {
    grid-template-columns: 1fr;
  }
  .factory-catalog-stats {
    justify-content: flex-start;
  }
  .factory-catalog-filters {
    grid-template-columns: 1fr;
  }
}

.factory-catalog-visibility-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  color: #285a4e;
  background: #eef8f4;
  border: 1px solid #cfe5dc;
}

.modal-panel.factory-catalog-editor-modal {
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--text);
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: 12px;
  padding: 16px 18px;
  min-height: 0;
  overflow: auto;
}

.modal-panel.bom-modal-panel .form-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: max-content minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: stretch;
  overflow: hidden;
}

.modal-panel.order-detail-modal-panel .form-grid {
  overflow: auto;
  min-height: 0;
}

.modal-panel.import-preview-modal-panel .form-grid {
  grid-auto-rows: max-content;
  overflow: auto;
  min-height: 0;
}

.modal-panel.order-detail-modal-panel .detail-block {
  min-height: 0;
}

.modal-panel.import-preview-modal-panel .detail-block {
  min-height: 0;
}

.modal-panel.order-detail-modal-panel .table-wrap {
  max-height: none;
}

.order-detail-bom-cell {
  min-width: 118px;
  display: grid;
  gap: 4px;
  align-items: start;
}

.order-detail-bom-cell .text-btn {
  justify-self: start;
}

.order-detail-bom-cell span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.order-detail-bom-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.modal-panel.import-preview-modal-panel .table-wrap {
  max-height: none;
}

.modal-panel.order-detail-modal-panel .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--panel);
  box-shadow: 0 -10px 24px rgba(8, 20, 18, .06);
}

.field.wide,
.line-editor,
.detail-block {
  grid-column: 1 / -1;
}

.style-search-field {
  grid-template-columns: 1fr;
}

.style-search-field small {
  color: var(--muted);
  font-weight: 800;
}

.readonly-box {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.stock-prepare-lines {
  display: grid;
  gap: 10px;
}

.stock-prepare-line-head,
.stock-prepare-line {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(120px, 160px) minmax(120px, 160px) minmax(140px, 1fr) 72px;
  gap: 10px;
  align-items: end;
}

.stock-prepare-line-head {
  align-items: center;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  padding: 0 2px;
}

.stock-prepare-line .field {
  margin: 0;
}

.stock-prepare-material-box {
  min-height: 42px;
  display: grid;
  gap: 3px;
  align-content: center;
}

.stock-prepare-material-box strong {
  color: var(--text);
  line-height: 1.25;
}

.stock-prepare-material-box span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.stock-prepare-line .text-btn {
  height: 42px;
  justify-content: center;
}

.stock-prepare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stock-prepare-empty {
  padding: 14px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.stock-prepare-select-card {
  width: min(1160px, calc(100vw - 28px));
}

.order-remark-box {
  margin-top: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-remark-box strong {
  color: var(--text);
}

.order-detail-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.order-detail-summary .text-btn {
  margin-left: auto;
}

.order-detail-total-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--panel-soft);
}

.order-detail-total-bar div {
  min-width: 180px;
  display: grid;
  gap: 4px;
}

.order-detail-total-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-detail-total-bar strong {
  color: var(--ink);
  font-size: 18px;
}

.order-detail-cell-input {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.order-detail-number-input,
.order-detail-cell-input input,
.order-detail-remark-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
  background: #fff;
}

.order-detail-remark-input {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.line-editor {
  display: grid;
  gap: 10px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(7, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.bom-line-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.bom-matrix-toolbar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.bom-matrix-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 160px;
}

.bom-matrix-toolbar .bom-search-field {
  min-width: min(360px, 100%);
  flex: 1 1 280px;
}

.bom-matrix-toolbar .bom-search-field input {
  width: 100%;
}

.bom-matrix-toolbar .bom-search-field small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.bom-matrix-toolbar span {
  font-size: 11px;
}

.bom-size-basis-actions {
  display: grid;
  grid-template-columns: auto 300px;
  align-items: end;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.bom-size-action-buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 8px;
}

.bom-size-basis-actions label {
  display: grid;
  gap: 3px;
}

.bom-size-basis-actions .bom-search-field {
  min-width: 220px;
  max-width: 320px;
  width: 300px;
}

.bom-size-basis-actions .bom-search-field input {
  width: 100%;
}

.bom-size-basis-actions .bom-search-field span {
  font-size: 11px;
}

.bom-size-basis-actions .bom-search-field small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.bom-size-basis {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bom-size-basis-main {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(380px, 1fr);
  align-items: end;
  gap: 12px;
}

.bom-size-basis-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.bom-size-basis-title strong {
  color: var(--text);
}

.bom-size-basis-table {
  display: grid;
  grid-template-columns: var(--basis-cols);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bom-size-basis-table > div {
  display: grid;
  place-items: center;
  min-width: 64px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.bom-size-basis-table > div:nth-last-child(-n + 1) {
  border-bottom: 0;
}

.bom-size-basis-table .basis-head {
  background: #eef5f1;
  color: #40586a;
}

.bom-size-basis-table .basis-size-head {
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  gap: 2px;
  padding: 0 4px;
}

.basis-order-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.basis-order-btn:hover,
.basis-order-btn:focus-visible {
  background: #dceee6;
  outline: none;
}

.bom-size-basis-table input {
  width: 72px;
  min-height: 28px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 900;
  color: var(--text);
}

.bom-modal-fixed {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bom-matrix-editor {
  grid-column: 1 / -1;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  display: grid;
  grid-template-rows: max-content max-content;
  align-content: start;
  align-items: start;
  gap: 8px;
  overflow: auto;
  padding-bottom: 4px;
  max-width: 100%;
  font-size: 10px;
}

.bom-matrix-editor .field,
.bom-matrix-editor input,
.bom-matrix-editor select,
.bom-matrix-editor textarea,
.bom-matrix-editor button {
  font-size: 10px;
}

.bom-matrix-editor .text-btn,
.bom-matrix-editor small {
  font-size: 9px;
}

.bom-matrix-body {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 8px;
}

.bom-matrix-row {
  min-width: 100%;
  width: max-content;
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(360px, 1.75fr) minmax(220px, .9fr) 120px minmax(180px, 1fr) minmax(150px, .8fr) 90px minmax(150px, 1fr) 72px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.bom-matrix-row.bom-material-invalid {
  border-color: #dc2626;
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .12);
}

.bom-matrix-row.bom-material-invalid .bom-material-search-input,
.bom-matrix-row.bom-material-invalid .bom-material-name-input {
  border-color: #dc2626;
}

.bom-material-warning {
  color: #b42318;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
}

.bom-matrix-row > [data-bom-col="materialNo"] select,
.bom-matrix-row > [data-bom-col="materialName"] select {
  min-width: 0;
}

.bom-cell {
  min-width: 0;
}

.bom-cell[data-bom-col="purchaseColor"] select {
  min-width: 220px;
}

.bom-cell > .field {
  margin: 0;
}

.bom-matrix-body .bom-cell > .field > span,
.bom-matrix-body .bom-usage-cell > .field > span {
  display: none;
}

.bom-material-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.bom-material-cell select,
.bom-material-picker input,
.material-picker input,
.order-picker input,
.supplier-picker input,
.bom-material-name-input {
  width: 100%;
  min-width: 0;
}

.bom-material-name-input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #f7fbf9;
  color: #06231c;
  font-weight: 700;
}

.bom-material-picker,
.material-picker,
.order-picker,
.supplier-picker {
  position: relative;
  min-width: 0;
}

.bom-material-results,
.material-results,
.order-results,
.supplier-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin-top: 4px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(8, 20, 18, .16);
}

.bom-modal-panel .bom-material-results,
.bom-modal-panel .material-results,
.bom-modal-panel .order-results,
.bom-modal-panel .supplier-results {
  position: static;
  z-index: 1;
}

.bom-material-results button,
.material-results button,
.order-results button,
.supplier-results button {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.order-results button {
  grid-template-columns: 128px minmax(0, 1fr);
}

.supplier-results button {
  grid-template-columns: 120px minmax(0, 1fr);
}

.supplier-results .supplier-create-result {
  background: #f4faf7;
  color: var(--primary);
  border-top: 1px solid var(--line);
}

.supplier-results .supplier-create-result strong {
  color: var(--primary);
}

.order-results button small,
.supplier-results button small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-material-results button:hover,
.material-results button:hover,
.order-results button:hover,
.supplier-results button:hover {
  background: #eef8f3;
}

.bom-material-results strong,
.bom-material-results span,
.material-results strong,
.material-results span,
.order-results strong,
.order-results span,
.supplier-results strong,
.supplier-results span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-picker {
  display: grid;
  gap: 8px;
}

.bom-material-no-result {
  padding: 10px;
  color: var(--muted);
  font-weight: 800;
}

.bom-material-headline {
  min-height: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bom-material-headline > span {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 900;
}

.bom-row-drag-handle {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(13, 125, 94, .18);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  font-size: 11px !important;
  line-height: 1;
  cursor: grab;
}

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

.bom-material-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.bom-material-actions .text-btn {
  font-size: 10px;
  line-height: 1;
}

.muted-text {
  color: var(--muted);
  font-weight: 800;
}

.approved-box {
  background: #effaf4;
  border-color: #c5ead3;
  color: #0c6b4f;
}

.bom-usage-cell {
  display: block;
  min-width: 0;
}

.bom-usage-field {
  margin: 0;
}

.bom-usage-input-shell {
  position: relative;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 42px 0 10px;
}

.bom-usage-input-shell [data-usage-summary] {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bom-usage-trigger {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 30px;
  min-width: 30px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  opacity: .18;
  transition: opacity .12s ease, border-color .12s ease, background .12s ease;
}

.bom-usage-cell:hover .bom-usage-trigger,
.bom-usage-cell:focus-within .bom-usage-trigger {
  opacity: 1;
  border-color: #b8d7ca;
  background: #f4fbf7;
}

.bom-usage-trigger:disabled {
  cursor: not-allowed;
  opacity: .28;
}

.icon-only {
  min-width: 36px;
  padding: 0;
}

.bom-usage-dialog {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 18, .42);
}

.bom-usage-card {
  width: min(620px, 100%);
  max-height: min(82vh, 680px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.bom-usage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.bom-usage-head h4 {
  margin: 0;
  font-size: 16px;
}

.bom-usage-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.bom-usage-note {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.bom-usage-table {
  display: grid;
  grid-template-columns: minmax(110px, .6fr) minmax(160px, 1fr);
  gap: 8px;
  padding: 14px 16px;
  overflow: auto;
  align-items: center;
}

.bom-usage-table > div {
  color: #40586a;
  font-weight: 900;
}

.bom-usage-table label {
  color: var(--text);
  font-weight: 900;
}

.bom-usage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.bom-material-dialog {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 18, .42);
}

.bom-material-card {
  width: min(1080px, 100%);
  max-height: min(86vh, 760px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.bom-material-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.bom-material-head h4 {
  margin: 0;
  font-size: 17px;
}

.bom-material-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.bom-material-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.bom-material-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.bom-material-tabs button.active {
  border-color: rgba(13, 125, 94, .28);
  background: #e8fbf3;
  color: var(--primary);
}

.bom-material-body {
  overflow: auto;
  padding: 14px 16px;
}

.bom-select-card {
  width: min(1180px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 36px));
  grid-template-rows: auto auto 1fr auto;
}

.bom-select-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(150px, .55fr) minmax(230px, .85fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.bom-select-filters label,
.bom-select-filters .field {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.bom-select-filters input,
.bom-select-filters select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.bom-select-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(260px, .62fr);
  gap: 12px;
  padding: 14px 16px;
  overflow: hidden;
}

.bom-select-pane {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.bom-select-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef5f1;
  color: #40586a;
  font-weight: 900;
}

.bom-select-pane-head span {
  color: var(--primary);
}

.bom-select-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.bom-select-list.is-slide-checking {
  user-select: none;
  touch-action: none;
}

.bom-select-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 8px;
  border-bottom: 1px solid #eef2f0;
  cursor: pointer;
}

.bom-select-row:hover {
  background: #f6fbf8;
}

.bom-select-row.is-checked {
  background: #eef8f2;
}

.bom-select-row.is-checked:hover {
  background: #e5f5ec;
}

.bom-select-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bom-select-row strong {
  color: var(--primary-strong);
}

.bom-select-row em {
  overflow: hidden;
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-select-row small {
  color: var(--muted);
  font-weight: 800;
}

.bom-select-transfer {
  display: grid;
  align-content: center;
  gap: 10px;
}

.bom-select-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

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

.bom-material-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.bom-material-price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  gap: 14px;
}

.bom-material-price-list,
.bom-material-price-form {
  display: grid;
  align-content: start;
  gap: 10px;
}

.bom-material-price-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.bom-material-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.bom-material-section-title strong {
  color: var(--text);
}

.bom-material-price-form .field,
.bom-material-form .field {
  margin: 0;
}

.bom-matrix-head {
  position: sticky;
  top: 0;
  z-index: 1;
  align-items: center;
  background: #eef5f1;
  color: #40586a;
  font-weight: 900;
}

.bom-matrix-head > div {
  min-height: 28px;
  display: flex;
  align-items: center;
}

.bom-drag-head {
  position: relative;
  cursor: grab;
  user-select: none;
}

.bom-col-resizer {
  position: absolute;
  top: 8px;
  right: -5px;
  z-index: 2;
  width: 10px;
  height: calc(100% - 16px);
  cursor: col-resize;
}

.bom-col-resizer::after {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  margin: 0 auto;
  border-radius: 999px;
  background: transparent;
}

.bom-drag-head:hover .bom-col-resizer::after,
.bom-resizing .bom-col-resizer::after {
  background: #9fb5ad;
}

.bom-resizing {
  cursor: col-resize;
  user-select: none;
}

.bom-size-head {
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #fff;
}

.bom-drag-head.dragging {
  opacity: .55;
  cursor: grabbing;
}

.bom-drag-head.drag-target {
  outline: 2px solid var(--primary);
  background: #e8fff5;
}

.bom-matrix-row.dragging-row {
  opacity: .58;
  outline: 2px solid rgba(13, 125, 94, .35);
}

.bom-matrix-row.drag-over-row {
  box-shadow: 0 0 0 2px rgba(13, 125, 94, .18);
}

.icon-mini {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid #f1b5b5;
  border-radius: 6px;
  background: #fff5f5;
  color: #b42318;
  cursor: pointer;
  font-weight: 900;
}

.bom-line-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.bom-line-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1.4fr) repeat(6, minmax(94px, 1fr)) minmax(120px, 1fr) 52px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.bom-line-index {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f2ed;
  color: var(--primary-strong);
  font-weight: 900;
}

.bom-remove-btn {
  min-height: 34px;
  align-self: end;
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

tr.error-row {
  background: #fff7ed;
}

tr.selected-row {
  background: #ecfdf5;
  outline: 2px solid rgba(15, 109, 91, .18);
}

.notification-settings {
  display: grid;
  gap: 16px;
}

.notification-status-card,
.notification-test-card,
.notification-rule-card,
.notification-log-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.notification-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.notification-status-card.ready {
  background: #f0fdf4;
}

.notification-status-card.warning {
  background: #fffbeb;
}

.notification-status-card strong,
.notification-test-card strong,
.notification-rule-head strong,
.notification-log-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.notification-status-card p,
.notification-test-card span,
.notification-rule-head span,
.notification-log-card span {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.notification-test-card,
.notification-log-card {
  padding: 16px 18px;
}

.notification-test-grid,
.notification-rule-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.notification-test-grid .wide,
.notification-rule-form .wide {
  grid-column: 1 / -1;
}

.notification-rule-list {
  display: grid;
  gap: 12px;
}

.notification-rule-card {
  padding: 0;
  overflow: hidden;
}

.notification-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.notification-rule-form {
  padding: 16px;
}

.notification-account-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.notification-recipient-text.hidden,
.notification-recipient-users.hidden {
  display: none;
}

.notification-rule-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #10231d;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    width: auto;
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .app.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    grid-template-rows: auto auto auto;
  }

  .workspace {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  .panel {
    min-height: 0;
    overflow: hidden;
  }

  .app.sidebar-collapsed .sidebar,
  .app.sidebar-collapsed .sidebar:hover,
  .app.sidebar-collapsed.sidebar-peek .sidebar {
    width: 100%;
    padding: 18px 14px;
    box-shadow: none;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) .brand-row {
    grid-template-columns: 42px minmax(0, 1fr) 30px;
    gap: 12px;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) .brand-row > div:not(.brand-mark),
  .app.sidebar-collapsed .sidebar:not(:hover) .nav-label,
  .app.sidebar-collapsed .sidebar:not(:hover) .nav-parent small,
  .app.sidebar-collapsed .sidebar:not(:hover) .nav-chevron,
  .app.sidebar-collapsed .sidebar:not(:hover) .account-switch {
    width: auto;
    height: auto;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) .sidebar-toggle {
    position: static;
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) .nav button {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) #logoutBtn {
    padding: 0 14px;
    font-size: 13px;
  }

  .app.sidebar-collapsed .sidebar:not(:hover) #logoutBtn::before {
    display: none;
  }

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

  .topbar {
    display: grid;
  }

  .top-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
  }

  .search {
    width: 100%;
  }

  .page-zoom-control {
    width: 100%;
    justify-content: space-between;
  }

  .order-filter-panel,
  .requirement-filter-panel,
  .material-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-order-summary {
    left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-order-summary-spacer {
    height: 154px;
  }

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

  .form-grid,
  .line-row,
  .bom-line-row,
  .bom-matrix-row,
  .stock-prepare-line,
  .bom-select-filters,
  .bom-select-body,
  .notification-test-grid,
  .notification-rule-form {
    grid-template-columns: 1fr !important;
  }

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

  .bom-size-basis-main,
  .bom-size-basis-actions {
    grid-template-columns: 1fr;
  }

  .bom-size-action-buttons {
    flex-wrap: wrap;
  }

  .bom-size-basis-actions .bom-search-field {
    width: 100%;
    max-width: none;
  }

  .bom-matrix-row {
    min-width: 0;
  }

  .bom-matrix-row > [data-bom-col="materialNo"] select,
  .bom-matrix-row > [data-bom-col="materialName"] select {
    min-width: 0;
  }

  .bom-col-resizer {
    display: none;
  }
}

@media (max-width: 560px) {
  .order-filter-panel,
  .requirement-filter-panel,
  .material-filter-panel,
  .purchase-order-summary {
    grid-template-columns: 1fr;
  }

  .purchase-order-summary-spacer {
    height: 300px;
  }
}
.change-collaboration-list { display: grid; gap: 10px; }
.change-collaboration-card { border: 1px solid var(--line); background: #fff; padding: 16px; cursor: pointer; }
.change-collaboration-card:hover { border-color: #7fb4a4; box-shadow: 0 7px 22px rgba(14, 72, 55, .09); }
.change-collaboration-head, .change-collaboration-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.change-collaboration-head > div { display: flex; align-items: baseline; gap: 12px; }
.change-collaboration-head strong { font-size: 18px; }
.change-collaboration-head span, .change-collaboration-foot span { color: var(--muted); }
.change-collaboration-card p { margin: 11px 0; }
.legacy-applied-tag { display: inline-block; margin-top: 9px; padding: 5px 8px; background: #fff3d6; color: #8b5d00; font-size: 12px; }
.change-collaboration-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.change-collaboration-metrics span { padding: 6px 9px; background: #f1f5f3; color: #405650; font-size: 13px; }
.change-collaboration-metrics .warn { background: #fff0d2; color: #8c5c00; }
.modal-panel.change-collaboration-modal {
  width: calc(100vw - 16px);
  height: calc(100vh - 16px);
  max-width: none;
  max-height: calc(100vh - 16px);
}
.change-collaboration-modal .modal-head { padding: 12px 16px; }
.change-collaboration-modal .form-grid { padding: 12px 16px; }
.change-collaboration-modal .modal-actions { padding: 10px 16px; }
.change-detail-shell { grid-column: 1 / -1; display: grid; gap: 14px; }
.change-legacy-warning { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff7e5; border-left: 4px solid #d88b16; }
.change-legacy-warning span { color: #755b26; }
.change-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.change-overview-grid > div { border: 1px solid var(--line); background: #f8faf9; padding: 11px; }
.change-overview-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.change-section { border-top: 1px solid var(--line); padding-top: 14px; }
.change-section h4 { margin: 0 0 11px; }
.change-section h4 small { color: var(--muted); font-weight: 500; }
.change-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.change-section-head h4 { margin: 0; }
.change-step-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.change-step { display: flex; gap: 8px; border: 1px solid var(--line); padding: 9px; min-height: 76px; }
.change-step > b { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: #e8eeeb; }
.change-step strong, .change-step span { display: block; }
.change-step span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.change-step.done { background: #f0faf4; border-color: #b9dcca; }
.change-step.done > b { background: #19825e; color: #fff; }
.change-step.current { background: #fff8e8; border-color: #dfbd75; }
.change-step.current > b { background: #d28a16; color: #fff; }
.change-diff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.change-diff-grid article { border: 1px solid var(--line); padding: 10px; }
.change-diff-grid article > span, .change-diff-grid small { display: block; color: var(--muted); margin-top: 4px; }
.change-diff-grid article > div { display: flex; gap: 9px; align-items: center; margin-top: 7px; }
.change-diff-grid em { font-style: normal; font-weight: 700; }
.change-diff-grid em.down { color: #c04433; }
.change-diff-grid em.up { color: #16805c; }
.change-diff-grid small.warn { color: #936000; }
.change-bom-block { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 11px; background: #fff6df; }
.change-bom-block > strong { flex-basis: 100%; color: #855700; }
.change-bom-block > span { padding: 5px 7px; background: #fff; color: #755000; }
.change-success { padding: 10px; background: #edf9f2; color: #14704e; }
.change-netting-note { color: var(--muted); font-size: 12px; }
.change-netting-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
}
.change-netting-metrics > div { padding: 10px 12px; border-right: 1px solid var(--line); background: #f8faf9; }
.change-netting-metrics > div:last-child { border-right: 0; }
.change-netting-metrics span { display: block; color: var(--muted); font-size: 12px; }
.change-netting-metrics b { display: block; margin-top: 4px; font-size: 18px; }
.change-netting-metrics .is-transfer { background: #edf9f2; }
.change-netting-metrics .is-transfer b, .change-transfer-qty, .requirement-change-transfer { color: #14704e; }
.change-netting-table-wrap { overflow: auto; border: 1px solid var(--line); max-height: 30vh; }
.change-netting-table { width: 100%; min-width: 1260px; table-layout: fixed; border-collapse: collapse; }
.change-netting-table th { position: sticky; top: 0; background: #eff5f2; z-index: 1; }
.change-netting-table th, .change-netting-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.change-netting-table th:first-child { width: 22%; }
.change-netting-table th:nth-child(2) { width: 10%; }
.change-netting-table th:nth-child(n+3):nth-child(-n+8) { width: 7%; }
.change-netting-table th:last-child { width: 26%; }
.change-netting-table td:first-child strong, .change-netting-table td:first-child span { display: block; }
.change-netting-table td:first-child span { color: var(--muted); margin-top: 2px; font-size: 12px; }
.change-netting-reason { color: var(--muted); line-height: 1.45; }
.change-netting-details { margin-top: 8px; }
.change-netting-details summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.change-netting-details > div { margin-top: 7px; border: 1px solid var(--line); }
.change-netting-details p {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}
.change-netting-details p:last-child { border-bottom: 0; }
.change-netting-details em { color: var(--muted); font-style: normal; white-space: nowrap; }
.change-bulk-actions { display: flex; gap: 7px; align-items: center; }
.change-material-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.change-material-filters > span { color: var(--muted); white-space: nowrap; }
.change-material-table-wrap { overflow: auto; border: 1px solid var(--line); max-height: 48vh; }
.change-material-table { width: 100%; min-width: 1320px; border-collapse: collapse; }
.change-material-table th { position: sticky; top: 0; z-index: 2; background: #eff5f2; }
.change-material-table th, .change-material-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.change-material-table td:first-child { min-width: 300px; }
.change-material-table td strong, .change-material-table td span, .change-material-table td small { display: block; }
.change-material-table td span, .change-material-table td small { margin-top: 3px; color: var(--muted); }
.change-material-table select { min-width: 170px; }
.change-material-table input { display: block; width: 180px; margin-bottom: 5px; }
.change-action-total { margin-bottom: 6px; font-weight: 700; color: var(--ink); }
.change-source-details { margin-top: 7px; border-top: 1px dashed var(--line); padding-top: 5px; }
.change-source-details summary { color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.change-source-detail-list { margin-top: 6px; display: grid; gap: 4px; }
.change-source-detail-list > div {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.5fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  background: #f7faf8;
}
.change-source-detail-list > div span,
.change-source-detail-list > div small,
.change-source-detail-list > div b { margin: 0; }
.change-source-detail-list > div b { white-space: nowrap; text-align: right; }
.btn.small { min-height: 34px; padding: 6px 10px; }

@media (max-width: 900px) {
  .change-overview-grid, .change-diff-grid { grid-template-columns: 1fr; }
  .change-netting-metrics { grid-template-columns: 1fr 1fr; }
  .change-netting-details p { grid-template-columns: 1fr; }
  .change-step-grid { grid-template-columns: 1fr 1fr; }
  .change-collaboration-head, .change-collaboration-foot, .change-section-head { align-items: flex-start; flex-direction: column; }
  .change-bulk-actions { width: 100%; flex-wrap: wrap; }
  .change-material-filters { grid-template-columns: 1fr; }
}
