﻿:root {
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  background: #f6f7fb;
  color: #111;
}

.top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e7e7ef;
  position: sticky;
  top: 0;
}

.brand {
  font-weight: 800;
  letter-spacing: 1px;
  color: #d40000;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  text-decoration: none;
  color: #333;
}

.nav a:hover {
  text-decoration: underline;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  background: #f1f3fb;
  border: 1px solid #e1e5f5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.auth-link {
  text-decoration: none;
  color: #2e9f72;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 980px;
  margin: 22px auto;
  padding: 0 18px;
}

.foot {
  margin-top: 24px;
  padding: 18px;
  text-align: center;
  color: #667085;
}

code {
  background: #fff;
  padding: 2px 6px;
  border: 1px solid #e7e7ef;
  border-radius: 6px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e7e7ef;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-label {
  margin: 0 0 10px;
  color: #5f6672;
  font-size: 14px;
}

.stat-value {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.table-card {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e7e7ef;
  border-radius: 12px;
  overflow: hidden;
}

.orders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}

.orders-main .table-card {
  margin-top: 0;
}

.photo-cell {
  width: 82px;
}

.order-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d9dce8;
  background: #fff;
}

.no-photo {
  width: 64px;
  min-height: 64px;
  border-radius: 8px;
  border: 1px dashed #c8cedf;
  background: #f7f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 4px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eef0f5;
}

.orders-table th {
  background: #f8f9fc;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #5f6672;
}

.orders-table tbody tr:hover {
  background: #fafbff;
}

.side-tabs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #1f2937;
  border: 1px solid #d9dce8;
  border-radius: 10px;
  background: #fff;
}

.tab:hover {
  border-color: #8f9aa5;
  background: #f9fafe;
}

.tab.active {
  color: #fff;
  background: #2e9f72;
  border-color: #2e9f72;
}

.scanner-card {
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 12px;
  padding: 12px;
}

.scanner-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.scanner-card form {
  display: grid;
  gap: 8px;
}

.scanner-card input {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  padding: 10px 12px;
}

.scanner-card button {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2e9f72;
  color: #fff;
  cursor: pointer;
}

.scanner-card button:hover {
  background: #257a58;
}

.scanner-result {
  margin-top: 8px;
  min-height: 22px;
  font-size: 14px;
}

.scanner-result.ok {
  color: #067647;
}

.scanner-result.error {
  color: #b42318;
}

.empty-row {
  text-align: center;
  color: #64748b;
}

.orders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

/* Supplies */
.supplies-page {
  display: grid;
  gap: 14px;
}

.supplies-header h1 {
  margin: 0;
}

.supplies-mp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplies-loader-card {
  padding: 14px;
}

.supplies-loader-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto auto;
  align-items: end;
  gap: 10px;
}

.supplies-field {
  display: grid;
  gap: 6px;
}

.supplies-field span {
  font-size: 12px;
  opacity: 0.85;
}

.supplies-field input {
  height: 40px;
}

.supplies-loader-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.supplies-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.supplies-archive-link {
  white-space: nowrap;
}

.supplies-body-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.supplies-history-card {
  padding: 12px;
}

.supplies-history-card h3 {
  margin: 0;
  font-size: 16px;
}

.supplies-history-head,
.supplies-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.supplies-history-head {
  margin-bottom: 10px;
}

.supplies-history-list {
  display: grid;
  gap: 8px;
}

.supplies-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.supplies-history-item {
  width: 100%;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--border, #37507a);
  background: var(--surface-2, #1f2f4d);
  color: inherit;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.supplies-history-item.active {
  border-color: rgba(74, 222, 128, 0.7);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.supplies-history-item strong {
  font-size: 14px;
}

.supplies-history-item span {
  font-size: 12px;
  opacity: 0.9;
}

.supplies-history-archive,
.supplies-history-pill {
  min-width: 82px;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.supplies-history-archive-form {
  display: flex;
}

.supplies-history-archive {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
}

.supplies-history-archive:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.supplies-history-pill {
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
  color: #7ee7a8;
}

.supplies-history-toggle {
  white-space: nowrap;
}

.supplies-archive-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #37507a);
  display: grid;
  gap: 8px;
}

.supplies-main-column {
  display: grid;
  gap: 12px;
}

.supplies-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.supplies-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplies-subtabs .tab {
  cursor: pointer;
}

.supplies-tab-panel {
  padding: 10px;
}

.supplies-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
}

.supplies-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.supplies-table th,
.supplies-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border, #37507a);
  text-align: left;
  vertical-align: middle;
}

.supplies-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.supplies-table td {
  overflow: visible;
}

.supplies-empty {
  text-align: center;
  opacity: 0.8;
  padding: 16px 10px;
}

.supplies-thumb-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  z-index: 1;
}

.supplies-thumb-wrap:hover {
  z-index: 130;
}

.supplies-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: #fff;
  border: 1px solid var(--border, #37507a);
}

