:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f1;
  --line: #d8dde3;
  --line-strong: #b9c1ca;
  --text: #17202a;
  --muted: #637083;
  --green: #20775a;
  --blue: #2f62a3;
  --amber: #936213;
  --red: #b33838;
  --shadow: 0 1px 2px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--blue);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

input,
select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

input[type="number"] {
  width: 132px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: 0;
}

.status-line {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 152px 88px 88px auto auto;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 22px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.message {
  color: var(--muted);
}

.message.error {
  color: var(--red);
}

.message.ok {
  color: var(--green);
}

.table-wrap {
  padding: 16px 22px 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  box-shadow: var(--shadow);
}

th,
td {
  height: 44px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f2f5;
  color: #465263;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

tr.product-row {
  background: #ffffff;
}

tr.variant-row {
  background: #fbfcfd;
}

tr.dirty {
  background: #fff9eb;
}

.code {
  width: 92px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.name-cell {
  min-width: 320px;
}

.name-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-name {
  padding-left: 28px;
  color: #2c3948;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

.badge.set {
  border-color: #d7c49a;
  color: var(--amber);
  background: #fff7df;
}

.badge.option {
  border-color: #b7d6c9;
  color: var(--green);
  background: #eef9f4;
}

.muted {
  color: var(--muted);
}

.money {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

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

.empty {
  padding: 54px 22px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
}

.locked-input {
  background: #f2f4f6;
  color: var(--muted);
}

@media (max-width: 1180px) {
  body {
    min-width: 980px;
  }

  .toolbar {
    grid-template-columns: minmax(220px, 1fr) 136px 78px 78px auto auto;
  }
}
