:root {
  --ink: #24182f;
  --muted: #6d6278;
  --cream: #fff8f2;
  --line: rgba(36, 24, 47, 0.08);
  --hot: #d84a32;
  --warm: #b86a12;
  --cool: #6d6278;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  background: #241433;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -12%;
  background:
    radial-gradient(ellipse 42% 36% at 12% 8%, rgba(255, 196, 122, 0.95), transparent 70%),
    radial-gradient(ellipse 38% 34% at 92% 12%, rgba(255, 94, 78, 0.82), transparent 68%),
    radial-gradient(ellipse 46% 40% at 78% 92%, rgba(52, 196, 186, 0.7), transparent 70%),
    radial-gradient(ellipse 36% 32% at 8% 88%, rgba(124, 92, 255, 0.75), transparent 70%),
    linear-gradient(155deg, #3a215c 0%, #1d3f5c 48%, #1a2744 100%);
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 56px;
  height: 56px;
  display: block;
  flex: none;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 560;
  font-size: clamp(40px, 5vw, 58px);
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.filters {
  display: flex;
  gap: 12px;
  flex: none;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 242, 0.78);
}

.filters input {
  width: 156px;
  border: 1px solid rgba(255, 248, 242, 0.28);
  background: rgba(255, 248, 242, 0.12);
  color: var(--cream);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.filters input:focus {
  outline: 2px solid rgba(255, 224, 174, 0.85);
  border-color: transparent;
  background: rgba(255, 248, 242, 0.18);
}

.sheet {
  background: var(--cream);
  color: var(--ink);
  border-radius: 22px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: #fff1e6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}

th button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

th button:hover { color: var(--ink); }

th button.sorted::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

th button.desc::after { border-top: 5px solid currentColor; }
th button.asc::after { border-bottom: 5px solid currentColor; }

th.num button {
  width: 100%;
  justify-content: flex-end;
}

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: rgba(255, 116, 84, 0.08); }

.name { font-weight: 650; }

.sku {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #4d415c;
}

.return { font-weight: 700; }

.return.hot { color: var(--hot); }
.return.warm { color: var(--warm); }
.return.cool { color: var(--cool); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
}

@media (max-width: 760px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 22px; }
  .masthead { display: block; }
  .filters { margin-top: 18px; }
  .filters input { width: 100%; }
  .filters label { flex: 1; min-width: 0; }

  .sheet { overflow: visible; }

  table, thead, tbody, tr, th, td { display: block; }
  table { min-width: 0; }

  thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 12px 4px;
  }

  th {
    position: static;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: left;
  }

  th.num button { width: auto; justify-content: flex-start; }

  th button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    margin: 0 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child { border-bottom: 0; }

  tbody td, tbody td.num {
    border: 0;
    padding: 0;
    text-align: left;
  }

  tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  td.name { grid-column: 1 / -1; font-size: 18px; }
  td.name::before { display: none; }

  td.empty { grid-column: 1 / -1; }
  td.empty::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
