.asset-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  background: #e9eee7;
  border: 1px solid var(--line);
  border-radius: 12px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.asset-tabs a,
.asset-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
.asset-tabs .active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px #1f331712;
}
.asset-tabs span,
.asset-count {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 20px;
  background: #edf1e9;
  color: #51614c;
}
.asset-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.asset-back:hover,
.asset-detail a,
.asset-note a {
  color: var(--green-dark);
  text-decoration: underline;
}
.asset-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.asset-filters select {
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  max-width: 100%;
  color: var(--ink);
}
.asset-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 190px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.asset-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}
.asset-search:focus-within {
  outline: 2px solid #739f49;
}
.registry-head,
.registry-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(115px, 1fr) minmax(126px, 0.94fr);
  gap: 18px;
  align-items: center;
  padding: 13px 20px;
}
.registry-head {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f7f9f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.registry-row {
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.registry-row:hover,
.asset-kit-row:hover {
  background: #f5f8f3;
}
.registry-row > *,
.registry-name > div,
.catalog-item,
.asset-kit-row > div {
  min-width: 0;
}
.registry-row strong,
.registry-row small,
.asset-kit-row strong,
.asset-kit-row small,
.catalog-row strong,
.catalog-row small {
  display: block;
  overflow-wrap: anywhere;
}
.registry-row small,
.asset-kit-row small,
.catalog-row small {
  font-size: 12px;
  margin-top: 2px;
  color: var(--muted);
}
.registry-name,
.catalog-row,
.asset-kit-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.asset-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-grid;
  place-items: center;
  background: #edf3e8;
  color: #54694b;
  border-radius: 9px;
}
.asset-icon.violet {
  background: #f0edf6;
  color: #77678d;
}
.registry-id strong {
  font-family: Consolas, 'Courier New', monospace;
}
.registry-status .badge {
  white-space: normal;
}
.registry-name .registry-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.asset-observation-note {
  grid-column: 1 / -1;
}
.asset-observation-note dd {
  white-space: pre-wrap;
}
.asset-kit-row,
.catalog-row {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.catalog-row:last-child,
.asset-kit-row:last-child {
  border-bottom: 0;
}
.asset-kit-n,
.catalog-row .icon-btn,
.asset-kit-row > .badge {
  margin-left: auto;
}
.asset-kit-n {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.asset-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.asset-message,
.asset-section,
.asset-scan-panel {
  padding: 22px;
}
.asset-message p,
.asset-scan-panel p,
.asset-section-title p,
.unknown-composition,
.asset-note,
.qr-data,
.scan-feedback {
  color: var(--muted);
  font-size: 14px;
}
.asset-message p {
  margin: 8px 0 16px;
}
.asset-section,
.asset-section-title,
.component-row,
.template-row {
  min-width: 0;
}
.asset-section {
  max-width: 960px;
}
.asset-section-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 16px;
}
.asset-section-title > .ico {
  color: #537847;
  margin-top: 1px;
}
.asset-section-title p {
  margin: 5px 0 0;
}
.asset-section .kit-fields {
  margin-top: 14px;
}
.asset-form-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}
.component-row,
.template-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.2fr) minmax(130px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  background: #f7f9f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.template-row {
  grid-template-columns: minmax(100px, 1fr) 75px auto;
}
.component-tools {
  display: flex;
  gap: 3px;
}
.component-row .field,
.template-row .field {
  min-width: 0;
  margin: 0;
}
.component-row select,
.template-row select {
  width: 100%;
}
.dialog-body .component-row {
  grid-template-columns: 1fr 1fr;
}
.unknown-composition,
.asset-note {
  padding: 12px;
  border-radius: 8px;
  background: #f3f7ee;
  margin: 10px 0;
}
.asset-error:not(:empty) {
  color: #9c332f;
  background: #fff1f0;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 8px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.asset-detail {
  min-width: 0;
}
.asset-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 25px;
  margin: 0;
  padding: 3px 20px 14px;
}
.asset-detail {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.asset-detail dt {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.asset-detail dd {
  margin: 0;
  font-size: 15px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.kit-units,
#asset-tasks:not(:empty) {
  margin-top: 18px;
}
.physical-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 126px;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #fff;
  color: #111;
}
.label-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.label-text small {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: #444;
}
.label-text strong {
  font-size: 17px;
}
.physical-label svg {
  width: 31%;
  min-width: 95px;
  max-width: 145px;
  flex: none;
}
.qr-data {
  margin: 12px 0;
}
.qr-data summary {
  cursor: pointer;
}
.qr-data pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  margin-bottom: 0;
}
.asset-scan-panel {
  max-width: 600px;
  text-align: center;
  margin: auto;
  padding: 32px 22px;
}
.asset-scan-panel p {
  max-width: 400px;
  margin: 10px auto 18px;
}
.scan-illustration {
  margin: 0 auto 18px;
  background: #edf6e4;
  color: #517a3d;
  border-radius: 22px;
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
}
.scan-stage {
  height: 122px;
  border-radius: 12px;
  background: #222c24;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.scan-stage.active {
  height: min(50vh, 300px);
}
.scan-stage video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.scan-stage.active video {
  display: block;
}
.scan-reticle {
  pointer-events: none;
  position: absolute;
  width: 58%;
  height: 65%;
  inset: 17.5% 21%;
  border: 1px dashed #bef08a;
  border-radius: 12px;
}
.scan-feedback {
  margin: 12px 0;
}
.scan-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.scan-input .field {
  flex: 1;
  min-width: 0;
  margin: 0;
}
@media (max-width: 1050px) {
  .registry-head,
  .registry-row {
    grid-template-columns: minmax(145px, 1.25fr) minmax(100px, 1fr) minmax(100px, 0.82fr) minmax(
        95px,
        1fr
      );
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .component-row {
    grid-template-columns: minmax(100px, 1fr) minmax(130px, 1.1fr);
  }
  .component-tools {
    justify-content: flex-end;
  }
}
@media (max-width: 680px) {
  .asset-tabs {
    gap: 2px;
    border-radius: 10px;
  }
  .asset-tabs a,
  .asset-tabs button {
    font-size: 13px;
    padding: 6px 9px;
    gap: 5px;
  }
  .catalog-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .asset-filters {
    padding: 13px;
    gap: 7px;
  }
  .asset-filters .asset-search {
    flex: 1 0 100%;
  }
  .asset-filters select {
    flex: 1 1 42%;
    min-width: 0;
    font-size: 13px;
    padding-right: 4px;
  }
  .registry-head {
    display: none;
  }
  .registry-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    gap: 9px;
    padding: 14px;
  }
  .registry-name {
    grid-column: 1/-1;
  }
  .registry-place {
    grid-column: 1;
    grid-row: 3;
  }
  .registry-status {
    grid-column: 2;
    grid-row: 2/4;
    text-align: right;
    align-self: center;
  }
  .asset-kit-row,
  .catalog-row {
    padding: 13px;
    gap: 8px;
  }
  .asset-kit-n {
    max-width: 95px;
    font-size: 12px;
  }
  .asset-kit-row > .badge {
    max-width: 120px;
    white-space: normal;
  }
  .asset-section,
  .asset-message {
    padding: 14px;
  }
  .component-row,
  .dialog-body .component-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .component-row > .field:nth-child(1),
  .component-row > .field:nth-child(2) {
    grid-column: 1/-1;
  }
  .asset-details {
    grid-template-columns: 1fr;
    padding: 0 15px 14px;
  }
  .scan-input {
    flex-wrap: wrap;
  }
  .scan-input .field {
    flex: 1 0 100%;
  }
}
.batch-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.batch-recipe {
  margin: 15px 0;
  display: grid;
  gap: 8px;
}
.batch-part,
.batch-cells {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.batch-part {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f9f6;
  border-radius: 10px;
}
.batch-part .field,
.batch-cells .field {
  flex: 1 1 165px;
  min-width: 0;
  margin: 0;
}
.batch-part .field:has([name='quantity']) {
  flex: 0 1 105px;
}
.batch-part select,
.batch-part input,
.batch-cells input {
  width: 100%;
}
.batch-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.batch-summary b {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.batch-summary span {
  font-size: 13px;
  color: var(--muted);
}
.batch-summary button {
  margin-left: auto;
}
.batch-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.batch-progress {
  color: var(--green-dark);
  font-weight: 650;
  font-size: 14px;
}
.batch-grid {
  display: grid;
  gap: 9px;
}
.batch-line {
  padding: 9px 12px 12px;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.batch-line legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.batch-entry {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.batch-entry input {
  flex: 1;
  min-width: 0;
  font-family: Consolas, monospace;
}
.batch-entry [aria-invalid='true'] {
  border-color: #a7463d;
}
.batch-entry .icon-btn {
  flex: none;
}
.batch-cells .field > span:first-child {
  overflow-wrap: anywhere;
}
.batch-paste {
  display: grid;
  gap: 12px;
}
.batch-paste p {
  font-size: 14px;
  color: var(--muted);
}
.batch-paste textarea {
  width: 100%;
  min-width: 0;
  font-family: Consolas, monospace;
}
.batch-links {
  display: grid;
  margin-top: 16px;
}
.batch-links a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.batch-links a:hover {
  color: var(--green-dark);
}
@media (max-width: 580px) {
  .batch-part .field:has([name='quantity']) {
    flex: 1 1 90px;
  }
  .batch-cells .field {
    flex-basis: 100%;
  }
  .batch-summary button {
    margin-left: 0;
  }
  .batch-entry .icon-btn {
    width: 42px;
    height: 42px;
  }
}
.batch-inventory-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
}
.batch-inventory-toggle input {
  width: 17px;
  height: 17px;
}
.batch-grid.only-inventory {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.batch-grid.only-inventory .batch-cells .field:not(:first-child) {
  display: none;
}

.label-device-list {
  display: grid;
  max-height: 13rem;
  overflow: auto;
  margin-top: .5rem;
}
.label-device-list label {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .35rem 0;
}
.label-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 16rem;
  margin: .75rem auto;
}
.label-slot-grid button {
  cursor: pointer;
  min-height: 28px;
  border: 1px solid #a1aaa8;
  border-radius: 4px;
  background: white;
  color: #414948;
}
.label-slot-grid button[aria-pressed="true"] {
  background: #175c51;
  color: white;
  border-color: #175c51;
}
