.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  padding: var(--space-5) var(--space-4);
  background: linear-gradient(180deg, var(--surface-glass), rgba(var(--bg-rgb), 0.54));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
}

.erp-app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 68px;
  padding: 12px clamp(16px, 2vw, 28px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong), transparent 6%);
  backdrop-filter: blur(22px);
}

.erp-topbar-brand,
.erp-topbar-actions,
.erp-user-menu-button,
.erp-global-search,
.erp-page-header,
.erp-breadcrumbs,
.erp-page-actions,
.erp-cabinet-footer {
  display: flex;
  align-items: center;
}

.erp-topbar-brand {
  gap: 10px;
  color: var(--text-strong);
  text-decoration: none;
  font-weight: var(--weight-bold);
}

.erp-brand-mark,
.erp-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: var(--shadow-sm);
}

.erp-global-search {
  position: relative;
  justify-self: center;
  gap: 10px;
  width: min(50%, 520px);
  min-height: 44px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.erp-global-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.erp-search-filter {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  cursor: pointer;
}

.erp-topbar-actions {
  justify-content: flex-end;
  gap: var(--space-2);
}

.erp-icon-button {
  position: relative;
}

.erp-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #111827;
  background: var(--warning);
  font-size: 11px;
  font-weight: var(--weight-bold);
}

.erp-user-menu-button {
  gap: 10px;
  min-height: 44px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
}

.erp-user-menu-button span:not(.erp-avatar) {
  display: grid;
  line-height: 1.15;
  text-align: left;
}

.erp-user-menu-button small {
  color: var(--muted);
}

.erp-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 18px;
  display: none;
  width: min(380px, calc(100vw - 32px));
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.erp-global-search .erp-dropdown-panel {
  right: 0;
  left: 0;
  width: auto;
}

.erp-dropdown-panel[data-open] {
  display: grid;
  gap: var(--space-3);
}

.erp-search-results-panel {
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
}

.erp-search-state {
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

.erp-search-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
}

.erp-search-result:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}

.erp-search-result-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--surface-soft);
}

.erp-search-result span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.erp-search-result b,
.erp-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-search-result small,
.erp-search-result em {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-style: normal;
}

.erp-marketplace-stock-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.erp-marketplace-stock {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: visible;
  border: 2px solid var(--surface-strong);
  border-radius: 999px;
  color: var(--text-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.erp-marketplace-stock img {
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: 999px;
  background: #fff;
  object-fit: cover;
}

.erp-marketplace-stock b {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--surface-strong);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.erp-doc-icon,
.erp-type-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  margin: 2px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-soft);
}

.erp-doc-icon {
  cursor: pointer;
}

.products-doc-actions,
.products-row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.products-product-group {
  display: inline-flex;
  max-width: 180px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-strong);
  background: var(--surface-soft);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1.2;
}

.products-vehicle-list {
  display: inline-flex;
  max-width: 260px;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.products-vehicle-list span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.erp-doc-icon i,
.erp-type-icon i {
  color: var(--accent);
  font-size: 18px;
}

.erp-price-profit {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  white-space: nowrap;
}

.erp-price-profit small {
  color: var(--success);
  font-weight: 800;
}

.products-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.erp-page-numbers {
  display: inline-flex;
  gap: 6px;
}

.erp-page-center {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: min(360px, 100%);
}

.erp-page-summary {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.erp-page-size {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.erp-page-number,
.erp-page-arrow,
.products-pagination select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
}

.erp-page-number {
  min-width: 36px;
}

.erp-page-number.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.erp-page-arrow {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0 14px;
}

.erp-page-arrow:disabled,
.erp-page-number:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.products-pagination select {
  padding: 0 12px;
}

.erp-document-viewer {
  min-width: min(720px, calc(100vw - 64px));
}

.erp-document-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: center;
}

.erp-document-preview > i {
  color: var(--accent);
  font-size: 46px;
}

.erp-document-page {
  width: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-strong);
}

