:root {
  --folder-closed-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 21'%3E%3Cpath d='M3.5 5.5c0-1.1.9-2 2-2h6.6c.62 0 1.2.29 1.58.78l1.12 1.42h7.7c1.1 0 2 .9 2 2v1.25h-21V5.5Z' fill='%23eef8fb' stroke='%23577f91' stroke-width='1.55'/%3E%3Cpath d='M3.2 8.05h21.6v8.05c0 1.21-.99 2.2-2.2 2.2H5.4c-1.21 0-2.2-.99-2.2-2.2V8.05Z' fill='%23d9eef5' stroke='%23577f91' stroke-width='1.55'/%3E%3Cpath d='M5.2 9.55h17.4' stroke='%23fbfeff' stroke-width='1.2' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --folder-open-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 21'%3E%3Cpath d='M3.8 6c0-1.08.87-1.95 1.95-1.95h5.75c.62 0 1.2.29 1.57.78l1.1 1.42h7.65c1.1 0 2 .9 2 2v2H3.8V6Z' fill='%23eef8fb' stroke='%234f7789' stroke-width='1.55'/%3E%3Cpath d='M5.1 8.6h18.4c1.07 0 1.89.95 1.73 2.01l-.9 5.95c-.16 1.04-1.05 1.81-2.1 1.81H5.2c-1.07 0-1.9-.94-1.75-2l.82-5.96C4.42 9.38 5.31 8.6 6.35 8.6Z' fill='%23d9eef5' stroke='%234f7789' stroke-width='1.55'/%3E%3Cpath d='M6.4 10.2h16.4' stroke='%23fbfeff' stroke-width='1.2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  --folder-selected-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 21'%3E%3Cpath d='M3.5 5.5c0-1.1.9-2 2-2h6.6c.62 0 1.2.29 1.58.78l1.12 1.42h7.7c1.1 0 2 .9 2 2v1.25h-21V5.5Z' fill='%23f2fbfe' stroke='%23496f80' stroke-width='1.7'/%3E%3Cpath d='M3.2 8.05h21.6v8.05c0 1.21-.99 2.2-2.2 2.2H5.4c-1.21 0-2.2-.99-2.2-2.2V8.05Z' fill='%23cfeaf4' stroke='%23496f80' stroke-width='1.7'/%3E%3Cpath d='M5.2 9.55h17.4' stroke='%23ffffff' stroke-width='1.25' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  --folder-open-selected-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 21'%3E%3Cpath d='M3.8 6c0-1.08.87-1.95 1.95-1.95h5.75c.62 0 1.2.29 1.57.78l1.1 1.42h7.65c1.1 0 2 .9 2 2v2H3.8V6Z' fill='%23f2fbfe' stroke='%23496f80' stroke-width='1.7'/%3E%3Cpath d='M5.1 8.6h18.4c1.07 0 1.89.95 1.73 2.01l-.9 5.95c-.16 1.04-1.05 1.81-2.1 1.81H5.2c-1.07 0-1.9-.94-1.75-2l.82-5.96C4.42 9.38 5.31 8.6 6.35 8.6Z' fill='%23cfeaf4' stroke='%23496f80' stroke-width='1.7'/%3E%3Cpath d='M6.4 10.2h16.4' stroke='%23ffffff' stroke-width='1.25' stroke-linecap='round' opacity='.95'/%3E%3C/svg%3E");  --bg: #eef1f4;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #6b7684;
  --line: #d8dde3;
  --accent: #176b87;
  --accent-dark: #0f4c62;
  --good: #1f7a4d;
  --bad: #a13a3a;
  --soft: #f6f8fa;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}


body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #16222e;
  color: #ffffff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #f3f7f9;
  color: #16222e;
  font-weight: 700;
  border-radius: 8px;
}


.brand-logo {
  width: 156px;
  max-width: 100%;
  height: auto;
  display: block;
}
.brand-title {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  line-height: 1.25;
  color: #b8c4cf;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #d7e0e8;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #223345;
  color: #ffffff;
}

.user-panel {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: #cbd6df;
}

.user-panel select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #32475b;
  background: #0f1924;
  color: #ffffff;
}

.main {
  padding: 22px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.topbar p,
.muted {
  color: var(--muted);
}

.top-actions,
.form-actions,
.scan-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 13px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
  white-space: nowrap;
}