.supplies-thumb-preview {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  border-radius: 14px;
  border: 1px solid var(--border, #37507a);
  background: var(--surface-2, #1f2f4d);
  box-shadow: var(--shadow, 0 18px 40px rgba(5, 10, 25, 0.35));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  overflow: hidden;
  padding: 10px;
}

.supplies-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

.supplies-thumb-wrap:hover .supplies-thumb-preview {
  display: flex;
}

.supplies-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px dashed var(--border, #37507a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0.8;
}

.supplies-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 44px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(62, 207, 142, 0.26);
  background: rgba(62, 207, 142, 0.08);
  color: var(--text, #f3f5f7);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.supplies-qty-input,
.supplies-dim-input {
  width: 100%;
  min-width: 90px;
  max-width: 120px;
  height: 34px;
  border-radius: 8px;
}

.supplies-employee {
  font-size: 13px;
}

.supplies-wb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.small-btn {
  min-width: 94px;
  height: 34px;
}

.supplies-sticker-btn {
  min-width: 138px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .supplies-body-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .supplies-loader-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .supplies-summary-grid {
    grid-template-columns: 1fr;
  }
}

.orders-list {
  display: grid;
  gap: 10px;
}

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

.orders-head h1 {
  margin: 0;
}

.orders-total {
  background: #f3f5f7;
  border: 1px solid #bce8d2;
  color: #2e9f72;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.orders-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.orders-view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.orders-view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-view-btn {
  border: 1px solid #d4d8e5;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
}

.orders-view-btn:hover {
  border-color: #8f9aa5;
  background: #f8faff;
}

.orders-view-btn.active {
  color: #fff;
  background: #2e9f72;
  border-color: #2e9f72;
}

.orders-view-summary {
  font-size: 13px;
  color: #475467;
  background: #f8f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.orders-search-input {
  width: 100%;
  border: 1px solid #d4d8e5;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.orders-search-input:focus {
  outline: none;
  border-color: #56d99b;
  box-shadow: 0 0 0 3px rgba(51, 171, 113, 0.12);
}

.orders-search-clear {
  border: 1px solid #d4d8e5;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
}

.orders-search-clear:hover {
  border-color: #8f9aa5;
  background: #f8faff;
}

.orders-search-count {
  color: #475467;
  font-size: 13px;
  white-space: nowrap;
}

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

.group-card {
  background: #fff;
  border: 1px solid #dfe3f1;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(23, 33, 28, 0.05);
  overflow: hidden;
}

.group-head {
  display: grid;
  grid-template-columns: auto 86px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
}

.group-toggle {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  min-height: 34px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.group-toggle:hover {
  border-color: #8f9aa5;
  background: #f8faff;
}

.group-photo {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-main {
  min-width: 0;
}

.group-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.group-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: #475467;
  font-size: 13px;
}

.group-bundle-panel {
  margin-top: 10px;
}

.group-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.group-status {
  font-size: 12px;
  color: #667085;
  min-height: 18px;
  line-height: 1.3;
}

.group-status.ok {
  color: #067647;
}

.group-status.err {
  color: #b42318;
}

.group-status.muted {
  color: #667085;
}

.group-body {
  border-top: 1px solid #e8ecf7;
  padding: 10px 12px 12px;
  display: none;
  gap: 8px;
}

.group-card.open .group-body {
  display: grid;
}

.group-order-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #fbfcff;
}

.group-order-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-thumb-sm {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.no-photo-sm {
  width: 58px;
  min-height: 58px;
  border-radius: 10px;
}

.group-order-mid {
  min-width: 0;
}

.group-order-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.group-order-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: #475467;
  font-size: 13px;
}

.barcode-img-sm {
  width: 180px;
  height: 40px;
}

.group-order-right {
  display: grid;
  gap: 6px;
  align-content: start;
}

.scan-group-dialog {
  max-width: 760px;
}

.scan-group-meta {
  margin-bottom: 10px;
  background: #f8f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
}

.scan-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.similar-sku-panel {
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #dfe3f1;
  border-radius: 12px;
  padding: 10px;
}

.similar-sku-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

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

.similar-sku-count {
  font-size: 12px;
  color: #475467;
  background: #f8f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 8px;
}

.similar-sku-list {
  display: grid;
  gap: 8px;
}

.similar-sku-group {
  border: 1px solid #e5e9f4;
  border-radius: 10px;
  padding: 8px;
  background: #fbfcff;
  display: grid;
  gap: 8px;
}

.similar-sku-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.similar-sku-row {
  border: 1px solid #e5e9f4;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.similar-sku-info {
  font-size: 13px;
  color: #334155;
  line-height: 1.35;
  word-break: break-word;
}

.similar-sku-actions {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 110px;
}

.similar-sku-status {
  font-size: 12px;
  min-height: 16px;
  color: #667085;
}

.similar-sku-status.ok {
  color: #067647;
}

.similar-sku-status.err {
  color: #b42318;
}

.similar-sku-status.muted {
  color: #667085;
}

.order-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dfe3f1;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(23, 33, 28, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.order-card:hover {
  transform: translateY(-1px);
  border-color: #cbe1d6;
  box-shadow: 0 8px 22px rgba(23, 33, 28, 0.08);
}

.order-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-wrap {
  position: relative;
  width: 84px;
  height: 84px;
}

.order-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d9dce8;
  background: #fff;
}

.thumb-preview {
  position: absolute;
  top: -8px;
  left: 94px;
  width: 220px;
  height: 220px;
  border-radius: 16px;
  border: 1px solid #d3d8e8;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 33, 28, 0.18);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transform-origin: top left;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 40;
}

.thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.thumb-wrap:hover .thumb-preview {
  opacity: 1;
  transform: scale(1);
}

.no-photo {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 1px dashed #c8cedf;
  background: #f7f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 4px;
}

.order-mid {
  min-width: 0;
}

.order-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 7px;
  color: #475467;
  font-size: 13px;
}

.meta-item {
  white-space: nowrap;
}

.sku-link {
  color: #2e9f72;
  text-decoration: none;
  font-weight: 600;
}

.sku-link:hover {
  text-decoration: underline;
}

.sku-ext {
  font-size: 12px;
}

.barcode-box {
  margin-top: 7px;
}

.barcode-img {
  width: 220px;
  max-width: 100%;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e1e5f2;
  border-radius: 8px;
  padding: 2px 6px;
}

.barcode-code {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #5f6672;
}

.order-right {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.badge.status {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}

.badge.status.completed {
  background: rgba(53, 196, 137, 0.18);
  border: 1px solid rgba(53, 196, 137, 0.54);
  color: #d6ffee;
}

.badge.status.in-progress,
.badge.status.err {
  background: rgba(255, 122, 139, 0.16);
  border: 1px solid rgba(255, 122, 139, 0.44);
  color: #ffd7dc;
}

.badge.mp {
  background: #f3f5f7;
  border: 1px solid #bce8d2;
  color: #2e9f72;
}

.order-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}

.print-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
}

.copies-select {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 8px;
  background: #fff;
  color: #1f2937;
}

.copies-select:focus {
  outline: none;
  border-color: #56d99b;
  box-shadow: 0 0 0 2px rgba(51, 171, 113, 0.12);
}

.card-print-status {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.3;
}

.card-print-status.ok {
  color: #067647;
}

.card-print-status.err {
  color: #b42318;
}

.card-print-status.muted {
  color: #667085;
}

.order-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  background: #2e9f72;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.order-btn:hover {
  background: #257a58;
}

.order-btn.disabled,
.order-btn:disabled {
  cursor: default;
  background: #c8cfde;
  color: #4b5565;
}

.orders-empty {
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #64748b;
}

.scanner-box {
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 12px;
  padding: 12px;
}

.scanner-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.print-options {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.autoprint-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  color: #334155;
  font-size: 13px;
  user-select: none;
}

.autoprint-toggle input {
  width: 16px;
  height: 16px;
}

.scanner-controls {
  display: grid;
  gap: 8px;
}

.scanner-controls input {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  padding: 10px 12px;
}

.scanner-controls input.scan-input-error {
  border-color: #be123c;
  box-shadow: 0 0 0 2px rgba(190, 18, 60, 0.15);
}

.scanner-controls button {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2e9f72;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.scanner-controls button:hover {
  background: #257a58;
}

.scan-status {
  margin-top: 8px;
  min-height: 22px;
  font-size: 14px;
  color: #475467;
}

.scan-status.ok {
  color: #067647;
}

.scan-status.err {
  color: #b42318;
}

.scan-status.muted {
  color: #667085;
}

.last-found {
  margin-top: 8px;
  border: 1px solid #e5e9f4;
  border-radius: 10px;
  background: #f8f9fc;
  padding: 8px 10px;
  font-size: 13px;
  color: #475467;
  display: grid;
  gap: 6px;
}

.last-found-title {
  font-weight: 700;
  color: #17211c;
}

.last-found-line {
  line-height: 1.3;
  word-break: break-word;
}

.last-found-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.last-found-link {
  color: #2e9f72;
  text-decoration: none;
  font-weight: 600;
}

.last-found-link:hover {
  text-decoration: underline;
}

.scan-match-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 34, 29, 0.45);
  z-index: 120;
  padding: 16px;
}