.erp-document-viewer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.products-modal-panel {
  width: min(1120px, 96vw);
  gap: 18px;
}

.products-modal-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34%),
    var(--surface-soft);
}

.products-modal-hero-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-soft);
}

.products-modal-hero-icon i {
  font-size: 28px;
}

.products-modal-hero span,
.products-modal-section p {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.products-modal-hero h4,
.products-modal-section h4 {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--fs-lg);
}

.products-modal-hero p {
  max-width: 720px;
  margin: 4px 0 8px;
  color: var(--muted);
}

.products-modal-hero strong {
  color: var(--text-strong);
}

.products-modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.products-modal-summary span {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: var(--fs-sm);
}

.products-modal-summary b {
  color: var(--text-strong);
}

.products-modal-form,
.products-modal-section {
  display: grid;
  gap: 16px;
}

.products-modal-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
}

.products-modal-section > div:first-child {
  display: grid;
  gap: 4px;
}

.products-modal-section p {
  margin: 0;
}

.products-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.products-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

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

.products-field input,
.products-field select,
.products-field textarea,
.bom-line input,
.bom-line select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-soft);
  padding: 0 12px;
  font: inherit;
}

.products-field textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

.products-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding-top: 4px;
}

.warehouse-action-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.warehouse-action-row .erp-icon-button {
  width: 34px;
  height: 34px;
}

.warehouse-materials-card {
  border-left: 4px solid var(--accent);
}

#erp-secondary-content.warehouse-single-column,
.sync-card-grid.warehouse-single-column,
.warehouse-single-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px;
  width: 100%;
}

.warehouse-full-width-card {
  width: 100%;
}

.warehouse-primary-table-hidden {
  display: none;
}

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

.warehouse-card-head h3 {
  margin: 0;
}