button:hover {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary:hover {
  background: #f3f7fa;
  border-color: #b8c8d5;
}

.add-row-action {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.add-row-action:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 16px;
}

.stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat strong {
  font-size: 28px;
}

.panel {
  padding: 16px;
}

.panel-heading {
  margin-bottom: 14px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 180px 160px;
  gap: 10px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: #354250;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--soft);
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}


table {
  table-layout: fixed;
}

th {
  text-align: center;
}

.col-center {
  text-align: center;
}

.col-id {
  text-align: left;
  width: 190px;
  font-family: Consolas, monospace;
}

.col-text {
  text-align: left;
}

td.col-center {
  white-space: nowrap;
}

td.col-location,
th.col-location {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
}


.col-fish {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
}
td.col-text {
  white-space: normal;
}
.col-code {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: normal;
}


.badge {
  justify-content: center;
  white-space: nowrap;
}

.col-action {
  text-align: center;
  width: 110px;
  white-space: nowrap;
}
.row-action {
  min-width: 74px;
}
tr:last-child td {
  border-bottom: 0;
}

.form-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.create-layout {
  grid-template-columns: 1fr;
}

.create-hint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: end;
}

.create-hint p {
  margin-bottom: 0;
}

.operations-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.operations-layout > .form-panel,
.movement-pane > .form-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-self: stretch;
}

.operations-layout > .form-panel textarea,
.movement-pane > .form-panel textarea {
  min-height: 74px;
}

.movement-pane {
  display: none;
}

.movement-pane.active {
  display: block;
}

.movement-source-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sale-lines,
.processing-lines,
.move-lines {
  display: grid;
  gap: 10px;
}

.sale-line-row,
.processing-line-row,
.move-line-row {
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sale-line-row label,
.processing-line-row label,
.move-line-row label {
  margin: 0;
  min-width: 0;
}

.sale-line-fields-row,
.processing-line-fields-row,
.move-line-fields-row {
  display: grid;
  gap: 10px;
  align-items: end;
}

.move-line-fields-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.processing-line-fields-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.sale-line-fields-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.sale-line-remove,
.processing-line-remove,
.move-line-remove {
  min-height: 34px;
  padding: 7px 11px;
  width: auto;
}

.sale-line-row .calc-note,
.processing-line-row .calc-note,
.move-line-row .calc-note {
  grid-column: 1 / -1;
  margin: 0;
}

.operations-journal {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.operation-canceled td {
  color: var(--muted);
}

.movement-journal-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.movement-journal-table th,
.movement-journal-table td {
  padding: 10px 8px;
  line-height: 1.25;
}

.movement-journal-table th:nth-child(1),
.movement-journal-table td:nth-child(1) { width: 16%; }
.movement-journal-table th:nth-child(2),
.movement-journal-table td:nth-child(2) { width: 16%; }
.movement-journal-table th:nth-child(3),
.movement-journal-table td:nth-child(3) { width: 22%; }
.movement-journal-table th:nth-child(4),
.movement-journal-table td:nth-child(4) { width: 14%; }
.movement-journal-table th:nth-child(5),
.movement-journal-table td:nth-child(5) { width: 16%; }
.movement-journal-table th:nth-child(6),
.movement-journal-table td:nth-child(6) { width: 7%; }
.movement-journal-table th:nth-child(7),
.movement-journal-table td:nth-child(7) { width: 9%; }

.movement-journal-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.movement-journal-table td:nth-child(1),
.movement-journal-table td:nth-child(6) {
  white-space: nowrap;
}

.movement-journal-table .col-code {
  font-size: 12px;
}

.movement-journal-table .col-action,
.movement-journal-table th:nth-child(7),
.movement-journal-table td:nth-child(7) {
  width: 9%;
  white-space: normal;
}

.movement-journal-table td:nth-child(7) .compact {
  padding-left: 8px;
  padding-right: 8px;
}


.directory-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.directory-layout > .panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-self: stretch;
}

.users-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.users-layout > .panel,
.users-layout > .form-panel {
  align-self: stretch;
}

#userForm {
  align-content: start;
}

@media (max-width: 1180px) {
  .users-layout {
    grid-template-columns: 1fr;
  }

  .sale-line-row {
    grid-template-columns: minmax(240px, 1fr) minmax(120px, 0.5fr);
  }

  .contract-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-remove {
    justify-self: start;
  }
}

.labels-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.labels-layout > .panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#labelPreview {
  margin-top: 0;
}
.form-panel {
  display: grid;
  gap: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nomenclature-picker {
  display: grid;
  gap: 10px;
  padding-bottom: 2px;
}

.nomenclature-picker-title {
  color: #334155;
  font-weight: 700;
}

.nomenclature-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}



