:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --ink: #0d1526;
  --muted: #647089;
  --line: #e5e9f2;
  --blue: #1557ff;
  --blue-2: #0f46dd;
  --green: #12a05c;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --sidebar: #0b1628;
  --sidebar-2: #111d31;
  --shadow: 0 14px 38px rgba(20, 30, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fff;
  box-shadow: 18px 0 40px rgba(9, 18, 35, 0.16);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1c6bff, #1745ea);
  color: #fff;
  font-weight: 900;
}

.logo strong {
  font-size: 17px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 13px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 750;
}

.side-nav a span {
  display: grid;
  place-items: center;
  width: 22px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 900;
}

.side-nav a.is-active {
  background: linear-gradient(135deg, #1564ff, #0d46e9);
  color: #fff;
  box-shadow: 0 12px 22px rgba(21, 100, 255, 0.28);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: auto -14px -24px;
  padding: 22px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 90%, #ffffff 0 32%, transparent 33%),
    #c7d2e7;
}

.user-box strong,
.user-box small {
  display: block;
}

.user-box small {
  color: rgba(255, 255, 255, 0.68);
}

.app-main {
  margin-left: 240px;
  padding: 22px 26px 28px;
  min-width: 0;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

#unit .page-top {
  margin-bottom: 14px;
}

#unit h1 {
  font-size: 26px;
}

#unit .action-button {
  min-height: 42px;
  padding: 0 16px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  letter-spacing: 0;
}

.hint {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #a8b2c6;
  border-radius: 50%;
  color: #71809a;
  font-size: 11px;
  font-weight: 900;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
}

.snapshot-picker {
  display: grid;
  gap: 4px;
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.snapshot-picker input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #1b2740;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 43, 70, 0.04);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #1b2740;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 43, 70, 0.04);
}

.file-action input {
  display: none;
}