.scan-match-modal.open {
  display: flex;
}

.scan-match-dialog {
  width: min(760px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #e1e5f2;
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(23, 34, 29, 0.25);
  padding: 12px;
}

.scan-match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.scan-match-head h3 {
  margin: 0;
  font-size: 18px;
}

.scan-match-close {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 600;
}

.scan-match-close:hover {
  border-color: #8f9aa5;
  background: #f8faff;
}

.scan-match-list {
  display: grid;
  gap: 8px;
}

.scan-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.scan-match-info {
  min-width: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.scan-match-title {
  margin-top: 5px;
  font-weight: 700;
  color: #17221d;
  word-break: break-word;
}

.scan-match-actions {
  display: grid;
  gap: 6px;
  min-width: 108px;
}

.label-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 34, 29, 0.56);
  z-index: 140;
  padding: 16px;
}

.label-preview-modal.open {
  display: flex;
}

.label-preview-dialog {
  width: min(840px, 96vw);
  max-height: 86vh;
  background: #fff;
  border: 1px solid #d9e1f4;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(23, 34, 29, 0.35);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.label-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.label-preview-head h3 {
  margin: 0;
  font-size: 18px;
}

.label-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-preview-body {
  min-height: 360px;
  max-height: calc(86vh - 120px);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.label-preview-frame,
.label-preview-image {
  display: none;
  width: 100%;
  height: 100%;
}

.label-preview-frame.active,
.label-preview-image.active {
  display: block;
}

.label-preview-frame {
  min-height: 360px;
  border: none;
}

.label-preview-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(86vh - 150px);
  object-fit: contain;
}

.label-preview-meta {
  font-size: 13px;
  color: #475467;
}

.highlight {
  animation: orderFlash 2.6s ease;
}

.search-hidden {
  display: none !important;
}

@keyframes orderFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(51, 171, 113, 0.45);
    border-color: #60c293;
  }
  40% {
    box-shadow: 0 0 0 4px rgba(51, 171, 113, 0.24);
  }
  100% {
    box-shadow: 0 2px 8px rgba(23, 33, 28, 0.05);
    border-color: #dfe3f1;
  }
}

.auth-card {
  max-width: 420px;
  margin: 24px auto;
  background: #fff;
  border: 1px solid #e7e7ef;
  border-radius: 14px;
  padding: 18px;
}

