* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f4fa;
  --card: rgba(255,255,255,.9);
  --ink: #28233a;
  --muted: #817b91;
  --line: #e8e3ef;
  --violet: #7763d7;
  --violet2: #9b87ea;
  --pink: #d591ca;
  --success: #55a884;
  --warning: #d89354;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(168,143,227,.16), transparent 30%),
    radial-gradient(circle at 10% 100%, rgba(220,155,199,.13), transparent 30%),
    var(--bg);
}

button,input,select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 235px 1fr;
}

.sidebar {
  background: linear-gradient(180deg,#2c2744 0%,#211d36 100%);
  color: white;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-star {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 23px;
  background: linear-gradient(135deg,var(--violet2),var(--pink));
  box-shadow: 0 8px 24px rgba(154,130,231,.35);
}

.brand strong {
  display: block;
  letter-spacing: .08em;
  font-size: 14px;
}

.brand span {
  display: block;
  opacity: .55;
  font-size: 11px;
  letter-spacing: .23em;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 7px;
}

.nav {
  border: 0;
  color: rgba(255,255,255,.72);
  background: transparent;
  text-align: left;
  padding: 12px 13px;
  border-radius: 12px;
}

.nav.active {
  background: rgba(255,255,255,.11);
  color: white;
}

.nav small {
  float: right;
  opacity: .45;
  font-size: 9px;
  margin-top: 4px;
}

.nav.disabled {
  cursor: default;
}

.side-status {
  margin-top: auto;
  padding: 15px 10px 4px;
  border-top: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.63);
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #62d49f;
  box-shadow: 0 0 10px #62d49f;
  margin-right: 7px;
}

main {
  padding: 42px 45px 70px;
  max-width: 1450px;
  width: 100%;
  margin: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.eyebrow {
  color: var(--violet);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .21em;
}

h1 {
  margin: 7px 0 5px;
  font-size: 34px;
  letter-spacing: -.04em;
}

header p {
  margin: 0;
  color: var(--muted);
}

.stats {
  margin: 32px 0 24px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
}

.stats article {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 10px 35px rgba(50,42,75,.035);
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.stats strong {
  font-size: 27px;
}

.stats .warning strong {
  color: var(--warning);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 205px;
  gap: 12px;
  margin-bottom: 18px;
}

input,select {
  width: 100%;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

input:focus,select:focus {
  border-color: #ab9bea;
  box-shadow: 0 0 0 3px rgba(142,121,221,.1);
}

.catalog {
  display: grid;
  gap: 10px;
}

.product {
  display: grid;
  grid-template-columns: minmax(280px,1.5fr) minmax(150px,.7fr) 145px 130px 125px;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 16px 18px;
  border-radius: 15px;
  transition: .18s ease;
}

.product:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(54,45,79,.06);
}

.product-title {
  font-weight: 700;
  margin-bottom: 5px;
}

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

.sku {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f4f1f8;
  width: fit-content;
  word-break: break-all;
}

.sku.hint-sku {
  background: #f0ebff;
  color: #6852bd;
}

.price {
  font-weight: 700;
}

.badge {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge.unmapped {
  color: #a15d28;
  background: #fff1e6;
}

.badge.mapped {
  color: #6650b0;
  background: #efebff;
}

.badge.verified {
  color: #397a5f;
  background: #e6f6ee;
}

.primary,
.secondary {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary {
  color: white;
  background: linear-gradient(135deg,var(--violet),var(--violet2));
}

.secondary {
  color: #625878;
  background: white;
  border: 1px solid var(--line);
}

.mapping-btn {
  border: 0;
  background: #312b48;
  color: white;
  border-radius: 10px;
  padding: 9px 11px;
}

#message {
  margin-bottom: 15px;
}

.message {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
}

.message.error {
  background: #ffe9e9;
  color: #a34b4b;
}

.message.success {
  background: #e9f8f1;
  color: #39795d;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(25,20,39,.53);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden,
.hidden {
  display: none;
}

.modal-card {
  width: min(650px,100%);
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  position: relative;
  box-shadow: 0 30px 100px rgba(24,20,40,.25);
}

.modal-card h2 {
  margin: 6px 0 3px;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.close {
  position: absolute;
  right: 17px;
  top: 14px;
  border: 0;
  background: transparent;
  font-size: 27px;
  color: #8c8599;
}

label {
  display: block;
  font-weight: 650;
  font-size: 12px;
  margin-top: 17px;
}

label input {
  margin-top: 6px;
  font-weight: 400;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.check input {
  width: auto;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 25px;
}

.hint {
  background: #f3efff;
  border: 1px solid #dfd6ff;
  color: #6653ab;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 9px;
  font-size: 12px;
}

@media(max-width:900px) {
  .app {
    grid-template-columns:1fr;
  }

  .sidebar {
    display:none;
  }

  main {
    padding:25px 16px;
  }

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

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

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