.auto-managed-field select {
  background: #ffffff;
}

.auto-managed-field.is-auto-locked select {
  background: #f6f9fb;
  color: #425466;
  pointer-events: none;
}

.auto-managed-field.is-manual select {
  background: #ffffff;
  color: var(--ink);
  pointer-events: auto;
}

.auto-managed-field.is-manual .field-note {
  color: #8a5a00;
}

.field-note {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}
.box-nomenclature-field {
  grid-column: 1 / -1;
}

.box-nomenclature-details {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  min-height: 16px;
}
.code-example {
  background: #0f1924;
  color: #d8f3ff;
  padding: 12px;
  border-radius: 6px;
  font-family: Consolas, monospace;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf3f7;
  color: var(--accent-dark);
  font-size: 12px;
}

.badge.stored,
.badge.counted {
  background: #e8f4ee;
  color: var(--good);
}

.badge.written_off,
.badge.missing {
  background: #f9eaea;
  color: var(--bad);
}

.badge.inventory-excluded {
  background: #eef2f5;
  color: #64748b;
}

.badge.user-active {
  background: #e8f4ee;
  color: var(--good);
}

.badge.user-inactive {
  background: #f9eaea;
  color: var(--bad);
}

.scan-row input {
  flex: 1;
}

.scan-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.scan-result.empty {
  color: var(--muted);
}

.scan-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scan-card div {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.scan-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.label-preview {
  width: 420px;
  min-height: 260px;
  max-width: 100%;
  border: 1px solid #111827;
  background: #ffffff;
  padding: 14px;
  display: grid;
  grid-template-columns: 128px 1fr;
  grid-template-rows: auto 1fr;
  gap: 12px 14px;
  align-content: start;
}

.label-header {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #111827;
}

.label-header strong {
  font-size: 22px;
  line-height: 1.1;
}

.label-header span {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: #374151;
}

.qr-image {
  width: 128px;
  height: 128px;
  border: 1px solid #111;
  object-fit: contain;
  background: #fff;
  padding: 5px;
}

.label-text {
  display: grid;
  gap: 5px;
  align-content: start;
  font-size: 13px;
  line-height: 1.15;
}

.label-text span,
.label-text small {
  display: block;
  padding-bottom: 5px;
  border-bottom: 1px solid #d1d5db;
}

.label-text strong {
  font-size: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.check-row input {
  width: auto;
}

@media print {
  body * {
    visibility: hidden;
  }

  #labelPreview,
  #labelPreview * {
    visibility: visible;
  }

  #labelPreview {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--print-width, 150mm);
    min-height: var(--print-height, 100mm);
    border: 0;
    padding: 5mm;
    grid-template-columns: 46mm 1fr;
    gap: 4mm 5mm;
  }

  #labelPreview .qr-image {
    width: 46mm;
    height: 46mm;
    padding: 1.5mm;
  }

  #labelPreview .label-header {
    gap: 1.5mm;
    padding-bottom: 3mm;
  }

  #labelPreview .label-header strong {
    font-size: 20pt;
  }

  #labelPreview .label-header span {
    font-size: 10pt;
  }

  #labelPreview .label-text {
    gap: 2mm;
    font-size: 12pt;
  }

  #labelPreview .label-text span,
  #labelPreview .label-text small {
    padding-bottom: 1.8mm;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .form-layout,
  .labels-layout,
  .filters {
    grid-template-columns: 1fr;
  }
}

.calc-note {
  align-self: end;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 9px 10px;
  min-height: 38px;
}

.calc-note.ok {
  border-color: #b8e1c7;
  background: #eef8f1;
  color: #2f6f45;
}

.calc-note.warning {
  border-color: #f1d18a;
  background: #fff8e5;
  color: #8a5a0a;
}
.inventory-toolbar,
.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

#inventoryComment {
  margin-top: 10px;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.inventory-summary div {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.inventory-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-summary strong {
  display: block;
  margin-top: 3px;
}

.inventory-summary.finished {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.scan-ok {
  margin-bottom: 12px;
  border: 1px solid #9bc7a5;
  border-radius: 6px;
  background: #edf8ef;
  color: #1f6b32;
  padding: 10px 12px;
}
.inventory-history {
  margin-top: 18px;
}

.compact {
  padding: 6px 10px;
}
.subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-top: 4px;
}

.subtab {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.subtab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}



.nav-parent {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.nav-parent::after {
  content: "▸";
  color: #91a4b5;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.nav-parent.is-expanded::after {
  transform: rotate(90deg);
}

.nav-children[hidden] {
  display: none;
}
.nav-children {
  display: grid;
  gap: 4px;
  margin: -4px 0 8px 24px;
  padding-left: 0;
}

.nav-subitem {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #c9d8e6;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  text-align: left;
}

.nav-subitem:hover,
.nav-subitem.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}
.content-panel {
  display: none;
}

.content-panel.active {
  display: grid;
  gap: 12px;
}
.container-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.container-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 10px;
}