.auth-card h1 {
  margin-top: 0;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form input {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  padding: 10px 12px;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-field input {
  flex: 1;
}

.password-toggle {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover {
  border-color: #94a3b8;
}

.password-toggle.active {
  border-color: #2e9f72;
  color: #2e9f72;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-form button {
  margin-top: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2e9f72;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.auth-form button:hover {
  background: #257a58;
}

.form-error {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  border-radius: 8px;
  padding: 8px 10px;
  color: #b42318;
}

.settings-card {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e7e7ef;
  border-radius: 12px;
  padding: 18px;
}

.settings-card h2 {
  margin-top: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-tab {
  display: block;
  padding: 10px 12px;
  border: 1px solid #d9dce8;
  border-radius: 10px;
  text-decoration: none;
  color: #1f2937;
  background: #fff;
}

.settings-tab:hover {
  border-color: #8f9aa5;
  background: #f9fafe;
}

.settings-tab.active {
  color: #fff;
  background: #2e9f72;
  border-color: #2e9f72;
}

.settings-content .settings-card {
  margin-top: 0;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.settings-actions form {
  margin: 0;
}

.settings-actions button {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2e9f72;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.settings-actions button:hover {
  background: #257a58;
}

.wb-result {
  margin-top: 12px;
  background: #f8f9fc;
  border: 1px solid #e7e7ef;
  border-radius: 10px;
  padding: 10px 12px;
}

.wb-result p {
  margin: 6px 0;
}

.settings-history-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.settings-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.settings-history-table th,
.settings-history-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7e7ef;
  text-align: left;
  vertical-align: top;
}

.settings-history-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.settings-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.settings-status-badge.status-active {
  color: #176c49;
  background: rgba(33, 151, 100, 0.1);
  border-color: rgba(33, 151, 100, 0.24);
}

.settings-status-badge.status-ready {
  color: #475467;
  background: rgba(71, 85, 105, 0.08);
  border-color: rgba(148, 163, 184, 0.28);
}

.settings-status-badge.status-uploaded {
  color: #475467;
  background: rgba(71, 85, 105, 0.08);
  border-color: rgba(148, 163, 184, 0.28);
}

.settings-status-badge.status-archived {
  color: #7c5d1a;
  background: rgba(217, 164, 65, 0.12);
  border-color: rgba(217, 164, 65, 0.28);
}

.settings-status-badge.status-invalid {
  color: #b42318;
  background: rgba(210, 77, 92, 0.1);
  border-color: rgba(210, 77, 92, 0.28);
}

.settings-status-badge.status-error {
  color: #b42318;
  background: rgba(210, 77, 92, 0.1);
  border-color: rgba(210, 77, 92, 0.28);
}

.settings-inline-form {
  margin: 0;
}

.settings-inline-form button {
  min-width: 132px;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: #2e9f72;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.settings-inline-form button:hover {
  background: #257a58;
}

.flash {
  border-radius: 8px;
  padding: 10px 12px;
}

.flash-success {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}

.flash-error {
  background: #fff1f3;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.employee-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.employee-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.employee-form input {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  padding: 10px 12px;
}

.employee-form button,
.small-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  background: #2e9f72;
  color: #fff;
  cursor: pointer;
}

.employee-form button:hover,
.small-btn:hover {
  background: #257a58;
}

.danger-btn {
  background: #b42318;
}

.danger-btn:hover {
  background: #912018;
}

.employee-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.employee-actions form {
  margin: 0;
}

.employee-password-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.employee-password-form .password-field {
  min-width: 180px;
}

.employees-table-card {
  margin-top: 0;
}

@media (max-width: 900px) {
  .top {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-right {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
  }

  .orders-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: -1;
  }

  .side-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .order-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
  }

  .orders-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .orders-search-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .group-head {
    grid-template-columns: 1fr;
  }

  .group-actions {
    grid-template-columns: 1fr;
  }

  .group-order-row {
    grid-template-columns: 1fr;
  }

  .group-order-right {
    grid-template-columns: 1fr 1fr;
  }

  .scan-group-actions {
    flex-direction: column;
  }

  .similar-sku-row {
    grid-template-columns: 1fr;
  }

  .order-right {
    grid-column: 1 / -1;
    align-items: stretch;
  }

  .badges {
    justify-content: flex-start;
  }

  .order-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .print-controls {
    grid-template-columns: 1fr;
  }

  .order-btn {
    flex: 1;
  }

  .thumb-preview {
    display: none;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .employee-password-form {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-match-item {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-match-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .label-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tsd-page {
  display: grid;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.tsd-head {
  display: grid;
  gap: 4px;
}

.tsd-head h1 {
  margin: 0;
  font-size: 34px;
}

.tsd-head p {
  margin: 0;
  color: #c0dccf;
  font-size: 16px;
}

.tsd-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tsd-mode-btn {
  min-height: 52px;
  border: 1px solid #3f587f;
  border-radius: 12px;
  background: #2b5641;
  color: #e6f0ff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.tsd-mode-btn.active {
  background: #407e60;
  border-color: #98cdb4;
  color: #ffffff;
}

.tsd-panel {
  border: 1px solid #3b6e56;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(45, 65, 55, 0.8), rgba(39, 57, 48, 0.75));
  padding: 14px;
  display: grid;
  gap: 10px;
}

.tsd-order-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.tsd-photo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  border: 1px solid #3f587f;
  background: #18221d;
  overflow: hidden;
}

.tsd-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.tsd-no-photo {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #b5d8c7;
}

.tsd-order-main {
  display: grid;
  gap: 8px;
}

.tsd-line {
  font-size: 22px;
  line-height: 1.3;
  color: #d8e7ff;
}

.tsd-line span {
  color: #aad1be;
}

.tsd-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.tsd-inventory-row {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 120px auto;
}

.tsd-input {
  min-height: 56px;
  border: 1px solid #4b6895;
  border-radius: 12px;
  background: #26372f;
  color: #f0f6ff;
  padding: 0 14px;
  font-size: 24px;
  font-weight: 600;
}

.tsd-input-small {
  min-width: 96px;
  text-align: center;
}

.tsd-btn {
  min-height: 56px;
  border: 1px solid #94d5b6;
  border-radius: 12px;
  background: #468969;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
}

.tsd-btn:hover {
  background: #509c78;
}

.tsd-btn-secondary {
  background: #33634c;
  border-color: #5d7eae;
}

.tsd-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid #40775d;
  background: rgba(27, 38, 33, 0.6);
}

.tsd-status.ok {
  color: #c5ffe9;
  border-color: rgba(53, 196, 137, 0.6);
  background: rgba(53, 196, 137, 0.16);
}

.tsd-status.err {
  color: #ffd9df;
  border-color: rgba(255, 122, 139, 0.65);
  background: rgba(255, 122, 139, 0.15);
}

.tsd-status.muted {
  color: #cde7db;
}

.tsd-result-card {
  border: 1px solid #478366;
  border-radius: 12px;
  background: rgba(27, 40, 34, 0.75);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.tsd-result-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.tsd-result-photo,
.tsd-result-no-photo {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  border: 1px solid #49658f;
}

.tsd-result-photo {
  object-fit: contain;
  background: #ffffff;
}

.tsd-result-no-photo {
  display: grid;
  place-items: center;
  color: #a8ccbb;
  font-size: 13px;
}

.tsd-result-main {
  display: grid;
  gap: 6px;
}

.tsd-result-title {
  font-size: 24px;
  font-weight: 700;
  color: #eff5ff;
}

.tsd-result-line {
  font-size: 20px;
  color: #d4e4fd;
}

@media (max-width: 900px) {
  .tsd-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tsd-input-row,
  .tsd-inventory-row {
    grid-template-columns: 1fr;
  }

  .tsd-order-card {
    grid-template-columns: 1fr;
  }

  .tsd-photo-wrap {
    width: 100px;
    height: 100px;
  }

  .tsd-line {
    font-size: 20px;
  }

  .tsd-input,
  .tsd-btn {
    min-height: 52px;
    font-size: 20px;
  }

  .tsd-status {
    font-size: 21px;
  }
}

@media (max-width: 640px) {
  .group-title {
    font-size: 20px;
  }

  .group-order-right {
    grid-template-columns: 1fr;
  }

  .order-card {
    grid-template-columns: 1fr;
  }

  .order-left {
    justify-content: flex-start;
  }

  .order-title {
    font-size: 15px;
  }

  .order-meta {
    gap: 8px 10px;
    font-size: 12px;
  }

  .barcode-img {
    width: 100%;
  }
}

/* Orders page v2 (flat cards + SKU duplicates modal) */
.orders-page-v2 .orders-main {
  min-width: 0;
}

.orders-list-v2 {
  display: grid;
  gap: 10px;
}

.order-card-v2 {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 250px;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dfe3f1;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(23, 33, 28, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.order-card-v2:hover {
  transform: translateY(-1px);
  border-color: #cbe1d6;
  box-shadow: 0 8px 22px rgba(23, 33, 28, 0.08);
}

.order-left-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-wrap-v2 {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.order-thumb-v2 {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid #d9dce8;
  background: #fff;
}

.no-photo-v2 {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 1px dashed #c8cedf;
  background: #f7f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 4px;
}

.thumb-preview-v2 {
  position: absolute;
  top: -8px;
  left: 94px;
  width: 340px;
  height: 340px;
  border-radius: 16px;
  border: 1px solid #d3d8e8;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 33, 28, 0.22);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transform-origin: top left;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 70;
}

.thumb-preview-v2 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.thumb-wrap-v2.preview-left .thumb-preview-v2 {
  left: auto;
  right: 94px;
}

.thumb-wrap-v2:hover .thumb-preview-v2 {
  opacity: 1;
  transform: scale(1);
}

.order-mid-v2 {
  min-width: 0;
}

.order-title-v2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.order-meta-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 7px;
  color: #475467;
  font-size: 13px;
}

.order-bundle-panel {
  margin-top: 10px;
}

.bundle-readonly-panel {
  border: 1px solid #d8dfeb;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.bundle-readonly-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.bundle-readonly-panel summary::-webkit-details-marker {
  display: none;
}

.bundle-readonly-panel[open] summary {
  border-bottom: 1px solid #d8dfeb;
  background: #f1f5f9;
}

.bundle-readonly-body {
  padding: 10px 12px 12px;
}

.bundle-readonly-note {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
}

.bundle-components-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.bundle-component-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  color: #334155;
}

.bundle-component-article {
  font-weight: 700;
  color: #111827;
}

.bundle-component-qty {
  color: #176c49;
  font-weight: 700;
}

.bundle-component-title {
  color: #475467;
}

.bundle-component-cell {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(33, 151, 100, 0.08);
  border: 1px solid rgba(33, 151, 100, 0.18);
  color: #176c49;
  font-size: 12px;
  font-weight: 700;
}

.order-badges-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.badge-bundle {
  background: rgba(30, 64, 175, 0.08);
  border: 1px solid rgba(30, 64, 175, 0.18);
  color: #1d4ed8;
}

.sku-dup-indicator {
  margin-left: 8px;
  border: 1px solid #bce8d2;
  background: #f3f5f7;
  color: #2e9f72;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.sku-dup-indicator:hover {
  border-color: #b9e5d0;
  background: #e7efff;
}

.order-right-v2 {
  display: grid;
  gap: 7px;
  align-content: start;
}

.order-print-buttons {
  display: grid;
  gap: 6px;
}

.order-card-v2 .card-print-status {
  min-height: 18px;
}

.sku-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.scan-match-item {
  align-items: start;
}

.scan-match-actions {
  min-width: 110px;
}

.group-status {
  margin-top: 8px;
  font-size: 12px;
  min-height: 18px;
}

.group-status.ok {
  color: #067647;
}

.group-status.err {
  color: #b42318;
}

.group-status.muted {
  color: #667085;
}

.print-settings-statuses {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.muted-note {
  color: #667085;
}

.print-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px 12px;
  margin: 10px 0 12px;
}

.setting-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-field select {
  border: 1px solid #d4d8e5;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
  background: #fff;
}

.assigned-printers {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8f9fc;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.assigned-printers p {
  margin: 4px 0;
}

.test-print-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) auto;
  align-items: end;
  gap: 10px;
}

@media (max-width: 1000px) {
  .order-card-v2 {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .order-right-v2 {
    grid-column: 1 / -1;
  }

  .order-badges-v2,
  .group-actions {
    justify-content: flex-start;
    justify-items: start;
  }
}

@media (max-width: 900px) {
  .orders-page-v2 .thumb-preview-v2 {
    display: none;
  }
}

@media (max-width: 640px) {
  .order-card-v2 {
    grid-template-columns: 1fr;
  }

  .order-left-v2 {
    justify-content: flex-start;
  }

  .print-settings-grid {
    grid-template-columns: 1fr;
  }

  .test-print-row {
    grid-template-columns: 1fr;
  }
}

/* Returns module */
.returns-page,
.return-detail-page,
.returns-analytics-page {
  display: grid;
  gap: 14px;
}

.returns-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.returns-head-form {
  display: inline-flex;
  margin: 0;
}

.returns-btn {
  min-height: 40px;
  border: 1px solid rgba(134, 216, 178, 0.62);
  border-radius: 12px;
  padding: 10px 18px;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(47, 87, 67, 0.96) 0%, rgba(34, 60, 47, 0.96) 100%);
  color: #f3fbff;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(10, 20, 16, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.returns-btn:hover {
  background: linear-gradient(180deg, rgba(58, 103, 79, 0.98) 0%, rgba(40, 74, 57, 0.98) 100%);
  border-color: rgba(176, 232, 206, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 26px rgba(10, 20, 16, 0.22);
  transform: translateY(-1px);
}

.returns-btn-primary {
  background: linear-gradient(180deg, #44b97f 0%, #2f8d61 100%);
  border-color: rgba(152, 234, 194, 0.96);
  color: #ffffff;
}

.returns-btn-primary:hover {
  background: linear-gradient(180deg, #4dc889 0%, #37996b 100%);
}

.returns-btn-secondary {
  background: linear-gradient(180deg, rgba(43, 63, 53, 0.98) 0%, rgba(31, 47, 39, 0.98) 100%);
}

.returns-btn-sm {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.returns-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.returns-action-form,
.returns-request-form {
  display: inline-flex;
  margin: 0;
}

.returns-action-note {
  margin-top: 6px;
  font-size: 12px;
  color: #b2d4c4;
}

.returns-delete-requests-card {
  padding: 12px;
}

.returns-delete-requests-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.returns-delete-requests-head h3 {
  margin: 0;
}

.returns-delete-requests-head p {
  margin: 4px 0 0;
  color: #b2d4c4;
  font-size: 13px;
}

.returns-delete-requests-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(121, 195, 159, 0.45);
  background: rgba(69, 127, 99, 0.22);
  color: #d7ffec;
  font-size: 13px;
  font-weight: 700;
}

.returns-delete-requests-list {
  display: grid;
  gap: 10px;
}

.returns-delete-request-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(84, 111, 155, 0.5);
  background: rgba(30, 42, 36, 0.86);
}

.returns-delete-request-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.returns-delete-request-title {
  font-weight: 700;
  color: #e2edff;
}

.returns-delete-request-subtitle {
  color: #c2e0d2;
}

.returns-delete-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #dce9ff;
}

.returns-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.returns-metric-card {
  border: 1px solid rgba(82, 152, 118, 0.45);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(38, 54, 46, 0.9) 0%, rgba(30, 42, 36, 0.9) 100%);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.returns-metric-label {
  font-size: 12px;
  color: #b2d3c3;
}

.returns-metric-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #f3f8ff;
}

.returns-metric-sub {
  font-size: 12px;
  color: #c9e6d8;
}

.returns-panels-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.returns-panel {
  border: 1px solid rgba(82, 152, 118, 0.45);
  border-radius: 12px;
  background: rgba(28, 40, 34, 0.86);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.returns-panel h3 {
  margin: 0;
  font-size: 19px;
}

.returns-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.returns-form-grid label,
.return-detail-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #c1ddd0;
}

.returns-form-grid input,
.returns-form-grid select,
.returns-filter-card input,
.returns-filter-card select,
.return-detail-form-grid input,
.return-detail-form-grid select,
.return-detail-comment-label textarea,
.returns-archive-filter-form select {
  border: 1px solid rgba(104, 176, 141, 0.55);
  border-radius: 10px;
  background: rgba(36, 52, 44, 0.9);
  color: #e9f1ff;
  padding: 9px 11px;
  font-size: 14px;
}

.return-detail-comment-label textarea {
  resize: vertical;
  min-height: 90px;
}

.returns-form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #d5e2f7;
  font-size: 13px;
}

.returns-form-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.returns-form-checks input[type="checkbox"],
.returns-table input[type="checkbox"],
.return-detail-form-grid input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(121, 195, 159, 0.75);
  border-radius: 4px;
  background: rgba(32, 47, 40, 0.95);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 16px;
  box-shadow: none;
}

.returns-form-checks input[type="checkbox"]::before,
.returns-table input[type="checkbox"]::before,
.return-detail-form-grid input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #ffffff;
  transform: scale(0);
  transition: transform 120ms ease;
}

.returns-form-checks input[type="checkbox"]:checked,
.returns-table input[type="checkbox"]:checked,
.return-detail-form-grid input[type="checkbox"]:checked {
  border-color: rgba(62, 207, 142, 0.95);
  background: linear-gradient(180deg, rgba(102, 200, 153, 0.92), rgba(83, 178, 132, 0.92));
}

.returns-form-checks input[type="checkbox"]:checked::before,
.returns-table input[type="checkbox"]:checked::before,
.return-detail-form-grid input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.returns-table td input[type="checkbox"] {
  margin-inline: auto;
}

.returns-form-checks label {
  gap: 8px;
  line-height: 1.2;
}

.returns-employee-input[readonly] {
  background: rgba(28, 41, 35, 0.88);
  border-color: rgba(109, 176, 144, 0.62);
  color: #d7e6ff;
  cursor: default;
}

.returns-employee-input[readonly]:focus {
  box-shadow: none;
  border-color: rgba(109, 176, 144, 0.62);
}

.returns-product-preview {
  border: 1px solid rgba(82, 153, 119, 0.5);
  border-radius: 12px;
  background: rgba(21, 31, 26, 0.7);
  padding: 10px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.returns-preview-title {
  font-size: 15px;
  font-weight: 700;
}

.returns-preview-sku {
  font-size: 13px;
  color: #b2d2c3;
}

.returns-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.returns-filter-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.returns-filters-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.returns-count {
  color: #c6e4d6;
  font-size: 13px;
}

.returns-archive-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.returns-archive-sidebar,
.returns-archive-summary-card,
.returns-archive-empty-card {
  padding: 12px;
}

.returns-archive-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.returns-archive-list-head h3 {
  margin: 0;
}

.returns-archive-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.returns-archive-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(84, 111, 155, 0.42);
  background: rgba(27, 39, 33, 0.88);
  color: #e8f0ff;
  text-decoration: none;
}

.returns-archive-item:hover {
  border-color: rgba(120, 192, 156, 0.6);
  background: rgba(33, 49, 41, 0.94);
}

.returns-archive-item.active {
  border-color: rgba(101, 209, 154, 0.72);
  box-shadow: inset 0 0 0 1px rgba(101, 209, 154, 0.22);
}

.returns-archive-item strong {
  font-size: 15px;
}

.returns-archive-item span {
  font-size: 12px;
  color: #c5deff;
}

.returns-archive-main {
  display: grid;
  gap: 12px;
}

.returns-archive-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.returns-archive-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.returns-archive-controls {
  display: grid;
  gap: 10px;
}

.returns-archive-export-buttons,
.returns-archive-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.returns-archive-filter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.returns-archive-filter-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #c5deff;
  min-width: 180px;
}

.returns-archive-filter-tabs {
  margin-top: 12px;
}

.returns-archive-meta {
  display: grid;
  gap: 4px;
  color: #d9e7ff;
}

.returns-archive-meta span {
  font-size: 13px;
  color: #b8d4c5;
}

.returns-archive-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #bddbcf;
}

.returns-archive-table {
  min-width: 860px;
}

.returns-table-wrap {
  overflow: auto;
}

.returns-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.returns-table th,
.returns-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(116, 140, 182, 0.2);
  vertical-align: middle;
}

.returns-table th {
  text-align: left;
  font-size: 12px;
  color: #bddfcf;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.returns-table tbody tr:hover {
  background: rgba(53, 98, 76, 0.24);
}

.returns-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(104, 128, 173, 0.48);
}

.returns-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px dashed rgba(117, 180, 150, 0.55);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 11px;
  color: #a8ccbb;
}