.warehouse-card-head p,
.warehouse-finished-card p,
.warehouse-materials-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.warehouse-finished-description {
  display: block;
  max-width: none;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.warehouse-table-card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.warehouse-table-tools {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.warehouse-finished-shell {
  overflow-x: hidden;
}

.warehouse-finished-table {
  table-layout: fixed;
  min-width: 0;
}

.warehouse-finished-table th,
.warehouse-finished-table td {
  position: relative;
  padding: 10px 8px;
  overflow: hidden;
  text-align: center !important;
  vertical-align: middle;
}

.warehouse-finished-table th:not([data-column="name"]),
.warehouse-finished-table td:not(.warehouse-finished-name) {
  text-align: center !important;
}

.warehouse-finished-table .warehouse-finished-name {
  text-align: left !important;
}

.warehouse-materials-table th,
.warehouse-materials-table td {
  padding: 10px 8px;
  text-align: center;
}

.warehouse-materials-table {
  table-layout: fixed;
  min-width: 0;
}

.warehouse-materials-table th,
.warehouse-materials-table td {
  overflow: hidden;
}

.warehouse-materials-table th:nth-child(1),
.warehouse-materials-table td:nth-child(1) {
  width: 82px;
}

.warehouse-materials-table th:nth-child(2),
.warehouse-materials-table td:nth-child(2) {
  width: 132px;
}

.warehouse-materials-table th:nth-child(3) {
  text-align: center;
}

.warehouse-materials-table td:nth-child(3) {
  text-align: left;
  overflow-wrap: anywhere;
}

.warehouse-materials-table th:nth-child(4),
.warehouse-materials-table td:nth-child(4) {
  width: 82px;
}

.warehouse-materials-table th:nth-child(5),
.warehouse-materials-table td:nth-child(5) {
  width: 70px;
}

.warehouse-materials-table th:nth-child(6),
.warehouse-materials-table td:nth-child(6) {
  width: 48px;
}

.warehouse-materials-table th:nth-child(7),
.warehouse-materials-table td:nth-child(7),
.warehouse-materials-table th:nth-child(8),
.warehouse-materials-table td:nth-child(8),
.warehouse-materials-table th:nth-child(9),
.warehouse-materials-table td:nth-child(9),
.warehouse-materials-table th:nth-child(10),
.warehouse-materials-table td:nth-child(10) {
  width: 64px;
}

.warehouse-materials-table th:nth-child(11),
.warehouse-materials-table td:nth-child(11) {
  width: 96px;
}

.warehouse-materials-card .erp-table-shell {
  overflow-x: hidden;
}

.warehouse-column-resizer {
  position: absolute;
  inset: 0 -3px 0 auto;
  width: 7px;
  cursor: col-resize;
}

.warehouse-column-resizer::after {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 3px;
  width: 1px;
  content: "";
  background: color-mix(in srgb, var(--accent), transparent 55%);
  opacity: 0;
}

.warehouse-finished-table th:hover .warehouse-column-resizer::after {
  opacity: 1;
}

.warehouse-finished-table th:nth-child(1),
.warehouse-finished-table td:nth-child(1) {
  width: 82px;
}

.warehouse-finished-table th:nth-child(2),
.warehouse-finished-table td:nth-child(2) {
  width: auto;
}

.warehouse-finished-table th:nth-child(3),
.warehouse-finished-table td:nth-child(3) {
  width: 80px;
}

.warehouse-finished-table th:nth-child(4),
.warehouse-finished-table td:nth-child(4) {
  width: 54px;
}

.warehouse-finished-table th:nth-child(5),
.warehouse-finished-table td:nth-child(5),
.warehouse-finished-table th:nth-child(6),
.warehouse-finished-table td:nth-child(6),
.warehouse-finished-table th:nth-child(7),
.warehouse-finished-table td:nth-child(7),
.warehouse-finished-table th:nth-child(8),
.warehouse-finished-table td:nth-child(8) {
  width: 58px;
}

.warehouse-finished-table th:nth-child(9),
.warehouse-finished-table td:nth-child(9) {
  width: 134px;
}

.warehouse-finished-table th:nth-child(10),
.warehouse-finished-table td:nth-child(10) {
  width: 118px;
}

.warehouse-finished-name strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.warehouse-finished-table input[name="physical_qty"],
.warehouse-finished-table input[name="reserved_qty"],
.warehouse-finished-table input[name="min_stock_qty"] {
  width: 4ch;
  min-width: 4ch;
  min-height: 32px;
  padding: 0 4px;
  text-align: center;
}

.warehouse-static-number {
  color: var(--text-strong);
  font-weight: 800;
  text-align: center;
}

.warehouse-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
  white-space: nowrap;
}

.warehouse-stepper button {
  display: inline-grid;
  width: 18px;
  height: 30px;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.warehouse-stepper input {
  width: 4ch;
  min-width: 4ch;
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 8px;
}

.warehouse-stepper button:first-child {
  border-radius: 8px 0 0 8px;
}

.warehouse-stepper button:last-child {
  border-radius: 0 8px 8px 0;
}

.warehouse-shortage-signal {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 10px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
  font-size: var(--fs-xxs);
  font-weight: 800;
}

.warehouse-settings-modal p {
  margin-top: 0;
  color: var(--muted);
}

.warehouse-settings-list {
  display: grid;
  gap: 12px;
}

.warehouse-column-switch-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.warehouse-column-switch-grid .products-modal-footer {
  grid-column: 1 / -1;
}

.warehouse-settings-check,
.warehouse-filter-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.warehouse-settings-check {
  grid-template-columns: auto 1fr;
}

.warehouse-filter-row {
  position: relative;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
}

.warehouse-filter-search {
  position: relative;
}

.warehouse-filter-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.warehouse-filter-results:empty {
  display: none;
}

.warehouse-filter-results button,
.warehouse-filter-results span {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.warehouse-filter-results button:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.warehouse-filter-row input,
.warehouse-filter-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  padding: 0 10px;
}

.warehouse-add-filter {
  display: grid;
  width: 100%;
  min-height: 54px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--accent), transparent 35%);
  border-radius: 16px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 24px;
  cursor: pointer;
}