.container-cell span {
  color: var(--muted);
  font-size: 12px;
}


.about-panel {
  max-width: 980px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.about-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.about-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.about-grid strong {
  display: block;
}

.about-text {
  display: grid;
  gap: 10px;
  color: var(--ink);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .create-hint {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .sale-line-fields-row,
  .processing-line-fields-row,
  .move-line-fields-row {
    grid-template-columns: 1fr;
  }

  .sale-line-remove,
  .processing-line-remove,
  .move-line-remove {
    justify-self: start;
  }

  .contract-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}



















.scan-label-warning {
  margin-bottom: 12px;
  border: 1px solid #e7c66a;
  border-radius: 6px;
  background: #fff7df;
  color: #805700;
  padding: 10px 12px;
}

.label-status {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 600;
}

.label-status.ok {
  background: #edf8ef;
  color: #1f6b32;
  border-color: #9bc7a5;
}

.label-status.warning {
  background: #fff7df;
  color: #805700;
  border-color: #e7c66a;
}

.label-warning-row {
  background: #fffaf0;
}

.badge.label-warning {
  background: #fff7df;
  color: #805700;
}

.badge.label-ok {
  background: #e8f4ee;
  color: var(--good);
}

.badge.label-muted {
  background: #eef2f5;
  color: #64748b;
}

.row-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-state {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background: rgba(16, 31, 42, 0.42);
}

.modal-overlay[hidden] {
  display: none;
}

.confirm-modal {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(16, 31, 42, 0.22);
  padding: 22px;
}

.confirm-modal h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.password-reset-modal {
  display: grid;
  gap: 12px;
}

.inventory-start-modal {
  width: min(820px, 100%);
  display: grid;
  gap: 12px;
}

.password-reset-modal label {
  display: grid;
  gap: 8px;
}

.password-reset-modal .password-tools {
  margin-top: 0;
}

.form-success {
  border: 1px solid #a8d9ba;
  border-radius: 6px;
  padding: 10px 12px;
  background: #eef8f1;
  color: #2f6f45;
}
.audit-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(170px, 1fr) minmax(150px, 0.9fr) 140px 140px minmax(220px, 1.4fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.audit-filters label {
  font-size: 13px;
}

.audit-filters .secondary {
  height: 38px;
  white-space: nowrap;
}

.audit-system-toggle {
  align-items: center;
  display: flex;
  gap: 7px;
  height: 38px;
  white-space: nowrap;
}
.audit-system-toggle input {
  margin: 0;
}

.audit-summary {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.audit-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1),
.audit-table th:nth-child(2),
.audit-table td:nth-child(2),
.audit-table th:nth-child(3),
.audit-table td:nth-child(3),
.audit-table th:nth-child(4),
.audit-table td:nth-child(4),
.audit-table th:nth-child(5),
.audit-table td:nth-child(5) { width: 20%; }

.audit-table th,
.audit-table td {
  padding: 12px 14px;
}

.audit-table td {
  vertical-align: top;
  line-height: 1.35;
}

.audit-table .col-code,
.audit-table td:nth-child(5) {
  word-break: break-word;
}

.audit-table th {
  text-align: center;
}

.audit-table td:nth-child(1),
.audit-table td:nth-child(3) {
  text-align: center;
}

.audit-table td:nth-child(2),
.audit-table td:nth-child(4),
.audit-table td:nth-child(5) {
  text-align: left;
}

@media (max-width: 1280px) {
  .audit-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .audit-filters {
    grid-template-columns: 1fr;
  }
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e8edf1;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(16, 31, 42, 0.14);
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  text-align: center;
}

.login-logo {
  max-width: 220px;
  max-height: 64px;
  object-fit: contain;
  justify-self: center;
}

.form-error {
  border: 1px solid #e2a4a4;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff0f0;
  color: #9f2f2f;
}

.password-rules {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.password-tools {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.password-tools .secondary {
  padding: 8px 12px;
}

.password-generated-note {
  color: #2f6f45;
  font-size: 13px;
  line-height: 1.35;
}

.password-change-row {
  grid-column: 1 / -1;
  margin-top: -2px;
}

.user-panel strong {
  color: #ffffff;
  font-size: 15px;
}

.user-panel small {
  color: #9fb0bf;
}

.sidebar-button {
  width: 100%;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  padding: 10px 0;
}

.permission-row {
  margin: 0;
}

@media (max-width: 720px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}


.login-note {
  margin: -4px 0 4px;
  color: var(--muted);
  line-height: 1.4;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 40px;
  height: auto;
  border: 0;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.password-toggle:hover,
.password-toggle.active {
  background: #eef4f7;
  color: var(--accent);
}
.users-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12.5px;
}

.users-table th,
.users-table td {
  padding: 11px 9px;
  line-height: 1.3;
}

.users-table th {
  white-space: normal;
  overflow-wrap: anywhere;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) { width: 24%; }
.users-table th:nth-child(2),
.users-table td:nth-child(2) { width: 18%; }
.users-table th:nth-child(3),
.users-table td:nth-child(3) { width: 34%; }
.users-table th:nth-child(4),
.users-table td:nth-child(4) { width: 24%; }

.users-table th:nth-child(2),
.users-table td:nth-child(2),
.users-table th:nth-child(3),
.users-table td:nth-child(3),
.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  text-align: center;
}

.users-table .user-name-cell,
.users-table .user-role-cell {
  overflow-wrap: anywhere;
  white-space: normal;
}

.users-table .user-name-cell strong,
.users-table .user-name-cell span,
.users-table .user-role-cell span {
  display: block;
}

.users-table .user-name-cell strong {
  font-weight: 600;
}

.users-table .user-name-cell span {
  color: var(--muted);
  margin-top: 3px;
}

.users-table .user-role-cell .badge {
  display: inline-flex;
  margin-top: 6px;
}

.permissions-cell {
  white-space: normal;
}

.permission-chip {
  display: inline-block;
  margin: 2px 2px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #edf5f7;
  color: #1f6678;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.permission-chip.all {
  background: #e8f6ee;
  color: #26724a;
}

.users-table .col-action {
  width: 24%;
}

.users-table .user-action-buttons {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
  text-align: center;
}

.users-table .user-action-buttons .compact {
  font-size: 12px;
  min-width: 0;
  padding: 6px 7px;
  width: auto;
}

.users-table .user-action-buttons .danger,
.danger-action {
  border-color: #f1b5b5;
  color: #a93232;
}

.users-table .user-action-buttons .danger:hover,
.danger-action:hover {
  background: #fff1f1;
}
























.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 14px;
}

.form-tab {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #f7f9fb;
  color: var(--ink);
  padding: 8px 12px;
}

.form-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: grid;
  gap: 12px;
}

.contract-editor {
  display: grid;
  gap: 10px;
}

.contract-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.contract-row label {
  min-width: 0;
}

.contract-remove {
  align-self: end;
  justify-self: start;
}

.organization-panel {
  max-width: 1180px;
}


.import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.file-input {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 0;
}

.file-input input {
  width: auto;
}


.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.inline-filter select {
  min-width: 220px;
}

.nomenclature-directory-panel {
  width: 100%;
}

.nomenclature-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.nomenclature-commandbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.compact-file {
  min-height: 34px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.compact-file input {
  width: auto;
}

.nomenclature-current-parent {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border: 1px solid #cfe0e7;
  border-radius: 6px;
  background: #f1f9fc;
}

.nomenclature-filter {
  margin-left: auto;
}

.nomenclature-search {
  width: min(260px, 100%);
}

.nomenclature-wrap {
  border-radius: 6px;
  overflow-x: auto;
}

.nomenclature-table {
  table-layout: fixed;
  min-width: 1280px;
  font-size: 13px;
}

.nomenclature-table th,
.nomenclature-table td {
  height: 26px;
  padding: 5px 8px;
  border-bottom: 1px solid #dce2e8;
  vertical-align: middle;
}

.nomenclature-table th {
  height: 28px;
  background: #f3f6f8;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.nomenclature-table th:nth-child(1),
.nomenclature-table td:nth-child(1) { width: 46%; }
.nomenclature-table th:nth-child(2),
.nomenclature-table td:nth-child(2) { width: 10%; }
.nomenclature-table th:nth-child(3),
.nomenclature-table td:nth-child(3) { width: 7%; }
.nomenclature-table th:nth-child(4),
.nomenclature-table td:nth-child(4) { width: 7%; }
.nomenclature-table th:nth-child(5),
.nomenclature-table td:nth-child(5) { width: 10%; }
.nomenclature-table th:nth-child(5) { text-align: center; }
.nomenclature-table th:nth-child(6),
.nomenclature-table td:nth-child(6) { width: 8%; }
.nomenclature-table th:nth-child(7),
.nomenclature-table td:nth-child(7) { width: 150px; }

.nomenclature-folder-row td {
  background: #f7fbfd;
}

.nomenclature-folder-row:hover td,
.nomenclature-item-row:hover td {
  background: #eef7fa;
}

.nomenclature-folder-row.is-selected td {
  background: linear-gradient(90deg, #e6f6fc 0%, #f3fbfe 100%);
}

.nomenclature-folder-row.is-selected:hover td {
  background: linear-gradient(90deg, #dff2fa 0%, #eef9fd 100%);
}

.nomenclature-tree-button {
  width: 100%;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 0 0 calc(2px + var(--tree-indent, 0px));
  text-align: left;
  cursor: pointer;
}

.nomenclature-tree-button strong {
  font-weight: 700;
}

.nomenclature-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.tree-toggle {
  width: 13px;
  text-align: center;
  color: #315a68;
  font-size: 11px;
}

.tree-folder-icon {
  width: 22px;
  height: 17px;
  flex: 0 0 22px;
  background: center / contain no-repeat var(--folder-closed-icon);
  filter: drop-shadow(0 1px 0 rgba(15, 79, 99, 0.12));
}

.tree-folder-icon.is-open {
  background-image: var(--folder-open-icon);
}

.tree-folder-icon.is-selected {
  background-image: var(--folder-selected-icon);
}

.tree-folder-icon.is-open.is-selected {
  background-image: var(--folder-open-selected-icon);
}

.tree-folder-icon::before {
  content: none;
}

.nomenclature-item-row td {
  background: #ffffff;
}

.nomenclature-item-name {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding-left: calc(22px + var(--tree-indent, 0px));
  line-height: 1.2;
}

.nomenclature-item-name span:last-child {
  overflow-wrap: anywhere;
}

.nomenclature-action-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.nomenclature-action-buttons .row-action {
  min-width: 0;
  padding: 6px 8px;
  white-space: nowrap;
}

.nomenclature-action-buttons .danger {
  border-color: #f1b5b5;
  color: #a93232;
}

.nomenclature-action-buttons .danger:hover {
  background: #fff1f1;
}

.tree-item-marker {
  width: 8px;
  height: 2px;
  background: #7ba7b7;
  border-radius: 999px;
}

.nomenclature-modal {
  width: min(820px, 100%);
  display: grid;
  gap: 12px;
}

.nomenclature-group-modal {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
}

.nomenclature-modal label,
.nomenclature-group-modal label {
  display: grid;
  gap: 8px;
}
.nomenclature-settings-block {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
}

.nomenclature-settings-block h3 {
  font-size: 15px;
  margin: 0;
}

.nomenclature-settings-block p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.box-mode-banner {
  align-items: center;
  background: #eef7fa;
  border: 1px solid #c9e4ed;
  border-radius: 6px;
  color: #0f6f87;
  display: flex;
  font-weight: 700;
  margin: 14px 0 12px;
  min-height: 38px;
  padding: 9px 12px;
}





.units-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

#unitForm {
  align-content: start;
}

#unitForm .field-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
}

#unitForm label {
  margin: 0;
}

#unitForm input,
#unitForm select {
  min-height: 38px;
}

#unitForm .form-actions {
  margin-top: 2px;
}

.units-table {
  table-layout: fixed;
}

.units-table th,
.units-table td {
  padding: 10px 9px;
  vertical-align: middle;
}

.units-table th:nth-child(1),
.units-table td:nth-child(1) { width: 28%; }
.units-table th:nth-child(2),
.units-table td:nth-child(2) { width: 11%; }
.units-table th:nth-child(3),
.units-table td:nth-child(3) { width: 24%; }
.units-table th:nth-child(4),
.units-table td:nth-child(4) { width: 11%; }
.units-table th:nth-child(5),
.units-table td:nth-child(5) { width: 11%; }
.units-table th:nth-child(6),
.units-table td:nth-child(6) { width: 15%; }

@media (max-width: 1280px) {
  #unitForm .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  #unitForm .field-grid {
    grid-template-columns: 1fr;
  }
}