.returns-title-cell {
  font-weight: 650;
  font-size: 14px;
}

.returns-badges {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.returns-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
}

.returns-badge.status-new {
  background: rgba(69, 127, 99, 0.35);
  border-color: rgba(121, 195, 159, 0.45);
  color: #d5e6ff;
}

.returns-badge.status-posted {
  background: rgba(55, 161, 109, 0.25);
  border-color: rgba(90, 199, 143, 0.5);
  color: #d7ffec;
}

.returns-badge.status-writeoff,
.returns-badge.type-writeoff {
  background: rgba(199, 77, 77, 0.28);
  border-color: rgba(221, 112, 112, 0.56);
  color: #ffe5e5;
}

.returns-badge.status-supplier,
.returns-badge.type-supplier {
  background: rgba(203, 147, 71, 0.24);
  border-color: rgba(228, 179, 112, 0.52);
  color: #ffefd2;
}

.returns-badge.type-ordinary {
  background: rgba(80, 103, 138, 0.25);
  border-color: rgba(134, 191, 164, 0.45);
  color: #d8e8ff;
}

.returns-empty {
  text-align: center;
  color: #b3d3c4;
  padding: 14px;
}

.returns-problems-card {
  padding: 12px;
}

.returns-problems-head h3 {
  margin: 0;
}

