.products-view { margin-top: 28px; }

.products-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.products-head h2 {
  margin: 0 0 5px;
  font-size: 24px;
  letter-spacing: -.04em;
}

.products-head > div > p:last-child {
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
}

.products-empty,
.products-loading {
  min-height: 440px;
  padding: 52px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.products-empty-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 29px;
  font-weight: 800;
}

.products-empty h3,
.products-loading h3 {
  margin: 0 0 9px;
  font-size: 21px;
  letter-spacing: -.035em;
}

.products-empty > p:not(.panel-kicker) {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.products-load-button {
  width: min(330px, 100%);
  margin-top: 25px;
}

.products-empty > small {
  max-width: 520px;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.5;
}

.products-loader {
  position: relative;
  width: 62px;
  height: 62px;
  margin-bottom: 21px;
  border: 1px solid #dedafc;
  border-radius: 20px;
  background: var(--primary-soft);
  animation: productPulse 1.5s ease-in-out infinite;
}

.products-loader span {
  position: absolute;
  inset: 17px;
  border: 3px solid #cfc9fb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.products-loading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.products-progress {
  width: min(430px, 90%);
  height: 7px;
  margin: 24px 0 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #ececf3;
}

.products-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #3fa4d5);
  transition: width .25s ease;
}

.products-loading > small {
  color: var(--ink-muted);
  font-size: 8px;
}

@keyframes productPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 10px 30px rgba(101,87,232,.08); }
  50% { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(101,87,232,.16); }
}

.product-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.product-metric {
  min-height: 126px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.product-metric > span,
.product-metric small {
  color: var(--ink-muted);
  font-size: 9px;
}

.product-metric strong {
  margin: 9px 0 6px;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

.product-metric.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #159a68, #36ad82 65%, #57b99c);
  box-shadow: 0 14px 34px rgba(21,154,104,.18);
}

.product-metric.primary > span,
.product-metric.primary small { color: rgba(255,255,255,.72); }

.products-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, .7fr);
  gap: 13px;
}

.products-chart-panel,
.abc-panel {
  padding: 20px;
}

.products-top-chart {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.product-bar-row {
  display: grid;
  grid-template-columns: 21px minmax(135px, 1.2fr) minmax(130px, 1.8fr) 82px;
  align-items: center;
  gap: 10px;
}

.product-rank {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 800;
}

.product-bar-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.product-bar-copy strong {
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-bar-copy small {
  color: var(--ink-muted);
  font-size: 7px;
}

.product-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef0f4;
}

.product-bar-track span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), #57b99c);
}

.product-bar-row > b {
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.products-no-data {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  font-size: 10px;
}

.abc-summary {
  display: grid;
  gap: 10px;
  margin-top: 21px;
}

.abc-row {
  padding: 11px;
  display: grid;
  grid-template-columns: 35px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.abc-row > div {
  display: grid;
  gap: 3px;
}

.abc-row strong { font-size: 10px; }
.abc-row small { color: var(--ink-muted); font-size: 8px; }
.abc-note { margin: 15px 0 0; color: var(--ink-muted); font-size: 8px; line-height: 1.55; }

.abc-badge {
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 900;
}

.abc-a { color: #11734e; background: var(--green-soft); }
.abc-b { color: #7d5a0b; background: var(--amber-soft); }
.abc-c { color: #6740af; background: var(--violet-soft); }

.products-toolbar {
  margin: 13px 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 155px 155px 160px;
  gap: 9px;
}

.products-toolbar input,
.products-toolbar select {
  width: 100%;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface);
  outline: none;
  font-size: 10px;
}

.products-toolbar select { padding: 0 10px; cursor: pointer; }
.products-toolbar input:focus,
.products-toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,87,232,.08); }
.products-register { overflow: hidden; }
.products-register .table-wrap { margin-top: 0; }
.products-table { min-width: 880px; }
.product-cell { max-width: 360px; display: grid; gap: 4px; }
.product-cell > span { overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.product-cell small { color: var(--ink-muted); font-size: 8px; }
.product-loss { color: var(--red); }

@media (max-width: 1100px) {
  .product-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-grid { grid-template-columns: 1fr; }
  .products-toolbar { grid-template-columns: 1fr 1fr; }
  .products-toolbar .search-field { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .products-head { align-items: flex-start; }
  .product-metrics { grid-template-columns: 1fr 1fr; }
  .product-metric { min-height: 108px; padding: 14px; }
  .product-metric strong { font-size: 21px; }
  .product-bar-row { grid-template-columns: 19px minmax(105px, 1fr) 65px; }
  .product-bar-track { display: none; }
  .products-toolbar { grid-template-columns: 1fr; }
  .products-toolbar .search-field { grid-column: auto; }
  .products-empty, .products-loading { min-height: 390px; padding: 38px 20px; }
}