.warehouse-add-filter:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.warehouse-toggle-switch {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.warehouse-toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.warehouse-toggle-slider {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.warehouse-toggle-slider::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  content: "";
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}

.warehouse-toggle-switch input:checked + .warehouse-toggle-slider {
  background: #22c55e;
}

.warehouse-toggle-switch input:checked + .warehouse-toggle-slider::after {
  transform: translateX(18px);
}

.erp-generic-table-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.warehouse-card-head > i {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-soft);
  font-size: 26px;
}

.warehouse-receipt-form {
  display: grid;
  gap: 14px;
}

.warehouse-receipt-row {
  display: grid;
  gap: 12px;
  align-items: end;
}

.warehouse-receipt-row.main-row {
  grid-template-columns: 1.1fr 0.8fr minmax(220px, 1.8fr) 88px 104px 90px 0.8fr 108px;
}

.warehouse-receipt-row.supplier-row {
  grid-template-columns: 150px minmax(220px, 1.4fr) 170px 1fr 1fr auto;
}

.warehouse-receipt-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.warehouse-receipt-form input,
.warehouse-receipt-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-soft);
  padding: 0 12px;
  font: inherit;
}

.warehouse-receipt-form .warehouse-search-input {
  appearance: textfield;
  background-image: linear-gradient(90deg, transparent, transparent);
}

.warehouse-receipt-form .warehouse-search-input::-webkit-calendar-picker-indicator {
  display: none !important;
}

.warehouse-receipt-footer {
  display: flex;
  align-items: end;
}

.warehouse-pagination {
  border-top: 0;
  border-radius: 0;
}

.warehouse-materials-table input,
#erp-table-body input {
  width: 96px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-soft);
  padding: 0 9px;
}

@media (max-width: 960px) {
  .warehouse-receipt-row,
  .warehouse-receipt-row.main-row,
  .warehouse-receipt-row.details-row,
  .warehouse-receipt-row.supplier-row {
    grid-template-columns: 1fr;
  }
}

.erp-button-primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.products-doc-list {
  display: grid;
  gap: 12px;
}

.product-doc-line {
  display: grid;
  grid-template-columns: auto 150px minmax(220px, 1fr) 140px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.products-doc-line-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--surface-strong);
}

.products-doc-line-icon i {
  font-size: 22px;
}

.products-bom-table {
  display: grid;
  gap: 8px;
}

.products-bom-head,
.bom-line {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) 110px 90px 110px 150px;
  gap: 10px;
  align-items: center;
}

.products-bom-head {
  padding: 0 12px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.bom-line {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

@media (max-width: 820px) {
  .products-modal-summary,
  .products-modal-grid,
  .product-doc-line,
  .products-bom-head,
  .bom-line {
    grid-template-columns: 1fr;
  }

  .products-bom-head {
    display: none;
  }
}

.erp-dropdown-panel h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--fs-base);
}

.erp-dropdown-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.erp-dropdown-panel input,
.erp-dropdown-panel select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-soft);
}