.returns-problems-head p {
  margin: 4px 0 0;
  color: #b2d4c4;
  font-size: 13px;
}

.returns-problems-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.returns-problem-item {
  border: 1px solid rgba(84, 111, 155, 0.5);
  border-radius: 10px;
  background: rgba(30, 42, 36, 0.86);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.returns-problem-sku {
  font-weight: 700;
  color: #e2edff;
}

.returns-problem-title {
  color: #c2e0d2;
  font-size: 13px;
}

.returns-problem-stats {
  display: flex;
  gap: 12px;
  color: #dce9ff;
  font-size: 13px;
}

.return-detail-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.return-detail-main {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.return-detail-photo-wrap {
  width: 110px;
  height: 110px;
}

.return-detail-photo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(101, 130, 177, 0.55);
}

.return-detail-info {
  display: grid;
  gap: 6px;
}

.return-detail-line span {
  color: #b4d6c6;
}

.return-detail-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.return-detail-comment-label {
  display: grid;
  gap: 6px;
  color: #c1ddd0;
}

@media (max-width: 1300px) {
  .returns-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .returns-archive-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .returns-filters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .returns-metrics,
  .returns-panels-grid,
  .returns-form-grid,
  .returns-filters-grid,
  .return-detail-main,
  .return-detail-form-grid,
  .returns-archive-layout,
  .returns-archive-metrics {
    grid-template-columns: 1fr;
  }

  .returns-problem-item,
  .returns-delete-request-item,
  .returns-delete-requests-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .returns-delete-requests-count {
    min-height: 32px;
  }
}

.supplies-history-item-static {
  cursor: default;
}

.supplies-history-item-static strong,
.supplies-history-item-static span {
  display: block;
}

.supplies-archive-card {
  padding: 12px;
}

@media (max-width: 900px) {
  .supplies-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .supplies-history-row {
    grid-template-columns: 1fr;
  }

  .supplies-history-archive-form {
    width: 100%;
  }

  .supplies-history-archive,
  .supplies-history-pill {
    min-height: 40px;
  }
}

.supplies-archive-meta-card {
  padding: 14px;
  margin-bottom: 12px;
}

.supplies-archive-page .supplies-history-card {
  max-height: none;
}

:root[data-theme="light"] .supplies-history-item {
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.92));
  color: var(--text);
}

:root[data-theme="light"] .supplies-history-item.active {
  border-color: rgba(33, 151, 100, 0.54);
  box-shadow: inset 0 0 0 1px rgba(33, 151, 100, 0.16);
}

:root[data-theme="light"] .supplies-history-archive {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(21, 32, 43, 0.04);
  color: var(--text-soft);
}