.action-button.primary {
  border-color: var(--blue);
  background: linear-gradient(135deg, #175fff, #0f47ea);
  color: #fff;
  box-shadow: 0 14px 26px rgba(21, 87, 255, 0.22);
}

.action-button.soft-blue {
  border-color: #b9cdfd;
  background: #edf4ff;
  color: #1557ff;
  box-shadow: 0 8px 18px rgba(21, 87, 255, 0.08);
}

.action-button.soft-blue:hover {
  border-color: #8fb0ff;
  background: #e3edff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  justify-content: space-between;
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover,
.stat-card.is-active {
  transform: translateY(-1px);
  border-color: #c9d6ff;
  box-shadow: 0 18px 42px rgba(21, 87, 255, 0.12);
}

.stat-card span,
.filters-bar label,
th {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin: 14px 0 10px;
  font-size: 29px;
  line-height: 1;
}

.stat-card em {
  color: var(--green);
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
}

.stat-card:nth-child(5) em {
  color: var(--red);
}

.stat-card small {
  color: #53617b;
}

.stat-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
}

.stat-icon.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.stat-icon.green {
  background: #cdebd9;
  color: #37a76b;
}

.stat-icon.orange {
  background: #fff1d9;
  color: #f59e0b;
}

.stat-icon.red {
  background: #ffd9df;
  color: #ef4444;
}

.stat-icon.purple {
  background: #eee5ff;
  color: #7c3aed;
}

.stat-icon.coral {
  background: #ffe6dc;
  color: #ff6b3d;
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) repeat(6, minmax(96px, 0.55fr)) minmax(120px, 0.62fr) minmax(170px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filters-bar label {
  display: grid;
  gap: 6px;
}

.filters-bar input,
.filters-bar select,
.calc-panel input,
.calc-panel select,
.page-top select,
.table-meta select,
.promo-card input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #17213a;
}

.filters-bar input,
.calc-panel input,
.promo-card input {
  padding: 0 12px;
}

.filters-bar select,
.page-top select,
.table-meta select {
  padding: 0 12px;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: #52627d;
  font-weight: 900;
}

.search-field input {
  width: 100%;
  padding-right: 40px;
}

.data-card {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.products-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
}

.products-table.compact {
  min-width: 980px;
}

.products-table.unit-table {
  min-width: 1920px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: middle;
}

td {
  color: #101a30;
  font-size: 13px;
  font-weight: 650;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8fbff;
}

.image-col {
  width: 56px;
}

.product-image {
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  border: 1px solid #e4e8f1;
  border-radius: 8px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #9ed0ff;
  font-size: 19px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.name-cell {
  min-width: 145px;
  max-width: 190px;
  line-height: 1.35;
}

.name-cell strong {
  display: block;
}

.product-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: inherit;
}

.ozon-product-link {
  display: inline-flex;
  margin-top: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.ozon-product-link:hover {
  text-decoration: underline;
}

.positive,
.status-ok {
  color: var(--green);
}

.negative,
.status-bad {
  color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

.badge.green {
  background: #e8f8ef;
  color: var(--green);
}

.badge.orange {
  background: #fff3dd;
  color: #e98600;
}

.badge.red {
  background: #ffe9ec;
  color: var(--red);
}

.badge.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.badge.gray {
  background: #f1f4f8;
  color: #5b667a;
}

.muted-small {
  display: inline-block;
  margin-left: 4px;
  color: #7a869d;
  font-size: 11px;
  font-weight: 800;
}

.unit-price-main {
  display: block;
}

.unit-spp-cell {
  min-width: 86px;
}

.unit-co-invest-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  color: #7a869d;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.unit-rate-input {
  width: 28px;
  min-height: 24px;
  padding: 0 3px;
  border: 1px solid #dbe3f0;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.unit-percent-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 62px;
}

.unit-percent-stack span {
  color: #7a869d;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.unit-percent-stack b {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 74px;
  padding: 0 26px;
}

.unit-summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(320px, 1.35fr) repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.unit-summary-grid article {
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.unit-summary-grid span,
.unit-controls label,
.unit-bulk-panel label {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.unit-summary-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

.unit-line-stock,
.unit-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.unit-line-chip,
.unit-threshold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f5f7fb;
  color: #24304a;
  font-size: 11px;
  font-weight: 850;
}

.unit-line-chip em,
.unit-line-chip i,
.unit-threshold em {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  font-style: normal;
}

.unit-line-chip em,
.unit-threshold.above em {
  color: var(--green);
}

.unit-line-chip i,
.unit-threshold.below em {
  color: var(--red);
}

.unit-controls,
.unit-bulk-panel {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.unit-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.unit-bulk-panel {
  grid-template-columns: minmax(220px, 0.9fr) minmax(150px, 0.55fr) repeat(6, minmax(138px, auto)) minmax(180px, 1fr);
  align-items: end;
}

.unit-controls label,
.unit-bulk-panel label,
.unit-filter-group {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.unit-range-filter,
.unit-filter-actions {
  grid-column: 1;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.unit-range-filter {
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(120px, 1fr));
}

.unit-filter-actions {
  grid-template-columns: minmax(260px, max-content) max-content;
  align-items: end;
}

.unit-line-group {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-content: start;
}

.unit-line-group .unit-quick-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  align-items: stretch;
}

.unit-line-group .unit-quick-filters button {
  width: 100%;
}

.unit-hidden-select {
  display: none !important;
}

.unit-controls input,
.unit-controls select,
.unit-bulk-panel input,
.unit-bulk-panel select {
  height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #17213a;
  line-height: 42px;
}

.unit-filter-group > span {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.unit-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.unit-quick-filters button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #f7f9fd;
  color: #24304a;
  font-size: 12px;
  font-weight: 850;
}

.unit-quick-filters button.is-active {
  border-color: var(--blue);
  background: #eaf1ff;
  color: var(--blue);
}

.unit-table-tools {
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  margin: 4px 0 10px;
}

.unit-table-tools .search-field input {
  min-height: 42px;
}

.unit-reset-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  align-self: end;
}

.unit-th {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: normal;
}

.unit-th button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #59657c;
  font-size: 12px;
  font-weight: 900;
}

.unit-th button:hover {
  background: #edf3ff;
  color: var(--blue);
}

.unit-actions-head,
.unit-actions-cell {
  width: 72px;
  min-width: 72px;
}

.unit-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.unit-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.unit-icon-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #dbe3f0;
  border-radius: 6px;
  background: #fff;
  color: #59657c;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.unit-icon-button:hover {
  border-color: #b9cdfd;
  background: #edf4ff;
  color: var(--blue);
}

.unit-row-input {
  width: 112px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dbe3f0;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font-weight: 850;
}

.unit-row-input.compact {
  width: 96px;
}

.unit-row-input.wholesale-input {
  width: 76px;
}

.unit-row-input.ads-input {
  width: 76px;
  min-height: 32px;
}

.unit-row-input.target-price-input {
  width: 92px;
  min-height: 34px;
  border-color: #b7ccff;
  background: #fff;
  color: #1557ff;
  font-weight: 900;
}

.unit-row-input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(21, 87, 255, 0.14);
}

.unit-margin-cell {
  min-width: 128px;
}

.unit-margin-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.unit-margin-cell .unit-percent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.unit-percent-badge span,
.unit-percent-badge em {
  font-size: 10.5px;
  font-style: normal;
  line-height: 1;
}

.unit-percent-badge b {
  font-size: 12px;
  line-height: 1.1;
}

.unit-margin-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eaf1ff;
  color: #1557ff;
  font-weight: 850;
  white-space: nowrap;
}

.unit-margin-check span,
.unit-margin-check em {
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.unit-margin-check b {
  font-size: 11px;
  line-height: 1.1;
}

.unit-ads-cell {
  min-width: 82px;
}

.unit-drr-label {
  display: block;
  margin-bottom: 4px;
  color: #7a869d;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.target-price-head,
.target-price-cell {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 #1557ff;
}

.target-price-head {
  color: #1746be;
}

.target-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #b7ccff;
  border-radius: 7px;
  background: #ffffff;
  color: #1557ff;
  font-size: 13px;
  font-weight: 900;
}

.unit-bulk-panel .action-button {
  min-height: 44px;
  min-width: 0;
  padding-inline: 14px;
  white-space: normal;
}

.unit-bulk-status {
  align-self: center;
  color: #647089;
  font-size: 12px;
  font-weight: 850;
}

.unit-bulk-status.green {
  color: var(--green);
}

.unit-bulk-status.red {
  color: var(--red);
}

.unit-history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 16, 31, 0.42);
}

