:root {
  --bg: #fff2f7;
  --card: #fff9fc;
  --ink: #2b1f26;
  --muted: #6e5363;
  --accent: #d04f88;
  --accent-soft: #f8d8e9;
  --line: #edd3df;
  --ok: #2f7a41;
  --warn: #9a5f1a;
  --info: #225f88;
  --danger: #8f2f2f;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 0%, #ffe7f2 0%, #ffd8ea 58%, #f8cfe2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px 12px 28px;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.42;
}

.bg-a {
  width: 220px;
  height: 220px;
  background: #f8a8cb;
  top: -70px;
  right: -50px;
}

.bg-b {
  width: 210px;
  height: 210px;
  background: #f28bc0;
  bottom: -70px;
  left: -60px;
}

.app {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.7rem, 7vw, 2.8rem);
  margin: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: #a3396c;
  font-weight: 700;
}

.card {
  background: color-mix(in srgb, var(--card) 85%, white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(132, 55, 92, 0.12);
  padding: 14px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

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

label {
  font-size: 0.88rem;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

label.wide {
  grid-column: auto;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  min-height: 42px;
}

input[readonly] {
  background: #fdf0f7;
  color: #7b6170;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 38%, white);
  border-color: var(--accent);
}

.size-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.ghost {
  background: var(--accent-soft);
  color: #7c2e59;
}

button.small {
  padding: 8px 10px;
  font-size: 0.83rem;
}

.toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.toolbar input {
  width: 100%;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
}

.table-wrap {
  overflow: visible;
}

table,
thead,
tbody,
tr,
th,
td {
  display: block;
  width: 100%;
}

thead {
  display: none;
}

tr {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  margin-bottom: 10px;
}

td {
  padding: 7px 0;
  border-bottom: 1px solid #eee6da;
  font-size: 0.9rem;
  display: grid;
  grid-template-columns: minmax(92px, 34%) 1fr;
  gap: 8px;
  align-items: center;
}

td::before {
  content: attr(data-label);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a6370;
}

td:last-child {
  border-bottom: 0;
}

td:last-child::before {
  align-self: start;
}

td:last-child button {
  margin-right: 6px;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status.status-stored {
  color: var(--ok);
  background: #e6f4e9;
}

.status.status-pending {
  color: var(--warn);
  background: #fff2df;
}

.status.status-listed {
  color: var(--info);
  background: #e6f1fa;
}

.status.status-sold {
  color: var(--danger);
  background: #fde7e7;
}

.low-stock {
  color: #a33268;
  font-weight: 700;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 16px 0;
  display: block;
}

.empty::before {
  content: "";
  display: none;
}

@media (min-width: 560px) {
  body {
    padding: 20px 16px 32px;
  }

  .card {
    padding: 18px;
  }

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

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

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

  label.wide {
    grid-column: span 2;
  }

  .toolbar {
    grid-template-columns: 1fr minmax(260px, 360px);
    align-items: center;
  }
}

@media (min-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: auto;
    margin-inline: auto;
  }

  table {
    display: table;
    border-collapse: collapse;
    min-width: 1380px;
    margin-inline: auto;
  }

  thead {
    display: table-header-group;
  }

  tbody {
    display: table-row-group;
  }

  tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0;
  }

  th,
  td {
    display: table-cell;
    width: auto;
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
  }

  td {
    grid-template-columns: 1fr;
    gap: 0;
  }

  td::before {
    content: none;
  }

  th {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #775f6c;
  }
}