:root[data-theme="light"] .supplies-history-archive:hover {
  border-color: rgba(100, 116, 139, 0.34);
  background: rgba(21, 32, 43, 0.08);
}

:root[data-theme="light"] .supplies-history-pill {
  border-color: rgba(33, 151, 100, 0.28);
  background: rgba(33, 151, 100, 0.08);
  color: #176c49;
}

:root[data-theme="light"] .supplies-table th {
  opacity: 1;
  color: #4b5563;
}

:root[data-theme="light"] .supplies-thumb-preview {
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(28, 45, 64, 0.12);
}

:root[data-theme="light"] .supplies-cell {
  border-color: rgba(33, 151, 100, 0.18);
  background: rgba(33, 151, 100, 0.06);
  color: #2f6a52;
  box-shadow: inset 0 0 0 1px rgba(33, 151, 100, 0.03);
}

:root[data-theme="light"] .badge.status {
  background: rgba(33, 151, 100, 0.08);
  border-color: rgba(33, 151, 100, 0.24);
  color: #176c49;
}

:root[data-theme="light"] .badge.status.completed {
  background: rgba(33, 151, 100, 0.12);
  border-color: rgba(33, 151, 100, 0.34);
  color: #176c49;
}

:root[data-theme="light"] .badge.status.in-progress,
:root[data-theme="light"] .badge.status.err {
  background: rgba(210, 77, 92, 0.1);
  border-color: rgba(210, 77, 92, 0.28);
  color: #b42318;
}

:root[data-theme="light"] .badge.mp {
  background: rgba(33, 151, 100, 0.08);
  border-color: rgba(33, 151, 100, 0.24);
  color: #176c49;
}
:root[data-theme="light"] .tsd-mode-btn,
:root[data-theme="light"] .returns-btn-secondary {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(21, 32, 43, 0.05);
  color: #294152;
}
:root[data-theme="light"] .tsd-mode-btn:hover,
:root[data-theme="light"] .returns-btn-secondary:hover {
  border-color: rgba(33, 151, 100, 0.34);
  background: rgba(33, 151, 100, 0.1);
  color: #13202c;
}
:root[data-theme="light"] .tsd-mode-btn.active,
:root[data-theme="light"] .returns-btn,
:root[data-theme="light"] .returns-btn-primary {
  border-color: rgba(23, 122, 79, 0.58);
  background: linear-gradient(180deg, #2ca46c 0%, #18784f 100%);
  color: #ffffff;
}
:root[data-theme="light"] .returns-btn:hover,
:root[data-theme="light"] .returns-btn-primary:hover {
  border-color: rgba(23, 122, 79, 0.72);
  background: linear-gradient(180deg, #33b173 0%, #1b8958 100%);
}

:root[data-theme="light"] .returns-metric-card,
:root[data-theme="light"] .returns-panel,
:root[data-theme="light"] .returns-product-preview,
:root[data-theme="light"] .returns-problem-item,
:root[data-theme="light"] .returns-delete-request-item {
  border-color: rgba(148, 163, 184, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.94));
  box-shadow: 0 10px 24px rgba(28, 45, 64, 0.08);
}

:root[data-theme="light"] .returns-metric-label,
:root[data-theme="light"] .returns-metric-sub,
:root[data-theme="light"] .returns-form-grid label,
:root[data-theme="light"] .return-detail-form-grid label,
:root[data-theme="light"] .returns-preview-sku,
:root[data-theme="light"] .returns-count,
:root[data-theme="light"] .returns-empty,
:root[data-theme="light"] .returns-problems-head p,
:root[data-theme="light"] .returns-problem-title,
:root[data-theme="light"] .returns-problem-stats,
:root[data-theme="light"] .returns-form-checks,
:root[data-theme="light"] .returns-thumb-placeholder,
:root[data-theme="light"] .returns-action-note,
:root[data-theme="light"] .returns-delete-requests-head p,
:root[data-theme="light"] .returns-delete-request-subtitle,
:root[data-theme="light"] .returns-delete-request-meta {
  color: #64748b;
}

:root[data-theme="light"] .returns-metric-value,
:root[data-theme="light"] .returns-preview-title,
:root[data-theme="light"] .returns-problem-sku,
:root[data-theme="light"] .returns-delete-request-title {
  color: #13202c;
}

:root[data-theme="light"] .returns-form-grid input,
:root[data-theme="light"] .returns-form-grid select,
:root[data-theme="light"] .returns-filter-card input,
:root[data-theme="light"] .returns-filter-card select,
:root[data-theme="light"] .return-detail-form-grid input,
:root[data-theme="light"] .return-detail-form-grid select,
:root[data-theme="light"] .return-detail-comment-label textarea,
:root[data-theme="light"] .returns-archive-filter-form select,
:root[data-theme="light"] .returns-employee-input[readonly] {
  border-color: rgba(148, 163, 184, 0.34);
  background: #ffffff;
  color: var(--text);
}

:root[data-theme="light"] .returns-employee-input[readonly]:focus {
  border-color: rgba(33, 151, 100, 0.5);
  box-shadow: none;
}

:root[data-theme="light"] .returns-form-checks input[type="checkbox"],
:root[data-theme="light"] .returns-table input[type="checkbox"],
:root[data-theme="light"] .return-detail-form-grid input[type="checkbox"] {
  border-color: rgba(148, 163, 184, 0.4);
  background: #ffffff;
}

:root[data-theme="light"] .returns-form-checks input[type="checkbox"]:checked,
:root[data-theme="light"] .returns-table input[type="checkbox"]:checked,
:root[data-theme="light"] .return-detail-form-grid input[type="checkbox"]:checked {
  border-color: rgba(33, 151, 100, 0.72);
  background: linear-gradient(180deg, #33b173 0%, #1b8958 100%);
}

:root[data-theme="light"] .returns-badge.status-new {
  background: rgba(71, 85, 105, 0.08);
  border-color: rgba(148, 163, 184, 0.34);
  color: #475467;
}

:root[data-theme="light"] .returns-badge.status-posted {
  background: rgba(33, 151, 100, 0.12);
  border-color: rgba(33, 151, 100, 0.34);
  color: #176c49;
}

:root[data-theme="light"] .returns-badge.status-writeoff,
:root[data-theme="light"] .returns-badge.type-writeoff {
  background: rgba(210, 77, 92, 0.1);
  border-color: rgba(210, 77, 92, 0.3);
  color: #b42318;
}

:root[data-theme="light"] .returns-badge.status-supplier,
:root[data-theme="light"] .returns-badge.type-supplier {
  background: rgba(207, 141, 34, 0.12);
  border-color: rgba(207, 141, 34, 0.32);
  color: #9a6700;
}

:root[data-theme="light"] .returns-badge.type-ordinary {
  background: rgba(71, 85, 105, 0.08);
  border-color: rgba(148, 163, 184, 0.34);
  color: #475467;
}

:root[data-theme="light"] .returns-table tbody tr:hover {
  background: rgba(33, 151, 100, 0.05);
}

:root[data-theme="light"] .returns-delete-requests-count {
  border-color: rgba(33, 151, 100, 0.28);
  background: rgba(33, 151, 100, 0.1);
  color: #176c49;
}

:root[data-theme="light"] .sku-link {
  color: #4a7f67;
}

:root[data-theme="light"] .sku-link:hover {
  color: #2f6a52;
}


/* receiving-page */
.receiving-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.receiving-search-panel,
.receiving-panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-sm);
}

