:root {
  --d0: #060606;
  --d1: #0A0A0A;
  --d2: #101010;
  --d3: #141414;
  --d4: #1A1A1A;
  --d5: #222222;
  --d-border: #252525;
  --l0: #FFFFFF;
  --l1: #F6F5F1;
  --l2: #EDEBE5;
  --l3: #E4E1DA;
  --l-border: #D6D3CC;
  --bronze: #7C4B1C;
  --bronze-hover: #643C16;
  --bronze-dark: #C89550;
  --on-dark: #EDE9E3;
  --on-dark-sub: #8E8A85;
  --on-dark-faint: #565250;
  --on-light: #111111;
  --on-light-sub: #6A6764;
  --on-light-faint: #9B9895;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--l1);
  color: var(--on-light);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.hero {
  padding: 24px clamp(22px, 4vw, 48px) 46px;
  background:
    radial-gradient(circle at 82% 20%, rgba(124, 75, 28, 0.18), transparent 32%),
    linear-gradient(180deg, var(--d0), var(--d1));
  color: var(--on-dark);
  border-bottom: 1px solid var(--d-border);
}

.topbar,
.hero-grid,
main {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 12.5px;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 1px;
  background: var(--bronze-dark);
}

.source-pill,
.panel-label,
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.source-pill {
  padding: 10px 16px;
  border: 1px solid var(--d-border);
  border-radius: 3px;
  color: var(--on-dark-sub);
  background: rgba(20, 20, 20, 0.72);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 48px;
  align-items: end;
  min-height: 390px;
  padding-top: 64px;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero h1 {
  max-width: 740px;
  font-size: clamp(3rem, 7.5vw, 5.9rem);
  line-height: 1.02;
}

.hero-text {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--on-dark-sub);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.status-panel,
.export-panel {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--d-border);
  border-radius: 3px;
  background: var(--d3);
}

.status-panel strong,
.export-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.status-panel span:last-child,
.export-panel {
  color: var(--on-dark-sub);
  line-height: 1.5;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.export-button {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--d-border);
  border-radius: 3px;
  background: var(--d4);
  color: var(--on-dark);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.export-button:hover,
.export-button:focus-visible {
  border-color: var(--bronze);
  background: var(--bronze);
  outline: none;
}

.export-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

main {
  padding: 30px clamp(22px, 4vw, 48px) 72px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: -68px;
  border: 1px solid var(--l-border);
  background: var(--l-border);
}

.kpi-card,
.product-card,
.low-stock-card {
  border: 1px solid var(--l-border);
  border-radius: 3px;
  background: var(--l0);
  box-shadow: none;
}

.kpi-card {
  display: grid;
  min-height: 150px;
  padding: 22px;
  gap: 8px;
  border: 0;
  border-radius: 0;
}

.kpi-card span,
.product-meta,
.variant-row,
.review-meta,
.empty-state {
  color: var(--on-light-sub);
}

.kpi-card strong {
  align-self: end;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
}

.kpi-card small {
  color: var(--bronze);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-kpi {
  background: var(--l2);
  box-shadow: none;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 32px 0;
}

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

.tab {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--l-border);
  border-radius: 3px;
  background: var(--l0);
  color: var(--on-light-sub);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.tab.is-active {
  border-color: var(--bronze);
  background: var(--bronze);
  color: var(--on-dark);
}

.search-control {
  flex: 0 1 320px;
}

.search-control input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--l-border);
  border-radius: 3px;
  background: var(--l0);
  color: var(--on-light);
  padding: 0 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 32px 0 16px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.section-heading p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--on-light-sub);
  line-height: 1.5;
  text-align: right;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--bronze);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 14px 3px 0;
  background: currentColor;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--l-border);
  background: var(--l-border);
}

.product-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.product-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 2.15rem;
  letter-spacing: 0;
}

.product-total {
  display: grid;
  min-width: 86px;
  text-align: right;
  color: var(--on-light-sub);
}

.product-total strong {
  color: var(--on-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.8rem;
}

.badge-row,
.size-grid,
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.size-chip,
.color-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge {
  background: var(--l2);
  color: var(--bronze);
}

.color-chip {
  border: 1px solid var(--l-border);
  color: var(--on-light-sub);
  background: var(--l0);
}

.color-filter-button {
  cursor: pointer;
  justify-content: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.color-filter-button.is-active {
  border-color: var(--bronze);
  background: var(--bronze);
  color: var(--on-dark);
}

.color-filter-button:hover {
  border-color: rgba(124, 75, 28, 0.42);
  color: var(--on-light);
}

.size-chip {
  background: var(--l2);
  color: var(--on-light);
}

.variant-list {
  display: grid;
  gap: 8px;
}

.variant-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  font-size: 0.88rem;
  padding: 8px 0;
  border-top: 1px solid rgba(33, 24, 15, 0.08);
}

.variant-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.variant-row span {
  color: var(--on-light-sub);
  line-height: 1.45;
}

.variant-row strong {
  color: var(--on-light);
  font-weight: 700;
}

.variant-details {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.variant-details summary {
  list-style: none;
  cursor: pointer;
  color: var(--bronze);
  font-size: 0.82rem;
  font-weight: 700;
}

.variant-details summary::-webkit-details-marker {
  display: none;
}

.variant-details summary::after {
  content: "+";
  margin-left: 8px;
}

.variant-details[open] summary::after {
  content: "-";
}

.variant-details-list {
  display: grid;
  gap: 0;
}

.low-stock-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  box-shadow: none;
  border-color: rgba(124, 75, 28, 0.28);
  background: var(--l0);
}

.alert-list,
.review-list {
  display: grid;
  gap: 10px;
}

.low-stock-card strong {
  color: var(--bronze);
}

.stock-count {
  min-width: 54px;
  text-align: right;
  font-weight: 700;
  color: var(--bronze);
}

.review-section {
  margin-top: 40px;
  padding-top: 10px;
  border-top: 1px solid var(--l-border);
}

.review-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.review-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--l-border);
  border-radius: 3px;
  background: var(--l2);
}

.review-item strong {
  font-size: 0.98rem;
}

.review-meta {
  font-size: 0.86rem;
  line-height: 1.5;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--l-border);
  border-radius: 3px;
  background: var(--l2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .hero-grid,
  .kpi-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

  .hero-side {
    grid-column: 1 / -1;
  }

  .controls,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading p:last-child {
    max-width: none;
    text-align: left;
  }

  .search-control {
    flex-basis: auto;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-grid {
    min-height: 0;
    padding-top: 42px;
  }

  .kpi-grid {
    margin-top: -34px;
  }

  .product-head,
  .low-stock-card {
    grid-template-columns: 1fr;
  }

  .product-head {
    display: grid;
  }

  .product-total,
  .stock-count {
    text-align: left;
  }

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