.erp-notification-item,
.erp-profile-panel a,
.erp-profile-panel button {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.erp-notification-item:hover,
.erp-profile-panel a:hover,
.erp-profile-panel button:hover {
  background: var(--accent-soft);
}

.erp-notification-item i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.erp-notification-item span {
  display: grid;
  gap: 2px;
}

.erp-notification-item small,
.erp-profile-panel p {
  color: var(--muted);
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: var(--space-4);
}

.erp-sidebar .nav-toggle {
  width: 100%;
  margin-bottom: var(--space-4);
}

.brand strong {
  color: var(--text-strong);
  font-size: var(--fs-xl);
  letter-spacing: -0.03em;
}

.brand span,
.nav-label {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.nav-group {
  margin-bottom: 14px;
}

.nav-group-title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group[data-group-collapsed] .nav-submenu {
  display: none;
}

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

.nav-item {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 16px;
  font-weight: var(--weight-medium);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item.active,
.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: clamp(18px, 2.6vw, 36px);
}

.erp-page-header {
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
}

.erp-page-header h1 {
  margin: 4px 0 0;
  color: var(--text-strong);
  font-size: clamp(22px, 2.4vw, 30px);
}

.erp-breadcrumbs,
.erp-page-actions {
  gap: var(--space-2);
  flex-wrap: wrap;
}

.erp-breadcrumbs {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.erp-breadcrumbs a {
  color: var(--accent-strong);
  text-decoration: none;
}

.erp-breadcrumbs span::before {
  margin-right: var(--space-2);
  color: var(--muted);
  content: "/";
}

.erp-cabinet-footer {
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.shell[data-nav-collapsed] {
  grid-template-columns: 88px minmax(0, 1fr);
}

.shell[data-nav-collapsed] .brand span,
.shell[data-nav-collapsed] .theme-switcher,
.shell[data-nav-collapsed] .nav-group-title span,
.shell[data-nav-collapsed] .nav-label,
.shell[data-nav-collapsed] .nav-collapse-toggle span {
  display: none;
}

.shell[data-nav-collapsed] .sidebar {
  padding-inline: 14px;
}

.shell[data-nav-collapsed] .nav-item {
  justify-content: center;
}

.erp-unified-page {
  display: grid;
  gap: var(--space-5);
}

.mobile-topbar,
.nav-overlay {
  display: none;
}

.nav-collapse-toggle,
.erp-button,
.erp-icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-collapse-toggle:hover,
.erp-button:hover,
.erp-icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.theme-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: var(--space-4);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.theme-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: var(--fs-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.theme-switcher button.active {
  color: var(--accent-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.nav-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: var(--space-4);
}

.public-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-6);
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px;
  margin-bottom: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
}

.public-brand,
.public-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.public-brand,
.public-nav a {
  color: var(--text);
  text-decoration: none;
}

.public-brand {
  font-weight: var(--weight-bold);
}

.public-brand span {
  color: var(--muted);
  font-weight: var(--weight-medium);
}

.public-page {
  display: grid;
  gap: var(--space-5);
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: var(--space-5);
  align-items: stretch;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface-strong), var(--surface-glass));
  box-shadow: var(--shadow-glow);
}

.public-hero h1 {
  max-width: 780px;
  margin-bottom: var(--space-3);
  color: var(--text-strong);
  font-size: clamp(34px, 6vw, 68px);
  line-height: var(--lh-tight);
  letter-spacing: -0.055em;
}

.public-hero p {
  max-width: 720px;
  font-size: var(--fs-lg);
}

.public-actions,
.public-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.public-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.public-demo-card {
  display: grid;
  align-content: end;
  min-height: 260px;
  padding: var(--space-5);
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(150deg, #2563eb, #7c3aed);
  box-shadow: var(--shadow-md);
}

.public-demo-card span {
  opacity: 0.82;
}

.public-demo-card strong {
  margin: 8px 0;
  font-size: var(--fs-xl);
}

.public-demo-card p {
  color: rgba(255, 255, 255, 0.78);
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.public-card i {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-3);
  border-radius: 16px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 22px;
}

.public-section {
  display: grid;
  gap: var(--space-4);
}

.public-form {
  display: grid;
  gap: var(--space-3);
}

.public-form label {
  display: grid;
  gap: 6px;
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
}

.public-form input,
.public-form select,
.public-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-strong);
}

.public-form textarea {
  min-height: 120px;
  resize: vertical;
}

.public-form-result {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--success-soft);
}

.public-form-result pre {
  overflow: auto;
  max-height: 260px;
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
}