.receiving-search-panel {
  padding: 22px;
}

.receiving-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.receiving-search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}

.receiving-search-input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}

.receiving-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.receiving-search-btn,
.receiving-choose-btn,
.receiving-photo-btn {
  border: none;
  cursor: pointer;
}

.receiving-search-btn,
.receiving-choose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #062414;
  font: 700 15px/1 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: transform 120ms ease, filter 120ms ease;
}

.receiving-search-btn:hover,
.receiving-choose-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.receiving-search-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.receiving-search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.receiving-chip,
.receiving-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.receiving-match-badge-best {
  background: rgba(33, 151, 100, 0.14);
  border-color: rgba(33, 151, 100, 0.34);
  color: var(--success);
}

.receiving-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.receiving-status {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.receiving-status.ok {
  color: var(--success);
}

.receiving-status.err {
  color: var(--danger);
}

.receiving-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.receiving-panel {
  padding: 20px;
}

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

.receiving-panel-head p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.receiving-panel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.receiving-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receiving-result-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  transition: border-color 120ms ease, transform 120ms ease, background-color 120ms ease;
}

.receiving-result-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.receiving-result-item.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(62, 207, 142, 0.14) 0%, rgba(62, 207, 142, 0.08) 100%);
}

.receiving-result-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}

.receiving-result-thumb-empty,
.receiving-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.receiving-result-thumb-empty {
  width: 72px;
  height: 72px;
  padding: 8px;
  border-radius: 16px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}

.receiving-result-main {
  min-width: 0;
}

.receiving-result-badge-row,
.receiving-result-badges,
.receiving-card-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receiving-result-badge-row {
  margin-bottom: 8px;
}

.receiving-card-sources {
  margin-top: 12px;
}

.receiving-result-media {
  align-self: start;
}

.receiving-result-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.receiving-result-line {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.receiving-result-line strong {
  color: var(--text);
}

.receiving-card-panel {
  min-height: 420px;
}

.receiving-empty {
  min-height: 380px;
  border: 1px dashed var(--border-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.receiving-empty-compact {
  min-height: 140px;
  font-size: 14px;
}

.receiving-empty[hidden],
.receiving-product-card[hidden] {
  display: none !important;
}

.receiving-product-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.receiving-card-top {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.receiving-card-photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.receiving-photo-btn {
  width: 100%;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.receiving-card-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface);
}

.receiving-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 24px;
  border-radius: 24px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-soft);
}

.receiving-card-kicker {
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.receiving-card-title {
  margin-top: 10px;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.12;
}

.receiving-card-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}

.receiving-card-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.receiving-card-section-title {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.receiving-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receiving-characteristic-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.receiving-card-description {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
}

.receiving-facts-grid,
.receiving-attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.receiving-facts-grid {
  margin-top: 18px;
}

.receiving-attribute,
.receiving-fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.receiving-attribute span,
.receiving-fact span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.receiving-attribute strong,
.receiving-fact strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .receiving-layout {
    grid-template-columns: 1fr;
  }

  .receiving-results-panel {
    order: 2;
  }

  .receiving-card-panel {
    order: 1;
  }
}

@media (max-width: 760px) {
  .receiving-search-row,
  .receiving-card-top {
    grid-template-columns: 1fr;
  }

  .receiving-search-btn {
    width: 100%;
  }

  .receiving-result-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .receiving-result-actions {
    grid-column: 1 / -1;
  }

  .receiving-choose-btn {
    width: 100%;
  }
}

.data-quality-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.data-quality-summary-card,
.data-quality-note-card,
.data-quality-table-card {
  padding: 20px;
}

.data-quality-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.data-quality-summary-grid div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.data-quality-summary-grid strong {
  font-size: 24px;
  line-height: 1.1;
}

.data-quality-summary-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-quality-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.data-quality-stat-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.data-quality-stat-card:hover {
  transform: translateY(-1px);
}

.data-quality-stat-card.active {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.data-quality-stat-critical.active {
  background: linear-gradient(180deg, rgba(255, 111, 125, 0.16), rgba(255, 111, 125, 0.08));
}

.data-quality-stat-medium.active {
  background: linear-gradient(180deg, rgba(240, 184, 75, 0.16), rgba(240, 184, 75, 0.08));
}

.data-quality-stat-low.active {
  background: linear-gradient(180deg, rgba(62, 207, 142, 0.16), rgba(62, 207, 142, 0.08));
}

.data-quality-stat-hint {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.data-quality-note-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  display: grid;
  gap: 10px;
}

.data-quality-table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.data-quality-table-badge {
  min-width: 52px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.data-quality-table-wrap {
  overflow-x: auto;
}

.data-quality-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.data-quality-table th,
.data-quality-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-quality-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-quality-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-quality-photo-cell {
  width: 88px;
}

.data-quality-photo,
.data-quality-photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.data-quality-photo {
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-quality-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.data-quality-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.data-quality-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.data-quality-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-quality-issue,
.data-quality-priority-badge,
.data-quality-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

.data-quality-issue-critical,
.data-quality-priority-critical {
  background: rgba(255, 111, 125, 0.14);
  border-color: rgba(255, 111, 125, 0.34);
  color: var(--danger);
}

.data-quality-issue-medium,
.data-quality-priority-medium {
  background: rgba(240, 184, 75, 0.14);
  border-color: rgba(240, 184, 75, 0.34);
  color: var(--warning);
}

.data-quality-issue-low,
.data-quality-priority-low {
  background: rgba(62, 207, 142, 0.14);
  border-color: rgba(62, 207, 142, 0.34);
  color: var(--success);
}

.data-quality-issue-more,
.data-quality-action-link {
  background: var(--bg-soft);
  color: var(--text);
}

.data-quality-action-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.data-quality-primary-description {
  max-width: 360px;
}

@media (max-width: 960px) {
  .data-quality-stats {
    grid-template-columns: 1fr;
  }

  .data-quality-table-head {
    flex-direction: column;
  }
}

.data-quality-maintenance-card {
  padding: 20px;
}

.data-quality-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.data-quality-maintenance-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.data-quality-maintenance-item strong {
  font-size: 28px;
  line-height: 1.1;
}

.data-quality-maintenance-form {
  margin-top: auto;
}

.data-quality-maintenance-form button {
  width: 100%;
}