.unit-history-modal.is-open {
  display: flex;
}

.unit-history-dialog {
  width: min(760px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 13, 28, 0.26);
}

.unit-history-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.unit-history-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.unit-history-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding: 14px 18px 18px;
}

.unit-history-item {
  display: grid;
  grid-template-columns: 110px minmax(80px, 0.35fr) minmax(120px, 0.45fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.unit-history-item time,
.unit-history-item span,
.unit-history-item small {
  color: #6b768c;
  font-size: 11px;
  font-weight: 800;
}

.unit-history-item strong,
.unit-history-item p {
  margin: 0;
  color: #142038;
  font-size: 12px;
  font-weight: 900;
}

.unit-history-item small {
  grid-column: 2 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-history-empty {
  padding: 22px;
  color: #647089;
  font-weight: 850;
  text-align: center;
}

.unit-table th,
.unit-table td {
  padding: 10px 8px;
  white-space: nowrap;
}

.unit-table .name-cell {
  min-width: 230px;
  max-width: 280px;
  white-space: normal;
}

.unit-table .product-open {
  font-size: 11px;
  line-height: 1.25;
}

.unit-table .name-cell strong {
  font-size: 12px;
}

.product-top {
  align-items: flex-start;
}

.product-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.back-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #24304a;
  font-weight: 850;
}

.product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: -8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.product-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4c5872;
  font-weight: 850;
}

.product-tabs button.is-active {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.product-main-card,
.product-metrics-card,
.product-tab-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-main-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
}

.large-product-image {
  display: grid;
  place-items: center;
  min-height: 190px;
  border-radius: 10px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #9ed0ff;
  font-size: 64px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.08);
}

.product-facts,
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fact,
.mini-metric {
  padding: 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
}

.fact span,
.mini-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.fact strong,
.mini-metric strong {
  display: block;
  font-size: 17px;
}

.product-metrics-card,
.product-tab-panel {
  padding: 24px;
}

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

.tab-summary article {
  padding: 16px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.tab-summary strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.tab-summary span {
  color: var(--muted);
}

.pages,
.table-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #56627a;
}

.pages button {
  min-width: 40px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #44516c;
  font-weight: 750;
}

.pages button.is-active {
  border: 1px solid #dce7ff;
  background: #f4f8ff;
  color: var(--blue);
}

.placeholder-grid,
.calculator-layout,
.promo-grid {
  display: grid;
  gap: 18px;
}

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

.placeholder-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.placeholder-grid article,
.calc-panel,
.calc-result,
.promo-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.placeholder-grid article strong,
.placeholder-grid article span {
  display: block;
}

.placeholder-grid article strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.placeholder-grid article span,
.placeholder-grid article p {
  color: var(--muted);
}

.calculator-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 420px);
  align-items: start;
}

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

.calc-panel label {
  display: grid;
  gap: 7px;
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.calc-result span,
.promo-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.calc-result strong,
.promo-card strong {
  display: block;
  margin: 10px 0 16px;
  font-size: 34px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.result-line dt {
  color: var(--muted);
}

.result-line dd {
  margin: 0;
  font-weight: 850;
}

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

.promo-card p {
  margin: 0;
  color: var(--green);
  font-weight: 850;
}

.promo-card.is-risk p {
  color: var(--orange);
}

.promo-card.is-bad p {
  color: var(--red);
}

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

.tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #244579;
  font-weight: 800;
}

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

  .filters-bar,
  .unit-summary-grid,
  .unit-controls,
  .unit-bulk-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #unit .unit-summary-grid {
    grid-template-columns: minmax(170px, 0.65fr) minmax(360px, 1.35fr);
  }

  #unit .unit-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #unit .unit-line-group {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 980px) {
  .sidebar {
    width: 216px;
  }

  .app-main {
    margin-left: 216px;
    padding: 18px;
  }

  .page-top {
    display: block;
  }

  .actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .action-button {
    min-height: 42px;
    padding: 0 14px;
  }

  .stats-grid,
  .filters-bar,
  .placeholder-grid,
  .placeholder-grid.three,
  .product-detail-grid,
  .product-main-card,
  .calculator-layout,
  .unit-summary-grid,
  .unit-controls,
  .unit-bulk-panel,
  .promo-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 116px;
  }

  .tab-summary,
  .product-facts,
  .mini-metrics {
    grid-template-columns: 1fr;
  }

  #unit .unit-range-filter,
  #unit .unit-filter-actions {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  #unit .unit-line-group {
    grid-column: 1;
    grid-row: auto;
  }

  #unit .unit-line-group .unit-quick-filters {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }
}
