.material-management-page .workspace-card__body {
  padding-top: 14px;
}

.material-page-title-probe {
  display: none;
}

.module-tab-panel {
  display: none;
}

.module-tab-panel.is-active {
  display: block;
}

.material-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.material-two-column > .section-card + .section-card {
  margin-top: 0;
}

.material-pane.section-card {
  display: grid;
  grid-template-rows: 62px 60px minmax(0, 1fr);
  align-self: start;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.material-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  height: 62px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #5a7dff 0%, #4d72ef 100%);
  box-sizing: border-box;
}

.material-pane__head > * {
  min-width: 0;
}

.material-pane__title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.material-pane__search {
  flex: 0 0 220px;
  min-width: 220px;
}

.material-pane__search input {
  min-height: 32px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.18);
}

.material-pane__search input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.material-pane__search .search-shell__icon {
  color: rgba(255, 255, 255, 0.88);
}

.material-pane__toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  height: 60px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #eef1f7;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  scrollbar-gutter: stable both-edges;
}

.material-pane__table-shell {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.material-pane__toolbar .tool-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.material-pane__toolbar::-webkit-scrollbar {
  height: 8px;
}

.material-master-table thead th:nth-child(1),
.material-master-table tbody td:nth-child(1),
.material-code-table thead th:nth-child(1),
.material-code-table tbody td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.material-master-table thead th:nth-child(2) {
  min-width: 160px;
}

.material-master-table thead th:nth-child(3) {
  min-width: 120px;
}

.material-master-table thead th:nth-child(4) {
  min-width: 150px;
}

.material-master-table thead th:nth-child(5) {
  min-width: 110px;
}

.material-master-table thead th:nth-child(6) {
  min-width: 150px;
}

.material-code-table thead th:nth-child(2) {
  min-width: 170px;
}

.material-code-table thead th:nth-child(3) {
  min-width: 190px;
}

.material-code-table thead th:nth-child(4) {
  min-width: 140px;
}

.material-code-table thead th:nth-child(5) {
  min-width: 120px;
}

.selection-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #d5dbea;
  color: #a5afc6;
  background: #fff;
  font-size: 12px;
  line-height: 1;
}

.selection-mark--header {
  background: #eef2fb;
}

.selection-mark--selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.material-record-panel {
  display: grid;
  gap: 14px;
}

.material-record-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.material-record-toolbar__left,
.material-record-toolbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.material-record-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.material-record-range__label {
  color: #49556f;
  font-size: 14px;
  font-weight: 600;
}

.material-record-range__fields {
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-record-range__fields input {
  min-width: 184px;
}

.material-record-range__split {
  color: var(--color-text-subtle);
}

.material-record-table-shell {
  background: #fff;
}

.material-record-table thead th:nth-child(1),
.material-record-table tbody td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.material-record-table thead th {
  min-width: 120px;
}

.material-record-table thead th:nth-child(11),
.material-record-table thead th:nth-child(12),
.material-record-table thead th:nth-child(14),
.material-record-table tbody td:nth-child(11),
.material-record-table tbody td:nth-child(12),
.material-record-table tbody td:nth-child(14) {
  min-width: 136px;
}

.material-management-page .drawer__content {
  padding-bottom: 26px;
}

.drawer__panel--material,
.drawer__panel--material-code {
  width: min(800px, 100%);
}

.material-form {
  display: grid;
  gap: 18px;
}

.material-form .form-row {
  grid-template-columns: 122px 1fr;
}

.material-form textarea {
  min-height: 104px;
}

.readonly-value {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: #f8faff;
  color: #55607b;
}

.rule-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.rule-picker__button {
  min-width: 86px;
  padding: 0 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: #fff;
  color: #4d5872;
}

.rule-picker__placeholder {
  color: var(--color-text-faint);
  font-size: 13px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef2f8;
  color: #4a566f;
  font-size: 13px;
}

.rule-chip__close {
  color: #7a859e;
  font-size: 14px;
  line-height: 1;
}

.material-code-help {
  margin: -6px 0 0;
  color: var(--color-text-faint);
  font-size: 13px;
  line-height: 1.6;
}

.modal__panel--rule {
  width: min(760px, calc(100vw - 32px));
}

.barcode-rule-card {
  text-align: left;
}

.barcode-rule-card__type {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
}

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

@media (max-width: 768px) {
  .material-pane.section-card {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .material-pane__head {
    height: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .material-pane__search {
    min-width: 0;
  }

  .material-pane__toolbar {
    height: auto;
    flex-wrap: wrap;
    overflow: visible;
  }

  .material-record-range {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-record-range__fields {
    flex-direction: column;
    align-items: stretch;
  }

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

  .rule-picker {
    grid-template-columns: 1fr;
  }
}
